A matching decompilation of Battle Stadium D.O.N (PlayStation 2, 2006): C source that, compiled with the original toolchain, rebuilds the game's executable byte for byte.
This repository contains no game material. No executable, no disc files, no disassembly, no assets. You need your own copy of the game, and every tool here reads it from your machine.
| Game | Battle Stadium D.O.N (バトルスタジアム D.O.N), Japan only |
| Serial | SLPS-25675, SYSTEM.CNF VER = 1.02 |
| Executable | SLPS_256.75 (3,973,040 bytes) |
| SHA-256 | 994e840123eb5a4cd5d13170a52fdca275dabb0a9f4585665b5d0fc67f9180c1 |
| SHA-1 | 024eda75fb453d8e644ec4d9a3962bc2249a1110 |
The fan English patch does not change the executable, so a patched disc works too.
The executable rebuilds identically. 141 / 2,039 functions of the game's own code (6.9%) are in C and match.
| Segment | Range | Compiler | Built from |
|---|---|---|---|
| Sony SDK 3.0 | 0x100000–0x1303C8 |
EE-GCC | asm |
| Game | 0x1303C8–0x255C40 |
MWCC | C where decompiled (src/game/), asm elsewhere |
| Sony libmtap, CRI cvFs and other libraries | 0x255C40–0x285128 |
EE-GCC | asm |
| RenderWare 3.7 | 0x285128–0x30C2B0 |
– | asm |
| CRI middleware, libmpeg | 0x30C2B0–0x350090 |
– | asm |
| C runtime and math | 0x350090–0x3902D4 |
– | asm |
| Data, bss | 0x3902D4–0x5A6800 |
– | asm |
Only the game's own code is a decompilation target; the libraries are third-party code. The end of the game code is
approximate (somewhere in 0x24FE40–0x255C40).
- Game code: Metrowerks CodeWarrior PS2
mwcps2-3.0.1b145-050209or3.0.1b151-050317(both match every function so far; this project builds with b151), flags-O4,p -sdatathreshold 0. The stringMW MIPS C Compiler (2.4.1.01)in the ELF comes from the linker and is the same across many CodeWarrior releases. Other builds were measured against the matched functions: the compiler of Splashdown (2.4-001213) matches 1 of 30. - Library code at
0x255C40+: EE-GCC2.95.3-136,-O2 -G0(identified, not a target). - How each was identified, and every build problem met on the way: NOTES.md.
macOS (Apple silicon) or Linux x86-64, Python 3.10+.
tools/setup.sh # Python env, wibo, MIPS binutils, MWCC PS2 compilers
cp /path/to/your/disc/SLPS_256.75 iso/
tools/split.sh # splat: asm/, assets/, src/game.c (all git-ignored)
.venv/bin/python tools/build.py # prints OK and the SHA-1 when the build matchesdon.yamltells splat how to cut the ELF. Every game function becomesasm/nonmatchings/game/<name>.s.tools/build.pyassembles the libraries and data and builds the game segment one function at a time: a function withsrc/game/<name>.cis compiled with MWCC (aligned and padded to its original size, its jump tables and other.rodataplaced where the original data was); the rest is assembled. The pieces are linked in the original order with splat's linker script and the result is compared with your executable.
See CONTRIBUTING.md: run the agent loop with your own Claude plan on a shard of the remaining functions, decompile by hand, or document what is matched.
- Pick a function in
asm/nonmatchings/game/. - Write
src/game/<name>.cwith the same name, includingcommon.h. Plain C only: noasm, no#pragma, no register pinning. - Run
tools/build.py.OKmeans it matches;MISMATCHgives the first differing address. tools/agent_loop/check.py <name> <file.c> <work_dir>compiles one function and shows a side-by-side diff with the original, without a full build.
Most functions in src/game/ were written by Claude agents (Claude Opus 5.5 and Claude Fable 5.2) running
tools/agent_loop/run.py: one headless Claude Code session per function, limited to writing its own C file and
running the checker. No function is accepted on the agent's word. The harness checks every one itself, and only a
byte-identical full build counts as a match. asm, #pragma and register pinning are rejected, and sessions stop
after 30 checks or 12 checks without progress.
Measured so far (results/):
| Run | Model | Functions | Matched | Cost (API-equivalent) |
|---|---|---|---|---|
| run1 (50 random) | Opus 5.5 | 42 game functions | 39 (93%, after a build fix) | $28.60 |
| run2 (all remaining, random order, in progress) | Fable 5.2 | 120 | 97 (81%) | $132.97 |
Functions decompiled by hand should say so in their commit.
Built on splat, spimdisasm, wibo, the decompals binutils and the compilers collected by decomp.me. The research of battlestadium-don (memory map, library ranges, function map) made this much faster.
Code under the MIT license (LICENSE). Battle Stadium D.O.N and its characters belong to their owners; this project is not affiliated with them and does not distribute any of their material. No Sony SDK source, headers or samples are used.