Changed default settings

Now by default CD-ROM extension is disabled and ROM disk is mounted
This commit is contained in:
Zane Kaminski 2021-06-27 19:38:47 -04:00
parent ad54853e60
commit 22fdedfd16
7 changed files with 7 additions and 139 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

2
RDiskCP/RDiskCP.c Executable file → Normal file
View File

@ -1 +1 @@
#include "RDiskCP.h" static long RDiskCPMacDev() { int i; // Check signature and return 0 if doesn't match // Don't check for length byte at beginning or null byte at endss for (i = 1; i < sizeof(RDiskSigStr)-1; i++) { if (RDiskSigPtr[i] != RDiskSigStr[i]) { // If signature doesn't match, // fail if not holding R key if (!((*((char*)0x175)) & 0x80)) { return 0; } } } return 1; // Otherwise return 1 if signature matches } static void RDiskCPUpdate(DialogPtr cpDialog, short numItems) { GrafPtr savePort; Handle h; Rect r; short type; char startup, ram; // Get startup and ram from PRAM RDiskCPReadXPRam(1, 4, &startup); RDiskCPReadXPRam(1, 5, &ram); // Save GrafPort and set port to dialog before updating items GetPort(&savePort); SetPort(cpDialog); GetDItem(cpDialog, BootCheckbox+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, startup & 0x01 ? 1 : 0); GetDItem(cpDialog, MountCheckbox+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, startup & 0x02 && !(startup & 0x01) ? 1 : 0); HiliteControl((ControlHandle)h, startup & 0x01 ? 255 : 0); GetDItem(cpDialog, RAMCheckbox+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, startup & 0x03 && ram & 0x01 ? 1 : 0); HiliteControl((ControlHandle)h, startup & 0x03 ? 0 : 255); GetDItem(cpDialog, DebugCheckbox+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, startup & 0x04 && (startup & 0x01) ? 1 : 0); HiliteControl((ControlHandle)h, !(startup & 0x01) || !*RDiskDBGDisPos ? 255 : 0); GetDItem(cpDialog, CDROMCheckbox+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, !(startup & 0x08) && (startup & 0x01) ? 1 : 0); HiliteControl((ControlHandle)h, !(startup & 0x01) || !*RDiskCDROMDisPos ? 255 : 0); // Restore old GrafPort SetPort(savePort); } static void RDiskCPHitDev(short message, short item, short numItems, short cpPrivateVal, EventRecord *theEvent, void *cdevStorageValue, DialogPtr cpDialog) { char startup, ram; RDiskCPReadXPRam(1, 4, &startup); RDiskCPReadXPRam(1, 5, &ram); switch (item - numItems) { case BootCheckbox: if (startup & 0x01) { startup &= 0x0F & ~0x01; } else { startup = startup & 0x0F | 0x01; } break; case MountCheckbox: if (!(startup & 0x01)) { if (startup & 0x02) { startup &= 0x0F & ~0x02; } else { startup = startup & 0x0F | 0x02; } } break; case RAMCheckbox: GetDItem(cpDialog, RAMCheckbox+numItems, &type, &h, &r); ) { if (ram & 0x01) { ram = 0x00; } else { ram = 0x01; } } break; case DebugCheckbox: if (startup & 0x01) { if (startup & 0x04) { startup &= 0x0F & ~0x04; } else { startup = startup & 0x0F | 0x04; } } break; case CDROMCheckbox: if (startup & 0x01) { if (startup & 0x08) { startup &= 0x0F & ~0x08; } else { startup = startup & 0x0F | 0x08; } } break; }; RDiskCPWriteXPRam(1, 4, &startup); RDiskCPWriteXPRam(1, 5, &ram); RDiskCPUpdate(cpDialog, numItems); } static void RDiskCPInitDev(short message, short item, short numItems, short cpPrivateVal, EventRecord *theEvent, void *cdevStorageValue, DialogPtr cpDialog) { Str15 ramSize; Str255 dbgName = "\pMacsBug"; Str255 cdromName = "\pCD-ROM Ext."; int i; ramSize[0] = 2; if (RDiskCPMacDev()) { ramSize[1] = RDiskRAMReq[0]; ramSize[2] = RDiskRAMReq[1]; } else { ramSize[1] = '1'; ramSize[2] = '6'; } if (RDiskCPMacDev() && *RDiskDBGNamePos != 0) { for (i = 0; i < 255; i++) { dbgName[i] = (*RDiskDBGNamePos)[i]; } } if (RDiskCPMacDev() && *RDiskCDROMNamePos != 0) { for (i = 0; i < 255; i++) { cdromName[i] = (*RDiskCDROMNamePos)[i]; } } ParamText(ramSize, dbgName, cdromName, 0); } pascal long main(short message, short item, short numItems, short cpPrivateVal, EventRecord *theEvent, void *cdevStorageValue, DialogPtr cpDialog) { long ret = (long)cdevStorageValue; // Switch to our A4 world EnterCodeResource(); // Handle message switch (message) { case initDev: RDiskCPInitDev(message, item, numItems, cpPrivateVal, theEvent, cdevStorageValue, cpDialog); // (fall through to return cdevUnset) case closeDev: ret = cdevUnset; break; case macDev: ret = RDiskCPMacDev(); break; case updateDev: case activDev: case deactivDev: RDiskCPUpdate(cpDialog, numItems); break; case hitDev: RDiskCPHitDev(message, item, numItems, cpPrivateVal, theEvent, cdevStorageValue, cpDialog); break; }; // Restore old A4 world and return result ExitCodeResource(); return ret; }
#include "RDiskCP.h" static long RDiskCPMacDev() { int i; // Check signature and return 0 if doesn't match // Don't check for length byte at beginning or null byte at endss for (i = 1; i < sizeof(RDiskSigStr)-1; i++) { if (RDiskSigPtr[i] != RDiskSigStr[i]) { // If signature doesn't match, // fail if not holding R key if (!((*((char*)0x175)) & 0x80)) { return 0; } } } return 1; // Otherwise return 1 if signature matches } static void RDiskCPUpdate(DialogPtr cpDialog, short numItems) { GrafPtr savePort; Handle h; Rect r; short type; char startup, ram; // Get startup and ram from PRAM RDiskCPReadXPRam(1, 4, &startup); RDiskCPReadXPRam(1, 5, &ram); // Save GrafPort and set port to dialog before updating items GetPort(&savePort); SetPort(cpDialog); GetDItem(cpDialog, BootCheckbox+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, startup & 0x01 ? 1 : 0); GetDItem(cpDialog, MountCheckbox+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, !(startup & 0x02) && !(startup & 0x01) ? 1 : 0); HiliteControl((ControlHandle)h, startup & 0x01 ? 255 : 0); GetDItem(cpDialog, RAMCheckbox+numItems, &type, &h, &r); HiliteControl((ControlHandle)h, startup & 0x03 ? 0 : 255); GetDItem(cpDialog, DebugCheckbox+numItems, &type, &h, &r); HiliteControl((ControlHandle)h, (startup & 0x01) || !(startup & 0x02) ? 0 : 255); GetDItem(cpDialog, DebugCheckbox+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, startup & 0x04 && (startup & 0x01) ? 1 : 0); HiliteControl((ControlHandle)h, !(startup & 0x01) || !*RDiskDBGDisPos ? 255 : 0); GetDItem(cpDialog, CDROMCheckbox+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, startup & 0x08 && (startup & 0x01) ? 1 : 0); HiliteControl((ControlHandle)h, !(startup & 0x01) || !*RDiskCDROMDisPos ? 255 : 0); // Restore old GrafPort SetPort(savePort); } static void RDiskCPHitDev(short message, short item, short numItems, short cpPrivateVal, EventRecord *theEvent, void *cdevStorageValue, DialogPtr cpDialog) { char startup, ram; RDiskCPReadXPRam(1, 4, &startup); RDiskCPReadXPRam(1, 5, &ram); switch (item - numItems) { case BootCheckbox: if (startup & 0x01) { startup &= 0x0F & ~0x01; } else { startup = startup & 0x0F | 0x01; } break; case MountCheckbox: if (!(startup & 0x01)) { if (startup & 0x02) { startup &= 0x0F & ~0x02; } else { startup = startup & 0x0F | 0x02; } } break; case RAMCheckbox: GetDItem(cpDialog, RAMCheckbox+numItems, &type, &h, &r); ) { if (ram & 0x01) { ram = 0x00; } else { ram = 0x01; } } break; case DebugCheckbox: if (startup & 0x01) { if (startup & 0x04) { startup &= 0x0F & ~0x04; } else { startup = startup & 0x0F | 0x04; } } break; case CDROMCheckbox: if (startup & 0x01) { if (startup & 0x08) { startup &= 0x0F & ~0x08; } else { startup = startup & 0x0F | 0x08; } } break; }; RDiskCPWriteXPRam(1, 4, &startup); RDiskCPWriteXPRam(1, 5, &ram); RDiskCPUpdate(cpDialog, numItems); } static void RDiskCPInitDev(short message, short item, short numItems, short cpPrivateVal, EventRecord *theEvent, void *cdevStorageValue, DialogPtr cpDialog) { Str15 ramSize; Str255 dbgName = "\pMacsBug"; Str255 cdromName = "\pCD-ROM Ext."; int i; ramSize[0] = 2; if (RDiskCPMacDev()) { ramSize[1] = RDiskRAMReq[0]; ramSize[2] = RDiskRAMReq[1]; } else { ramSize[1] = '1'; ramSize[2] = '6'; } if (RDiskCPMacDev() && *RDiskDBGNamePos != 0) { for (i = 0; i < 255; i++) { dbgName[i] = (*RDiskDBGNamePos)[i]; } } if (RDiskCPMacDev() && *RDiskCDROMNamePos != 0) { for (i = 0; i < 255; i++) { cdromName[i] = (*RDiskCDROMNamePos)[i]; } } ParamText(ramSize, dbgName, cdromName, 0); } pascal long main(short message, short item, short numItems, short cpPrivateVal, EventRecord *theEvent, void *cdevStorageValue, DialogPtr cpDialog) { long ret = (long)cdevStorageValue; // Switch to our A4 world EnterCodeResource(); // Handle message switch (message) { case initDev: RDiskCPInitDev(message, item, numItems, cpPrivateVal, theEvent, cdevStorageValue, cpDialog); // (fall through to return cdevUnset) case closeDev: ret = cdevUnset; break; case macDev: ret = RDiskCPMacDev(); break; case updateDev: case activDev: case deactivDev: RDiskCPUpdate(cpDialog, numItems); break; case hitDev: RDiskCPHitDev(message, item, numItems, cpPrivateVal, theEvent, cdevStorageValue, cpDialog); break; }; // Restore old A4 world and return result ExitCodeResource(); return ret; }

File diff suppressed because one or more lines are too long

0
RDiskCP/RDiskCP.h Executable file → Normal file
View File

View File

@ -1,31 +1 @@
(This file must be converted with BinHex 4.0)
:#9*%DA0V3e!ZD!"849K868e$3`%!N!-$q!!!!CUGAL0TCQjNC@BJ8N4*8dY$8&p
)$50NC@CTEQ8J8N4*8dY$8&p)$3dMD@jME(9NC5!m3646G(9QCLjS2Jd0)f4PCQP
ZC5"#Efpd3fKPBfYLEhJJ-`dMC'9QD@jP)%*[Eh4$BA"dD@pZ)$B0)f4PCQPZC5"
0Eh9ZG%0SC@0VBQpi)$80)f4PCQPZC5"0Eh9ZG%0KF(4TEfiJ1!dMC'9QD@jP)&*
"680SC@0VBQpi)$F0)f4PCQPZC5"538e$BA"dD@pZ)$%`$50NC@CTEQ8J4'9LG@G
$D'9MDf*[H#!a-`dMC'9QD@jP)%4PBR9R3f&`G'P[EL!a0!dMC'9QD@jP)%0%8Np
03fKPBfYLEhJJ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Z*P ,!33S8!%%mV5$!5#!@8d#5T!!CajB!M&m!)#e@8eB!L&mIrpX6`%GI'C2`p42CB- "@%qYBr)#3QhjVZ%45'd"qEa-!IqL%4!I!@FSi5-"qEK-!Iq8*!&R'Z%M!IQd6!( rKL6@i5-"qE"-!3!!!3!!!!%!!!!!!!!!!"i!!!!!!!!!!!!F!"lrrbjV:

View File

@ -31,15 +31,15 @@ static void RDDecodeSettings(Ptr unmountEN, Ptr mountEN, Ptr ramEN, Ptr dbgEN, P
*mountEN = 0; // No need to mount later since we are boot disk
*ramEN = a; // A enables RAM disk
*dbgEN = 0;
*cdrEN = 1;
*cdrEN = 0;
} else {
if (legacy_startup & 0x01) { // Boot from ROM disk
*unmountEN = 0; // Don't unmount so we boot from this drive
*mountEN = 0; // No need to mount later since we are boot disk
*ramEN = legacy_ram & 0x01; // Allocate RAM disk if bit 0 == 1
*dbgEN = legacy_startup & 0x04; // MacsBug enabled if bit 2 == 1
*cdrEN = !(legacy_startup & 0x08); // CD-ROM enabled if bit 3 == 0
} else if (legacy_startup & 0x02) { // Mount ROM disk
*cdrEN = legacy_startup & 0x08; // CD-ROM enabled if bit 3 == 1
} else if (!(legacy_startup & 0x02)) { // Mount ROM disk
*unmountEN = 1; // Unmount to not boot from our disk
*mountEN = 1; // Mount in accRun
*ramEN = legacy_ram & 0x01; // Allocate RAM disk if bit 0 == 1