diff --git a/emulators/aethersx2.yml b/emulators/aethersx2.yml index ae3851eb9..2f63e2e41 100644 --- a/emulators/aethersx2.yml +++ b/emulators/aethersx2.yml @@ -102,6 +102,7 @@ notes: | files: - name: ps2-0230a-20080220.bin + found_by: content path: bios/ps2-0230a-20080220.bin required: true min_size: 4194304 diff --git a/emulators/armsx2.yml b/emulators/armsx2.yml index 7db9c5be5..ea9bc68c8 100644 --- a/emulators/armsx2.yml +++ b/emulators/armsx2.yml @@ -163,6 +163,7 @@ notes: | files: - name: ps2-0230a-20080220.bin + found_by: content path: pcsx2/bios/ps2-0230a-20080220.bin aliases: [ps2-0250j-20100415.bin] standalone_path: bios/ps2-0230a-20080220.bin diff --git a/emulators/lrps2.yml b/emulators/lrps2.yml index 8977a465b..4bf7b0d92 100644 --- a/emulators/lrps2.yml +++ b/emulators/lrps2.yml @@ -45,6 +45,7 @@ data_directories: files: - name: ".bin" + found_by: content path: "pcsx2/bios/.bin" required: true description: "PS2 BIOS binary" diff --git a/emulators/nethersx2-turnip-classic.yml b/emulators/nethersx2-turnip-classic.yml index ee33915d6..8b4994455 100644 --- a/emulators/nethersx2-turnip-classic.yml +++ b/emulators/nethersx2-turnip-classic.yml @@ -168,6 +168,7 @@ notes: | files: - name: ps2-0230a-20080220.bin + found_by: content path: bios/ps2-0230a-20080220.bin required: true min_size: 4194304 diff --git a/emulators/nethersx2-turnip.yml b/emulators/nethersx2-turnip.yml index 5f71386a0..258f7f4a9 100644 --- a/emulators/nethersx2-turnip.yml +++ b/emulators/nethersx2-turnip.yml @@ -149,6 +149,7 @@ notes: | files: - name: ps2-0230a-20080220.bin + found_by: content path: bios/ps2-0230a-20080220.bin required: true min_size: 4194304 diff --git a/emulators/nethersx2.yml b/emulators/nethersx2.yml index b4398c0bf..65075c10f 100644 --- a/emulators/nethersx2.yml +++ b/emulators/nethersx2.yml @@ -129,6 +129,7 @@ notes: | files: - name: ps2-0230a-20080220.bin + found_by: content path: bios/ps2-0230a-20080220.bin required: true min_size: 4194304 diff --git a/emulators/pcee2.yml b/emulators/pcee2.yml index 11dea57cf..3c9355b1c 100644 --- a/emulators/pcee2.yml +++ b/emulators/pcee2.yml @@ -91,6 +91,7 @@ notes: | files: - name: ".bin" + found_by: content path: "pcsx2/bios/.bin" description: "PS2 BIOS image" min_size: 4194304 diff --git a/emulators/pcsx2-legacy.yml b/emulators/pcsx2-legacy.yml index 74ec65c37..fda0bd950 100644 --- a/emulators/pcsx2-legacy.yml +++ b/emulators/pcsx2-legacy.yml @@ -77,6 +77,7 @@ notes: | files: - name: ps2-0230a-20080220.bin + found_by: content system: sony-playstation-2 required: true description: "PS2 console BIOS" diff --git a/emulators/pcsx2.yml b/emulators/pcsx2.yml index 693e6f9f0..7c2f5206d 100644 --- a/emulators/pcsx2.yml +++ b/emulators/pcsx2.yml @@ -25,6 +25,7 @@ notes: | files: - name: ps2-0230a-20080220.bin + found_by: content aliases: [ps2-0250j-20100415.bin, SCPH-70004_BIOS_V12_EUR_200.BIN] required: true min_size: 4194304 diff --git a/emulators/pcsx2x6.yml b/emulators/pcsx2x6.yml index aeb3ea2cb..7732c22d6 100644 --- a/emulators/pcsx2x6.yml +++ b/emulators/pcsx2x6.yml @@ -80,6 +80,7 @@ notes: | files: - name: COH-H31100.rom0 + found_by: content system: namco-system246 required: true min_size: 4194304 diff --git a/emulators/yaps2.yml b/emulators/yaps2.yml index 07ed63931..fc47f171c 100644 --- a/emulators/yaps2.yml +++ b/emulators/yaps2.yml @@ -179,6 +179,7 @@ notes: | files: - name: ps2-0230a-20080220.bin + found_by: content path: pcsx2/bios/ps2-0230a-20080220.bin aliases: [ps2-0250j-20100415.bin] standalone_path: bios/ps2-0230a-20080220.bin diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 4e191efc2..929ecceea 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -6878,5 +6878,31 @@ class ProfileNotesDescribeTheCoreAlone(unittest.TestCase): self.assertEqual(found, []) +class Ps2BiosImagesAreFoundByContent(unittest.TestCase): + """PCSX2 and its forks scan the BIOS folder and keep the first 4 to 8 MB + image with a romdir (pcsx2/ps2/BiosTools.cpp:258-282 at f0523f8a). With + no found_by the label ps2-0230a-20080220.bin read as a name the core + opens, and the RetroDECK export added it as a required file.""" + + def test_every_ps2_image_scan_is_marked(self): + import yaml + + from validation import opens_by_name + + named = [] + for path in sorted((ROOT / "emulators").glob("*.yml")): + profile = yaml.safe_load(path.read_text(encoding="utf-8")) or {} + if profile.get("bios_mode") != "agnostic": + continue + for entry in profile.get("files") or []: + if ( + entry.get("min_size") == 4194304 + and entry.get("max_size") == 8388608 + and opens_by_name(entry, profile) + ): + named.append(f"{path.stem}: {entry['name']}") + self.assertEqual(named, []) + + if __name__ == "__main__": unittest.main()