HowTo: Generate Pretty, Curated MAME Playlists the Easy(ish) Way

Very clever, gleam2003.

If I understand correctly (use my pre-made batch files to copy roms, make RA create a playlist for each folder, share thumbnails via symbolic link) that will make per-genre playlists with images and without using AutoHotKey scripts. I haven’t tested it but it seems plausible at first glance.

That said, I believe the playlists would only show raw rom filenames, instead of the expanded full game names, right?

[QUOTE=Alexandra;52555]Very clever, gleam2003.

If I understand correctly (use my pre-made batch files to copy roms, make RA create a playlist for each folder, share thumbnails via symbolic link) that will make per-genre playlists with images and without using AutoHotKey scripts. I haven’t tested it but it seems plausible at first glance.

That said, I believe the playlists would only show raw rom filenames, instead of the expanded full game names, right?[/QUOTE]

Full games names are show, not the raw

Yes, not use AutoHotkey Script, more simple for me

Note: Important to rename the lpl every scan because they use not the ROM folders as name but the Emulator Name and all ROMS use the same emulator Note 2: Need to set the default emu for created playlist or the ask you all time you run a ROM

Great thread. However, I think I’m still missing a step that is preventing my MAME roms from showing up in LAKKA.

Here’s how I understand it - can you please tell me if I’m not grasping something correctly…

Here’s how I understand it:

Lakka wants 0.78 Romsets that follow the Progetto-SNAPS MAME 0.78 naming structure.

I have some 0.78 MAME roms downloaded, and I have that Progetto DAT file, but I still can’t seem to rename properly them to get Lakka to see them.

Move followed some scanning and rebuilding guides, it still no luck.

Do I have the versions correct?

Thanks!!

[QUOTE=KillerQ;53133] Here’s how I understand it: Lakka wants 0.78 Romsets that follow the Progetto-SNAPS MAME 0.78 naming structure.

I have some 0.78 MAME roms downloaded, and I have that Progetto DAT file, but I still can’t seem to rename properly them to get Lakka to see them.

Move followed some scanning and rebuilding guides, it still no luck.

Do I have the versions correct?

Thanks!![/QUOTE]

KillerQ – if it would be helpful, there are a few of us Lakka users in the AHK playlist generator thread that could help you with your project: https://libretro.com/forums/showthread.php?t=7802 Most of the users in this thread aren’t using Lakka so you may want to think of this in two phases.

Once you have the basic playlist generation working at all in Lakka, then I’d suggest taking the next step of separating the ROMs into curated playlists per Alexandra’s method in this thread.

Thanks Markwkidd and Roldemort for your optimisation of the snapshots renaming script. That’s quite the difference in speed! :slight_smile:

Making the playlist is still really slow though. I’ve just remade everything for Mame 180/181 now that R-type has fixed most problems of the libretro core (huge thanks to him).

@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.

Tatsuya79, I have also been working on a fix to support the new XML DAT format as well as to incorporate some of roldemort’s speedups for playlist generation.

Would you be willing to test out the ‘prototype’ of the new script? Link: https://github.com/markwkidd/ahk-retroarch-playlist-helpers/blob/master/one-step-arcade-processing-proto.ahk

I believe it addresses the concerns that you’re mentioning, but you might be the first person other than myself to give this enhanced version a try. I’m personally using it for MAME 2003 so it can help to have folks who are using other MAME cores to double check.

If you do take a look, ShrinkArcadeDAT() and PlaylistGenerator() are where the code you’re referring to has wound up, post-updating and refactoring.

Sorry I’ve just finished dealing with all this stuff, I’ll check it again around Mame 0.190.

Hey everyone,

Since this very useful tutorial was brutally murdered by the new forum formats, I thought I’d share this backup I made on Evernote of the original version back when I first used it.

(I know it’s not the ideal, the Evernote web client shrinks it horizontally, so you’ll have to scroll a bit… But it’s better than what was left here.)

(Also, I’m not sure if it was modified after I made the backup, I’ll check for changes later.)

Thank you for making this available in notes . I just save it for me read later👍🏻

Hi, I am running the most up-to-date RetroArch. When I have one controller plugged in everythings fine. When I have 2 or more that are the same device such as 2 xbox one controllers connected to pc, Itll show Xbox Controller 1 and 2 in the binding menu, one controller is hooked up to xbox controller 1 and the other is hooked up to xbox controller 2 but only one controller actually works. This is an ongoing issue for me, trying to plug in 3 and 4 controllers makes it much more difficult, some work and others dont. Im just trying to find the best way to get my controllers working and mapped properly, to where I hook up anywhere from 2 to 4 controllers and have to do no extra configuring. I had retroarch about a year ago and never had these issues until coming back to it recently. Any help is much appreciated.

I added partial support for this in the new Retrosystem theme, but the playlists must be prefixed with "Arcade - " like “Arcade - Action” i did this to have all the arcade playlists together

Great topic!

One question: I’m trying to configure RmLister and I got all the accessory *.ini and *.xml files and merged them together in the master romlister.xml file.

What I don’t get is: In the instruction you talk about “categories and sub-categories” for games, like “Fighter / Versus”. In the catver.ini file I got there are only the “basic” categories in a rom = category format.

I have also a catlist.ini file that seems to have that level of information, but it won’t load in stead of catver.ini because the format is different.

What am I doing wrong?

This is going to come across as poor etiquette on my part, but could I earnestly suggest that you check out my Simple Arcade Multifilter app for your genre sorting? Simple Arcade Multifilter - app for MAME and FB Alpha ROM sets

It is not 100% compatible with Alexandra’s method any more but it is partially inspired by this thread and it’s actively maintained. Also I can help you if you have problems with that app which I am not qualified to do with romlister.

1 Like

Thanks, I’ll sure give a try to it!

Troubling to hear about catver.ini lacking those subgenres; wonder why?

Anyway, as Mark said, his solution is actively maintained, so I agree it’s best to try that first these days.

Unrelated: I still don’t have edit access for the first two posts in this thread, unfortunately. They really decayed in the forum switchover.

@hunterk could you make the first two posts editable as a wiki, per @Alexandra’s previous post?

@Alexandra, I’ve been having this trouble myself. I don’t think it’s that the posts were migrated, it’s that the new forum automatically locks posts that are older than a certain date. It’s a pain and I can’t see the point of that feature, but wiki-mode is the next best thing to having regular edit access.

(Wiki mode will let you get in and make updates)

All set. :slight_smile: [needs 20 chars]

mame emulation is the best

Wow, this is an astonishingly complete guide. Good work!