From: notaz Date: Tue, 3 Oct 2017 20:00:39 +0000 (+0300) Subject: menu: add reset hotkey X-Git-Tag: v1.92~13 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9db6a54485501b56b0f2f5db4d093c38fe495bda;p=picodrive.git menu: add reset hotkey --- diff --git a/platform/common/config_file.c b/platform/common/config_file.c index 97369cb4..e66d4e1c 100644 --- a/platform/common/config_file.c +++ b/platform/common/config_file.c @@ -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); diff --git a/platform/common/emu.c b/platform/common/emu.c index 0a1b59c0..6a8c940b 100644 --- a/platform/common/emu.c +++ b/platform/common/emu.c @@ -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; } diff --git a/platform/common/input_pico.h b/platform/common/input_pico.h index c2730b52..c0501d33 100644 --- a/platform/common/input_pico.h +++ b/platform/common/input_pico.h @@ -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 */ diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c index cc116382..f928f054 100644 --- a/platform/common/menu_pico.c +++ b/platform/common/menu_pico.c @@ -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 }, diff --git a/platform/common/plat_sdl.c b/platform/common/plat_sdl.c index 3387b952..1b617d5a 100644 --- a/platform/common/plat_sdl.c +++ b/platform/common/plat_sdl.c @@ -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 }, diff --git a/platform/pandora/plat.c b/platform/pandora/plat.c index 8f8eac6c..9cd5fc5b 100644 --- a/platform/pandora/plat.c +++ b/platform/pandora/plat.c @@ -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 },