HFS Dispatch (in design)

This commit is contained in:
Kelvin Sherlock 2013-03-02 17:39:54 -05:00
parent 673fc4f492
commit 1871f85e7b
4 changed files with 75 additions and 1 deletions

View File

@ -10,6 +10,7 @@ set(TOOLBOX_SRC
mm.cpp
os.cpp
os_internal.cpp
os_hfs_dispatch.cpp
os_highlevel.cpp
qd.cpp
sane.cpp

View File

@ -150,6 +150,7 @@ namespace OS
uint16_t TickCount(uint16_t trap);
uint16_t HFSDispatch(uint16_t trap);
uint16_t HighLevelHFSDispatch(uint16_t trap);
}

View File

@ -0,0 +1,62 @@
#include <cerrno>
#include <cctype>
#include <ctime>
#include <algorithm>
#include <chrono>
#include <deque>
#include <string>
#include <sys/xattr.h>
#include <sys/stat.h>
#include <sys/paths.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <strings.h>
#include <cpu/defs.h>
#include <cpu/CpuModule.h>
#include <cpu/fmem.h>
#include "os.h"
#include "os_internal.h"
#include "toolbox.h"
#include "stackframe.h"
using ToolBox::Log;
using namespace ToolBox::Errors;
namespace OS {
uint16_t PBGetCatInfo(uint32_t paramBlock)
{
return 0;
}
uint16_t HFSDispatch(uint16_t trap)
{
uint32_t selector = cpuGetDReg(0);
uint32_t paramBlock = cpuGetAReg(0);
Log("%04x HFSDispatch(%08x, %08x)\n", trap, selector, paramBlock);
switch (selector)
{
case 0x0009:
//return PBGetCatInfo(paramBlock);
//break;
default:
fprintf(stderr, "HFSDispatch: selector %08x not implemented\n",
selector);
exit(1);
}
return 0;
}
}

View File

@ -65,7 +65,10 @@ namespace ToolBox {
d0 = OS::GetVol(trap);
break;
case 0xa260:
d0 = OS::HFSDispatch(trap);
break;
case 0xaa52:
d0 = OS::HighLevelHFSDispatch(trap);
break;
@ -256,6 +259,13 @@ namespace ToolBox {
exit(255);
}
if (d0)
{
int16_t v = (int16_t)d0;
Log(" -> %d\n", v);
}
cpuSetDReg(0, d0);
cpuSetFlagsNZ00NewW(d0);
}