--- BasiliskII/src/MacOSX/main_macosx.mm 2002/03/16 04:00:24 1.1 +++ BasiliskII/src/MacOSX/main_macosx.mm 2003/03/26 00:26:38 1.7 @@ -1,5 +1,5 @@ /* - * $Id: main_macosx.mm,v 1.1 2002/03/16 04:00:24 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); } @@ -483,25 +488,6 @@ void ClearInterruptFlag(uint32 flag) * Display error alert */ -//#import -#import - -extern "C" -{ - int NSRunAlertPanel (NSString *title, NSString *msg, - NSString *defaultButton, - NSString *alternateButton, - NSString *otherButton, ...); - int NSRunInformationalAlertPanel(NSString *title, NSString *msg, - NSString *defaultButton, - NSString *alternateButton, - NSString *otherButton, ...); - int NSRunCriticalAlertPanel (NSString *title, NSString *msg, - NSString *defaultButton, - NSString *alternateButton, - NSString *otherButton, ...); -} - void ErrorAlert(const char *text) { NSString *title = [NSString stringWithCString: