RM::HomeResFile

This commit is contained in:
Kelvin Sherlock 2013-08-18 00:51:31 -04:00
parent 60683d14ea
commit b61d082497
4 changed files with 37 additions and 0 deletions

View File

@ -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

View File

@ -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());
}
}

View File

@ -50,6 +50,9 @@ namespace RM
uint16_t GetResInfo(uint16_t trap);
uint16_t LoadResource(uint16_t trap);
uint16_t HomeResFile(uint16_t trap);
}

View File

@ -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;