fix: give np2kai scsi.rom a read ceiling, not a size

This commit is contained in:
Abdessamad Derraz committed 2026-10-06 08:52:26 +02:00
1 parent 947fd23421
commit 5a776fc06e
2 files changed
+21 -4

No files matched your search

+6 -4
View File
@@ -151,16 +151,18 @@ files:
source_ref: "cbus/ideio.c:1928-1930, cbus/ideio.c:1944-1981"
# -- SCSI BIOS ROM --
# Loaded by scsiio.c:219. 16 KB (0x4000). Falls back to scsibios[] stub.
# Read into a 0x4000 buffer; any non-empty read is kept. Falls back to the
# scsibios[] stub.
- name: "scsi.rom"
path: "np2kai/scsi.rom"
size: 16384
max_size: 16384
required: false
hle_fallback: true
note: >
SCSI controller BIOS ROM (16 KB). The core includes a built-in
SCSI controller BIOS ROM, up to 16 KB: the full-size test is commented
out and a shorter file is used as read. The core includes a built-in
SCSI BIOS stub as fallback.
source_ref: "cbus/scsiio.c:214-231"
source_ref: "cbus/scsiio.c:720-732"
# -- SASI BIOS ROM --
# Loaded by sasiio.c:455. 4 KB (0x1000). Falls back to sasibios[] stub.
+15
View File
@@ -314,5 +314,20 @@ class SwitchKeysAreTheNewestSet(unittest.TestCase):
self.assertEqual(newest(REPO_ROOT / path), best)
class Pc98ScsiBiosIsNotTheAppleCard(unittest.TestCase):
"""np2kai declared an exact 16 KB its loader never requires; the Apple II
SCSI card ROM of that size won the name tie over the PC-98 BIOS."""
def test_np2kai_resolves_the_pc98_rom(self):
db_path = REPO_ROOT / "database.json"
if not db_path.exists():
self.skipTest("no database.json")
db = load_database(str(db_path))
profile = load_emulator_profiles(str(REPO_ROOT / "emulators"))["np2kai"]
entry = next(e for e in profile["files"] if e["name"] == "scsi.rom")
path, _status = resolve_local_file(entry, db, dest_hint=entry["path"])
self.assertIn("PC-98", path or "")
if __name__ == "__main__":
unittest.main()