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: How to best run a script or .bat on Mala exit  (Read 3746 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
How to best run a script or .bat on Mala exit
« on: June 08, 2011, 11:38:25 am »
There are pre and post commands for other emulators besides mame.  Is there a way to run an .exe (.ahk script) or .bat on every mala exit?  I would like to always make sure my monitor is rotated to horizontal. 

One way would always run Mala by calling it in a script with the rotate command afterwards.  Would this have any negative/performance effect on the operation of Mala/Mame/Emulators?  I would shake my lazy carcass to give it a try but I'm taking a lunch break at work.

Vigo

  • the Scourage of Carpathia
  • Global Moderator
  • Trade Count: (+24)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6417
  • Last login:June 25, 2025, 03:09:16 pm
Re: How to best run a script or .bat on Mala exit
« Reply #1 on: June 08, 2011, 12:03:33 pm »
I just ended up pasting in the same post-command in every emulator.

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: How to best run a script or .bat on Mala exit
« Reply #2 on: June 08, 2011, 12:49:36 pm »
But you can't give mame a post command that I have found, right?

Vigo

  • the Scourage of Carpathia
  • Global Moderator
  • Trade Count: (+24)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6417
  • Last login:June 25, 2025, 03:09:16 pm
Re: How to best run a script or .bat on Mala exit
« Reply #3 on: June 08, 2011, 03:12:54 pm »
I see what you are saying now. I don't think there is a Mame post command option.  :-\

Another option might be to make a plug-in that simply runs the batch file upon game exit.

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5158
  • Last login:May 24, 2025, 09:57:44 pm
  • Wheres my coffee?
    • Skenny's Outpost
Re: How to best run a script or .bat on Mala exit
« Reply #4 on: June 08, 2011, 06:20:28 pm »
Mala can run your bat file on exit.
Look under options/configuration (right click on Mala screen)
Then GUI-- Mala Exit-- place a check on "run app on exit" and enter path and name of your bat file.
This "special" bat file can be set up with your ahk script to only turn horizontal when ran.
Of course if your Mala screen is vertical when you exit Mala, it might still be vertical on next boot up, even though your monitor has turned back to horizontal.
Or maybe Im missing what you are wanting to do.

If you have mala and startcom setup correctly, startcom will always rotate the monitor and the Mala screen back to horizontal whenever you choose a game in a different emulator, unless that emulator is listed in the "Vertical emulators" list in startcom. I guess I dont understand why you would always want to rotate the monitor back to horz unless you are doing something other than Mala with the computer?

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: How to best run a script or .bat on Mala exit
« Reply #5 on: June 08, 2011, 09:14:55 pm »
DaOldMan, you basically nailed it.  the bat file "wrapper" or mala will do what I wanted.  I do have a good bit going on besides mala on that pc as far as setup and stuff, so I need to run windows.  And, yeah, it does confuse mala if exited in vertical configuration.  It's not a big deal since I'm not rotating the monitor itself just yet.  Thanks for the input, all. 

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5158
  • Last login:May 24, 2025, 09:57:44 pm
  • Wheres my coffee?
    • Skenny's Outpost
Re: How to best run a script or .bat on Mala exit
« Reply #6 on: June 08, 2011, 10:02:46 pm »
Hint:
In your script, when you exit mala and rotate monitor back to horizontal, have your script edit these lines in mala.ini:

SwitchOrientation=0
FlipOrientation=0

You need to play around with it and see if the values need to be 1 or 0. (Depends on how your monitor rotates I think).
If you get it right, mala will always start in horizontal, no matter which orientation it was in when you quit.

Make sure you make a backup copy of your mala.ini just in case it breaks and you need to start over.

Also, I wrote another small app for Mala (called MalaOri), that automatically starts Mala in whatever orientation the monitor is in at the time, but it reads the rotate rig's orientation switches that are connected to the printer port to get that orientation.
Not sure if your script returns the limit switch states to the PC?? (I know you are not using printer port).

TopJimmyCooks

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2097
  • Last login:March 26, 2024, 01:18:39 pm
Re: How to best run a script or .bat on Mala exit
« Reply #7 on: June 09, 2011, 09:30:24 am »
Using scripts to edit the .ini files is something I would have to learn about.  I'm just going to switch orientation in mala when needed for the near term.  Then, once the dedicated cab is in use, the need should almost never come up to use anything outside Mala.  That is a really good route to go if the need for a permanent fix arises.  it's amazing what you can do with scripts.