fix: declare the higan Super GameBoy.sfc folder

higan and nSide look program.rom up in the option's folder, SGB.sfc/,
then Super GameBoy.sfc/. Only the SGB1.sfc/ and SGB2.sfc/ folders were
entries, and both names are files bsnes, Mesen-S and ares read from the
same system directory, so no pack could give the higan cores a Super
Game Boy. SGB.sfc/ collides with SuperSnes9x's sgb.sfc on a
case-insensitive file system. Super GameBoy.sfc/ collides with nothing.
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 11:50:27 +01:00
1 parent 1a7389076d
commit f5140aad0c
3 files changed
+65

No files matched your search

+15
View File
@@ -228,3 +228,18 @@ files:
required: false
note: "Falls back to sgb2.boot.rom at the system directory root."
source_ref: "higan/gb/system/system.cpp:54-65, icarus/heuristics/super-famicom.cpp:243, icarus/heuristics/super-famicom.cpp:614"
- name: "program.rom"
path: "Super GameBoy.sfc/program.rom"
system: nintendo-sgb
required: false
note: "Last folder tried, after the option's folder and SGB.sfc/."
source_ref: "higan/target-libretro/libretro-sfc.cpp:209-225, higan/sfc/cartridge/load.cpp:77-80"
- name: "sgb1.boot.rom"
path: "Super GameBoy.sfc/sgb1.boot.rom"
system: nintendo-sgb
size: 256
required: false
note: "Read from the folder program.rom was found in, then from the system directory root. The name follows the Super GAMEBOY header of an SGB1 program.rom."
source_ref: "higan/target-libretro/libretro-sfc.cpp:229, higan/gb/system/system.cpp:54-65, icarus/heuristics/super-famicom.cpp:232, icarus/heuristics/super-famicom.cpp:618"
+16
View File
@@ -227,3 +227,19 @@ files:
required: false
note: "Falls back to lr35902.boot.rom at the system directory root."
source_ref: "source nSide/gb/system/system.cpp:54-65, source nSide/emulator/game.hpp:101-104, source icarus/heuristics/super-famicom.cpp:103, source icarus/heuristics/super-famicom.cpp:523-527"
- name: "program.rom"
path: "Super GameBoy.sfc/program.rom"
system: nintendo-sgb
required: false
note: "Last folder tried, after the option's folder and SGB.sfc/."
source_ref: "source nSide/target-libretro/libretro-sfc.cpp:184-199, source nSide/sfc-balanced/cartridge/load.cpp:159-162"
- name: "lr35902.boot.rom"
path: "Super GameBoy.sfc/lr35902.boot.rom"
system: nintendo-sgb
size: 256
sha1: "aa2f50a77dfb4823da96ba99309085a3c6278515"
required: false
note: "Read from the folder program.rom was found in, then from the system directory root."
source_ref: "source nSide/target-libretro/libretro-sfc.cpp:201, source nSide/gb/system/system.cpp:54-65, source nSide/target-libretro/program.cpp:59-72, source icarus/heuristics/super-famicom.cpp:103"
+34
View File
@@ -6821,5 +6821,39 @@ class PipelineChildrenSkipNodeCompileCache(unittest.TestCase):
self.assertIn('"NODE_DISABLE_COMPILE_CACHE": "1"', source)
class HiganSuperGameBoyFolderIsFree(unittest.TestCase):
"""higan reads program.rom in the option's folder, SGB.sfc/, then Super
GameBoy.sfc/. bsnes, Mesen-S and ares read SGB1.sfc and SGB2.sfc as files
in the same system directory, and SuperSnes9x sgb.sfc, so a pack that only
had the first two folders never gave the higan cores a Super Game Boy."""
def test_each_higan_core_has_a_folder_no_core_reads_as_a_file(self):
import yaml
file_names: set[str] = set()
for path in (ROOT / "emulators").glob("*.yml"):
document = yaml.safe_load(path.read_text(encoding="utf-8")) or {}
for entry in document.get("files") or []:
for name in [entry.get("name"), *(entry.get("aliases") or [])]:
if name:
file_names.add(str(name).casefold())
if entry.get("path"):
file_names.add(str(entry["path"]).casefold())
for profile in ("higan_sfc", "higan_sfc_balanced"):
document = yaml.safe_load(
(ROOT / "emulators" / f"{profile}.yml").read_text(encoding="utf-8")
)
folders = {
str(entry["path"]).split("/", 1)[0]
for entry in document["files"]
if str(entry.get("path") or "").endswith("/program.rom")
and entry.get("system") == "nintendo-sgb"
}
with self.subTest(profile=profile):
self.assertTrue(
[f for f in folders if f.casefold() not in file_names], folders
)
if __name__ == "__main__":
unittest.main()