--- BasiliskII/src/MacOSX/Emulator.mm 2004/01/12 15:29:24 1.8 +++ BasiliskII/src/MacOSX/Emulator.mm 2007/06/13 16:10:05 1.12 @@ -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.12 2007/06/13 16:10:05 gbeauche Exp $ * - * Basilisk II (C) 1997-2004 Christian Bauer + * Basilisk II (C) 1997-2005 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,24 @@ #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 +#import "adb.h" +#import "main.h" +#import "prefs.h" +#import "timer.h" -#undef check() // memory.h defines a check macro, clashes with an OS X one? -#import +#undef check // memory.h defines a check macro, clashes with an OS X one? +#import "cpu_emulation.h" #define DEBUG 0 -#import +#import "debug.h" + +@implementation Emulator // NSWindow method, which is invoked via delegation @@ -353,7 +353,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 +424,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