diff --git a/CHANGELOG.text b/CHANGELOG.text index 8e0468d..bc6b36e 100644 --- a/CHANGELOG.text +++ b/CHANGELOG.text @@ -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 diff --git a/toolbox/rm.cpp b/toolbox/rm.cpp index 4af6b94..e336496 100644 --- a/toolbox/rm.cpp +++ b/toolbox/rm.cpp @@ -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()); + } + } diff --git a/toolbox/rm.h b/toolbox/rm.h index 34ec1cd..6bc62f9 100644 --- a/toolbox/rm.h +++ b/toolbox/rm.h @@ -50,6 +50,9 @@ namespace RM uint16_t GetResInfo(uint16_t trap); uint16_t LoadResource(uint16_t trap); + + uint16_t HomeResFile(uint16_t trap); + } diff --git a/toolbox/toolbox.cpp b/toolbox/toolbox.cpp index e80c3f8..56e719a 100644 --- a/toolbox/toolbox.cpp +++ b/toolbox/toolbox.cpp @@ -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;