mirror of
https://github.com/ksherlock/mpw.git
synced 2024-06-08 02:29:36 +00:00
SetOSTrap stub (Link patches _MaxBlock to return _MaxBlock - 2 before calling SetResLoad for some reason)
This commit is contained in:
parent
67cb2b6e09
commit
d48f3c39da
|
@ -1026,6 +1026,31 @@ namespace OS
|
||||||
return MacOS::dsCoreErr;
|
return MacOS::dsCoreErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t SetOSTrapAddress(uint16_t trap)
|
||||||
|
{
|
||||||
|
//pascal void SetOSTrapAddress(long trapAddr, short trapNum);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* on entry:
|
||||||
|
* A0 Address of patch
|
||||||
|
* D0 trap number
|
||||||
|
*
|
||||||
|
* on exit:
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint16_t trapNumber = cpuGetDReg(0);
|
||||||
|
uint32_t trapAddress = cpuGetAReg(0);
|
||||||
|
const char *trapName = TrapName(trapNumber | 0xa000);
|
||||||
|
if (!trapName) trapName = "Unknown";
|
||||||
|
|
||||||
|
Log("%04x SetOSTrapAddress($%08x, $%04x %s)\n",
|
||||||
|
trap, trapAddress, trapNumber, trapName);
|
||||||
|
|
||||||
|
|
||||||
|
return MacOS::dsCoreErr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#pragma mark XP - RAM
|
#pragma mark XP - RAM
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,7 @@ namespace OS
|
||||||
uint16_t SetToolTrapAddress(uint16_t trap);
|
uint16_t SetToolTrapAddress(uint16_t trap);
|
||||||
|
|
||||||
uint16_t GetOSTrapAddress(uint16_t trap);
|
uint16_t GetOSTrapAddress(uint16_t trap);
|
||||||
|
uint16_t SetOSTrapAddress(uint16_t trap);
|
||||||
|
|
||||||
#pragma mark - Alias Manager
|
#pragma mark - Alias Manager
|
||||||
|
|
||||||
|
|
|
@ -222,6 +222,10 @@ namespace ToolBox {
|
||||||
d0 = OS::GetOSTrapAddress(trap);
|
d0 = OS::GetOSTrapAddress(trap);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0xa247:
|
||||||
|
d0 = OS::SetOSTrapAddress(trap);
|
||||||
|
break;
|
||||||
|
|
||||||
case 0xA823:
|
case 0xA823:
|
||||||
d0 = OS::AliasDispatch(trap);
|
d0 = OS::AliasDispatch(trap);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user