-
Notifications
You must be signed in to change notification settings - Fork 2.5k
SDL3 Add DSU joystick driver #14353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
SDL3 Add DSU joystick driver #14353
Conversation
Rebased on latest upstream
Disabled DSU joystick on Emscripten due to lack of UDP socket support. Updated socket initialization to use ioctl with FIONBIO for better compatibility on Unix-like systems. Refactored header includes and comments for clarity and platform correctness. Fixed variable naming in DSU data packet handling and removed unnecessary 'static' from inline functions in header.
|
FYI, this is failing CI. |
Updated CMakeLists.txt to only enable DSU joystick on non-Emscripten targets and use sdl_link_dependency for required network libraries. Enhanced DSU socket creation for better non-blocking support and portability, including FIONBIO and ioctl handling. Added missing socket-related includes for non-Windows platforms in SDL_dsujoystick_driver.c.
|
The table-based CRC32 implementation here is directly equivalent to calling |
Updated CMakeLists.txt to enable DSU joystick support only on Windows, Linux, Android, Haiku, FreeBSD, NetBSD, OpenBSD, and macOS. Added conditional inclusion of <sys/ioctl.h> in SDL_dsujoystick.c. Removed unused GetDSUMutex helper from SDL_dsujoystick_driver.c.
Please replace your CRC implementation with SDL_crc32() |
|
Please merge SDL_dsujoystick_driver.c into SDL_dsujoystick.c. There's no need for these to be separate. The IN_JOYSTICK_DSU_ code in the header should probably be moved into the C file. |
Moved all DSU joystick driver logic from SDL_dsujoystick_driver.c into SDL_dsujoystick.c, removing the separate driver file. Updated SDL_dsujoystick_c.h to remove internal driver declarations and macros now handled in the implementation. Updated VisualC project file to remove the deleted driver source.
Replace inet_addr() with InetPtonA() on Windows and inet_pton() on Unix-like systems to fix C4996 warnings on Windows ARM64 builds where warnings are treated as errors.
Extended DSU support to additional platforms including QNX, RISC OS, PlayStation Vita, PSP, PS2, and Nintendo 3DS. Updated CMakeLists.txt to handle platform-specific dependencies and added platform-specific socket handling, initialization, and cleanup in SDL_dsujoystick.c. Introduced wrappers for network functions and improved error handling for these platforms.
Dropped DSU support for PlayStation Vita, PSP, PS2, and Nintendo 3DS platforms I dont have a way to test anyway
Introduces DSU client joystick support for SDL, enabling connection to DSU servers (such as DS4Windows and BetterJoy) to receive controller data over UDP, including motion sensors and touchpad data. Adds build system options, configuration hints, protocol implementation, and driver integration for Windows and other platforms.