Skip to content

Conversation

@danprice142
Copy link

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.

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 danprice142 marked this pull request as draft October 25, 2025 23:42
@sezero
Copy link
Contributor

sezero commented Oct 26, 2025

Here is a tidy-up patch that makes things build for me: dsu.patch

  • DSU_ReceiverThread() must be marked as SDLCALL
  • the lib pragma is for MSVC only: others need ws2_32 in link libraries
  • socket type isn't int for windows: it is UINT_PTR, i.e. word-size it is
    word size dependent
  • winsock2.h must be included before windows.h (other headers might pull
    it in), otherwise windows.h pulls in winsock.h, instead.
  • winsock2 already has socklen_t type in SDKs that are supported by SDL.
  • adds new dsu sources to Makefile.w32 for watcom/windows.

There still are more work to do, e.g. autotools integration (since you
are doing this for SDL2), addition of new sources to MSVC project files
and to Android.mk, etc: I didn't bother, yet.

I also didn't bother for os/2 support (SDL2 does support os2) either
(probably it's not worth the effort...)

@slouken
Copy link
Collaborator

slouken commented Oct 26, 2025

This won't be accepted for SDL2, but you could create a PR against main for review after 3.4 ships.

@danprice142
Copy link
Author

This won't be accepted for SDL2, but you could create a PR against main for review after 3.4 ships.

No way to make you change your mind on this? I dont mind doing this for SDL3 too and I know SDL2 is maintenance mode now but I was mainly doing this for UWP/XBOX and other platforms that dont support 3rd party devices, touch, gyro etc will have a nice workaround but with UWP support gone in SDL3 it would be nice to have this in SDL2

@slouken
Copy link
Collaborator

slouken commented Oct 26, 2025

Can you actually run DSU servers on Xbox?

Let's get it in SDL3 and work out the kinks, and then we can evaluate how valuable it is to backport.

@danprice142
Copy link
Author

Yes DSU does work on Xbox, anyway I made a PR for SDL3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants