From: "Rémi Bernon" Subject: [PATCH 1/2] winebus.sys: Fix inverted SDL joystick hat switch y axis. Message-Id: <20211015111741.3172055-1-rbernon@codeweavers.com> Date: Fri, 15 Oct 2021 13:17:40 +0200 SDL_HAT_UP should work as SDL_CONTROLLER_BUTTON_DPAD_UP. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40658 Signed-off-by: Rémi Bernon --- dlls/winebus.sys/bus_sdl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 4fb91e4dc6d..16e7a2f6f30 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -161,14 +161,14 @@ static void set_hat_value(struct unix_device *iface, int index, int value) switch (value) { case SDL_HAT_CENTERED: break; - case SDL_HAT_UP: y = 1; break; - case SDL_HAT_RIGHTUP: y = x = 1; break; + case SDL_HAT_DOWN: y = 1; break; + case SDL_HAT_RIGHTDOWN: y = x = 1; break; case SDL_HAT_RIGHT: x = 1; break; - case SDL_HAT_RIGHTDOWN: x = 1; y = -1; break; - case SDL_HAT_DOWN: y = -1; break; - case SDL_HAT_LEFTDOWN: x = y = -1; break; + case SDL_HAT_RIGHTUP: x = 1; y = -1; break; + case SDL_HAT_UP: y = -1; break; + case SDL_HAT_LEFTUP: x = y = -1; break; case SDL_HAT_LEFT: x = -1; break; - case SDL_HAT_LEFTUP: x = -1; y = 1; break; + case SDL_HAT_LEFTDOWN: x = -1; y = 1; break; } hid_device_set_hatswitch_x(iface, index, x); hid_device_set_hatswitch_y(iface, index, y); -- 2.33.0