diff options
author | Vas Crabb <vas@vastheman.com> | 2023-02-28 05:16:13 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2023-02-28 05:29:22 +1100 |
commit | 42e759ade491813588fda7cb185878d80a831a05 (patch) | |
tree | 3ac72bab96675ae38062da992b42204a5bdbfef5 /src/frontend/mame/ui | |
parent | 410a3dbeae2021a357dc2da96c17e189adb715cf (diff) |
osd/modules/input: Always use DirectInput with desktop window in background mode.
There are multiple issues with what MAME was doing, but the most glaring
is that it violates the DirectInput interface contract that requires the
window associated with an open device must not be destroyed. See
documentation for IDirectInputDevice8::SetCooperativeLevel: "This
parameter must be a valid top-level window handle that belongs to the
process. The window associated with the device must not be destroyed
while it is still active in a DirectInput device."
The previous code also prevented DirectInput controllers from working
when using multiple windows if any window other than the first window
had focus.
Also fixed SDL builds not correctly recognising when all windows lose
focus, and save state menu not appearing.
Diffstat (limited to 'src/frontend/mame/ui')
-rw-r--r-- | src/frontend/mame/ui/ui.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 37f60a8795d..3907ad6ae71 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -54,18 +54,6 @@ /*************************************************************************** - CONSTANTS -***************************************************************************/ - -enum -{ - LOADSAVE_NONE, - LOADSAVE_LOAD, - LOADSAVE_SAVE -}; - - -/*************************************************************************** LOCAL VARIABLES ***************************************************************************/ @@ -1376,15 +1364,17 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container) // handle a save state request if (machine().ui_input().pressed(IPT_UI_SAVE_STATE)) { + osd_printf_info("Save requested\n"); start_save_state(); - return LOADSAVE_SAVE; + return 0; } // handle a load state request if (machine().ui_input().pressed(IPT_UI_LOAD_STATE)) { + osd_printf_info("Load requested\n"); start_load_state(); - return LOADSAVE_LOAD; + return 0; } // handle a save snapshot request |