Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 8BitDo N64 Modkit support (DInput) #930

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

bcat
Copy link
Contributor

@bcat bcat commented Oct 6, 2023

The 8BitDo N64 Modkit is a replacement PCB and "rumble pak" that converts an OEM N64 Controller to a USB/Bluetooth controller with two modes: one that emulates an NSO N64 controller (for which there are already autoconfig files), and the other that presents as a normal DirectInput controller with a unique PID/VID. This pull request adds a dinput config file for the second mode of operation.

I tried to the match the formatting of the other 8BitDo dinput configs, but since the controller physically offers the same buttons as the NSO N64 Controller (including addition of ZR and Home buttons), I used the same RetroPad mappings as the existing N64_Nintendo_Switch_Online.cfg (with DirectInput button/axis numbers changed appropriately).

I tested this on the Mupen64Plus-Next core, and it seems to work fine.

Note that I don't love the compromises these mappings (and the equivalent NSO N64 mappings) make for the controller to work with both default Mupen config and RetroArch menus. In particular, double-binding the controller's physical "B" button to enable menu navigation is a hack, and the end result still leaves menu OK/cancel flipped vs. a normal controller. But honestly, the RetroPad abstraction doesn't work very well with controllers whose face buttons aren't laid out like a SNES or DualShock pad, and I suspect the NSO controller mappings are the least bad choice to make under the circumstances.

I don't have a Linux setup running RetroArch right now, so I didn't add a corresponding udev config, though it should be easy for someone else to do so if they want.

@RobLoach
Copy link
Member

RobLoach commented Oct 6, 2023

Looks great, while I don't have the modkit to build the config for udev, this should be good to go as a first step. Thanks!

@RobLoach RobLoach merged commit 8f8865f into libretro:master Oct 6, 2023
1 check passed
@RobLoach RobLoach changed the title Add dinput config for 8BitDo N64 Modkit Add 8BitDo N64 Modkit support (DInput) Oct 6, 2023
@bcat bcat deleted the 8bitdo-n64-modkit branch October 13, 2023 05:36
@SosPosos
Copy link

SosPosos commented Apr 22, 2024

Hi, a and b was swapped for some reason..
And did you manage to make rumble work in switch mode?

@bcat
Copy link
Contributor Author

bcat commented Apr 29, 2024

Hi, a and b was swapped for some reason.

I agree this is a bit strange, but it's actually intentional (and matches the autoconfig for the official NSO N64 controller). If you look at the default Mupen64Plus-Next controller conifg, you will see the following:

  • RetroPad B -> Emulated N64 A
  • RetroPad Y -> Emulated N64 B

This way, the physical positions of the N64 B and A buttons relative to one another are preserved on a SNES-style RetroPad.

But the abstraction gets confusing when the physical controller doesn't have an SNES-style button cluster. In order for the N64 controller to work correctly with default Mupen core mappings, this autoconfig maps as follows:

  • Physical N64 A -> RetroPad B -> Emulated N64 A
  • Physical N64 B -> RetroPad Y -> Emulated N64 B

However, those two mappings would leave no way to press RetroPad A, which is kind of important for navigating the RetroArch menus. :) To work around this, we define an additional mapping (and, again, the official NSO controller's autoconfig file does the same thing):

  • Physical N64 A -> RetroPad B -> Emulated N64 A
  • Physical N64 B -> RetroPad Y -> Emulated N64 B
  • Physical N64 B -> RetroPad A

With these mappings, the physical buttons perform the right actions in emulated games by default, and it's possible to navigate the RetroArch menus as well. But A and B are swapped when navigating menus (Physical N64 A -> RetroPad B, Physical N64 B -> RetroPad A).

IMO, this is a drawback of the RetroPad abstraction itself. I really wish libretro had support for controller "shapes" other than SNES/PSX style. In particular, native awareness of physical controllers with six physical face buttons would make button mapping for N64- and Genesis-style controllers much nicer.

But that's not how RetroArch works today, and so the author of NSO controller config chose to prioritize default functionality at the expense of reversed buttons in the menus. That seemed like a reasonable choice, and I decided to follow it for the config that got checked in. :)

(Note that I personally do not use this config as is. I only play N64 games on an N64-style controller, so I updated my autoconfig locally to map Physical N64 A -> RetroPad A and Physical N64 B -> RetroPad B, and then I adjusted my Mupen core control mappings accordingly. But that didn't seem like a good default config since the controller wouldn't be compatible out of the box with default Mupen mappings.)

And did you manage to make rumble work in switch mode?

I did not test this, sorry. (I use my controller exclusively in Switch mode on Switch and DInput mode on PC.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants