A real improvement to RetroPie EmulationStation 2.x is the ability to easily set up and use multiple different types of controllers in the emulators on the fly. This will also allow you to use two different controllers for different players. In the past I had to write separate retroarch.cfg config files and call them using a program that I wrote.
For this to work there can be no controller information in any of the retroarch.cfg files either in the main one or the system specific file including the hot keys. If you followed my post about setting up controllers in Retroarch (here) then you already have a back up of the original retroarch.cfg file. If you made any other changes to the retroarch.cfg file then make sure to write them down to change again. To change revert back to the original file use the cp command:
pi@raspberrypi ~ $ cd /opt/retropie/configs/all pi@raspberrypi /opt/retropie/configs/all $ cp retroarch.cfg.bak retroarch.cfg |
If you don’t have a backup file then you can find a copy of it on the petrockblock’s git hub here
To start make sure only one controller is plugged in at one time. Use the following commands to load the retropie-setup script:
pi@raspberrypi /opt/retropie/configs/all $ cd /home/pi/RetroPie-Setup pi@raspberrypi ~/RetroPie-Setup $ sudo ./retropie_setup.sh |
Once loaded, select ‘Option 3: SETUP (only if you already have run one of the installations above)‘
Then ‘Option 315: Resister RetroArch Controller‘
It will be the same after this as mapping the controllers since it uses retroarch-joyconfig. If you get to a button that your controller doesn’t have, don’t press anything and the program will skip over it. When the program finishes it will tell you what it saved as.
For example I did this with my SNES controller and it saved the configuration file as:
USBGamepad.cfg |
After I exited out of the setup script I found the file by running the find command I found the file to be located in:
pi@raspberrypi ~/RetroPie-Setup $ cd pi@raspberrypi ~ $ sudo find / -name USBGamepad.cfg /opt/retropie/emulators/RetroArch/configs/USBGamepad.cfg |
This is also the file that you will enter the hot keys you’d want for this controller. I just used the hot key settings that I did in my old retroarch.cfg file.
pi@raspberrypi ~ $ cd /opt/retropie/emulators/RetroArch/configs pi@raspberrypi /opt/retropie/emulators/RetroArch/configs $ sudo nano USBGamepad.cfg |
I went to the bottom of the file and added:
input_enable_hotkey_btn = 8 #Select input_exit_emulator_btn = 9 #Start input_save_state_btn = 1 #A button input_load_state_btn = 2 #B button input_state_slot_increase_btn = 5 #R button input_state_slot_decrease_btn = 4 #L button input_reset_btn = 0 #X button input_menu_toggle_btn = 3 #Y button input_state_slot_increase_axis = +0 #Right on D pad input_state_slot_decrease_axis = -0 #Left on D pad input_reset_axis = -1 #Up on D pad input_audio_mute_axis = +1 #Down on D pad |
Save and exit with:
Ctrl+x Y Enter |
Next time you load EmulationStation it will auto detect the controller! Now all you have to do is repeat these steps for how ever many different controllers you have.
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)