Steering wheel emulation for the new dualshock4 controller option. Fine tuned anti-deadzone calculation for DS4 output controller.

This commit is contained in:
mika-n 2019-05-09 23:21:31 +03:00
parent 8a561d1cde
commit 02f66981a7

View File

@ -4087,8 +4087,8 @@ namespace DS4Windows
if (sxAntiDead > 0) if (sxAntiDead > 0)
{ {
sxAntiDead *= (outputAxisMax - outputAxisZero); sxAntiDead *= (outputAxisMax - outputAxisZero);
if (result < 0) return (((result - maxRangeLeft) * (-Convert.ToInt32(sxAntiDead) - (outputAxisMin))) / (0 - maxRangeLeft)) + (outputAxisMin); if (result < 0) return (((result - maxRangeLeft) * (outputAxisZero - Convert.ToInt32(sxAntiDead) - (outputAxisMin))) / (0 - maxRangeLeft)) + (outputAxisMin);
else return (((result - 0) * (outputAxisMax - (Convert.ToInt32(sxAntiDead)))) / (maxRangeRight - 0)) + (Convert.ToInt32(sxAntiDead)); else return (((result - 0) * (outputAxisMax - (outputAxisZero + Convert.ToInt32(sxAntiDead)))) / (maxRangeRight - 0)) + (outputAxisZero + Convert.ToInt32(sxAntiDead));
} }
else else
{ {