Xenosaga Ep I Decompilation Project

Hello, everyone!

For a little over a week now, I’ve been working on an AI-assisted matching decompilation of Xenosaga Ep I.

So far, I’ve managed to decompile 3,669 out of 7,645 game functions (47.992%) + ~600 Java files that the game uses for scripting scenes and cutscenes.

The ultimate goal, in addition to preserving the game’s code, is to create a native PC port based on this decompilation with improvements and easier mod capabilities.

I hope you like it, and if you’d like to contribute, here’s the repository: GitHub - OpokXeno/xsg-i-decomp: Matching decompilation of Xenosaga Episode I: Der Wille zur Macht for the PS2 · GitHub

Oh this is awesome! I’ve also been working on this, along with a few other folks privately on a discord server. I probably need to create a venue for collaboration on AI projects.

Would you like to share work? we may be able to fill gaps together.

I’d be happy to help in any way I can, of course. And I’d love to collaborate on whatever is needed!

1 Like

That’s to say this is something I think EVERYONE wants to see happen, but we don’t all have all the tokens and all the know how so it would be efficient to have one project if you’re open to working on it collaboratively. I am actually hoping to open discussions on AI/llm use here and this is good motivation for that. Thanks so much for sharing your project. I’ve been nervous to share mine until I know it’s click to run. We should also be discussing legality (how to use the bleem court case).

I think it’s awesome multiple folks are working on it, but it’s a huge effort so it’s important to stick the landing since this is something a lot of people want.

I’ll send you a GitHub invite :emote-pyra-happy:

1 Like

I agree. In fact, I didn’t know you were already working on it. If I had known, I probably would have tried to help with that instead of starting my own project. There’s strength in numbers

1 Like

Awesome! Thank you, I’m looking forward to collaborating on this. Peeking at your repo, you’re quite ahead of me on the C from the ELF file. :slight_smile:

I have been beginning my efforts on the asset extraction/runtime level, so this pairs quite well. We’ve been working in different directions so there’s not much repeat.

Per quick analysis against your repo…

I got:

  • Disc/asset layer — iso9660.py, ARX/XTX/FL00, byte-perfect ARX compressor, in-place ISO patcher, textpack/subs
  • Java at the byte level — 2,233 classes in classes/ + classes_norm/, the NUL-terminated-Utf8 quirk, CLASS-MAP.json. The inputs a .class rebuild gate needs.
  • 428 XS1↔XS3 function matches + the masked-compare engine that produced them.
  • Unicorn differential-execution harness (compiler-id/, run_mips.py) — behavioral equivalence when bytes won’t match.
  • PINE/PCSX2 live-memory rig (flag-hunt/). (this is an internal workspace reference to my effort to find action flags in RAM)
  • A runtime — EE core, VU0 macro interpreter, HAL, IOP/SIF HLE; xs1-playable’s AOT plan.
  • SSD.IRX/RSSD.IRX — ssd.py/ssd_render.py sequencer + SPU2-faithful sampler.
  • XS3 and the trilogy — XS3 decomp, HD plan, FMV format.

You have:

  • The matching C tree — 307 .c, 232 .h, 3,669 functions.
  • Toolchain identity — the patched cc1 (12 documented byte patches), patched ee-as, full provenance with rebuild recipes.
  • splat configs for all six binaries + symbol .txt/.ld files.
  • ninja build, whole-file SHA-256 gate, accepted-asm provenance gate.
  • Reverse-engineered types — struct layouts and field semantics with VA-cited evidence, plus a whole header-canon system (generated headers, umbrella, type ownership).
  • Vu0MicroCode.dvp carved out as a build input
  • decomp.dev progress reporting.

We both have:

  • The six binaries — all six SHA-256s identical to ours, verified.
  • Symbol tables (their config/symbols/*.txt ≈ our 15,132-row symbols.csv).
  • ee-gcc 2.96 at -O2 -G8 identified as the compiler; splat as the splitter.
  • The Java event layer decompiled to source
  • First-pass decompilation (our Ghidra sweep, their m2c).

I just got done with work but I’ll do a push on my repo to make sure my work is up to date then invite you shortly. :emote-pyra-smile:

As bit of an update to the prior message, what I have done is more a compatibility kit. I’ll go on and share that publicly now that it’s known folks are working on this.

I had gotten pretty mucky into XSIII and wanted a way to sanity check and XSI had some easier inroads for developing that. I speak with a person on discord who is doing parallel elf work to you, and I hope you both get use from this.

I also added you to two private repos: my XSI work (only thing I really might have that you maybe do not is some Java code, but sharing just in case) and my XSIII work which is a good bit further with the actual decomp work (it can compile Hakox in isolation but I wanted deeper sanity checking before going further).

I also found out tonight (you may know) this project on GH has progressed quite a bit since I last looked at it: GitHub - ran-j/PS2Recomp: Playstation 2 Static Recompiler & Runtime Tool to make native PC ports · GitHub

Exciting things!

Edit; sorry I’m replying a lot, im just very enthusiastic

Your replies aren’t a problem,don’t worry.

If you want, we can chat on Discord. That way we can communicate better. My Discord username is opok (opok#385830).

Other than that, I do have the Java decompiled, yeah; it’s in the `script/` folder of my repo.

As for the PS2 recompilation project, I’m familiar with it. At first, I thought about using it instead of doing a decompilation, but I’m currently working on a recompilation of Xenogears, so I’m well aware of the limitations of recompilation, and I know that a native port based on a decompilation, using native calls rather than high-level emulation, could offer us much more for Xenosaga.

1 Like

Awesome! I see you got my invite, I’ll set up the groupchat shortly. Thanks for sharing your username.

As far as true decomp goes, I was looking into that vs existing recomp projects this morning. I’m hopeful we can bring our work together in that direction. I pulled your repo yesterday and ran tests against the Xenosaga I unpack tool, and your stuff looks great. Thanks again for sharing and I look forward to discussing it further on here and on discord.

1 Like