mirror of
https://github.com/ksherlock/mpw.git
synced 2024-06-01 02:41:33 +00:00
GetOS/ToolTrapAddress (MPW 3.2 InitEnv)
This commit is contained in:
parent
c6e4867c25
commit
2fb4e67323
|
@ -20,6 +20,7 @@
|
|||
#include <cpu/fmem.h>
|
||||
|
||||
#include <macos/sysequ.h>
|
||||
#include <macos/errors.h>
|
||||
|
||||
#include "os.h"
|
||||
#include "os_internal.h"
|
||||
|
@ -1002,4 +1003,42 @@ namespace OS
|
|||
}
|
||||
|
||||
|
||||
#pragma mark - Trap Manager
|
||||
|
||||
uint16_t GetToolTrapAddress(uint16_t trap)
|
||||
{
|
||||
/*
|
||||
* on entry:
|
||||
* D0 trap number
|
||||
*
|
||||
* on exit:
|
||||
* A0 Address of patch
|
||||
*
|
||||
*/
|
||||
uint16_t trapNumber = cpuGetDReg(0);
|
||||
Log("%04x GetToolTrapAddress($%04x)\n", trap, trapNumber);
|
||||
|
||||
cpuSetAReg(0, 0);
|
||||
return MacOS::dsCoreErr;
|
||||
}
|
||||
|
||||
uint16_t GetOSTrapAddress(uint16_t trap)
|
||||
{
|
||||
/*
|
||||
* on entry:
|
||||
* D0 trap number
|
||||
*
|
||||
* on exit:
|
||||
* A0 Address of patch
|
||||
*
|
||||
*/
|
||||
uint16_t trapNumber = cpuGetDReg(0);
|
||||
Log("%04x GetOSTrapAddress($%04x)\n", trap, trapNumber);
|
||||
|
||||
cpuSetAReg(0, 0);
|
||||
return MacOS::dsCoreErr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -67,6 +67,11 @@ namespace OS
|
|||
|
||||
uint16_t HFSDispatch(uint16_t trap);
|
||||
uint16_t HighLevelHFSDispatch(uint16_t trap);
|
||||
|
||||
#pragma mark - Trap Manager
|
||||
|
||||
uint16_t GetToolTrapAddress(uint16_t trap);
|
||||
uint16_t GetOSTrapAddress(uint16_t trap);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -89,6 +89,16 @@ namespace ToolBox {
|
|||
d0 = OS::HighLevelHFSDispatch(trap);
|
||||
break;
|
||||
|
||||
|
||||
case 0xA746:
|
||||
d0 = OS::GetToolTrapAddress(trap);
|
||||
break;
|
||||
|
||||
case 0xA346:
|
||||
d0 = OS::GetOSTrapAddress(trap);
|
||||
break;
|
||||
|
||||
|
||||
// SetPtrSize (p: Ptr; newSize: Size);
|
||||
case 0xa020:
|
||||
d0 = MM::SetPtrSize(trap);
|
||||
|
|
Loading…
Reference in New Issue
Block a user