SetToolTrapAddress

This commit is contained in:
Kelvin Sherlock 2013-08-04 14:34:34 -04:00
parent bd3e540b89
commit 061c025e02
3 changed files with 32 additions and 0 deletions

View File

@ -1109,6 +1109,32 @@ namespace OS
return MacOS::dsCoreErr;
}
uint16_t SetToolTrapAddress(uint16_t trap)
{
//pascal void SetToolTrapAddress(long trapAddr, short trapNum);
/*
* on entry:
* A0 Address of patch
* D0 trap number
*
* on exit:
*
*/
// this is used by the far model stub, presumably
// to replace LoadSeg.
uint16_t trapNumber = cpuGetDReg(0);
uint32_t trapAddress = cpuGetAReg(0);
Log("%04x SetToolTrapAddress($%08x, $%04x)\n",
trap, trapAddress, trapNumber);
return MacOS::dsCoreErr;
}
uint16_t GetOSTrapAddress(uint16_t trap)
{
/*

View File

@ -81,6 +81,8 @@ namespace OS
#pragma mark - Trap Manager
uint16_t GetToolTrapAddress(uint16_t trap);
uint16_t SetToolTrapAddress(uint16_t trap);
uint16_t GetOSTrapAddress(uint16_t trap);
#pragma mark - Alias Manager

View File

@ -148,6 +148,10 @@ namespace ToolBox {
d0 = OS::GetToolTrapAddress(trap);
break;
case 0xa647:
d0 = OS::SetToolTrapAddress(trap);
break;
case 0xA346:
d0 = OS::GetOSTrapAddress(trap);
break;