Re: oops, typo in previous post


[ Follow Ups ] [ Post Followup ] [ Build Your Own Arcade Controls message board ] [ FAQ ]

Posted by JMDickson on 27, 2000 at 9:50 AM:

In Reply to: oops, typo in previous post posted by Torgo on 26, 2000 at 11:09 PM:

: My first attempt was more like this:

: D:\mame\Optidrv\optidrv /1
: D:\mame\optimame marble -tweak -soundcard 1

The problem here is probably relative paths. If your mame.cfg file does not have full paths (ie rompath=D:\mame\roms instead of rompath=.\roms) MAME will look for the roms starting under the current directory. An example is if the current directory is C:\mamebat then MAME will look for C:\mamebat\roms.
You could edit the mame.cfg file and put full paths in to fix this.

: But as far as the %#s instead of command line options, I still don't understand how this works. could you explain in further detail?

Command.com is not a very powerful shell, but it does have a few features you can take advantage of. The programmers recognized that batch files would be much more powerful if you could pass options instead writing several different files for each case.
They came up with using a percent followed by a number as the variable. When processing the file if a %1 was found it would be replaced by the first argument (in this case the word 'marble'). %2 would be replaced by the second argument ('-tweak'), and so on. Since there are 4 arguments ('marble','-tweak','-soundcard', and '1') %5,%6,%7,%8, and %9 will not be used and be blank instead.

If you put runmame.bat in the MAME directory then all it needs is

.\Optidrv\optidrv /1
optimame %1 %2 %3 %4 %5 %6 %7 %8 %9

If you want it somewhere else then all you have to do is add the lines
D:
cd \mame
at the beginning of the file.

: the %#s are replaced by the command line arguments that you typed.

: runmame marble -tweak -soundcard 1

: would be like typing:
: D:\mame\Optidrv\optidrv /1
: optimame marble -tweak -soundcard 1

: Any frontend that could call runmame.bat instead of mame.exe would work too.
: The only problem is only 9 parameters can be passed, and -soundcard and 1 are considered two seperate arguments.




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Build Your Own Arcade Controls message board ] [ FAQ ]