Jump to content
OGXbox.com

OGX-Mini, Pico firmware for emulating Xbox (and other) controllers


SoftMachine
 Share

Recommended Posts

I've written some firmware for the RP2040, thanks to a bunch of TinyUSB drivers created by Ryzee119 and the OpenStickCommunity, that supports pretty much anything the original OGX360 supports, apart from the 360 keyboard for Steel Battalion. On top of those I've added Sony Dualshock 4 and Dualsense support, and will be working on Switch Pro/Dualshock 3 once I get my hands on those. By default it's setup for the Adafruit Feather RP2040 USB Host board, but it can be compiled for the normal Pico as well, though that doesn't have a second USB port for your controller so you'll have to solder one to GPIO 0/1 (data +/-). 

The firmware can be compiled and used for
- Original Xbox
- Nintendo Switch
- Xinput (not 360, due to the security chip)

These are all the devices that are supported currently:
- Original Xbox Duke and S controllers
- Wired Xbox 360 controllers
- Xbox 360 wireless PC adapter (clone and Microsoft, syncs 1 controller)
- Xbox One/Series/Elite controllers
- Dualshock 4 (PS4)
- Dualsense (PS5)
- 8bitdo v1 and v2 wireless adapters

I've posted source code and compiled .uf2 files on Github: https://github.com/wiredopposite/OGX-Mini

I'd also add that Playstation controllers are recognized by USB vendor and device ID, I'm not positive if there's a better way to do that, but those need to be manually added to the program to work. I need more of these IDs so if you're aware of some list somewhere, or your aftermarket Playstation 4/5 controller isn't working, just give me the VID/PID and I'll add them. I also need these for Playstation 3 controllers once I get around to adding support for those.

This is the Adafruit board, no soldering is required for this, you just need a way to connect USB-C to your Xbox's controller port:
ada_feather_rp2040_usb.jpg.ad351dbf15d3fe47532ad1ff7669c94f.jpg

 

  • Like 5
  • Thanks 4
Link to comment
Share on other sites

1 hour ago, SoftMachine said:

I'd also add that Playstation controllers are recognized by USB vendor and device ID, I'm not positive if there's a better way to do that, but those need to be manually added to the program to work. I need more of these IDs so if you're aware of some list somewhere, or your aftermarket Playstation 4/5 controller isn't working, just give me the VID/PID and I'll add them. I also need these for Playstation 3 controllers once I get around to adding support for those.

You can try the the USB ID Repository: http://www.linux-usb.org/usb-ids.html

This list is used by Linux distributions to identify USB devices.

  • Like 1
Link to comment
Share on other sites

18 minutes ago, SoftMachine said:

Thanks, I'm gonna go through that tomorrow and start adding IDs. That list has me wondering if those ps4/3 wireless dongles would work, I just ordered one

I think most of those adapters look like Xbox 360 controllers on the host, so they should work. I have an official Sony PS4 Wireless Adapter that doesn't do that. It has a USB vendor/device ID of 054c:0ba0.

Link to comment
Share on other sites

3 hours ago, TelaKeppi said:

Interesting, so the only thing that differentiates this from OGX360_T4 would be the ability to function as a memory card? Any way to add support for XMU with a 16Mb QSPI chip?

Honestly I hadn't thought of that, it's a good idea. The Xbox device driver would need to be changed in order for the controller to show up with a memory card in it, but I'd imagine it's possible. I'll give some more thought to it and see what I can do, atm my focus is really adding support for as many devices as possible, along with gamepad emulation for PS3.

The ogx360_t4 firmware can be compiled to emulate a Steel Battalion controller, as of now my firmware cannot, that and the memory card are the differences. I'm not sure how popular the Steel Battalion support was or if there's a big demand for that, if there is it wouldn't be a ton of work to get that going, most of the code was written already for the ogx360_t4.

The main reason for this project is how simple the rp2040 is to use and design hardware for in this context, it takes care of usb device and host duties by itself for $0.80 + the $0.50 flash, as opposed to the way more expensive atmega32u4 + level shifter + max usb controller setup, or the $30+ teensy4.1. There's also plenty of room to expand the program, which the atmega chip doesn't offer. 

  • Like 1
Link to comment
Share on other sites

8 minutes ago, GoTeamScotch said:

Github says it's compatible with modern Xbox gamepads (one/series). I assume that's wired, correct? Wireless adapter would be amazing.

It is mentioned the 8bitdo v1 and v2 wireless adapters are supported so there is some wireless adapter support.   I have wondered why a Pico W couldnt be used for these type projects where you have 2.4ghz and BT 5.2 built into the board where it could eliminate the need for an external wireless adapter.

Edited by RMM
spelling
Link to comment
Share on other sites

12 hours ago, GoTeamScotch said:

Github says it's compatible with modern Xbox gamepads (one/series). I assume that's wired, correct? Wireless adapter would be amazing.

If it presents itself and acts as an xbox controller it might just work, i've not tried yet but I'll pick one up to test. Once I add switch pro support, a bunch of those cheapo wireless adapters for switch should work too.

Link to comment
Share on other sites

I'm unsure how it works and no diagrams. Can you clarify for me does it plug into the Xbox console, emulates a duke/S, and pair it with a wireless controller from Xbox 360 / Playstation?

Or is it an inline adapter that plugs between the cable from console to controller?

Link to comment
Share on other sites

1 hour ago, corona2222 said:

I'm unsure how it works and no diagrams. Can you clarify for me does it plug into the Xbox console, emulates a duke/S, and pair it with a wireless controller from Xbox 360 / Playstation?

Or is it an inline adapter that plugs between the cable from console to controller?

With the Adafruit Feather board I linked, you plug the USB C end into the Xbox with an Xbox to USB adapter, then your controller into the USB type A port.
feather_inst.jpg.127ba87815c469a0e0b4fa8bb7e7b1b4.jpg

 

If you wanted to use the normal Pi Pico board, you'd need to attach another USB port to it for your controller, here's a diagram of thatpico_wiring.png.54587512e3f08b3e4172f77e3daefd0a.png

 

Firmware for both boards is in the Releases section of the Github. There's no wireless functionality on either of these boards so a wireless adapter like an 8bitdo or the Xbox 360 PC adapter is needed for that

Edited by SoftMachine
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

1 hour ago, SoftMachine said:

Firmware for both boards is in the Releases section of the Github. There's no wireless functionality on either of these boards so a wireless adapter like an 8bitdo or the Xbox 360 PC adapter is needed for that

I made mention of this in my previous post but I'm wondering since this works on a Pico, the Pico W has Bluetooth and the antenna built in.  At some point could the firmware be made to support a wireless controller connecting directly to a Pico W Bluetooth antenna without the need for an external WIFI adapter? 

Link to comment
Share on other sites

You can buy a break away cable on ebay for about $5 U.S.  If you cut off the end of it and solder the wires onto the Pico/Adafruit Feather board you could have a direct connection to the Xbox.  Make a little 3D printed case and you could have a dedicated Xbox adapter for around $15

 

1218021291_breakaway.jpg.c04af33347ed8010d5bce09a12f39d2a.jpg

  • Like 1
Link to comment
Share on other sites

7 hours ago, RMM said:

You can buy a break away cable on ebay for about $5 U.S.  If you cut off the end of it and solder the wires onto the Pico/Adafruit Feather board you could have a direct connection to the Xbox.  Make a little 3D printed case and you could have a dedicated Xbox adapter for around $15

 

1218021291_breakaway.jpg.c04af33347ed8010d5bce09a12f39d2a.jpg

I don't think that you can solder this unfortunately. You have to solder it to the micro usb port of the Pico and this could be complex, also because that port is necessary to program the Pico so you can't remove that. If i understand correctly the USB type A port is used to connect the pico to the newer joystick. 

Link to comment
Share on other sites

9 hours ago, Aleter said:

I don't think that you can solder this unfortunately. You have to solder it to the micro usb port of the Pico and this could be complex, also because that port is necessary to program the Pico so you can't remove that. If i understand correctly the USB type A port is used to connect the pico to the newer joystick. 

The Pico has solder points on the bottom, TP1 is ground, TP2 is data- and TP3 is data+   You have power on VBUS pin 40.    Although this link is not dealing with connecting a Xbox cable to the Pico, it should give you an idea.  https://blog.4dcu.be/diy/2023/12/03/pi-pico-usb-c.html  You could print a 3D case where the Xbox cable comes out from the bottom and the USB is on the top

The other option if you dont like the idea of soldering directly to the Pico is cutting the end off a break away cable and soldering a micro USB connector to the end of it.  This way you could plug and unplug it from the Pico anytime you want. https://www.amazon.com/Connector-Straight-Micro-USB-Replacement-Adapter/dp/B081SS97XS

Edit:  To add to my post, it looks like someone already makes an Xbox to micro USB cable so if someone wanted they could just buy a cable like that and plug it in to the Pico's micro USB port instead of making their own:

https://www.ebay.com/itm/355189625143

 

Edited by RMM
Link to comment
Share on other sites

On 2/23/2024 at 5:13 PM, Bowlsnapper said:

This could probably be used with well known, in-stock usb adapters to run emulators with their respective native controllers, yes?

I do have switch pro controller support mostly working, real pro controllers seem to disconnect after a while, but I believe those cheap wireless adapters that work for the switch don't care about whatever exchange/command I'm missing to keep it connected. They seem to work fine, so I might just post an update with that if I can't get everything 100% working within the next couple of days. I also have a Microsoft Xbox One/Series wireless dongle coming in the mail so I'll see if that one works as well.

Link to comment
Share on other sites

3 minutes ago, SoftMachine said:

I do have switch pro controller support mostly working, real pro controllers seem to disconnect after a while, but I believe those cheap wireless adapters that work for the switch don't care about whatever exchange/command I'm missing to keep it connected. They seem to work fine, so I might just post an update with that if I can't get everything 100% working within the next couple of days. I also have a Microsoft Xbox One/Series wireless dongle coming in the mail so I'll see if that one works as well.

Well what I'm referring to is PC USB adapters for genuine controllers: N64, Genesis, SNES, etc. Basically, picking a USB adapter for each type of controller in good supply and porting over driver support so that emulators can be used with their actual controllers. Obviously a solution would have to be found to do Xbox-Controllery things to navigate the menus to get the ROM to load (maybe using P2, 3 or 4 ports), but I've wanted to see that for a VERY long time... Using an Xbox controller to play Sonic works, but it's nothing like the real thing. :)

Link to comment
Share on other sites

1 minute ago, Bowlsnapper said:

Well what I'm referring to is PC USB adapters for genuine controllers: N64, Genesis, SNES, etc. Basically, picking a USB adapter for each type of controller in good supply and porting over driver support so that emulators can be used with their actual controllers. Obviously a solution would have to be found to do Xbox-Controllery things to navigate the menus to get the ROM to load (maybe using P2, 3 or 4 ports), but I've wanted to see that for a VERY long time... Using an Xbox controller to play Sonic works, but it's nothing like the real thing. :)

Ah okay, I dont have any but I'd imagine they're just generic HID, that wouldn't be much work to support. I'm not sure how they would map to something like an Xbox controller though, that might be a bit wonky

  • Like 1
Link to comment
Share on other sites

26 minutes ago, SoftMachine said:

Ah okay, I dont have any but I'd imagine they're just generic HID...

That's true!

Yeah, the mappings would have to be specified, for sure, but would that would be very, very cool to try to implement! Just pop it in and use your favorite controller! :)

Link to comment
Share on other sites

Amazing work!

Regarding PID/VID for PS3/4 controllers generally it is better to check against the interface class/subclass/protocol. Atleast on Xbox these are always consistent and so you don't need to rely on hardcoded PID/VIDs etc by I'm not sure how the PS controllers are tbh 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

Board Life Status


Board startup date: April 23, 2017 12:45:48
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.