Save rewind variables to config file. Rename rewind variables to fit port style. Set default rewind buffer to 0.

This commit is contained in:
Brandon Wright 2016-10-08 21:33:34 -05:00
parent 5dd5d9ba74
commit 7223e2283e
3 changed files with 20 additions and 9 deletions

View File

@ -175,9 +175,9 @@ Snes9xConfig::load_defaults (void)
netplay_last_host [0] = '\0';
netplay_last_port = 6096;
modal_dialogs = 1;
rewindGranularity = 5;
rewindBufferSize = 150;
rewind_granularity = 5;
rewind_buffer_size = 0;
#ifdef USE_OPENGL
sync_to_vblank = 1;
@ -328,6 +328,9 @@ Snes9xConfig::save_config_file (void)
xml_out_int (xml, "hw_accel", hw_accel);
xml_out_int (xml, "bilinear_filter", bilinear_filter);
xml_out_int (xml, "rewind_buffer_size", rewind_buffer_size);
xml_out_int (xml, "rewind_granularity", rewind_granularity);
#ifdef USE_OPENGL
xml_out_int (xml, "sync_to_vblank", sync_to_vblank);
xml_out_int (xml, "sync_every_frame", sync_every_frame);
@ -841,6 +844,14 @@ Snes9xConfig::set_option (const char *name, const char *value)
{
Settings.SoundSync = atoi (value) ? 1 : 0;
}
else if (!strcasecmp (name, "rewind_buffer_size"))
{
rewind_buffer_size = CLAMP (atoi (value), 0, 2000);
}
else if (!strcasecmp (name, "rewind_granularity"))
{
rewind_granularity = CLAMP (atoi (value), 0, 600);
}
else
{
fprintf (stderr, _("bad option name: %s\n"), name);

View File

@ -134,8 +134,8 @@ class Snes9xConfig
int pointer_is_visible;
struct timeval pointer_timestamp;
unsigned int rewindGranularity;
unsigned int rewindBufferSize;
unsigned int rewind_granularity;
unsigned int rewind_buffer_size;
#ifdef USE_XRANDR
XRRScreenConfiguration *xrr_config;

View File

@ -222,10 +222,10 @@ S9xOpenROM (const char *rom_filename)
CPU.Flags = flags;
if (gui_config->rewindBufferSize)
if (gui_config->rewind_buffer_size)
{
printf("Setting buffer size to %u\n", gui_config->rewindBufferSize * 1024 * 1024);
stateMan.init(gui_config->rewindBufferSize * 1024 * 1024);
printf ("Using rewind buffer of %uMB\n", gui_config->rewind_buffer_size);
stateMan.init (gui_config->rewind_buffer_size * 1024 * 1024);
}
S9xROMLoaded ();
@ -367,7 +367,7 @@ S9xIdleFunc (gpointer data)
if(top_level->user_rewind)
top_level->user_rewind = stateMan.pop();
else if(IPPU.TotalEmulatedFrames % gui_config->rewindGranularity == 0)
else if(IPPU.TotalEmulatedFrames % gui_config->rewind_granularity == 0)
stateMan.push();
static int muted_from_turbo = FALSE;