Skip to content

Repository files navigation

Dragon Quest IX: Sentinels of the Starry Skies Decompilation Project

USA functions USA bytes JPN functions JPN bytes

📖 About

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.


⚙️ Setup

🛠️ Prerequisites

Programs

Python 3.11 or newer

GCC 9+ (available through installers like MINGW on windows, usually included on linux)

Ninja build system

Setup

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


🚀 Building the Project

Once everything is set up:

  1. Open the command line in the root folder of the repository.
  2. Run the following command:
    ninja

This builds the ROM, verifies every module against the original, generates a decomp.me context for each object (requires GCC), creates an objdiff configuration and progress report, and verifies the SHA-1 of the whole built ROM (needs the ARM7 BIOS dump). If you're only interested in building the ROM, you can instead use ninja min. This will still verify the modules but not the final SHA-1 and as such does not require GCC or the ARM7 BIOS dump.


🤝 Contributing

See CONTRIBUTING.md for the full guide.

We recommend joining the DQIX discord server The Quester's Rest (https://discord.gg/DQIX) so you can participate in discussions in the DQI-haX: SWEs of the Starry Skies thread to claim a function, ask for help, or share a scratch.

📤 Submitting Contributions

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.

Decompiling code

See Decompiling.md

Contributions are welcome, though make sure you've read the pages linked above first. If you're new to decompilation, some possible tasks to get started with include:

  1. Find and decompile additional uses for the game's scripting system. Some existing uses can be found here and here as a guideline. (You don't need to worry about matching global variables, it's okay to mark everything as extern for the time being - just focus on matching the .text section). You may find this script disassembler helpful.
  2. Help to match additional pieces of the Zone3D class. This is very experimental/WIP, so we have a separate branch to work off of for this.
  3. Start decompiling one of the game's standalone overlays/systems, such as overlay 6 (the alchemy pot), overlay 8 (battle records) or overlay 14 (bestiary). This will likely interact with some as of yet unknown systems e.g. input, sound or text processing, but partial progress on the rest would still be very interesting!

🔧 Useful Tools

  1. Ghidra (with the NTRGhidra plugin):

  2. Desmume:

  3. No$GBA:

    • Another popular DS emulator for debugging, though less user-friendly.
    • Download No$GBA
  4. 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

About

Decompilation project for Dragon Quest IX for the Nintendo DS using dsd

Resources

Contributing

Stars

40 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages