Skip to content

OpenGTA ​

Grand Theft Auto (1997), reimplemented from the original Windows executable

GitHub · Website, user guide & internals · Download · Play in the browser

Driving a stolen car through Liberty City in OpenGTA

About ​

Grand Theft Auto is DMA Design's 1997 original: three cities seen from above — Liberty City, San Andreas and Vice City — traffic, pedestrians, the police, trains, and missions handed out over payphones. OpenGTA is a from-scratch reimplementation of its Windows version in C11, reproducing the original's behaviour, quirks and bugs included. It runs on gasm: one opengta.wasm for macOS, Linux, Windows and the browser.

Nothing was rewritten from memory. The executable is stripped, so the first step was naming all of its 1,795 game functions in Ghidra and documenting the binary module by module; the port follows that map, and the tables the game needs — vehicle and ped tables, mission names, maths and text — are read from the user's own executable at run time rather than copied.

Bring your own copy ​

OpenGTA ships no original code, assets or data. It uses the Windows version from Rockstar's 2002 re-release (GTAINSTALLER.zip): either the installed game, or simply the unzipped installer. The installer keeps everything inside InstallShield 5 cabinets, so OpenGTA reads those directly — all 195 files, including the music track that is split across data1.cab and data2.cab and that unshield fails to extract.

What the original turned out to be ​

PieceWhat it is
TimingThe game waits for three ticks of a 70 Hz timer from the Miles sound library every frame: it runs at 23.33 frames a second, the menus at 35 ms a frame
RendererA software rasteriser: 64×64 tiles in 256×256 pages, texture coordinates that wrap in 8 bits, every block face drawn as an affine trapezoid
Car physicsA rigid-body model in x87 floating point at 53-bit precision, reproduced operation by operation
MissionsMISSION.INI: 17 sections, 72 object types and an interpreter of about 150 commands with 32 script processes
SoundMiles Sound System 3.6: 22,050 Hz stereo, 8-bit output, every one-shot with a random pitch (the check meant to prevent it tests the wrong variable)
IntroA Smacker movie, decoded by a clean-room decoder written from the public format description

Beyond the original ​

Optional and off by default: hires=2..4 draws the game, the HUD and the menus at up to 2560×1920 while the game runs unchanged underneath (the faithful renderer still runs every frame), upscale=xbr upscales the original art, and skins layer your own replacement art — tiles, sprites, fonts, pictures — over it, with a template generator and a validator. Creating a skin.

Verification ​

Twenty-three headless tests run the ported code against the real data: the level start of every city, walking, driving, collisions, traffic, police, trains, fires, the HUD, the menus, the movie. Runs are deterministic: the same scripted input gives bit-identical video and audio on the native and the browser runner, and the release bundles are smoke-tested on each system before publishing.

Status ​

Intro movie, menus, options, high scores, cutscene stillsDone
Liberty City, San Andreas, Vice City: city renderer, sprites, HUDDone
Walking, stealing and driving cars, weapons, explosions, firesDone
Traffic, traffic lights, pedestrians, police, ambulances, fire engines, trainsDone
The mission interpreter, phones, triggers, garagesDone
Data from the installed game or the unzipped installerDone
Release0.2.0: bundles for macOS (universal), Linux (x86_64, arm64) and Windows (x86_64), and opengta.wasm for gasm 0.6.0+
PlatformsEverything gasm runs on: macOS, Linux, Windows and the browser
NextPlaying missions through and comparing them with the original; the London expansions

GPL-3.0. Grand Theft Auto is © 1997 DMA Design / Rockstar Games.