From 65d505bfb55704135f29a45564d21d7cb5e0527e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20A=2E=20A=CC=81lvarez?= Date: Fri, 27 May 2016 20:33:09 +0200 Subject: [PATCH] terminate when suspending if no disks are inserted --- Mini vMac/AppDelegate.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mini vMac/AppDelegate.m b/Mini vMac/AppDelegate.m index 1d64d53..9cddbd3 100644 --- a/Mini vMac/AppDelegate.m +++ b/Mini vMac/AppDelegate.m @@ -21,6 +21,7 @@ IMPORTPROC SetMouseLoc(ui4r h, ui4r v); IMPORTPROC SetMouseDelta(ui4r dh, ui4r dv); IMPORTFUNC blnr Sony_Insert1(NSString *filePath, blnr silentfail); IMPORTFUNC blnr Sony_IsInserted(NSString *filePath); +IMPORTFUNC blnr AnyDiskInserted(void); EXPORTVAR(ui3b,SpeedValue); IMPORTPROC SetKeyState(int key, blnr down); IMPORTPROC MacInterrupt(); @@ -77,6 +78,9 @@ NSString * const MNVMDidEjectDiskNotification = @"MNVMDidEjectDisk"; - (void)applicationDidEnterBackground:(UIApplication *)application { self.emulatorRunning = NO; + if (AnyDiskInserted() == falseblnr) { + exit(0); + } } - (void)applicationWillEnterForeground:(UIApplication *)application {