This project aims to create a 1:1 disassembly and decompilation of Dragon Quest IX: Sentinels of the Starry Skies for the Nintendo DS.
The primary focus is on the USA and Japanese versions of the game, with the goal of making it fully recompilable.
GCC 9+ (available through installers like MINGW on windows, usually included on linux)
Place a clean ROM of the original game in the 'extract' folder and name it <baserom_dqix_(region).nds>, with (region) being the appropriate region identifier. ex: baserom_dqix_usa.nds
(Note: currently only the usa and jpn roms are supported)
Install the Python dependencies with pip
python -m pip install -r tools/requirements.txt
Run the script to configure Ninja (Do this any time a file is added or removed)
python tools/configure.py <usa|jpn>
If using ghidra, be sure to create a successful build using ninja (see: Building the Project) at least once before loading the game's config.yaml with ghidra. (For more information see See Decompiling.md)
Lastly, if you want the final ROM to be perfectly byte accurate you need to dump the ARM7 BIOS from your DS and place them in the root folder, under the name arm7_bios.bin
Once everything is set up:
- Open the command line in the root folder of the repository.
- Run the following command:
ninja
This will initiate the compilation process.
Important
Ensure the decompiled code you submit produces the same binary as the original release game. The build script should throw errors should your code not match.
See Decompiling.md
Disassemble and decompile accessible functions to begin mapping out the games code.
Get to the point where the strange function calls referenced on lines 26-28 of ARM9 main relocs.txt and lines 2695-2697 of overlay 1 relocs.txt can be understood
-
Ghidra (with the NTRGhidra plugin):
- A powerful reverse engineering tool for DS games and code.
- Download Ghidra
- Get dsd-ghidra Plugin (note: at current, ensure you use v0.2.1: 0.3.0 seems to be broken with the game)
-
Desmume:
- A DS emulator with excellent debugging features.
- Download nightly builds
-
No$GBA:
- Another popular DS emulator for debugging, though less user-friendly.
- Download No$GBA
-
Decomp.me:
- A powerful website designed to aid decompilation of games on different platforms. Select the DS platform and input the assembly of the function you want to decompile, and it will show you how closely the code you write matches the output assembly.
- Additionally, it's great for collaboration, as you can share a "scratch" of the function you're working on with others and they can seamlessly fork it and contribute.
- Check it out here
This project is a work in progress. Community contributions and feedback are welcome to help improve functionality!