diff --git a/apple/OSX/platform.h b/apple/OSX/platform.h index 36c3356613..541e23bf81 100644 --- a/apple/OSX/platform.h +++ b/apple/OSX/platform.h @@ -36,7 +36,6 @@ { NSWindow* _window; NSString* _configDirectory; - NSString* _coreDirectory; NSWindowController* _settingsWindow; NSWindow* _coreSelectSheet; NSString* _file; @@ -48,7 +47,6 @@ @property (nonatomic, retain) NSWindow IBOutlet* window; @property (nonatomic, copy) NSString* configDirectory; // e.g. /var/mobile/Documents/.RetroArch -@property (nonatomic, copy) NSString* coreDirectory; // e.g. /Applications/RetroArch.app/modules + (RetroArch_OSX*)get; diff --git a/apple/OSX/platform.m b/apple/OSX/platform.m index fb34285fa8..6416e469b7 100644 --- a/apple/OSX/platform.m +++ b/apple/OSX/platform.m @@ -102,7 +102,6 @@ static char** waiting_argv; @synthesize window = _window; @synthesize configDirectory = _configDirectory; -@synthesize coreDirectory = _coreDirectory; @synthesize settingsWindow = _settingsWindow; @synthesize coreSelectSheet = _coreSelectSheet; @synthesize file = _file; @@ -112,7 +111,6 @@ static char** waiting_argv; { [_window release]; [_configDirectory release]; - [_coreDirectory release]; [_coreSelectSheet release]; [_settingsWindow release]; [_file release]; @@ -138,7 +136,7 @@ static char** waiting_argv; paths = (NSArray*)NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); self.configDirectory = [[paths objectAtIndex:0] stringByAppendingPathComponent:BOXSTRING("RetroArch")]; snprintf(g_defaults.config_path, sizeof(g_defaults.config_path), "%s/retroarch.cfg", self.configDirectory.UTF8String); - self.coreDirectory = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:BOXSTRING("Contents/Resources/modules")]; + snprintf(g_defaults.core_dir, sizeof(g_defaults.core_dir), "%s/%s", NSBundle.mainBundle.bundlePath.UTF8String, "Contents/Resources/modules"); #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 [self.window setCollectionBehavior:[self.window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary]; @@ -153,7 +151,7 @@ static char** waiting_argv; self.settingsWindow = [[[NSWindowController alloc] initWithWindowNibName:BOXSTRING("Settings")] autorelease]; - core_info_set_core_path(self.coreDirectory.UTF8String); + core_info_set_core_path(g_defaults.core_dir); core_info_set_config_path(self.configDirectory.UTF8String); core_list = (const core_info_list_t*)core_info_list_get(); @@ -307,7 +305,7 @@ static char** waiting_argv; #pragma mark Menus - (IBAction)showCoresDirectory:(id)sender { - [[NSWorkspace sharedWorkspace] openFile:self.coreDirectory]; + [[NSWorkspace sharedWorkspace] openFile:BOXSTRING(g_defaults.core_dir)]; } - (IBAction)showPreferences:(id)sender diff --git a/apple/common/RetroArch_Apple.h b/apple/common/RetroArch_Apple.h index 8f7de4e235..08dbd8409c 100644 --- a/apple/common/RetroArch_Apple.h +++ b/apple/common/RetroArch_Apple.h @@ -32,7 +32,6 @@ - (void)unloadingCore:(NSString*)core; - (NSString*)configDirectory; // < This returns the directory that contains retroarch.cfg and other custom configs -- (NSString*)coreDirectory; // < This is the default path to where libretro cores are installed @end #ifdef IOS diff --git a/apple/iOS/platform.h b/apple/iOS/platform.h index 01d88e2654..d411638406 100644 --- a/apple/iOS/platform.h +++ b/apple/iOS/platform.h @@ -48,8 +48,6 @@ const void* apple_get_frontend_settings(void); @property (nonatomic) NSString* configDirectory; // e.g. /var/mobile/Documents/.RetroArch -@property (nonatomic) NSString* coreDirectory; // e.g. /Applications/RetroArch.app/modules - @property (nonatomic) NSString* documentsDirectory; // e.g. /var/mobile/Documents @property (nonatomic) NSString* systemDirectory; // e.g. /var/mobile/Documents/.RetroArch diff --git a/apple/iOS/platform.m b/apple/iOS/platform.m index 78ffefc43b..af5f1c859f 100644 --- a/apple/iOS/platform.m +++ b/apple/iOS/platform.m @@ -202,7 +202,7 @@ static void handle_touch_event(NSArray* touches) self.configDirectory = self.systemDirectory; snprintf(g_defaults.config_path, sizeof(g_defaults.config_path), "%s/retroarch.cfg", self.configDirectory.UTF8String); - self.coreDirectory = [NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:@"modules"]; + snprintf(g_defaults.core_dir, sizeof(g_defaults.core_dir), "%s/%s", NSBundle.mainBundle.bundlePath.UTF8String, "modules"); path = (const char*)self.documentsDirectory.UTF8String; path_mkdir(path); @@ -229,7 +229,7 @@ static void handle_touch_event(NSArray* touches) } // Warn if there are no cores present - core_info_set_core_path(self.coreDirectory.UTF8String); + core_info_set_core_path(g_defaults.core_dir); core_info_set_config_path(self.configDirectory.UTF8String); core_list = (const core_info_list_t*)core_info_list_get();