From 8931d738dcc1fa258eaee5ba86bc691f5309f0e1 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 21 Oct 2026 05:11:36 +0200 Subject: [PATCH] fix: read fbalpha2012 hiscore.dat from save dir HiscoreInit opens /hiscore.dat (hiscore.cpp:411). Without load_from the entry was packed at bios/hiscore.dat and took the slot mame2000 reads on RetroDECK, which now gets its sha1-pinned file. --- emulators/fbalpha2012.yml | 1 + emulators/fbalpha2012_cps3.yml | 1 + tests/test_profile_checks.py | 17 +++++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/emulators/fbalpha2012.yml b/emulators/fbalpha2012.yml index c303790b..3fe7320c 100644 --- a/emulators/fbalpha2012.yml +++ b/emulators/fbalpha2012.yml @@ -56,6 +56,7 @@ notes: | files: - name: "hiscore.dat" description: "High score persistence database" + load_from: save_dir required: false system: arcade source_ref: "svn-current/trunk/src/burn/hiscore.cpp:386-394, 411, svn-current/trunk/src/burn/burn.cpp:619" diff --git a/emulators/fbalpha2012_cps3.yml b/emulators/fbalpha2012_cps3.yml index 39489064..5e835ce7 100644 --- a/emulators/fbalpha2012_cps3.yml +++ b/emulators/fbalpha2012_cps3.yml @@ -54,6 +54,7 @@ notes: | files: - name: "hiscore.dat" description: "High score persistence database" + load_from: save_dir required: false source_ref: "svn-current/trunk/src/burn/hiscore.cpp:116-118" note: "Loaded from save directory (g_save_dir)" diff --git a/tests/test_profile_checks.py b/tests/test_profile_checks.py index 2e528be2..c9522dbf 100644 --- a/tests/test_profile_checks.py +++ b/tests/test_profile_checks.py @@ -360,5 +360,22 @@ class ClkMasterSystemBios(unittest.TestCase): self.assertEqual(drops, {"MasterSystem/japanese-bios.sms"}) +class FbAlpha2012HiscoreFromSaveDir(unittest.TestCase): + """HiscoreInit opens /hiscore.dat in the libretro build + (svn-current/trunk/src/burn/hiscore.cpp:411 at 0ce31536, and :116 of the + CPS-3 core at 57f8015c). Read as a system file, the entry took the + bios/hiscore.dat slot that MAME cores read on RetroDECK and RetroBat.""" + + def test_hiscore_is_not_a_system_file(self): + from validation import read_from_system_dir + + for emulator in ("fbalpha2012", "fbalpha2012_cps3"): + with self.subTest(emulator=emulator): + entry = next( + f for f in _profile(emulator)["files"] if f["name"] == "hiscore.dat" + ) + self.assertFalse(read_from_system_dir(entry)) + + if __name__ == "__main__": unittest.main()