This project is an in-progress matching decompilation of Chrono Cross for PlayStation 1. The project currently targets the Japanese release (SLPS 023.64) extracted from the Chrono Cross: Radical Dreamers Edition remaster.
The original PlayStation 1 release of Chrono Cross uses complex custom disk sectoring and data packing that makes it extremely difficult to extract cleanly. Fortunately, the 2022 Radical Dreamers Edition remaster provides us with a much cleaner extraction path.
The remaster works by running an emulator that loads the original PS1 game from a file called cdrom.dat - which is essentially a zip file containing an unmodified copy of the original Japanese PS1 release (SLPS 023.64). The emulator then injects modern features like new fonts and artwork at runtime.
By extracting cdrom.dat from Radical Dreamers Edition, we get direct access to the original PS1 binary without having to deal with the nightmare of custom disk sectoring.
This project stands on the shoulders of giants and owes a huge debt to:
- splat - Binary splitting and disassembly
- spimdisasm - MIPS disassembly
- Xenogears decomp - Project structure and infrastructure inspiration
- MASPSX - PSY-Q compatible assembler
- objdiff - Function diffing tool
- decomp.dev - Progress tracking and visualization
- decomp.me - Collaborative decompilation platform
- The Chrono Compendium community for reverse engineering research
- q-gears reverse - Reverse engineering of similar games
These instructions assume you're using a Debian-based Linux distribution (Ubuntu, Debian, etc.). If you're on Windows, you can use WSL2.
sudo apt update
sudo apt install git make 7zip \
binutils-mips-linux-gnu gcc-mips-linux-gnu \
python3 python3-pip python3-venvIf on an ARM-based architecture or VM, you'll need these packages as well
sudo apt install qemu-user-static binfmt-supportgit clone --recursive https://github.com/jdperos/chrono-cross-decomp.gitWe use a virtual environment to manage Python packages:
cd chrono-cross-decomp
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtImportant: Each time you open a new terminal, you'll need to reactivate the virtual environment:
source .venv/bin/activateYou need to own a legal copy of Chrono Cross: Radical Dreamers Edition. The game is available on:
- Steam
- PlayStation 4/5
- Nintendo Switch
- Xbox
For Steam (PC):
-
Locate your game installation directory:
- Windows:
C:\Program Files (x86)\Steam\steamapps\common\CHRONO CROSS THE RADICAL DREAMERS EDITION\ - Linux: idk lol
- Windows:
-
Find the
cdrom.datfile (in thedatafolder) -
Copy it to the project's
disc/directory:
# From the project root
mkdir -p disc
cp "/path/to/cdrom.dat" disc/cdrom.dat- Verify the checksum:
sha1sum disc/cdrom.dat
# Should match: 354e6593b639c245ba41db1d0bd49664feb4c65eFor Console Versions:
Extracting from console versions requires additional steps beyond the scope of this README.
Once you have the ROM in place:
make setupThis will extract cdrom.dat to expose all of the program data, as well as download necessary linked dependencies
Build the project and verify it matches the original:
make clean-checkIf successful, you should see:
build/out/prog/slps_023.64: OK
make generate- Split the binary into assembly onlymake build- Build the executable without checkingmake check- Compare built executable against originalmake clean- Clean build artifactsmake reset- Wipe repository (bigger clean)make generate-context- Generate context file for m2c and decomp.memake objdiff-config- Generate objdiff configurationmake decompile FUNC=<symbol>- Decompile a function to C using m2cmake asm-diff FUNC=<symbol>- Show a TARGET vs BASE instruction diff tablemake permute FUNC=<symbol>- Run the permuter on a function
Happily welcoming contributions! Here are some ways you can help:
The primary goal is to match functions - converting assembly back into C code that compiles to identical machine code.
- Choose a function to work on from the
src/directory - Use decomp.me to collaboratively match the function
- Platform: PlayStation 1
- Compiler:
gcc 2.8.1-psx + maspsx - Flags:
-Wall -Wa,--aspsx-version=2.79,--expand-div -g3 -O2 -G0 - Source ASM copied from
asm/directory aftermakegenerate commands - Context can be generated using
make generate-contextintoctx/project.ctx.c
- Alternatively Use objdiff locally for matching
- Call
make objdiff-configto generate asm, objdiff.json, and context file - Open objdiff and point the project to the root directory
- Preferred workflow on Windows/WSL is to run native Windows objdiff and point it to the directory in WSL
- Explore the objects in the project viewer to find your function target
- Run this command, replacing the paths and function name
python ./tools/cc_decompile.py -c \ ./src/slps_023.64/path/to/source.c / ./asm/slps_023.64/nonmatchings/path/to/source/func_01234567.s- Replace the
INCLUDE_ASM()macro in your corresponding file with the generated code as a starting point
- Call
- Submit a pull request with your matched function
Help document and understand the game's systems:
- Join the Chrono Cross repository Ghidra server on decomp.dev for static analysis
- Name functions, variables, and data structures in
config/symbol_addrs.*.txtand source/header files - Identify program layout and splits in
config/*.yamlfiles - Document game systems and algorithms
- Use emulator debuggers (PCSX Redux, no$psx) for dynamic analysis
Improve the build system and developer experience:
- Enhance Python scripts
- Improve objdiff/decomp.me integration
- Create Ghidra scripts for importing symbols
- Document workflows
chrono-cross-decomp/
├── asm/ # Splat-generated assembly (the "target") (gitignored)
├── build/ # Build files (gitignored)
│ ├── asm/ # Built from assembly for comparison
│ ├── out/ # Map and elf files
│ └── src/ # Built from decompiled source code
├── config/ # Splat configuration and symbol addresses
├── ctx/ # Generated context files (gitignored)
├── disc/ # ROM (gitignored)
│ └── cdrom.dat # Disk image copied from Radical Dreamers edition
├── expected/ # Compiled objs from decompiled, used for objdiff
├── game/ # Game files extracted from cdrom.dat (gitignored)
│ └── prog/ # Game program data
│ └── slps_023.64 # Main game executable
├── include/ # C header files
│ ├── psyq/ # PSY-Q SDK headers
│ └── system/ # Game system headers
├── lib/ # Psyq libraries (gitignored - pulled in script)
├── linker/ # Generated linker scripts (gitignored)
├── nonmatchings/ # Permuter work directory
├── src/ # Decompiled C source code
│ └── slps_023.64/ # Main executable source
├── tools/ # Build tools and scripts
- Issues: Use GitHub issues for bug reports and feature requests
- Pull Requests: Submit PRs for matched functions and improvements
New to decompilation? Check out these resources:
- decomp.me FAQ - Learn the basics of matching decompilation
- MIPS Assembly Reference - Understanding PS1 assembly
- C Programming Tutorial - Brush up on C
- Compiler Explorer - See how C compiles to assembly
Progress is tracked and visualized on decomp.dev.
This project is for educational and preservation purposes only. You must own a legal copy of Chrono Cross to extract the ROM. We do not distribute any copyrighted game assets.
Chrono Cross © 1999-2022 Square Enix Co., Ltd. All Rights Reserved.