From e540dac99696649463edf35f99490568710babfe Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sat, 17 Oct 2026 11:59:38 +0200 Subject: [PATCH] fix: give one native system id one slug RetroDECK filed coco as tandy-coco and Dragon as dragon-32-64, MiSTer filed COCO3 as tandy-coco and Recalbox kept its raw ids, so none of them met xroar's coco, coco3 and dragon64 and its ROMs reached no system. The scraper maps now agree and a test holds every shared native id to one system. --- platforms/misterfpga.yml | 46 +++++++++++++-------------- platforms/recalbox.yml | 4 +-- platforms/retrodeck.yml | 4 +-- scripts/scraper/emudeck_scraper.py | 2 +- scripts/scraper/misterfpga_scraper.py | 2 +- scripts/scraper/recalbox_scraper.py | 2 ++ scripts/scraper/retrodeck_scraper.py | 10 +++--- tests/test_scraper_contract.py | 44 +++++++++++++++++++++++++ 8 files changed, 81 insertions(+), 33 deletions(-) diff --git a/platforms/misterfpga.yml b/platforms/misterfpga.yml index 8efa2657..9eec4e12 100644 --- a/platforms/misterfpga.yml +++ b/platforms/misterfpga.yml @@ -97,6 +97,29 @@ systems: native_id: Casio_PV-2000 name: Casio PV-2000 docs: "https://github.com/MiSTer-devel/Casio_PV-2000_MiSTer" + coco3: + files: + - name: boot0.rom + destination: COCO3/boot0.rom + required: true + md5: 7233c6c429f3ce1c7392f28a933e0b6f + size: 32768 + native_system: COCO3 + - name: boot1.rom + destination: COCO3/boot1.rom + required: true + md5: 8cab28f4b7311b8df63c07bb3b59bfd5 + size: 8192 + native_system: COCO3 + - name: boot2.rom + destination: COCO3/boot2.rom + required: true + md5: 171fb7a5d3b808565295b45c773abaaf + size: 8192 + native_system: COCO3 + native_id: COCO3 + name: Tandy Color Computer 3 + docs: "https://github.com/MiSTer-devel/CoCo3_MiSTer" creativision: files: - name: boot.rom @@ -597,29 +620,6 @@ systems: native_system: SuperAcan native_id: SuperAcan name: superacan - tandy-coco: - files: - - name: boot0.rom - destination: COCO3/boot0.rom - required: true - md5: 7233c6c429f3ce1c7392f28a933e0b6f - size: 32768 - native_system: COCO3 - - name: boot1.rom - destination: COCO3/boot1.rom - required: true - md5: 8cab28f4b7311b8df63c07bb3b59bfd5 - size: 8192 - native_system: COCO3 - - name: boot2.rom - destination: COCO3/boot2.rom - required: true - md5: 171fb7a5d3b808565295b45c773abaaf - size: 8192 - native_system: COCO3 - native_id: COCO3 - name: Tandy Color Computer 3 - docs: "https://github.com/MiSTer-devel/CoCo3_MiSTer" ti99: files: - name: boot0.rom diff --git a/platforms/recalbox.yml b/platforms/recalbox.yml index 297390a6..ca5a7022 100644 --- a/platforms/recalbox.yml +++ b/platforms/recalbox.yml @@ -2948,7 +2948,7 @@ systems: native_name: Texas Instrument TI-99/4A note: Disk Operating System native_id: ti994a - dragon: + dragon64: files: - name: d32.rom destination: dragon/d32.rom @@ -3131,7 +3131,7 @@ systems: native_name: Dragon 32/64 note: Super DOS E8 native_id: dragon - trs80coco: + coco: files: - name: bas10.rom destination: trs80coco/bas10.rom diff --git a/platforms/retrodeck.yml b/platforms/retrodeck.yml index 2b60bcc2..f6a6d786 100644 --- a/platforms/retrodeck.yml +++ b/platforms/retrodeck.yml @@ -15751,7 +15751,7 @@ systems: native_system: xbox component: xemu description: XBOX Complex BIOS 4627 - dragon-32-64: + dragon64: files: - name: d32.rom destination: bios/d32.rom @@ -15882,7 +15882,7 @@ systems: native_system: tanodragon component: xroar description: Prológica CP-400 BASIC OS firmware - tandy-coco: + coco: files: - name: cp400extbas.rom destination: bios/cp400extbas.rom diff --git a/scripts/scraper/emudeck_scraper.py b/scripts/scraper/emudeck_scraper.py index 0afb8c97..1f027271 100644 --- a/scripts/scraper/emudeck_scraper.py +++ b/scripts/scraper/emudeck_scraper.py @@ -85,7 +85,7 @@ SYSTEM_SLUG_MAP = { "ps2": "sony-playstation-2", "ps3": "sony-playstation-3", "psp": "sony-psp", - "psvita": "sony-psvita", + "psvita": "sony-playstation-vita", "segacd": "sega-mega-cd", "megacd": "sega-mega-cd", "saturn": "sega-saturn", diff --git a/scripts/scraper/misterfpga_scraper.py b/scripts/scraper/misterfpga_scraper.py index e78b08e7..481de192 100644 --- a/scripts/scraper/misterfpga_scraper.py +++ b/scripts/scraper/misterfpga_scraper.py @@ -61,7 +61,7 @@ SYSTEM_MAP = { "Astrocade": ("bally-astrocade", "Bally Astrocade", "Astrocade_MiSTer"), "AtariLynx": ("atari-lynx", "Atari Lynx", "AtariLynx_MiSTer"), "CD-i": ("philips-cdi", "Philips CD-i", "CDi_MiSTer"), - "COCO3": ("tandy-coco", "Tandy Color Computer 3", "CoCo3_MiSTer"), + "COCO3": ("coco3", "Tandy Color Computer 3", "CoCo3_MiSTer"), "Casio_PV-2000": ("casio-pv2000", "Casio PV-2000", "Casio_PV-2000_MiSTer"), "CreatiVision": ("creativision", "VTech CreatiVision", "CreatiVision_MiSTer"), "GAMEBOY": ("nintendo-gb", "Game Boy / Game Boy Color", "Gameboy_MiSTer"), diff --git a/scripts/scraper/recalbox_scraper.py b/scripts/scraper/recalbox_scraper.py index 62173df7..0fb0bcd7 100644 --- a/scripts/scraper/recalbox_scraper.py +++ b/scripts/scraper/recalbox_scraper.py @@ -49,6 +49,8 @@ SOURCE_URL = ( SYSTEM_SLUG_MAP = { "3do": "3do", + "dragon": "dragon64", + "trs80coco": "coco", "amiga600": "commodore-amiga", "amiga1200": "commodore-amiga", "amigacd32": "commodore-amiga", diff --git a/scripts/scraper/retrodeck_scraper.py b/scripts/scraper/retrodeck_scraper.py index e41bfa48..15f9762d 100644 --- a/scripts/scraper/retrodeck_scraper.py +++ b/scripts/scraper/retrodeck_scraper.py @@ -85,7 +85,7 @@ SYSTEM_SLUG_MAP: dict[str, str | None] = { "ps2": "sony-playstation-2", "ps3": "sony-playstation-3", "psp": "sony-psp", - "psvita": "sony-psvita", + "psvita": "sony-playstation-vita", # Sega "megadrive": "sega-mega-drive", "genesis": "sega-mega-drive", @@ -146,10 +146,12 @@ SYSTEM_SLUG_MAP: dict[str, str | None] = { "wonderswan": "bandai-wonderswan", "neogeocd": "snk-neogeo-cd", "neogeocdjp": "snk-neogeo-cd", - "coco": "tandy-coco", + # xroar files the CoCo 1/2 ROMs under coco and the Dragon 64's under + # dragon64, the ids Batocera uses too. + "coco": "coco", "trs80": "tandy-trs-80", - "dragon": "dragon-32-64", - "tanodragon": "dragon-32-64", + "dragon": "dragon64", + "tanodragon": "dragon64", "pico8": "pico8", "wolfenstein": "wolfenstein-3d", "zxspectrum": "sinclair-zx-spectrum", diff --git a/tests/test_scraper_contract.py b/tests/test_scraper_contract.py index c1d7836f..b40cae4b 100644 --- a/tests/test_scraper_contract.py +++ b/tests/test_scraper_contract.py @@ -587,5 +587,49 @@ class ImportingAScraperFetchesNothing(unittest.TestCase): ) +class OneNativeIdOneSystem(unittest.TestCase): + """RetroDECK filed coco as tandy-coco and Batocera as coco: xroar's 28 + CoCo and Dragon ROMs reached no RetroDECK system, and --system left + them out of the pack and the installer alike.""" + + # A folder each platform fills with something else, not a system name: + # EmuDeck checks the Neo Geo BIOS there, RetroDECK keeps arcade sets. + # Several platforms file the PC Engine CD under the HuCard system, the + # native_system of each entry keeping the platform's own grouping. + FOLDS = {"fbneo", "pcenginecd"} + + def test_scrapers_agree_on_every_shared_native_id(self): + from common import _norm_system_id # noqa: PLC0415 + + seen: dict[str, dict[str, str]] = {} + for path in sorted((REPO_ROOT / "scripts" / "scraper").glob("*_scraper.py")): + if "SYSTEM_SLUG_MAP" not in path.read_text(): + continue + module = importlib.import_module(f"scraper.{path.stem}") + for native, slug in getattr(module, "SYSTEM_SLUG_MAP", {}).items(): + slug = slug[0] if isinstance(slug, tuple) else slug + if isinstance(slug, str): + seen.setdefault(native.lower(), {})[path.stem] = slug + split = { + native: by for native, by in seen.items() + if native not in self.FOLDS and len({_norm_system_id(s) for s in by.values()}) > 1 + } + self.assertEqual(split, {}) + + def test_xroar_machines_reach_the_platforms_that_run_it(self): + import yaml # noqa: PLC0415 + + from common import _norm_system_id # noqa: PLC0415 + + xroar = yaml.safe_load((REPO_ROOT / "emulators" / "xroar.yml").read_text()) + machines = {_norm_system_id(s) for s in xroar["systems"]} + for platform, wanted in (("retrodeck", {"coco", "dragon64"}), + ("recalbox", {"coco", "dragon64"}), + ("misterfpga", {"coco3"})): + with self.subTest(platform=platform): + data = yaml.safe_load((REPO_ROOT / "platforms" / f"{platform}.yml").read_text()) + ids = {_norm_system_id(s) for s in data["systems"]} + self.assertEqual(wanted & ids & machines, wanted) + if __name__ == "__main__": unittest.main()