Hi,
I just found that if I create the ‘nvram’ directory here (and allow user pi to write to it)
/opt/retropie/emulators/mame4all-pi/
Then when playing Mame games (with mame4all-pi) the service menu (accessed with F2) will save settings here. Useful with things like flipping the screen and setting difficulty. To save the service menu you just press F2 again.