It's because mGalaxy don't use the same command line
mGalaxy use
-rompath "%path" %file%ext -volume -%volume(32,0) -skip_gameinfo -nowindow
so I think %1 = -rompath here.
You can use autoitscript , easier to use and more powerfull, mGalaxy use them to escape from some emuls.
Aeliss is right!
I'll take some time to try to help you...but can't check everything cause I'm not at home!
Hope that it'll help!
if %1==dkong goto mame112
if %1==kinst goto mame112
if %1==kinst2 goto mame112
rem default MAME launch
cd 125
mame %1 %2 %3 %4 %5 %6
cd ..
goto end
:mame112
cd 112
mame %1 %2 %3 %4 %5 %6
cd ..
goto end
:end
Explanations:mame %1 %2 %3 %4 %5 %6 : each % (%1, %2,..) is an identifier for arguments passed in the command line.
So, if the main goal is to send a rom name to mame through a batch file one should send:
batchfile.exe "pacman"
The batch file would check for the rom name this way:
If argument #1 = "pacman" then goto 'mame112'
In code
if %1=="pacman" goto mame112
:mame112
cd 112
mame %1
cd ..
goto end
:end
The mGalaxy part now:
-rompath "%path" %file%ext -volume -%volume(32,0) -skip_gameinfo -nowindow
You have here a copy of the command line TEMPLATE, filled with arguments, that is sent to mame by mGalaxy.
You can see that there too mGalaxy uses identifiers!
They are here called '%path', '%file', '%ext', '%volume'.
In running mode, mGalaxy will substitute those identifiers with the real value...ok?
So, if you want to send the rom name as first argument to your batchfile, this template should simply be:
%file
This was the theory. To summarize:To have it working, 2 solutions:
1. You don't want to edit the batch file (so, you'll have to edit mGalaxy settings):In mGalaxy folder > Data > BaseSystems > BaseSystems.xml: edit this file and find the 'mame' block of code to add a new line for your batch/exe system.
If you only want to send the rom name (as with my example) the final block of code should look like this:
<System type="Arcade">
<Name ss="75" em="MAME" tgdb="Arcade" gb="84|ARC">Multi-system [MAME]</Name>
<Emu selected="MAME">
<Cmd hidden="true" name="MAME" value="-rompath "%path" %file%ext -volume -%volume(32,0) -skip_gameinfo -nowindow" extensions=".zip,.7z,.chd"/>
<Cmd hidden="true" name="My Custom System" value="%file" extensions=".zip,.7z,.chd"/>
</Emu>
</System>
Now, back to mGalaxy_Runway, you now can create a new "MAME" system and choose "My Custom System" (and make it point to your batch/exe file)
From now, when you'll launch a game in mGalaxy, the rom name only will be sent to your bach/exe file, which in turn will check for the name then run mame with this rom name!
2. You don't want to edit mGalaxy settings (so, you'll have to edit your batch file)This is the preferred way! That's simpler...and you won't need to start again with new mGalaxy version
Now that you're mastering the identifiers system
you understand that you want to check for the name with the correct identifier!
With mGalaxy sending "-rompath "%path" %file%ext -volume -%volume(32,0) -skip_gameinfo -nowindow"
...the rom name (actually with the 'extension' identifier joinded to it) is in #3 position (%file%ext). So you'll have to check %3 in your batch file.
ATTENTION: one little problem here! In the mGalaxy command line template the romname and extension are joined (%file%ext). So, I hope that it won't be a problem for you, but you'll have to check for the romname + extension in your batch file!
The ending file should look like this:
if %3==dkong.zip goto mame112
if %3==kinst.zip goto mame112
if %3==kinst2.zip goto mame112
rem default MAME launch
cd 125
mame %1 %2 %3 %4 %5 %6
cd ..
goto end
:mame112
cd 112
mame %1 %2 %3 %4 %5 %6
cd ..
goto end
:end