From 3ccee1b216290ea8305008a7ff5fbca714cf1818 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 21 Oct 2026 10:14:15 +0200 Subject: [PATCH] fix: drop the gba_bios.bin alias of nanoboyadvance NanoBoyAdvance opens general.bios_path, default bios.bin (src/platform/core/src/config.cpp:36 at 3bb6f478). gba_bios.bin is the path ROCKNIX's config.toml sets, recorded under launchers: in rocknix.yml. Without the alias the entry met only PCem's and QEMU's bios.bin, 64 and 128 KB, which BIOSLoader refuses (bios.cpp:17-48). verify counted it held by name, so the launcher layer left it alone and the ROCKNIX pack gained PCem's image. A hashless entry whose every same-named copy fails its size is now not held, and the gba_bios.bin ROCKNIX declares settles it. --- emulators/nanoboyadvance.yml | 6 +----- scripts/verify.py | 11 +++++++++++ tests/test_launcher_layer.py | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/emulators/nanoboyadvance.yml b/emulators/nanoboyadvance.yml index c6edfe09..92546cc9 100644 --- a/emulators/nanoboyadvance.yml +++ b/emulators/nanoboyadvance.yml @@ -30,18 +30,14 @@ notes: | ref: src/platform/core/src/loader/bios.cpp:17-48, src/platform/sdl/main.cpp:177-192, src/nba/src/core.cpp:42-44 - ROCKNIX patches config.toml and keymap.toml to /storage/.config/nanoboyadvance/ - and its config.toml sets bios_path = /storage/roms/bios/gba_bios.bin. - files: - name: "bios.bin" path: "bios.bin" - aliases: ["gba_bios.bin"] system: nintendo-gba required: true size: 16384 validation: [size] config_key: "general.bios_path" description: "Game Boy Advance BIOS" - note: "Any file name through general.bios_path or --bios, or bios.bin beside the executable when neither is set. ROCKNIX points the key at gba_bios.bin in its BIOS directory." + note: "Any file name through general.bios_path or --bios, or bios.bin beside the executable when neither is set." source_ref: "src/platform/core/src/loader/bios.cpp:17-48, src/platform/core/src/config.cpp:36, src/platform/sdl/main.cpp:177-192" diff --git a/scripts/verify.py b/scripts/verify.py index 09947723..d9c5db0d 100644 --- a/scripts/verify.py +++ b/scripts/verify.py @@ -666,6 +666,17 @@ def find_undeclared_files( path_base, by_name, by_path_suffix, data_names, by_name_lower, ) + if in_repo and not any( + f.get(h) for h in ("sha1", "md5", "crc32", "sha256") + ): + # A name alone answers nothing when every copy of that + # name fails the size the code checks: the resolver + # rejects them all. NanoBoyAdvance's 16 KB bios.bin met + # only PCem's and QEMU's PC BIOS images of that name. + # The fallback below then decides as for any mismatch. + _lp, _st = resolve_local_file(f, db, dest_hint=dest) + if _st == "hash_mismatch": + in_repo = False if not in_repo: # Hash fallback: the repo may hold the content under a # different filename (exos21.rom vs exos21.bin). diff --git a/tests/test_launcher_layer.py b/tests/test_launcher_layer.py index dd029a6d..4231a0c8 100644 --- a/tests/test_launcher_layer.py +++ b/tests/test_launcher_layer.py @@ -231,6 +231,25 @@ class LauncherLayerTest(unittest.TestCase): self.assertIn("v103.bin", report) self.assertIn("boot.bin", report) + def test_a_name_whose_copies_fail_the_size_is_not_held(self) -> None: + """NanoBoyAdvance reads a 16 KB bios.bin, and the collection's + bios.bin files are PCem's and QEMU's PC BIOS images. Counted held by + name, the entry escaped the launcher layer, which settles only what + the collection lacks, and the ROCKNIX pack carried PCem's 64 KB image + beside the gba_bios.bin its launcher passes.""" + profile = { + "emulator": "FixEmu", "type": "standalone", "systems": ["test-sys"], + "files": [{"name": "core.bin", "required": True, + "size": len(CONTENT["plain.bin"]), "validation": ["size"]}], + } + with open(os.path.join(self.emulators_dir, "fixemu.yml"), "w") as fh: + yaml.dump(profile, fh) + self.config["launchers"][2]["names"] = ["plain.bin"] + _emulator_profiles_cache.clear() + self.profiles = load_emulator_profiles(self.emulators_dir) + self.assertNotIn("core.bin", {u["name"] for u in self._report()}) + self.assertNotIn("core.bin", self._pack_names()) + def test_no_place_is_filled_twice(self) -> None: added = [u["path"] for u in self._report() if u.get("launcher")] self.assertEqual(sorted(added), ["e.bin", "sub/fix.bin"])