From d51ea3bf2a640bbf7280da082020f0ebcd7f66cb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 13 Jun 2013 23:38:25 +0200 Subject: [PATCH] (iOS) Add Global Configuration Enable option - will use one common shared config instead of making a new config file per selected core --- ios/RetroArch/main.m | 10 +++++++++- ios/RetroArch/settings/settings.m | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ios/RetroArch/main.m b/ios/RetroArch/main.m index a02fcafcc9..b474bc45b5 100644 --- a/ios/RetroArch/main.m +++ b/ios/RetroArch/main.m @@ -42,6 +42,7 @@ static ios_input_data_t g_input_data; static bool enable_btstack; +static bool enable_global_config; static bool use_icade; static uint32_t icade_buttons; @@ -370,7 +371,13 @@ static void event_reload_config(void* userdata) load_data->rom_path = strdup(path.UTF8String); load_data->sram_path = strdup(self.systemDirectory.UTF8String); load_data->state_path = strdup(self.systemDirectory.UTF8String); - load_data->config_path = strdup(_module.configPath.UTF8String); + if (enable_global_config) + { + NSString *str = [NSString stringWithFormat:@"%@/retroarch.cfg", [RetroArch_iOS get].systemDirectory]; + load_data->config_path = [str UTF8String]; + } + else + load_data->config_path = strdup(_module.configPath.UTF8String); load_data->verbose = false; if (pthread_create(&_retroThread, 0, rarch_main_ios, load_data)) @@ -442,6 +449,7 @@ static void event_reload_config(void* userdata) // config_get_bool(conf, "ios_use_icade", &use_icade); config_get_bool(conf, "ios_use_btstack", &enable_btstack); + config_get_bool(conf, "global_config_enable", &enable_btstack); if (enable_btstack) [self startBluetooth]; diff --git a/ios/RetroArch/settings/settings.m b/ios/RetroArch/settings/settings.m index cdb56e30a3..8df8415771 100644 --- a/ios/RetroArch/settings/settings.m +++ b/ios/RetroArch/settings/settings.m @@ -290,6 +290,7 @@ static RASettingData* custom_action(NSString* action, id data) NSArray* settings = [NSArray arrayWithObjects: [NSArray arrayWithObjects:@"Frontend", custom_action(@"Diagnostic Log", nil), + boolean_setting(config, @"global_config_enable", @"Use Global Configuration", @"false"), nil], [NSArray arrayWithObjects:@"Bluetooth", // TODO: Note that with this turned off the native bluetooth is expected to be a real keyboard