mirror of
https://github.com/ksherlock/mpw.git
synced 2025-01-03 04:30:32 +00:00
HSetState toolcall
This commit is contained in:
parent
ac66233f40
commit
6449892f51
@ -1180,7 +1180,36 @@ namespace MM
|
||||
return flags;
|
||||
}
|
||||
|
||||
uint16_t HSetState(uint16_t trap)
|
||||
{
|
||||
/*
|
||||
* on entry:
|
||||
* A0 Handle
|
||||
* D0 flags
|
||||
*
|
||||
* on exit:
|
||||
* D0 flag byte
|
||||
*
|
||||
*/
|
||||
|
||||
uint32_t hh = cpuGetAReg(0);
|
||||
uint16_t flags = cpuGetDReg(0);
|
||||
|
||||
Log("%04x HSetState(%08x, %04x)\n", trap, hh, flags);
|
||||
|
||||
auto iter = HandleMap.find(hh);
|
||||
|
||||
if (iter == HandleMap.end()) return SetMemError(MacOS::memWZErr);
|
||||
|
||||
auto &info = iter->second;
|
||||
|
||||
info.resource = (flags & (1 << 5));
|
||||
info.purgeable = (flags & (1 << 6));
|
||||
info.locked = (flags & (1 << 7));
|
||||
|
||||
|
||||
return SetMemError(0);
|
||||
}
|
||||
|
||||
uint16_t HPurge(uint16_t trap)
|
||||
{
|
||||
|
@ -62,6 +62,7 @@ namespace MM
|
||||
uint32_t RecoverHandle(uint16_t);
|
||||
|
||||
uint16_t HGetState(uint16_t trap);
|
||||
uint16_t HSetState(uint16_t trap);
|
||||
|
||||
uint16_t HLock(uint16_t trap);
|
||||
uint16_t HUnlock(uint16_t trap);
|
||||
|
@ -277,6 +277,11 @@ namespace ToolBox {
|
||||
d0 = MM::HGetState(trap);
|
||||
break;
|
||||
|
||||
case 0xa06a:
|
||||
d0 = MM::HSetState(trap);
|
||||
break;
|
||||
|
||||
|
||||
// MoveHHi (h: Handle);
|
||||
case 0xa064:
|
||||
d0 = MM::MoveHHi(trap);
|
||||
|
Loading…
Reference in New Issue
Block a user