Close

2020-06-04 Progress update - Generic HID Gamepad support

A project log for BlueRetro

Multiplayer Bluetooth controllers adapter for retro video game consoles

Jacques GagnonJacques Gagnon 06/04/2020 at 22:180 Comments

Finished log on Bluetooth tracing Saturday. That took more time to finish than I expected, took much of my available time last week. Been working since Sunday on the Generic HID pad support and it finally work! I use a 8bitdo NS30 to test this since it got a switch to toggle between 2 HID descriptor: xinput and dinput.

BlueRetro detect controllers in 2 ways. Very early in the Bluetooth stack it will match the device name with a list of known supported controllers. This is not great but it's required for devices with weird connection process like the Wiimote. If the name string doesn't match anything then it's tag as a generic HID device. This will trigger the adapter to get the HID descriptor from SDP. At that point the adapter will try to match a known controller again by trying to fingerprint the HID report to one of the known controllers. As an example if the NS30 was set to xinput at that point the adapter would find that it's report match the one from the Xbox One controller and simply consider the device as a Xbox One controller from that point on.

When the NS30 is set to dinput it will match nothing the adapter know. Adding explicit support for the main families of controller is fine but it's not viable to do so for every random controller. So when nothing matches the adapter will follow what the HID descriptor state. That should give good result for axes but the buttons mapping might be a bit weird. So default mapping setting will likely not do but once configured properly it should be fine.

Next I will start working on HID Keyboard support!

Discussions