mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-24 18:32:49 -06:00
Fix for always firing triggers on some controllers, trigger threshold more universal
This commit is contained in:
parent
e69d715e3d
commit
d00972fce1
2 changed files with 5 additions and 5 deletions
|
@ -156,14 +156,12 @@ void Adapter::Read() {
|
||||||
pads[port].axis_value = pads[port].substick_y;
|
pads[port].axis_value = pads[port].substick_y;
|
||||||
pad_queue[port].Push(pads[port]);
|
pad_queue[port].Push(pads[port]);
|
||||||
}
|
}
|
||||||
if (pads[port].trigger_left > pads[port].TRIGGER_CENTER + pads[port].THRESHOLD ||
|
if (pads[port].trigger_left > pads[port].TRIGGER_THRESHOLD) {
|
||||||
pads[port].trigger_left < pads[port].TRIGGER_CENTER - pads[port].THRESHOLD) {
|
|
||||||
pads[port].axis = GCAdapter::PadAxes::TriggerLeft;
|
pads[port].axis = GCAdapter::PadAxes::TriggerLeft;
|
||||||
pads[port].axis_value = pads[port].trigger_left;
|
pads[port].axis_value = pads[port].trigger_left;
|
||||||
pad_queue[port].Push(pads[port]);
|
pad_queue[port].Push(pads[port]);
|
||||||
}
|
}
|
||||||
if (pads[port].trigger_right > pads[port].TRIGGER_CENTER + pads[port].THRESHOLD ||
|
if (pads[port].trigger_right > pads[port].TRIGGER_THRESHOLD) {
|
||||||
pads[port].trigger_right < pads[port].TRIGGER_CENTER - pads[port].THRESHOLD) {
|
|
||||||
pads[port].axis = GCAdapter::PadAxes::TriggerRight;
|
pads[port].axis = GCAdapter::PadAxes::TriggerRight;
|
||||||
pads[port].axis_value = pads[port].trigger_right;
|
pads[port].axis_value = pads[port].trigger_right;
|
||||||
pad_queue[port].Push(pads[port]);
|
pad_queue[port].Push(pads[port]);
|
||||||
|
|
|
@ -63,9 +63,11 @@ struct GCPadStatus {
|
||||||
static constexpr u8 C_STICK_CENTER_X = 0x80;
|
static constexpr u8 C_STICK_CENTER_X = 0x80;
|
||||||
static constexpr u8 C_STICK_CENTER_Y = 0x80;
|
static constexpr u8 C_STICK_CENTER_Y = 0x80;
|
||||||
static constexpr u8 C_STICK_RADIUS = 0x7f;
|
static constexpr u8 C_STICK_RADIUS = 0x7f;
|
||||||
static constexpr u8 TRIGGER_CENTER = 20;
|
|
||||||
static constexpr u8 THRESHOLD = 10;
|
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{};
|
u8 port{};
|
||||||
PadAxes axis{PadAxes::Undefined};
|
PadAxes axis{PadAxes::Undefined};
|
||||||
u8 axis_value{255};
|
u8 axis_value{255};
|
||||||
|
|
Loading…
Reference in a new issue