summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmeer <aj662@drexel.edu>2020-07-07 04:09:07 +0200
committerAmeer <aj662@drexel.edu>2020-07-07 04:09:07 +0200
commit86abff48e1212498a3f6361012062458d8ae24ba (patch)
treec8973923bcd4ca500d66737642657d3f4bac9b2d /src
parentSave origin state of GC controller analog features, compare against origin for input detection (diff)
downloadyuzu-86abff48e1212498a3f6361012062458d8ae24ba.tar
yuzu-86abff48e1212498a3f6361012062458d8ae24ba.tar.gz
yuzu-86abff48e1212498a3f6361012062458d8ae24ba.tar.bz2
yuzu-86abff48e1212498a3f6361012062458d8ae24ba.tar.lz
yuzu-86abff48e1212498a3f6361012062458d8ae24ba.tar.xz
yuzu-86abff48e1212498a3f6361012062458d8ae24ba.tar.zst
yuzu-86abff48e1212498a3f6361012062458d8ae24ba.zip
Diffstat (limited to 'src')
-rw-r--r--src/input_common/gcadapter/gc_adapter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp
index 8465309d0..f173a018a 100644
--- a/src/input_common/gcadapter/gc_adapter.cpp
+++ b/src/input_common/gcadapter/gc_adapter.cpp
@@ -49,6 +49,11 @@ GCPadStatus Adapter::GetPadStatus(int port, const std::array<u8, 37>& adapter_pa
PadButton::PAD_TRIGGER_L,
};
+ if (adapter_controllers_status[port] == ControllerTypes::None && !get_origin[port]) {
+ // Controller may have been disconnected, recalibrate if reconnected.
+ get_origin[port] = true;
+ }
+
if (adapter_controllers_status[port] != ControllerTypes::None) {
const u8 b1 = adapter_payload[1 + (9 * port) + 1];
const u8 b2 = adapter_payload[1 + (9 * port) + 2];