diff --git a/Source/Core/Common/Src/ConsoleListener.cpp b/Source/Core/Common/Src/ConsoleListener.cpp index ff4e0b3c90..c987f3c441 100644 --- a/Source/Core/Common/Src/ConsoleListener.cpp +++ b/Source/Core/Common/Src/ConsoleListener.cpp @@ -253,8 +253,10 @@ void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool void ConsoleListener::CustomLog(const char *Text) { + #ifdef _WIN32 DWORD cCharsWritten; WriteConsole(hConsole, Text, (DWORD)strlen(Text), &cCharsWritten, NULL); + #endif } void ConsoleListener::Log(LogTypes::LOG_LEVELS Level, const char *Text) diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp index c4f11df9b8..16c96d7a27 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp @@ -692,8 +692,11 @@ void WiimotePadConfigDialog::Update(wxTimerEvent& WXUNUSED(event)) { if (!LiveUpdates) return; + // Don't run this the first time + int OldNumDIDevices; + if (WiiMoteEmu::NumDIDevices == -1) OldNumDIDevices = InputCommon::SearchDIDevices(); // Search for connected devices and update dialog - int OldNumDIDevices = WiiMoteEmu::NumDIDevices; + OldNumDIDevices = WiiMoteEmu::NumDIDevices; WiiMoteEmu::NumDIDevices = InputCommon::SearchDIDevices(); // Update if a pad has been connected/disconnected. Todo: Add a better check that also takes into consideration the pad id diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp index d08b209f85..1151aee786 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp @@ -57,7 +57,7 @@ wiimote_key g_ExtKey; // The extension encryption key bool g_Encryption; // Encryption on or off // Gamepad input -int NumPads = 0, NumDIDevices = 0; // Number of pads +int NumPads = 0, NumDIDevices = -1; // Number of pads bool SDLPolling = true; std::vector joyinfo; InputCommon::CONTROLLER_STATE_NEW PadState[4]; diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp index 57e286491e..db43475c61 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp @@ -173,8 +173,11 @@ void PADConfigDialognJoy::UpdateSlow() { if (!LiveUpdates) return; + // Don't run this the first time + int OldNumDIDevices; + if (NumDIDevices == -1) OldNumDIDevices = InputCommon::SearchDIDevices(); // Search for connected devices and update dialog - int OldNumDIDevices = NumDIDevices; + OldNumDIDevices = NumDIDevices; NumDIDevices = InputCommon::SearchDIDevices(); // Update if a pad has been connected/disconnected. Todo: Add a better check that also takes into consideration the pad id diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index d97c9de45d..fd65a10b53 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -49,7 +49,7 @@ InputCommon::CONTROLLER_STATE PadState[4]; InputCommon::CONTROLLER_MAPPING PadMapping[4]; bool g_EmulatorRunning = false; bool SDLPolling = true; -int NumPads = 0, NumDIDevices = 0, LastPad = 0; +int NumPads = 0, NumDIDevices = -1, LastPad = 0; #ifdef _WIN32 HWND m_hWnd = NULL, m_hConsole = NULL; // Handle to window #endif