From 4b2ce429cd136c007207c704f9af7c13d7ea18ec Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Tue, 18 Dec 2018 19:15:36 -0600 Subject: [PATCH] win32: Try to propagate controller enabled state. --- win32/wsnes9x.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index a997fdab..ea9d8f9e 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -571,9 +571,7 @@ void ControllerOptionsFromControllers() GUI.ControllerOption = SNES_JOYPAD; - if (controller[0] == CTL_JOYPAD && controller[1] == CTL_JOYPAD) - GUI.ControllerOption = SNES_JOYPAD; - else if (controller[0] == CTL_JOYPAD && controller[1] == CTL_MP5) + if (controller[0] == CTL_JOYPAD && controller[1] == CTL_MP5) GUI.ControllerOption = SNES_MULTIPLAYER5; else if (controller[0] == CTL_MP5 && controller[1] == CTL_MP5) GUI.ControllerOption = SNES_MULTIPLAYER8; @@ -589,6 +587,9 @@ void ControllerOptionsFromControllers() GUI.ControllerOption = SNES_JUSTIFIER_2; else if (controller[0] == CTL_JOYPAD && controller[1] == CTL_MACSRIFLE) GUI.ControllerOption = SNES_MACSRIFLE; + else if (controller[0] == CTL_JOYPAD) + GUI.ControllerOption = SNES_JOYPAD; + } void ChangeInputDevice(void) @@ -1764,6 +1765,7 @@ LRESULT CALLBACK WinProc( RestoreGUIDisplay (); DialogBox(g_hInst, MAKEINTRESOURCE(IDD_INPUTCONFIG), hWnd, DlgInputConfig); RestoreSNESDisplay (); + ChangeInputDevice (); break; case ID_OPTIONS_KEYCUSTOM: @@ -3251,12 +3253,11 @@ int WINAPI WinMain( ConfigFile::SetAlphaSort(false); ConfigFile::SetTimeSort(false); - ChangeInputDevice(); - const TCHAR *rom_filename = WinParseCommandLineAndLoadConfigFile (GetCommandLine()); WinSaveConfigFile (); WinLockConfigFile (); + ChangeInputDevice(); ControllerOptionsFromControllers(); WinInit (hInstance);