fix: give the bizhawk DSi NAND slots their region

DecideNAND (MelonDS.cs:684-706) keeps, for a DSi title, only the NAND
slots whose bit is set in header byte 0x1B0. The six DSi_Nand entries
now carry that territory, so --region keeps one 240 MB image, not six.
AUS answers oceania, as every other Australian slot does.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 07:00:48 +02:00
1 parent bc2233e725
commit ab16555014
2 files changed
+49 -6

No files matched your search

+12 -6
View File
@@ -154,8 +154,9 @@ files:
size: 251658304
storage: large_file
description: "DSi NAND (Japan)"
region: [japan]
source_ref: "src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs:405, src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs:484, 684-706"
note: "Slot NDS+NAND_JPN has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. The size includes the 64-byte nocash footer."
note: "Slot NDS+NAND_JPN has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. A title whose ID upper word is 0x000300xx (DSi) gets only the NAND of a region its header byte 0x1B0 allows, any other title the first held in the order JPN, USA, EUR, AUS, CHN, KOR. The size includes the 64-byte nocash footer."
- name: "DSi_Nand_EUR.bin"
system: nintendo-ds
@@ -163,8 +164,9 @@ files:
size: 251658304
storage: large_file
description: "DSi NAND (Europe)"
region: [europe]
source_ref: "src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs:406, src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs:484, 684-706"
note: "Slot NDS+NAND_EUR has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. The size includes the 64-byte nocash footer."
note: "Slot NDS+NAND_EUR has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. A title whose ID upper word is 0x000300xx (DSi) gets only the NAND of a region its header byte 0x1B0 allows, any other title the first held in the order JPN, USA, EUR, AUS, CHN, KOR. The size includes the 64-byte nocash footer."
- name: "DSi_Nand_USA.bin"
system: nintendo-ds
@@ -172,8 +174,9 @@ files:
size: 251658304
storage: large_file
description: "DSi NAND (USA)"
region: [north-america]
source_ref: "src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs:407, src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs:484, 684-706"
note: "Slot NDS+NAND_USA has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. The size includes the 64-byte nocash footer."
note: "Slot NDS+NAND_USA has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. A title whose ID upper word is 0x000300xx (DSi) gets only the NAND of a region its header byte 0x1B0 allows, any other title the first held in the order JPN, USA, EUR, AUS, CHN, KOR. The size includes the 64-byte nocash footer."
- name: "DSi_Nand_AUS.bin"
system: nintendo-ds
@@ -181,8 +184,9 @@ files:
size: 251658304
storage: large_file
description: "DSi NAND (Australia)"
region: [oceania]
source_ref: "src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs:408, src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs:484, 684-706"
note: "Slot NDS+NAND_AUS has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. The size includes the 64-byte nocash footer."
note: "Slot NDS+NAND_AUS has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. A title whose ID upper word is 0x000300xx (DSi) gets only the NAND of a region its header byte 0x1B0 allows, any other title the first held in the order JPN, USA, EUR, AUS, CHN, KOR. The size includes the 64-byte nocash footer."
- name: "DSi_Nand_CHN.bin"
system: nintendo-ds
@@ -190,8 +194,9 @@ files:
size: 251658304
storage: large_file
description: "DSi NAND (China)"
region: [china]
source_ref: "src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs:409, src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs:484, 684-706"
note: "Slot NDS+NAND_CHN has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. The size includes the 64-byte nocash footer."
note: "Slot NDS+NAND_CHN has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. A title whose ID upper word is 0x000300xx (DSi) gets only the NAND of a region its header byte 0x1B0 allows, any other title the first held in the order JPN, USA, EUR, AUS, CHN, KOR. The size includes the 64-byte nocash footer."
- name: "DSi_Nand_KOR.bin"
system: nintendo-ds
@@ -199,8 +204,9 @@ files:
size: 251658304
storage: large_file
description: "DSi NAND (Korea)"
region: [south-korea]
source_ref: "src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs:410, src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs:484, 684-706"
note: "Slot NDS+NAND_KOR has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. The size includes the 64-byte nocash footer."
note: "Slot NDS+NAND_KOR has a placeholder hash, so the scan never finds it. Only a user specification reaches it. Read in DSi mode. A title whose ID upper word is 0x000300xx (DSi) gets only the NAND of a region its header byte 0x1B0 allows, any other title the first held in the order JPN, USA, EUR, AUS, CHN, KOR. The size includes the 64-byte nocash footer."
- name: "32X_G_BIOS.BIN"
system: sega-32x
+37
View File
@@ -916,6 +916,9 @@ class RegionalRequestsKeepWhatTheCodeLoads(unittest.TestCase):
("duckstation", ["brazil", "japan"], "scph5501.bin"),
("duckstation", ["brazil", "japan"], "scph7001.bin"),
("duckstation", ["brazil", "japan"], "ps2_scph39001.bin"),
("bizhawk", ["north-america"], "DSi_Nand_USA.bin"),
("bizhawk", ["oceania"], "DSi_Nand_AUS.bin"),
("bizhawk", ["china", "japan"], "DSi_Nand_CHN.bin"),
)
def test_each_request_keeps_its_file(self):
@@ -929,6 +932,40 @@ class RegionalRequestsKeepWhatTheCodeLoads(unittest.TestCase):
class DsiNandFollowsTheHeaderRegion(unittest.TestCase):
"""BizHawk's DecideNAND keeps, for a DSi title, only the NAND slots whose
bit is set in header byte 0x1B0 (MelonDS.cs:684-706): JPN, USA, EUR, AUS,
CHN, KOR. The six DSi_Nand_<REGION>.bin entries carried no region, so a
--region request kept all six 240 MB images."""
SLOTS = {
"JPN": ["japan"],
"USA": ["north-america"],
"EUR": ["europe"],
"AUS": ["oceania"],
"CHN": ["china"],
"KOR": ["south-korea"],
}
def _profile(self) -> dict:
return common.load_emulator_profiles(
os.path.join(os.path.dirname(__file__), "..", "emulators")
)["bizhawk"]
def test_each_slot_carries_its_territory(self):
files = {f["name"]: f for f in self._profile()["files"]}
for slot, expected in self.SLOTS.items():
with self.subTest(slot=slot):
declared = files[f"DSi_Nand_{slot}.bin"].get("region")
self.assertEqual(declared, expected)
self.assertTrue(set(declared) <= region.REGIONS)
def test_a_request_keeps_its_nand_and_withdraws_the_others(self):
nands = {f"DSi_Nand_{slot}.bin" for slot in self.SLOTS}
drops = emulator_region_drops([("bizhawk", self._profile())], False, ["north-america"])
self.assertEqual(nands & drops, nands - {"DSi_Nand_USA.bin"})
class FontRomsCarryNoTerritory(unittest.TestCase):
"""A CJK font ROM is a language, not a territory. blueMSX tagged KANJI.rom
and MSXKANJI.rom [japan], which a --region south-korea request withdrew