From 0f5161d62116ed180f592e33f85f193566fd9234 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 17 Oct 2014 04:17:28 +0200 Subject: [PATCH] Add History List Enable option --- config.def.h | 6 ++++-- frontend/frontend.c | 15 ++++++++------- frontend/menu/menu_common.c | 3 +++ general.h | 1 + retroarch.cfg | 4 ++++ settings.c | 5 +++++ settings_data.c | 12 ++++++++++++ 7 files changed, 37 insertions(+), 9 deletions(-) diff --git a/config.def.h b/config.def.h index c8b770a0e0..89949e2816 100644 --- a/config.def.h +++ b/config.def.h @@ -309,6 +309,10 @@ enum #define DEFAULT_ASPECT_RATIO -1.0f #endif +static const bool def_history_list_enable = true; + +static const unsigned int def_user_language = 0; + /* VIDEO */ #if defined(_XBOX360) @@ -317,8 +321,6 @@ enum #define DEFAULT_GAMMA 0 #endif -static const unsigned int def_user_language = 0; - /* Windowed * Real x resolution = aspect * base_size * x scale * Real y resolution = base_size * y scale diff --git a/frontend/frontend.c b/frontend/frontend.c index 49cc284342..c248027eb1 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -228,15 +228,16 @@ returntype main_entry(signature()) rarch_main_command(RARCH_CMD_HISTORY_INIT); -#if defined(HAVE_MENU) + if (g_settings.history_list_enable) + { #if defined(RARCH_CONSOLE) || defined(RARCH_MOBILE) - if (ret) -#endif - rarch_playlist_push(g_defaults.history, - g_extern.fullpath, - g_settings.libretro, - &g_extern.system.info); + if (ret) #endif + rarch_playlist_push(g_defaults.history, + g_extern.fullpath, + g_settings.libretro, + &g_extern.system.info); + } #if defined(HAVE_MAIN_LOOP) while (main_entry_decide(signature_expand(), args) != -1); diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index 39df932690..531cee0427 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -80,6 +80,9 @@ static void menu_environment_get(int *argc, char *argv[], static void push_to_history_playlist(void) { + if (!g_settings.history_list_enable) + return; + if (*g_extern.fullpath) { char tmp[PATH_MAX]; diff --git a/general.h b/general.h index 244e26b62c..d4c9d74af5 100644 --- a/general.h +++ b/general.h @@ -388,6 +388,7 @@ struct settings char extraction_directory[PATH_MAX]; char playlist_directory[PATH_MAX]; + bool history_list_enable; bool rewind_enable; size_t rewind_buffer_size; unsigned rewind_granularity; diff --git a/retroarch.cfg b/retroarch.cfg index f19fc87955..e24878a020 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -43,6 +43,10 @@ # Enable or disable verbosity level of frontend. # log_verbosity = false +# If this option is enabled, every content file loaded in RetroArch will be +# automatically added to a history list. +# history_list_enable = true + # Enable or disable RetroArch performance counters # perfcnt_enable = false diff --git a/settings.c b/settings.c index 7b5365757e..5b805976d9 100644 --- a/settings.c +++ b/settings.c @@ -332,6 +332,7 @@ static void config_set_defaults(void) def_menu, sizeof(g_settings.menu.driver)); #endif + g_settings.history_list_enable = def_history_list_enable; g_settings.load_dummy_on_core_shutdown = load_dummy_on_core_shutdown; g_settings.video.scale = scale; @@ -1124,6 +1125,8 @@ static bool config_load_file(const char *path, bool set_defaults) g_extern.config_path, "retroarch-content-history.txt", sizeof(g_settings.content_history_path)); + CONFIG_GET_BOOL(history_list_enable, "history_list_enable"); + CONFIG_GET_PATH(content_history_path, "game_history_path"); CONFIG_GET_INT(content_history_size, "game_history_size"); @@ -1679,6 +1682,8 @@ bool config_save_file(const char *path) g_settings.savestate_auto_save); config_set_bool(conf, "savestate_auto_load", g_settings.savestate_auto_load); + config_set_bool(conf, "history_list_enable", + g_settings.history_list_enable); config_set_float(conf, "fastforward_ratio", g_settings.fastforward_ratio); config_set_bool(conf, "fastforward_ratio_throttle_enable", g_settings.fastforward_ratio_throttle_enable); diff --git a/settings_data.c b/settings_data.c index ae21c3107c..99a93dbe93 100644 --- a/settings_data.c +++ b/settings_data.c @@ -3041,6 +3041,18 @@ static bool setting_data_append_list_general_options( general_write_handler, general_read_handler); + CONFIG_BOOL( + g_settings.history_list_enable, + "history_list_enable", + "History List Enable", + true, + "OFF", + "ON", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + CONFIG_UINT(g_settings.libretro_log_level, "libretro_log_level", "Libretro Logging Level",