Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Retropie Rotating Monitor Config  (Read 6454 times)

0 Members and 1 Guest are viewing this topic.

Kingcade

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 82
  • Last login:October 14, 2021, 04:33:12 pm
  • Building a steampunk arcade cabinet
Retropie Rotating Monitor Config
« on: July 10, 2020, 11:41:32 pm »
My cabinet has a manually rotated CRT. I’m using a Raspberry Pi 3b+ running RetroPie and EmulationStation (ES).

I’ve spent a fair amount of time figuring out how to configure things using the UI so my games were shown in the correct orientation, so I thought I would share what worked for me. You could also manually edit the config files. There may be easier ways.

I’ve got 4 ES Collections set up for my games, to separate them based on the hardware requirements.

- Horizontal Display, 4-way joystick
- Horizontal Display, 8-way joystick
- Vertical Display, 4-way joystick
- Vertical Display, 8-way joystick

I rotate the monitor and set the joystick mode appropriately and then play games from the corresponding collection.

First, you need to set video_allow_rotate to false in the Retroarch config. This will prevent the games from assuming a horizontal monitor rotation and rotating vertical games to fit in it. You might also need to set video_rotation(0), depending on what the default is.

I made this config change by going into the Retropie Configuration Editor > Advanced Configuration > Configure Libreto Options > arcade/retroarch.cfg. You might have to pick a different folder depending on your game file setup.




I could only get rotating and scaling to work well in the MAME2003 and fbneo cores, so I set all of my games to use one of those two cores.

To config MAME 2003 vertical games, launch a MAME game and then enter the Retroarch config menus by hitting Select (Exit) button plus the X button. On my 6-button control panel, the X button is the top middle button.

This will take you into the Main Menu > Quick Menu. From here, scroll down to Options, and set TATE_mode to on. Go back to the previous menu and Overrides>Save Core Overrides. Go back to the Main Menu and Quit Retroarch. You might need to then restart the system.




Repeat the process with a fbneo games, but set Options > Vertical_Mode to  true.

For each Mame game, the rotation will need to be set. Some will require normal rotation, others will require 90, 180, or 270 rotation. You’ll need to launch each game to see how to configure it.

Again, launch a MAME game and enter the Retroarch menu. Go back to the Main Menu, and then go to the right for the Settings menu.

From the Settings > Video menu, set the “rotation” value accordingly. Then go back to the Quick Menu, and select Override > Save Game Overrides. Go back to the Main Menu and Quit Retroarch.









The only problem with this setup is the EmulationStation menus for the vertical games are sideways. ES doesn’t appear to have a way to dynamically switch into vertical orientations.  ES provides a startup parameter to put it into vertical mode, but it can’t be changed without a config change and restart.


Sent from my iPhone using Tapatalk
« Last Edit: July 11, 2020, 09:16:16 pm by Kingcade »
KINGCADE - my Steampunk Wild West penny arcade-style cabinet
http://forum.arcadecontrols.com/index.php/topic,161105.msg1697383.html#msg1697383

Kingcade

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 82
  • Last login:October 14, 2021, 04:33:12 pm
  • Building a steampunk arcade cabinet
Re: Retropie Rotating Monitor Config
« Reply #1 on: July 11, 2020, 09:35:58 pm »
Update - I figured out a way to rotate EmulationStation without reconfiguration! I changed the EmulationStation startup script to toggle between starting up in horizontal mode or vertical mode. So, now, to switch modes, I just click the P1 button and select Quit>Restart EmulationStation!  :woot

To make the same change, hit F4 to exit to the command line, then
sudo nano /opt/retropie/supplementary/emulationstation/emulationstation.sh

Make the changes below, hit Ctrl-O and Enter to save the file, then Ctrl-X, then type Exit. That's it!  Follow the steps above to restart EmulationStation, and it will switch modes each time you restart.

Note:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Code: [Select]
#!/bin/sh


esdir="$(dirname $0)"
while true; do
    rm -f /tmp/es-restart /tmp/es-sysrestart /tmp/es-shutdown
    "$esdir/emulationstation" "$@" $rotate
    ret=$?
    if [ -f /tmp/es-restart ]; then
       if [ -z "$rotate" ]
       then
            rotate=”--screenrotate 1”         
       else
         rotate=””
       fi
       continue
    fi
    if [ -f /tmp/es-sysrestart ]; then
        rm -f /tmp/es-sysrestart
        sudo reboot
        break
    fi
    if [ -f /tmp/es-shutdown ]; then
                rm -f /tmp/es-shutdown
        sudo poweroff
        break
    fi
    break
done
exit $ret

KINGCADE - my Steampunk Wild West penny arcade-style cabinet
http://forum.arcadecontrols.com/index.php/topic,161105.msg1697383.html#msg1697383

Kingcade

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 82
  • Last login:October 14, 2021, 04:33:12 pm
  • Building a steampunk arcade cabinet
Re: Retropie Rotating Monitor Config
« Reply #2 on: July 11, 2020, 09:40:28 pm »
Here’s a screenshot showing the highlighted changes in the code, as well as a view of what the EmulationStation Carbon theme looks like when rotated vertically.





Sent from my iPhone using Tapatalk
KINGCADE - my Steampunk Wild West penny arcade-style cabinet
http://forum.arcadecontrols.com/index.php/topic,161105.msg1697383.html#msg1697383

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5116
  • Last login:May 03, 2022, 09:49:12 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Retropie Rotating Monitor Config
« Reply #3 on: July 13, 2020, 01:08:40 pm »
Good work Kingcade.
I played around with using ES with retropie to automatically rotate the monitor.
I used the GPIO to interface RPi to the motor drive and rotation limit switches.
I cant find any reference to it here or in my backups (Maybe PL1 can help me.)
But if memory serves correctly, I think I did basically what you are doing, except my script re-wrote the ES config file based on game selected, and restarted ES after the game ended.
I cant verify that without some reference to go by though.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8888
  • Last login:Today at 03:13:34 pm
  • Designated spam hunter
Re: Retropie Rotating Monitor Config
« Reply #4 on: July 13, 2020, 01:52:02 pm »
I played around with using ES with retropie to automatically rotate the monitor.
I used the GPIO to interface RPi to the motor drive and rotation limit switches.
I cant find any reference to it here or in my backups (Maybe PL1 can help me.)
Is this what you're looking for?

http://forum.arcadecontrols.com/index.php/topic,150907.msg1580159.html#msg1580159




Scott

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5116
  • Last login:May 03, 2022, 09:49:12 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Retropie Rotating Monitor Config
« Reply #5 on: July 13, 2020, 04:58:01 pm »
Yes thats it, Thanks again PL1!!!

Kingcade

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 82
  • Last login:October 14, 2021, 04:33:12 pm
  • Building a steampunk arcade cabinet
Re: Retropie Rotating Monitor Config
« Reply #6 on: July 13, 2020, 06:48:48 pm »
Good work Kingcade.
I played around with using ES with retropie to automatically rotate the monitor.
I used the GPIO to interface RPi to the motor drive and rotation limit switches.
I cant find any reference to it here or in my backups (Maybe PL1 can help me.)
But if memory serves correctly, I think I did basically what you are doing, except my script re-wrote the ES config file based on game selected, and restarted ES after the game ended.
I cant verify that without some reference to go by though.

Thanks! Unfortunately my rotation mechanism is to clunky to automate it, but the manual rotation seems to work okay. I am a little nervous about the longevity of the CRT with all the rotation and de-gaussing. 21" CRTs are hard to come by these days.

I've spent the last couple of days diving down the rabbit hole of RGB video with the Raspberry Pi. There are scripts called runcommand-onstart.sh and runcommand-onend.sh that are run before and after a game is started, and I'll be using them to set the HDMI timings for the monitor to correspond to the game resolution. Are those the scripts you used for your automated rotation?

I found sample versions of the scripts for setting the resolutions, but of course they don't account for rotating monitors. So, next step is to modify those and try them out. Hoping to get as close to native resolutions and scan lines as is possible with the Pi.
KINGCADE - my Steampunk Wild West penny arcade-style cabinet
http://forum.arcadecontrols.com/index.php/topic,161105.msg1697383.html#msg1697383

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5116
  • Last login:May 03, 2022, 09:49:12 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Retropie Rotating Monitor Config
« Reply #7 on: July 15, 2020, 06:05:35 pm »

I've spent the last couple of days diving down the rabbit hole of RGB video with the Raspberry Pi. There are scripts called runcommand-onstart.sh and runcommand-onend.sh that are run before and after a game is started, and I'll be using them to set the HDMI timings for the monitor to correspond to the game resolution. Are those the scripts you used for your automated rotation?

Honestly, I cant remember, but that may have been the way I did it. Also, the monitor would turn back to horizontal after game was done playing, and ES would come back in horz. mode. I wish I could find the work I did on that. It would be a lot better if the ES screen turned vertical and horizontal too.

Kingcade

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 82
  • Last login:October 14, 2021, 04:33:12 pm
  • Building a steampunk arcade cabinet
Re: Retropie Rotating Monitor Config
« Reply #8 on: August 15, 2020, 03:01:25 pm »
Just a quick update here - I switched my setup from using an HDMI output to an analog VGA666 output. I set HDMI_TIMINGS in my config.txt to run EmulationStation in 800x600 mode. This change caused my screen rotation script to have issues in vertical mode, where it was displayed in 800x600 vertically instead of 600x800.

To fix it required the following change to the code above:

Code: [Select]
            rotate=”--screenrotate 1 --screensize 600 800”
   
KINGCADE - my Steampunk Wild West penny arcade-style cabinet
http://forum.arcadecontrols.com/index.php/topic,161105.msg1697383.html#msg1697383

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5116
  • Last login:May 03, 2022, 09:49:12 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Retropie Rotating Monitor Config
« Reply #9 on: August 16, 2020, 06:08:53 pm »
Cool. I just about have my MRotate5 project behind me, then I plan to concentrate on this. Im sure I made a image of the sd card for my project, will see if I can find it and dig out the RPi.