(PS3) Add rewind menu option - note - g_settings.rewind_enable gets

cleared to '0' somewhere in first-stage SSNES init for some weird
reason - can't even enable it right now beacuse of that
This commit is contained in:
TwinAphex51224 2012-01-21 06:06:01 +01:00
parent 4d95765cb5
commit 64de1a3260
4 changed files with 46 additions and 1 deletions

View File

@ -138,6 +138,7 @@ static void init_settings(void)
init_setting_uint("state_slot", g_extern.state_slot, 0);
init_setting_uint("screenshots_enabled", g_console.screenshots_enable, 0);
init_setting_char("cheat_database_path", g_settings.cheat_database, usrDirPath);
init_setting_bool("rewind_enable", g_settings.rewind_enable, false);
}
static void get_path_settings(bool multiman_support)
@ -542,6 +543,7 @@ begin_loop:
}
else if(mode_switch == MODE_MENU)
{
printf("rewind enable: %d\n", g_settings.rewind_enable);
menu_loop();
if(init_ssnes)
{
@ -559,6 +561,8 @@ begin_loop:
snprintf(arg5, sizeof(arg5), SYS_CONFIG_FILE);
char *argv_[] = { arg1, arg2, arg3, arg4, arg5, NULL };
printf("rewind enable: %d\n", g_settings.rewind_enable);
int argc = sizeof(argv_) / sizeof(argv_[0]) - 1;
int init_ret = ssnes_main_init(argc, argv_);
g_emulator_initialized = 1;

View File

@ -375,6 +375,21 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] =
0,
1
},
{
SETTING_EMU_REWIND_ENABLED,
"Rewind",
"",
0.0f,
0.0f,
YELLOW,
"INFO - [Rewind] feature is set to 'OFF'.",
WHITE,
0.91f,
0.09f,
0.83f,
0,
1
},
{
SETTING_EMU_VIDEO_DEFAULT_ALL,
"DEFAULT",

View File

@ -680,6 +680,20 @@ static void set_setting_label(menu * menu_obj, int currentsetting)
else
menu_obj->items[currentsetting].text_color = ORANGE;
break;
case SETTING_EMU_REWIND_ENABLED:
if(g_settings.rewind_enable)
{
snprintf(menu_obj->items[currentsetting].setting_text, sizeof(menu_obj->items[currentsetting].setting_text), "ON");
menu_obj->items[currentsetting].text_color = GREEN;
snprintf(menu_obj->items[currentsetting].comment, sizeof(menu_obj->items[currentsetting].comment), "INFO - [Rewind] feature is set to 'ON'. You can rewind the game in real-time.");
}
else
{
snprintf(menu_obj->items[currentsetting].setting_text, sizeof(menu_obj->items[currentsetting].setting_text), "OFF");
menu_obj->items[currentsetting].text_color = ORANGE;
snprintf(menu_obj->items[currentsetting].comment, sizeof(menu_obj->items[currentsetting].comment), "INFO - [Rewind] feature is set to 'OFF'.");
}
break;
case SETTING_EMU_VIDEO_DEFAULT_ALL:
if(menu_obj->selected == currentsetting)
menu_obj->items[currentsetting].text_color = GREEN;
@ -1039,6 +1053,18 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue)
if(CTRL_START(state))
g_extern.state_slot = 0;
break;
case SETTING_EMU_REWIND_ENABLED:
if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) || CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state) || CTRL_CROSS(state))
{
g_settings.rewind_enable = !g_settings.rewind_enable;
set_text_message("", 7);
}
if(CTRL_START(state))
{
g_settings.rewind_enable = false;
}
break;
case SETTING_EMU_VIDEO_DEFAULT_ALL:
break;
case SETTING_EMU_AUDIO_DEFAULT_ALL:
@ -1278,7 +1304,6 @@ static void select_rom(void)
snprintf(rom_path_temp, sizeof(rom_path_temp), "%s/%s", FILEBROWSER_GET_CURRENT_DIRECTORY_NAME(browser), FILEBROWSER_GET_CURRENT_FILENAME(browser));
menu_is_running = 0;
memset(&g_extern, 0, sizeof(g_extern));
snprintf(g_console.rom_path, sizeof(g_console.rom_path), "%s/%s", FILEBROWSER_GET_CURRENT_DIRECTORY_NAME(browser), FILEBROWSER_GET_CURRENT_FILENAME(browser));
init_ssnes = 1;
mode_switch = MODE_EMULATION;

View File

@ -97,6 +97,7 @@ enum
/* port-specific */
SETTING_EMU_CURRENT_SAVE_STATE_SLOT,
SETTING_EMU_DEFAULT_ALL,
SETTING_EMU_REWIND_ENABLED,
SETTING_EMU_VIDEO_DEFAULT_ALL,
SETTING_EMU_AUDIO_DEFAULT_ALL,
/* end of port-specific */