RobertDaleSmith / USBRetro

USBRetro: Robust USB host controller input for retro consoles.
https://usbretro.com
Apache License 2.0
104 stars 7 forks source link
controller dinput gamecube nuon pcengine switch tinyusb usb usb-hid xbox-one xinput

USBRetro

USBRetro is an open source controller adapter firmware for converting USB controllers, keyboards, and mice to various retro consoles' native controller protocols.

Update Instructions

USB-2-PCE controlleradapter.com/products/usb-2-pce
NUON USB controlleradapter.com/products/nuon-usb

  1. Download the latest release usbretro_[console].uf2 file.
  2. Disconnected adapter from the console and all connected USB devices.
  3. While holding the boot(+) button, connect the USB-C port to a computer.
  4. A virual drive called RPI-RP2 will appear, drag-n-drop the UF2 update file onto the drive.
  5. The virtual drive will automatically unmount when the update is completed. 🚀

GC USB controlleradapter.com/products/gc-usb

  1. Download the latest release usbretro_ngc.uf2 file.
  2. Disconnected adapter from the console and all connected USB devices.
  3. Connect the USB-C port to a computer.
  4. A virual drive called RPI-RP2 will appear, drag-n-drop the UF2 update file onto the drive.
  5. The virtual drive will automatically unmount and remount when the update is completed. 🚀

Compatibility

USB Host Input

Retro Console Output

Bugs and Feature Requests

If you run into any issues, then please submit a bug report on the issues tab of this repo. If you would like to see support for specific USB controllers or think of something I missed, then you are welcome to open a feature request under the issues tab. Don't be shy. 👂

Button Mapping

Input Map

USBRetro X-input Switch PlayStation DirectInput
B1 A B Cross 2
B2 B A Circle 3
B3 X Y Square 1
B4 Y X Triangle 4
L1 LB L L1 5
R1 RB R R1 6
L2 LT ZL L2 7
R2 RT ZR R2 8
S1 Back Minus Select/Share 9
S2 Start Options Start/Option 10
L3 LS LS L3 11
R3 RS RS R3 12
A1 Guide Home PS 13
A2 Capture Touchpad 14

Output Map

USBRetro PCEngine Nuon GameCube Xbox One
B1 II A B A
B2 I C-Down A B
B3 IV (turbo II) B Y X
B4 III (turbo I) C-Left X Y
L1 VI L L LB
R1 V R R RB
L2 C-Up L (switch Z) LT
R2 C-Right R (switch Z) RT
S1 Select Nuon Z Back
S2 Run Start Start Start
L3 LS
R3 RS
A1 Guide
A2 Nuon Z

Compiling

Setup

1.) Raspberry Pi Pico SDK

First, clone the pico-sdk repo to your local dev environment. Then point the PICO_SDK_PATH environment variable to it.

cd ~/git
git clone https://github.com/raspberrypi/pico-sdk.git

cd ~/git/pico-sdk
git submodule init
git submodule update

export PICO_SDK_PATH=~/git/pico-sdk

2.) TinyUSB

Then the TinyUSB library within pico-sdk should be on the latest master branch. Change to that directory and checkout master if not already on it.

cd ~/git/pico-sdk/lib/tinyusb
git checkout master

3.) Clone USBRetro and Submodules

Once you have cloned this repo to your local environment. The external submodule dependencies must be initialized and updated.

cd ~/git
git clone https://github.com/RobertDaleSmith/usbretro.git

cd ~/git/usbretro
git submodule init
git submodule update

4.) RP2040 Board Setup

Finally, run the specific microcontroller build script to create a src/build directory.

cd ~/git/usbretro/src
sh build_ada_kb2040.sh

Build Firmwares

Build All

To build all the various console specific firmwares:

cd ~/git/usbretro/src/build
cmake ..
make

Build Individual

If you ever want to build firmware for only a single output console, then you can use make usbretro_[console].

make usbretro_pce
make usbretro_ngc
make usbretro_nuon
make usbretro_xb1

Discord Server

Join 👉 discord.usbretro.com

Acknowledgements