feat: profile the Batocera and Recalbox LRPS2

Batocera 43.1 builds libretro/ps2 at 416291a with 001.bios-dir.patch and
Recalbox 10.1.1 builds it at 9485a53 with 0001-recalbox-paths.patch. Both
patches move the BIOS scan from pcsx2/bios to ps2, and Recalbox also moves
the data root to system/ps2. Each build gets its own built_by profile:
lrps2-416291a under Batocera's pcsx2 name, lrps2-9485a53 under Recalbox's
ps2 name.

A platform's own build now answers for its own build mode only on a
dual_mode_cores name, so Batocera keeps standalone PCSX2 beside its
libretro build.
This commit is contained in:
Abdessamad Derraz committed 2026-11-10 11:38:03 +01:00
1 parent d457948143
commit 7cb0e67eb6
5 files changed
+371 -4

No files matched your search

+45
View File
@@ -160,5 +160,50 @@ class APlatformsOwnBuildWinsItsName(unittest.TestCase):
self.assertEqual(resolve_platform_cores(retropie, profiles), {"uae4all"})
class APatchedLibretroBuildTakesItsNameOnly(unittest.TestCase):
"""Batocera and Recalbox compile LRPS2 with a patch that reads the BIOS
from ps2/ instead of pcsx2/bios/. Their own build replaces the buildbot
LRPS2 under the name they ship, and Batocera's standalone PCSX2, under
the same name, stays."""
def test_own_libretro_build_keeps_the_standalone_of_a_dual_name(self):
from common import resolve_platform_cores
profiles = {
"pcsx2": {"type": "standalone", "source": "s", "cores": ["pcsx2"]},
"lrps2": {"type": "libretro", "source": "l", "cores": ["lrps2", "pcsx2"]},
"lrps2-own": {"type": "libretro", "source": "l", "cores": ["pcsx2"],
"built_by": ["x"]},
}
config = {"_key": "x", "cores": ["pcsx2"], "standalone_cores": ["pcsx2"],
"dual_mode_cores": ["pcsx2"]}
self.assertEqual(resolve_platform_cores(config, profiles), {"pcsx2", "lrps2-own"})
del config["dual_mode_cores"]
self.assertEqual(resolve_platform_cores(config, profiles), {"lrps2-own"})
def test_the_registry_resolves_each_platform_build(self):
from common import load_emulator_profiles, load_platform_config, resolve_platform_cores
profiles = load_emulator_profiles(str(REPO_ROOT / "emulators"))
platforms = str(REPO_ROOT / "platforms")
def ps2_cores(platform: str) -> set[str]:
config = load_platform_config(platform, platforms)
return {
c for c in resolve_platform_cores(config, profiles)
if c.startswith(("lrps2", "pcsx2", "pcee2"))
}
self.assertEqual(ps2_cores("batocera"), {"lrps2-416291a", "pcsx2", "pcee2"})
self.assertEqual(ps2_cores("recalbox"), {"lrps2-9485a53", "pcsx2"})
for platform in ("retroarch", "retrobat", "emudeck", "retrodeck"):
with self.subTest(platform=platform):
cores = ps2_cores(platform)
self.assertIn("lrps2", cores)
self.assertFalse({"lrps2-416291a", "lrps2-9485a53"} & cores)
self.assertEqual(profiles["lrps2-416291a"]["files"][0]["path"], "ps2/<bios>.bin")
self.assertEqual(profiles["lrps2-9485a53"]["files"][0]["path"], "ps2/<bios>.bin")
if __name__ == "__main__":
unittest.main()