From 5d33861c8b611b4920d51b7f589bf99aef110cf5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 19 Jan 2013 08:54:03 +0100 Subject: [PATCH] (RMenu) Add rewind_granularity option --- frontend/menu/rmenu.c | 16 ++++++++++++++++ frontend/menu/rmenu.h | 1 + settings.c | 1 + 3 files changed, 18 insertions(+) diff --git a/frontend/menu/rmenu.c b/frontend/menu/rmenu.c index 66b1036295..dcb189b223 100644 --- a/frontend/menu/rmenu.c +++ b/frontend/menu/rmenu.c @@ -308,6 +308,11 @@ static void populate_setting_item(void *data, unsigned input) else snprintf(current_item->comment, sizeof(current_item->comment), "INFO - [Rewind] feature is set to 'OFF'."); break; + case SETTING_EMU_REWIND_GRANULARITY: + snprintf(current_item->text, sizeof(current_item->text), "Rewind granularity"); + snprintf(current_item->setting_text, sizeof(current_item->setting_text), "%d", g_settings.rewind_granularity); + snprintf(current_item->comment, sizeof(current_item->comment), "INFO - Set the amount of frames to 'rewind'.\nIncrease this to lower CPU usage."); + break; #ifdef HAVE_ZLIB case SETTING_ZIP_EXTRACT: snprintf(current_item->text, sizeof(current_item->text), "Unzip mode"); @@ -1394,6 +1399,17 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input) if(input & (1ULL << RMENU_DEVICE_NAV_START)) g_settings.rewind_enable = false; break; + case SETTING_EMU_REWIND_GRANULARITY: + if(input & (1ULL << RMENU_DEVICE_NAV_LEFT)) + { + if (g_settings.rewind_granularity > 1) + g_settings.rewind_granularity--; + } + if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B))) + g_settings.rewind_granularity++; + if(input & (1ULL << RMENU_DEVICE_NAV_START)) + g_settings.rewind_granularity = 1; + break; #ifdef HAVE_ZLIB case SETTING_ZIP_EXTRACT: if((input & (1ULL << RMENU_DEVICE_NAV_LEFT))) diff --git a/frontend/menu/rmenu.h b/frontend/menu/rmenu.h index 314e0eed15..09b5b0690b 100644 --- a/frontend/menu/rmenu.h +++ b/frontend/menu/rmenu.h @@ -146,6 +146,7 @@ enum SETTING_QUIT_RARCH, SETTING_EMU_DEFAULT_ALL, SETTING_EMU_REWIND_ENABLED, + SETTING_EMU_REWIND_GRANULARITY, SETTING_EMU_VIDEO_DEFAULT_ALL, #ifdef _XBOX1 SETTING_EMU_AUDIO_SOUND_VOLUME_LEVEL, diff --git a/settings.c b/settings.c index 4de45639d9..9cc8309d26 100644 --- a/settings.c +++ b/settings.c @@ -1168,6 +1168,7 @@ bool config_save_file(const char *path) config_set_string(conf, "libretro_path", g_settings.libretro); 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); config_set_string(conf, "video_cg_shader", g_settings.video.cg_shader_path); config_set_float(conf, "video_aspect_ratio", g_settings.video.aspect_ratio); #ifdef HAVE_FBO