diff --git a/apple/OSX/platform.m b/apple/OSX/platform.m index 7f50b88c45..ec160ac65c 100644 --- a/apple/OSX/platform.m +++ b/apple/OSX/platform.m @@ -180,10 +180,7 @@ static char** waiting_argv; apple_display_alert("No libretro cores were found.\nSelect \"Go->Cores Directory\" from the menu and place libretro dylib files there.", "RetroArch"); if (waiting_argc) - { - apple_is_running = true; - apple_rarch_load_content(&waiting_argc, waiting_argv); - } + apple_rarch_load_content(&waiting_argc, waiting_argv); else if (!_wantReload) apple_run_core(nil, 0); else @@ -202,12 +199,15 @@ static char** waiting_argv; - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { + NSApplicationTerminateReply reply = NSTerminateNow; _isTerminating = true; - if (apple_is_running) - g_extern.system.shutdown = true; + if (g_extern.main_is_init) + reply = NSTerminateCancel; + + g_extern.system.shutdown = true; - return apple_is_running ? NSTerminateCancel : NSTerminateNow; + return reply; } @@ -255,9 +255,9 @@ static char** waiting_argv; // This utility function will queue the self.core and self.file instance values for running. - (void)runCore { - _wantReload = apple_is_running; + _wantReload = g_extern.main_is_init; - if (!apple_is_running) + if (!g_extern.main_is_init) apple_run_core(self.core, self.file.UTF8String); else g_extern.system.shutdown = true; @@ -324,7 +324,7 @@ static char** waiting_argv; - (IBAction)basicEvent:(id)sender { - if (!apple_is_running) + if (!g_extern.main_is_init) return; apple_event_basic_command([sender tag]); diff --git a/apple/common/RetroArch_Apple.h b/apple/common/RetroArch_Apple.h index 844f62f250..63a5fe7044 100644 --- a/apple/common/RetroArch_Apple.h +++ b/apple/common/RetroArch_Apple.h @@ -45,7 +45,6 @@ extern char** apple_argv; extern bool apple_is_paused; -extern bool apple_is_running; extern bool apple_use_tv_mode; extern NSString* apple_core; diff --git a/apple/common/main.m b/apple/common/main.m index 02e5e2e485..b527350717 100644 --- a/apple/common/main.m +++ b/apple/common/main.m @@ -23,7 +23,6 @@ id apple_platform; #pragma mark EMULATION -bool apple_is_running; bool apple_use_tv_mode; NSString* apple_core; @@ -31,12 +30,7 @@ void apple_rarch_exited(void) { NSString *used_core = (NSString*)apple_core; apple_core = 0; - - if (apple_is_running) - { - apple_is_running = false; - [apple_platform unloadingCore:used_core]; - } + [apple_platform unloadingCore:used_core]; #ifdef OSX [used_core release]; @@ -53,14 +47,10 @@ void apple_run_core(NSString* core, const char* file) int argc; (void)config_path; - - if (apple_is_running) - return; [apple_platform loadingCore:core withFile:file]; apple_core = core; - apple_is_running = true; if (file && core) { diff --git a/apple/iOS/menu.m b/apple/iOS/menu.m index c71b1831bc..ea9b6e2ab0 100644 --- a/apple/iOS/menu.m +++ b/apple/iOS/menu.m @@ -526,7 +526,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U action:^{ [weakSelf.navigationController pushViewController:[RAFrontendSettingsMenu new] animated:YES]; }], nil]; - if (!apple_is_running) + if (!g_extern.main_is_init) { [self.sections addObject:[NSArray arrayWithObjects:BOXSTRING("Content"), [RAMenuItemBasic itemWithDescription:BOXSTRING("Choose Core") @@ -557,7 +557,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U [self.sections addObject:settings]; - if (apple_is_running) + if (g_extern.main_is_init) self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:BOXSTRING("Resume") style:UIBarButtonItemStyleBordered target:[RetroArch_iOS get] action:@selector(showGameView)]; else self.navigationItem.leftBarButtonItem = nil;