mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-14 05:53:47 -06:00
feat: place retrobat's amiberry 8.3.0 roms
RetroBat writes rom_path and whdboot_path below its amiberry emulator folder and copies the kickstarts and rom.key it finds in bios into that ROMs folder. The copies and both folders are launcher records, and the 8.3.0 standalone entries go to the emulators tree where the build reads them.
This commit is contained in:
1 parent
96faec98a4
commit
577b654a9d
4 files changed
+364
No files matched your search
@@ -92,6 +92,38 @@ AMIBERRY = """
|
||||
var searchDirs = new List<string> { biosPath, Path.Combine(biosPath, "amiga"), Path.Combine(biosPath, "Amiga") };
|
||||
return null;
|
||||
}
|
||||
|
||||
public override ProcessStartInfo Generate(string system, string emulator, string core, string rom)
|
||||
{
|
||||
if (!GetEmulatorPathAndExe(emulator, out string path, out string exe, "Amiberry.exe", "amiberry.exe"))
|
||||
return null;
|
||||
}
|
||||
|
||||
private void SetupAmiberrySettings(string path, string system)
|
||||
{
|
||||
_amiberryRomsPath = Path.Combine(path, "ROMs");
|
||||
FileTools.TryCreateDirectory(_amiberryRomsPath);
|
||||
overrides["rom_path"] = _amiberryRomsPath;
|
||||
overrides["whdboot_path"] = Path.Combine(path, "WHDBoot");
|
||||
MergeConfLines(confFile, overrides);
|
||||
}
|
||||
|
||||
private void StageRomKey()
|
||||
{
|
||||
string source = FindBios(new[] { "rom.key" });
|
||||
string dest = Path.Combine(_amiberryRomsPath, "rom.key");
|
||||
if (!File.Exists(dest) || new FileInfo(dest).Length != new FileInfo(source).Length)
|
||||
File.Copy(source, dest, true);
|
||||
}
|
||||
|
||||
private string StageKickstart(string[] candidates)
|
||||
{
|
||||
string source = FindBios(candidates);
|
||||
string dest = Path.Combine(_amiberryRomsPath, candidates[0]);
|
||||
if (!dst.Exists || dst.Length != src.Length || dst.LastWriteTimeUtc < src.LastWriteTimeUtc)
|
||||
File.Copy(source, dest, true);
|
||||
return dest;
|
||||
}
|
||||
"""
|
||||
|
||||
MEDNAFEN = """
|
||||
@@ -353,6 +385,7 @@ class NamesInLauncherOrder(unittest.TestCase):
|
||||
|
||||
def test_amiberry_identical_lists_are_one_record(self):
|
||||
records = rl.amiberry(_sources(**{f"{G}/Amiberry.Generator.cs": AMIBERRY}))
|
||||
records = [r for r in records if r["kind"] == "names_searched"]
|
||||
self.assertEqual(
|
||||
[r["names"] for r in records],
|
||||
[
|
||||
@@ -369,6 +402,46 @@ class NamesInLauncherOrder(unittest.TestCase):
|
||||
"copied to <amiberry roms>/kick40060.CD32.ext, kickstart_ext_rom_file",
|
||||
)
|
||||
|
||||
def test_amiberry_folders_are_below_its_emulator_folder(self):
|
||||
records = rl.amiberry(_sources(**{f"{G}/Amiberry.Generator.cs": AMIBERRY}))
|
||||
folders = [r for r in records if r["kind"] == "passes_path"]
|
||||
self.assertEqual(
|
||||
[(r["search_dir"], r["passes_to"], r["source_ref"]) for r in folders],
|
||||
[
|
||||
('<AppConfig.GetFullPath("amiberry")>/ROMs', "written: rom_path in amiberry.conf",
|
||||
f"{G}/Amiberry.Generator.cs:31, 37-41"),
|
||||
('<AppConfig.GetFullPath("amiberry")>/WHDBoot',
|
||||
"written: whdboot_path in amiberry.conf", f"{G}/Amiberry.Generator.cs:31, 40-41"),
|
||||
],
|
||||
)
|
||||
|
||||
def test_amiberry_copies_each_kickstart_into_its_roms_folder(self):
|
||||
records = rl.amiberry(_sources(**{f"{G}/Amiberry.Generator.cs": AMIBERRY}))
|
||||
copies = [r for r in records if r["kind"] == "copies"]
|
||||
self.assertEqual(
|
||||
[(r["names"], r["passes_to"], r["depends_on_option"]) for r in copies],
|
||||
[
|
||||
(["kick40060.CD32", "kick40060.CD32.rom"],
|
||||
'<AppConfig.GetFullPath("amiberry")>/ROMs/kick40060.CD32',
|
||||
"first name found, the target is absent, smaller or older"),
|
||||
(["kick40060.CD32.ext", "amiga-os-310-cd32-ext.rom"],
|
||||
'<AppConfig.GetFullPath("amiberry")>/ROMs/kick40060.CD32.ext',
|
||||
"first name found, the target is absent, smaller or older"),
|
||||
(["rom.key"], '<AppConfig.GetFullPath("amiberry")>/ROMs/rom.key',
|
||||
"the target is absent or its size differs"),
|
||||
],
|
||||
)
|
||||
self.assertEqual(copies[0]["search_dir"], "bios, bios/amiga, bios/Amiga")
|
||||
self.assertEqual(
|
||||
copies[0]["source_ref"],
|
||||
f"{G}/Amiberry.Generator.cs:3-5, 8-10, 15, 23-27, 31, 37-39, 52-59",
|
||||
)
|
||||
|
||||
def test_amiberry_copy_without_its_staleness_test_raises(self):
|
||||
broken = AMIBERRY.replace(" || dst.LastWriteTimeUtc < src.LastWriteTimeUtc", "")
|
||||
with self.assertRaises(rl.LauncherPatternMissing):
|
||||
rl.amiberry(_sources(**{f"{G}/Amiberry.Generator.cs": broken}))
|
||||
|
||||
def test_psx_cascade_splits_searched_from_fallback(self):
|
||||
records = rl.psx_cascades(_psx_sources())
|
||||
searched, fallback = [r for r in records if r["emulator"] == "mednafen"]
|
||||
|
||||
@@ -658,6 +658,27 @@ class AmiberryOnEachPlatform(unittest.TestCase):
|
||||
self.assertEqual(entry["standalone_path"], f"{folder}/{layout}")
|
||||
|
||||
|
||||
def test_retrobat_reads_its_folders_below_the_amiberry_emulator_folder(self) -> None:
|
||||
# RetroBat writes rom_path and whdboot_path below the amiberry
|
||||
# folder of its install and copies the kickstarts it finds in bios
|
||||
# into that ROMs folder.
|
||||
name = "amiberry-8.3.0"
|
||||
profile = self.profiles[name]
|
||||
cfg = load_platform_config("retrobat", str(REPO_ROOT / "platforms"))
|
||||
self.assertEqual(
|
||||
standalone_bindings_for(name, profile, standalone_set(cfg)),
|
||||
{"": ("emulators", "amiberry/ROMs"), "WHDBoot": ("emulators", "amiberry/WHDBoot")},
|
||||
)
|
||||
((view, _standalone),) = platform_layouts(name, profile, standalone_set(cfg))
|
||||
for own, entry in zip(profile["files"], view["files"]):
|
||||
layout = own.get("standalone_path") or own.get("path") or own["name"]
|
||||
folder = "amiberry" if layout.startswith("WHDBoot/") else "amiberry/ROMs"
|
||||
with self.subTest(name=entry["name"]):
|
||||
self.assertNotIn("unplaced", entry)
|
||||
self.assertEqual(entry.get("root"), "emulators")
|
||||
self.assertEqual(entry["standalone_path"], f"{folder}/{layout}")
|
||||
|
||||
|
||||
class AmiberryBuildEachPlatformShips(unittest.TestCase):
|
||||
"""Each platform resolves the name amiberry to the build its own package
|
||||
compiles. RetroBat keeps the 8.5.0 libretro core beside its standalone."""
|
||||
|
||||
Reference in new issue
Block a user