fix: read libretro MAME sets in mame/bios

libretro/mame hands MAME the rompath <content folder>;<system>/mame/bios;
<system>/mame/roms (src/osd/libretro/libretro-internal/retro_init.cpp:580-597
at 5f5a0774, 573-579 at dc1a9653 for 0.258, 582-588 at fba50741 for 0.278,
CORE_NAME "mame" in libretro_shared.h). The system folder itself is never
searched, and every pack put the sets there. The mame, mame0258, mame0278,
mamearcade and mamemess profiles now lay their sets out in mame/bios, the
standalone build keeping the top of its rompath. The release profile writer
and the device and set merge write the same paths on new entries.

RetroBat offers MAME as the libretro core mame and as the standalone mame64
(es_systems.cfg), two names of one profile, and laid out only the
standalone build. A libretro name whose profile the platform also runs
standalone under another name now makes the profile dual mode.

Manifests: mame/bios gains 1453 sets on RetroArch, Lakka, RetroPie,
EmuDeck and RetroDECK, 1427 on Batocera, KNULLI, RetroBat, ROCKNIX,
AmberELEC and EmuELEC, 78 on Recalbox. Root copies only these cores
claimed leave: 1373 on RetroArch and Lakka, 1372 on RetroPie, 1349 on
ROCKNIX, 1347 on AmberELEC, 1365 on EmuELEC, 240 on RetroDECK, 26 on
EmuDeck, 9 on Recalbox. Batocera, KNULLI and RetroBat keep theirs for the
standalone rompath. RetroBat gains the libretro layout: mame/hash (725),
mame/samples/floppy (19) and mame/plugins (71). The root copies other cores
still claim now hold the copy those cores resolve (38 on RetroArch).
Recalbox drops three Arcade/Arcade copies (coh3002t, pumpitup, naomi2)
that only the root claim reached, mame/bios holding the copies with every
member the 0.258 and 0.278 sets list. No set is lost.
This commit is contained in:
Abdessamad Derraz committed 2026-11-10 14:03:41 +01:00
1 parent c69b31cfc0
commit 1b711b96f5
10 files changed
+1845 -5

No files matched your search

+23 -2
View File
@@ -578,8 +578,10 @@ def _append_new_entries(text: str, files: list[dict], original: str) -> str:
return text
lines = []
profile_type = str(existing_data.get("type") or "")
for fe in new_entries:
lines.append(f"\n - name: {_yaml_scalar(fe['name'])}")
lines.extend(set_path_lines(profile_type, fe["name"]))
lines.append(f" required: {str(fe['required']).lower()}")
lines.append(" category: bios_zip")
if fe.get("source_ref"):
@@ -715,10 +717,27 @@ def _rewrite_systems(section: str, systems: dict[str, list[str]]) -> str:
return "\n".join(out)
def _format_device_entry(name: str, device: dict, role: str) -> str:
def set_path_lines(profile_type: str, name: str) -> list[str]:
"""Where each build of a MAME profile reads a set it lists.
The libretro build searches the content folder, then <system>/mame/bios
and <system>/mame/roms (libretro-internal/retro_init.cpp,
Set_Path_Option), never the system folder itself. The standalone build
reads the top of its rompath.
"""
if "libretro" not in profile_type:
return []
lines = [f' path: "mame/bios/{name}"']
if "standalone" in profile_type:
lines.append(f' standalone_path: "{name}"')
return lines
def _format_device_entry(name: str, device: dict, role: str, profile_type: str = "") -> str:
"""One generated device entry, in the field order of the written ones."""
lines = [
f" - name: {_zip_scalar(name)}",
*set_path_lines(profile_type, name),
" required: false",
" category: bios_zip",
*_system_lines(device.get("systems") or []),
@@ -779,7 +798,9 @@ def merge_mame_devices(
name = f"{set_name}.zip"
existing = entries.get(name)
if not existing:
new_blocks[name] = _format_device_entry(name, device, role)
new_blocks[name] = _format_device_entry(
name, device, role, str(profile.get("type") or "")
)
report["added"].append(set_name)
continue
if any(e.get("category") != "bios_zip" for e in existing):
+4
View File
@@ -453,6 +453,10 @@ def release_profile(
name = f"{set_name}.zip"
entry: dict[str, Any] = {
"name": name,
# The libretro build searches the content folder, then
# <system>/mame/bios and <system>/mame/roms (retro_init.cpp,
# Set_Path_Option): the system folder itself is not read.
"path": f"mame/bios/{name}",
"required": settled_required(known.get(name, {}), data),
"category": "bios_zip",
}