4 |
|
* |
5 |
|
* $Id$ |
6 |
|
* |
7 |
< |
* Basilisk II (C) 1997-2004 Christian Bauer |
7 |
> |
* Basilisk II (C) 1997-2008 Christian Bauer |
8 |
|
* |
9 |
|
* This program is free software; you can redistribute it and/or modify |
10 |
|
* it under the terms of the GNU General Public License as published by |
24 |
|
#import "Emulator.h" |
25 |
|
#import "EmulatorView.h" |
26 |
|
|
27 |
– |
@implementation Emulator |
28 |
– |
|
27 |
|
#import "sysdeps.h" // Types used in Basilisk C++ code |
28 |
|
|
29 |
|
#import "main_macosx.h" // Prototypes for QuitEmuNoExit() and InitEmulator() |
30 |
|
#import "misc_macosx.h" // Some other prototypes |
31 |
|
#import "video_macosx.h" // Some window/view globals |
32 |
|
|
33 |
< |
#import <adb.h> |
34 |
< |
#import <main.h> |
35 |
< |
#import <prefs.h> |
36 |
< |
#import <timer.h> |
37 |
< |
|
38 |
< |
#undef check() // memory.h defines a check macro, clashes with an OS X one? |
39 |
< |
#import <cpu_emulation.h> |
33 |
> |
#import "adb.h" |
34 |
> |
#import "main.h" |
35 |
> |
#import "prefs.h" |
36 |
> |
#import "timer.h" |
37 |
> |
|
38 |
> |
#undef check // memory.h defines a check macro, |
39 |
> |
// which may clash with an OS X one on 10.1 or 10.2 |
40 |
> |
#import "cpu_emulation.h" |
41 |
|
|
42 |
|
#define DEBUG 0 |
43 |
< |
#import <debug.h> |
43 |
> |
#import "debug.h" |
44 |
> |
|
45 |
> |
@implementation Emulator |
46 |
|
|
47 |
|
// NSWindow method, which is invoked via delegation |
48 |
|
|
219 |
|
int argc = 0; |
220 |
|
char **argv; |
221 |
|
|
222 |
< |
PrefsInit(argc, argv); |
222 |
> |
PrefsInit(NULL, argc, argv); |
223 |
|
SysInit(); |
224 |
|
|
225 |
|
emul = [NNThread new]; |
354 |
|
#endif |
355 |
|
emul = [NNThread new]; |
356 |
|
RTC = [NNTimer new]; |
357 |
< |
redraw = [NNTimer new]; |
357 |
> |
redraw = [[NNTimer alloc] initWithAutoRelPool]; |
358 |
|
tick = [NNTimer new]; |
359 |
|
xPRAM = [NNTimer new]; |
360 |
|
|
425 |
|
|
426 |
|
- (void) RTCinterrupt |
427 |
|
{ |
428 |
< |
if ( uaeCreated ) |
429 |
< |
WriteMacInt32 (0x20c, TimerDateTime() ); // Update MacOS time |
428 |
> |
if ( ! uaeCreated ) |
429 |
> |
return; |
430 |
> |
|
431 |
> |
WriteMacInt32 (0x20c, TimerDateTime() ); // Update MacOS time |
432 |
> |
|
433 |
> |
SetInterruptFlag(INTFLAG_1HZ); |
434 |
> |
TriggerInterrupt(); |
435 |
|
} |
436 |
|
|
437 |
|
- (void) redrawScreen |