This is taken from my own PERSONAL installation guide that i have been creating as I build my retro station. Please excuse any spelling mistakes and such, I spun this off while working on the pi, but the steps are exactly the process I used while doing individual emulator mapping.
ALTERING EMULATOR SPECIFIC CONTROLS
Assuming you have 4 controllers that are the same… (if not scroll down)
From terminal, type”
dir (or ls -1)
Now select a controller to look at for reference for button mapping
sudo nano “controller cfg file to reference/alter”
find specific buttons to change and write down the current configuration. For example, I want to change the NES a and b button mapping by swapping the function of each. MadCatzXbox360Controller.cfg states:
input_a_btn = “0”
input_b_btn = “1”
So now I exit without changing anything (ctrl X, n, enter)
sudo nano retroarch.cfg
IF YOU HAVE DIFFERENT CONTROLLERS (not all the same type)
Enter the emulator you want to alter mapping for. Find the USB that controls the 1st, 2nd, 3rd, and 4th player controllers. Write down the type of controller is for each # player. Exit emulation and emulationstation.
Now in terminal follow the above instructions but repeat the first part for finding how the controller is configured (cd /opt/retropie/emulators/retroarch/configs and sudo nano config file for the controllers that need to be changed) for the controller type for each player. Write down the controls that you want to change under each controller type/player.
Continue to the emulator retroach.cfg file (IE: cd /opt/retropie/configs/nes then
sudo nano retroarch.cfg) and alter the buttons by player# and controller type for remapping (using the configurations from the controller config files). for example, if player 1 is an xbox controller, player one should be reconfigured using mapping for xbox controllers, playstation player # to playstation mapping, etc..
NOTE: You may want to mark what ports they are plugged into by painting a number on the port and the controller. As long as the controllers are in the SAME ports when you load the pi, they should be correctly mapped each time you start emulation.