mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-22 01:27:52 -06:00
feat: record every core a rom folder offers
The rom folders files kept the default core of each folder only, so a core the user picks in the frontend's menu was not known to read its sets there. Each folder now lists its offers: every <core> of every <emulator> in AmberELEC's es_systems.cfg (arcade: packages/ui/emulationstation/config/es_systems.cfg:116-150), every core of EmuELEC's es_systems.json, every add_emu_core of ROCKNIX's emulators package.mk with the device case it is written under (arcade: 218-229), and the emulator of every ES-DE <command>. A core written under every branch of a case is offered unconditionally. The ES-XML, ES-JSON, ELEC-conf and ES-DE setups are rescraped at their pins: archr, arkos, chaos, darkos, jelos, kolos, pan4elec, retrobat and unofficialos gain the same records and nothing else. A libretro core offered for a folder reads the sets it loads beside the game there, as the default one does. Manifests, roms folders gaining sets read beside the game: - AmberELEC: +215 (293.1 MB) in fbneo, arcade and mame, for MAME 2010, 2015, 2016 and 2003-Plus. 1 omission leaves. - EmuELEC: +291 (232.0 MB) in cps1, cps2, cps3, mame, fbneo and arcade, for MAME 2010 and 2003-Plus. 47 omissions leave. - ROCKNIX: +501 (538.7 MB) in fbneo, neogeo, cps1, cps2, cps3, arcade and mame, for MAME 2010, 2015 and 2003-Plus. 120 omissions leave. - EmuDeck: +306 (251.2 MB) in cps, cps1, cps2, cps3, arcade and mame, for MAME 2000, 2003, 2003-Plus and 2010. 92 omissions leave. Each omission that leaves was a set named as read outside the BIOS folder. RetroDECK and the other platforms do not change. No file leaves, and verify --all keeps its severity and status counts.
This commit is contained in:
1 parent
01a422f86c
commit
801af113b7
21 files changed
+19272
-6
No files matched your search
@@ -1187,6 +1187,27 @@ class StandaloneMameOnEmuDeck(unittest.TestCase):
|
||||
self.assertIn(("roms", "adam/adam.zip"), places)
|
||||
|
||||
|
||||
class EveryCoreAFolderOffers(unittest.TestCase):
|
||||
"""AmberELEC's es_systems.cfg, EmuELEC's es_systems.json and ROCKNIX's
|
||||
add_emu_core calls offer several cores per folder, the user's choice
|
||||
starting any of them."""
|
||||
|
||||
def test_the_rom_folders_files_record_the_offers(self) -> None:
|
||||
for setup, folder, core in (("amberelec", "arcade", "mame2010"),
|
||||
("emuelec", "arcade", "mame2010"),
|
||||
("rocknix", "arcade", "mame2010")):
|
||||
with (REPO_ROOT / "platforms" / "romfolders" / f"{setup}.yml").open() as f:
|
||||
rows = {r["folder"]: r for r in yaml.safe_load(f)["folders"]}
|
||||
self.assertIn(core, {o["core"] for o in rows[folder].get("offers") or []}, setup)
|
||||
|
||||
def test_an_offered_core_reads_its_sets_in_that_folder(self) -> None:
|
||||
for platform in ("amberelec", "rocknix"):
|
||||
view = libretro_view("mame2010", platform)
|
||||
folders = {e["path"].split("/")[0] for e in view["files"]
|
||||
if e.get("category") == "bios_zip" and e.get("layout_path")}
|
||||
self.assertIn("arcade", folders, platform)
|
||||
|
||||
|
||||
def platform_manifest(platform: str) -> dict:
|
||||
from common import load_database
|
||||
|
||||
@@ -1214,6 +1235,16 @@ class ArchiveSharedByOfferedCores(unittest.TestCase):
|
||||
others = {c for a in entry.get("alternatives", []) for c in a["cores"]}
|
||||
self.assertIn("advancemame", others)
|
||||
|
||||
def test_offered_cores_join_the_default_one(self) -> None:
|
||||
# AmberELEC's arcade folder starts MAME 2003-Plus and offers MAME
|
||||
# 2000, 2010, 2015 and 2016 (es_systems.cfg:116-150).
|
||||
(entry,) = [f for f in platform_manifest("amberelec")["files"]
|
||||
if f["dest"] == "arcade/neogeo.zip"]
|
||||
self.assertEqual(entry["cores"], ["mame2003_plus"])
|
||||
self.assertTrue(entry["repo_path"].endswith("neogeo.zip.74df3258"))
|
||||
others = {c for a in entry.get("alternatives", []) for c in a["cores"]}
|
||||
self.assertLessEqual({"mame2000", "mame2010", "mame2015", "mame2016"}, others)
|
||||
|
||||
def test_the_copy_serving_most_cores_wins_without_a_default(self) -> None:
|
||||
# RetroDECK's cps folders start the libretro MAME core, whose sets are
|
||||
# in mame/bios. Of the cores reading nss.zip in cps1, MAME 2003-Plus
|
||||
|
||||
@@ -133,6 +133,13 @@ class EsXmlFormat(unittest.TestCase):
|
||||
self.assertEqual(rows["psx"]["board_defaults"]["rk3326"]["core"], "duckstation")
|
||||
self.assertNotIn("board_defaults", rows["mame"])
|
||||
|
||||
def test_every_core_the_system_lists_is_offered(self) -> None:
|
||||
self.assertEqual(self.rows["psx"]["offers"], [
|
||||
{"emulator": "retroarch", "core": "pcsx_rearmed"},
|
||||
{"emulator": "retroarch", "core": "swanstation"}])
|
||||
# A default alone is no choice.
|
||||
self.assertNotIn("offers", self.rows["mame"])
|
||||
|
||||
def test_source_ref_points_at_the_name_line(self) -> None:
|
||||
self.assertEqual(self.rows["psx"]["source_ref"], "os es_systems.cfg:4")
|
||||
self.assertEqual(self.rows["advision"]["source_ref"], "os es_systems.cfg:20")
|
||||
@@ -173,6 +180,11 @@ class ElecConfFormat(unittest.TestCase):
|
||||
"DEVICE=RK3326": {"core": "pcsx_rearmed", "emulator": "retroarch",
|
||||
"source_ref": "os package.mk:11"}})
|
||||
|
||||
def test_a_core_under_every_branch_is_offered_unconditionally(self) -> None:
|
||||
self.assertEqual(self.rows["psx"]["offers"], [
|
||||
{"emulator": "retroarch", "core": "pcsx_rearmed", "source_ref": "os package.mk:11,16"},
|
||||
{"emulator": "retroarch", "core": "swanstation", "source_ref": "os package.mk:12,15"}])
|
||||
|
||||
def test_unconditional_default(self) -> None:
|
||||
self.assertEqual(self.rows["3do"]["core"], "opera")
|
||||
self.assertEqual(self.rows["3do"]["source_ref"],
|
||||
@@ -221,6 +233,11 @@ class EsdeFormat(unittest.TestCase):
|
||||
self.assertTrue(libretro["any_machine"])
|
||||
self.assertEqual(libretro["source_ref"], "os es_systems.xml:27")
|
||||
|
||||
def test_each_command_offers_its_emulator(self) -> None:
|
||||
self.assertEqual(self.rows["arcade"]["offers"], [
|
||||
{"emulator": "retroarch", "core": "mame", "source_ref": "os es_systems.xml:27"},
|
||||
{"emulator": "mame", "core": "mame", "source_ref": "os es_systems.xml:28"}])
|
||||
|
||||
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