diff --git a/emulators/fbneo_neogeo.yml b/emulators/fbneo_neogeo.yml index 02f26368..3c04c44a 100644 --- a/emulators/fbneo_neogeo.yml +++ b/emulators/fbneo_neogeo.yml @@ -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 diff --git a/scripts/scraper/_hash_merge.py b/scripts/scraper/_hash_merge.py index 0a23749e..3574b188 100644 --- a/scripts/scraper/_hash_merge.py +++ b/scripts/scraper/_hash_merge.py @@ -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" ): diff --git a/scripts/scraper/fbneo_hash_scraper.py b/scripts/scraper/fbneo_hash_scraper.py index 5ecc8def..f1c4c8b4 100644 --- a/scripts/scraper/fbneo_hash_scraper.py +++ b/scripts/scraper/fbneo_hash_scraper.py @@ -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 diff --git a/tests/test_hash_merge.py b/tests/test_hash_merge.py index d7ad3623..96a5c578 100644 --- a/tests/test_hash_merge.py +++ b/tests/test_hash_merge.py @@ -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()