A matching decompilation of Ape Escape 3 for PlayStation 2 (NTSC-U, SCUS_975.01): the game code, rebuilt
as readable C that compiles to the same bytes as the retail executable. Part of Open-Ape.
The decompilation is the base for a planned native PC port, in the style of OpenGOAL and OpenRAC: the game's own code compiled for PC with its own renderer, no emulation. reape3, an experimental recompilation, is used alongside it as a research tool.
Warning. This repository contains no game data, executables, disc images or proprietary toolchains. You need your own copy of the game. Read LEGAL.md before contributing.
The compiler is found: Sony EE GCC 3.2 with -Os reproduces the game's code byte for byte (see
docs/build/toolchain.md); some parts were built with -O2 instead (the Sg2 sound engine,
the C library and SDK code, and a few other modules: src/lib/sg2/, src/m2c_o2/). splat finds 26,134 functions (5,399,396 bytes of code) in
.text. Matched so far, as ByteMatch counts it: 14,104 of 26,130 functions
(16.16 % of code bytes), all checked byte for byte and at full length by
tools/build.sh, including every call target and global address (every relocated field resolved the way the linker
would and compared with retail, except 8 fields in 4 expat functions, see
docs/contributing/workflow.md): 3,534 simple shapes generated by
tools/gen_trivial.py (src/auto/) and 8,426 m2c drafts that matched as written, after decomp-permuter or after small hand fixes (src/m2c/). 466 Sony SDK and C
library functions carry their real names (identified by their code), 22 functions of the game's sound engine are
named from its own assert messages, and the game's copies of zlib 1.2.1, Lua 5.0
and expat 1.95.8 are built from their original sources (src/lib/: 48 zlib, 378 Lua and 152 expat functions
located so far); everything else still uses
placeholder names and types. python3 tools/progress.py prints the current numbers.
| Release | Region | Boot executable | Notes |
|---|---|---|---|
| v1.00 | NTSC-U | SCUS_975.01 |
Primary version |
Expected SHA-1 of the executable:
475f5225b1be4890e114063ece0578baa3dce89d
git clone https://github.com/Open-Ape/ae3-decomp.git && cd ae3-decomp
cp /path/to/SCUS_975.01 baserom/ # the executable from your own disc
python3 tools/check_baserom.py # checks the SHA-1
python3 -m pip install "splat64[mips]"
python3 -m splat split config/SCUS_975.01.yaml # disassembly into asm/ (not committed)
bash tools/build.sh # Linux / WSL: compiles src/ and compares every function
tools/build.sh needs Sony's EE GCC 3.2, builds 040921 and 030926 (32-bit Linux programs; on Windows they run in
WSL). Where to get them, the packages they need and every step in detail: docs/build/building.md.
Linking a complete executable is not set up yet; functions are compared one by one, including their relocations.
Start with CONTRIBUTING.md. Questions and discussion: Discord. All docs are listed in docs/README.md. Keep the build matching retail. Never commit game images, extracted game data, disassembly or proprietary compiler binaries.
- reape3: the Ape Escape 3 PC port (static recompilation), also part of Open-Ape. A developer preview: it runs, slowly, and needs your own copy of the game.
- Inspired by OpenRAC, whose Ratchet & Clank decompilation shows how a project like this can be organised.
Code written for this project is under the GNU General Public License v3.0 (see LICENSE). Code reconstructed from third-party binaries belongs to its copyright holders; see THIRD_PARTY_NOTICES.md.
This project is not affiliated with or endorsed by Sony Interactive Entertainment. Ape Escape and PlayStation are its trademarks, used here only to identify the game and the console.
