From cc7e028179f38899ac2f8ba2f191ddf154315c21 Mon Sep 17 00:00:00 2001 From: OV2 Date: Mon, 11 Jan 2021 20:15:15 +0100 Subject: [PATCH] win32: poll joypads in hotkey handler if paused or stopped (#684) --- win32/wsnes9x.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index b19818ab..29e6f83a 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -116,6 +116,8 @@ VOID CALLBACK HotkeyTimer( UINT idEvent, UINT uMsg, DWORD dwUser, DWORD dw1, DWO void S9xDetectJoypads(); +void S9xWinScanJoypads(); + #define NOTKNOWN "Unknown Company " #define HEADER_SIZE 512 #define INFO_LEN (0xFF - 0xC0) @@ -2734,6 +2736,10 @@ VOID CALLBACK HotkeyTimer( UINT idEvent, UINT uMsg, DWORD dwUser, DWORD dw1, DWO if(GUI.JoystickHotkeys) { + if (Settings.StopEmulation || (Settings.Paused && !Settings.FrameAdvance) || Settings.ForcedPause) + { + S9xWinScanJoypads(); + } static int counter = 0; static uint32 joyState[6][53]; for(int j = 0 ; j < 6 ; j++) @@ -3273,7 +3279,6 @@ void ControlPadFlagsToS9xPseudoPointer(uint32 p) static void ProcessInput(void) { - extern void S9xWinScanJoypads (); #ifdef NETPLAY_SUPPORT if (!Settings.NetPlay) #endif