From eb76f56a96e32a309c53859bc7c2bad7c309dda6 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 28 Oct 2026 08:18:24 +0100 Subject: [PATCH] fix: swanstation opens its region bios by name The region BIOS option names scph5500/5501/5502.bin by default and LoadImageFromFile checks only the size (host_interface.cpp:124-133, bios.cpp:82-105). The md5 table serves the directory scan and the Fast Boot patch. validation: [size], found_by: name. Closes the open swanstation finding. --- emulators/swanstation.yml | 25 ++++++++++++++++++------- measurements/findings.jsonl | 1 + 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/emulators/swanstation.yml b/emulators/swanstation.yml index 610e19a94..c15e7e7a1 100644 --- a/emulators/swanstation.yml +++ b/emulators/swanstation.yml @@ -23,7 +23,11 @@ notes: | (dep/openbios) boots instead. ref: src/core/system.cpp:650,678-682 - Auto-detects BIOS by scanning system_dir for files of known sizes. + The BIOS option of the console region names a file, scph5500.bin, + scph5501.bin and scph5502.bin by default, opened by that name with a size + check only. When it is missing or of another size the core scans system_dir + for files of known sizes and keeps one whose md5 the table knows. + ref: src/core/host_interface.cpp:100-133, src/libretro/libretro_core_options.h:96-137 ref: src/core/host_interface.cpp:136-194 (FindBIOSImageInDirectory) Accepts PS1 (512 KB), PS2 (4 MB), and PS3 (0x3E66F0) BIOS images. Only the first 512 KB are loaded (src/core/bios.cpp:84, Image(BIOS_SIZE)). @@ -46,39 +50,46 @@ notes: | files: - name: "scph5500.bin" + found_by: "name" description: "SCPH-5500 (v3.0 09-09-96 J)" region: [japan] required: false hle_fallback: true md5: "8dd7d5296a650fac7319bce665a6a53c" size: 524288 - validation: [size, md5] - source_ref: "source src/core/bios.cpp:49" + validation: ["size"] + source_ref: "source src/core/bios.cpp:49, source src/core/bios.cpp:82-105, source src/core/host_interface.cpp:100-133, source src/libretro/libretro_core_options.h:96-109" aliases: [] + note: "Default of swanstation_BIOS_PathNTSCJ, opened by this name with a size check only (512 KB, 4 MB or the PS3 size). The md5 table identifies files in the directory scan, which runs only when the named file is missing or of another size (host_interface.cpp:136-193). A file whose md5 the table lacks still boots, without the Fast Boot patch (bios.cpp:142-146, system.cpp:689, 711)." - name: "scph5501.bin" + found_by: "name" description: "SCPH-5501, 5503, 7003 (v3.0 11-18-96 A)" region: [north-america, latin-america] required: false hle_fallback: true md5: "490f666e1afb15b7362b406ed1cea246" size: 524288 - validation: [size, md5] - source_ref: "source src/core/bios.cpp:50-51" + validation: ["size"] + source_ref: "source src/core/bios.cpp:50-51, source src/core/bios.cpp:82-105, source src/core/host_interface.cpp:100-133, source src/libretro/libretro_core_options.h:110-123" aliases: [] evidence: hle_fallback: ["2026-10-27-ba53cd101c61", "2026-10-27-f9363c9e87f6"] + validation: ["2026-10-27-f9363c9e87f6", "2026-10-27-97e674b2e56e"] + note: "Default of swanstation_BIOS_PathNTSCU, opened by this name with a size check only (512 KB, 4 MB or the PS3 size). The md5 table identifies files in the directory scan, which runs only when the named file is missing or of another size (host_interface.cpp:136-193). A file whose md5 the table lacks still boots, without the Fast Boot patch (bios.cpp:142-146, system.cpp:689, 711)." - name: "scph5502.bin" + found_by: "name" description: "SCPH-5502, 5552 (v3.0 01-06-97 E)" region: [europe, oceania] required: false hle_fallback: true md5: "32736f17079d0b2b7024407c39bd3050" size: 524288 - validation: [size, md5] - source_ref: "source src/core/bios.cpp:52-53" + validation: ["size"] + source_ref: "source src/core/bios.cpp:52-53, source src/core/bios.cpp:82-105, source src/core/host_interface.cpp:100-133, source src/libretro/libretro_core_options.h:124-137" aliases: [] + note: "Default of swanstation_BIOS_PathPAL, opened by this name with a size check only (512 KB, 4 MB or the PS3 size). The md5 table identifies files in the directory scan, which runs only when the named file is missing or of another size (host_interface.cpp:136-193). A file whose md5 the table lacks still boots, without the Fast Boot patch (bios.cpp:142-146, system.cpp:689, 711)." - name: "psxonpsp660.bin" description: "PSP, SCPH-1000R (v4.5 05-25-00 J)" diff --git a/measurements/findings.jsonl b/measurements/findings.jsonl index c017ae564..aecc0676b 100644 --- a/measurements/findings.jsonl +++ b/measurements/findings.jsonl @@ -27,3 +27,4 @@ {"content":"Bust-A-Move 2 - Arcade Edition (USA)","core":{"file":"swanstation_libretro.so","library_version":"1.0.0 631f0fb","sha256":"fc65bb2d662c3ad762b611a62ac578f78efd260431d3b8c090f0eb40887a77ea"},"emulator":"swanstation","evidence":["2026-10-27-f9363c9e87f6","2026-10-27-97e674b2e56e"],"field":"validation","file":"scph5501.bin","found_at":"2026-10-27T22:37:43+00:00","id":"2026-10-27-7becd3ea082b","key":"swanstation/sony-playstation/scph5501.bin/validation","profile_says":["size","md5"],"rule":"validation_contradicted","run_shows":{"content":false,"size":true},"schema_version":1,"statement":"the core does not check the content and checks the size of scph5501.bin: a same-size file of zeros is run, the profile declares validation ['md5', 'size']","status":"open","system":"sony-playstation"} {"content":"Bust-A-Move 2 - Arcade Edition (USA)","core":{"file":"mednafen_psx_hw_libretro.so","library_version":"0.9.44.1 7fea57a","sha256":"d16c889c9f12bd3265edc3c9d4b0e6e24c1f244d1d8d475235f6a74e65e5b10b"},"emulator":"beetle_psx","evidence":["2026-10-27-ae6d4db96e73","2026-10-27-c1f4aa5d47cd"],"field":"validation","file":"scph5501.bin","found_at":"2026-10-28T07:16:45+00:00","id":"2026-10-28-7df447e3370d","key":"beetle_psx/sony-playstation/scph5501.bin/validation","profile_says":["sha1"],"reason":"firmware_is_present computes the SHA1, logs 'Firmware found but has invalid SHA1' and returns true (libretro.c:853-860). The load reads the file whatever its size and only logs a size that is neither 512 KB nor 1 MB (libretro.c:3425-3502). The check is declared with on_mismatch: warn.","rule":"validation_contradicted","run_shows":{"content":false,"size":false},"schema_version":1,"statement":"the core does not check the content and does not check the size of scph5501.bin: a same-size file of zeros is run, the profile declares validation ['sha1']","status":"applied","system":"sony-playstation"} {"content":"Bust-A-Move 2 - Arcade Edition (USA)","core":{"file":"mednafen_psx_hw_libretro.so","library_version":"0.9.44.1 7fea57a","sha256":"d16c889c9f12bd3265edc3c9d4b0e6e24c1f244d1d8d475235f6a74e65e5b10b"},"emulator":"beetle_psx","evidence":["2026-10-27-ae6d4db96e73"],"field":"required","file":"scph5501.bin","found_at":"2026-10-28T07:17:02+00:00","id":"2026-10-28-9c0f49d04c7d","key":"beetle_psx/sony-playstation/scph5501.bin/required","profile_says":true,"reason":"Applied by hand in 499e5faa7: required false. When firmware_is_present finds no region BIOS the load copies the built-in OpenBIOS into BIOS ROM (libretro.c:3425-3428, 3505-3511), so the core boots without the file.","rule":"boots_without_file","run_shows":false,"schema_version":1,"statement":"the profile says scph5501.bin is required, and the core boots without it. The table settles hle_fallback from this run, not required","status":"applied","system":"sony-playstation"} +{"content":"Bust-A-Move 2 - Arcade Edition (USA)","core":{"file":"swanstation_libretro.so","library_version":"1.0.0 631f0fb","sha256":"fc65bb2d662c3ad762b611a62ac578f78efd260431d3b8c090f0eb40887a77ea"},"emulator":"swanstation","evidence":["2026-10-27-f9363c9e87f6","2026-10-27-97e674b2e56e"],"field":"validation","file":"scph5501.bin","found_at":"2026-10-28T07:17:48+00:00","id":"2026-10-28-15b35fbe2651","key":"swanstation/sony-playstation/scph5501.bin/validation","profile_says":["size","md5"],"reason":"With the default option the core opens scph5501.bin by name through LoadImageFromFile, which checks only the size (host_interface.cpp:124-133, bios.cpp:82-105, libretro_core_options.h:110-123). The md5 is read only by the directory scan (host_interface.cpp:136-193) and the Fast Boot patch (bios.cpp:142-146). validation: [size] and found_by: name.","rule":"validation_contradicted","run_shows":{"content":false,"size":true},"schema_version":1,"statement":"the core does not check the content and checks the size of scph5501.bin: a same-size file of zeros is run, the profile declares validation ['md5', 'size']","status":"applied","system":"sony-playstation"}