Skip to content

Commit 4e98536

Browse files
authored
Merge pull request #17 from fhoedemakers/USB
Support for more usb input devices
2 parents c993063 + 1571d70 commit 4e98536

12 files changed

+544
-50
lines changed

.github/workflows/buildandrelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
releases/${{ env.APP_NAME }}WsRP2040PiZero.uf2
105105
releases/pico2_${{ env.APP_NAME }}AdaFruitDVISD.uf2
106106
releases/pico2_${{ env.APP_NAME }}PimoroniDV.uf2
107-
PCB/pico_nesPCB_v2.0.zip
107+
PCB/pico_nesPCB_v2.1.zip
108108
body_path: CHANGELOG.md
109109

110110

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "pico_lib"]
22
path = pico_lib
33
url = https://github.com/fhoedemakers/pico_lib.git
4+
[submodule "tusb_xinput"]
5+
path = tusb_xinput
6+
url = https://github.com/fhoedemakers/tusb_xinput.git

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,44 @@ Binaries are at the end of this page.
1818
- pico2_picosmsPlusimoroniDV.uf2: Pimoroni Pico DV Demo Base with Pico 2/RP2350
1919
- pico_nesPCB_v20.zip: PCB Design. For more info see the [Pico-InfonesPlus sister project](https://github.com/fhoedemakers/pico-infonesPlus#pcb-with-raspberry-pi-pico-or-pico-2).
2020

21+
3D-printed case design for PCB: [https://www.thingiverse.com/thing:6689537](https://www.thingiverse.com/thing:6689537).
22+
For the latest two player PCB 2.0, you need:
23+
24+
- Top_v2.0_with_Bootsel_Button.stl. This allows for software upgrades without removing the cover. (*)
25+
- Base_v2.0.stl
26+
- Power_Switch.stl.
27+
28+
(*) in case you don't want to access the bootsel button on the Pico, you can choose Base_v2.0.stl
29+
2130
3D-printed case design for Waveshare RP2040-PiZero: [https://www.thingiverse.com/thing:6758682](https://www.thingiverse.com/thing:6758682)
2231

2332
# Release notes
2433

34+
## v0.12
35+
36+
### Features
37+
38+
- Add support for these USB gamepads:
39+
- Sega Mega Drive/Genesis Mini 1 and Mini 2 controllers.
40+
- PlayStation Classic controller.
41+
- Mantapad, cheap [NES](https://nl.aliexpress.com/w/wholesale-nes-controller-usb.html?spm=a2g0o.home.search.0) and [SNES](https://nl.aliexpress.com/w/wholesale-snes-controller-usb.html?spm=a2g0o.productlist.search.0) USB controllers from AliExpress. When starting a game, it is possible you have to unplug and replug the controller to get it working.
42+
- XInput controllers like Xbox 360 and Xbox One controllers. 8bitdo controllers are also XInput controllers and should work. Hold X + Start to switch to XInput mode. (LED 1 and 2 will blink). For Xbox controllers, remove the batteries before connecting the USB cable. Playing with batteries in the controller will work, but can cause the controller to stop working. Sometimes the controller will not work after flashing a game. In that case, unplug the controller and plug it back in. In case of 8bitdo controllers, unplug the controller, hold start to turn it off, then plug it back in. This will make the controller work again.
43+
- Add USB keyboard support:
44+
- A: Select
45+
- S: Start
46+
- Z: B
47+
- X: A
48+
- Cursor keys: D-pad
49+
- When an USB device is connected, the device type is shown at the bottom of the menu. Unsupported devices show as xxxx:xxxx.
50+
- Minor cosmetic changes to the menu system.
51+
- Minor changes in PCB design (pico_nesPCB_v2.1.zip)
52+
- D3 and D4 of NES controller port 2 are connected to GPIO28 (D3) and GPIO27 (D4), for possible future zapper use.
53+
- More ground points are added.
54+
55+
XInput driver: https://github.com/Ryzee119/tusb_XInput by [Ryzee119](https://github.com/Ryzee119) When building from source, make sure you do a **git submodule update --init** from within the source folder to get the XInput driver.
56+
57+
For more details, see the [README](https://github.com/fhoedemakers/pico-infonesPlus/blob/main/README.md#gamecontroller-support) and [troubleshooting](https://github.com/fhoedemakers/pico-infonesPlus/blob/main/README.md#troubleshooting-usb-controllers) section
58+
2559
## v0.11
2660

2761
### Features

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ PRIVATE
202202
tinyusb_host
203203
dvi
204204
util
205+
xinput_host
205206
)
206207

207208
target_include_directories(${projectname}
@@ -215,6 +216,7 @@ add_subdirectory(drivers/fatfs)
215216
add_subdirectory(drivers/sdcard)
216217
add_subdirectory(pico_lib/dvi)
217218
add_subdirectory(pico_lib/util)
219+
add_subdirectory(tusb_xinput xinput_host)
218220
pico_add_extra_outputs(${projectname})
219221

220222

PCB/pico_nesPCB_v2.1.zip

778 KB
Binary file not shown.

gamepad.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace io
4343
uint8_t axis[3]{0x80, 0x80, 0x80};
4444
Hat hat{Hat::RELEASED};
4545
uint32_t buttons{0};
46-
46+
char GamePadName[20]{};
4747
public:
4848
void convertButtonsFromAxis(int axisX, int axisY);
4949
void convertButtonsFromHat();
@@ -54,4 +54,4 @@ namespace io
5454
GamePadState &getCurrentGamePadState(int i);
5555
}
5656

57-
#endif /* _510036F3_0134_6411_4376_A918ACA8AC4C */
57+
#endif /* _510036F3_0134_6411_4376_A918ACA8AC4C */

0 commit comments

Comments
 (0)