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.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 10:14:15 +02:00
1 parent b4a88798de
commit 3ccee1b216
3 files changed
+31 -5

No files matched your search

+1 -5
View File
@@ -30,18 +30,14 @@ notes: |
ref: src/platform/core/src/loader/bios.cpp:17-48, src/platform/sdl/main.cpp:177-192, ref: src/platform/core/src/loader/bios.cpp:17-48, src/platform/sdl/main.cpp:177-192,
src/nba/src/core.cpp:42-44 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: files:
- name: "bios.bin" - name: "bios.bin"
path: "bios.bin" path: "bios.bin"
aliases: ["gba_bios.bin"]
system: nintendo-gba system: nintendo-gba
required: true required: true
size: 16384 size: 16384
validation: [size] validation: [size]
config_key: "general.bios_path" config_key: "general.bios_path"
description: "Game Boy Advance BIOS" 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" 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"
+11
View File
@@ -666,6 +666,17 @@ def find_undeclared_files(
path_base, by_name, by_path_suffix, data_names, path_base, by_name, by_path_suffix, data_names,
by_name_lower, 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: if not in_repo:
# Hash fallback: the repo may hold the content under a # Hash fallback: the repo may hold the content under a
# different filename (exos21.rom vs exos21.bin). # different filename (exos21.rom vs exos21.bin).
+19
View File
@@ -231,6 +231,25 @@ class LauncherLayerTest(unittest.TestCase):
self.assertIn("v103.bin", report) self.assertIn("v103.bin", report)
self.assertIn("boot.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: def test_no_place_is_filled_twice(self) -> None:
added = [u["path"] for u in self._report() if u.get("launcher")] added = [u["path"] for u in self._report() if u.get("launcher")]
self.assertEqual(sorted(added), ["e.bin", "sub/fix.bin"]) self.assertEqual(sorted(added), ["e.bin", "sub/fix.bin"])