From df6bec236fd6ff2f817d5aa7f411bdbb3682df88 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 26 Jun 2024 20:52:18 +0200 Subject: [PATCH] input: Use same dualsense gyro values as linux kernel --- rpcs3/Input/dualsense_pad_handler.cpp | 31 ++++++--------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/rpcs3/Input/dualsense_pad_handler.cpp b/rpcs3/Input/dualsense_pad_handler.cpp index d53d532dca..b3c3021ccd 100644 --- a/rpcs3/Input/dualsense_pad_handler.cpp +++ b/rpcs3/Input/dualsense_pad_handler.cpp @@ -432,31 +432,12 @@ bool dualsense_pad_handler::get_calibration_data(DualSenseDevice* dualsense_devi dualsense_device->calib_data[CalibIndex::YAW].bias = read_s16(&buf[3]); dualsense_device->calib_data[CalibIndex::ROLL].bias = read_s16(&buf[5]); - s16 pitch_plus, pitch_minus, roll_plus, roll_minus, yaw_plus, yaw_minus; - - // TODO: This was copied from DS4. Find out if it applies here. - // Check for calibration data format - // It's going to be either alternating +/- or +++--- - if (read_s16(&buf[9]) < 0 && read_s16(&buf[7]) > 0) - { - // Wired mode for OEM controllers - pitch_plus = read_s16(&buf[7]); - pitch_minus = read_s16(&buf[9]); - yaw_plus = read_s16(&buf[11]); - yaw_minus = read_s16(&buf[13]); - roll_plus = read_s16(&buf[15]); - roll_minus = read_s16(&buf[17]); - } - else - { - // Bluetooth mode and wired mode for some 3rd party controllers - pitch_plus = read_s16(&buf[7]); - yaw_plus = read_s16(&buf[9]); - roll_plus = read_s16(&buf[11]); - pitch_minus = read_s16(&buf[13]); - yaw_minus = read_s16(&buf[15]); - roll_minus = read_s16(&buf[17]); - } + const s16 pitch_plus = read_s16(&buf[7]); + const s16 pitch_minus = read_s16(&buf[9]); + const s16 yaw_plus = read_s16(&buf[11]); + const s16 yaw_minus = read_s16(&buf[13]); + const s16 roll_plus = read_s16(&buf[15]); + const s16 roll_minus = read_s16(&buf[17]); // Confirm correctness. Need confirmation with dongle with no active controller if (pitch_plus <= 0 || yaw_plus <= 0 || roll_plus <= 0 ||