DraStic
DraStic emulates Nintendo DS. It reads 12 files, none of them required: it starts games without them.
About this profile
Install this emulator's files
With ROCKNIX, AmberELEC or RetroPie: the installer finds ROCKNIX, AmberELEC or RetroPie and its BIOS folder, then downloads only the files DraStic reads there and checks each one.
Open a terminal on the device. Or connect from a computer with SSH, a terminal over the network. Paste the line. Press Enter.
curl -fsSL https://abdess.github.io/retrobios/i | sh -s -- --emulator drasticTechnical notes
Nintendo DS emulator by Exophase, closed source and distributed as a binary. Two releases are read here and they name the same files: the Android build r2.6.0.4a build 109, package com.dsemu.drastic, apk md5 7df979ef9420c5053b27c838e6a7e20c (sha256 d3a45b9bfd5a68cc), v1 signed by CN=Gilead Kutnick over every entry, whose loader is lib/arm64-v8a/libdrastic_arm64.so (sha256 3b27eee0c480df81) and whose installer is the smali of DraSticActivity. The second is the Linux AArch64 build r2.5.2.2, md5 17550db727f3b59d36b57746ad1944be (sha256 dab3275ef772451b), which ships unstripped with 2731 named functions and is cited by function name. r2.5.2.2 predates the firmware editor and the user database, and that is the whole of the divergence. Every reference below is an address in one of the two binaries, a line in the apktool decode of the Android one or a line of an asset it ships. ref: libdrastic_arm64.so r2.6.0.4a, drastic r2.5.2.2 (DWARF comp_dir /home/odroid/nds_emu/src/linux_odroid64), DraSticActivity.smali
One root holds everything. On Android it is a directory named DraStic at the root of shared storage, on Linux it is the working directory. Startup creates backup, savestates, config, unzip_cache, system, input_record, cheats, slot2, microphone and scripts below it, and the Android build adds backgrounds, icon_cache, users, shaders and virtual_controller. Paths below are relative to that root. ref: drastic r2.5.2.2 initialize_system_directories 0xf784-0xf838, drastic r2.5.2.2 initialize_system 0xf9e8, DraSticPathCache.smali:44-56, DraSticActivity.smali:4373-4429, DraSticActivity.smali:4187, DraSticActivity.smali:4482
load_system_file builds <root>/system/<name>, opens it read only, measures it by seeking to the end, refuses any length other than the one its caller asks for with "System file %s is the wrong size (should be %d bytes, is %d)", then reads it whole. Size is the only test: no hash is computed on any file. ref: drastic r2.5.2.2 load_system_file 0xea80-0xebe4, libdrastic_arm64.so r2.6.0.4a 0x1b4d4-0x1b510
Each BIOS slot has two candidates. The ARM9 slot takes nds_bios_arm9.bin, and on failure logs "Can't find Nintendo ARM9 BIOS. Trying free DraStic ARM9 BIOS." and takes drastic_bios_arm9.bin. The ARM7 slot does the same with nds_bios_arm7.bin then drastic_bios_arm7.bin. A slot left empty returns -1 from initialize_memory, and initialize_system answers that with the on-screen warning naming the two Nintendo files and their sizes, the line "FATAL: Could not load system files." and quit. Neither name in a slot is required on its own, both slots are. Taking the replacement sets a bit per slot, which is what savestates record so that a state made under one pair does not load under the other. ref: drastic r2.5.2.2 initialize_memory 0x1c398-0x1c3d4, drastic r2.5.2.2 initialize_memory 0x1c4b0-0x1c52c, drastic r2.5.2.2 initialize_system 0xf940-0xf944, drastic r2.5.2.2 initialize_system 0xf9f8-0xfa10, drastic r2.5.2.2 menu_bios_warning 0x801e0-0x80238, libdrastic_arm64.so r2.6.0.4a 0x2b6d0-0x2b764
Firmware is answered in code when no file loads: the 256 KB region is zeroed and patch_firmware_header_data writes the header, the console identity and the user settings block into it. r2.5.2.2 reads nds_firmware.bin alone, while r2.6.0.4a reads nds_firmware_modified.bin first, which is what its firmware editor writes back, and falls through to nds_firmware.bin. ref: drastic r2.5.2.2 initialize_memory 0x1c3e0-0x1c3f8, drastic r2.5.2.2 initialize_memory 0x1c560-0x1c578, drastic r2.5.2.2 patch_firmware_header_data 0x1b920, libdrastic_arm64.so r2.6.0.4a 0x2b768-0x2b7c4, libdrastic_arm64.so r2.6.0.4a 0x774e0-0x7751c
The Nintendo ARM7 image still decides one thing. gamecard_load_program passes the 0x1048 bytes at ARM7 BIOS offset 0x30 to gamecard_decrypt_secure_region as the Blowfish key table, and a secure area that does not decrypt to the id encryObj is reported and left alone. The free ARM7 replacement holds zeroes there, so encrypted cards need the dumped image. ref: drastic r2.5.2.2 gamecard_load_program 0x6fb98-0x6fbac, drastic r2.5.2.2 gamecard_decrypt_secure_region 0x6e2c0-0x6e38c, drastic r2.5.2.2 initialize_memory 0x1c3bc-0x1c3c8
Two databases sit at the root. game_database.xml carries the save type per title and a failed open only logs "Error: could not load game database file %s." r2.6.0.4a reads game_database_user.xml after it as a user overlay. usrcheat.dat is the Action Replay library, read by load_cheat_directory. ref: drastic r2.5.2.2 initialize_gamecard 0x709bc-0x70a30, drastic r2.5.2.2 initialize_game_database 0x73180, drastic r2.5.2.2 initialize_game_database 0x73d24-0x73d38, libdrastic_arm64.so r2.6.0.4a 0x76ab8-0x76b58
The Android package carries its own copies of the files it needs and lays them down on first run: the two free BIOS images into system, the default layout into config, game_database.xml, usrcheat.dat and the BSD-licensed source archive of the free BIOS at the root, and the shaders and virtual_controller trees whole. Nothing already present is overwritten. ref: DraSticActivity.smali:4052-4090, DraSticActivity.smali:5189-5200, DraSticActivity.smali:5459, DraSticActivity.smali:5619-5624, DraSticActivity.smali:5645, DraSticActivity.smali:5834, DraSticActivity.smali:5974
fxLoad hands the path of the chosen .dfx to the chain loader, which opens it, keeps its directory and reads it line by line. An <include> reads its file= whole, a <texture> whose input= is neither null nor framebuffer reads that file whole as a lookup texture, and the shader= of each <pass> opens a .dsd and splits its <vertex> and <fragment> blocks, all three relative to the .dfx. A stage that fails to compile has its log written to <path>.log beside the .dsd. A .dfx that does not open or parse leaves a built-in pass-through shader. Nine chains ship: None, Linear, Quilez, Scale2X, Scanline, HQ2X, FXAA, FXAA HQ and SMAA, and SMAA is the only one naming .raw textures. ref: libdrastic_arm64.so r2.6.0.4a Java_com_dsemu_drastic_DraSticJNI_fxLoad 0x18eec, libdrastic_arm64.so r2.6.0.4a FUN_1ff78 0x1ffd4-0x20214, libdrastic_arm64.so r2.6.0.4a FUN_1f0a0 0x1f17c-0x1f1c8, libdrastic_arm64.so r2.6.0.4a FUN_1f260 0x1f464-0x1f52c, libdrastic_arm64.so r2.6.0.4a FUN_1f734 0x1f850-0x1f894, libdrastic_arm64.so r2.6.0.4a FUN_1ebfc 0x1ec20-0x1ecec, assets/shaders/SMAA.dfx:108-122
Per-title inputs are read beside the ROM name. reset_spu answers the microphone with microphone/<game>.wav then microphone/microphone.wav, load_nds runs scripts/<game>.lua then scripts/default.lua through the built-in Lua 5.3, load_custom_cheats reads cheats/<game>.cht on top of the library, and gamecard_load_gba fills the slot 2 cart from slot2/<game>.gba with its save beside it. Homebrew turns on R4 flashcart emulation and opens drastic_dldi.img read-write for the fat:/ device, logging "Couldn't load drastic_dldi.img: " and carrying on without one. ref: drastic r2.5.2.2 reset_spu 0x6dba8-0x6dc5c, drastic r2.5.2.2 load_nds 0x6ff78-0x6ffd0, drastic r2.5.2.2 load_nds 0x70054-0x70094, drastic r2.5.2.2 load_custom_cheats 0x817b4, drastic r2.5.2.2 gamecard_load_gba 0x6ec98, drastic r2.5.2.2 gamecard_load_gba 0x6eda0, drastic r2.5.2.2 gamecard_initialize_homebrew 0x6e4e0-0x6e518, drastic r2.5.2.2 gamecard_initialize_homebrew 0x6e5a4
The Linux build alone draws a splash, reading drastic_logo_0.raw or drastic_logo_1.raw at 120000 bytes each, one of the two picked at random. ref: drastic r2.5.2.2 load_logo 0x7fad0-0x7fb78
12 files: 0 required, 12 optional. 2 have an HLE fallback. 12 more files come with the app.
By kind: 6 BIOS and 18 game data.
In this collection: 3 in repo, 3 missing and 6 unsourceable.
Optional
Section titled “Optional”| File | Status |
|---|---|
nds_bios_arm9.binNintendo DS ARM9 BIOS
Validation and source
|
in repo |
nds_bios_arm7.binNintendo DS ARM7 BIOS
Validation and source
|
in repo |
nds_firmware.binNintendo DS firmware
Validation and source
|
in repo HLE fallback |
nds_firmware_modified.binfirmware image edited in the emulator
Validation and source
|
unsourceable HLE fallback |
Game data
Section titled “Game data”| File | Status |
|---|---|
game_database_user.xmluser save type database
Source
|
optional unsourceable game data |
microphone.wavdefault microphone input
Packages and source
|
optional unsourceable game data |
<game>.wavper-title microphone input
Source
|
optional missing game data |
default.luafallback Lua script
Source
|
optional unsourceable game data |
<game>.luaper-title Lua script
Source
|
optional missing game data |
<game>.chtcustom cheat file
Source
|
optional missing game data |
<game>.gbaslot 2 cartridge image
Source
|
optional unsourceable game data |
drastic_dldi.imgR4 flashcart disk image
Source
|
optional unsourceable game data |
Comes with the app
Section titled “Comes with the app”| File | Status | Hash |
|---|---|---|
drastic_bios_arm9.binDraStic free ARM9 BIOS replacement
Hashes, validation and source
|
- | MD5 5f34f9f6108f |
drastic_bios_arm7.binDraStic free ARM7 BIOS replacement
Hashes, validation and source
|
- | MD5 c259d5dd2d1a |
game_database.xmlsave type database, one entry per title
Hashes and source
|
game data | SHA1 b0ae5480c61b |
usrcheat.datAction Replay cheat library
Source
|
game data | - |
drastic_bios.zipsource archive of the free BIOS replacement
Hashes and source
|
game data | SHA1 bb2e4f588db6 |
LC_default.datdefault screen layout
Hashes and source
|
game data | SHA1 9a0f96436ad7 |
<name>.dfxpost-processing chain definition
Source
|
game data | - |
<name>.dsdGLSL stage source named by a chain
Source
|
game data | - |
<name>.rawlookup texture named by a chain
Source
|
game data | - |
<name>.zipon-screen controller skin
Source
|
game data | - |
drastic_logo_0.rawboot splash, first of two
Hashes, validation and source
|
game data | SHA1 13c0866a8fb9 |
drastic_logo_1.rawboot splash, second of two
Hashes, validation and source
|
game data | SHA1 a5e63c52cda7 |
Next steps
Section titled “Next steps”- Get the files, for the setup in use
- Every system, and the files each one needs
- When a game does not start