Hitesh's Mame Cabinet Tips : No 1

Everything Emulator related
Post Reply
Hitesh
Posts: 196
Joined: August 22nd, 2008, 7:38 am
Location:
eBay: HiteshPujara

Hitesh's Mame Cabinet Tips : No 1

Post by Hitesh »

This is a BATCH FILE I have written which does a couple of things:

(A) From a list of games, it plays the next game
(B) From the same list it plays a random game
(C) It loads your front end

say for example your list of games is :
Mame32 cutieq
Mame32 cyvern
Mame32 dkong
Mame32 eyes
The Batch File will

(1) Load Mame and run the first game on the list : CUTIEQ
(2) It will Load Mame and run a random game from the rest of the list : So you will get CVYERN or DKONG or EYES but not CUTIEQ
(3) It will move the first game (CUTIEQ) to the bottom of the list so next time the next game will by CYVERN
(4) It will Load your Front End

If you want to give this a go, your need to put two files in your Mame Executable Directory ;

File 1 : Gameslist.Txt
Depending on which Mame you use, change the "Mame32" part of text file ie "DMame" or "Mame"
This file can be as long as you want it. Please make sure there are no blank lines at top or bottom of file.
Mame32 cutieq
Mame32 cyvern
Mame32 dkong
Mame32 eyes
File 2 : Play.Bat
Echo Off
Cls

REM Play Next Game in List

Set/p PlayNextGame=<Gameslist.txt
Echo %PlayNextGame% > PlayNextGame.Bat

REM Move Game Played to Bottom of List

More +1 Gameslist.txt > Gameslist.001
Copy/b GamesList.001+PlayNextGame.Bat GamesList.002
Del Gameslist.txt
Del GamesList.001
Ren GamesList.002 GamesList.Txt

REM Count Lines in Gameslist.Txt

Set file=Gameslist.Txt
Set /a CountLines=0
For /f %%a in ('type "Gameslist.Txt"^|find "" /v /c') do set /a CountLines=%%a

REM Generate Random Number and Game

Set /a randnum=(%CountLines%+1)*%random%/32767+1
More +%randnum% Gameslist.Txt > Gameslist.003
Set/p PlayRandomGame=<Gameslist.003
Echo %PlayRandomGame% > PlayRandomGame.Bat
Del GamesList.003

REM Play and Delete

Call PlayNextGame.Bat
Call PlayRandomGame.Bat
Del PlayNextGame.Bat
Del PlayRandomGame.Bat

REM Launch Front End

C:
Cd\Emulators\Glaunch
Glaunch.Exe
Change the bottom three lines to take it to your front end.

Hope the above makes sense and helps.........

Hitesh
Post Reply