menu: add reset hotkey

This commit is contained in:
notaz 2017-10-03 23:00:39 +03:00
parent e42a47e208
commit 9db6a54485
6 changed files with 9 additions and 2 deletions

View file

@ -417,7 +417,7 @@ static void keys_parse_all(FILE *f)
acts = parse_bind_val(val, &type);
if (acts == -1) {
lprintf("config: unhandled action \"%s\"\n", val);
return;
continue;
}
mystrip(var + 5);

View file

@ -1141,6 +1141,8 @@ static void run_events_ui(unsigned int which)
emu_status_msg("SAVE SLOT %i [%s]", state_slot,
emu_check_save_file(state_slot, NULL) ? "USED" : "FREE");
}
if (which & PEV_RESET)
emu_reset_game();
if (which & PEV_MENU)
engineState = PGS_Menu;
}

View file

@ -28,6 +28,7 @@
#define PEVB_PICO_PNEXT 21
#define PEVB_PICO_PPREV 20
#define PEVB_PICO_SWINP 19
#define PEVB_RESET 18
#define PEV_VOL_DOWN (1 << PEVB_VOL_DOWN)
#define PEV_VOL_UP (1 << PEVB_VOL_UP)
@ -41,7 +42,8 @@
#define PEV_PICO_PNEXT (1 << PEVB_PICO_PNEXT)
#define PEV_PICO_PPREV (1 << PEVB_PICO_PPREV)
#define PEV_PICO_SWINP (1 << PEVB_PICO_SWINP)
#define PEV_RESET (1 << PEVB_RESET)
#define PEV_MASK 0x7ff80000
#define PEV_MASK 0x7ffc0000
#endif /* INCLUDE_c48097f3ff2a6a9af1cce8fd7a9b3f0c */

View file

@ -312,6 +312,7 @@ me_bind_action emuctrl_actions[] =
{ "Volume Down ", PEV_VOL_DOWN },
{ "Volume Up ", PEV_VOL_UP },
{ "Fast forward ", PEV_FF },
{ "Reset Game ", PEV_RESET },
{ "Enter Menu ", PEV_MENU },
{ "Pico Next page ", PEV_PICO_PNEXT },
{ "Pico Prev page ", PEV_PICO_PPREV },

View file

@ -35,6 +35,7 @@ const struct in_default_bind in_sdl_defbinds[] __attribute__((weak)) = {
{ SDLK_RETURN, IN_BINDTYPE_PLAYER12, GBTN_START },
{ SDLK_f, IN_BINDTYPE_PLAYER12, GBTN_MODE },
{ SDLK_ESCAPE, IN_BINDTYPE_EMU, PEVB_MENU },
{ SDLK_TAB, IN_BINDTYPE_EMU, PEVB_RESET },
{ SDLK_F1, IN_BINDTYPE_EMU, PEVB_STATE_SAVE },
{ SDLK_F2, IN_BINDTYPE_EMU, PEVB_STATE_LOAD },
{ SDLK_F3, IN_BINDTYPE_EMU, PEVB_SSLOT_PREV },

View file

@ -74,6 +74,7 @@ static struct in_default_bind in_evdev_defbinds[] =
{ KEY_S, IN_BINDTYPE_PLAYER12, GBTN_B },
{ KEY_D, IN_BINDTYPE_PLAYER12, GBTN_C },
{ KEY_ENTER, IN_BINDTYPE_PLAYER12, GBTN_START },
{ KEY_R, IN_BINDTYPE_EMU, PEVB_RESET },
{ KEY_F, IN_BINDTYPE_EMU, PEVB_FF },
{ KEY_BACKSPACE,IN_BINDTYPE_EMU, PEVB_FF },
{ KEY_BACKSLASH,IN_BINDTYPE_EMU, PEVB_MENU },