From a08827257d2c8c8f0360ee841617582a5fed4fa7 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sun, 18 Oct 2026 14:48:14 +0200 Subject: [PATCH] fix: tag regions by the branch the code takes Mega CD US BIOS serves every non-EU, non-JP disc; Dolphin boots Korean discs from the JAP directory; Beetle never opens scph5903.bin under that name. --- emulators/beetle_psx.yml | 2 +- emulators/dolphin-mmjr.yml | 2 +- emulators/dolphin-mmjr2.yml | 2 +- emulators/dolphin.yml | 2 +- emulators/genesis_plus_gx.yml | 4 +- emulators/genesis_plus_gx_wide.yml | 2 +- emulators/ishiiruka.yml | 2 +- emulators/picodrive.yml | 10 ++--- emulators/primehack.yml | 2 +- emulators/triforce.yml | 4 +- install/batocera.json | 22 +++++----- install/bizhawk.json | 10 ++--- install/emudeck.json | 8 ++-- install/lakka.json | 13 +++--- install/recalbox.json | 32 +++++++++------ install/retroarch.json | 13 +++--- install/retrobat.json | 18 ++++---- install/retrodeck.json | 16 ++++---- install/retropie.json | 13 +++--- install/rocknix.json | 21 +++++----- install/romm.json | 16 ++++---- tests/test_region.py | 66 ++++++++++++++++++++++++++++++ 22 files changed, 176 insertions(+), 104 deletions(-) diff --git a/emulators/beetle_psx.yml b/emulators/beetle_psx.yml index 9e27f549..35cb4d15 100644 --- a/emulators/beetle_psx.yml +++ b/emulators/beetle_psx.yml @@ -45,8 +45,8 @@ files: - name: "scph5903.bin" description: "SCPH-5903 (System ROM Version 2.2 12/04/95 J), Video CD daughterboard" - region: [japan] required: false + note: "No code path opens this name: the Japanese name list and the SHA-1 scan look for scph5500.bin (libretro.c:594-602, 486-490). Copied as scph5500.bin it loads with a SHA-1 warning (libretro.c:680-687) and enables the Video CD daughterboard." size: 1048576 sha1: "15c94da3cc5a38a582429575af4198c487fe893c" md5: "81328b966e6dcf7ea1e32e55e1c104bb" diff --git a/emulators/dolphin-mmjr.yml b/emulators/dolphin-mmjr.yml index 7789f9f0..ca3a1cf7 100644 --- a/emulators/dolphin-mmjr.yml +++ b/emulators/dolphin-mmjr.yml @@ -111,7 +111,7 @@ files: system: nintendo-gamecube required: false hle_fallback: true - region: [japan] + region: [japan, south-korea] size: 2097152 crc32: ["6dac1f2a", "d5e6feea", "86573808", "667d0b64"] validation: [crc32] diff --git a/emulators/dolphin-mmjr2.yml b/emulators/dolphin-mmjr2.yml index 9691c5f4..929bc9d6 100644 --- a/emulators/dolphin-mmjr2.yml +++ b/emulators/dolphin-mmjr2.yml @@ -147,7 +147,7 @@ files: system: nintendo-gamecube required: false hle_fallback: true - region: [japan] + region: [japan, south-korea] size: 2097152 crc32: ["6dac1f2a", "d5e6feea", "86573808", "667d0b64"] validation: [crc32] diff --git a/emulators/dolphin.yml b/emulators/dolphin.yml index da1e02f5..c0d1ed70 100644 --- a/emulators/dolphin.yml +++ b/emulators/dolphin.yml @@ -58,7 +58,7 @@ files: - name: "IPL.bin" path: "dolphin-emu/Sys/GC/JAP/IPL.bin" standalone_path: "GC/JAP/IPL.bin" - region: [japan] + region: [japan, south-korea] size: 2097152 required: false hle_fallback: true diff --git a/emulators/genesis_plus_gx.yml b/emulators/genesis_plus_gx.yml index d6f4389b..f88cf856 100644 --- a/emulators/genesis_plus_gx.yml +++ b/emulators/genesis_plus_gx.yml @@ -40,9 +40,9 @@ files: # ------------------------------------------------------- - name: bios_CD_U.bin system: sega-megacd - region: [north-america] + region: [north-america, latin-america] required: true - note: "Sega CD (NTSC-U) boot ROM. Loaded for REGION_USA." + note: "Sega CD (NTSC-U) boot ROM. Loaded for REGION_USA, which get_region sets for every disc whose security byte is neither 0x64 (Europe) nor 0xa1 (Japan) (core/loadrom.c:1065-1078)." source_ref: "core/loadrom.c:409" - name: bios_CD_E.bin diff --git a/emulators/genesis_plus_gx_wide.yml b/emulators/genesis_plus_gx_wide.yml index 3d57f035..9e054c0d 100644 --- a/emulators/genesis_plus_gx_wide.yml +++ b/emulators/genesis_plus_gx_wide.yml @@ -27,7 +27,7 @@ notes: | files: - name: bios_CD_U.bin system: sega-megacd - region: [north-america] + region: [north-america, latin-america] required: true size: 131072 source_ref: "core/loadrom.c:408" diff --git a/emulators/ishiiruka.yml b/emulators/ishiiruka.yml index 4c060709..9bde54d2 100644 --- a/emulators/ishiiruka.yml +++ b/emulators/ishiiruka.yml @@ -55,7 +55,7 @@ files: - name: "IPL.bin" path: "dolphin-emu/Sys/GC/JAP/IPL.bin" standalone_path: "GC/JAP/IPL.bin" - region: [japan] + region: [japan, south-korea] size: 2097152 required: false hle_fallback: true diff --git a/emulators/picodrive.yml b/emulators/picodrive.yml index dadd71c1..4b9c1c75 100644 --- a/emulators/picodrive.yml +++ b/emulators/picodrive.yml @@ -65,17 +65,17 @@ files: - name: "us_scd2_9306.bin" system: sega-megacd variant_group: "mega-cd-bios" - region: [north-america] + region: [north-america, latin-america] priority: 1 required: true size: 131072 # 128 KB (0x20000) - note: "US Sega CD Model 2 BIOS (September 1993). First in US search order." + note: "US Sega CD Model 2 BIOS (September 1993). First in US search order. The US list serves every disc whose security byte is neither 0x64 nor 0xa1 (pico/cd/cd_image.c:190, 247-248)." source_ref: "platform/libretro/libretro.c:1273" - name: "SegaCDBIOS9303.bin" system: sega-megacd variant_group: "mega-cd-bios" - region: [north-america] + region: [north-america, latin-america] priority: 2 required: false size: 131072 @@ -85,7 +85,7 @@ files: - name: "us_scd1_9210.bin" system: sega-megacd variant_group: "mega-cd-bios" - region: [north-america] + region: [north-america, latin-america] priority: 3 required: false size: 131072 @@ -95,7 +95,7 @@ files: - name: "bios_CD_U.bin" system: sega-megacd variant_group: "mega-cd-bios" - region: [north-america] + region: [north-america, latin-america] priority: 4 required: false size: 131072 diff --git a/emulators/primehack.yml b/emulators/primehack.yml index 618ac3b6..d1451314 100644 --- a/emulators/primehack.yml +++ b/emulators/primehack.yml @@ -52,7 +52,7 @@ files: - name: "IPL.bin" path: "GC/JAP/IPL.bin" - region: [japan] + region: [japan, south-korea] size: 2097152 required: false hle_fallback: true diff --git a/emulators/triforce.yml b/emulators/triforce.yml index ddfa19ec..7377e103 100644 --- a/emulators/triforce.yml +++ b/emulators/triforce.yml @@ -141,7 +141,7 @@ files: path: "GC/JAP/IPL_TRI.bin" description: "Triforce boot ROM, NTSC-J directory" system: sega-triforce - region: [japan] + region: [japan, south-korea] size: 2097152 crc32: "d1883221" validation: [crc32] @@ -214,7 +214,7 @@ files: - name: "IPL.bin" path: "GC/JAP/IPL.bin" description: "GameCube NTSC-J boot ROM" - region: [japan] + region: [japan, south-korea] size: 2097152 required: false hle_fallback: true diff --git a/install/batocera.json b/install/batocera.json index c78f7788..29e0d300 100644 --- a/install/batocera.json +++ b/install/batocera.json @@ -8954,7 +8954,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/EUR/IPL.bin" @@ -8992,7 +8993,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/JAP/IPL.bin" @@ -9030,7 +9032,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/USA/IPL.bin" @@ -9750,6 +9753,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -11445,12 +11449,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -137884,6 +137882,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -137904,6 +137903,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -137924,6 +137924,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -140944,7 +140945,8 @@ "triforce" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:dolphin-emu/Sys/GC/JAP/IPL.bin" diff --git a/install/bizhawk.json b/install/bizhawk.json index 57c376f2..4b62be71 100644 --- a/install/bizhawk.json +++ b/install/bizhawk.json @@ -2259,12 +2259,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -8213,6 +8207,7 @@ "picodrive" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -10418,6 +10413,7 @@ "picodrive" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -10435,6 +10431,7 @@ "picodrive" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -10452,6 +10449,7 @@ "picodrive" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ diff --git a/install/emudeck.json b/install/emudeck.json index 04fd4ec7..df306c7a 100644 --- a/install/emudeck.json +++ b/install/emudeck.json @@ -5,7 +5,7 @@ "platform": "emudeck", "display_name": "EmuDeck", "version": "1.0", - "generated": "2026-10-18T06:45:25Z", + "generated": "2026-10-18T11:24:19Z", "base_destination": "bios", "detect": [ { @@ -752,7 +752,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_system_groups": [ "nintendo-gamecube" @@ -7362,7 +7363,8 @@ "nintendo-gamecube" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/JAP/IPL.bin" diff --git a/install/lakka.json b/install/lakka.json index 95d0ac4f..bd0783db 100644 --- a/install/lakka.json +++ b/install/lakka.json @@ -6038,7 +6038,8 @@ "nintendo-gamecube" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:dolphin-emu/Sys/GC/JAP/IPL.bin" @@ -9181,6 +9182,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -13121,12 +13123,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -67219,6 +67215,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -67239,6 +67236,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -67259,6 +67257,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ diff --git a/install/recalbox.json b/install/recalbox.json index f615ad65..de0712e6 100644 --- a/install/recalbox.json +++ b/install/recalbox.json @@ -4653,7 +4653,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_system_groups": [ "nintendo-gamecube" @@ -4673,7 +4674,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_system_groups": [ "nintendo-gamecube" @@ -4693,7 +4695,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_system_groups": [ "nintendo-gamecube" @@ -5658,6 +5661,7 @@ "sega-mega-drive" ], "regions": [ + "latin-america", "north-america" ], "region_system_groups": [ @@ -7560,12 +7564,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -36793,6 +36791,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -36813,6 +36812,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -36833,6 +36833,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -38734,7 +38735,8 @@ "nintendo-gamecube" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:dolphin-emu/Sys/GC/JAP/IPL.bin" @@ -38756,7 +38758,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/USA/IPL.bin" @@ -38778,7 +38781,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/EUR/IPL.bin" @@ -38800,7 +38804,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/JAP/IPL.bin" @@ -39222,6 +39227,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ diff --git a/install/retroarch.json b/install/retroarch.json index a3243acc..34e70744 100644 --- a/install/retroarch.json +++ b/install/retroarch.json @@ -6157,7 +6157,8 @@ "nintendo-gamecube" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:dolphin-emu/Sys/GC/JAP/IPL.bin" @@ -9300,6 +9301,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -13240,12 +13242,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -67403,6 +67399,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -67423,6 +67420,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -67443,6 +67441,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ diff --git a/install/retrobat.json b/install/retrobat.json index f189aa62..0c40aab3 100644 --- a/install/retrobat.json +++ b/install/retrobat.json @@ -5916,6 +5916,7 @@ "megacd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -9787,12 +9788,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -70493,7 +70488,8 @@ "triforce" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "triforce" @@ -75122,7 +75118,8 @@ "triforce" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:dolphin-emu/Sys/GC/JAP/IPL.bin" @@ -75235,7 +75232,8 @@ "triforce" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/JAP/IPL.bin" @@ -85260,6 +85258,7 @@ "megacd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -85280,6 +85279,7 @@ "megacd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ diff --git a/install/retrodeck.json b/install/retrodeck.json index 204875d0..287d511e 100644 --- a/install/retrodeck.json +++ b/install/retrodeck.json @@ -26064,6 +26064,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_system_groups": [ @@ -28809,12 +28810,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -76773,7 +76768,8 @@ "triforce" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/JAP/IPL.bin" @@ -78558,7 +78554,8 @@ "ishiiruka" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Ishiiruka:file:dolphin-emu/Sys/GC/JAP/IPL.bin" @@ -82785,6 +82782,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -82805,6 +82803,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -82825,6 +82824,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ diff --git a/install/retropie.json b/install/retropie.json index ba7c1512..3670b461 100644 --- a/install/retropie.json +++ b/install/retropie.json @@ -7101,7 +7101,8 @@ "nintendo-gamecube" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:dolphin-emu/Sys/GC/JAP/IPL.bin" @@ -10245,6 +10246,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -14207,12 +14209,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -107870,6 +107866,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -107890,6 +107887,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -107910,6 +107908,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ diff --git a/install/rocknix.json b/install/rocknix.json index 885107f7..2dcf635b 100644 --- a/install/rocknix.json +++ b/install/rocknix.json @@ -1246,7 +1246,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/EUR/IPL.bin" @@ -1280,7 +1281,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/JAP/IPL.bin" @@ -1314,7 +1316,8 @@ "europe", "japan", "north-america", - "oceania" + "oceania", + "south-korea" ], "region_groups": [ "Dolphin:file:GC/USA/IPL.bin" @@ -1569,6 +1572,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -2416,12 +2420,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -59806,6 +59804,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -59826,6 +59825,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -62949,7 +62949,8 @@ "nintendo-gamecube" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:dolphin-emu/Sys/GC/JAP/IPL.bin" diff --git a/install/romm.json b/install/romm.json index a4ce77c6..12d0680f 100644 --- a/install/romm.json +++ b/install/romm.json @@ -3605,6 +3605,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_system_groups": [ @@ -5667,12 +5668,6 @@ ], "systems": [ "sony-playstation" - ], - "regions": [ - "japan" - ], - "region_groups": [ - "sony-playstation" ] }, { @@ -12866,7 +12861,8 @@ "nintendo-gamecube" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "Dolphin:file:ngc/dolphin-emu/Sys/GC/JAP/IPL.bin" @@ -13558,6 +13554,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -13578,6 +13575,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -13598,6 +13596,7 @@ "sega-mega-cd" ], "regions": [ + "latin-america", "north-america" ], "region_groups": [ @@ -13823,7 +13822,8 @@ "nintendo-gamecube" ], "regions": [ - "japan" + "japan", + "south-korea" ], "region_groups": [ "PrimeHack:file:ngc/GC/JAP/IPL.bin" diff --git a/tests/test_region.py b/tests/test_region.py index 8be6d0b7..eeedeb4c 100644 --- a/tests/test_region.py +++ b/tests/test_region.py @@ -963,5 +963,71 @@ class GenesisPlusGxUsBiosServesEurope(unittest.TestCase): self.assertNotIn("bios/bios_U.sms", drops) + +def _real_drops(profile: str, members: list[str], requested: str) -> set[str]: + from pathlib import Path + + from common import load_emulator_profiles + from region import build_region_index, parse_requested, resolve_region_drops + + root = Path(__file__).resolve().parents[1] + profiles = load_emulator_profiles(str(root / "emulators")) + index = build_region_index({profile: profiles[profile]}) + group = {"g": [(m, m.rsplit("/", 1)[-1]) for m in members]} + return resolve_region_drops(group, index, parse_requested(requested), None) + + +class MegaCdUsBiosIsTheDefaultBranch(unittest.TestCase): + """GPGX and PicoDrive load the US Mega CD BIOS for any disc whose + security byte is neither 0x64 nor 0xa1, Brazilian discs included: + --region brazil,jp dropped it and those discs found no BIOS.""" + + def test_brazil_keeps_the_us_bios(self): + cases = { + "genesis_plus_gx": ["bios_CD_U.bin", "bios_CD_E.bin", "bios_CD_J.bin"], + "genesis_plus_gx_wide": ["bios_CD_U.bin", "bios_CD_E.bin", "bios_CD_J.bin"], + "picodrive": ["us_scd2_9306.bin", "eu_mcd2_9306.bin", "jp_mcd2_921222.bin"], + } + for profile, members in cases.items(): + with self.subTest(profile=profile): + drops = _real_drops(profile, members, "brazil,jp") + self.assertNotIn(members[0], drops) + + +class KoreanGameCubeDiscsReadTheJapaneseIpl(unittest.TestCase): + """Dolphin's ToGameCubeRegion maps NTSC-K to NTSC-J, so a Korean disc + boots from GC/JAP/IPL.bin; --region south-korea,us dropped it.""" + + def test_korea_keeps_the_jap_ipl(self): + for profile in ("dolphin", "dolphin-mmjr", "dolphin-mmjr2", "ishiiruka", + "primehack", "triforce"): + with self.subTest(profile=profile): + from common import load_emulator_profiles + + entries = [ + f for f in load_emulator_profiles("emulators")[profile]["files"] + if "JAP/" in (f.get("path") or "") + ] + self.assertTrue(entries) + for entry in entries: + self.assertIn("south-korea", entry.get("region") or []) + + +class ANameNoCodeOpensCarriesNoRegion(unittest.TestCase): + """Beetle PSX never opens scph5903.bin: its Japanese list and scan want + scph5500.bin. Tagged japan, --region jp shipped a 1 MB file the core + does not read and --region us removed it, on a selection that does not + exist.""" + + def test_scph5903_is_unregioned(self): + from common import load_emulator_profiles + + entry = next( + f for f in load_emulator_profiles("emulators")["beetle_psx"]["files"] + if f["name"] == "scph5903.bin" + ) + self.assertNotIn("region", entry) + + if __name__ == "__main__": unittest.main()