mirror of
https://github.com/ksherlock/mpw.git
synced 2024-12-22 00:29:18 +00:00
RM::HomeResFile
This commit is contained in:
parent
60683d14ea
commit
b61d082497
@ -1,3 +1,6 @@
|
||||
* PPCAsm utility now supported
|
||||
- added HomeResFile toolbox call.
|
||||
|
||||
* CODE loader enhancements
|
||||
- Cleaned up CODE loader.
|
||||
- Added experimental support for far model segments
|
||||
|
@ -937,4 +937,31 @@ namespace RM
|
||||
}
|
||||
|
||||
|
||||
uint16_t HomeResFile(uint16_t trap)
|
||||
{
|
||||
// PPCAsm
|
||||
|
||||
// FUNCTION HomeResFile (theResource: Handle): Integer;
|
||||
|
||||
uint32_t sp;
|
||||
uint32_t theResource;
|
||||
uint16_t resFile;
|
||||
|
||||
sp = StackFrame<4>(theResource);
|
||||
Log("%04x HomeResFile(%08x)\n", trap, theResource);
|
||||
|
||||
|
||||
auto iter = rhandle_map.find(theResource);
|
||||
if (iter == rhandle_map.end())
|
||||
{
|
||||
return SetResError(MacOS::resNotFound);
|
||||
}
|
||||
|
||||
resFile = ::HomeResFile(iter->second);
|
||||
|
||||
ToolReturn<2>(sp, resFile);
|
||||
|
||||
return SetResError(::ResError());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -50,6 +50,9 @@ namespace RM
|
||||
|
||||
uint16_t GetResInfo(uint16_t trap);
|
||||
uint16_t LoadResource(uint16_t trap);
|
||||
|
||||
uint16_t HomeResFile(uint16_t trap);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -377,6 +377,10 @@ namespace ToolBox {
|
||||
d0 = RM::ReleaseResource(trap);
|
||||
break;
|
||||
|
||||
case 0xa9a4:
|
||||
d0 = RM::HomeResFile(trap);
|
||||
break;
|
||||
|
||||
case 0xa9a5:
|
||||
d0 = RM::GetResourceSizeOnDisk(trap);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user