Remap xbox360 controller A B buttons for NES games

I use version 1.2.2 and I want to remap my xbox360 controller A B buttons for NES games.

By default my xbox360 controller’s A button jumps in super mario bros and the B button is speedup. I want to remap speedup to the X button on the controller.

The Libretro 1.2 release blog post said:

– Ability to remap controls – An often-heard complaint before was the inability to change the controls. We have made this possible now. Once a game is loaded, go to the ‘Quick Menu’ and select ‘Core Input Remapping Options’. From there you can change the controls per core, and you can also save these changes to a config file.

But I have no such remapping option in my quick menu in version 1.2.2! I’ve tried with both xmb and rgui menu drivers and open the quick menu when the game is loaded.

edit: I found the problem. The “Core Input Remapping Options” is missing from quick menu only when I use the BNES core. But it is there for other cores. Is that a known bug?

Here is a manual workaround to remap for BNES. First load a NES game with another core like Nestopia, open quick menu, select “Core Input Remapping Options” and “save core remap file”. The remap files have this path and name format for a core wide remap

 \config\remap\[corename]\[corename].rmp

and this for a single game only remap

 \config\remap\[corename]\[game file name without extension].rmp

To manually remap for BNES we first copy

 \config\remap\Nestopia\Nestopia.rmp

to

 \config\remap\BNES\BNES.rmp

and then open BNES.rmp in a text editor.

It will look something like this

input_player1_b = "0"
input_player1_y = "1"
input_player1_select = "2"
input_player1_start = "3"
input_player1_up = "4"
input_player1_down = "5"
input_player1_left = "6"
input_player1_right = "7"
input_player1_a = "8"
input_player1_x = "9"
...

Now we must think in two steps. 1 Find out which variable name (input_player1_b etc) corresponds to which hardware button on the controller (green A button etc). 2 Switch values in the remap for the those buttons (their corresponding variables) that we want to remap.

I’m not sure what the complete answer to step 1 is. I first thought the list in the last half of the file

\autoconfig\xinput\Microsoft(R)Sidewinder(R)_Game_Pad_USB.cfg

answered that but that appears to be incorrect for hardware buttons green A and red B.

Through trial and error I discovered that I should edit the first two lines of the BNES.rmp file into this

input_player1_b = "1"
input_player1_y = "0"

That makes the blue X button on the controller do the speed/fireball action in the game. Problem solved.

But I’d still like to hear if someone can explain step 1 more fully and give a complete list of variable names and corresponding hardware buttons for the xbox360 controller in Windows . I also want to ask if there is a way to bind the same action to multiple buttons. For example can I map both the red B button and the blue X button on the controller to do the speed/fireball action in Super Mario Bros?

There’s no fancy mapping in RetroArch, including one-to-many and/or many-to-one. Only one-to-one via the retropad, so one physical button to one virtual button.

The input remapping has to be added to each core, which is why it’s missing from bNES. Just for reference, you probably shouldn’t bother using bNES-libretro, as it is based on outdated code from back when bNES was first released. Higan’s version is significantly better now, but nestopia (and FCEUmm, for that matter) is still better in pretty much every way, and that’s definitely the case as far as libretro/RetroArch is concerned.

Ok, good to know.

Thanks, I’ll switch. Though the games I’ve tried with bnes_libretro.dll run ok so far. Is there some list of which cores are best/recommended for each system? I think I simply started using bnes_libretro.dll simply because it came before some of the others in the list of cores in the RetroArch core downloader menu.

Do you know if there’s a complete list of variable names and corresponding hardware buttons for the xbox360 controller in Windows? In case I want to remap some more stuff manually.

Not really, since they’re almost all important for some reason or another, be it performance or features (for example, nestopia is generally your best bet, but FCEUmm is a bit faster and supports more weird Chinese bootleg mappers). The only ones that are essentially always worse than other options are bNES, mednafen-snes, mednafen-gba and meteor.

Not that I know of but you could probably figure it out by doing the same process you described in your post for mednafen-psx, since it uses all of the retropad buttons.

Huh? I haven’t posted about mednafen-psx. Feels like I’m missing something regarding retropad here too. I’ll try to rephrase my question.

the remap files saved by RetroArch have this format:

input_player1_b = "0" 
input_player1_y = "1"
...

How does RetroArch determine which hardware button on a controller will be matched to which “input_player1_b” type variable?

When I looked around I found e.g. \autoconfig\xinput\Microsoft®Sidewinder®_Game_Pad_USB.cfg with a section like this

input_b_btn_label = "A"
input_y_btn_label = "X"
input_select_btn_label = "."
input_start_btn_label = ".."
input_up_axis_label = "D-Pad Up"
input_down_axis_label = "D-Pad Down"
...

I first thought that was the answer but that doesn’t appear to get the physical green A and red B button on the 360 controller. So I’m thinking there must be some other list like that that is the correct one for the xbox 360 controller. Or maybe I’m merely very confused on how all this works (this is perhaps the most probable answer :smiley: ).

I meant: follow the same process you used on the NES emus but with mednafen-psx.

Regardless, the codes are whatever the driver reports back. When you hit ‘a’ on the 360 controller (that is, bottom face button), the driver reports a code–looks to be ‘0’ in this case–which is autoconfigured to the retropad’s ‘b’ button (same place, bottom face button; we just use SNES button naming as a result of RetroArch first being developed with snes emulation in mind) because of the driver-specific, controller-specific autoconfig file. You should be able look into that file and see what all of the controllers other automappings are. You can find out where it’s stored by looking at your settings > directory and looking for your ‘input device autoconfig’ directory. You’ll also need to go into settings > driver and see what your input driver is set to (presumably xinput) to make sure you’re looking at the correct file.