返回资讯中心
外部精选
软件工程
#开发者实时流

Vib-Ribbon (PS1) decompiled to C++, rebuilds byte-identical

Vib-Ribbon (PlayStation, PAL, SCES-02873) decompiled to C++.

Hacker News 最新PawiX252026/10/23 · 22 天前10 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Vib-Ribbon (PlayStation, PAL, SCES-02873) decompiled to C++.

All four executables of the game are rebuilt from this source and are byte-identical to the ones on the disc:

The game was written in C++ and compiled with GCC. This source is C++ too: real classes with named members, the SGI STL 3.2 the game used, and the original split into source files. It is built with egcs 2.91.66 (egcs 1.1.2), with one change to its C++ compiler where the game's compiler behaved like GCC 2.95 (see bin/README.md).

The game's own code is C++, apart from five functions that still come from assembly: Effect::operator=, Gameplay::Update, Gameplay::AddEvent, Glue::Update and the static initializer of NumberVoice.cpp. Their C++ is next to them (under NON_MATCHING), with what still differs written down.

Sony's PSY-Q libraries (graphics, sound, CD, ...) stay as assembly.

A few unused strings and data blocks (debug text from headers the game never calls, for example) are taken from the original executables as data.

The debug menus

The game still has its developers' debug menus, and nothing in it opens them. The debug-menu branch adds a way in (select on the first controller) and describes the menus in its docs/debug_menus.md.

You need your own copy of the game: this repository has none of its files.

Requirements: Linux or WSL 2 (tested on Ubuntu 24.04), make, binutils-mips-linux-gnu, Python 3 and python3-venv. The compiler is in bin/ (see bin/README.md).

git clone --recursive https://github.com/PawiX25/revib.git cd revib python3 -m venv .venv . .venv/bin/activate pip install -r tools/requirements.txt

SCES_028.73, MAIN_T.EXE, MAIN_K.EXE and MAIN_G.EXE go into iso/: copy them

from your disc, or take them out of an image of its data track with

python3 tools/mod/psxdisc.py extract "Track 1.bin" iso "*.EXE" SCES_028.73

make extract kiosk-extract game-extract loader-extract make make kiosk kiosk-check make game game-check make loader loader-check

make builds the title and checks it; each check prints OK when the SHA-1 of the built executable is the original's (kept in the .sha files).

To compare a function of a build with the original, use asm-differ, e.g. python3 tools/asm-differ/diff.py --exe game Draw__10ModelMovie (see diff_settings.py).

tools/mod/ has small Python tools for the game's data, written from what the decompiled code reads:

python3 tools/mod/psxdisc.py list "Track 1.bin" python3 tools/mod/psxdisc.py extract "Track 1.bin" out "GAME/*" python3 tools/mod/pak.py list out/GAME/02_FILES.PAK python3 tools/mod/pak.py get out/GAME/02_FILES.PAK CHARA/PEELOO/MODEL.TMD vibri.tmd python3 tools/mod/pak.py get out/GAME/02_FILES.PAK CHARA/PEELOO/N00_SKIP.ANM run.anm python3 tools/mod/tmd.py png vibri.tmd parts.png python3 tools/mod/anm.py png vibri.tmd run.anm 0 vibri.png

The banner above and the picture below are drawn from your disc by tools/mod/examples/banner.py and cast.py, with the game's own models, font, movies and jitter (see each script's docstring). They need Pillow, which tools/requirements.txt installs.

python3 tools/mod/examples/banner.py "Track 1.bin" banner.png --gif banner.gif python3 tools/mod/examples/cast.py "Track 1.bin" cast.gif

Always work on a copy of your disc image.

Path What

src/game/ the game's source, one file per original source file

include/ the PSY-Q headers, the SGI STL and the build's own headers

config/ how the executables are split (splat) and their symbols

docs/ notes, such as the list of source files (translation_units.md)

bin/ the compiler

tools/ splat, maspsx, asm-differ, decomp-permuter, m2c, mod tools

Credits

The build setup grew out of the open-ribbon project (github.com/open-ribbon/open-ribbon); the code here is a C++ rewrite. Tools by their authors: splat, maspsx, asm-differ, decomp-permuter, m2c, decompals/old-gcc; the SGI STL 3.2. The pictures in docs/ are drawn from the game's own models, font and movies.

Vib-Ribbon © Sony Interactive Entertainment / NanaOn-Sha. This is an unofficial project, not affiliated with them.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →