melonDS Nightly emulates Nintendo DS and Nintendo DSi. It reads 7 files, 4 of them required: without a required file it does not start games. A required file is needed only by the machines that use it. Each file below cites the line of source code that reads it.
Android port of melonDS. The emulation code is the melonDS-android-lib
submodule, a fork of melonDS-emu/melonDS pinned at 431ab4bd and declaring
version 1.1 (CMakeLists.txt:20), and the app around it is Kotlin plus a JNI layer
under app/src/main/cpp.
Nightly is a product flavor, not a separate tree: the build dimension "build"
has prod and nightly, and nightly sets applicationIdSuffix ".nightly" and the
version suffix " (NIGHTLY)" (app/build.gradle.kts:63,79-87), giving the package
id me.magnum.melonds.nightly. Its source set holds an app name and a launcher
icon (app/src/nightly/res), and the gitHubNightly set points the update check
at the nightly release instead of the tagged one
(app/src/gitHubNightly/java/me/magnum/melonds/github/repositories/GitHubNightlyUpdatesRepository.kt:31).
No load path differs from the prod flavor.
Files live in two directories the user picks through the storage access
framework, stored in the preferences bios_dir and dsi_bios_dir
(app/src/main/res/xml/pref_custom_firmware.xml:29-39). Both are read by
basename, so bios7.bin, bios9.bin and firmware.bin each name a DS image in one
directory and a DSi image in the other. The accepted lengths are what tell them
apart. The app lists the expected names on screen when a directory is unset or
rejected (app/src/main/res/values/strings.xml:120,122). Entries below carry the
basename the app opens in the path, under the console identifier the picker
binds to each directory, ds and dsi
(app/src/main/res/xml/pref_custom_firmware.xml:33,39).
Neither SD card is reachable in this build. getSDCardArgs returns nothing when
a card is disabled (app/src/main/cpp/SDCardArgsBuilder.cpp:19-20) and the JNI layer hardcodes
both the DSi card and the homebrew DLDI card to disabled
(app/src/main/cpp/MelonDSAndroidConfiguration.cpp:95-96), with no preference anywhere in the app
to turn either on, and the README lists DSi SD card support under missing features. The Action Replay database the core can parse is likewise
never built: ARDatabaseDAT is reached only from src/frontend/qt_sdl, and the
Android build sets BUILD_QT_SDL OFF and links the core alone
(app/CMakeLists.txt:8,74). Cheats are entered in the app's own database.
Opened as bios9.bin inside the DSi directory. The picker rejects any length other than 65536, and no hash is computed on it. A load failure aborts the launch. DSi boot copies four blocks out of it into ITCM from 0x87F4, 0x9920, 0x99A0 and 0xA9E8, and cartridge Key1 in DSi mode is seeded from 0x99A0. With the boot screen off, the reset vector is overwritten in memory with 0xEAFFFFFE.
Opened as bios7.bin inside the DSi directory. The picker rejects any length other than 65536, and no hash is computed on it. A load failure aborts the launch. Offset 0x8308 holds the ES key used to derive the NAND AES keys, so the NAND cannot be opened without this exact image. DSi boot copies four blocks out of it from 0x8188, 0xB5D8, 0xC6D0 and 0xD718. With the boot screen off, the reset vector is overwritten in memory with 0xEAFFFFFE.
Opened as firmware.bin inside the DSi directory, where only 131072 is accepted against three accepted lengths in the DS directory. Read in DSi mode in place of the DS firmware, and customised the same way. The core has no generator for DSi firmware, so nothing stands in for it.
Opened as nand.bin inside the DSi directory. The only test the app makes is that the entry is a file: no length, no hash. It is opened for read and write and must already exist. The core wants the nocash footer "DSi eMMC CID/CPU" at 0x40 before the end, falling back to 0x000FF800 for images cut short by external tools, and reads the eMMC CID and console ID from there to derive the FAT and ES keys with the key at 0x8308 of the ARM7i BIOS. Touchscreen calibration is rewritten in the mounted user data on every launch. Any regional dump works. A DSiWare title is refused unless it is already installed in this image.
The picker rejects any length other than 4096. The core hashes what it loads and keeps the result as a flag rather than refusing the image: a CRC32 other than 2ab23573 marks the BIOS non-native, which forces direct boot and makes SetupDirectBoot copy the Nintendo logo out of the ROM header into the BIOS at 0x20 so DS-to-GBA communication still works. FreeBIOS is substituted when custom BIOS is off.
The picker rejects any length other than 16384. A CRC32 other than 1280f0d5 marks the BIOS non-native, which forces direct boot and leaves Key1_KeyBuf zeroed instead of seeding it from offset 0x0030, so cartridge Key1 encryption is unavailable. FreeBIOS is substituted when custom BIOS is off.
Three lengths are accepted and everything else is rejected. Loaded only in DS mode. DSi mode reads the firmware from the DSi directory but still needs this file present, because the DSi check re-runs the DS directory check. Nickname, message, language, colour, birthday and MAC are written into the image before it reaches the core. A firmware the core reports as non-bootable forces direct boot. When custom BIOS is off the core builds a firmware in memory instead.