From 84598e0ac7ed9fec59468e2bbd567e480039f294 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Wed, 27 Mar 2013 23:54:08 -0400 Subject: [PATCH] _FSDispatch OpenDF (for Apple's Mac C compiler) --- toolbox/os_hfs_dispatch.cpp | 16 +++++++++++++++- toolbox/toolbox.cpp | 7 ++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/toolbox/os_hfs_dispatch.cpp b/toolbox/os_hfs_dispatch.cpp index 5bc4e3b..b731918 100644 --- a/toolbox/os_hfs_dispatch.cpp +++ b/toolbox/os_hfs_dispatch.cpp @@ -35,9 +35,19 @@ namespace OS { return 0; } + uint16_t PBOpenDF(uint32_t paramBlock) + { + Log(" PBOpenDF\n"); + // same as Open but slightly different handling of . files. + return OS::Open(0xa000); + } + uint16_t HFSDispatch(uint16_t trap) { + // TODO -- check new hfs bit ( (trap & 0x0200) == 0x0200) + // TODO -- check async bit ((trap & 0x0400) == 0x0400) + uint32_t selector = cpuGetDReg(0); uint32_t paramBlock = cpuGetAReg(0); @@ -45,10 +55,14 @@ namespace OS { switch (selector) { - case 0x0009: + //case 0x0009: //return PBGetCatInfo(paramBlock); //break; + case 0x1a: + return PBOpenDF(paramBlock); + break; + default: fprintf(stderr, "HFSDispatch: selector %08x not implemented\n", selector); diff --git a/toolbox/toolbox.cpp b/toolbox/toolbox.cpp index e9d6db1..671ba09 100644 --- a/toolbox/toolbox.cpp +++ b/toolbox/toolbox.cpp @@ -80,9 +80,10 @@ namespace ToolBox { d0 = OS::SetFPos(trap); break; - //case 0xa260: - // d0 = OS::HFSDispatch(trap); - // break; + case 0xa060: + // also a260 for async + d0 = OS::HFSDispatch(trap); + break; case 0xaa52: d0 = OS::HighLevelHFSDispatch(trap);