SDL icon indicating copy to clipboard operation
SDL copied to clipboard

SDL3 Add DSU joystick driver

Open danprice142 opened this issue 1 month ago • 6 comments

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.

danprice142 avatar Oct 28 '25 18:10 danprice142

FYI, this is failing CI.

slouken avatar Nov 14 '25 15:11 slouken

The table-based CRC32 implementation here is directly equivalent to calling SDL_crc32() using 0 as the initial CRC.

eloj avatar Nov 14 '25 20:11 eloj

The table-based CRC32 implementation here is directly equivalent to calling SDL_crc32() using 0 as the initial CRC.

Please replace your CRC implementation with SDL_crc32()

slouken avatar Nov 15 '25 15:11 slouken

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.

slouken avatar Nov 15 '25 16:11 slouken

Overall this looks good. When you're ready you can remove the debug logging and move the remaining logging to SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, ...)

I'll merge this once we start working on 3.6, so it has plenty of time to bake.

Cheers!

slouken avatar Nov 21 '25 05:11 slouken

Oh, FYI the joystick system is designed so that you can add joysticks from another thread as needed. You don't need to queue up connected and disconnected joysticks, just make sure you call SDL_LockJoysticks() around adding and removing them.

slouken avatar Nov 21 '25 05:11 slouken