Skip to content

About

a Vagrant Story byte-matching decompilation

Resources

Stars

159 stars

Watchers

11 watching

Forks

Repository files navigation

Rood Reverse

A decompilation project for Vagrant Story for PlayStation 1, with a goal of enabling interoperability with modern hardware and fixing bugs in the original game.

This project does not contain any of the original files from the game disk, you must own a copy of the game.

Many thanks to the Chrono Cross Decompilation for much of the sound library code.

Heavily inspired by and indebted to the incredible work of the sotn-decomp team and the PS1/PS2 decompilation Discord server.

Grateful to the authors of Data Crystal’s Vagrant Story page for their excellent work and insights.

Thanks also to the following amazing projects (and their dependencies):

Status

Overall progress

Core libraries

SLUS_010.40 progress

Main game engine

BATTLE.PRG progress INITBTL.PRG progress SCREFF2.PRG progress

Effects

Total effects progress

EFFPURGE.BIN progress PLG005.BIN progress PLG044.BIN progress PLG045.BIN progress PLG047.BIN progress PLG049.BIN progress PLG050.BIN progress PLG051.BIN progress PLG053.BIN progress PLG057.BIN progress PLG061.BIN progress PLG065.BIN progress PLG065.BIN progress PLG073.BIN progress PLG077.BIN progress PLG081.BIN progress PLG082.BIN progress PLG085.BIN progress PLG086.BIN progress PLG087.BIN progress PLG114.BIN progress PLG128.BIN progress PLG129.BIN progress PLG134.BIN progress PLG135.BIN progress PLG137.BIN progress PLG138.BIN progress PLG139.BIN progress PLG141.BIN progress PLG142.BIN progress PLG143.BIN progress PLG146.BIN progress PLG147.BIN progress PLG148.BIN progress PLG149.BIN progress PLG150.BIN progress PLG152.BIN progress PLG153.BIN progress PLG154.BIN progress PLG156.BIN progress PLG158.BIN progress PLG160.BIN progress PLG161.BIN progress PLG162.BIN progress PLG165.BIN progress PLG166.BIN progress PLG167.BIN progress PLG168.BIN progress PLG169.BIN progress PLG198.BIN progress PLG224.BIN progress PLG232.BIN progress PLG232.BIN progress PLG242.BIN progress PLG246.BIN progress PLG250.BIN progress PLG255.BIN progress PLG260.BIN progress PLG263.BIN progress PLG265.BIN progress PLG265.BIN progress PLG272.BIN progress PLG273.BIN progress PLG291.BIN progress PLG297.BIN progress PLG300.BIN progress PLG300.BIN progress

Menus

Total menu progress

MAINMENU.PRG progress MENU0.PRG progress MENU1.PRG progress MENU2.PRG progress MENU3.PRG progress MENU4.PRG progress MENU5.PRG progress MENU7.PRG progress MENU8.PRG progress MENU9.PRG progress MENUB.PRG progress MENUC.PRG progress MENUD.PRG progress MENUE.PRG progress MENUF.PRG progress

Title and Ending Sequence

TITLE.PRG progress ENDING.PRG progress

Editable content

The entirety of the game's menu code and data is decompiled, including all files in MENU and SMALL, with the exceptions of MENU/MCDATA.BIN, MENU/OPMCIMG1.BIN and MENU/OPMCIMG2.BIN.

Much of the menu code has been refactored and is readable, and the menu executables are completely relocatable. It should be possible to rewrite the menu code arbitrarily, the method and data addresses in other modules will be relinked appropriately.

Due to the presence of a large number of empty sectors at the start of each directory on the disk, it should also be possible to rebuild the disk without affecting sector-based data loading in BATTLE.PRG, as long as the number of dummy sectors is adjusted accordingly.

(Naive) Quickstart

  1. n.b.: You may want to consider limiting the jobs spawned by make to something sensible like -j8.
  2. Fork the project
  3. Install system dependencies and copy disk image (see "Setup" below)
  4. Run make -j to perform an initial split & build
  5. Pick a function to decompile, use make decompme to create a scratch on decomp.me
  6. Claim and decompile the scratch
  7. Copy the decompiled code where it belongs
  8. Optionally use make permute if needed
  9. Run make remake -j, and finally make format if the code compiles successfully
  10. Open a PR

Setup

The project is mostly self-configuring but requires a minimal amount of setup.

  • Make sure the following packages are installed, older versions may also work but this is not tested. This configuration works as-is on Ubuntu 26.04 on WSL; depending on your distro you may need additional packages.
Package Minimum Version
clang-format 21.1.8
g++ 15.2.0
binutils-mipsel-linux-gnu 2.45.90
make 4.4.
python3 3.14.4
python3-venv 3.14.4
unzip 6.00
wget 1.25.0

Take a look at ./Dockerfile for a minimal setup on Ubuntu

  • Dump your original disk to disks/SLUS-01040.bin
  • Run make -j to finish installation and perform an initial build

Build targets

  • make -j should be all that is needed most of the time. The first execution will configure the remaining dependencies in the tools directory and extract the files from the disk; from then on it will perform a minimal rebuild.
  • make decompme TARGET=path/to/nonmatchings/source.s uploads the target function to a new decomp.me scratch.
  • make permute TARGET=path/to/nonmatchings/source.s invokes the permuter for the target assembly file.
  • make remake -j will delete and re-split the targets; this can be necessary if the dependency management has failed to identify everything that needs rebuilding (in which case a bug report is appreciated!), or if the configuration has changed enough to be no longer valid (e.g. orphaned .d files). It's good practice to run this before submitting a pull request to make sure everything still works.
  • make format formats the source files and symbol addresses for consistency. Please run this before submitting a PR.
  • make clean simply deletes the build and nonmatchings directories
  • make clean-all will completely reset the project, including dropping any source changes and data files (but not the disk image). Use with caution.

About

a Vagrant Story byte-matching decompilation

Resources

Stars

159 stars

Watchers

11 watching

Forks

Releases

Packages

Used by

Contributors

Languages