feat: read RetroPie search lists below $romdir

RetroPie writes MAME's mame.ini with samplepath $romdir/mame/samples;
$romdir/arcade/samples and artpath the same way (scriptmodules/emulators/
mame.sh:135-136), and MAME4ALL's mame.cfg with rompath and samplepath
below $romdir (mame4all.sh:78-79). The extractor kept the lines naming
$biosdir only. An iniSet whose value lists folders below $romdir is now a
search path, one folder alone being where the program writes
(cfg_directory and the others). $romdir is read as RetroPie's roms root
(retropie_packages.sh:47-49).

Rescraped at the pinned revision 427e7621: the four records are the only
change.

Manifests: RetroPie's standalone MAME reads bbc.zip in roms/mame/samples,
no longer named as read outside the BIOS folder, and its 19 floppy
samples there.
This commit is contained in:
Abdessamad Derraz committed 2026-11-10 14:05:03 +01:00
1 parent bd8cf8ed2c
commit 83e901a5d4
5 files changed
+113 -2

No files matched your search

+23
View File
@@ -32,6 +32,9 @@ SECTIONS = ("emulators", "libretrocores", "ports")
PACKAGES_SCRIPT = "retropie_packages.sh"
BIOSDIR = "$biosdir"
# The roms root (retropie_packages.sh:47-49): MAME's mame.ini lists rom,
# sample and artwork folders below it (scriptmodules/emulators/mame.sh:133-136).
ROMDIR = "$romdir"
# The package whose config every lr- core runs under.
LIBRETRO_FRONTEND = "retroarch"
# The launch scripts copied next to an emulator spell the directory out.
@@ -464,6 +467,20 @@ class Scripts:
return results
def _search_list_in_roms(event: "Event") -> bool:
"""An iniSet whose value is a list of folders below the roms root.
One folder alone is where a program writes (cfg_directory, nvram_directory
and the others MAME's mame.ini sets): a list is where it searches.
"""
if len(event.words) < 3 or len(event.words[2]) != 1:
return False
parts = [p for p in event.words[2][0].split(";") if p]
return len(parts) > 1 and all(
p.startswith(ROMDIR + "/") or p.startswith("${romdir}/") for p in parts
)
def _mentions_bios(text: str) -> bool:
return BIOSDIR in text or "${biosdir}" in text or BIOS_SPELLED in text
@@ -541,6 +558,12 @@ class PackageReader:
if command == "addEmulator":
self._add_emulator(event)
return
if command == "iniSet" and not _mentions_bios(event.raw):
# A search path below the roms root: MAME reads its samples from
# samplepath $romdir/mame/samples;$romdir/arcade/samples.
if _search_list_in_roms(event):
self._ini_set(event)
return
if not _mentions_bios(event.raw):
return
if command in HOUSEKEEPING: