mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-21 09:07:50 -06:00
fix: place xroar ROMs in each rompath
XRoar reads a ROM by name from the directories of rompath. The entries
take their file name as path, relative to ~/.xroar/roms or
${prefix}/share/xroar/roms, and rompath and -rompath are declared as
search lists.
Batocera records its rompath line, Recalbox -rompath bios/<system>
(the placeholder its extractor already writes), RetroBat its -rompath
as two records, bios/dragon and bios/coco for coco. An entry whose
name the platform list does not declare follows the launch its
profile system is listed under: Recalbox lists mc10.rom under
trs80coco, so alice.rom is read there.
Batocera ROMs move from the BIOS root to bios/xroar, Recalbox ROMs to
bios/dragon and bios/trs80coco, RetroBat ROMs to bios/dragon and
bios/coco. RetroDECK and RetroPie keep them at the BIOS root.
This commit is contained in:
1 parent
e6dbbe69ed
commit
8ec0c5482c
13 files changed
+279
-19
No files matched your search
@@ -2976,7 +2976,11 @@ def xroar(sources: dict[str, Source]) -> list[Record]:
|
||||
found = _argument_paths(src, "xroar", "standalone")
|
||||
if not found:
|
||||
raise LauncherPatternMissing(src.path, "rompath argument")
|
||||
records = [_with_conditions(record, conditions) for record, conditions in found]
|
||||
records = [
|
||||
split
|
||||
for record, conditions in found
|
||||
for split in _per_system(src, _with_conditions(record, conditions))
|
||||
]
|
||||
line = src.find(r'string (\w+) = ("rompath (?:[^"\\\n]|\\.)*");', "config rompath line")
|
||||
written = _unescape(line.group(2)[1:-1])
|
||||
relative = re.fullmatch(r'rompath "(.*)"', written)
|
||||
@@ -3003,6 +3007,37 @@ def xroar(sources: dict[str, Source]) -> list[Record]:
|
||||
return _covered(src, records)
|
||||
|
||||
|
||||
_SYSTEM_BRANCH = re.compile(r'(\S+), or (\S+) when system == "([\w.-]+)"')
|
||||
|
||||
|
||||
def _per_system(src: Source, record: Record) -> list[Record]:
|
||||
"""A directory chosen by the system, one record per choice.
|
||||
|
||||
`romPath = <a>; if (system == "coco") romPath = <b>;` renders as "<a>, or
|
||||
<b> when system == "coco"": <b> is passed for that system, <a> for every
|
||||
other one.
|
||||
"""
|
||||
rendered = str(record.get("search_dir", ""))
|
||||
branch = _SYSTEM_BRANCH.fullmatch(rendered)
|
||||
if branch is None:
|
||||
if " or " in rendered:
|
||||
raise LauncherPatternMissing(src.path, f"directory choice {rendered!r}")
|
||||
return [record]
|
||||
default, chosen, system = branch.groups()
|
||||
flag = str(record["passes_to"]).removesuffix(rendered).strip()
|
||||
out = []
|
||||
for directory, systems in ((default, None), (chosen, [system])):
|
||||
split = {k: v for k, v in record.items() if k != "source_ref"}
|
||||
split.update(
|
||||
names=list(record["names"]), search_dir=directory, passes_to=f"{flag} {directory}"
|
||||
)
|
||||
if systems:
|
||||
split["systems"] = systems
|
||||
split["source_ref"] = record["source_ref"]
|
||||
out.append(split)
|
||||
return out
|
||||
|
||||
|
||||
def pico8(sources: dict[str, Source]) -> list[Record]:
|
||||
"""The PICO-8 binary the generator runs, from an emulator folder.
|
||||
|
||||
|
||||
Reference in new issue
Block a user