fix: let taiwan and asia-ntsc answer each other

kronos tags the ST-V BIOS epr-19854.ic8 taiwan, mednafen_stv tags it
asia-ntsc, the SMPC area Mednafen names for Taiwan (ss.cpp:1119,
2363-2364). As siblings under asia they never matched, so a request in
one spelling dropped the file tagged in the other, and --region
taiwan,us dropped the Saturn sega_101.bin. AREA_TERRITORIES relates
each area to the territory it serves, china for asia-pal included, in
region.py and its installer copy.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 05:20:08 +02:00
1 parent e318bb4503
commit 7bcd41e0c4
7 files changed
+56 -8

No files matched your search

+20 -2
View File
@@ -47,6 +47,17 @@ REGION_TREE: dict[str, frozenset[str]] = {
"oceania": frozenset({"australia", "new-zealand"}),
}
# Hardware areas that fuse territory and signal standard, with the territories
# the code serves through them. Mednafen's Saturn SMPC area 0x2 is "For TAIWAN
# and PHILIPINES" and its area option offers it as "Taiwan", area 0xA as
# "China" (mednafen/ss/ss.cpp:1119, 2363-2364 in the mednafen_stv port).
# kronos tags the ST-V BIOS epr-19854.ic8 taiwan and mednafen_stv tags it
# asia-ntsc: a request in either spelling has to reach the other.
AREA_TERRITORIES: dict[str, frozenset[str]] = {
"asia-ntsc": frozenset({"taiwan"}),
"asia-pal": frozenset({"china"}),
}
_PARENT: dict[str, str] = {
member: parent for parent, members in REGION_TREE.items() for member in members
}
@@ -96,8 +107,15 @@ def _canonical(raw: str) -> str:
def comparable(a: str, b: str) -> bool:
"""True when two regions are equal or in a parent/child relation."""
return a == b or _PARENT.get(a) == b or _PARENT.get(b) == a
"""True when two regions are equal, parent and child, or an area and a
territory it serves."""
return (
a == b
or _PARENT.get(a) == b
or _PARENT.get(b) == a
or a in AREA_TERRITORIES.get(b, ())
or b in AREA_TERRITORIES.get(a, ())
)
def normalize_declared(raw: str | list | None) -> set[str]: