Fix disk image patch bugs

This commit is contained in:
Zane Kaminski 2021-04-03 09:21:59 -04:00
parent 56f233917c
commit d642756985
3 changed files with 15 additions and 13 deletions

Binary file not shown.

Binary file not shown.

28
rdisk.c
View File

@ -182,21 +182,23 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) {
} }
// Get debug and CD-ROM disable settings from ROM table // Get debug and CD-ROM disable settings from ROM table
peek24L((long*)0x40851D98, c->dbgDisPos); c->dbgDisPos = *(long*)0x40851D98;
peek24L((long*)0x40851D9C, c->cdrDisPos); c->cdrDisPos = *(long*)0x40851D9C;
c->dbgDisByte = *(char*)0x40851DA8;
c->cdrDisByte = *(char*)0x40851DA9;
// Patch // Patch
if (c->dbgDisPos < RDiskSize) { if (c->dbgDisPos < RDiskSize) {
if (c->ramdisk && !dbgEN) { poke24(c->ramdisk + c->dbgDisPos, c->dbgDisByte); } if (c->ramdisk && !dbgEN) {
else { peek24(dbgEN ? poke24(c->ramdisk + c->dbgDisPos, c->dbgDisByte);
RDiskBuf + c->dbgDisPos : } else if (dbgEN) {
(char*)0x40851DA8, c->dbgDisByte); peek24(RDiskBuf + c->dbgDisPos, c->dbgDisByte);
} }
} }
if (c->dbgDisPos < RDiskSize) { if (c->cdrDisPos < RDiskSize) {
if (c->ramdisk && !cdrEN) { poke24(c->ramdisk + c->cdrDisPos, c->cdrDisByte); } if (c->ramdisk && !cdrEN) {
else { peek24(cdrEN ? poke24(c->ramdisk + c->cdrDisPos, c->cdrDisByte);
RDiskBuf + c->cdrDisPos : } else if (cdrEN) {
(char*)0x40851DA9, c->cdrDisByte); peek24(RDiskBuf + c->cdrDisPos, c->cdrDisByte);
} }
} }
@ -277,8 +279,8 @@ OSErr RDCtl(CntrlParamPtr p, DCtlPtr d) {
!c->ramdisk) { return controlErr; } !c->ramdisk) { return controlErr; }
long long z = 0; long long z = 0;
Ptr pz; Ptr pz;
if (*MMU32bit) { p = (Ptr)&z; } if (*MMU32bit) { pz = (Ptr)&z; }
else { StripAddress((Ptr)&z); } else { pz = StripAddress((Ptr)&z); }
for (int i = 0; i < 4095; i++) { for (int i = 0; i < 4095; i++) {
copy24(c->ramdisk + i * sizeof(z), pz, sizeof(z)); copy24(c->ramdisk + i * sizeof(z), pz, sizeof(z));
} }