Better PRAM options

This commit is contained in:
Zane Kaminski 2020-07-15 02:14:32 -04:00
parent b55d31cec0
commit 83af6e36f8
3 changed files with 14 additions and 16 deletions

Binary file not shown.

Binary file not shown.

30
rdisk.c
View File

@ -167,32 +167,30 @@ const char const RDiskIcon[285] = {
static void RDiskDecodeSettings(RDiskStorage_t *c, Ptr unmount, Ptr mount, Ptr ram) { static void RDiskDecodeSettings(RDiskStorage_t *c, Ptr unmount, Ptr mount, Ptr ram) {
// Decode settings // Decode settings
if (c->postBoot) { if (c->postBoot) {
*unmount = 0; *unmount = 0; // Don't unmount
*mount = 1; *mount = 0; // No need to post event since it's already been done
*ram = 0; *ram = 0;
} else if (RDiskIsRPressed()) { // R boots from ROM disk } else if (RDiskIsRPressed()) { // R boots from ROM disk
*unmount = 0; *unmount = 0; // Don't unmount so we boot from this drive
*mount = 0; *mount = 0; // No need to mount later since we are boot disk
*ram = RDiskIsAPressed(); // A enables RAM disk *ram = RDiskIsAPressed(); // A enables RAM disk
} else { } else {
// Read PRAM // Read PRAM
char legacy_startup, legacy_ram; char legacy_startup, legacy_ram;
RDiskReadXPRAM(1, 4, &legacy_startup); RDiskReadXPRAM(1, 4, &legacy_startup);
RDiskReadXPRAM(1, 5, &legacy_ram); RDiskReadXPRAM(1, 5, &legacy_ram);
if (legacy_startup == 1) { if (legacy_startup & 1) {
*unmount = 0; *unmount = 0; // Don't unmount so we boot from this drive
*mount = 0; *mount = 0; // No need to mount later since we are boot disk
*ram = legacy_ram; *ram = legacy_ram & 1;
} else if (legacy_startup == 2 || legacy_startup == 3 || } else if (legacy_startup & 2) {
legacy_startup == 4 || legacy_startup == 5 || *unmount = 1; // Unmount to not boot from ouur disks
legacy_startup == 6 || legacy_startup == 7) { *mount = 1; // Mount in accRun
*unmount = 1;
*mount = 1;
*ram = legacy_ram & 1; *ram = legacy_ram & 1;
} else { } else {
*unmount = 1; *unmount = 1; // Unmount
*mount = 0; *mount = 0; // Don't mount again
*ram = 0; *ram = 0; // Don't allocate RAM disk
} }
} }
} }