mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-17 23:27:49 -06:00
fix: place AdvanceMAME's sets in EmuELEC's dir_rom
AdvanceMAME reads its sets from dir_rom, a list of folders (advance/osd/fileio.c:74, doc/advmame.d:680,699-701). EmuELEC's advmame.rc sets dir_rom /storage/roms/mame (advmame.rc:11), and advmame.sh rewrites /roms/mame to /roms/arcade when it is started for the arcade system (advmame.sh:26-30). The extractor kept the keys under the BIOS root alone: it now records those under the roms root too, and a key the script rewrites gives one record for arcade and one for every other system. A configgen record carries the systems it is written for. The profile lays its 29 sets out at the top of dir_rom. On EmuELEC they land in roms/mame. The 12 root archives AdvanceMAME alone claimed there now hold the copies of the cores that also declare them (mame, geolith), none of them lost. A destination outside the BIOS tree is no proof of content: the moved entry resolves by its layout path alone. roms/mame/konamigv.zip took bios/Arcade/MAME/konamigv.zip, MAME 0.289's set, by that tail.
This commit is contained in:
1 parent
4a5c693b66
commit
8eaffcfead
7 files changed
+384
-29
No files matched your search
@@ -879,5 +879,32 @@ class GzdoomOnRetroDECK(unittest.TestCase):
|
||||
self.assertFalse(any(e.get("standalone_path") for e in view["files"]))
|
||||
|
||||
|
||||
class AdvanceMameOnEmuELEC(unittest.TestCase):
|
||||
"""advmame.rc sets dir_rom /storage/roms/mame, /storage/roms/arcade for
|
||||
the arcade system (advmame.rc:11, advmame.sh:26-30)."""
|
||||
|
||||
def test_the_sets_land_in_roms_mame(self) -> None:
|
||||
view = standalone_view("advancemame", "emuelec")
|
||||
sets = [e for e in view["files"] if e.get("category") == "bios_zip"]
|
||||
self.assertEqual(len(sets), 29)
|
||||
for entry in sets:
|
||||
self.assertEqual(entry["standalone_path"], "mame/" + entry["name"])
|
||||
self.assertTrue(entry.get("unprefixed"))
|
||||
|
||||
def test_the_roms_folder_is_no_proof_of_content(self) -> None:
|
||||
# bios/Arcade/MAME/konamigv.zip is MAME 0.289's set, not AdvanceMAME's.
|
||||
from common import load_database, resolve_local_file
|
||||
|
||||
db = load_database(str(REPO_ROOT / "database.json"))
|
||||
view = standalone_view("advancemame", "emuelec")
|
||||
(entry,) = [e for e in view["files"] if e["name"] == "konamigv.zip"]
|
||||
moved, _status = resolve_local_file(entry, db, dest_hint=entry["standalone_path"])
|
||||
plain = {k: v for k, v in entry.items()
|
||||
if k not in ("layout_path", "standalone_path", "unprefixed")}
|
||||
root, _status = resolve_local_file(plain, db, dest_hint=entry["name"])
|
||||
self.assertEqual(moved, root)
|
||||
self.assertNotIn("/MAME/", moved)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -313,6 +313,11 @@ ADVMAME_RC = text(
|
||||
|
||||
ADVMAME_SH = text(
|
||||
"""
|
||||
if [[ "${1}" = "arcade" ]]; then
|
||||
sed -i "s|/roms/mame|/roms/arcade|g" ${CONFIG_DIR}/advmame.rc
|
||||
else
|
||||
sed -i "s|/roms/arcade|/roms/mame|g" ${CONFIG_DIR}/advmame.rc
|
||||
fi
|
||||
SDL_AUDIODRIVER=alsa advmame ${ARG} -quiet
|
||||
"""
|
||||
)
|
||||
@@ -580,9 +585,17 @@ class StandaloneRecords(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_advancemame_one_record_when_every_device_agrees(self):
|
||||
(record,) = records(el.advancemame)
|
||||
self.assertEqual(record["search_dir"], "/storage/roms/bios/advmame/samples")
|
||||
self.assertNotIn("device", record)
|
||||
roms, arcade, samples = records(el.advancemame)
|
||||
self.assertEqual(samples["search_dir"], "/storage/roms/bios/advmame/samples")
|
||||
self.assertNotIn("device", samples)
|
||||
# advmame.sh rewrites /roms/mame to /roms/arcade for the arcade system.
|
||||
self.assertEqual(
|
||||
(roms["search_dir"], roms["passes_to"], roms["depends_on_option"]),
|
||||
("/storage/roms/mame", "advmame.rc dir_rom", "system != arcade"),
|
||||
)
|
||||
self.assertNotIn("systems", roms)
|
||||
self.assertEqual((arcade["search_dir"], arcade["systems"]), ("/storage/roms/arcade", ["arcade"]))
|
||||
self.assertTrue(arcade["source_ref"].endswith("bin/advmame.sh:1-2, 6"))
|
||||
|
||||
def test_advancemame_devices_that_disagree_raise(self):
|
||||
changed = ADVMAME_RC.replace("bios/advmame", "bios/other")
|
||||
@@ -618,7 +631,7 @@ class StandaloneRecords(unittest.TestCase):
|
||||
|
||||
def test_every_extractor_runs_on_the_fixtures(self):
|
||||
found = el.extract_launchers(tree())
|
||||
self.assertEqual(len(found), 26)
|
||||
self.assertEqual(len(found), 28)
|
||||
|
||||
|
||||
class Revision(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user