RM::Count1Types, RM::Get1IndType

This commit is contained in:
Kelvin Sherlock 2013-08-18 01:10:14 -04:00
parent b61d082497
commit 0d24388f98
4 changed files with 46 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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