(PS3/Core) Make reset into an extern function so it can be called

from port-specific code
This commit is contained in:
TwinAphex51224 2012-02-02 14:22:43 +01:00
parent a509d40bf6
commit 02c3977e9d
3 changed files with 12 additions and 7 deletions

View File

@ -388,6 +388,7 @@ void config_set_defaults(void);
bool config_load_file(const char *path);
#endif
void perform_reset(void);
void ssnes_main_clear_state(void);
int ssnes_main_init(int argc, char *argv[]);
bool ssnes_main_iterate(void);

View File

@ -521,6 +521,7 @@ static void ingame_menu(void)
ingame_menu_item = 0;
g_console.ingame_menu_enable = false;
mode_switch = MODE_EMULATION;
perform_reset();
}
ingame_menu_reset_entry_colors (ingame_menu_item);
strcpy(comment, "Press 'CROSS' to reset the game.");

17
ssnes.c
View File

@ -1847,18 +1847,21 @@ static void check_oneshot(void)
old_rewind_state = new_rewind_state;
}
void perform_reset(void)
{
SSNES_LOG("Resetting game!\n");
msg_queue_clear(g_extern.msg_queue);
msg_queue_push(g_extern.msg_queue, "Reset!", 1, 120);
psnes_reset();
init_controllers(); // bSNES since v073r01 resets controllers to JOYPAD after a reset, so just enforce it here.
}
static void check_reset(void)
{
static bool old_state = false;
bool new_state = driver.input->key_pressed(driver.input_data, SSNES_RESET);
if (new_state && !old_state)
{
SSNES_LOG("Resetting game!\n");
msg_queue_clear(g_extern.msg_queue);
msg_queue_push(g_extern.msg_queue, "Reset!", 1, 120);
psnes_reset();
init_controllers(); // bSNES since v073r01 resets controllers to JOYPAD after a reset, so just enforce it here.
}
perform_reset();
old_state = new_state;
}