- C++ 56.8%
- C 25%
- Python 18.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| config/PCV2 | ||
| docs | ||
| drafts | ||
| hooks | ||
| orig/PCV2 | ||
| src | ||
| tools | ||
| .gitignore | ||
| AGENTS.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
Phantasy Star Online (PC, Japanese)
A work-in-progress matching decompilation of Phantasy Star Online for PC, Japanese V2 retail final (Episode 1 only; no EP2, no EP4): C and C++ source that compiles to the same code as the game's executable, function for function, in its original translation units.
Nothing from the game is included here. You need your own copy of the game to build it; see Legal.
Progress
Measured on pso.exe at the latest commit; a function is matched when it
compiles to the original's exact bytes, and code/data are linked when the
build takes them from compiled source instead of the original. Counts are
computed, never hand-written:
- Progress table — generated by
python tools/gc_progress.py(regenerate it whenever the build state changes; never edit by hand). - Badge endpoint JSONs (donor shape, ready for hosted badges) are written
to
build/badges/*.jsonby the same tool; they wire to hosted images when the project gains a remote (seedocs/parity.md, Decisions).
Target
| Game | Phantasy Star Online, PC (Windows), Japanese, V2 retail final |
| Executable | pso.exe, SHA-1 bb7f9fd59e8cb729f086fc3c2c431b9537d29e39 |
| Built | 2003-02-06; Intel C++ 5.0 b001120 (library units) + Visual C++ 6 (game units), linked with VC6 link.exe |
| Sections | .text 0x40e000, .rdata 0x64c000, .data 0x676000, .data1 0x7bf000 |
The executable ships without symbols. The repo carries the recovered
registries it needs: the function inventory (config/PCV2/symbols.txt,
from a fresh analysis of the target), the verified data-label inventory
(config/PCV2/data_symbols.txt), and the embedded compiler records that
name the original build units. Names are recovered from the binary's own
class-name registry, embedded compiler records, sibling decompilations of
the same engine, and code reading. Functions without evidence keep a
placeholder such as fn_0040E013.
Building
Requires Python 3.10+ and user-supplied compiler kits: a Visual C++ 6
toolchain (Enterprise RTM cl/link), an Intel icl 5.0.1 kit, and the
DirectX 8.0 SDK import libraries for the relink. The kit locations are
resolved by tools/gate_relink.py — override them with the ZPC_MSVC6
and ZPC_ICL environment variables. (Run python tools/configure.py
first: it verifies the kits and writes hash receipts into build/;
--fetch stages them into gitignored build/tools/. The template's
one-command ninja wiring stays deferred by owner decision —
docs/parity.md, Decisions.) Put your pso.exe in orig/PCV2/,
then:
python tools/zpc.py gate # relink whole image, byte-compare vs the pin
python tools/zpc.py ci check # regression gate (linked units, splits, carve registry)
The gate compiles every source-linked unit, relinks pso.exe from those
objects plus the original objects for everything not matched yet, and
checks the assembled image against the pinned SHA-1. Code that is not
decompiled yet still comes from the original, so a passing build does not
mean the decompilation is complete.
The working CLI is python tools/zpc.py <verb> —
brief, lookup, try, probe, compiled, misses, twins, check, grid, land, progress, gate, ci drive the whole match workflow; run
python tools/zpc.py brief for orientation.
Objdiff and the progress page
The per-unit diff view uses objdiff:
python tools/zpc.py gate— produce the per-unit objects.python tools/objdiff_config.py— emitobjdiff.jsonat the root (gitignored) plus the original-bytes target objects for linked units.build/objdiff-cli.exe report generate -p . -o build/progress.json— the per-unit report.python tools/gc_progress.py— badges +docs/progress.md.
Working on it
- Data-milestone tail: descriptor record shapes for the registered clusters; class-name transfer onto the vtable scaffold.
- The icl library tail (real stamped paths held): unit-boundary partition and the icl 5.0→5.0.1 substitution problem — the surviving kit cannot reproduce the target's 5.0 codegen in the measured classes; the choice between substitution work and evidence-carving is an owner decision.
- Cross-build name transfer from the GameCube donor (the 623-name
class intersection already banked in
config/PCV2/gc_class_match.json). - Match grind cadence: batches from the ranked
zpc misseslist, parked by owner direction.
Credits
pso-decomp-master(GameCube, Episode I & II Plus) — format, standards and house template; the donor this repo shapes itself after.psopct-decomp(PC, V2 demo) — x86 match/build machinery concepts, compiler-identification lore, and the provenance of both staged compiler kits.objdiff— the per-function diff UI.- zkit — the CLI verb conventions
zpcmirrors.
Legal
This repository contains no game assets, no game files, no compiler
binaries and no code copied from the game. Every line of game source in
src/ was written by hand to compile into the same machine code as the
original; the CRT units link the Visual C++ 6 runtime source that ships
with the (user-supplied) toolchain, and are never game code.
Everything else the build needs comes from your own legally obtained
copies, on your machine, when you build.
Phantasy Star Online is a trademark of SEGA. This project is not affiliated with or endorsed by SEGA.