darkludx: like Tatsuya79 wrote comment out lines you don’t want in the section with RegExReplace commands. But remember that some game names include characters that Windows forbids in filenames so if you keep those characters (comment out first datname1 RegExReplace command) you may not be able to display boxart for that game because you can’t save a png with the exact same name.
Tatsuya79: Good modification. I’ve added the ismodification check and also a check that skips any file that has isbios, and isdevice too. Even with those automatic skip checks the line with the comment “;add non game zip file names to skip” could I guess still be used when someone wants to include e.g. clonegame.zip that depend on files in originalgame.zip but doesn’t want the original in the playlist so I’ll leave it in.
;AUTOHOTKEY SCRIPT TO GENERATE MAME.lpl FOR RETROARCH
;### SETUP, ADD YOUR PATHS HERE
content =
;### MAME ROMs folder
;### example: C:\RA\RetroArch_1.2.2\content\arcade
cores =
;### cores folder
;### C:\RA\RetroArch_1.2.2\cores
dat =
;### path to a MAME ROM database file
;### example C:\files\MAME - ROMs (v0.164_XML).dat
;### get dat here http://www.emulab.it/rommanager/datfiles.php
FileDelete, %A_ScriptDir%\MAME.lpl ;clear old file
FileRead, dat, %dat%
Loop, %content%\*.zip
{
if A_LoopFileName in neogeo.zip,awbios.zip,cpzn2.zip
continue
;### you can add names of zip files in the folder to skip in the list above
name := SubStr(A_LoopFileName,1,-4) ;trim .zip
needle2 = <game name=.%name%. (isbios|isdevice)
if RegExMatch(dat, needle2)
continue
needle = <game name=.%name%.(?:| ismechanical=.*)(?:| cloneof=.*)(?:| romof=.*)>\R\s*<description>(.*)</description>
RegExMatch(dat, needle, datname)
if !datname1
datname1 := name ;fallback to filename
datname1 := RegExReplace(datname1, "[/\?<>\\:*\|]","") ;replace win forbidden chars
datname1 := RegExReplace(datname1, "'","'") ;may need more replace like this
datname1 := RegExReplace(datname1, "&","&")
datname1 := RegExReplace(datname1, " \(.*","") ;trim stuff like "(World version 2.2)"
datname1 := RegExReplace(datname1, "\.$","")
;list = %xx%`n%datname1% ;for troubleshooting
i := A_index<10 ? "000" A_index : A_index<100 ? "00" A_index : A_index<1000 ? "0" A_index : A_index
;the above line was modified to correctly number up to 9999 items in a playlist
;### Next section assigns cores to games.
;### Edit filenames and corenames to what works for you
;### To use same core for all remove all lines
;### in the section below except core = fb_alpha_libretro.dll
if A_LoopFileName in asteroid.zip,dkongjr.zip,dkong.zip
core = mame_libretro.dll
else if in mslugx.zip
core = fba_libretro.dll
else
core = fb_alpha_libretro.dll
a =
(
%A_LoopFileFullPath%
%datname1%
%cores%\%core%
_
%i%|CRC
)
if (a_index == 1)
FileAppend, %a%, %A_ScriptDir%\MAME.lpl
else
FileAppend, `n%a%, %A_ScriptDir%\MAME.lpl
}
;msgbox % list ;for troubleshooting
It is cool that we can make multi system playlists like darkludx has shown but I’d like to also make playlists that launch other stuff. For example I have a bunch of winuae amiga game configurations. I’d like to make a playlist with similar structure as for the available cores (game path, game name, core …) but for other files (e.g. path to amiga game file or config, game name, path to winuae.exe ) and launch those games from within RetroArch. Similarly for the Dolphin gamecube/wii emulator.