--- BasiliskII/src/main.cpp 1999/10/19 17:41:17 1.1 +++ BasiliskII/src/main.cpp 1999/10/28 15:33:10 1.4 @@ -41,6 +41,20 @@ #define DEBUG 0 #include "debug.h" +#if ENABLE_MON +#include "mon.h" + +static uint32 mon_read_byte_b2(uint32 adr) +{ + return ReadMacInt8(adr); +} + +static void mon_write_byte_b2(uint32 adr, uint32 b) +{ + WriteMacInt8(adr, b); +} +#endif + /* * Initialize everything, returns false on error @@ -65,13 +79,19 @@ bool InitAll(void) TwentyFourBitAddressing = true; break; case ROM_VERSION_II: - CPUType = 2; + CPUType = PrefsFindInt32("cpu"); + if (CPUType < 2) CPUType = 2; + if (CPUType > 4) CPUType = 4; FPUType = PrefsFindBool("fpu") ? 1 : 0; + if (CPUType == 4) FPUType = 1; // 68040 always with FPU TwentyFourBitAddressing = true; break; case ROM_VERSION_32: - CPUType = 3; + CPUType = PrefsFindInt32("cpu"); + if (CPUType < 2) CPUType = 2; + if (CPUType > 4) CPUType = 4; FPUType = PrefsFindBool("fpu") ? 1 : 0; + if (CPUType == 4) FPUType = 1; // 68040 always with FPU TwentyFourBitAddressing = false; break; } @@ -95,8 +115,10 @@ bool InitAll(void) CDROMInit(); SCSIInit(); +#if SUPPORTS_EXTFS // Init external file system ExtFSInit(); +#endif // Init serial ports SerialInit(); @@ -128,6 +150,14 @@ bool InitAll(void) ErrorAlert(GetString(STR_UNSUPPORTED_ROM_TYPE_ERR)); return false; } + +#if ENABLE_MON + // Initialize mon + mon_init(); + mon_read_byte = mon_read_byte_b2; + mon_write_byte = mon_write_byte_b2; +#endif + return true; } @@ -138,6 +168,11 @@ bool InitAll(void) void ExitAll(void) { +#if ENABLE_MON + // Deinitialize mon + mon_exit(); +#endif + // Save XPRAM XPRAMExit(); @@ -159,8 +194,10 @@ void ExitAll(void) // Exit network EtherExit(); +#if SUPPORTS_EXTFS // Exit external file system ExtFSExit(); +#endif // Exit drivers SCSIExit();