From: SeongChan Lee <foriequal@gmail.com> The previous axis direction inversion (`-ly - 1`) assumes `ly` is a signed, 32-bit, 2's complement value. It broke with the change 88e775db, which changed the size to 16-bit from 32-bit. Fix it by using simple arithmetic rather than relying on the 2's complement logic. --- dlls/winexinput.sys/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/winexinput.sys/main.c b/dlls/winexinput.sys/main.c index f8d1fab1332..e79bb314c5b 100644 --- a/dlls/winexinput.sys/main.c +++ b/dlls/winexinput.sys/main.c @@ -235,9 +235,9 @@ static void translate_report_to_xinput_state(struct func_device *fdo) fdo->xinput_state.buttons |= (1 << (usages[i] - 1)); } fdo->xinput_state.lx_axis = scale_value(lx, &fdo->lx_caps, 0, 65535); - fdo->xinput_state.ly_axis = scale_value(-ly - 1, &fdo->ly_caps, 0, 65535); + fdo->xinput_state.ly_axis = 65535 - scale_value(ly, &fdo->ly_caps, 0, 65535); fdo->xinput_state.rx_axis = scale_value(rx, &fdo->rx_caps, 0, 65535); - fdo->xinput_state.ry_axis = scale_value(-ry - 1, &fdo->ry_caps, 0, 65535); + fdo->xinput_state.ry_axis = 65535 - scale_value(ry, &fdo->ry_caps, 0, 65535); rt = scale_value(rt, &fdo->rt_caps, 0, 255); lt = scale_value(lt, &fdo->lt_caps, 0, 255); fdo->xinput_state.trigger = 0x8000 + (lt - rt) * 128; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11057