mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-11-15 16:07:09 +00:00
Mac can toggle emulation pause state
This commit is contained in:
parent
0eeb93820c
commit
ec0af686b2
@ -25,6 +25,7 @@
|
||||
@property (assign) IBOutlet EmulatorGLView *view;
|
||||
@property (assign) IBOutlet NSWindow *disksWindow;
|
||||
@property (assign) IBOutlet NSWindow *prefsWindow;
|
||||
@property (assign) IBOutlet NSMenuItem *pauseMenuItem;
|
||||
|
||||
@property (nonatomic, retain) EmulatorFullscreenWindow *fullscreenWindow;
|
||||
@property (nonatomic, retain) NSWindow *standardWindow;
|
||||
@ -80,6 +81,30 @@
|
||||
timing_toggle_cpu_speed();
|
||||
}
|
||||
|
||||
- (IBAction)togglePause:(id)sender
|
||||
{
|
||||
NSAssert(pthread_main_np(), @"Pause emulation called from non-main thread");
|
||||
static BOOL paused = NO;
|
||||
if (paused)
|
||||
{
|
||||
[[self pauseMenuItem] setTitle:@"Pause Emulation"];
|
||||
#ifdef AUDIO_ENABLED
|
||||
SoundSystemUnpause();
|
||||
#endif
|
||||
pthread_mutex_unlock(&interface_mutex);
|
||||
paused = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
paused = YES;
|
||||
[[self pauseMenuItem] setTitle:@"Resume Emulation"];
|
||||
pthread_mutex_lock(&interface_mutex);
|
||||
#ifdef AUDIO_ENABLED
|
||||
SoundSystemPause();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
- (void)goFullscreen
|
||||
{
|
||||
// If app is already fullscreen...
|
||||
|
Loading…
Reference in New Issue
Block a user