#84267
nolageek
Participant

This is what I’ve done, your mileage may vary but this may get you closer to what you’re going for. I got tired of running retroarch-joyconfig over and over…

I have three controllers: a Logitech F310 and F710 and a RetroLink SNES

I ran the joystick config for each of them, with settings for player one and player two. I saved the output into files for save keeping:

cd /opt/retropie/emulators/RetroArch/installdir/bin

Plug in f710
sudo ./retroarch-joyconfig -j 0 > /opt/retropie/configs/all/f710-P1.cfg
sudo ./retroarch-joyconfig -j 1 > /opt/retropie/configs/all/f710-P2.cfg

Plug in f310
sudo ./retroarch-joyconfig -j 0 > /opt/retropie/configs/all/f310-P1.cfg
sudo ./retroarch-joyconfig -j 1 > /opt/retropie/configs/all/f310-P2.cfg

Plug in SNES
sudo ./retroarch-joyconfig -j 0 > /opt/retropie/configs/all/SNES-P1.cfg
sudo ./retroarch-joyconfig -j 1 > /opt/retropie/configs/all/SNES-P2.cfg

Now you have 2 files for each of the controllers, as Player 1 and Player 2. The only thing I think you’ll need to add manually is the
Hotkey and Exit keys for the player 1 files, etc…

input_enable_hotkey_btn = x (usually the select key number)
input_exit_emulator_btn = x (usually the start key number)

Now append each of the controllers configs to the existing retroarch.cfg file in a game directory.

Let’s use the snes game and my controllers as an example. Let’s use the SNES controller for player one and the F710 controller for player two:

Go to SNES directory
cd /opt/retropie/configs/snes

backups are good!
cp retroarch.cfg retroarch.cfg.bak

add controllers to the end of the current retroarch.cfg file:
cat /opt/retropie/configs/all/SNES-P1.cfg >> retroarch.cfg
cat /opt/retropie/configs/all/f710-P2.cfg >> retroarch.cfg

Granted, I have NOT done this to individual games like it sounds like you want to do, but this is how I swap out controllers in my default /all/retroarch.cfg when I want to use different controllers.