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 Try the site in https mode Site News

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

  

Author Topic: Rotating the monitor in Wahcade with Xrandr?  (Read 3440 times)

0 Members and 1 Guest are viewing this topic.

symgryph

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:February 02, 2010, 10:07:20 pm
Rotating the monitor in Wahcade with Xrandr?
« on: November 16, 2009, 10:32:03 pm »
I have loaded wahcade, and have figured out how to get the layouts to switch from portrait to landscape via manual use of the 'xrandr' command. I was wondering if anyone had any ideas on how to script this or hack wahcade so that I could just press a button and have it cycle through the various left, right, 'normal' layouts, and automagically rotate the screen?

THomas

symgryph

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:February 02, 2010, 10:07:20 pm
Re: Rotating the monitor in Wahcade with Xrandr?
« Reply #1 on: November 17, 2009, 10:18:09 pm »
I managed to hack up something (that doesn't work perfectly, but it does allow rotation when choosing the 'toggle' button for layouts.

It assumes that you have files in /home/mame/bin/
and files for the different orientations (left, right, and 'normal).

Edit the wahcade file win_main.py and modify the following:

Code: Select all
      if layout_matched:
                #print "switched to:", new_angle
                self.layout_orientation = new_angle
                if os.path.isfile(layout_files[0]):
                    self.load_layout_file(layout_files[0])
                if os.path.isfile(layout_files[1]):
                    self.histview.load_layout(layout_files[1])
                if os.path.isfile(layout_files[2]):
                    self.cpviewer.load_layout(layout_files[2])


Add the following code after:

Code: Select all
    if new_angle == 0 :
               os.system("/home/mame/bin/normal")
            if new_angle == 90 :
               os.system("/home/mame/bin/left")



This isn't perfect, you have to toggle rotation back after every game, but it’s a start.

Thomas

symgryph
     
    Posts: 8
    Joined: Fri Nov 06, 2009 12:08 am

Top

    * Edit post
    * Delete post
    * Report this post
    * Reply with quote

Re: Getting Wahcade to Rotate?

Postby symgryph » Tue Nov 17, 2009 10:15 pm
Forgot to add that you xrandr -o left, right, normal, and inverted in the different batch files called from previously mentioned edited file.

symgryph
     
    Posts: 8
    Joined: Fri Nov 06, 2009 12:08 am