mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-26 08:31:49 +01:00
Merge branch 'jay' of https://github.com/Ryochan7/DS4Windows into jay
This commit is contained in:
commit
1d637005cb
@ -529,7 +529,8 @@ namespace DS4Windows
|
||||
|
||||
sixAxis.setCalibrationData(ref calibration, conType == ConnectionType.USB);
|
||||
|
||||
if ((hDevice.Attributes.ProductId == 0x5C4 && hDevice.Attributes.VendorId == 0x054C) && sixAxis.fixupInvertedGyroAxis())
|
||||
if (hDevice.Attributes.ProductId == 0x5C4 && hDevice.Attributes.VendorId == 0x054C &&
|
||||
sixAxis.fixupInvertedGyroAxis())
|
||||
AppLogger.LogToGui($"Automatically fixed inverted YAW gyro axis in DS4 v.1 BT gamepad ({Mac.ToString()})", false);
|
||||
}
|
||||
else
|
||||
|
@ -258,14 +258,16 @@ namespace DS4Windows
|
||||
|
||||
public bool fixupInvertedGyroAxis()
|
||||
{
|
||||
bool result = false;
|
||||
// Some, not all, DS4 rev1 gamepads have an inverted YAW gyro axis calibration value (sensNumber>0 but at the same time sensDenom value is <0 while other two axies have both attributes >0).
|
||||
// If this gamepad has YAW calibration with weird mixed values then fix it automatically to workaround inverted YAW axis problem.
|
||||
if ((calibrationData[1].sensNumer > 0 && calibrationData[1].sensDenom < 0) && calibrationData[0].sensDenom > 0 && calibrationData[2].sensDenom > 0)
|
||||
if (calibrationData[1].sensNumer > 0 && calibrationData[1].sensDenom < 0 &&
|
||||
calibrationData[0].sensDenom > 0 && calibrationData[2].sensDenom > 0)
|
||||
{
|
||||
calibrationData[1].sensDenom *= -1;
|
||||
return true; // Fixed inverted axis
|
||||
result = true; // Fixed inverted axis
|
||||
}
|
||||
return false; // No need to fix anything
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user