mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-20 10:23:16 -05:00
fix: an untagged bios serves every region
This commit is contained in:
1 parent
9304931845
commit
908d75a86c
2 files changed
+20
-5
No files matched your search
+14
-5
@@ -255,16 +255,25 @@ def fallback_groups(
|
|||||||
index: dict[str, dict],
|
index: dict[str, dict],
|
||||||
requested: list[str],
|
requested: list[str],
|
||||||
) -> list[str]:
|
) -> list[str]:
|
||||||
"""Group IDs where no candidate matched, so the whole group was kept."""
|
"""Group IDs where no candidate matched, so the whole group was kept.
|
||||||
|
|
||||||
|
A world file, or one that declares no region at all, answers every
|
||||||
|
region: the C64 kernal VICE loads by default is untagged, and a group
|
||||||
|
holding it beside a Japanese and a Swedish kernal does have a BIOS for
|
||||||
|
North America.
|
||||||
|
"""
|
||||||
if not requested:
|
if not requested:
|
||||||
return []
|
return []
|
||||||
out: list[str] = []
|
out: list[str] = []
|
||||||
for group_id, members in groups.items():
|
for group_id, members in groups.items():
|
||||||
ranked = _competing_ranks(members, index, requested)
|
ranked = _competing_ranks(members, index, requested)
|
||||||
has_world = any(
|
served = any(
|
||||||
WORLD in lookup_regions(index, destination, name)
|
not regions or WORLD in regions
|
||||||
for destination, name in members
|
for regions in (
|
||||||
|
lookup_regions(index, destination, name)
|
||||||
|
for destination, name in members
|
||||||
|
)
|
||||||
)
|
)
|
||||||
if ranked and not has_world and min(r for r, _ in ranked) == len(requested):
|
if ranked and not served and min(r for r, _ in ranked) == len(requested):
|
||||||
out.append(group_id)
|
out.append(group_id)
|
||||||
return sorted(out)
|
return sorted(out)
|
||||||
@@ -355,6 +355,12 @@ class TestFallbackGroups(unittest.TestCase):
|
|||||||
region.fallback_groups(groups, self.index, ["north-america"]), ["fds"]
|
region.fallback_groups(groups, self.index, ["north-america"]), ["fds"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_an_untagged_bios_answers_every_region(self):
|
||||||
|
"""VICE's generic kernal is untagged beside its Japanese one: the C64
|
||||||
|
was reported as having no BIOS for North America."""
|
||||||
|
groups = {"fds": [("disksys.rom", "disksys.rom"), ("generic.rom", "generic.rom")]}
|
||||||
|
self.assertEqual(region.fallback_groups(groups, self.index, ["north-america"]), [])
|
||||||
|
|
||||||
def test_no_requested_regions_reports_nothing(self):
|
def test_no_requested_regions_reports_nothing(self):
|
||||||
groups = {"fds": [("disksys.rom", "disksys.rom")]}
|
groups = {"fds": [("disksys.rom", "disksys.rom")]}
|
||||||
self.assertEqual(region.fallback_groups(groups, self.index, []), [])
|
self.assertEqual(region.fallback_groups(groups, self.index, []), [])
|
||||||
|
|||||||
Reference in new issue
Block a user