dmadison / ArduinoXInput

XInput library for USB capable Arduino boards
http://www.partsnotincluded.com/arduino-xinput-library/
MIT License
361 stars 61 forks source link

More than 1 controller like the wireless receiver #91

Closed petanque closed 11 months ago

petanque commented 11 months ago

Is it possible to make a version like an xbox 360 wireless receiver that supports 4 controllers? I have tried myself but my skills are not good enough. The reason I ask is that with a modified xbox360 with usbdsecpatch, your version works with most games and if there was a version with 4 players, it will be easier to make a multi player adapter.

I am in possession of an original wireless receiver from a phat xbox360 which I have modified to work with usb. I've added what I captured with USBPcap if it might be useful. xbox360wireless_receiver.zip

dmadison commented 11 months ago

In theory, but not at the moment.

From dumping the descriptors of my own Xbox 360 Wireless Receiver, the device appears to have 16 endpoints, 2 for each interface. Reading between the lines my guess is that there are separate control and audio interfaces for each controller, supporting a total of 4 gamepads.

At the moment the library is targeted towards the ATmega32U4, which supports 6 USB endpoints. Due to that limitation it wouldn't be possible to support more than 1 of the gamepads, unless the driver happens to play nice with omitting the secondary interfaces. Although from my testing with the current implementation I'd be surprised if that were the case.

Something like the RP2040 that supports 32 endpoints is a more promising candidate, but that would require an RP2040 implementation and a rewrite of the library to support multiple gamepads. Unfortunately this is going to go into the "maybe someday" feature folder for the time being.