If you are running RetroPie on a Raspberry Pi 7″ LCD, running some games e.g. arcade games using MAME, in the usual landscape orientation means the output of the game is only displayed in the center of the screen.
There are a number of options for rotating output to the screen, depending on what you need to do and/or your preferences:
Rotate the video output
You can do this by editing /boot/config.txt and adding a line like:
display_rotate=1
or
lcd_rotate=1
(depending on whether you are rotating HDMI output or output to the 7″ LCD). 1=90 degrees rotation, 2=180, 3=270
Rotate all Retroarch output
Edit /opt/retropie/configs/arcade/retroarch.cfg and add:
video_allow_rotate = "true"
video_rotation = "3"
Use a rotation value of 1, 2, or 3 etc same as rotating the video output. From here.
Rotate individual MAME rom output
In your ROMs folder, create a rom-name.zip.cfg file and add the same 2 lines as above. Same approach as the overlay configs created here, which also has config for adding a rotated background graphics overlay too.
Rotate EmulationStation display
To rotate the EmulationStation gui you can pass the –screenrotate option in the autostart config for EmulationStation, which you can either set in the cfg file directly or via the RetroPie-Setup.sh – described here.
For the 7″ LCD these options worked for me:
--screenrotate 3 --screenszie 480 800 #auto