Giter VIP home page Giter VIP logo

usbretro's Introduction

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

  • USB Hubs (up to 5 devices)
  • USB HID Keyboards/Mice (maps to controller)
  • X-input Controllers (Xbox OG/360/One/SeriesX|S)
  • D-input Controllers (generic HID gamepad|joystick)
  • PlayStation (PSClassic/DS3/DS4/DualSense)
  • Switch (SwitchPro/JoyConGrip)
  • 8BitDo Controllers/Adapters
    • PCEngine 2.4g
    • M30 2.4g/BT
    • NeoGeo 2.4g
    • Wireless Adapter 1 (Grey/Red)
    • Wireless Adapter 2 (Black/Red)
  • Logitech Wingman Action Pad
  • Sega Astrocity controller/joystick
  • Hori Pokken and Horipad controllers
  • DragonRise Generic USB controllers

Retro Console Output

  • PCEngine/TurboGrafx-16
    • Multitap (1-5 players)
    • PCEngine Mouse
    • 2-button Controller
    • 3-button Controller
    • 6-button Controller
  • Nuon DVD Players
    • Standard controller output
    • Spinner controller output for Tempest 3000
  • GameCube/Wii
    • Standard Controller (with rumble)
    • GameCube Keyboard (scroll lock to enable)
    • Copilot (combine up to 4 controllers into one)
  • Xbox One S (USB host controller mod)
    • Full button and analog value passthrough
    • Rumble passthrough
  • CD-i
    • 2-player Splitter
    • Standard Controller
    • CD-i Mouse Output
  • 3DO
    • Daisy-chaining (1-8 controllers)
    • 3DO Mouse Output
    • 3DO Arcade Start/Coin (Orbatak/Shootout at Old Tucson)
  • Sega Dreamcast
    • Standard Controller
    • Dreamcast Keyboard
    • Virtual VMU/Rumble Pack
  • Any retro console or computer..

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

usbretro's People

Contributors

bestie avatar dshadoff avatar olleolleolle avatar robertdalesmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

usbretro's Issues

GameCube 4-player Output

Currently the GameCube USBRetro output only supports single controller output. It may be possible to output all four players on a single RP2040 by adding 3 additional GPIO data lines for players 2, 3, and 4.

Some research needs to be done to evaluate whether the GC output lib used is small enough to run four simultaneous state machines on a single RP2040. If the PIOs instructions are small enough then it should fit no problem.

If so then a bit of refactoring will need to be done to handle this..

It should be able to detect whether one or more GC controller ports are connected. If more than one then split up USB input players to their reactive outputs. If only one then merge into copilot mode as it currently does.

Turbo EverDrive Pro Hot-Heys No Longer Working

In a recent update the Turbo EverDrive Pro hotkeys workaround patch stopped functioning as it was. Need to revisit this and see what changes caused the single controller buttons to not apply to all multitap reads when hotkeys are detected.

6 buttons mode broken ?

The 6-button mode does not look to work (for me).

Tested on a real PC Engine with SFII'.

With a real Nec Avenue 6 controller : Toggling Mode A/B switch changes the controller behaviour from 2 buttons to 6.
This can be observed in the options Menu. The buttons re-mapping list changes automatically from displaying 2 buttons to 6.

With a 8bitdo PCE and an 8Bitdo M30 2.4, holding RUN (START for M30) and quickly tapping UP does nothing.

Nuon internal mod in-game reset

The Nuon by default reboots the current game if the stop button is pressed. It should be possible to connect a gpio pin from the microcontroller being installed to the stop button and sink it low when a common button combo is pressed.

Also to expand upon this maybe another gpio pin can be connected to the power button to allow for power off and on through another controller button combo. I found that using 5V+E rather than 5V+VDD will allow the microcontroller to always be powered on. (SD-2300 model)

Using a wireless adapter with a controller would allow for quick remote power on/off.

GPIO pin 2 and 3 are already used by our program so maybe pin 4 for power button and the BOOTSEL pin for Stop button. Using the BOOTSEL so that it being wired to Stop will allow holding the stop button when doing firmware updates.

Disconnect Nuon controller when no USB controller connected

For the internal Nuon USB mod, it would be ideal for the Nuon to detect no controller connected when none is connected to USBRetro.

Should be able to do this by only responding to Nuon packets when at least one controller/player is detected.

USB hub support is not good enough

USB hub support has got better since pre-release build but still needs some more improvement. A USB hub with devices connected should just work every time and hot-swapping devices should be possible.

Sometime I found that I need to plug in the adapter, then connect the USB hub, and then connect each device one by one to get it to work properly. The issue most likely is within the TinyUSB library so thats where we should start investigating further.

8BitDo USB Adapter 2 (Black) not working with firmware v.1.0.1

The 8BitDo USB Adapter 2 (black w/o 2 on shell) seems to automatically unmount and throw and Invalid Speed error when connecting to the adapter. Despite overriding the speed error in pico-sdk/lib/tinyusb the device unmounts before presenting any sort of vid/pid mounting.

Further investigation needs to be done to figure out why. In the short-term downgrading to the 8Bitdo USB Adapter 2 firmware v.1.0.0 restores functionality with the USB2PCE.

Black screen when playing Youkai Douchuuki

I'm new user of USB2PCE with v1.0.3 firmware. In most of titles, it works correctly, but found an issue when playing Youkai Douchuuki.

When I turn on PC Engine with USB2PCE plugged in, the screen remains black. In this situation, any controller input doesn't work at all. When I unplug USB2PCE while the power stays ON, the title screen of Youkai Dochuki is correctly displayed.

I posted video of this issue in X.
https://twitter.com/peca_port0/status/1747291292156277220

Seems like, USB2PCE repeats sending soft reset, so that the screen remains black. But not sure. You can also reproduce this by putting Youkai Douchuuki to Turbo EverDrive Pro, as I tried.

Is there any solution to avoid this?

Verify Xbox One Third-party controller compatibility

Here is a possible list of VIDs of Xbox One controllers. Microsoft, PDP, and PowerA should be covered but I need to verify all third-party controllers are working.

  • {(0x045e) }, /* Microsoft */
  • {(0x0738) }, /* Mad Catz */
  • {(0x0e6f) }, /* PDP */
  • {(0x0f0d) }, /* Hori */
  • {(0x1532) }, /* Razer */
  • {(0x24c6) }, /* PowerA */
  • {(0x20d6) }, /* BDA */
  • {(0x044f) }, /* Thrustmaster */
  • {(0x10f5) }, /* Turtle Beach */
  • {(0x2e24) }, /* Hyperkin */
  • {(0x3285) }, /* Nacon */
  • {(0x2dc8) }, /* 8BitDo */
  • {(0x2e95) }, /* SCUF */
  • {(0x3537) }, /* GameSir */

Incorrect LED status when using the Black 8BitDo USB Receiver

Issue:
When connecting the black 8BitDo receiver the LED status indicator blinks blue/green, which indicates two controllers connected. Everything is functioning correctly except for the wrong LED status.

Solution:
The player counter variable appears to be miscalculating when using the black 8BitDo receiver. I believe this is due to the way this particular adapter cycles modes upon boot. Probably best to just revisit how the LED status's player counter is calculated.

Support Krikzz Turbo Everdrive Pro's In-Game menu / hot-key combos

Hello,

Several user's (including myself) have issues with accessing the In-Game menu on the new Turbo Everdrive Pro via the defined hot-key combos when using the USB-2-PCE adapter.
The combos simply don’t work with the adapter, neither for quick save/load nor bringing up the menu. There are reports for CoreGrafx 1 & 2 at least.
I tried with adapter’s March and December firmware w/o luck.

Krikzz just stated on Twitter: "I don not control controllers refresh timings, i just sniff what console reads. I don't think that i can do something with non regular controllers on my side."

Could you please look into this issue? Thanks!

8bitdo M30 2.4G for Genesis Mini wireless 6-button mode issues

In Street Fighter II CE (or other 6-button enabled games) the buttons on the 8bitdo M30 2.4G for Genesis Mini have their buttons mapped incorrectly. My guess is that since this controller will work with the Switch, it's falling into Switch mode.

X = III
Y = IV
Z = V
A = I
B = II
C = VI

In addition, down diagonals do not seem to register, and on the Options screen you can see the game flicker between 6-button and 2-button modes.

All of this is true whether the controller is connected via the USB cable directly to the USB2PCE or connected via the 2.4 GHz wireless receiver. 2-button mode seems fine other than the diagonals.

I am using the latest firmware for both the receiver and the controller from 8bitdo's site (3.12 for the receiver, 2.08 for the controller) and the July 4 firmware for the USB2PCE.

Nuon spinner type should only be used with spinner capable devices

Tempest 3000 ignores analog and dpad when a spinner is detected. Currently the adapter always identifies itself as having a spinner. We need to make sure it only includes the spinner capability when a controller/mouse is connected that support it.

For example, PS4/PS5 controllers have touch pad implemented to simulate spinner data. But many other USB controllers will not have this. There is a rough right analog stick simulated spinner implemented for xinput but not sure if I will carry this over to all dual analog stick controllers. Also mice and spinners in general that appear as mice will always calculate spinner output.

Xbox 360 wireless receiver mapping all controllers to same player

Problem:
The Microsoft Xbox 360 Wireless Receiver for Windows allows for pairing multiple controllers. But currently every controller paired is being mapped to the same player.

Solution:
Quick peak into this and the reason for this is because each player is assigned by device address. Although each controller paired to the Xbox 360 receiver get a unique device index number, they all use the same device address number. We need to adjust the players array to handle this case. (unique index with same address)

Firmware usb2pce-2023-06-14 and greater break compatibility with 8bitdo PCE controllers

Firmware usb2pce-2023-06-14 and usb2pce-2023-06-21 break compatibility with 8bitdo PCE controllers. Specifically, dpad Up and dpad Left no longer work. There may be other issues too but this is as much as I could test having no dpad left or up. Verified using two different 8bitdo PCE controllers. Reverted back to the June 8 firmware and it's working again.

Switch GameCube Adapter compatibility

It was reported that GameCube adapter support was not working with some 3rd-party adapters. I was under the assumption that all of these simulated the vid/pid and USB HID reports of the official WiiU/Switch GameCube USB adapters. So this needs to be researched further to verify.

M30 3-button mode turbo buttons

With the addition of the 3-button mode, turbo functionality had been requested specifically for the M30. For 6-button controllers this makes sense can be done.

Currently the turbo functionality is applied globally and not on a per-device type basis. Turbo I and II get applied to whatever button III and IV are mapped to. Just like the 6-button mode the 3-button mode currently does have turbo button functionality.

A middle ground requested was to simply map the top and bottom row of the 6-button controllers the same when in 3-button mode. As the M30 has its own turbo functionality built-in that can be enabled manually on the top row. ex. III, II, I.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.