From ab35bb407a87476be1b11974ce11da8b659198da Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 21 Oct 2026 10:14:42 +0200 Subject: [PATCH] fix: keep the Apple II SCSI ROM from np2pi np2pi reads 0x4000 bytes of scsi.rom as the SCSI BIOS (cbus/scsiio.c: 208-233). The only 16 KB copy of that name is Clock Signal's Apple II card ROM, which the name step served and the RetroPie manifest installed. The entry now carries unsourceable: and np2pi falls back on its stub. --- emulators/np2pi.yml | 1 + tests/test_foreign_tree.py | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/emulators/np2pi.yml b/emulators/np2pi.yml index 06324efa..66d29cef 100644 --- a/emulators/np2pi.yml +++ b/emulators/np2pi.yml @@ -190,3 +190,4 @@ files: hle_fallback: true note: "Read when a SCSI disk is attached, 0x4000 bytes. Otherwise the built-in stub is copied." source_ref: "cbus/scsiio.c:208-233" + unsourceable: "PC-98 SCSI BIOS image the collection does not hold, and a same-named ROM of another machine must not stand in" diff --git a/tests/test_foreign_tree.py b/tests/test_foreign_tree.py index 4fba40a8..47056e55 100644 --- a/tests/test_foreign_tree.py +++ b/tests/test_foreign_tree.py @@ -113,5 +113,31 @@ class AReleaseNamedAfterTheTree(unittest.TestCase): self.assertIn("cxbxreloaded", _owner_tokens({"source_profile": "cxbx-reloaded-2023"})) +class AnotherMachinesRomIsNotServed(unittest.TestCase): + """np2pi reads a 16 KB PC-98 SCSI BIOS as scsi.rom. The only copy of that + size was Clock Signal's Apple II SCSI card ROM, and the name step served + it. Reads the repository.""" + + def test_np2pi_does_not_receive_the_apple_ii_rom(self): + import yaml + + from common import load_database + + if not (REPO_ROOT / "database.json").is_file(): + self.skipTest("database.json is absent") + profile = yaml.safe_load((REPO_ROOT / "emulators" / "np2pi.yml").read_text()) + entry = next(f for f in profile["files"] if f.get("name") == "scsi.rom") + previous = os.getcwd() + os.chdir(REPO_ROOT) + try: + db = load_database("database.json") + local, _status = resolve_local_file( + {**entry, "source_profile": "np2pi"}, db, {}, dest_hint=entry["path"] + ) + finally: + os.chdir(previous) + self.assertFalse(local and "Clock Signal" in local, local) + + if __name__ == "__main__": unittest.main()