I checked the Pi Piggies image, and it looks like it has Mame2010. According to the RetroPie Wiki (
https://github.com/RetroPie/RetroPie-Setup/wiki/MAME) those ought to be Mame .139 roms. I *think* Rey's image uses Advmame. Typically, regular Mame versions have a black or clear tab screen, and Advmame has a white tab screen. Advame uses .94 or .106 roms, so the roms you have there aren't interchangeable. Some might happen to work in Advmame if they haven't been updated in a long time. You can always try.
I'm sure Piggies image has thousands of roms, so I know it's not realistic to check them all. A better bet would be to remove them all, and just get the roms for games you actually want... a list that probably tops out orders of magnitude smaller than what's included. There's a list of all killer no filler games here on the board. It's a good place to start.
http://forum.arcadecontrols.com/index.php/topic,149708.0.htmlAnyway, that doesn't fix the problem... just an offhand suggestion.
Regarding switching... you shouldn't need to delete anything Retroarch includes multiple versions of Mame (including Advmame). You can probably just mv or cp the roms to the mame-advmame folder and restart. If Emulation is setup like the default, you won't need to do anything, it should update it's rom list for you (IIRC).
Regarding JSTest vs. EmulationStation, what you have there is probably good enough.
The mapping for joystick controls in libretro mame versions is the same as everything else in retroetrarch (by default). There's the main CFG file here:
/opt/retropie/configs/all/retroarch.cfg
and then mame specific version here:
/opt/retropie/configs/mame-libretro/retroarch.cfg
You can use the same mapping in the main retroarch.cfg file to make mame-specific configs in the mame-libretro retroarch.cfg file.
I also haven't found the text you would need to input if I found the right config file to edit.
In the past, the method I used to find the right key mappings was to use the tab menu and then map ALL of the controls to different commands in some specific rom. Then I could find that correct text/mapping of those controls and copy it elsewhere. You may need to edit the analog controls setting in Mame2010 to get your sticks to work.
If you end up using advmame, it's located /opt/retropie/configs/mame-advmame/MAME VERSION HERE. There's 2 or 3 versions available depending on your retropie version. Some sample mapping in my admame-0.94.rc file looks like this (several joysticks and a keyboard):
qbert/input_map[p1_left] joystick_digital[1,0,0,1] joystick_digital[1,0,1,1]
qbert/input_map[p1_right] joystick_digital[1,0,0,0] joystick_digital[1,0,1,0]
qbert/input_map[p1_down] joystick_digital[1,0,0,1] joystick_digital[1,0,1,0]
qbert/input_map[p1_up] joystick_digital[1,0,0,0] joystick_digital[1,0,1,1]
input_map[p1_button1] joystick_button[1,0] or keyboard[0,lcontrol]
input_map[p1_button2] joystick_button[1,1] or keyboard[0,lalt]
input_map[ui_configure] joystick_button[0,6] or keyboard[0,tab]
input_map[ui_cancel] keyboard[0,esc] or joystick_button[0,5]
input_map[start1] joystick_button[1,6] or keyboard[0,1]
input_map[coin1] joystick_button[0,4] or keyboard[0,5]
input_map[ui_up] joystick_digital[1,0,1,1] or keyboard[0,up]
input_map[ui_down] joystick_digital[1,0,1,0] or keyboard[0,down]
input_map[ui_left] joystick_digital[1,0,0,1] or keyboard[0,left]
input_map[ui_right] joystick_digital[1,0,0,0] or keyboard[0,right]
input_map[ui_select] joystick_button[1,6] or keyboard[0,enter]
input_map[p1_up] joystick_digital[1,0,1,1] or keyboard[0,up]
input_map[p1_down] keyboard[0,down] or joystick_digital[1,0,1,0]
input_map[p1_left] joystick_digital[1,0,0,1] or keyboard[0,left]
input_map[p1_right] joystick_digital[1,0,0,0] or keyboard[0,right]
galaga/input_dipswitch[coinage] free_play
excitebk/input_dipswitch[coinage] free_play
mspacman/input_dipswitch[coinage] free_play
mpatrol/input_dipswitch[coinage_mode_1] free_play
mpatrol/input_dipswitch[coin_a_mode_2] free_play
gyruss/input_dipswitch[coin_b] free_play
gyruss/input_dipswitch[coin_a] free_play
quick reference: All of the locations for the config files are listed on this page:
https://github.com/RetroPie/RetroPie-Setup/wiki/MAME