From 34ef0cda1dcd7ed52ba4c9aca09776c54b509da8 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:51:53 +0100 Subject: [PATCH] fix: clk western sms bios answers latin america CLK reads every export cartridge as Europe or USA and boots the western BIOS for any region but Japan (StaticAnalyser.cpp:49-66, MasterSystem.cpp:137-140). The tag named brazil without its parent, so --region mx dropped the BIOS from the Batocera pack. --- emulators/clk.yml | 4 ++-- tests/test_region.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/emulators/clk.yml b/emulators/clk.yml index a0259ca14..63fc82aef 100644 --- a/emulators/clk.yml +++ b/emulators/clk.yml @@ -712,12 +712,12 @@ files: path: MasterSystem/bios.sms system: sega-mastersystem description: "European/US Master System BIOS" - region: [north-america, europe, oceania, brazil] + region: [north-america, latin-america, europe, oceania] size: 8192 crc32: "0072ed54" required: false note: "Optional. Boots cartridge directly if absent. Loaded for every region but Japan." - source_ref: "Machines/Utility/ROMCatalogue.cpp:764-771, Machines/MasterSystem/MasterSystem.cpp:137-140, Analyser/Static/Sega/Target.hpp:24-29" + source_ref: "Machines/Utility/ROMCatalogue.cpp:764-771, Machines/MasterSystem/MasterSystem.cpp:137-140, Analyser/Static/Sega/Target.hpp:24-29, Analyser/Static/Sega/StaticAnalyser.cpp:49-66" - name: japanese-bios.sms path: MasterSystem/japanese-bios.sms diff --git a/tests/test_region.py b/tests/test_region.py index 6669680ab..8cc861c9b 100644 --- a/tests/test_region.py +++ b/tests/test_region.py @@ -509,6 +509,11 @@ class OneCodeOneRegionAnswer(unittest.TestCase): profiles = common.load_emulator_profiles(self.PROFILES) bios_sms = next(e for e in profiles["clk"]["files"] if e["name"] == "bios.sms") self.assertIn("oceania", bios_sms["region"]) + # A Mexican export cartridge is analysed as Europe or USA and boots the + # western BIOS: only Japan selects the other one. + self.assertEqual( + region.rank(region.normalize_declared(bios_sms["region"]), ["mexico"]), 0 + ) tagged = { e["name"]: e.get("region") for e in profiles["kronos"]["files"] if e.get("archive") == "stvbios.zip" and e["name"].startswith("epr-")