Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

Well, I'm not exactly sure what I'm doing wrong here. I've got a batch file which executes LEDWizLighter and an appropriate cfg file. It works great from the command line.

I put the path/filename of the bat file in the ShellBeforeLaunch line in the GameEx.ini file. It runs perfectly and illuminates the LEDs, but mame doesn't successfully execute afterwards. It switches to a blank screen, pauses, and returns to gameex.

I've looked in the log file. It indicates that the correct call is made to mame with the correct rom name and settings. If I leave the system alone, it pops into the attract mode just fine. Mame executes correctly.

So, it is a problem with my batch file. Do I need to terminate it in some way? The call to mame seems to be happening correctly, but execution is hindered.

Any ideas?

Thanks!

Posted

A little more info:

If I put the the LEDWizLighter command in by itself:

ShellBeforeLaunch=c:\mame\LEDControl\LEDWizLighter.exe cfg\[ROM] 2 0

then everything is fine (LEDWizLighter lights up the control panel and the mame game runs). If I put this same instruction in a batch file and execute:

ShellBeforeLaunch=c:\mame\LEDControl\[ROM].bat

then LEDWizLighter still executes correctly, but mame fails afterwards.

I do need a batch file because I also need to configure my joysticks on each game.

Humpf...

-TP

Well, I'm not exactly sure what I'm doing wrong here. I've got a batch file which executes LEDWizLighter and an appropriate cfg file. It works great from the command line.

I put the path/filename of the bat file in the ShellBeforeLaunch line in the GameEx.ini file. It runs perfectly and illuminates the LEDs, but mame doesn't successfully execute afterwards. It switches to a blank screen, pauses, and returns to gameex.

I've looked in the log file. It indicates that the correct call is made to mame with the correct rom name and settings. If I leave the system alone, it pops into the attract mode just fine. Mame executes correctly.

So, it is a problem with my batch file. Do I need to terminate it in some way? The call to mame seems to be happening correctly, but execution is hindered.

Any ideas?

Thanks!

Posted

let me see a sample bat file...and I'll look into things for you.

Keep in mind I don't currently own a cab...let alone LEDWiz...that said I'll give it a go...but expect trial and error.

Posted

Thanks. Actually, the .bat file only contains the following line at the moment:

c:\mame\LEDControl\LEDWizLighter.exe cfg\[ROM] 2 0

let me see a sample bat file...and I'll look into things for you.

Keep in mind I don't currently own a cab...let alone LEDWiz...that said I'll give it a go...but expect trial and error.

Posted

Well a quick glance over it...my best guess is that since [rom] is in a batch file...its invalid.

Well lets run through things here a bit.

ShellBeforeLaunch=c:\mame\LEDControl\Batch\[ROM].bat

Means that if your playing say 1943...you would need a batch file called 1943.bat

Now in that batch file you would need some thing like:

..\LEDWizLighter.exe ..\Config\1943 2 0

Tho this might be wrong also...but its going off the idea of directory structure like:

.\mame\mame.exe

.\mame\LEDControl\LEDWizLighter.exe

.\mame\LEDControl\Batch\1943.bat

.\mame\LEDControl\Config\1943.cfg

I'm really not all that great with batch scripts...so I'm prone to errors. :)

Posted

Personally I would wait for the LCD Plugin instead of bothering with LEDWIzLighter, but if you have to get it running from a batch file, do this.

You can send paramters to a batch file quite easily.

ShellBeforeLaunch=C:\mame\LEDControl\RunIt.bat [ROM]

Then you create a batch file called RunIt.bat

@ECHO OFF
C:\mame\LEDControl\LEDWizLighter.exe cfg\%1 2 0

Posted

Thanks for the tip. Unfortunately, this seems to fail as well and with the same symptoms. For some reason, the MAME can't run after the batch file has run.

I've tried putting multiple commands in the batch file (playing .wavs, etc...) and everything in the batch file executes. Interestingly, if I put a line in the batch file to actually execute mame with a hard-coded ROM, that will fail.

hmmmmm.....

Personally I would wait for the LCD Plugin instead of bothering with LEDWIzLighter, but if you have to get it running from a batch file, do this.

You can send paramters to a batch file quite easily.

ShellBeforeLaunch=C:\mame\LEDControl\RunIt.bat [ROM]

Then you create a batch file called RunIt.bat

@ECHO OFF
C:\mame\LEDControl\LEDWizLighter.exe cfg\%1 2 0

Posted

Oh hang on I get what's going on... it's waiting for LEDWizLighter.exe!

Either try..

@ECHO OFF
start C:\mame\LEDControl\LEDWizLighter.exe cfg\%1 2 0

If that doesn't work make two batch files...

RunIt.bat

@ECHO OFF
call LEDWizLight.bat %1

LEDWizLight.bat

@ECHO OFF
C:\mame\LEDControl\LEDWizLighter.exe cfg\%1 2 0

Then just use

ShellBeforeLaunch=C:\mame\LEDControl\RunIt.bat [ROM]

Posted

Thanks HeadKaze, I sure appreciate the help. It still seems to be failing the same way. I also tried all the variations of your suggestions as well (that I could think off). This failed as well:

RunIt.bat

@ECHO OFF
call centiped.bat

centiped.bat

start C:\mame\LEDControl\LEDWizLighter.exe cfg\centiped 2 0

Everything in the batch files runs perfectly, even commands after LEDWizLighter. If I do this:

centiped.bat

start C:\mame\LEDControl\LEDWizLighter.exe cfg\centiped 2 0
sndrec32 /embedding /play /close "c:\mame\voices\centiped.wav"

then LEDWizLighter runs and the .wav is played, but mame still seems to fail. I wonder if there is some limitation with .bat files. A direct call always works:

ShellBeforeLaunch=C:\mame\LEDControl\LEDWizLighter.exe cfg\centiped 2 0

hmmmm......

===============================================================

Oh hang on I get what's going on... it's waiting for LEDWizLighter.exe!

Either try..

@ECHO OFF
start C:\mame\LEDControl\LEDWizLighter.exe cfg\%1 2 0

If that doesn't work make two batch files...

RunIt.bat

@ECHO OFF
call LEDWizLight.bat %1

LEDWizLight.bat

@ECHO OFF
C:\mame\LEDControl\LEDWizLighter.exe cfg\%1 2 0

Then just use

ShellBeforeLaunch=C:\mame\LEDControl\RunIt.bat [ROM]

Posted

Why have you created a centiped.bat? That is not how my batch files work. The %1 is a variable passed by [ROM], that's so you don't have to create batch files for every game.

Posted

Yup, I realize that. The example I posted was just another of my attempts. After trying it exactly as you described, I tried other things like using "start" and "call" commands and trying to "hardcode" and trim things down to try to isolate the problem. I was trying to prove that it is the use of a .bat file itself that is causing the mame execution problem and not necessarily something to do with LEDWizLighter. I just tried

ShellBeforeLaunch=C:\mame\LEDControl\RunIt.bat

RunIt.bat

sndrec32 /embedding /play /close c:/voice/intro.wav

and it shows the same issue. The .wav file plays, but mame fails to start. pre-pending sndrec32 with "start" has no effect. I don't think this problem is specific LEDWizLighter.

Why have you created a centiped.bat? That is not how my batch files work. The %1 is a variable passed by [ROM], that's so you don't have to create batch files for every game.
Posted

I was looking at that, but it looked like it was under other emulators and not under MAME (the first occurance looked like it was under N64). I'll give it a another look tonight...

-TP

Posted

Just to tie this up. The only working solution I found was to create an AutoIt script and compile it to an executable. Works great. GameEx doesn't seem to handle executing a batch file from ShellBeforeLaunch/ShellOnExit, but executables are no problem.

Now I can download play a .wav file, control the LEDWiz modules, and download mappings to the Ultimarc360s all on game start.

-TP

Guest
This topic is now closed to further replies.
×
×
  • Create New...