From 2995e59d5061f5ab0f84dd56510d42e8944827a6 Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 11 Feb 2024 18:45:56 +0100 Subject: ui: add quick save/load state shortcut, default key undecided --- src/emu/inpttype.h | 2 ++ src/emu/inpttype.ipp | 2 ++ src/frontend/mame/ui/ui.cpp | 14 ++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/src/emu/inpttype.h b/src/emu/inpttype.h index de5b42d0a77..fa711b7eabd 100644 --- a/src/emu/inpttype.h +++ b/src/emu/inpttype.h @@ -268,7 +268,9 @@ enum ioport_type : osd::u32 IPT_UI_PAUSE_SINGLE, IPT_UI_REWIND_SINGLE, IPT_UI_SAVE_STATE, + IPT_UI_SAVE_STATE_QUICK, IPT_UI_LOAD_STATE, + IPT_UI_LOAD_STATE_QUICK, IPT_UI_RESET_MACHINE, IPT_UI_SOFT_RESET, IPT_UI_SHOW_GFX, diff --git a/src/emu/inpttype.ipp b/src/emu/inpttype.ipp index e5cb81c45fc..d1f4d866df2 100644 --- a/src/emu/inpttype.ipp +++ b/src/emu/inpttype.ipp @@ -894,7 +894,9 @@ namespace { INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_PAUSE_SINGLE, N_p("input-name", "Pause - Single Step"), input_seq(KEYCODE_P, KEYCODE_LSHIFT, input_seq::or_code, KEYCODE_P, KEYCODE_RSHIFT) ) \ INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_REWIND_SINGLE, N_p("input-name", "Rewind - Single Step"), input_seq(KEYCODE_TILDE, KEYCODE_LSHIFT) ) \ INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_SAVE_STATE, N_p("input-name", "Save State"), input_seq(KEYCODE_F7, KEYCODE_LSHIFT, input_seq::or_code, KEYCODE_F7, KEYCODE_RSHIFT) ) \ + INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_SAVE_STATE_QUICK, N_p("input-name", "Save State - Quick"), input_seq() ) \ INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_LOAD_STATE, N_p("input-name", "Load State"), input_seq(KEYCODE_F7, input_seq::not_code, KEYCODE_LSHIFT, input_seq::not_code, KEYCODE_RSHIFT) ) \ + INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_LOAD_STATE_QUICK, N_p("input-name", "Load State - Quick"), input_seq() ) \ INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_RESET_MACHINE, N_p("input-name", "Reset Machine"), input_seq(KEYCODE_F3, KEYCODE_LSHIFT, input_seq::or_code, KEYCODE_F3, KEYCODE_RSHIFT) ) \ INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_SOFT_RESET, N_p("input-name", "Soft Reset"), input_seq(KEYCODE_F3, input_seq::not_code, KEYCODE_LSHIFT, input_seq::not_code, KEYCODE_RSHIFT) ) \ INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_SHOW_GFX, N_p("input-name", "Show Decoded Graphics"), input_seq(KEYCODE_F4) ) \ diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 3a50ecb1e12..09a8d24bdd1 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -1356,6 +1356,20 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container) return 0; } + // handle a quick save state request + if (machine().ui_input().pressed(IPT_UI_SAVE_STATE_QUICK)) + { + machine().schedule_save("quick"); + return 0; + } + + // handle a quick load state request + if (machine().ui_input().pressed(IPT_UI_LOAD_STATE_QUICK)) + { + machine().schedule_load("quick"); + return 0; + } + // handle a save snapshot request if (machine().ui_input().pressed(IPT_UI_SNAPSHOT)) machine().video().save_active_screen_snapshots(); -- cgit v1.2.3