summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmeer <aj662@drexel.edu>2020-07-04 06:40:48 +0200
committerAmeer <aj662@drexel.edu>2020-07-04 06:40:48 +0200
commitd00972fce1fe5f2eb13c7e5d7e4e56036cb6bc91 (patch)
tree3fd2a2bc5f6cc3ac29eef23759cc93d342152372
parentAddress lioncash feedback: Log formatting, extern const PadButtonArray, little touch ups (diff)
downloadyuzu-d00972fce1fe5f2eb13c7e5d7e4e56036cb6bc91.tar
yuzu-d00972fce1fe5f2eb13c7e5d7e4e56036cb6bc91.tar.gz
yuzu-d00972fce1fe5f2eb13c7e5d7e4e56036cb6bc91.tar.bz2
yuzu-d00972fce1fe5f2eb13c7e5d7e4e56036cb6bc91.tar.lz
yuzu-d00972fce1fe5f2eb13c7e5d7e4e56036cb6bc91.tar.xz
yuzu-d00972fce1fe5f2eb13c7e5d7e4e56036cb6bc91.tar.zst
yuzu-d00972fce1fe5f2eb13c7e5d7e4e56036cb6bc91.zip
-rw-r--r--src/input_common/gcadapter/gc_adapter.cpp6
-rw-r--r--src/input_common/gcadapter/gc_adapter.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp
index f58b0e11c..b39d2a3fb 100644
--- a/src/input_common/gcadapter/gc_adapter.cpp
+++ b/src/input_common/gcadapter/gc_adapter.cpp
@@ -156,14 +156,12 @@ void Adapter::Read() {
pads[port].axis_value = pads[port].substick_y;
pad_queue[port].Push(pads[port]);
}
- if (pads[port].trigger_left > pads[port].TRIGGER_CENTER + pads[port].THRESHOLD ||
- pads[port].trigger_left < pads[port].TRIGGER_CENTER - pads[port].THRESHOLD) {
+ if (pads[port].trigger_left > pads[port].TRIGGER_THRESHOLD) {
pads[port].axis = GCAdapter::PadAxes::TriggerLeft;
pads[port].axis_value = pads[port].trigger_left;
pad_queue[port].Push(pads[port]);
}
- if (pads[port].trigger_right > pads[port].TRIGGER_CENTER + pads[port].THRESHOLD ||
- pads[port].trigger_right < pads[port].TRIGGER_CENTER - pads[port].THRESHOLD) {
+ if (pads[port].trigger_right > pads[port].TRIGGER_THRESHOLD) {
pads[port].axis = GCAdapter::PadAxes::TriggerRight;
pads[port].axis_value = pads[port].trigger_right;
pad_queue[port].Push(pads[port]);
diff --git a/src/input_common/gcadapter/gc_adapter.h b/src/input_common/gcadapter/gc_adapter.h
index 161d522ac..0ea6263eb 100644
--- a/src/input_common/gcadapter/gc_adapter.h
+++ b/src/input_common/gcadapter/gc_adapter.h
@@ -63,9 +63,11 @@ struct GCPadStatus {
static constexpr u8 C_STICK_CENTER_X = 0x80;
static constexpr u8 C_STICK_CENTER_Y = 0x80;
static constexpr u8 C_STICK_RADIUS = 0x7f;
- static constexpr u8 TRIGGER_CENTER = 20;
static constexpr u8 THRESHOLD = 10;
+ // 256/4, at least a quarter press to count as a press. For polling mostly
+ static constexpr u8 TRIGGER_THRESHOLD = 64;
+
u8 port{};
PadAxes axis{PadAxes::Undefined};
u8 axis_value{255};