From ac8621ccabcdff890e0f1844e8a1b2362cb7f1c3 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 14 Jul 2015 12:34:16 +0200 Subject: [PATCH 1/2] GCAdapter: Disable the scanning thread when direct connect is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The goal of this commit is to let people who experience driver issues with libusb and windows disable the scanning thread (to avoid mouse issues, keyboard issues, and audio issues). Also disable the rumble setting when the adapter driver is not detected, and don’t do anything if libusb can’t init for some reason. --- Source/Core/Core/HW/SI_GCAdapter.cpp | 1 + Source/Core/DolphinWX/ControllerConfigDiag.cpp | 1 + Source/Core/DolphinWX/ControllerConfigDiag.h | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/Source/Core/Core/HW/SI_GCAdapter.cpp b/Source/Core/Core/HW/SI_GCAdapter.cpp index b54c07ef74..9b4482c452 100644 --- a/Source/Core/Core/HW/SI_GCAdapter.cpp +++ b/Source/Core/Core/HW/SI_GCAdapter.cpp @@ -146,6 +146,7 @@ void Init() if (ret) { ERROR_LOG(SERIALINTERFACE, "libusb_init failed with error: %d", ret); + s_libusb_driver_not_supported = true; Shutdown(); } else diff --git a/Source/Core/DolphinWX/ControllerConfigDiag.cpp b/Source/Core/DolphinWX/ControllerConfigDiag.cpp index ff5bafc44e..170439f1f5 100644 --- a/Source/Core/DolphinWX/ControllerConfigDiag.cpp +++ b/Source/Core/DolphinWX/ControllerConfigDiag.cpp @@ -174,6 +174,7 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateGamecubeSizer() m_adapter_status->SetLabelText(_("Driver Not Detected")); gamecube_adapter->Disable(); gamecube_adapter->SetValue(false); + gamecube_rumble->Disable(); } } else diff --git a/Source/Core/DolphinWX/ControllerConfigDiag.h b/Source/Core/DolphinWX/ControllerConfigDiag.h index 5fa2c0f52e..3c6582a5e1 100644 --- a/Source/Core/DolphinWX/ControllerConfigDiag.h +++ b/Source/Core/DolphinWX/ControllerConfigDiag.h @@ -73,6 +73,10 @@ private: void OnGameCubeAdapter(wxCommandEvent& event) { SConfig::GetInstance().m_GameCubeAdapter = event.IsChecked(); + if (event.IsChecked()) + SI_GCAdapter::StartScanThread(); + else + SI_GCAdapter::StopScanThread(); event.Skip(); } void OnAdapterRumble(wxCommandEvent& event) From cae00254a5c6c1d177b13552243613a92bf37738 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 14 Jul 2015 17:15:26 +0200 Subject: [PATCH 2/2] GCAdapter: Only start the thread on startup if direct connect is enabled --- Source/Core/Core/HW/SI_GCAdapter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/SI_GCAdapter.cpp b/Source/Core/Core/HW/SI_GCAdapter.cpp index 9b4482c452..8660f44d65 100644 --- a/Source/Core/Core/HW/SI_GCAdapter.cpp +++ b/Source/Core/Core/HW/SI_GCAdapter.cpp @@ -151,7 +151,8 @@ void Init() } else { - StartScanThread(); + if (SConfig::GetInstance().m_GameCubeAdapter) + StartScanThread(); } }