The mame emulator cannot save the config since you’re running mame as pi user. The config folder in the mame emulator belongs to the root user, so you’re not allowed to make any changes to that folder. The easiest thing would be to run mame one time by hand as root user
configure your controls by pressing and then restart emulationstation. The pi should now have your new controls saved. The other solution would be to change the ownership of the config file but that is a bit more complicated.
At the end of the retroarch.cfg file, it is a good idea to add the following to allow you to press select+start to exit the game.
input_enable_hotkey_btn = “6″ input_exit_emulator_btn = “7″
I also like to take advantage of the save and load states in emulation, which some people consider cheating. Add the following lines to enable these buttons on your joypad.
input_save_state_btn = “8″ input_load_state_btn = “10″
Keep in mind, you must hold the “input_enable_hotkey_btn” to trigger the other functions. In other words, using save state would require you to press button 6, and hold it while pressing button 8
I just saw these in other posts, which could explain the settings not being saved when making changes to the emulator whilst running through ES and setting buttons to exit emulators / access menus etc. I’ll give them a go later and see whether this has any effect.
Thought I would dump this post in here as it might become useful for others later on…