mirror of
https://github.com/garrettsworkshop/MacIIROMDiskDriver.git
synced 2024-11-25 09:30:46 +00:00
change patch24 args
This commit is contained in:
parent
355890836b
commit
2cefcb0657
Binary file not shown.
BIN
bin/rom8M.bin
BIN
bin/rom8M.bin
Binary file not shown.
12
rdisk.c
12
rdisk.c
@ -53,12 +53,12 @@ void C24(Ptr sourcePtr, Ptr destPtr, unsigned long byteCount) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Switch to 32-bit mode and patch
|
// Switch to 32-bit mode and patch
|
||||||
typedef void (*RDiskPatch_t)(Ptr, long, char);
|
typedef void (*RDiskPatch_t)(Ptr, char);
|
||||||
void __attribute__ ((noinline)) P24(Ptr ramdisk, long index, char patch) {
|
#pragma parameter P24(__A0, __D0)
|
||||||
if (index < 0) { return; } // Don't patch if index < 0
|
void __attribute__ ((noinline)) P24(Ptr ptr, char patch) {
|
||||||
signed char mode = true32b;
|
signed char mode = true32b;
|
||||||
SwapMMUMode(&mode);
|
SwapMMUMode(&mode);
|
||||||
ramdisk[index] = patch; // Patch byte
|
*ptr = patch; // Patch byte
|
||||||
SwapMMUMode(&mode);
|
SwapMMUMode(&mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,8 +166,8 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) {
|
|||||||
// Patch debug and CD-ROM enable bytes
|
// Patch debug and CD-ROM enable bytes
|
||||||
if (c->ramdisk) {
|
if (c->ramdisk) {
|
||||||
RDiskPatch_t fun = P24;
|
RDiskPatch_t fun = P24;
|
||||||
if (!dbgEN) { fun(c->ramdisk, 0x00000031UL, *RDiskDBGDisByte); }
|
if (!dbgEN /*&& *RDiskDBGDisPos >= 0*/) { fun(c->ramdisk + 0x00000031UL, *RDiskDBGDisByte); }
|
||||||
if (!cdrEN) { fun(c->ramdisk, 0x00012CAFUL, 0x44); }
|
if (!cdrEN /*&& *RDiskCDRDisPos >= 0*/) { fun(c->ramdisk + 0x00012CAFUL, *RDiskCDRDisByte); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unmount if not booting from ROM disk
|
// Unmount if not booting from ROM disk
|
||||||
|
Loading…
Reference in New Issue
Block a user