--- BasiliskII/src/MacOSX/Emulator.mm 2004/01/12 15:29:24 1.8 +++ BasiliskII/src/MacOSX/Emulator.mm 2009/10/08 09:20:51 1.14 @@ -2,9 +2,9 @@ * Emulator.mm - Class whose actions are attached to GUI widgets in a window, * used to control a single Basilisk II emulated Macintosh. * - * $Id: Emulator.mm,v 1.8 2004/01/12 15:29:24 cebix Exp $ + * $Id: Emulator.mm,v 1.14 2009/10/08 09:20:51 nigel Exp $ * - * Basilisk II (C) 1997-2004 Christian Bauer + * Basilisk II (C) 1997-2008 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,24 +24,25 @@ #import "Emulator.h" #import "EmulatorView.h" -@implementation Emulator - #import "sysdeps.h" // Types used in Basilisk C++ code #import "main_macosx.h" // Prototypes for QuitEmuNoExit() and InitEmulator() #import "misc_macosx.h" // Some other prototypes #import "video_macosx.h" // Some window/view globals -#import -#import -#import -#import - -#undef check() // memory.h defines a check macro, clashes with an OS X one? -#import +#import "adb.h" +#import "main.h" +#import "prefs.h" +#import "timer.h" + +#undef check // memory.h defines a check macro, + // which may clash with an OS X one on 10.1 or 10.2 +#import "cpu_emulation.h" #define DEBUG 0 -#import +#import "debug.h" + +@implementation Emulator // NSWindow method, which is invoked via delegation @@ -218,7 +219,7 @@ int argc = 0; char **argv; - PrefsInit(argc, argv); + PrefsInit(NULL, argc, argv); SysInit(); emul = [NNThread new]; @@ -353,7 +354,7 @@ uint8 lastXPRAM[XPRAM_SIZE]; // Copy of #endif emul = [NNThread new]; RTC = [NNTimer new]; - redraw = [NNTimer new]; + redraw = [[NNTimer alloc] initWithAutoRelPool]; tick = [NNTimer new]; xPRAM = [NNTimer new]; @@ -424,8 +425,13 @@ uint8 lastXPRAM[XPRAM_SIZE]; // Copy of - (void) RTCinterrupt { - if ( uaeCreated ) - WriteMacInt32 (0x20c, TimerDateTime() ); // Update MacOS time + if ( ! uaeCreated ) + return; + + WriteMacInt32 (0x20c, TimerDateTime() ); // Update MacOS time + + SetInterruptFlag(INTFLAG_1HZ); + TriggerInterrupt(); } - (void) redrawScreen