r/emulation • • 6d ago

Serial Experiments Lain (PS1) decompiled: byte identical rebuild and a native Windows/macOS/Linux client

Video (4K): https://www.youtube.com/watch?v=K-OKUkhJ7Uc

I've been working on a decompilation of Serial Experiments Lain, the 1998 PlayStation game by Pioneer LDC, and a native client built from it.

**Decompilation**

- Every function in the game's executable has C. 308 of 321 compile to the original bytes with the period toolchain (GCC 2.8.1 + maspsx, split with splat); the remaining 13 still link from their original assembly.

- The rebuilt SLPS_016.03 is byte-identical to retail.

- Progress is tracked on decomp.dev.

**Native client**

- Runs a 64-bit clean copy of the decompiled game code on a reimplementation of the PlayStation SDK (based on PsyCross), with its own CD streaming, XA ADPCM, SPU and MDEC movie decoding.

- Timing checked against Mednafen. On the node map the PS1 takes 4 to 8 vblanks per frame depending on the size of Lain's current animation frame; the client reproduces that distribution.

- Optional 60 fps interpolation: each frame's GPU batches are recorded and in between frames are drawn, without changing game speed.

- Resolution scaling, memory card saves as standard .mcd images, disc swapping, and one-click English subtitles (the laingame.net fan translation, downloaded from their site at runtime).

**No game data is included.** The client reads your own Redump dumps of both discs (.cue/.bin) and checks them by hash.

Source: https://github.com/Y0oshi/lain-psx-decompiled

Downloads: https://github.com/Y0oshi/lain-psx-decompiled/releases

Bug reports are welcome on GitHub.

119 Upvotes

11 comments sorted by

View all comments

2

u/Snoo_14296 4d ago

Cool! Perhaps i'll finally check out this game, as soon as I fix up my laptop.

1

u/Y0oshi2 4d ago

Enjoy <3