From a015851b02a94a9c064cf47475302e180b51905c Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Fri, 29 Mar 2019 06:15:58 -0500 Subject: [PATCH] HW/SI: GCAdapter calibration fix. --- Source/Core/Core/HW/SI/SI_DeviceGCAdapter.cpp | 3 +++ Source/Core/InputCommon/GCAdapter.cpp | 5 +++++ Source/Core/InputCommon/GCAdapter.h | 1 + Source/Core/InputCommon/GCAdapter_Android.cpp | 5 +++++ 4 files changed, 14 insertions(+) diff --git a/Source/Core/Core/HW/SI/SI_DeviceGCAdapter.cpp b/Source/Core/Core/HW/SI/SI_DeviceGCAdapter.cpp index 4e18ae39a7..880f8f88e2 100644 --- a/Source/Core/Core/HW/SI/SI_DeviceGCAdapter.cpp +++ b/Source/Core/Core/HW/SI/SI_DeviceGCAdapter.cpp @@ -18,6 +18,9 @@ namespace SerialInterface CSIDevice_GCAdapter::CSIDevice_GCAdapter(SIDevices device, int device_number) : CSIDevice_GCController(device, device_number) { + // Make sure PAD_GET_ORIGIN gets set due to a newly connected device. + GCAdapter::ResetDeviceType(m_device_number); + // get the correct pad number that should rumble locally when using netplay const int pad_num = NetPlay_InGamePadToLocalPad(m_device_number); if (pad_num < 4) diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp index f6b55a7fac..196f693b07 100644 --- a/Source/Core/InputCommon/GCAdapter.cpp +++ b/Source/Core/InputCommon/GCAdapter.cpp @@ -485,6 +485,11 @@ bool DeviceConnected(int chan) return s_controller_type[chan] != ControllerTypes::CONTROLLER_NONE; } +void ResetDeviceType(int chan) +{ + s_controller_type[chan] = ControllerTypes::CONTROLLER_NONE; +} + bool UseAdapter() { const auto& si_devices = SConfig::GetInstance().m_SIDevice; diff --git a/Source/Core/InputCommon/GCAdapter.h b/Source/Core/InputCommon/GCAdapter.h index 179b27793c..02b15a3cd2 100644 --- a/Source/Core/InputCommon/GCAdapter.h +++ b/Source/Core/InputCommon/GCAdapter.h @@ -29,6 +29,7 @@ void Output(int chan, u8 rumble_command); bool IsDetected(); bool IsDriverDetected(); bool DeviceConnected(int chan); +void ResetDeviceType(int chan); bool UseAdapter(); } // end of namespace GCAdapter diff --git a/Source/Core/InputCommon/GCAdapter_Android.cpp b/Source/Core/InputCommon/GCAdapter_Android.cpp index d71e665015..9c6092dc78 100644 --- a/Source/Core/InputCommon/GCAdapter_Android.cpp +++ b/Source/Core/InputCommon/GCAdapter_Android.cpp @@ -382,6 +382,11 @@ bool DeviceConnected(int chan) return s_controller_type[chan] != ControllerTypes::CONTROLLER_NONE; } +void ResetDeviceType(int chan) +{ + s_controller_type[chan] = ControllerTypes::CONTROLLER_NONE; +} + bool UseAdapter() { const auto& si_devices = SConfig::GetInstance().m_SIDevice;