change patch24 args

This commit is contained in:
Zane Kaminski 2021-04-02 01:01:32 -04:00
parent 355890836b
commit 2cefcb0657
3 changed files with 6 additions and 6 deletions

Binary file not shown.

Binary file not shown.

12
rdisk.c
View File

@ -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