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 launch Supermodel 3 from Mala with AHK? [SOLVED]  (Read 10499 times)

0 Members and 1 Guest are viewing this topic.

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
How to launch Supermodel 3 from Mala with AHK? [SOLVED]
« on: June 23, 2012, 07:10:20 pm »
I'm trying to launch Supermodel 3 games from Mala using Auto Hot Key because I want to set up a simultaneous 2-button press to Exit the emulator instead of using ESC.

I can't quite get the code right. I'm missing something in the command line settings.

Anyone know how to get this fixed? Below is my AHK code for Daytona USA 2: Power Edition

Run, C:\Arcade\Supermodel 3\Supermodel.exe dayto2pe.zip
~2 & ~4::
Process, Close, supermodel.exe
ExitAPP
return

The Supermodel error log keeps telling me..

Started as:
argv[0] = C:\Arcade\Supermodel 3\Supermodel.exe
argv[1] = dayto2pe.zip

Could not opoen 'dayto2pe.zip'.
Failed to load ROM set.
Program terminated due to an error.


Any expert help out there? Thanks in advance.

Any help?
« Last Edit: June 25, 2012, 11:04:26 pm by Wade007 »
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

empardopo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 526
  • Last login:July 20, 2025, 05:12:51 am
    • My personal forum
Re: How to launch Supermodel 3 from Mala with AHK?
« Reply #1 on: June 24, 2012, 05:23:30 am »
Have you tested AllInOne?

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: How to launch Supermodel 3 from Mala with AHK?
« Reply #2 on: June 24, 2012, 11:36:00 am »
Still no luck with eiter one. I tried AllInOne. It give me an error "Windows cannot fine 'C:\Arcade\Supermodel'. Make sure you typed the name correctly, and then try again. But I'm quadruple checked the path and names. All correct.

I read somewhere in the Hyperspin forums that you had to have the supermodel.ini (setting/control file) in the same folder as the AHK script. Tried that. Nothing changed.

AutoHotKey uses the same path and seems to find Supermodel.exe just fine. Somehow I'm not able to pass the command line info to the emulator correctly for it to launch. I don't get it. The command line I'm sending through AHK is:

Run, C:\Arcade\Supermodel 3\Supermodel.exe dayto2pe.zip -res=1024,768 -fullscreen

The error log says:

Started as:
argv[0] = C:\Arcade\Supermodel 3\Supermodel.exe
argv[1] = dayto2pe.zip
argv[2] = -res=1024

'-res' requires both a width and ad height.
Could not open 'dayto2pe.zip'
Program terminated due to an error.

What am I doing wrong here? I know the emulator works. I had it going fine with Supermodel UI. Anyone understand this better than I do?
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:March 22, 2022, 03:57:28 pm
Re: How to launch Supermodel 3 from Mala with AHK?
« Reply #3 on: June 24, 2012, 04:48:40 pm »
If you look at your error log, it says "-res requires both a width and height."  And if you look at the args that are passing, it's truncating the height off.  Looking at the original string you are passing, there is a comma.  That leads me to believe the comma needs to be escaped some how, so that AHK knows it's part of the command you are trying to run, and not part of the AHK command.

A quick look at the AHK site under the run command would confirm my theory.

Code: [Select]
If Target contains any commas, they must be escaped as shown three times in the following example:

Run rundll32.exe shell32.dll`,Control_RunDLL desk.cpl`,`, 3  ; Opens Control Panel > Display Properties > Settings

Edit:
Looking at it closer, it looks like you have 2 issues.  The first is AHK is truncating after the comma as noted above.  The other is that supermodel doesn't know where to find dayto2pe.zip.  Supermodel can probably find it when you execute it directly from the supermodel directory.  But if you executing it anywhere else, you may also need to either change to the SM directory before executing (which appears to be "setworkingdir" in AHK):

Code: [Select]
Changes the script's current working directory.

SetWorkingDir, DirName

Or try adding the path to the rom name.

Code: [Select]
Run, C:\Arcade\Supermodel 3\Supermodel.exe C:\Arcade\Supermodel 3\dayto2pe.zip
« Last Edit: June 24, 2012, 05:00:45 pm by nick3092 »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 07:23:49 am
  • ...
Re: How to launch Supermodel 3 from Mala with AHK?
« Reply #4 on: June 24, 2012, 09:06:11 pm »
Hello again, lol.

I haven't set Supermodel up in Mala yet, but I'll try to help.
For Supermodel, the roms must be in the same folder as the exe, not in a roms subfolder.

Does the script work outside of Mala?

What do you have listed as the executable and rom extension in MALA?

If using the ahk script, you'd leave the executable blank because you don't want Mala to launch Supermodel, you want the ahk script to do it.

I seem to remember having an issue with another emulator where I couldn't use the ahk scripts directly, but had to create shortcuts to them and have Mala go through the shortcut.  (executable blank, rom extension .lnk (LNK))  I think it was because I had to keep the ahk scripts in the same folder as the emulator exe, but needed to point Mala to a different folder (for SGT's all in one list workaround).  But if nothing else works, it's worth a try.
« Last Edit: June 24, 2012, 09:16:56 pm by BadMouth »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 07:23:49 am
  • ...
Re: How to launch Supermodel 3 from Mala with AHK?
« Reply #5 on: June 24, 2012, 10:56:40 pm »
Had a go with these Mala settings it works fine:
I didn't add any resolutions to the command line.

executable:       (blank)
rom extensions: ahk
command line:   "%path%\%rom%.%ext%"

It's a shame to have to make a different script for every game.
There is a way to have the script run all the time and only be active when supermodel.exe is running, but the script will be running all the time.
Let me know if interested in doing it that way.
I tried doing it using Mala pre-commands, but it doesn't launch supermodel until after the autohotkey script has exited.

For those who do not need to use an autohotkey script to exit:

executable:       Supermodel.exe
rom extensions: zip
command line:   "%path%\%rom%.%ext%" - fullscreen
(more options can be added to the end of the command line if wanted)

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: How to launch Supermodel 3 from Mala with AHK?
« Reply #6 on: June 24, 2012, 11:05:18 pm »
Thanks so much nic3092 and BadMouth!!! Excellent guidance from you both!!

Given your input I've been able to get the AHK script working. Used nic's suggested code. Had to lookup what 'SetWorkingDir' meant. Got it working using absolute paths to the rom as suggested. Also had to experiment a bit on where to put the supermodel.ini file so it would be read (in same directory as .exe file).

Prior to my post I was able to get Supermodel to launch from Mala using the same code that Badmouth suggested:

Now that I've got some new momentum on this, I'll keep tweaking it until I've got Supermodel all set up in Mala along with a 2 button exit command. I'll repost here if there is anything else learned in the process. Thanks again guys. This is a great forum for help!!

Badmouth, I would be interested to know how to run Auto Hot Key automatically while the emulator is running. I tried to do in in Pre-Commands but it didn't work. Well... it launched AHK but wouldn't launch the emulator. Got too confusing so I gave up.
« Last Edit: June 24, 2012, 11:48:44 pm by Wade007 »
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 07:23:49 am
  • ...
Re: How to launch Supermodel 3 from Mala with AHK?
« Reply #7 on: June 25, 2012, 09:19:56 am »
Badmouth, I would be interested to know how to run Auto Hot Key automatically while the emulator is running. I tried to do in in Pre-Commands but it didn't work. Well... it launched AHK but wouldn't launch the emulator. Got too confusing so I gave up.

Haven't tested this (I'm at work), but it should go like this:

#IfWinActive, Supermodel - *
~2 & ~4::
Process, Close, supermodel.exe
return

It would be put in the windows start folder so it starts with windows and would always be running.
You can copy and paste the first three lines over and over again in the same script, substituting any other emulators you need to close.

If you ever need to do anything complicated with autohotkey, post in the software forum and Nitz will usually blow your mind.
He's the man around here when it comes to ahk.

EDIT: Alternatively (looking at one of Nitz's scripts), I don't think it would hurt anything to just tell autohotkey to close it whether Supermodel is running or not since you're using the same combination to close everything.  Just list every program you'd want to close after ~2 & ~4::

~2 & ~4::
Process, Close, supermodel.exe
send {esc}
Process, Close, zsnesw.exe
Process, close, fceux.exe
return
« Last Edit: June 25, 2012, 09:40:30 am by BadMouth »

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: How to launch Supermodel 3 from Mala with AHK? [SOLVED]
« Reply #8 on: June 25, 2012, 11:34:28 pm »
OK, Thought I'd post one last time here just to fill in the details on this issue for anyone else that might come along later.

I decided to use Auto Hot Key to launch Supermodel 3 games from Mala because I wanted a custom simutaneous 2-button exit (buttons 2 & 4 together).
Otherwise I could have just done it through Mala only and possibly the built-in hotkeys function.

Below is an example of my AHK script for a Supermodel 3 game (ie: Star Wars Trilogy). Is you use this script, do NOT include the text in the parenthesis:

SetWorkingDir, C:\Arcade\Supermodel_3\ (This is needed to get Supermodel to launch correctly and find all needed files)
Run, C:\Arcade\Supermodel_3\AHK scripts\GetX-Arcade_ini.bat (Optional: This line is used to make sure I use my X-Arcade ini file for controls etc.)
Run, C:\Arcade\Supermodel_3\Supermodel.exe C:\Arcade\Supermodel_3\swtrilgy.zip
~2 & ~4::
Send, {ALTDOWN}{NDOWN}{ALTUP} (Optional: This is to send Alt+N to clear NVRAM upon closing. A bug in StarWars often stalls the game with a black screen if there are credits from the prior boot up)
Process, Close, supermodel.exe
ExitAPP
return

Roms are placed in the same root directory as the .exe file. NOT in a "roms" subfolder.

Supermodel.ini can be kept in the usual 'Config' folder. All my other command line info was held here.

Snaps must have the same name as the AHK file in order to be read into Mala's gamelist correctly.

Now, in MALA under "Other Emu Config" place the following:
Basics tab;
Name: Supermodel 3
Executable: explorer.exe
Rom Path: (use your full path to your AHK scritps, not your ROMS)
Rom extensions: ahk

Execution tab;
Pre commands: (empty)
Command Line: "%path%\%rom%.%ext%" (include quotes)
Window State: Hidden (my preference)

Options tab;
Snap/Title: (full path to snaps folder. Snaps have name of AHK files)


If you DIDN'T want need to use AHK then the following is how you could launch Supermodel 3 in Mala directly:
In MALA under "Other Emu Config" place the following:
Basics tab;
Name: Supermodel 3
Executable: (full path to supermodel.exe)
Rom Path: (use your full path to your ROMS location)
Rom extensions: zip

Execution tab;
Pre commands: (empty)
Command Line: "%path%\%rom%.%ext%" (include quotes)
Window State: Hidden (my preference)

Options tab;
Snap/Title: (full path to snaps folder. Snaps have name of roms)

Check "Use hot keys"
Close
Name: Close
Source: (Double click and choose your close key here.)
Additionally you can check 'Shift', 'Alt' and/or 'Ctrl' here to ADD that key to the one above it to be a two key combo exit. This would have worked for me except that I didn't what one of these three keys to be my second close key.

So, there you have it...TWO ways to launch Supermodel 3 games in MALA. Much thanks to nick3092 & Badmouth for nudging me in the right direction on this one.


« Last Edit: June 26, 2012, 01:55:31 am by Wade007 »
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN