From 355939d1d90f5ea828e896097f541f4d0fe2b5db Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sat, 17 Oct 2026 19:11:51 +0200 Subject: [PATCH] fix: align three region tags with their code --- emulators/clk.yml | 2 +- emulators/kronos.yml | 3 ++- emulators/mednafen_stv.yml | 2 +- emulators/saturn-emu.yml | 4 ++-- tests/test_region.py | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 5 deletions(-) diff --git a/emulators/clk.yml b/emulators/clk.yml index e78e38e7..779012c3 100644 --- a/emulators/clk.yml +++ b/emulators/clk.yml @@ -708,7 +708,7 @@ files: path: MasterSystem/bios.sms system: sega-mastersystem description: "European/US Master System BIOS" - region: [north-america, europe, brazil] + region: [north-america, europe, oceania, brazil] size: 8192 crc32: "0072ed54" required: false diff --git a/emulators/kronos.yml b/emulators/kronos.yml index f760bac9..b07e2509 100644 --- a/emulators/kronos.yml +++ b/emulators/kronos.yml @@ -158,8 +158,9 @@ files: - name: "epr-17954a.ic8" archive: stvbios.zip system: sega-stv + region: [europe] required: false - note: "Picked by the kronos_stv_favorite_region option, Europe by default, among the BIOS regions the set accepts (yabause/src/ctrl/src/stv.c:2435, 2562-2564)." + note: "Loaded only when the set allows STV_REGION_EU; among allowed regions the kronos_stv_favorite_region option, Europe by default, picks (yabause/src/ctrl/src/stv.c:2435, 2562-2564)." size: 524288 crc32: "f7722da3" validation: [crc32] diff --git a/emulators/mednafen_stv.yml b/emulators/mednafen_stv.yml index 788b2110..50a82680 100644 --- a/emulators/mednafen_stv.yml +++ b/emulators/mednafen_stv.yml @@ -97,7 +97,7 @@ files: source_ref: "libretro/libretro.cpp:640, mednafen/ss/ss.cpp:1449-1450, 1507, 1520-1521" - name: "mpr-17933.bin" system: "sega-saturn" - region: [north-america, latin-america, brazil, south-korea, asia-pal, europe] + region: [north-america, latin-america, brazil, south-korea, asia-pal, europe, oceania] required: true size: 524288 sha256: "96e106f740ab448cf89f0dd49dfbac7fe5391cb6bd6e14ad5e3061c13330266f" diff --git a/emulators/saturn-emu.yml b/emulators/saturn-emu.yml index 86d987ba..4c23b59c 100644 --- a/emulators/saturn-emu.yml +++ b/emulators/saturn-emu.yml @@ -131,7 +131,7 @@ files: system: sega-saturn description: "Saturn BIOS read for every area outside Japan and Asia NTSC" required: true - region: [north-america, europe, south-korea, asia-pal, brazil, latin-america] + region: [north-america, europe, oceania, south-korea, asia-pal, brazil, latin-america] size: 524288 sha256: "96e106f740ab448cf89f0dd49dfbac7fe5391cb6bd6e14ad5e3061c13330266f" validation: [existence, size, sha256] @@ -175,7 +175,7 @@ files: system: sega-saturn description: "Saturn BIOS v1.00a, accepted for every area outside Japan and Asia NTSC" required: false - region: [north-america, europe, south-korea, asia-pal, brazil, latin-america] + region: [north-america, europe, oceania, south-korea, asia-pal, brazil, latin-america] size: 524288 sha256: "87293093fad802fcff31fcab427a16caff1acbc5184899b8383b360fd58efb73" validation: [existence, size, sha256] diff --git a/tests/test_region.py b/tests/test_region.py index 124a3972..c2c06a91 100644 --- a/tests/test_region.py +++ b/tests/test_region.py @@ -428,6 +428,38 @@ class TestFallbackGroups(unittest.TestCase): self.assertEqual(region.fallback_groups(groups, self.index, []), []) +class OneCodeOneRegionAnswer(unittest.TestCase): + """mednafen, beetle_saturn, saturn-emu and mednafen_stv read the same + ss.cpp, where area E (Australia included) selects the PAL BIOS: only + two of them answered oceania. CLK and Kronos are pinned here too.""" + + PROFILES = os.path.join(os.path.dirname(__file__), "..", "emulators") + + def test_the_mednafen_saturn_profiles_agree(self): + profiles = common.load_emulator_profiles(self.PROFILES) + seen: dict[str, dict[str, frozenset]] = {} + for name in ("mednafen", "beetle_saturn", "saturn-emu", "mednafen_stv"): + for entry in profiles[name]["files"]: + if entry["name"] in ("mpr-17933.bin", "sega_100a.bin"): + seen.setdefault(entry["name"], {})[name] = frozenset( + entry.get("region") or () + ) + for file_name, tags in seen.items(): + with self.subTest(file=file_name): + self.assertEqual(len(set(tags.values())), 1, tags) + self.assertIn("oceania", next(iter(tags.values()))) + + def test_export_cartridges_and_allowed_regions(self): + 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"]) + tagged = { + e["name"]: e.get("region") for e in profiles["kronos"]["files"] + if e.get("archive") == "stvbios.zip" and e["name"].startswith("epr-") + } + self.assertTrue(all(tagged.values()), tagged) + + class AustraliaReadsThePalIpl(unittest.TestCase): """Dolphin files the Australian country code U under Region::PAL (Source/Core/DiscIO/Enums.cpp), whose IPL is GC/EUR. Tagged [europe]