fix: index the standalone layout for regions

GC/EUR/IPL.bin fell through to its bare name and the union of five regions, so a Batocera or standalone Dolphin pack never reduced it. The GameCube IPLs of four Dolphin-family profiles now name their system, as the MMJR profiles do.
This commit is contained in:
Abdessamad Derraz committed 2026-10-18 19:51:03 +02:00
1 parent 6c7f1c9d06
commit 7482cfefab
7 files changed
+37 -3

No files matched your search

+3
View File
@@ -38,6 +38,7 @@ files:
- name: "IPL.bin"
path: "dolphin-emu/Sys/GC/USA/IPL.bin"
standalone_path: "GC/USA/IPL.bin"
system: nintendo-gamecube
region: [north-america]
size: 2097152
required: false
@@ -48,6 +49,7 @@ files:
- name: "IPL.bin"
path: "dolphin-emu/Sys/GC/EUR/IPL.bin"
standalone_path: "GC/EUR/IPL.bin"
system: nintendo-gamecube
region: [europe, oceania]
size: 2097152
required: false
@@ -58,6 +60,7 @@ files:
- name: "IPL.bin"
path: "dolphin-emu/Sys/GC/JAP/IPL.bin"
standalone_path: "GC/JAP/IPL.bin"
system: nintendo-gamecube
region: [japan, south-korea]
size: 2097152
required: false
+3
View File
@@ -35,6 +35,7 @@ files:
- name: "IPL.bin"
path: "dolphin-emu/Sys/GC/USA/IPL.bin"
standalone_path: "GC/USA/IPL.bin"
system: nintendo-gamecube
region: [north-america]
size: 2097152
required: false
@@ -45,6 +46,7 @@ files:
- name: "IPL.bin"
path: "dolphin-emu/Sys/GC/EUR/IPL.bin"
standalone_path: "GC/EUR/IPL.bin"
system: nintendo-gamecube
region: [europe, oceania]
size: 2097152
required: false
@@ -55,6 +57,7 @@ files:
- name: "IPL.bin"
path: "dolphin-emu/Sys/GC/JAP/IPL.bin"
standalone_path: "GC/JAP/IPL.bin"
system: nintendo-gamecube
region: [japan, south-korea]
size: 2097152
required: false
+3
View File
@@ -34,6 +34,7 @@ files:
# Checked in User/GC/<region>/ then Sys/GC/<region>/
- name: "IPL.bin"
path: "GC/USA/IPL.bin"
system: nintendo-gamecube
region: [north-america]
size: 2097152
required: false
@@ -43,6 +44,7 @@ files:
- name: "IPL.bin"
path: "GC/EUR/IPL.bin"
system: nintendo-gamecube
region: [europe, oceania]
size: 2097152
required: false
@@ -52,6 +54,7 @@ files:
- name: "IPL.bin"
path: "GC/JAP/IPL.bin"
system: nintendo-gamecube
region: [japan, south-korea]
size: 2097152
required: false
+3
View File
@@ -195,6 +195,7 @@ files:
- name: "IPL.bin"
path: "GC/USA/IPL.bin"
description: "GameCube NTSC-U boot ROM"
system: nintendo-gamecube
region: [north-america]
size: 2097152
required: false
@@ -205,6 +206,7 @@ files:
- name: "IPL.bin"
path: "GC/EUR/IPL.bin"
description: "GameCube PAL boot ROM"
system: nintendo-gamecube
region: [europe, oceania]
size: 2097152
required: false
@@ -214,6 +216,7 @@ files:
- name: "IPL.bin"
path: "GC/JAP/IPL.bin"
description: "GameCube NTSC-J boot ROM"
system: nintendo-gamecube
region: [japan, south-korea]
size: 2097152
required: false
+4 -2
View File
@@ -181,9 +181,11 @@ def build_region_index(profiles: dict) -> dict[str, dict]:
path = f.get("path") or ""
# Path-keyed so same-named entries stay separate (Dolphin declares
# three IPL.bin), name-keyed so a candidate identified by name alone
# sees the union and is never dropped on ambiguity.
# sees the union and is never dropped on ambiguity. The standalone
# layout is a path of its own: GC/EUR/IPL.bin fell through to the
# bare name and its five-region union, and was never reduced.
priority = f.get("priority")
for key in {path, name} - {""}:
for key in {path, f.get("standalone_path") or "", name} - {""}:
entry = index.setdefault(
key,
{"regions": set(), "has_untagged": False, "emulators": [],
+2 -1
View File
@@ -60,7 +60,8 @@ def build_slot_index(profiles: dict) -> dict[str, dict]:
continue
name = f.get("name", "")
path = f.get("path") or ""
for key in {path, name} - {""}:
# Keyed by the standalone layout too, as build_region_index is.
for key in {path, f.get("standalone_path") or "", name} - {""}:
entry = index.setdefault(
key,
{"rank": None, "conflict": False, "regions": set(),
+19
View File
@@ -246,6 +246,25 @@ class TestRegionIndex(unittest.TestCase):
self.assertIn("x.bin", str(ctx.exception))
class TestStandaloneLayoutIsIndexed(unittest.TestCase):
"""GC/EUR/IPL.bin, Dolphin's standalone path, was looked up by its bare
name and got the union of five regions: never reduced in a Batocera
pack nor in --emulator dolphin --standalone."""
def test_the_standalone_path_carries_its_own_regions(self):
import slot
profiles = {"dolphin": {"files": [
{"name": "IPL.bin", "path": "dolphin-emu/Sys/GC/USA/IPL.bin",
"standalone_path": "GC/USA/IPL.bin", "region": ["north-america"]},
{"name": "IPL.bin", "path": "dolphin-emu/Sys/GC/EUR/IPL.bin",
"standalone_path": "GC/EUR/IPL.bin", "region": ["europe"]},
]}}
index = region.build_region_index(profiles)
self.assertEqual(region.lookup_regions(index, "GC/EUR/IPL.bin", "IPL.bin"), {"europe"})
self.assertIn("GC/EUR/IPL.bin", slot.build_slot_index(profiles))
class TestResolveRegionDrops(unittest.TestCase):
def setUp(self):
self.index = region.build_region_index(