diff --git a/core_info.c b/core_info.c index c8a7e9e0ad..19e00906d5 100644 --- a/core_info.c +++ b/core_info.c @@ -74,7 +74,7 @@ core_info_list_t *core_info_list_new(const char *modules_path) #endif strlcat(info_path_base, ".info", sizeof(info_path_base)); - fill_pathname(info_path, (*g_settings.libretro_info_path) ? g_settings.libretro_info_path : modules_path, + fill_pathname_join(info_path, (*g_settings.libretro_info_path) ? g_settings.libretro_info_path : modules_path, info_path_base, sizeof(info_path)); core_info[i].data = config_file_new(info_path); diff --git a/frontend/menu/menu_common.h b/frontend/menu/menu_common.h index a467353e17..35d68bc0b4 100644 --- a/frontend/menu/menu_common.h +++ b/frontend/menu/menu_common.h @@ -131,6 +131,7 @@ typedef enum RGUI_SAVESTATE_DIR_PATH, RGUI_SAVEFILE_DIR_PATH, RGUI_LIBRETRO_DIR_PATH, + RGUI_LIBRETRO_INFO_DIR_PATH, RGUI_CONFIG_DIR_PATH, #ifdef HAVE_OVERLAY RGUI_OVERLAY_DIR_PATH, diff --git a/frontend/menu/menu_settings.c b/frontend/menu/menu_settings.c index b3b04f1a22..a8b389f79b 100644 --- a/frontend/menu/menu_settings.c +++ b/frontend/menu/menu_settings.c @@ -580,6 +580,10 @@ int menu_set_settings(unsigned setting, unsigned action) } break; #endif + case RGUI_LIBRETRO_INFO_DIR_PATH: + if (action == RGUI_ACTION_START) + *g_settings.libretro_info_path = '\0'; + break; case RGUI_CONFIG_DIR_PATH: if (action == RGUI_ACTION_START) *g_settings.rgui_config_directory = '\0'; @@ -1153,6 +1157,9 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w, strlcpy(type_str, *rgui->libretro_dir ? rgui->libretro_dir : "", type_str_size); break; #endif + case RGUI_LIBRETRO_INFO_DIR_PATH: + strlcpy(type_str, *g_settings.libretro_info_path ? g_settings.libretro_info_path : "", type_str_size); + break; case RGUI_CONFIG_DIR_PATH: strlcpy(type_str, *g_settings.rgui_config_directory ? g_settings.rgui_config_directory : "", type_str_size); break; diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index 7d3997a390..3d297eb523 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -100,6 +100,7 @@ static bool menu_type_is_directory_browser(unsigned type) type == RGUI_SAVESTATE_DIR_PATH || #ifdef HAVE_DYNAMIC type == RGUI_LIBRETRO_DIR_PATH || + type == RGUI_LIBRETRO_INFO_DIR_PATH || #endif type == RGUI_CONFIG_DIR_PATH || type == RGUI_SAVEFILE_DIR_PATH || @@ -491,6 +492,7 @@ static void rgui_settings_path_populate_entries(rgui_handle_t *rgui) #ifdef HAVE_DYNAMIC rgui_list_push(rgui->selection_buf, "Core Directory", RGUI_LIBRETRO_DIR_PATH, 0); #endif + rgui_list_push(rgui->selection_buf, "Core Info Directory", RGUI_LIBRETRO_INFO_DIR_PATH, 0); #ifdef HAVE_SHADER_MANAGER rgui_list_push(rgui->selection_buf, "Shader Directory", RGUI_SHADER_DIR_PATH, 0); #endif @@ -1436,6 +1438,11 @@ static int rgui_iterate(void *data, unsigned action) rgui_flush_menu_stack_type(rgui, RGUI_SETTINGS_PATH_OPTIONS); } #endif + else if (menu_type == RGUI_LIBRETRO_INFO_DIR_PATH) + { + strlcpy(g_settings.libretro_info_path, dir, sizeof(g_settings.libretro_info_path)); + rgui_flush_menu_stack_type(rgui, RGUI_SETTINGS_PATH_OPTIONS); + } else if (menu_type == RGUI_SHADER_DIR_PATH) { strlcpy(g_settings.video.shader_dir, dir, sizeof(g_settings.video.shader_dir)); diff --git a/settings.c b/settings.c index f3bbb021ab..fe26dcdc33 100644 --- a/settings.c +++ b/settings.c @@ -734,6 +734,8 @@ bool config_load_file(const char *path) if (!*g_settings.libretro) CONFIG_GET_PATH(libretro, "libretro_path"); + CONFIG_GET_PATH(libretro_info_path, "libretro_info_path"); + CONFIG_GET_PATH(core_options_path, "core_options_path"); CONFIG_GET_PATH(screenshot_directory, "screenshot_directory"); if (*g_settings.screenshot_directory) @@ -1045,6 +1047,7 @@ bool config_save_file(const char *path) RARCH_LOG("Saving config at path: \"%s\"\n", path); config_set_string(conf, "libretro_path", g_settings.libretro); + config_set_string(conf, "libretro_info_path", g_settings.libretro_info_path); config_set_string(conf, "cheat_database_path", g_settings.cheat_database); config_set_bool(conf, "rewind_enable", g_settings.rewind_enable); config_set_int(conf, "rewind_granularity", g_settings.rewind_granularity);