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

+20
View File
@@ -1209,6 +1209,26 @@ class EveryCoreAFolderOffers(unittest.TestCase):
self.assertIn("arcade", folders, platform)
class AdvanceMameOnRetroPie(unittest.TestCase):
"""RetroPie writes dir_rom $romdir/mame-advmame:$romdir/arcade into each
AdvanceMAME build's rc (advmame.sh:100), the list the code splits on ':'
(advance/linux/file.c:138-141)."""
def test_the_sets_go_to_the_first_folder_searched(self) -> None:
config = load_platform_config("retropie", str(REPO_ROOT / "platforms"))
profiles = load_emulator_profiles(str(REPO_ROOT / "emulators"))
tags = standalone_set(config)
for emu in ("advmame", "advmame-1.4", "advmame-0.94"):
with self.subTest(emu=emu):
placed = [
(f.get("root"), f.get("standalone_path"))
for view, standalone in platform_layouts(emu, profiles[emu], tags)
if standalone
for f in view["files"] if isinstance(f, dict) and f["name"] == "neogeo.zip"
]
self.assertEqual(placed, [("roms", "mame-advmame/neogeo.zip")])
class CoreOfferedOnSomeBoards(unittest.TestCase):
"""ROCKNIX writes some add_emu_core calls under a `case "${DEVICE}"`
branch (emulators/package.mk:188 offers uae4arm for amiga on the devices
+32
View File
@@ -278,6 +278,38 @@ class IniSearchLists(unittest.TestCase):
self.assertFalse([r for r in found if "hash" in str(r.get("search_dir"))])
ADVMAME = module("advmame", """
function configure_advmame() {
iniConfig " " "" "$md_conf_root/mame-advmame/$md_id.rc"
iniSet "dir_rom" "$romdir/mame-advmame:$romdir/arcade"
iniSet "dir_artwork" "$romdir/mame-advmame/artwork"
addEmulator 1 "$md_id" "arcade" "$md_inst/bin/advmame %BASENAME%"
addSystem "arcade"
}
""", 95)
class AdvanceMameSearchList(unittest.TestCase):
"""AdvanceMAME splits dir_rom on ':' (advance/linux/file.c:138-141,
advance/osd/fileio.c:696-699), and advmame.sh:100 lists two folders."""
def test_a_colon_list_below_the_roms_root_is_a_search_path(self):
found = [r for r in records({f"{EMULATORS}/advmame.sh": ADVMAME}, "advmame")
if r["kind"] == "passes_path"]
self.assertEqual(
[(r["search_dir"], r["passes_to"].split(" in ")[0]) for r in found],
[("$romdir/mame-advmame:$romdir/arcade", "dir_rom")],
)
def test_mame_does_not_read_a_colon_as_a_separator(self):
from scraper.retropie_launchers import LIST_SEPARATORS
self.assertNotIn("mame", LIST_SEPARATORS)
self.assertEqual(
{LIST_SEPARATORS[p] for p in ("advmame", "advmame-0.94", "advmame-1.4")}, {":"}
)
class CommandLines(unittest.TestCase):
def test_sdltrs_passes_one_rom_per_machine(self):
found = records({f"{EMULATORS}/sdltrs.sh": SDLTRS}, "sdltrs")