mirror of https://github.com/snes9xgit/snes9x.git
Mac: Always save SRAM on window close and quit
This commit is contained in:
parent
7d028a4e74
commit
a4b207cbaa
|
@ -68,12 +68,12 @@ static NSWindowFrameAutosaveName const kMainWindowIdentifier = @"s9xMainWindow";
|
|||
|
||||
[NSNotificationCenter.defaultCenter addObserverForName:NSWindowWillCloseNotification object:window queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *notification)
|
||||
{
|
||||
[self.s9xEngine pause];
|
||||
[self.s9xEngine quit];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
||||
// Insert code here to tear down your application
|
||||
[self.s9xEngine quit];
|
||||
}
|
||||
|
||||
- (void)setupDefaults
|
||||
|
|
|
@ -167,6 +167,7 @@ extern id<S9xInputDelegate> inputDelegate;
|
|||
- (BOOL)isRunning;
|
||||
- (BOOL)isPaused;
|
||||
- (void)pause;
|
||||
- (void)quit;
|
||||
- (void)resume;
|
||||
|
||||
- (BOOL)setButton:(S9xButtonCode)button forKey:(int16)key player:(int8)player oldButton:(S9xButtonCode *)oldButton oldPlayer:(int8 *)oldPlayer oldKey:(int16 *)oldKey;
|
||||
|
|
|
@ -3015,6 +3015,7 @@ void QuitWithFatalError ( NSString *message)
|
|||
|
||||
- (void)stop
|
||||
{
|
||||
SNES9X_Quit();
|
||||
S9xExit();
|
||||
}
|
||||
|
||||
|
@ -3034,6 +3035,12 @@ void QuitWithFatalError ( NSString *message)
|
|||
[s9xView setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
- (void)quit
|
||||
{
|
||||
SNES9X_Quit();
|
||||
[self pause];
|
||||
}
|
||||
|
||||
- (void)resume
|
||||
{
|
||||
pauseEmulation = false;
|
||||
|
|
Loading…
Reference in New Issue