diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index 6a186b0860..a3a04e6953 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -1515,6 +1515,7 @@ bool menu_replace_config(const char *path) // Load dummy core. *g_extern.fullpath = '\0'; + *g_extern.original_config_path = '\0'; *g_settings.libretro = '\0'; // Load core in new config. g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME); rgui->load_no_rom = false; diff --git a/frontend/menu/menu_settings.c b/frontend/menu/menu_settings.c index 5156677811..1fbed0656a 100644 --- a/frontend/menu/menu_settings.c +++ b/frontend/menu/menu_settings.c @@ -444,6 +444,7 @@ int menu_set_settings(void *data, unsigned setting, unsigned action) g_extern.config_save_on_exit = true; break; case RGUI_SETTINGS_PER_CORE_CONFIG: + g_extern.block_config_read = false; if (action == RGUI_ACTION_OK || action == RGUI_ACTION_RIGHT || action == RGUI_ACTION_LEFT) g_settings.core_specific_config = !g_settings.core_specific_config; diff --git a/settings.c b/settings.c index 9db62cdde3..cd7768e98c 100644 --- a/settings.c +++ b/settings.c @@ -448,6 +448,7 @@ void config_load(void) if (!*g_extern.original_config_path) { + // save the original path for saving. a copy of the last core's settings is always saved to the original config file path for future launches path_resolve_realpath(g_extern.config_path, sizeof(g_extern.config_path)); strlcpy(g_extern.original_config_path, g_extern.config_path, sizeof(g_extern.original_config_path)); } @@ -461,6 +462,7 @@ void config_load(void) } else { + // use original config file's directory strlcpy(g_extern.core_specific_config_path, g_extern.original_config_path, sizeof(g_extern.core_specific_config_path)); path_basedir(g_extern.core_specific_config_path); } @@ -477,7 +479,7 @@ void config_load(void) if (!config_load_file(g_extern.config_path)) RARCH_WARN("Core-specific config not found, reusing last config.\n"); - // make sure we don't accidentally switch this + // don't have the core config file overwrite the libretro path strlcpy(g_settings.libretro, tmp, sizeof(g_settings.libretro)); } }