mirror of
https://github.com/garrettsworkshop/MacIIROMDiskDriver.git
synced 2024-11-21 12:30:49 +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
|
||||
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
|
||||
typedef void (*RDiskPatch_t)(Ptr, char);
|
||||
#pragma parameter P24(__A0, __D0)
|
||||
void __attribute__ ((noinline)) P24(Ptr ptr, char patch) {
|
||||
signed char mode = true32b;
|
||||
SwapMMUMode(&mode);
|
||||
ramdisk[index] = patch; // Patch byte
|
||||
*ptr = patch; // Patch byte
|
||||
SwapMMUMode(&mode);
|
||||
}
|
||||
|
||||
@ -166,8 +166,8 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) {
|
||||
// Patch debug and CD-ROM enable bytes
|
||||
if (c->ramdisk) {
|
||||
RDiskPatch_t fun = P24;
|
||||
if (!dbgEN) { fun(c->ramdisk, 0x00000031UL, *RDiskDBGDisByte); }
|
||||
if (!cdrEN) { fun(c->ramdisk, 0x00012CAFUL, 0x44); }
|
||||
if (!dbgEN /*&& *RDiskDBGDisPos >= 0*/) { fun(c->ramdisk + 0x00000031UL, *RDiskDBGDisByte); }
|
||||
if (!cdrEN /*&& *RDiskCDRDisPos >= 0*/) { fun(c->ramdisk + 0x00012CAFUL, *RDiskCDRDisByte); }
|
||||
}
|
||||
|
||||
// Unmount if not booting from ROM disk
|
||||
|
Loading…
Reference in New Issue
Block a user