lain-psx-decompiled-android
lain-psx-decompiled-android is a decompilation and native Android port of Serial Experiments Lain for PlayStation with touchscreen and gamepad support.
- Type: PC port
- Game: Serial Experiments Lain
- Runs on Android
- By VandalsEmpire
- Latest release android-v0.2.0, 2026-11-06
- Source: https://github.com/VandalsEmpire/lain-psx-decompiled-android
README
English | 日本語
This is a decompilation of Serial Experiments Lain (PlayStation, Pioneer LDC, 1998) and a native client for Windows, macOS and Linux built from it.
The decompilation recreates the game's source code in C. Compiled with the original PsyQ toolchain, it rebuilds an executable byte-identical to the retail one. The native client runs the same code on a reimplementation of the PlayStation SDK, with no emulator.
| Disc | Serial | Executable | SHA-1 of the data track (Redump) |
|---|---|---|---|
| Disc 1 | SLPS-01603 | SLPS_016.03 | 6426fbdb45f27e089af650cddb8c41929c7890de |
| Disc 2 | SLPS-01604 | SLPS_016.04 | 409668af454a0e0a33a71c1d22918d765e718608 |
The rebuilt SLPS_016.03 has SHA-1 a0012634f82dd7fcc4ee5a3f97ddc052573b4815. Disc 2's
executable is identical.
Important
This repository and its releases contain no game data. Movies, voices, images, sounds, text and data tables are read from your own dump of the two original discs.
Android (re:Lain)
This fork includes re:Lain Android, a native Android client for Serial Experiments Lain (PlayStation).
Download Android releases | Android documentation
Requirements
- Android 6.0+ (API 23)
- ARM64 device (
arm64-v8a) - OpenGL ES 3.0
- Your own dumps of the original PlayStation discs
Features in v0.2.0
- Wired Workstation launcher, inspired by classic Unix desktops
- Improved launcher/game session handling
- Play → Launcher → Play without restarting the application
- Touchscreen controls and physical gamepad support
- Mod importing and management
- Archive with unused images, animations and audio
- Individual PNG export and batch ZIP export
- Community subtitles: PT-BR, English, Spanish, French and German
- Subtitle download and selection directly from the launcher
- Original Japanese audio and game content
Getting started
- Install the APK from GitHub Releases.
- Import your own Disc 1 raw BIN/IMG data track.
- Import Disc 2 when needed.
- Choose optional subtitles in the launcher.
- Press Play.
The importer accepts raw 2352-byte-per-sector BIN/IMG data tracks. CHD and 2048-byte ISO files are not supported.
Limitations
- ARM64 only
- Landscape orientation
- Unicode subtitle support for non-Latin scripts is deferred
- Compatibility varies by Android device
No copyrighted game data is included. The client reads the player's own imported disc images.
Desktop clients
The Windows, macOS and Linux clients are maintained in the upstream project.
Playing on desktop
-
Dump both discs in Redump format (
.cue+.bin). -
Download the client for your system from Releases:
System Package First launch Windows 10/11 (x64) Lain-windows.zipRun lain.exe. On a SmartScreen warning: More info, Run anyway.macOS (Apple Silicon) Lain-macos.zipRight-click Lain.app, Open.Linux (x86-64, glibc 2.35+) Lain-linux-x86_64.tar.gzRun ./lain. Needs OpenGL 3.2.The builds are not signed.
-
In the launcher, add both discs (file picker or drag and drop). The client verifies them and copies them into its data folder.
-
Choose window size, subtitles and options, then press Play.
F1 opens the in-game menu: display, volume, languages, key bindings, cheats and mods.
| PlayStation | Keyboard | In Lain |
|---|---|---|
| D-pad | Arrow keys | Move the cursor, select a node |
| ○ | V | Confirm, open a node |
| × | C | Back |
| △ | Z | Menu (load, save, ...) |
| Start | Return | Continue, skip |
Gamepads work as controller 1. Full controls and options: port/PORTING.md.
Features
| Feature | Details |
|---|---|
| Original behaviour | Game logic, timing and pacing match the PlayStation, measured on real hardware. |
| Display | Resolution scaling, fullscreen, optional 60 fps motion interpolation at the original game speed. |
| Subtitles and dubs | Plain .srt, .ass and .ogg folder packs. The launcher can download the laingame.net English fan subtitles from their source; none are bundled. |
| Saves | Standard 128 KiB memory card images (.mcd), usable with emulators. |
| Unused content | A launcher tab showing content on the discs that the game never uses, decoded from your own dump. See docs/findings. |
| Mods | Replace pictures, text, voices, movies and game data, HD texture packs, Lua scripts that hook any game function, and native plugins, managed in the launcher's Mods tab. See MODDING.md. |
Status
| Part | State |
|---|---|
Decompilation (src/) | All 321 game functions are C that compiles to the original bytes, and the EXE is byte-identical. Sony's PsyQ libraries link from their original code. |
Native client (port/) | Plays the whole game: both sites, all voice sessions and movies, disc swap, all four endings. |
| Naming | Most functions, globals and struct fields are named. |
Open work is tracked in docs/ROADMAP.md.
Building the client
Requirements: CMake, a C/C++ compiler, SDL2 and OpenAL (openal-soft).
# macOS: brew install cmake ninja sdl2 openal-soft
# Linux: apt install cmake ninja-build libsdl2-dev libopenal-dev libgl-dev
cmake -S port -B build/port -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build/port
build/port/lain
The Windows build is cross-compiled with MinGW-w64 in Docker, from macOS or Linux
(port/tools/package_windows.sh below).
Release packages link every dependency statically:
port/tools/package_macos.sh # dist/Lain-macos.zip
port/tools/package_windows.sh # dist/Lain-windows.zip (MinGW-w64 in Docker)
port/tools/package_linux.sh # dist/Lain-linux-x86_64.tar.gz (Ubuntu 22.04 in Docker)
Building the decompilation
Requirements: Python 3, Docker (provides GCC 2.8.1-psx and maspsx), and both disc dumps.
python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
tools/disc.py extract path/to/disc1.cue --disc 1
tools/disc.py extract path/to/disc2.cue --disc 2
tools/docker.sh make split # disassemble the executable into asm/
tools/docker.sh make # compile, link and verify
A successful build ends with build/SLPS_016.03: OK. To work on functions, see
docs/MATCHING.md.
Repository layout
| Path | Contents |
|---|---|
src/ | Decompiled game code (matching) |
include/, config/ | Headers, splat configuration, symbol maps |
tools/ | Disc extraction, build and matching tools |
port/game/ | 64-bit copy of the game code used by the client |
port/psx/ | PlayStation SDK reimplementation, based on PsyCross |
port/client/ | Launcher, overlay, settings, subtitle and dub packs, mods |
docs/ | Technical documentation and findings |
Documentation
| Document | Topic |
|---|---|
| DECOMPILATION.md | How the decompilation is organised |
| MATCHING.md | Matching workflow and tools |
| PORTING.md | Client internals, pack formats, options |
| MODDING.md | Making and using mods |
| findings | Unused and hidden content |
| ROADMAP.md | Open work |
License
This fork, including the Android port, is distributed under the upstream MIT License. The original copyright notice for Y0oshi is retained. Third-party components keep their own licenses; see thirdparty/.
Serial Experiments Lain is the property of its respective rights holders. This project is not affiliated with or endorsed by them. The icon is adapted from the game's memory card icon.