Previously I set up all my controllers to work on the front end of EmulationStation (found here). To have them also work on the emulators I am going to need to edit the main emulator configuration file with the controller’s button information. I found it easier to record the button inputs to a file so that I can reference them later.
When you install RetroPie an nice tool is included called ‘retroarch-joyconfig’. What this does is prompt you for a button and then display the button’s value. The results can be used to set up the controller for the emulators.
Since this is the new version of RetroPie I had to find the program’s new location. To do this I used the find command:
|pi@raspberrypi ~ $ sudo find / -name retroarch-joyconfig|
The results showed two locations:
I used the one in the tools directory but I don’t think it matters which you use. I needed a location to store these files that I am going to be making so I created a folder in the pi’s home directory with:
|pi@raspberrypi ~ $ mkdir /home/pi/keymaps|
and then went into that directory with:
|pi@raspberrypi ~ $ cd /home/pi/keymaps|
I am going to label the controllers the same way that I did in the previous post to make things simple.
It is important to note that you should only have one controller plugged in at a time when doing this. The retroarch-joyconfig program will only recognize the first input device.
I typed the following command (all one line) to run retroarch-joyconfig and told it to record the values to a new file SNES_1.txt
|pi@raspberrypi ~/keymaps $ /opt/retropie/emulators/RetroArch/tools/retroarch-joyconfig > /home/pi/keymaps/SNES_1.txt|
When you run this it will To see the contents of the file that was just created you can either open it in the editor with nano or view it in the terminal with cat. The file that I created looks like following when I displayed it with cat:
|pi@raspberrypi ~/keymaps $ cat SNES_1.txt
input_player1_joypad_index = “0”
input_player1_b_btn = “2”
input_player1_y_btn = “3”
input_player1_select_btn = “8”
input_player1_start_btn = “9”
input_player1_up_axis = “-1”
input_player1_down_axis = “+1”
input_player1_left_axis = “-0”
input_player1_right_axis = “+0”
input_player1_a_btn = “1”
input_player1_x_btn = “0”
input_player1_l_btn = “4”
input_player1_r_btn = “5”
input_player1_l2_btn = “9”
input_player1_r2_btn = “9”
input_player1_l3_btn = “9”
input_player1_r3_btn = “9”
input_player1_l_x_plus_btn = “9”
input_player1_l_x_minus_btn = “9”
input_player1_l_y_plus_btn = “9”
input_player1_l_y_minus_btn = “9”
input_player1_r_x_plus_btn = “9”
input_player1_r_x_minus_btn = “9”
input_player1_r_y_plus_btn = “9”
input_player1_r_y_minus_btn = “9”
Since this was a SNES controller I didn’t have all the buttons so I hit the Start button for all the other ones. I did the same for the two PlayStation 2 controllers PS2_1 and PS2_2 respectively.
|pi@raspberrypi ~/keymaps $ /opt/retropie/emulators/RetroArch/tools/retroarch-joyconfig >
pi@raspberrypi ~/keymaps $
/opt/retropie/emulators/RetroArch/tools/retroarch-joyconfig > /home/pi/keymaps/PS2_2.txt
Those files will look very similar also.
Next time I will finally set up the controllers to work with RetroArch so that they work with the emulators!
Check out these other helpful links:
Mapping Controllers (1 of 3): For EmulationStation
Mapping Controllers (2 of 3): Mapping Controllers to a File
Mapping Controllers (3 of 3): Setting up Controllers in RetroArch
Auto detecting controllers in EmulationStation 2.0+
RetroPie: Adding game roms, BIOS files, and enabling save states
Setting up GameBoy Advance for RetroPie
Adding a XBMC tab in EmulationStation
Adding an Apps tab in EmulationStation
Setting up Playstation for RetroPie
Creating power logs for EmulationStation (1 of 2)
Creating power logs for EmulationStation (2 of 2)