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: Where is the rotation data for each game in mame?  (Read 12507 times)

0 Members and 1 Guest are viewing this topic.

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Where is the rotation data for each game in mame?
« on: October 04, 2011, 11:36:16 am »
For Example, mame thinks a dual screen game like Punch Out should have the monitor in the horizontal orientation, (Mala, mrotate, 141u3).  Is there a way to tell it to run it in vertical?

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Where is the rotation data for each game in mame?
« Reply #1 on: October 05, 2011, 05:41:17 am »
Mala passes the monitor position to startcom, which then tells mrotate or any other program which way to run the motor.
The screen position is recorded in the mame.xml file.
If you want to change the orientation of just one game, I suppose you could edit the mame.xml file for that game.
I havent tried this so Im not sure how it would work. (I would first make a backup of the xml file just in case it gets broke.)
There may be programs out that that can do that for you.

Another way may be to create a new emulator for that game. Have this new emulator run a command line mame with just that game. (HINT: bat file). You may have to play around with the bat file to include -rol or -ror, im not sure.
Then Im pretty sure Mala would ignore this new emulator as far as looking up its info in mame.xml, so then you could add this new emulator to the "emulators that run in vertical list" in startcom.
If this works, you could remove the game from the mala mame list, so it doesnt appear twice in mala.

But the first method would be a lot cleaner, I think.
Please let us know how this turns out, someone else may want to do it.

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #2 on: February 21, 2012, 03:14:25 pm »
 . . . time passes, back on this now . . .

Ok, I opened up Mame.xml, made sure I was on the right rom (punchout) for the right game (Punchout!!) and changed rotation (0) to rotation (90) in two lines.   Makes sense since the original game had 2 displays.  Seems like a couple of vertical games are rotation (90) so I thought that would be it. This on it's own didn't do anything, monitor stays horizontal. 

I also tried a punchout.ini in the mame\ini folder with various combinations of rotate, norotate, ror, rol, autorotate.  These can change the orientation on the screen but are not related the monitor orientation that I can tell. 

Is there more specific info about how the tags are used in mame.xml, possibly I'm not changing the right thing?  maybe punchout is a weird case because of the dual monitor situation?  I don't even really care about the game in particular, I just want to be in control. 

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Where is the rotation data for each game in mame?
« Reply #3 on: February 21, 2012, 09:23:57 pm »
Instead of using "90" try "vertical"

Here is the tag you want to change: (Or at least it is in my version of mame.xml)

orientation="vertical"

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #4 on: February 21, 2012, 09:34:25 pm »
Ok gotcha, I was looking at a rotation tag rather than orientation- I'll give that a go.  I got the controlchoose plugin but haven't gotten into it yet-working on controllerremap right now which I want to use but it's Kicking my butt bigtime.  off to see the good Dr (venture)!

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #5 on: February 22, 2012, 11:41:23 am »
Ok, here's where I am after further poking around.  I don't think any orientation data comes from mame.xml.  MaLa with Startcom orients properly without having a mame.xml in the Mame folder, and changes to mame.xml have no effect.  This makes sense because mame.xml is generated upon command from the mame executable, all the information in .xml is derived from the mame executable.  Nothing that I know of reads information from mame.xml except stuff like clrmamepro and maybe control panel display programs. 

So rather than change the mame code for each driver and recompile, is there some way to intercept or change the data MaLa is taking from Mame.exe for monitor orientation?  This is starting to be a MaLa question, since you said Startcom gets it's variable passed from MaLa, not directly from anywhere else.  (for about the fourth time this week, I wish Loadman wasn't lost out in the real world these days!)

I am using Orientation rather than Rotation for clarity.  Rotation of the picture on the screen is doable with .ini files, but I can't affect orientation (so far) with .ini's.  Forgive me if I'm being stupid about this- software's my weaker area.  I know orientation could be changed with a batch wrapper for the given rom, but I've managed to avoid doing that so far and would like to stay simple.  This would be a good type of control to have. 

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Where is the rotation data for each game in mame?
« Reply #6 on: February 22, 2012, 08:15:42 pm »
Im working on a fix for you hang on..

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Where is the rotation data for each game in mame?
« Reply #7 on: February 22, 2012, 09:11:39 pm »
The fix I had in mind aint gonna work.
I was going to add another list to startcom, similar to the "vertical emulators" list, except I was going to have it to where you could add a rom name, followed by a -h for horz or a -v for vertical.
Example: pacman.zip -h
This would work fine as far as turning your monitor, but mame will turn the game to it's orientation, so I think you will have a vertically turned monitor with the game being displayed horizontal.

Have you search for a rom organizing program? Im sure someone out there has one that will let you change certain things (such as orientation) per game.

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #8 on: February 22, 2012, 09:44:41 pm »
Don't worry about it.  It's low priority right now.  I would like to solve it at some point; maybe when Loadman comes around we can see if the orientation can be intercepted and changed before it passes to the plugin. 

Thanks for your help as always. 

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #9 on: February 26, 2012, 12:40:47 pm »
DaOld Man:
posted a vid on my cab thread showing autorotation via MaLa (near the end of the vid).  Take a look if you get a sec. 

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Where is the rotation data for each game in mame?
« Reply #10 on: February 26, 2012, 02:28:13 pm »
Great job TJC!!!
Now I know that project is going to be hard to top, but tell us, what's next?

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:Yesterday at 09:14:16 pm
  • ...
Re: Where is the rotation data for each game in mame?
« Reply #11 on: April 18, 2012, 11:34:44 am »
TopJimmyCooks, the main gamelist in MALA needs to be refreshed when you make changes to the xml for them to take effect.
Not sure if the changes flow to the smaller gamelists either.




TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #12 on: April 18, 2012, 12:05:16 pm »
Thats good info, I always forget about that.  Will try again accordingly. Thanks.

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #13 on: December 13, 2012, 09:16:40 pm »
Ugh.  messed with this some more.  changed orientation value in mame xml for this rom to "1" "90" "180" etc from "0" 
saved mame.xml.
made sure mala was pointed to that mame .xml
Refresh game list was grayed out in the options popup on mala.  went into options/gamelist and did the update meta data thing.

didn't work.  why is my refresh game list always grayed out? 

(oh yeah, I took a 6 month break on this issue)

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:Yesterday at 09:14:16 pm
  • ...
Re: Where is the rotation data for each game in mame?
« Reply #14 on: December 14, 2012, 09:30:06 am »
Ugh.  messed with this some more.  changed orientation value in mame xml for this rom to "1" "90" "180" etc from "0" 
saved mame.xml.
made sure mala was pointed to that mame .xml
Refresh game list was grayed out in the options popup on mala.  went into options/gamelist and did the update meta data thing.

didn't work.  why is my refresh game list always grayed out? 

(oh yeah, I took a 6 month break on this issue)

Were you on the ALL GAMES list or were you trying to refresh a smaller gamelist?
I don't think you can refresh the smaller lists that way.


Although the gamelist is created using info from the xml,
once it is created, Mala only uses the gamelist.

So if the xml thing isn't working, you could change the gamelist itself. 
(this might actually be easier if changing multiple games on a smaller list)
This is all theory.  I haven't actually done it.  :P

Use mlgconverter.exe from this thread: http://forum.arcadecontrols.com/index.php/topic,101104.0.html
That will convert it to a plain text .ini file that you can modify.
Make your changes and convert it back.

I've converted gamelists just to see what information was stored, but I've never tried making changes and converting them back.
I do remember that the gamelist only stores Vertical or Horizontal, not 270, 180, etc.

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #15 on: December 14, 2012, 03:27:35 pm »
good info, I had "all games" hidden in my layout in favor of a romlister created "all 'working' games" list.  I'll try refreshing that all games list first and then delve into the mlg converter if I fail there.  Thank you.  You are the man.   :cheers:

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:Yesterday at 09:14:16 pm
  • ...
Re: Where is the rotation data for each game in mame?
« Reply #16 on: December 14, 2012, 04:15:43 pm »
Glad I'm of some use.  :angel:

Don't forget that you'll have to delete the game from the smaller gamelist and add it back to get the changes to carry to there.

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #17 on: December 14, 2012, 06:21:47 pm »
Success. 

To confirm, if you want your monitor in different orientation for a game than MaLa thinks it should be: 
1.  Text edit mame.xml - find your rom and change rotation from "0" to "90" or vice versa.  for both monitors if the game had two such as playchoice cabinets. Save.
2.  Refresh your all game list in MaLa.  If you have the game in any other game list, delete it and re-add it to that list to get it updated.
3.  In mame, hit tab and get the game oriented as needed on your rotated display.
4.  Profit

Now i'm going to see if I can find some other dual screen games where the rotation is wrong.  Thanks to Badmouth and DaOldMan. 
« Last Edit: April 06, 2014, 04:48:13 pm by TopJimmyCooks »

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #18 on: December 19, 2012, 05:25:39 pm »
To sum this up, I'm doing the same thing BadMouth is doing with MalaOri3.  My power button can turn the cab off at any point without exiting Mala/writing over Mala.ini and the display stays vertical if that's where it was.  So, I changed settings in Malaori3 to run Mala.  On start up, a batch file always rotates to horizontal if needed, and malaori starts Mala in horizontal.  So even if power is cut while mala is running it starts off horizontal, the little startup video displays right, etc.


BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:Yesterday at 09:14:16 pm
  • ...
Re: Where is the rotation data for each game in mame?
« Reply #19 on: December 20, 2012, 09:41:55 am »
To sum this up, I'm doing the same thing BadMouth is doing with MalaOri3.  My power button can turn the cab off at any point without exiting Mala/writing over Mala.ini and the display stays vertical if that's where it was.  So, I changed settings in Malaori3 to run Mala.  On start up, a batch file always rotates to horizontal if needed, and malaori starts Mala in horizontal.  So even if power is cut while mala is running it starts off horizontal, the little startup video displays right, etc.

Another option that I didn't learn about until later is the iniswap iniwrite command in autohotkey.
It swaps values into the mala.ini file.

EDIT:fixed
« Last Edit: December 20, 2012, 01:07:42 pm by BadMouth »

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #20 on: December 20, 2012, 11:44:49 am »
Looked it up, looks like it's actually called iniwrite.  that could replace what Malaori is doing. 

one of my low priority projects is to combine my various AHK scripts into one  - I'll look into that then - Thanks for the heads up.  let me know if you get it working that way. 

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:Yesterday at 09:14:16 pm
  • ...
Re: Where is the rotation data for each game in mame?
« Reply #21 on: December 20, 2012, 01:24:35 pm »
Looked it up, looks like it's actually called iniwrite.  that could replace what Malaori is doing. 

one of my low priority projects is to combine my various AHK scripts into one  - I'll look into that then - Thanks for the heads up.  let me know if you get it working that way.

It works.  I'm using it to accomplish a few other things also, but wasn't sure that it fit with the topic of this thread.

In short, I have to kill Mala to get a few of the Taito Type X games to run.  With ahk killing it, Mala doesn't get a chance to write anything to the .ini file like it normally does when it exits properly.  The script writes the orientation, gamelist & position to the .ini file before relaunching Mala.  It also disables the video intro.
Otherwise when Mala is relaunched, it will be on whatever gamelist and game it was on last time it was shut down properly, not the place it was when you launched the game.  The video intro is re-enabled in the same script that resets everything to horizontal when Mala exits properly.  The result is pretty close to not knowing that Mala was even shut down. 

The pololu commands can also be incorporated into the same script instead of having a batch file.
Code: [Select]
run smccmd --speed -3200,,Hide

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Where is the rotation data for each game in mame?
« Reply #22 on: December 20, 2012, 01:46:42 pm »
Good work guys, I knew you would figure it out.  ;D

When you guys get everything hammered out, how about starting a new thread with the info laid out in order, that will perhaps help others find the needed info.
Good stuff guys, keep up the good work.

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: Where is the rotation data for each game in mame?
« Reply #23 on: December 20, 2012, 03:45:01 pm »
I've kept the batch files for SMCCMD for the Startcom plugin to use.  Right now I'm only using AHK to start games in Mala with Coin and P2 start button presses as well as "start". and a script to convert u360 input to keystrokes to navigate mala.  this last because mala input via joystick has bugs.  Good thing there are lots of options.  Sounds like a good workaround you've developed to work well with the type X pc games. 

If you ever need help with a script Nitz here on the forum is great with them.