From db9fa7aa2368a85d46a111190dfca47358139131 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 2 Mar 2013 20:54:43 -0500 Subject: [PATCH] OpenRF --- toolbox/os.cpp | 19 ++++++++++++++++++- toolbox/toolbox.cpp | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/toolbox/os.cpp b/toolbox/os.cpp index c047f39..62ef056 100644 --- a/toolbox/os.cpp +++ b/toolbox/os.cpp @@ -283,13 +283,25 @@ namespace OS return d0; } + uint16_t Open(uint16_t trap) { uint32_t d0; uint32_t parm = cpuGetAReg(0); - Log("%04x Open(%08x)\n", trap, parm); + bool rf = trap == 0xa00a; + + switch(trap) + { + case 0xa000: + Log("%04x Open(%08x)\n", trap, parm); + break; + case 0xa00a: + Log("%04x OpenRF(%08x)\n", trap, parm); + break; + } + //uint32_t ioCompletion = memoryReadLong(parm + 12); uint32_t namePtr = memoryReadLong(parm + 18); @@ -331,6 +343,11 @@ namespace OS //todo -- FD table w/ flag for text/binary + std::string xname = sname; + if (rf) + sname.append(_PATH_RSRCFORKSPEC); + + int fd = ::open(sname.c_str(), access); if (fd < 0 && ioPermission == fsCurPerm && errno == EACCES) { diff --git a/toolbox/toolbox.cpp b/toolbox/toolbox.cpp index dcd9c70..6066d95 100644 --- a/toolbox/toolbox.cpp +++ b/toolbox/toolbox.cpp @@ -30,7 +30,8 @@ namespace ToolBox { uint32_t d0 = 0; switch (trap) { - case 0xa000: + case 0xa000: // open + case 0xa00a: // openrf d0 = OS::Open(trap); break;