mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-22 00:32:44 +00:00
GetNamedResource trap
This commit is contained in:
parent
7c928c8eb5
commit
792e21d0c1
@ -260,7 +260,32 @@ namespace RM
|
||||
return SetResError(d0);
|
||||
}
|
||||
|
||||
uint16_t GetNamedResource(uint16_t trap)
|
||||
{
|
||||
// FUNCTION GetNamedResource (theType: ResType; name: Str255): Handle;
|
||||
|
||||
uint32_t sp;
|
||||
uint32_t theType;
|
||||
uint32_t name;
|
||||
|
||||
sp = StackFrame<8>(theType, name);
|
||||
|
||||
std::string sname = ToolBox::ReadPString(name);
|
||||
|
||||
Log("%04x GetNamedResource(%08x ('%s'), %s)\n",
|
||||
trap, theType, TypeToString(theType).c_str(), sname.c_str());
|
||||
|
||||
uint32_t resourceHandle;
|
||||
uint32_t d0;
|
||||
d0 = Native::LoadResource(theType, resourceHandle,
|
||||
[theType, name](){
|
||||
return ::GetNamedResource(theType, memoryPointer(name));
|
||||
}
|
||||
);
|
||||
|
||||
ToolReturn<4>(sp, resourceHandle);
|
||||
return SetResError(d0);
|
||||
}
|
||||
|
||||
uint16_t GetResource(uint16_t trap)
|
||||
{
|
||||
|
@ -490,6 +490,10 @@ namespace ToolBox {
|
||||
d0 = RM::GetResource(trap);
|
||||
break;
|
||||
|
||||
case 0xa9a1:
|
||||
d0 = RM::GetNamedResource(trap);
|
||||
break;
|
||||
|
||||
case 0xa9a2:
|
||||
d0 = RM::LoadResource(trap);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user