A work-in-progress matching decompilation of Shin Megami Tensei: Digital Devil Saga and Digital Devil Saga 2 for PlayStation 2. The goal is to understand and document how the games work by reconstructing readable source code from their retail binaries. Matching builds verify the reconstruction against the original executables.
Important
This is a binary reconstruction and analysis project for understanding and documenting how the games work. You cannot use this repository to play the games; it is not a port.
Building requires your own lawfully obtained copy of the corresponding game. Required files are extracted locally from your copy. Disc images and retail executables are not included.
Unfinished functions use assembly extracted from the original executable, so a matching build does not mean the decompilation is complete. Names, types, and source organization are still being recovered.
| Version | Game | Serial | ELF SHA-1 |
|---|---|---|---|
dds1 |
Digital Devil Saga (USA) | SLUS_209.74 |
6d18898e2724bf1d145392766e8ba1e678487419 |
dds2 |
Digital Devil Saga 2 (USA) | SLUS_211.52 |
9be91ee1b4a535a4cb6ec89237b5a6ba41be2add |
The badges track production-exact, source-owned game/engine code bytes and function counts for each game. Assembly fallbacks receive zero source credit. SDK/runtime code, handwritten assembly segments and VU1 microcode are outside those totals. Reading progress explains the measurements and comparison limits.
Requirements:
- Linux x86-64 or WSL2, with support for running 32-bit i386 programs.
- Python 3.10+,
ninja,cpp, andgit. - Your own disc image of either supported game.
git clone https://github.com/Megami-Decomps/dds-decomp.git
cd dds-decomp
python -m pip install -r requirements.txt
python tools/download_tools.py
# Copy your disc image(s) into the repository root or orig/, then:
python tools/extract.py
python configure.py
ninjaninja builds every extracted version and checks each executable against its
retail SHA-1. Use ninja dds1 or ninja dds2 to build one game. A checksum
mismatch fails the build.
See Building for optional script, data, and development targets, generated files, and checksum troubleshooting. The toolchain notes explain the original compiler, assembler, and pinned 32-bit runtime.
Start with the contribution guide and
confirmed source idioms to reconstruct a function. Pick an
INCLUDE_ASM function, replace it with readable C, check the whole unit with
tools/check_unit.py, and verify that ninja still produces a matching
executable.
DDS2 reuses much of DDS1's engine. The contribution guide also covers sharing reconstructed functions between games and recovering names and types.
The documentation index groups the available references:
- Code reconstruction: matching workflow, compiler behavior, and unit names.
- Scripts: compiled VM scripts and editable source.
- Field resources: interaction and transition tables, field formats, automaps, lighting, archives, and textures.
- Battle data: encounter and battle content tables.
- Development builds: experimental relocatable executables.
- splat, spimdisasm, m2c and objdiff
- decomp.me for the ee-gcc 2.96 toolchain packaging
- the Persona 3/4 decompilation projects, for SDK layout and naming conventions
- romwright, for analysis and cross-game pairing