--- BasiliskII/src/MacOSX/main_macosx.mm 2002/05/25 23:58:51 1.2 +++ BasiliskII/src/MacOSX/main_macosx.mm 2003/03/26 00:26:38 1.7 @@ -1,5 +1,5 @@ /* - * $Id: main_macosx.mm,v 1.2 2002/05/25 23:58:51 nigel Exp $ + * $Id: main_macosx.mm,v 1.7 2003/03/26 00:26:38 nigel Exp $ * * main_macosx.mm - Startup code for MacOS X * Based (in a small way) on the default main.m, @@ -96,10 +96,10 @@ uint8 *ScratchMem = NULL; // Scratch m static timer_t timer; // 60Hz timer #endif -//#ifdef ENABLE_MON +#ifdef ENABLE_MON static struct sigaction sigint_sa; // sigaction for SIGINT handler static void sigint_handler(...); -//#endif +#endif #if REAL_ADDRESSING static bool lm_area_mapped = false; // Flag: Low Memory area mmap()ped @@ -172,7 +172,7 @@ int main(int argc, char **argv) return i; } -#define QuitEmulator() QuitEmuNoExit() ; return NO; +#define QuitEmulator() { QuitEmuNoExit() ; return NO; } bool InitEmulator (void) { @@ -223,6 +223,8 @@ bool InitEmulator (void) ErrorAlert(str); QuitEmulator(); } +#else + *str = 0; // Eliminate unused variable warning #endif // Create areas for Mac RAM and ROM @@ -267,6 +269,8 @@ bool InitEmulator (void) // Get rom file path from preferences const char *rom_path = PrefsFindString("rom"); + if ( ! rom_path ) + WarningAlert("No rom pathname set. Trying ./ROM"); // Load Mac ROM int rom_fd = open(rom_path ? rom_path : ROM_FILE_NAME, O_RDONLY); @@ -316,9 +320,6 @@ bool InitEmulator (void) void QuitEmuNoExit() { - extern NSApplication *NSApp; - - D(bug("QuitEmulator\n")); // Exit 680x0 emulation @@ -359,14 +360,18 @@ void QuitEmuNoExit() // Exit preferences PrefsExit(); - - // Stop run loop - [NSApp terminate: nil]; } void QuitEmulator(void) { + extern NSApplication *NSApp; + + QuitEmuNoExit(); + + // Stop run loop? + [NSApp terminate: nil]; + exit(0); }