@Markwkidd:
I should add I had to modify this line on windows to reverse the slash ().
It made Retroarch crash at launch on windows 7 with the new Mame.
This is what I used for the latest mame.dat from http://www.progettosnaps.net/dats/
;### AUTOHOTKEY SCRIPT TO GENERATE MAME PLAYLIST FOR LAKKA/RETROARCH
;### Based on prior work by libretro forum users roldemort, Tatsuya79, Alexandra, and markwkidd
;---------------------------------------------------------------------------------------------------------
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;---------------------------------------------------------------------------------------------------------
playlistname = MAME.lpl
;### Local path to output the playlist file.
;### Should include the .lpl extension.
;### NOTE: THIS SCRIPT WILL DELETE ANY EXISTING FILE WITH THIS NAME
;### As of 5/2016 using the name "MAME.lpl" results in icons appearing for
;### MAME and its playlist entries in Lakka. Other file names may require
;### adding icons or copying the MAME set.
;### Default: MAME.lpl
dat = E:\Emulateurs\RetroArch64\database\MAME 181 Arcade.dat
;### Example: C:\MAME\dats\MAME 078.dat
;### local path to a MAME ROM database file
windowsroms = E:\Roms\Arcade - MAME
;### Example: C:\MAME 0.78 Non-Merged\roms
;### DO NOT INCLUDE A CLOSING SLASH AT THE END OF THE PATH
;### This path is a MAME ROMs folder accessible to THIS WINDOWS HOST. These
;### ROMs should be the same set that will be used in Lakka
;### and should be of the same MAME version as the datfile.
FileRead, dat, %dat%
FileDelete, %A_ScriptDir%\%playlistname% ;### Clears old MAME.lpl file if present
playlistfile := FileOpen(playlistname,"a") ;### Creates new playlist in 'append' mode
ROMFileList := ; Initialize to be blank.
Loop, Files, %windowsroms%\*.zip
{
ROMFileList = %ROMFileList%%A_LoopFileName%`n
}
Sort, ROMFileList
Loop, Parse, ROMFileList, `n
{
if A_LoopField =
continue ;### continue on blank line (sometimes the last line in the file list)
if A_LoopField in (neogeo.zip,awbios.zip,cpzn2.zip)
continue ;### manually skip these bios files. you can add names of other files to skip
SplitPath, A_LoopField,,,,filename ;### trim the file extension from the name
filter1 = <machine name=.%filename%.(?:| sourcefile=.*)(?:| sampleof=.*)(isbios|isdevice|ismechanical|runnable)
if RegExMatch(dat, filter1)
continue ;### skip if the file listed as a BIOS or device in the dat
needle = <machine name=.%filename%.(?:| sourcefile=.*)(?:| cloneof=.*)(?:| romof=.*)(?:| sampleof=.*)>\R\s*<description>(.*)</description>
RegExMatch(dat, needle, datname)
fancyname := datname1 ;### extract match #1 from the RegExMatch result
if !fancyname
continue ;### file is skipped now if not in the dat
;### fancyname := filename ;### the file is not matched in the dat file, use the filename instead
;### Replace characters unsafe for cross-platform filenames with underscore,
;### per RetroArch thumbnail/playlist convention
fancyname := StrReplace(fancyname, "'", "'")
fancyname := StrReplace(fancyname, "&", "_")
fancyname := StrReplace(fancyname, "&", "_")
fancyname := StrReplace(fancyname, "\", "_")
fancyname := StrReplace(fancyname, "/", "_")
fancyname := StrReplace(fancyname, "?", "_")
fancyname := StrReplace(fancyname, ":", "_")
fancyname := StrReplace(fancyname, "``", "_")
fancyname := StrReplace(fancyname, "<", "_")
fancyname := StrReplace(fancyname, ">", "_")
fancyname := StrReplace(fancyname, "*", "_")
fancyname := StrReplace(fancyname, "|", "_")
playlistentry = %windowsroms%\%filename%.zip`n%fancyname%`nDETECT`nDETECT`n-`n%playlistname%`n
playlistfile.Write(playlistentry)
}
playlistfile.Close() ;## close and flush the new playlist file
;## EOF
“machine name” instead of “game name”, added that sampleof category (I think it’s new?), filter out mechanical and not runnable machines,
skip games not in the dat (as I was scanning a 0.181 set with the right dat and I had a lot of bios clones in my resulting playlist).
I didn’t understand the “lakkaroms=” path usage.