Commit Graph

227 Commits

Author SHA1 Message Date
Sam Lantinga
cb36189692 Fixed bug 5235 - All internal sources should include SDL_assert.h
Ryan C. Gordon

We should really stick this in SDL_internal.h or something so it's always available.
2020-12-09 07:16:22 -08:00
Sam Lantinga
c9723c407f Fixed potential hang in joystick close if the rumble thread is blocked for some reason
It's still possible to hang when shutting down, if the rumble thread is still hung, but it won't block indefinitely at runtime.
2020-12-07 09:38:21 -08:00
Sam Lantinga
09909d029d Fixed handling of BACK button on newer Xbox One S controllers 2020-12-03 19:44:47 -08:00
Sam Lantinga
54e5136b50 Refactored Xbox One Bluetooth protocol and verified Xbox One S, Xbox Series X, and Xbox One Elite Series 2 controllers 2020-12-03 18:17:04 -08:00
Sam Lantinga
1031231b29 Fixed duplicating a device between XInput and HIDAPI 2020-12-03 18:17:03 -08:00
Sam Lantinga
59f28b7f4b Fixed whitespace 2020-12-03 18:17:01 -08:00
Sam Lantinga
e3966e25ca Use the correct internal API for updating the battery level for PS5 controllers 2020-11-30 13:04:30 -08:00
Sam Lantinga
f4ed07de06 We don't know whether the PS5 controller is Bluetooth or not when we open it 2020-11-30 13:02:34 -08:00
Sam Lantinga
a0c5bfa3bd Moved raw input event processing from the main thread to the joystick thread
This allows fast joystick event delivery regardless of what the main thread is doing.
2020-11-27 13:08:40 -08:00
Sam Lantinga
ce77966da8 Fixed RAWINPUT_IsDevicePresent() not returning TRUE for Xbox One controllers 2020-11-27 10:44:49 -08:00
Sam Lantinga
517be80822 Implemented battery status for Bluetooth Xbox One controllers
Also switched the rumble loop count to 0xEB (one hour) to match Windows driver
2020-11-25 16:05:19 -08:00
Sam Lantinga
159d1b3df5 Don't set the serial number after the controller is opened
We'll use the USB value instead so it's available as soon as it's opened.
2020-11-25 01:35:45 -08:00
Sam Lantinga
7d92b14f46 Simplified Xbox One controller initialization state, and don't query for the serial number. 2020-11-25 01:18:18 -08:00
Sam Lantinga
9fc4a4c92c Revamped Xbox One HIDAPI init sequence
Added support for querying the controller serial number on newer firmware
2020-11-24 22:25:26 -08:00
Sam Lantinga
e44bf8a080 Fixed bug 5359 - Incorrect sensor data from DualShock4
multiply gyro values by sensitivity

When the hardware calibration fails, values read from sensors need to be multiplied by default sensitivity (16 for gyro, 1 for accelerometer).
2020-11-23 21:18:37 -08:00
Sam Lantinga
5b3616c325 Generalized the raw input controller driver and moved XInput/WGI detection into it for XInput devices
This fixes bad report parsing for various newer Xbox controllers, and this driver is now preferred over XInput, since it handles more than 4 controllers.
2020-11-23 18:24:05 -08:00
Sam Lantinga
870841c414 Reset the LED state after Bluetooth connection has completed on the PS5 controller 2020-11-21 11:59:01 -08:00
Sam Lantinga
2e8e3854b8 Fixed compile warning 2020-11-21 17:59:15 -08:00
Sam Lantinga
549010f2a0 It takes 2 packets to stop audio haptics and start emulated rumble on the PS5 controller 2020-11-20 13:24:49 -08:00
Sam Lantinga
ffb4d960b2 Disabled Xbox protocol debugging 2020-11-19 19:09:34 -08:00
Sam Lantinga
c9b097e659 Clarify the meaning of the rumble enable bits for the PS5 controller 2020-11-19 13:31:16 -08:00
Sam Lantinga
c85623d790 Re-enable haptic audio after rumble on PS5 controller
Also make sure we don't set any other state when we're not intending to, and added more interesting effects which are currently not exposed via API
2020-11-19 13:10:14 -08:00
Sam Lantinga
8c3196da60 Fixed some compiler warnings 2020-11-18 21:33:11 -08:00
Sam Lantinga
45f1437549 Experimenting with requesting the serial number on an Xbox One controller 2020-11-18 20:34:12 -08:00
Sam Lantinga
963d8b3f40 Fixed bits in the initial Xbox One protocol ack 2020-11-18 20:34:10 -08:00
Sam Lantinga
cd51a51f00 Updated with a better understanding of the Xbox One controller protocol 2020-11-18 20:34:08 -08:00
Sam Lantinga
463d84a860 Added support for the PS5 controller gyro and accelerometer 2020-11-17 10:56:56 -08:00
Sam Lantinga
fcb21aa883 Added API for sensors on game controllers
Added support for the PS4 controller gyro and accelerometer on iOS and HIDAPI drivers

Also fixed an issue with the accelerometer on iOS having inverted axes
2020-11-17 10:30:20 -08:00
Sam Lantinga
d140d88744 Added SDL_JoystickGetSerial() and SDL_GameControllerGetSerial() 2020-11-16 17:36:47 -08:00
Sam Lantinga
71e32f5e1b Added SDL_crc32() 2020-11-16 15:00:15 -08:00
Sam Lantinga
3d48fc05c3 Added notes about the pad lights on the PS5 controller 2020-11-16 13:21:02 -08:00
Sam Lantinga
4514ad573e Fixed updating LED state when starting application with Bluetooth PS5 controller connected 2020-11-16 13:07:11 -08:00
Sam Lantinga
a37e3ae218 Implemented PS5 effects over Bluetooth 2020-11-16 11:21:58 -08:00
Sam Lantinga
c6c116e847 Implemented setting the LED color on the PS5 controller 2020-11-16 10:51:13 -08:00
Sam Lantinga
aa7c3eae19 Fixed size of rumble packet 2020-11-16 09:16:01 -08:00
Sam Lantinga
f28c01a4fb Fixed rumble order on PS5 2020-11-16 09:11:15 -08:00
Sam Lantinga
eb94c19a63 SDL: fix iOS build 2020-11-16 08:09:15 -08:00
Sam Lantinga
8243bd1dc6 SDL: Plumb PS5 rumble to output report 2020-11-16 08:09:13 -08:00
Sam Lantinga
5c34c973e6 Clarify that we're using button indices, not using gamepad button names 2020-11-13 19:40:25 -08:00
Sam Lantinga
9f51fad361 Added support for the touchpad on PS4 and PS5 controllers 2020-11-13 18:01:29 -08:00
Sam Lantinga
78422fa3c8 Added more detail on the PS5 controller state packet and enable full reports over Bluetooth 2020-11-13 13:17:07 -08:00
Sam Lantinga
5b0d432942 Implemented trigger rumble in the HIDAPI Xbox One driver 2020-11-12 07:53:03 -08:00
Sam Lantinga
83b653d55d Fixed build warning 2020-11-11 20:09:56 -08:00
Sam Lantinga
320a7587d7 Fixed compiler warnings 2020-11-11 19:26:59 -08:00
Sam Lantinga
1e2caac58b Added SDL_JoystickRumbleTriggers() and SDL_GameControllerRumbleTriggers() 2020-11-11 18:57:37 -08:00
John "Nielk1" Klein
067630aef3 Fix hidapi for unhandled DS4 headset microphone data corrupting controller state 2020-11-11 03:47:08 -06:00
Sam Lantinga
d1e10c313e Removed debug output 2020-11-11 14:38:14 -08:00
Sam Lantinga
e12457d8bf Added support for the Xbox Series X controller to the HIDAPI driver 2020-11-10 12:26:30 -08:00
Sam Lantinga
c3dea23120 Added support for reading the paddles on a Xbox Elite Series 2 controller in Bluetooth mode 2020-11-09 22:39:33 -08:00
Sam Lantinga
1577366c36 Fixed duplicated switch statement processing Xbox controller dpad state 2020-11-08 23:49:03 -08:00