mirror of
https://github.com/garrettsworkshop/MacIIROMDiskDriver.git
synced 2024-12-27 03:32:24 +00:00
Don't inline patch function...
This commit is contained in:
parent
34f4cae528
commit
a65c7b8707
Binary file not shown.
BIN
bin/rom8M.bin
BIN
bin/rom8M.bin
Binary file not shown.
21
rdisk.c
21
rdisk.c
@ -53,7 +53,8 @@ void C24(Ptr sourcePtr, Ptr destPtr, unsigned long byteCount) {
|
||||
}
|
||||
|
||||
// Switch to 32-bit mode and patch
|
||||
void P24(Ptr ramdisk, long index, char patch) {
|
||||
typedef void (*RDiskPatch_t)(Ptr, long, char);
|
||||
void __attribute__ ((noinline)) P24(Ptr ramdisk, long index, char patch) {
|
||||
if (index < 0) { return; } // Don't patch if index < 0
|
||||
signed char mode = true32b;
|
||||
SwapMMUMode(&mode);
|
||||
@ -61,13 +62,6 @@ void P24(Ptr ramdisk, long index, char patch) {
|
||||
SwapMMUMode(&mode);
|
||||
}
|
||||
|
||||
typedef void (*RDiskPatch_t)(Ptr, long, char);
|
||||
static void patch24(Ptr ramdisk, char dbgEN, char cdrEN) {
|
||||
RDiskPatch_t fun = P24;
|
||||
if (!dbgEN) { fun(ramdisk, 0x00000031UL, 0x44); }
|
||||
if (!cdrEN) { fun(ramdisk, 0x00012CAFUL, 0x44); }
|
||||
}
|
||||
|
||||
// Figure out the first available drive number >= 5
|
||||
static int RDFindDrvNum() {
|
||||
DrvQElPtr dq;
|
||||
@ -154,8 +148,6 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) {
|
||||
BlockMove(RDiskBuf, c->ramdisk, RDiskSize);
|
||||
// Clearing write protect marks RAM disk enabled
|
||||
c->status.writeProt = 0;
|
||||
// Patch debug and CD-ROM enable bytes
|
||||
patch24(c->ramdisk, dbgEN, cdrEN);
|
||||
}
|
||||
} else { // 24-bit mode
|
||||
// Put RAM disk just past 8MB
|
||||
@ -168,11 +160,16 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) {
|
||||
copy24(RDiskBuf, c->ramdisk, RDiskSize);
|
||||
// Clearing write protect marks RAM disk enabled
|
||||
c->status.writeProt = 0;
|
||||
// Patch debug and CD-ROM enable bytes
|
||||
patch24(c->ramdisk, dbgEN, cdrEN);
|
||||
}
|
||||
}
|
||||
|
||||
// Patch debug and CD-ROM enable bytes
|
||||
if (c->ramdisk) {
|
||||
RDiskPatch_t fun = P24;
|
||||
if (!dbgEN) { fun(c->ramdisk, 0x00000031UL, 0x44); }
|
||||
if (!cdrEN) { fun(c->ramdisk, 0x00012CAFUL, 0x44); }
|
||||
}
|
||||
|
||||
// Unmount if not booting from ROM disk
|
||||
if (unmountEN) { c->status.diskInPlace = 0; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user