mirror of
https://github.com/garrettsworkshop/MacIIROMDiskDriver.git
synced 2025-01-14 17:30:54 +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
|
// 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
|
if (index < 0) { return; } // Don't patch if index < 0
|
||||||
signed char mode = true32b;
|
signed char mode = true32b;
|
||||||
SwapMMUMode(&mode);
|
SwapMMUMode(&mode);
|
||||||
@ -61,13 +62,6 @@ void P24(Ptr ramdisk, long index, char patch) {
|
|||||||
SwapMMUMode(&mode);
|
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
|
// Figure out the first available drive number >= 5
|
||||||
static int RDFindDrvNum() {
|
static int RDFindDrvNum() {
|
||||||
DrvQElPtr dq;
|
DrvQElPtr dq;
|
||||||
@ -154,8 +148,6 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) {
|
|||||||
BlockMove(RDiskBuf, c->ramdisk, RDiskSize);
|
BlockMove(RDiskBuf, c->ramdisk, RDiskSize);
|
||||||
// Clearing write protect marks RAM disk enabled
|
// Clearing write protect marks RAM disk enabled
|
||||||
c->status.writeProt = 0;
|
c->status.writeProt = 0;
|
||||||
// Patch debug and CD-ROM enable bytes
|
|
||||||
patch24(c->ramdisk, dbgEN, cdrEN);
|
|
||||||
}
|
}
|
||||||
} else { // 24-bit mode
|
} else { // 24-bit mode
|
||||||
// Put RAM disk just past 8MB
|
// 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);
|
copy24(RDiskBuf, c->ramdisk, RDiskSize);
|
||||||
// Clearing write protect marks RAM disk enabled
|
// Clearing write protect marks RAM disk enabled
|
||||||
c->status.writeProt = 0;
|
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
|
// Unmount if not booting from ROM disk
|
||||||
if (unmountEN) { c->status.diskInPlace = 0; }
|
if (unmountEN) { c->status.diskInPlace = 0; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user