diff --git a/CHANGELOG.text b/CHANGELOG.text index bc6b36e..da63b99 100644 --- a/CHANGELOG.text +++ b/CHANGELOG.text @@ -7,7 +7,7 @@ - SCpp works, MrC and MrCpp does not currently work * DumpCode utility now supported -- added HGetState, GetResInfo, LoadResource toolbox calls +- added HGetState, GetResInfo, LoadResource, Count1Types, Get1IndType toolbox calls * Pathname conversion enhancements: diff --git a/toolbox/rm.cpp b/toolbox/rm.cpp index e336496..715d312 100644 --- a/toolbox/rm.cpp +++ b/toolbox/rm.cpp @@ -964,4 +964,39 @@ namespace RM return SetResError(::ResError()); } + uint16_t Count1Types(uint16_t trap) + { + // FUNCTION Count1Types: Integer; + + uint16_t count; + + Log("%04x Count1Types\n", trap); + + count = ::Count1Types(); + + ToolReturn<2>(-1, count); + + return SetResError(::ResError()); + } + + + uint16_t Get1IndType(uint16_t trap) + { + // PROCEDURE Get1IndType (VAR theType: ResType; index: Integer); + + uint32_t theType; + uint16_t index; + + StackFrame<6>(theType, index); + + Log("%04x Get1IndType(%08x, %04x)\n", trap, theType, index); + + ResType nativeType = 0; + + ::Get1IndType(&nativeType, index); + + memoryWriteLong(nativeType, theType); + + return SetResError(::ResError()); + } } diff --git a/toolbox/rm.h b/toolbox/rm.h index 6bc62f9..be4ddd0 100644 --- a/toolbox/rm.h +++ b/toolbox/rm.h @@ -52,6 +52,8 @@ namespace RM uint16_t LoadResource(uint16_t trap); uint16_t HomeResFile(uint16_t trap); + uint16_t Count1Types(uint16_t trap); + uint16_t Get1IndType(uint16_t trap); } diff --git a/toolbox/toolbox.cpp b/toolbox/toolbox.cpp index 56e719a..d06b595 100644 --- a/toolbox/toolbox.cpp +++ b/toolbox/toolbox.cpp @@ -324,6 +324,14 @@ namespace ToolBox { d0 = RM::Get1IndResource(trap); break; + case 0xa80f: + d0 = RM::Get1IndType(trap); + break; + + case 0xa81c: + d0 = RM::Count1Types(trap); + break; + // Get1Resource (theType: ResType; thelD: INTEGER) : Handle; case 0xa81f: d0 = RM::Get1Resource(trap);