mirror of
https://github.com/garrettsworkshop/MacIIROMDiskDriver.git
synced 2025-03-13 20:29:40 +00:00
Fix for when debugger/CD-ROM are disabled
This commit is contained in:
parent
db196fc221
commit
3d1667f549
14
Makefile
14
Makefile
@ -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.
BIN
bin/driver.bin
BIN
bin/driver.bin
Binary file not shown.
2
entry.s
2
entry.s
@ -14,7 +14,7 @@ RDiskSig:
|
||||
RDiskDBGDisPos:
|
||||
dc.l 0x00000031
|
||||
RDiskCDRDisPos:
|
||||
dc.l 0xFFFFFFFF
|
||||
dc.l 0x00000000
|
||||
RDiskDBGNameAddr:
|
||||
dc.l 0x4088002A
|
||||
RDiskCDRNameAddr:
|
||||
|
8
rdisk.c
8
rdisk.c
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user