mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-02-09 05:03:25 +01:00
Minor tweak for VS
This commit is contained in:
parent
47d7fc2509
commit
12b2466111
@ -529,7 +529,8 @@ namespace DS4Windows
|
|||||||
|
|
||||||
sixAxis.setCalibrationData(ref calibration, conType == ConnectionType.USB);
|
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);
|
AppLogger.LogToGui($"Automatically fixed inverted YAW gyro axis in DS4 v.1 BT gamepad ({Mac.ToString()})", false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -258,14 +258,16 @@ namespace DS4Windows
|
|||||||
|
|
||||||
public bool fixupInvertedGyroAxis()
|
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).
|
// 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 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;
|
calibrationData[1].sensDenom *= -1;
|
||||||
return true; // Fixed inverted axis
|
result = true; // Fixed inverted axis
|
||||||
}
|
}
|
||||||
return false; // No need to fix anything
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user