summaryrefslogtreecommitdiffstats
path: root/src/core/hid/emulated_controller.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-02-10 02:05:20 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2023-02-10 02:07:50 +0100
commit5e9fa5def5cf5ae3f00cc354a0b1363123dc6930 (patch)
tree90a707a21b66803010bbe707c36563e1ff583559 /src/core/hid/emulated_controller.cpp
parentservice: hid: Return error if arguments of SetSupportedNpadIdType is invalid (diff)
downloadyuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar
yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.gz
yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.bz2
yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.lz
yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.xz
yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.zst
yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.zip
Diffstat (limited to '')
-rw-r--r--src/core/hid/emulated_controller.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 631aa6ad2..6d5a3dead 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -957,7 +957,7 @@ void EmulatedController::SetMotion(const Common::Input::CallbackStatus& callback
raw_status.gyro.y.value,
raw_status.gyro.z.value,
});
- emulated.SetGyroThreshold(raw_status.gyro.x.properties.threshold);
+ emulated.SetUserGyroThreshold(raw_status.gyro.x.properties.threshold);
emulated.UpdateRotation(raw_status.delta_timestamp);
emulated.UpdateOrientation(raw_status.delta_timestamp);
force_update_motion = raw_status.force_update;
@@ -1284,6 +1284,26 @@ void EmulatedController::SetLedPattern() {
}
}
+void EmulatedController::SetGyroscopeZeroDriftMode(GyroscopeZeroDriftMode mode) {
+ for (auto& motion : controller.motion_values) {
+ switch (mode) {
+ case GyroscopeZeroDriftMode::Loose:
+ motion_sensitivity = motion.emulated.IsAtRestLoose;
+ motion.emulated.SetGyroThreshold(motion.emulated.ThresholdLoose);
+ break;
+ case GyroscopeZeroDriftMode::Tight:
+ motion_sensitivity = motion.emulated.IsAtRestThight;
+ motion.emulated.SetGyroThreshold(motion.emulated.ThresholdThight);
+ break;
+ case GyroscopeZeroDriftMode::Standard:
+ default:
+ motion_sensitivity = motion.emulated.IsAtRestStandard;
+ motion.emulated.SetGyroThreshold(motion.emulated.ThresholdStandard);
+ break;
+ }
+ }
+}
+
void EmulatedController::SetSupportedNpadStyleTag(NpadStyleTag supported_styles) {
supported_style_tag = supported_styles;
if (!is_connected) {