You can use dd, this applies also for creating an image of an SDD, USB, ... and restoring it
It's best to unmount the drive you're going to copy. In case of the SD-card, remove the SD-card from the RPi and put it into a card reader. Don't mount.
The basic command is this:
dd if=input_file of=output_file status=progress
Use lsblk to determine the name of the ...
Have a look through Using rsync to backup Pi
You need to set the exclusions to include where the roms are stored.
I would question why not backup the rom files though? Restoring the machine WHEN (not if) the SD card fails will take significantly longer if you have to download / find all the rom files again...
I don't think there is on command in either Linux or the RetroPi setup to achieve this but you can use either :
There may be other scripts or options available if you do a web search. In Linux at least Bash scripts are your friends :D
There's an easier way. Just change the settings for your controllers in RetroArch.
You can find it under input settings and the second line should say something about "Assign DPad to Analogue stick". You can also change the first line to "Gamepad with Analogue sticks". Mine was set to just "Gamepad".