1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

input: Use same dualsense gyro values as linux kernel

This commit is contained in:
Megamouse 2024-06-26 20:52:18 +02:00
parent 78cb7963fb
commit df6bec236f

View File

@ -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 ||