restore Y/RY axis inversion for XInput controllers for now, pending
a more permanent upstream solution to this
https://github.com/libsdl-org/SDL/issues/7609#issuecomment-1522831640

break from axis/hat assignments to not override hat with 0 after HUG_DPAD_*

Index: src/joystick/bsd/SDL_bsdjoystick.c
--- src/joystick/bsd/SDL_bsdjoystick.c.orig
+++ src/joystick/bsd/SDL_bsdjoystick.c
@@ -687,12 +687,30 @@ static void BSD_JoystickUpdate(SDL_Joystick *joy)
                         /* scaleaxe */
                         v = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem);
                         v = (((SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN) * (v - hitem.logical_minimum)) / (hitem.logical_maximum - hitem.logical_minimum)) + SDL_JOYSTICK_AXIS_MIN;
+#ifdef __OpenBSD__
+                        /* XInput controllermapping relies on inverted Y axes.
+                         * These devices have a 16bit signed space, as opposed
+                         * to older DInput devices (8bit unsigned), so
+                         * hitem.logical_maximum can be used to differentiate them.
+                         */
+                        if ((joyaxe == JOYAXE_Y || joyaxe == JOYAXE_RY)
+                            && hitem.logical_maximum > 255) {
+                            if (v != 0)
+                                v = ~v;
+                        }
+#endif
                         SDL_PrivateJoystickAxis(joy, naxe, v);
+#ifdef __OpenBSD__
+                        break;
+#endif
                     } else if (usage == HUG_HAT_SWITCH) {
                         v = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem);
                         SDL_PrivateJoystickHat(joy, 0,
                                                hatval_to_sdl(v) -
                                                    hitem.logical_minimum);
+#ifdef __OpenBSD__
+                        break;
+#endif
                     }
 #ifdef __OpenBSD__
                     /* here D-pad directions are reported like separate buttons.
