fix: read AdvanceMAME's dir_rom list on RetroPie

RetroPie writes dir_rom $romdir/mame-advmame:$romdir/arcade into the
rc of each AdvanceMAME build (advmame.sh:100, configure_advmame being
called by the 1.4 and 0.94 modules too). _search_list_in_roms split
every list on ';', so the line was dropped and the sets landed at the
BIOS root, where no build reads them.

Each program's separator is now read from its own code: AdvanceMAME
strtoks dir_rom on file_dir_separator(), ':' on Linux, in the three
builds RetroPie ships (advance/linux/file.c:138-141, advance/osd/
fileio.c:696-699 at 96237a5, 685-688 at advancemame-1.4, 640-643 in
advancemame-0.94.0). MAME splits on ';' (src/emu/fileio.cpp:56, 64,
112 at mame0289). RetroPie is rescraped at 427e762: the three
passes_path records are its only change.

advmame, advmame-1.4 and advmame-0.94 carry a retropie config_reads
for dir_rom, read at the build RetroPie installs (96237a5, the tag
advancemame-1.4 its tarball matches, the 0.94.0 tarball). The 1.4 and
0.94 profiles gain the dir_rom pool and a path for each set, and 0.94
a pin_build on rp_module_repo.

Manifests: on RetroPie 55 sets of the three builds move from the BIOS
root to roms/mame-advmame, the first folder of the list, which every
game started from either folder reads. Seven archives other cores
share stay at the root for them. No other platform changes. verify
--all keeps its severity and status counts.
This commit is contained in:
Abdessamad Derraz committed 2026-11-11 14:57:12 +01:00
1 parent 39a8ccfd6d
commit cb7700a594
7 files changed
+185 -4

No files matched your search

+17 -4
View File
@@ -473,15 +473,26 @@ class Scripts:
return results
def _search_list_in_roms(event: "Event") -> bool:
# The character each program splits a search list on, read in its code.
# AdvanceMAME strtoks dir_rom on file_dir_separator(), ':' on Linux, in all
# three builds RetroPie ships (advance/linux/file.c:138-141 and
# advance/osd/fileio.c:696-699 at 96237a5, 685-688 at advancemame-1.4,
# 640-643 in advancemame-0.94.0.tar.gz). MAME's path_iterator splits on ';'
# whatever the system (src/emu/fileio.cpp:56, 64, 112 at mame0289).
LIST_SEPARATORS = {"advmame": ":", "advmame-0.94": ":", "advmame-1.4": ":"}
DEFAULT_LIST_SEPARATOR = ";"
def _search_list_in_roms(event: "Event", separator: str = DEFAULT_LIST_SEPARATOR) -> 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.
and the others MAME's mame.ini sets): a list is where it searches, split
on the separator the program reads it with.
"""
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]
parts = [p for p in event.words[2][0].split(separator) if p]
return len(parts) > 1 and all(
p.startswith(ROMDIR + "/") or p.startswith("${romdir}/") for p in parts
)
@@ -567,7 +578,9 @@ class PackageReader:
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):
if _search_list_in_roms(
event, LIST_SEPARATORS.get(self.package.id, DEFAULT_LIST_SEPARATOR)
):
self._ini_set(event)
return
if not _mentions_bios(event.raw):