mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 13:33:24 -05:00
fix: keep fbneo per-rom refs and archive names
This commit is contained in:
1 parent
47182f4cb1
commit
77dff6377e
4 files changed
+30
-4
No files matched your search
@@ -5,7 +5,7 @@ source: "https://github.com/libretro/FBNeo"
|
||||
upstream: "https://github.com/finalburnneo/FBNeo"
|
||||
profiled_date: "2026-03-23"
|
||||
source_commit: "b267b79504366def21cefb08215e68df93310dba"
|
||||
core_version: "v1.0.0.03"
|
||||
core_version: "v1.0.0.2"
|
||||
display_name: "Arcade (FinalBurn Neo) (Neo-Geo)"
|
||||
cores:
|
||||
- fbneo_neogeo
|
||||
|
||||
@@ -266,6 +266,11 @@ def _diff_fbneo(
|
||||
continue
|
||||
|
||||
old = existing_by_key[key]
|
||||
# source_ref is deliberately not compared here. The scraper knows
|
||||
# one line per driver, the struct, while a curated entry cites the
|
||||
# RomDesc line of its own ROM. Treating the difference as drift
|
||||
# would replace per-ROM precision with a single driver line, which
|
||||
# the profiling rules call the signature of a faulty entry.
|
||||
if old.get("crc32") != rom.get("crc32") or old.get("size") != rom.get(
|
||||
"size"
|
||||
):
|
||||
|
||||
@@ -279,9 +279,15 @@ def run(
|
||||
diff = compute_diff(str(path), str(CACHE_PATH), mode="fbneo")
|
||||
print(_format_diff(path.stem, diff, show_added=is_main))
|
||||
|
||||
effective_added = diff["added"] if is_main else []
|
||||
if not dry_run and (effective_added or diff["updated"]):
|
||||
merge_fbneo_profile(str(path), str(CACHE_PATH), write=True, add_new=is_main)
|
||||
# New entries are never written. A non-arcade FBNeo driver opens an
|
||||
# archive whose name has the system prefix stripped by its own
|
||||
# GetZipName (cv_coleco -> coleco.zip, gba_gba -> gba.zip), and the
|
||||
# parser reads the driver struct name instead. Adding those would
|
||||
# create phantom archives the core never opens, next to the correctly
|
||||
# named entries already curated. Refreshing existing entries is safe:
|
||||
# they are keyed by the archive name the profile already declares.
|
||||
if not dry_run and diff["updated"]:
|
||||
merge_fbneo_profile(str(path), str(CACHE_PATH), write=True, add_new=False)
|
||||
log.info("merged changes into %s", path.name)
|
||||
|
||||
return 0
|
||||
|
||||
@@ -469,6 +469,21 @@ class TestDiff(unittest.TestCase):
|
||||
self.assertEqual(len(diff["added"]), 0)
|
||||
self.assertEqual(len(diff["updated"]), 0)
|
||||
|
||||
def test_diff_fbneo_keeps_a_per_rom_ref(self) -> None:
|
||||
"""The scraper knows the driver line; a curated ref knows its ROM."""
|
||||
profile = _make_fbneo_profile()
|
||||
profile["files"][0]["crc32"] = "9036d879"
|
||||
profile["files"][0]["size"] = 131072
|
||||
profile["files"][0]["source_ref"] = "src/burn/drv/neogeo/d_neogeo.cpp:1615"
|
||||
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
p = Path(td)
|
||||
profile_path = _write_yaml(p / "fbneo.yml", profile)
|
||||
hashes_path = _write_json(p / "hashes.json", _make_fbneo_hashes())
|
||||
diff = compute_diff(profile_path, hashes_path, mode="fbneo")
|
||||
self.assertEqual(len(diff["updated"]), 0)
|
||||
self.assertEqual(diff["unchanged"], 1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in new issue
Block a user