mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 15:08:31 +00:00
Added controller mappings for Xbox 360, PS4, and PS5 controllers on OpenBSD
Removed the axis flipping hack for Xbox controllers which would actually apply to any controller with a full 16-bit range. Fixes https://github.com/libsdl-org/SDL/issues/6143
This commit is contained in:
@@ -731,18 +731,6 @@ BSD_JoystickUpdate(SDL_Joystick *joy)
|
||||
naxe = joy->hwdata->axis_map[joyaxe];
|
||||
/* scaleaxe */
|
||||
v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
#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
|
||||
v -= (hitem.logical_maximum +
|
||||
hitem.logical_minimum + 1) / 2;
|
||||
v *= 32768 /
|
||||
|
Reference in New Issue
Block a user