Author Topic: Help me with rotation ?  (Read 7716 times)

jimmer

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Help me with rotation ?
« on: November 07, 2015, 01:15:27 PM »

I going to build a PC based MAME machine with a manual (for the time being) rotation of the screen.  So the way I want things to work is you select your game and it will appear in the screen in the correct orientation (ie filling it) and if that is not the current rotation you will then rotate the screen, when you exit the game Attractmode appear correctly oriented (I've seen there is a plugin for that).

Up to now I've only done dedicated horizontal or vertical MAME set-ups, so how do I go about this please? 
Is it a MAME set-up thing or will AM do it for me?

Thanks.

pixelObsession

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Help me with rotation ?
« Reply #1 on: November 15, 2015, 05:10:58 PM »
I am interested in this as well  8)

I have a servo motor and will be receiving my pololu micro maestro controller board this week to start playing with my LCD rotation setup.  Haven't gotten too deep into my FE setup but have been keeping an eye on AM after testing is about 6 months ago.

I'm guessing it has the ability to run command lines to drive the motor controller and able to pull orientation from the mame.xml per game...

pixelObsession

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Help me with rotation ?
« Reply #2 on: November 16, 2015, 02:54:13 PM »
Also just remembered another bit of automation - 4-8 way joystick switching with servo sticks.  Guessing this would be setup along the same lines. 

akafox

  • Hero Member
  • *****
  • Posts: 985
    • View Profile
Re: Help me with rotation ?
« Reply #3 on: November 16, 2015, 07:05:10 PM »
There might be a better way..I don't know, but you can make MAME load the game rotated how you want and the when you quit MAME whatever orientation you left attract mode in it will be that orientation of course. This would be handled in mame itself.
« Last Edit: November 17, 2015, 08:43:11 AM by akafox »
People want life easy..then complain about it

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: Help me with rotation ?
« Reply #4 on: November 16, 2015, 07:15:20 PM »
This isn't necessarily an emulators question  - although it may also involve some parameters when launching the emulator?

I haven't done this, so just going off of what I have read from others but it involves a bit of setup with both the frontend and possibly the emulator as well.

For the frontend:

You mentioned the rotation plugin, which can automatically rotate the frontend display to match the last game played, and can also change the default rotation. If you are just manually rotating the monitor - then that should be good enough.

You will also want to find or put together a good layout that works in both horizontal and vertical, a lot of times layouts aren't designed well to work for both.

For the emulator / mame:
May either involve setting up the config to rotate or passing parameters along with the emulator executable

For mechanical rotation:
You'd need a 'rotate_mon' executable that runs to rotate the monitor - at least before running the emulator executable, and maybe after the emulator exits if you wanted it to rotate back. I haven't needed it yet and can't recall if AM has somewhere to configure pre/post executables. The tricky part is passing the selected games rotation to the rotate executable - this might need to be done via a plugin / script.

Quite a few have done it before with other frontends, and you could find some guidance about it at the arcadecontrols forum:
http://forum.arcadecontrols.com/index.php?topic=90769.0

jimmer

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Re: Help me with rotation ?
« Reply #5 on: November 17, 2015, 04:02:30 AM »
Thanks for the replies.

I haven't studied/tried the AM plugin yet, but I was hoping it would be able to use 2 layouts ie come back to either the vertical or horizontal layout as appropriate ?



The MAME part is quite easy. Just put a vertical.ini file in the mame directory
in that file turn off autorotate:
#
# CORE ROTATION OPTIONS
#
rotate                    0

edit: except that the vertical games are not all rotated the same way.

I was planning just 90degress of rotation, but now it looks like I have to choose between 180 degrees rotation or configuring games individually.

« Last Edit: November 17, 2015, 07:54:36 AM by jimmer »

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: Help me with rotation ?
« Reply #6 on: November 17, 2015, 06:26:43 PM »
I believe the proper rotation info is imported from the mame data, and could be gotten from fe.game_info( Info.Rotation ) in a script. So if it's possible to run a pre-launch command, you'd pass that to the 'rotate_mon' executable so it knows the correct rotation.

I'm guessing a script could do something like:

Code: [Select]
fe.add_transition_callback( "on_transition" );

function on_transition( ttype, var, ttime )
{
   if ( ttype == Transition.ToGame ) rotate();
}

function rotate()
{
  fe.plugin_command( 'rotate_mon', fe.game_info(Info.Rotation) )
}

This is generic and just a guess, but that's the direction I would try :)

akafox

  • Hero Member
  • *****
  • Posts: 985
    • View Profile
Re: Help me with rotation ?
« Reply #7 on: November 20, 2015, 06:20:45 PM »
Not sure about the rotating AM...but for the game just have to start it..then TAB then video then you can change the rotation in that menu..back out (default esc) then you can quit the game...now when you start the game it will start rotated.
People want life easy..then complain about it