I guess this script so I can get Mr. Driller hi score support... ; This script will take command line arguments (the rom name, -rompath, etc) and check ; to see if it needs to be run in a special version of MAME based on the rom. If so, it will ; launch the rom in that version and wait for MAME to exit. At that point, it ; will kill the script. ; ;This version of the script assumes that the first 3 arguments are: ; 1) Rom name ; 2) "-rompath" ; 3) path to roms ; ; All other arguments beyond these 3 are simply passed on to the version of MAME it ; chooses to run. #NoTrayIcon #SingleInstance ignore ;MAME MAME_Path := "C:\Emulation\Emulators\Mame" MAME_Exe := "mame.exe" rem ;MAME Analog+ rem MAME_Analog_Path := "C:\Emu\MAME-rotary\" rem MAME_Analog_Exe := "mameanalogXP.exe" rem ;MAME v0.104u6 for gun games rem MAME_Guns_Path := "C:\Emu\MAME-guns\" rem MAME_Guns_Exe := "mame.exe" ;ZiNc 1.1 Zinc_Path := "C:\Emulation\Emulators\ZiNc" Zinc_Exe := "zinc.exe" Loop, %0% ; For each parameter: { if A_Index = 1 { RomName := %A_Index% } else if A_Index > 3 { param := %A_Index% Arguments = %Arguments% %param% } } ; Run in MAME Analog+? Loop, read, Rotary.txt { If RomName = %A_LoopReadLine% { ;msgbox SetWorkingDir, %MAME_Analog_Path% ;msgbox Run %MAME_Analog_Path%%MAME_Analog_Exe% %RomName% %Arguments%,,,MAME_PID SetWorkingDir, %MAME_Analog_Path% Run %MAME_Analog_Path%%MAME_Analog_Exe% %RomName% %Arguments%,,,MAME_PID WinWait, ahk_pid %MAME_PID% Sleep, 100 Send, {SPACE} WinWaitClose ;Wait until MAME is exited ExitApp } } ; Run in MAME Guns version? Loop, read, GunGames.txt { If RomName = %A_LoopReadLine% { ;msgbox SetWorkingDir, %MAME_Guns_Path% ;msgbox Run %MAME_Guns_Path%%MAME_Guns_Exe% %RomName% %Arguments%,,,MAME_PID SetWorkingDir, %MAME_Guns_Path% Run %MAME_Guns_Path%%MAME_Guns_Exe% %RomName% %Arguments%,,,MAME_PID WinWait, ahk_pid %MAME_PID% WinWaitClose, ahk_pid %MAME_PID% ;Wait until MAME is exited ExitApp } } ; Run in Zinc ; example: ; zinc.exe 1 --use-config-file=zinc.cfg --use-controller-cfg-file=c:\emu\zinc\ctrlr\starglad.ini Zinc_Options = --use-config-file=zinc.cfg --use-controller-cfg-file=.\ctrlr\%RomName%.ini Loop, read, zinc.txt { IfEqual, A_LoopReadLine, %RomName% { RomNum := A_Index ;msgbox SetWorkingDir, %Zinc_Path% ;msgbox Run %Zinc_Path%%Zinc_Exe% %RomNum% %Zinc_Options%,,,Zinc_PID Run %Zinc_Path%%Zinc_Exe% %RomNum% %Zinc_Options%,,,Zinc_PID WinWait, ahk_pid %Zinc_PID% WinWaitClose, ahk_pid %Zinc_PID% ;Wait until Zinc is exited ExitApp } } ; Run in standard MAME ;msgbox SetWorkingDir, %MAME_Path% ;msgbox Run %MAME_Path%%MAME_Exe% %RomName% %Arguments%,,,MAME_PID SetWorkingDir, %MAME_Path% Run %MAME_Path%%MAME_Exe% %RomName% %Arguments%,,,MAME_PID WinWait, ahk_pid %MAME_PID% WinWaitClose ;Wait until MAME is exited #IfWinNotActive ahk_class MAME { WinActivate, MAME } #IfWinNotActive ahk_class Zinc { WinActivate, Zinc }