mirror of
https://github.com/garrettsworkshop/MacIIROMDiskDriver.git
synced 2024-11-22 03:30:58 +00:00
Refactor settings load again
This commit is contained in:
parent
bbf5601b3e
commit
acf71fcd80
Binary file not shown.
BIN
bin/rom8M.bin
BIN
bin/rom8M.bin
Binary file not shown.
28
rdisk.c
28
rdisk.c
@ -149,11 +149,6 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) {
|
|||||||
c->initialized = 1;
|
c->initialized = 1;
|
||||||
// Decode settings
|
// Decode settings
|
||||||
RDDecodeSettings(&unmountEN, &mountEN, &ramEN, &dbgEN, &cdrEN);
|
RDDecodeSettings(&unmountEN, &mountEN, &ramEN, &dbgEN, &cdrEN);
|
||||||
// Set debug and CD-ROM disable stuff in storage struct
|
|
||||||
peek24L((long*)0x40851D98, c->dbgDisPos);
|
|
||||||
peek24L((long*)0x40851D9C, c->cdrDisPos);
|
|
||||||
peek24(dbgEN ? RDiskBuf + c->dbgDisPos : (char*)0x40851DA8, c->dbgDisByte);
|
|
||||||
peek24(cdrEN ? RDiskBuf + c->cdrDisPos : (char*)0x40851DA9, c->cdrDisByte);
|
|
||||||
|
|
||||||
// If RAM disk enabled, try to allocate RAM disk buffer if not already
|
// If RAM disk enabled, try to allocate RAM disk buffer if not already
|
||||||
if (ramEN & !c->ramdisk) {
|
if (ramEN & !c->ramdisk) {
|
||||||
@ -186,12 +181,23 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply patches to RAM disk
|
// Get debug and CD-ROM disable settings from ROM table
|
||||||
if (c->ramdisk) {
|
peek24L((long*)0x40851D98, c->dbgDisPos);
|
||||||
// Patch debugger enable byte
|
peek24L((long*)0x40851D9C, c->cdrDisPos);
|
||||||
poke24(c->ramdisk + c->dbgDisPos, c->dbgDisByte);
|
// Patch
|
||||||
// Patch CD-R enable byte
|
if (c->dbgDisPos < RDiskSize) {
|
||||||
poke24(c->ramdisk + c->cdrDisPos, c->cdrDisByte);
|
if (c->ramdisk) { poke24(c->ramdisk + c->dbgDisPos, c->dbgDisByte); }
|
||||||
|
else { peek24(dbgEN ?
|
||||||
|
RDiskBuf + c->dbgDisPos :
|
||||||
|
(char*)0x40851DA8, c->dbgDisByte);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (c->dbgDisPos < RDiskSize) {
|
||||||
|
if (c->ramdisk) { poke24(c->ramdisk + c->cdrDisPos, c->cdrDisByte); }
|
||||||
|
else { peek24(cdrEN ?
|
||||||
|
RDiskBuf + c->cdrDisPos :
|
||||||
|
(char*)0x40851DA9, c->cdrDisByte);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unmount if not booting from ROM disk
|
// Unmount if not booting from ROM disk
|
||||||
|
Loading…
Reference in New Issue
Block a user