mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-13 05:23:51 -06:00
feat: read ES-DE MAME search paths
ES-DE starts standalone MAME with -rompath %GAMEDIR%\;%ROMPATH%/<system> in 78 live commands across 54 systems (resources/systems/linux/ es_systems.xml at retrodeck-main-20261103-162710, 15e1b236; two more are commented out). The command line outranks mame.ini, so RetroDECK's MAME reads its sets in the roms folder each command names and in no BIOS folder. The ES-DE rom folders parser now records, per folder, the folders a standalone command passes as its ROM search path and the machines it starts, or that the game is the machine (%BASENAME%). Rescraped at the pinned revisions: retrodeck, emudeck and emudeck-windows gain these records and nothing else. A command reads the sets its machines load: the machine's own set, the BIOS sets on its romof chain and the device sets with ROMs it instantiates, from games/arcade/mame.json (mame0289 -listxml). That index now also lists the game and device sets of each driver source file, so a %BASENAME% folder reads for its board: neogeo and stv by their BIOS root, cps1-3 and model2 by source file, daphne and laserdisc by the laserdisc player devices, gameandwatch and lcdgames by the handheld sources, any other (arcade, mame, consolearcade) for every machine. The published installer copy of the index leaves the sources out. Manifests: RetroDECK gains 1399 files, 378.2 MB, below roms/. Of the 219 sets named as read outside the BIOS folder, 58 reach 146 files (25.9 MB), 161 stay named, no command's machine reading them. 441 sets RetroDECK's list also declares at bios/ reach 1253 files (352.3 MB), 429 each in arcade and mame and 480 in consolearcade. No other platform changes.
This commit is contained in:
1 parent
a8cfd20f49
commit
7a3d91585d
14 files changed
+1452
-10
No files matched your search
@@ -13,4 +13,18 @@
|
||||
<extension>.zip</extension>
|
||||
<command label="MAME">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame_libretro.so %ROM%</command>
|
||||
</system>
|
||||
<system>
|
||||
<name>tanodragon</name>
|
||||
<path>%ROMPATH%/tanodragon</path>
|
||||
<extension>.cas .CAS</extension>
|
||||
<command label="MAME [Tape] (Standalone)">%EMULATOR_MAME% -rompath %GAMEDIR%\;%ROMPATH%/dragon32 tanodr64 -cass %ROM%</command>
|
||||
<!-- <command label="MAME Legacy (Standalone)">%EMULATOR_MAME% -rompath %GAMEDIR%\;%ROMPATH%/tanodragon tanodr64 -cass %ROM%</command> -->
|
||||
</system>
|
||||
<system>
|
||||
<name>arcade</name>
|
||||
<path>%ROMPATH%/arcade</path>
|
||||
<extension>.zip .ZIP</extension>
|
||||
<command label="MAME - Current">%EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame_libretro.so "%BASENAME% -rompath \"%GAMEDIRRAW%;%ROMPATH%/arcade\""</command>
|
||||
<command label="MAME (Standalone)">%EMULATOR_MAME% -rompath %GAMEDIR%\;%ROMPATH%/arcade %BASENAME%</command>
|
||||
</system>
|
||||
</systemList>
|
||||
@@ -848,7 +848,9 @@ class MameSearchPaths(unittest.TestCase):
|
||||
self.assertEqual(bbc["standalone_path"], "mame-sa/samples/bbc.zip")
|
||||
# ES-DE hands -rompath %GAMEDIR%;%ROMPATH%/<system>: no BIOS folder.
|
||||
self.assertTrue(all(
|
||||
e.get("unplaced") == "outside_bios_folder" for e in self.sets(view)
|
||||
e.get("unplaced") == "outside_bios_folder"
|
||||
or str(e.get("standalone_path")).startswith("roms/")
|
||||
for e in self.sets(view)
|
||||
))
|
||||
|
||||
def test_a_passed_search_setting_leaves_the_bundled_tree_unread(self) -> None:
|
||||
@@ -1099,5 +1101,51 @@ class SetsReadBesideTheGame(unittest.TestCase):
|
||||
self.assertNotIn(("", "coh1000c.zip"), dests)
|
||||
|
||||
|
||||
class MameOnRetroDeckRomPaths(unittest.TestCase):
|
||||
"""ES-DE starts standalone MAME with -rompath %GAMEDIR%;%ROMPATH%/<system>
|
||||
(resources/systems/linux/es_systems.xml), which outranks mame.ini."""
|
||||
|
||||
def test_the_rom_folders_file_records_each_search_path(self) -> None:
|
||||
with (REPO_ROOT / "platforms" / "romfolders" / "retrodeck.yml").open() as f:
|
||||
rows = yaml.safe_load(f)["folders"]
|
||||
found = {r["folder"]: s for r in rows for s in r.get("searched_by") or []}
|
||||
self.assertEqual(len(found), 54)
|
||||
self.assertEqual(found["tanodragon"]["reads"], ["dragon32"])
|
||||
self.assertEqual(found["adam"]["machines"], ["adam"])
|
||||
self.assertTrue(found["neogeo"]["any_machine"])
|
||||
|
||||
def test_a_machine_reads_its_own_set_and_its_devices(self) -> None:
|
||||
from common import rom_search_sets
|
||||
|
||||
self.assertIn("adam", rom_search_sets("mame", "adam", ["adam"], False))
|
||||
neogeo = rom_search_sets("mame", "neogeo", [], True)
|
||||
self.assertIn("neogeo", neogeo)
|
||||
self.assertNotIn("stvbios", neogeo)
|
||||
# A folder that holds any machine reads every BIOS set.
|
||||
self.assertIn("stvbios", rom_search_sets("mame", "mame", [], True))
|
||||
|
||||
def test_sets_land_in_the_folders_that_read_them(self) -> None:
|
||||
# RetroDECK's roms/ sits beside bios/ in the install tree.
|
||||
view = standalone_view("mame", "retrodeck")
|
||||
places = {}
|
||||
for e in view["files"]:
|
||||
if e.get("unprefixed") and e["standalone_path"].startswith("roms/"):
|
||||
places.setdefault(e["name"], set()).add(e["standalone_path"].split("/")[1])
|
||||
self.assertEqual(places["adam.zip"], {"adam"})
|
||||
self.assertIn("neogeo", places["neogeo.zip"])
|
||||
self.assertNotIn("adam", places["neogeo.zip"])
|
||||
self.assertEqual(places["stvbios.zip"] - {"arcade", "mame", "consolearcade"}, {"stv"})
|
||||
|
||||
|
||||
class ArcadeParentSources(unittest.TestCase):
|
||||
def test_the_index_names_each_driver_source(self) -> None:
|
||||
import json
|
||||
|
||||
with (REPO_ROOT / "games" / "arcade" / "mame.json").open() as f:
|
||||
index = json.load(f)
|
||||
self.assertIn("sf2", index["sources"]["capcom/cps1.cpp"])
|
||||
self.assertIn("qsound_hle", {d for sets in index["sources"].values() for d in sets})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -198,6 +198,22 @@ class EsdeFormat(unittest.TestCase):
|
||||
self.assertEqual(model2["core"], "model-2")
|
||||
self.assertIn("names no command", model2["note"])
|
||||
|
||||
def test_a_rom_search_path_names_the_folders_it_reads(self) -> None:
|
||||
# The Tano Dragon reads the Dragon 32 folder, the commented command
|
||||
# counts for nothing.
|
||||
(tano,) = self.rows["tanodragon"]["searched_by"]
|
||||
self.assertEqual(tano["reads"], ["dragon32"])
|
||||
self.assertEqual(tano["machines"], ["tanodr64"])
|
||||
self.assertNotIn("any_machine", tano)
|
||||
self.assertEqual(tano["source_ref"], "os es_systems.xml:20")
|
||||
|
||||
def test_the_game_itself_as_machine_and_libretro_left_out(self) -> None:
|
||||
(arcade,) = self.rows["arcade"]["searched_by"]
|
||||
self.assertEqual(arcade["emulator"], "mame")
|
||||
self.assertTrue(arcade["any_machine"])
|
||||
self.assertNotIn("machines", arcade)
|
||||
self.assertNotIn("searched_by", self.rows["psx"])
|
||||
|
||||
def test_first_command_without_alternative(self) -> None:
|
||||
rows = by_folder(scrape("esde", "esde", {"systems": {"source": "os", "path": "es_systems.xml"}}))
|
||||
self.assertEqual((rows["psx"]["core"], rows["psx"]["emulator"]), ("mednafen_psx", "retroarch"))
|
||||
|
||||
Reference in new issue
Block a user