diff options
author | MonsterDruide1 <5958456@gmail.com> | 2023-01-03 20:08:25 +0100 |
---|---|---|
committer | MonsterDruide1 <5958456@gmail.com> | 2023-01-03 20:08:25 +0100 |
commit | 04cb05fce01d95941a7bbc6edfe2b5be80aeea1d (patch) | |
tree | 4fcc5cb894d6e23e499512621330ee76416c05f0 /src | |
parent | Merge pull request #9542 from abouvier/cmake-module-path (diff) | |
download | yuzu-04cb05fce01d95941a7bbc6edfe2b5be80aeea1d.tar yuzu-04cb05fce01d95941a7bbc6edfe2b5be80aeea1d.tar.gz yuzu-04cb05fce01d95941a7bbc6edfe2b5be80aeea1d.tar.bz2 yuzu-04cb05fce01d95941a7bbc6edfe2b5be80aeea1d.tar.lz yuzu-04cb05fce01d95941a7bbc6edfe2b5be80aeea1d.tar.xz yuzu-04cb05fce01d95941a7bbc6edfe2b5be80aeea1d.tar.zst yuzu-04cb05fce01d95941a7bbc6edfe2b5be80aeea1d.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hid/emulated_controller.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 5587ee097..71364c323 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -11,6 +11,11 @@ namespace Core::HID { constexpr s32 HID_JOYSTICK_MAX = 0x7fff; constexpr s32 HID_TRIGGER_MAX = 0x7fff; +// Use a common UUID for TAS and Virtual Gamepad +constexpr Common::UUID TAS_UUID = + Common::UUID{{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xA5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}; +constexpr Common::UUID VIRTUAL_UUID = + Common::UUID{{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xFF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}; EmulatedController::EmulatedController(NpadIdType npad_id_type_) : npad_id_type(npad_id_type_) {} @@ -348,10 +353,6 @@ void EmulatedController::ReloadInput() { } } - // Use a common UUID for TAS - static constexpr Common::UUID TAS_UUID = Common::UUID{ - {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xA5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}; - // Register TAS devices. No need to force update for (std::size_t index = 0; index < tas_button_devices.size(); ++index) { if (!tas_button_devices[index]) { @@ -377,10 +378,6 @@ void EmulatedController::ReloadInput() { }); } - // Use a common UUID for Virtual Gamepad - static constexpr Common::UUID VIRTUAL_UUID = Common::UUID{ - {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xFF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}; - // Register virtual devices. No need to force update for (std::size_t index = 0; index < virtual_button_devices.size(); ++index) { if (!virtual_button_devices[index]) { @@ -780,7 +777,12 @@ void EmulatedController::SetStick(const Common::Input::CallbackStatus& callback, // Only read stick values that have the same uuid or are over the threshold to avoid flapping if (controller.stick_values[index].uuid != uuid) { - if (!stick_value.down && !stick_value.up && !stick_value.left && !stick_value.right) { + const bool is_tas = uuid == TAS_UUID; + if (is_tas && stick_value.x.value == 0 && stick_value.y.value == 0) { + return; + } + if (!is_tas && !stick_value.down && !stick_value.up && !stick_value.left && + !stick_value.right) { return; } } |