Add RARCH_CMD_REWIND_DEINIT/RARCH_CMD_REWIND_INIT/RARCH_CMD_REWIND_TOGGLE

This commit is contained in:
twinaphex 2014-10-03 11:44:54 +02:00
parent 16fd8b227e
commit 4f0953f3e3
3 changed files with 16 additions and 9 deletions

View File

@ -100,7 +100,9 @@ enum basic_event
RARCH_CMD_PREPARE_DUMMY,
RARCH_CMD_QUIT,
RARCH_CMD_REINIT,
RARCH_CMD_REWIND,
RARCH_CMD_REWIND_DEINIT,
RARCH_CMD_REWIND_INIT,
RARCH_CMD_REWIND_TOGGLE,
RARCH_CMD_AUTOSAVE,
RARCH_CMD_AUDIO_STOP,
RARCH_CMD_AUDIO_START,

View File

@ -2629,7 +2629,7 @@ int rarch_main_init(int argc, char *argv[])
init_command();
#endif
init_rewind();
rarch_main_command(RARCH_CMD_REWIND_INIT);
init_controllers();
rarch_main_command(RARCH_CMD_RECORD_INIT);
@ -2769,7 +2769,7 @@ void rarch_main_set_state(unsigned cmd)
}
}
/* Save a new config to a file. Filename is based
/* Save a new configuration to a file. Filename is based
* on heuristics to avoid typing. */
static void save_core_config(void)
@ -2952,11 +2952,17 @@ void rarch_main_command(unsigned cmd)
/* Poll input to avoid possibly stale data to corrupt things. */
driver.input->poll(driver.input_data);
break;
case RARCH_CMD_REWIND:
case RARCH_CMD_REWIND_DEINIT:
deinit_rewind();
break;
case RARCH_CMD_REWIND_INIT:
init_rewind();
break;
case RARCH_CMD_REWIND_TOGGLE:
if (g_settings.rewind_enable)
init_rewind();
rarch_main_command(RARCH_CMD_REWIND_INIT);
else
deinit_rewind();
rarch_main_command(RARCH_CMD_REWIND_DEINIT);
break;
case RARCH_CMD_AUTOSAVE:
#ifdef HAVE_THREADS
@ -2967,7 +2973,6 @@ void rarch_main_command(unsigned cmd)
case RARCH_CMD_AUDIO_STOP:
if (!driver.audio_data)
return;
if (!driver.audio->alive(driver.audio_data))
return;
@ -3340,7 +3345,7 @@ void rarch_main_deinit(void)
save_files();
deinit_rewind();
rarch_main_command(RARCH_CMD_REWIND_DEINIT);
deinit_cheats();
deinit_movie();

View File

@ -2319,7 +2319,7 @@ rarch_setting_t *setting_data_get_list(void)
CONFIG_BOOL(g_settings.core_specific_config, "core_specific_config", "Configuration Per-Core", default_core_specific_config, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_BOOL(g_settings.load_dummy_on_core_shutdown, "dummy_on_core_shutdown", "Dummy On Core Shutdown", load_dummy_on_core_shutdown, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_BOOL(g_settings.fps_show, "fps_show", "Show Framerate", fps_show, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
CONFIG_BOOL(g_settings.rewind_enable, "rewind_enable", "Rewind", rewind_enable, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_CMD(RARCH_CMD_REWIND) WITH_FLAGS(SD_FLAG_CMD_APPLY_AUTO)
CONFIG_BOOL(g_settings.rewind_enable, "rewind_enable", "Rewind", rewind_enable, "OFF", "ON", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_CMD(RARCH_CMD_REWIND_TOGGLE) WITH_FLAGS(SD_FLAG_CMD_APPLY_AUTO)
#if 0
CONFIG_SIZE(g_settings.rewind_buffer_size, "rewind_buffer_size", "Rewind Buffer Size", rewind_buffer_size, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
#endif