From 6f8190ea0b9e98eaef470db872c13c1913779950 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 24 Jan 2013 19:24:40 +0100 Subject: [PATCH] Add savestate_auto_load option. --- config.def.h | 3 ++- general.h | 1 + retroarch.c | 3 +++ retroarch.cfg | 3 ++- settings.c | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index ce20469682..36877ef2af 100644 --- a/config.def.h +++ b/config.def.h @@ -358,8 +358,9 @@ static const bool savestate_auto_index = false; // Automatically saves a savestate at the end of RetroArch's lifetime. // The path is $SRAM_PATH.auto. -// RetroArch will automatically load any savestate with this path on startup. +// RetroArch will automatically load any savestate with this path on startup if savestate_auto_load is set. static const bool savestate_auto_save = false; +static const bool savestate_auto_load = true; // Slowmotion ratio. static const float slowmotion_ratio = 3.0; diff --git a/general.h b/general.h index 3f7c4f2eda..543bfc8c91 100644 --- a/general.h +++ b/general.h @@ -256,6 +256,7 @@ struct settings bool block_sram_overwrite; bool savestate_auto_index; bool savestate_auto_save; + bool savestate_auto_load; bool network_cmd_enable; uint16_t network_cmd_port; diff --git a/retroarch.c b/retroarch.c index 85bae69e82..a3a3ea4570 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1845,6 +1845,9 @@ static void load_auto_state(void) return; #endif + if (!g_settings.savestate_auto_load) + return; + char savestate_name_auto[PATH_MAX]; fill_pathname_noext(savestate_name_auto, g_extern.savestate_name, ".auto", sizeof(savestate_name_auto)); diff --git a/retroarch.cfg b/retroarch.cfg index be4b198cfe..65b77527e0 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -10,8 +10,9 @@ # Automatically saves a savestate at the end of RetroArch's lifetime. # The path is $SRAM_PATH.auto. -# RetroArch will automatically load any savestate with this path on startup. +# RetroArch will automatically load any savestate with this path on startup if savestate_auto_load is set. # savestate_auto_save = false +# savestate_auto_load = true # Load libretro from a dynamic location for dynamically built RetroArch. # This option is mandatory. diff --git a/settings.c b/settings.c index 82a797c456..3eca9cb599 100644 --- a/settings.c +++ b/settings.c @@ -211,6 +211,7 @@ void config_set_defaults(void) g_settings.block_sram_overwrite = block_sram_overwrite; g_settings.savestate_auto_index = savestate_auto_index; g_settings.savestate_auto_save = savestate_auto_save; + g_settings.savestate_auto_load = savestate_auto_load; g_settings.network_cmd_enable = network_cmd_enable; g_settings.network_cmd_port = network_cmd_port; g_settings.stdin_cmd_enable = stdin_cmd_enable; @@ -671,6 +672,7 @@ bool config_load_file(const char *path) CONFIG_GET_BOOL(block_sram_overwrite, "block_sram_overwrite"); CONFIG_GET_BOOL(savestate_auto_index, "savestate_auto_index"); CONFIG_GET_BOOL(savestate_auto_save, "savestate_auto_save"); + CONFIG_GET_BOOL(savestate_auto_load, "savestate_auto_load"); CONFIG_GET_BOOL(network_cmd_enable, "network_cmd_enable"); CONFIG_GET_INT(network_cmd_port, "network_cmd_port");