From 521f9e97b93a45389c883966f35737be4720f440 Mon Sep 17 00:00:00 2001 From: kozec Date: Sat, 29 Dec 2018 12:20:28 +0100 Subject: [PATCH] W10: Fixed ABS_LY overflowing, ABS_RY inverted. Ref #215 --- src/virtual-device/uinput-win32/vigem_gamepad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/virtual-device/uinput-win32/vigem_gamepad.c b/src/virtual-device/uinput-win32/vigem_gamepad.c index 41daf9503..87b4fb510 100644 --- a/src/virtual-device/uinput-win32/vigem_gamepad.c +++ b/src/virtual-device/uinput-win32/vigem_gamepad.c @@ -253,7 +253,7 @@ static void scc_virtual_xusb_set_axis(struct Internal* idev, Axis a, AxisValue v idev->xusb_report.sThumbLX = value; return scc_virtual_xusb_update(idev); case ABS_Y: - idev->xusb_report.sThumbLY = -value; + idev->xusb_report.sThumbLY = -((int32_t)value+1); return scc_virtual_xusb_update(idev); case ABS_Z: idev->xusb_report.bLeftTrigger = (uint8_t)value; @@ -262,7 +262,7 @@ static void scc_virtual_xusb_set_axis(struct Internal* idev, Axis a, AxisValue v idev->xusb_report.sThumbRX = value; return scc_virtual_xusb_update(idev); case ABS_RY: - idev->xusb_report.sThumbRY = value; + idev->xusb_report.sThumbRY = -((int32_t)value+1); return scc_virtual_xusb_update(idev); case ABS_RZ: idev->xusb_report.bRightTrigger = (uint8_t)value;