diff options
Diffstat (limited to 'src/emu/ui')
-rw-r--r-- | src/emu/ui/ui.cpp | 19 | ||||
-rw-r--r-- | src/emu/ui/ui.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp index 304c365ac6a..df16d384ebb 100644 --- a/src/emu/ui/ui.cpp +++ b/src/emu/ui/ui.cpp @@ -1625,6 +1625,7 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co if (machine.ui_input().pressed(IPT_UI_SAVE_STATE)) { machine.pause(); + machine.ui().m_load_save_hold = true; return machine.ui().set_handler(handler_load_save, LOADSAVE_SAVE); } @@ -1632,6 +1633,7 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co if (machine.ui_input().pressed(IPT_UI_LOAD_STATE)) { machine.pause(); + machine.ui().m_load_save_hold = true; return machine.ui().set_handler(handler_load_save, LOADSAVE_LOAD); } @@ -1713,6 +1715,23 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container else machine.ui().draw_message_window(container, "Select position to load from"); + // if load/save state sequence is still being pressed, do not read the filename yet + if (machine.ui().m_load_save_hold) { + bool seq_in_progress = false; + const input_seq &load_save_seq = state == LOADSAVE_SAVE ? + machine.ioport().type_seq(IPT_UI_SAVE_STATE) : + machine.ioport().type_seq(IPT_UI_LOAD_STATE); + + for (int i = 0; i < load_save_seq.length(); i++) + if (machine.input().code_pressed_once(load_save_seq[i])) + seq_in_progress = true; + + if (seq_in_progress) + return state; + else + machine.ui().m_load_save_hold = false; + } + // check for cancel key if (machine.ui_input().pressed(IPT_UI_CANCEL)) { diff --git a/src/emu/ui/ui.h b/src/emu/ui/ui.h index ac68a2fb773..d0f7a28ad27 100644 --- a/src/emu/ui/ui.h +++ b/src/emu/ui/ui.h @@ -182,6 +182,7 @@ private: std::unique_ptr<UINT8[]> m_non_char_keys_down; render_texture * m_mouse_arrow_texture; bool m_mouse_show; + bool m_load_save_hold; // text generators std::string &disclaimer_string(std::string &buffer); |