Previous 199869 Revisions Next

r44644 Tuesday 2nd February, 2016 at 21:18:57 UTC by Victor Vasiliev
Do not read the load/save state filename while sequence is still pressed

Fixes the issue where, if the save state button was bound to something
that was a legal save state input, it would occasionally immediately
save the state onto the same button as "save state" input itself was
bound.
[src/emu/ui]ui.cpp ui.h

trunk/src/emu/ui/ui.cpp
r253155r253156
16251625   if (machine.ui_input().pressed(IPT_UI_SAVE_STATE))
16261626   {
16271627      machine.pause();
1628      machine.ui().m_load_save_hold = true;
16281629      return machine.ui().set_handler(handler_load_save, LOADSAVE_SAVE);
16291630   }
16301631
r253155r253156
16321633   if (machine.ui_input().pressed(IPT_UI_LOAD_STATE))
16331634   {
16341635      machine.pause();
1636      machine.ui().m_load_save_hold = true;
16351637      return machine.ui().set_handler(handler_load_save, LOADSAVE_LOAD);
16361638   }
16371639
r253155r253156
17131715   else
17141716      machine.ui().draw_message_window(container, "Select position to load from");
17151717
1718   // if load/save state sequence is still being pressed, do not read the filename yet
1719   if (machine.ui().m_load_save_hold) {
1720      bool seq_in_progress = false;
1721      const input_seq &load_save_seq = state == LOADSAVE_SAVE ?
1722         machine.ioport().type_seq(IPT_UI_SAVE_STATE) :
1723         machine.ioport().type_seq(IPT_UI_LOAD_STATE);
1724
1725      for (int i = 0; i < load_save_seq.length(); i++)
1726         if (machine.input().code_pressed_once(load_save_seq[i]))
1727            seq_in_progress = true;
1728
1729      if (seq_in_progress)
1730         return state;
1731      else
1732         machine.ui().m_load_save_hold = false;
1733   }
1734
17161735   // check for cancel key
17171736   if (machine.ui_input().pressed(IPT_UI_CANCEL))
17181737   {
trunk/src/emu/ui/ui.h
r253155r253156
182182   std::unique_ptr<UINT8[]> m_non_char_keys_down;
183183   render_texture *        m_mouse_arrow_texture;
184184   bool                    m_mouse_show;
185   bool                    m_load_save_hold;
185186
186187   // text generators
187188   std::string &disclaimer_string(std::string &buffer);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team