From cb4649bb23bb3b7f80f4670729c28790315220ec Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:15:08 +0100 Subject: [PATCH] fix: mark openmsx system roms as found by sha1 openMSX reaches a ROM in share/systemroms through its file pool by SHA1 alone. A filename is only looked up beside the machine's XML (src/memory/Rom.cc:121-170, HardwareConfig.cc:279-280, FileContext.cc:152-156 at a557de7b). The labels read as names the core opens, and the export added 15 of them to KNULLI and 2 to Batocera. --- emulators/openmsx.yml | 5 ++++- tests/test_audit_regressions.py | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/emulators/openmsx.yml b/emulators/openmsx.yml index e8cb758fa..fe75e1b0f 100644 --- a/emulators/openmsx.yml +++ b/emulators/openmsx.yml @@ -10,6 +10,7 @@ version_basis: tag: "RELEASE_22_0_RC2" distance: 0 display_name: "MSX / ColecoVision / Spectravideo (openMSX)" +found_by: content cores: - openmsx systems: @@ -29,7 +30,9 @@ notes: | ROM resolution via FilePool (src/file/FilePool.cc, FilePoolCore.cc): searches configured directories for files matching SHA1 checksums. - Filenames are secondary hints, while SHA1 is the primary lookup key. + A ROM in share/systemroms is reached by its SHA1 alone: a filename is only + looked up beside the machine's XML (src/memory/Rom.cc:121-170, + src/config/HardwareConfig.cc:279-280, src/file/FileContext.cc:152-156). Files may be gzipped or individually zipped. Each user data directory contributes share/systemroms, scanned recursively (src/file/FilePool.cc:27, src/file/FilePoolCore.cc:369-385). RetroBat diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 8d0bdf2a5..9b1e964d4 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -6924,5 +6924,25 @@ class Dev9FilesAreReadFromTheWorkingDirectory(unittest.TestCase): self.assertEqual(unset, []) +class OpenMsxSystemRomsAreFoundBySha1(unittest.TestCase): + """openMSX reaches a ROM in share/systemroms through the file pool by + SHA1 alone, a filename being looked up only beside the machine's XML + (src/memory/Rom.cc:121-170). Read as names the core opens, the labels + were added to the KNULLI and Batocera exports.""" + + def test_no_systemrom_label_reads_as_a_name(self): + import yaml + + from validation import opens_by_name + + profile = yaml.safe_load((ROOT / "emulators" / "openmsx.yml").read_text()) + named = [ + entry["name"] for entry in profile["files"] + if "share/systemroms/" in str(entry.get("path")) + and opens_by_name(entry, profile) + ] + self.assertEqual(named, []) + + if __name__ == "__main__": unittest.main()