Fix for when debugger/CD-ROM are disabled

This commit is contained in:
Zane Kaminski 2024-06-26 06:16:05 -04:00
parent db196fc221
commit 3d1667f549
10 changed files with 16 additions and 8 deletions

View File

@ -85,9 +85,12 @@ bin/GWSys6_4M.bin: bin bin/baserom_romdisk_noramtest.bin disks/RDisk3M5.dsk
# Copy base rom with ROM disk driver
cp bin/baserom_romdisk_noramtest.bin $@
# Patch ROM disk driver parameter table
printf '\xFF\xFF\xFF\xFF' | dd of=$@ bs=1 seek=335260 count=4 conv=notrunc # Patch CDR patch offset
printf '\x00\x00\x00\x00' | dd of=$@ bs=1 seek=335256 count=4 conv=notrunc # Patch MacsBug patch offset
printf '\x00\x00\x00\x00' | dd of=$@ bs=1 seek=335264 count=4 conv=notrunc # Patch MacsBug name address
printf '\x00' | dd of=$@ bs=1 seek=335272 count=1 conv=notrunc # Patch MacsBug disable byte
printf '\x00\x00\x00\x00' | dd of=$@ bs=1 seek=335260 count=4 conv=notrunc # Patch CDR patch offset
printf '\x00\x00\x00\x00' | dd of=$@ bs=1 seek=335268 count=4 conv=notrunc # Patch CDR name address
printf '\x44' | dd of=$@ bs=1 seek=335273 count=1 conv=notrunc # Patch CDR disable byte
printf '\x00' | dd of=$@ bs=1 seek=335273 count=1 conv=notrunc # Patch CDR disable byte
printf '\x00\x38\x00\x00' | dd of=$@ bs=1 seek=335276 count=4 conv=notrunc # Patch ROM disk size
# Copy ROM disk image
dd if=disks/RDisk3M5.dsk of=$@ bs=1024 seek=512 conv=notrunc
@ -101,9 +104,12 @@ bin/GWSys7Diagnostics_8M.bin: bin bin/baserom_romdisk_ramtest.bin disks/RDisk7M5
# Copy base rom with ROM disk driver
cp bin/baserom_romdisk_ramtest.bin $@
# Patch ROM disk driver parameter table
printf '\xFF\xFF\xFF\xFF' | dd of=$@ bs=1 seek=335260 count=4 conv=notrunc # Patch CDR patch offset
printf '\x00\x00\x00\x00' | dd of=$@ bs=1 seek=335256 count=4 conv=notrunc # Patch MacsBug patch offset
printf '\x00\x00\x00\x00' | dd of=$@ bs=1 seek=335264 count=4 conv=notrunc # Patch MacsBug name address
printf '\x00' | dd of=$@ bs=1 seek=335272 count=1 conv=notrunc # Patch MacsBug disable byte
printf '\x00\x00\x00\x00' | dd of=$@ bs=1 seek=335260 count=4 conv=notrunc # Patch CDR patch offset
printf '\x00\x00\x00\x00' | dd of=$@ bs=1 seek=335268 count=4 conv=notrunc # Patch CDR name address
printf '\x44' | dd of=$@ bs=1 seek=335273 count=1 conv=notrunc # Patch CDR disable byte
printf '\x00' | dd of=$@ bs=1 seek=335273 count=1 conv=notrunc # Patch CDR disable byte
printf '\x00\x78\x00\x00' | dd of=$@ bs=1 seek=335276 count=4 conv=notrunc # Patch ROM disk size
# Copy ROM disk image
dd if=disks/RDisk7M5-diagnostics.dsk of=$@ bs=1024 seek=512 conv=notrunc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@ RDiskSig:
RDiskDBGDisPos:
dc.l 0x00000031
RDiskCDRDisPos:
dc.l 0xFFFFFFFF
dc.l 0x00000000
RDiskDBGNameAddr:
dc.l 0x4088002A
RDiskCDRNameAddr:

View File

@ -101,7 +101,7 @@ static void RDUnpatch(unsigned long pos, Ptr patch) {
static void RDPatch(char enable, Ptr patch, Ptr ramdisk, unsigned long pos, char data) {
if (!enable) {
*patch = data;
if (ramdisk) {
if (ramdisk && pos) {
void (*poke)(Ptr, char) = S24;
poke(ramdisk + pos, data);
}
@ -263,11 +263,13 @@ OSErr RDPrime(IOParamPtr p, DCtlPtr d) {
// Read from disk into buffer.
if (*MMU32bit) { BlockMove(disk, p->ioBuffer, p->ioReqCount); }
else { copy24(disk, StripAddress(p->ioBuffer), p->ioReqCount); }
if (!c->ramdisk && RDiskDBGDisPos >= d->dCtlPosition &&
if (!c->ramdisk && RDiskDBGDisPos != 0 &&
RDiskDBGDisPos >= d->dCtlPosition &&
RDiskDBGDisPos < d->dCtlPosition + p->ioReqCount) {
p->ioBuffer[RDiskDBGDisPos - d->dCtlPosition] = c->dbgDisByte;
}
if (!c->ramdisk && RDiskCDRDisPos >= d->dCtlPosition &&
if (!c->ramdisk && RDiskCDRDisPos != 0 &&
RDiskCDRDisPos >= d->dCtlPosition &&
RDiskCDRDisPos < d->dCtlPosition + p->ioReqCount) {
p->ioBuffer[RDiskCDRDisPos - d->dCtlPosition] = c->cdrDisByte;
}