GTA San Andreas Runs Natively in 3D on a Real Nintendo DS With Just 4 MB of RAM Thanks to a Custom C++ Port

With just days left before the launch of Grand Theft Auto VI, indie developer and modder Sammwy has pulled off a hardware feat that long seemed out of reach. Through the open-source gtasands repository on GitHub, the creator has Grand Theft Auto: San Andreas running natively in 3D on a real Nintendo DS equipped with only 4 MB of RAM.
Until now, Nintendo's dual-screen handheld had only received one official entry built specifically around a top-down camera, 2009's Grand Theft Auto: Chinatown Wars. Squeezing the sprawling 3D open world of Los Santos onto a portable console roughly eight times slower than the PlayStation 2 required rewriting the entire runtime in C++17.
67 MHz Without an FPU and 4 MB of RAM: Conquering the Nintendo DS Bottleneck
When Rockstar North released the original PlayStation 2 masterpiece in October 2004 (which currently trades around $12.70 loose and $14.99 complete in box according to the Grand Theft Auto: San Andreas price guide on Retrocharting), it relied on a 294 MHz Emotion Engine CPU and 32 MB of RDRAM. By contrast, the standard Nintendo DS runs on a 67 MHz ARM946E-S processor with no floating-point unit (FPU) and a strict ceiling of 4 MB of main system RAM (expanding to 16 MB and 134 MHz in Nintendo DSi mode).
Texture memory is even tighter, limited to 256 KB of VRAM across banks A and B, while the handheld's hardware GX geometry engine hits a hard wall at 2,048 polygons and 6,144 vertices per frame. Because San Andreas world coordinates exceed the DS hardware's signed 20.12 fixed-point limits, the custom renderer emits every piece of geometry relative to Carl "CJ" Johnson and the camera origin.

To survive without hardware floating-point math on the ARM9 chip, Sammwy converted physics, culling, animation hot paths, and zone lookups into fixed-point arithmetic (using 1/16-meter integers instead of software floats). If you want to revisit the classic trilogy on modern hardware while following this homebrew experiment, check out our complete platform guide on how to legally play every GTA game in 2026.
A Native C++17 Engine Built on gta-reversed and Aggressive LRU Streaming
Unlike mock concept animations or PC video streams disguised as handheld ports, the showcase uploaded to Sammwy's official YouTube channel runs natively on real Nintendo DS hardware and the melonDS emulator. The project uses the community-driven gta-reversed codebase purely as a behavioral reference, replacing every legacy RenderWare call with custom GX display lists.
An offline Python pipeline (tools/assets.py) extracts assets from a legal PC installation of San Andreas and packs them into custom Nintendo DS binary formats: FNV-1a indexed DSPK archives, DMDL models, compressed DTEX textures, DCOL collision data, and streamed DANM skeletal animations. The build system outputs four ROM variants (.nds and .dsi) that either embed data inside NitroFS (around 387 MB against the 448 MB cartridge limit) or stream directly from an SD card.

Out of the handheld's 4 MB of main RAM, the dynamic streaming heap (STREAM) is budgeted at just 2.5 MB. When spawning a Greenwood car or pedestrian models while the map cache already occupies 2.4 MB, the TLSF memory allocator calls world::releaseRam to evict least-recently-used (LRU) map models that were not drawn during the last two frames.
Instead of freezing CJ for up to 300 frames (15 seconds) while waiting for an entire 180-meter window to stream after a teleport, world::nearSectorsPending() only holds the player until the immediate 3×3 sector grid and local collision list are ready. CJ can already walk, sprint, fight, drive vehicles, trigger original gang AI behaviors (CPedIntelligence), and play through the chained opening cutscenes (PROLOG1 and PROLOG3) featuring Officer Tenpenny.
From 8.7 ms to 0.1 ms on the Bottom Screen: The HUD Optimization Boosting Grove Street FPS
The port also makes clever use of the dual-screen clamshell layout, taking the opposite path of widescreen preservation mods like the Pokémon Fulldex project that merges classic Nintendo DS dual screens into 16:9. Here, the top display is dedicated to the 3D chase camera, dynamic skybox, and weather effects, while the lower touchscreen runs a 96 KB RAM framebuffer.
Pressing SELECT toggles the bottom screen between the authentic GTA HUD (with streamed radar tiles, health bar, cash counter, and clock) and a double-buffered touch debug console for spawning vehicles or toggling cheats. In commits pushed on November 8, 2026, Sammwy discovered that redrawing the radar disc and running a full 96 KB DMA copy into VRAM Bank C on every vertical blank was eating 8.7 milliseconds per frame and competing with audio channel fetches.
By introducing a quantized state signature that only repaints dirty HUD regions and skips redundant VRAM transfers, bottom-screen CPU overhead dropped from 8.7 ms down to 0.1 ms per frame. Standing at the Grove Street spawn point, that single change lifted frame rates from 19 FPS to 25 FPS on base hardware, while the pause menu now locks at a clean 60 FPS (2.7 ms per frame) with zero radio audio crackling.
My Field Notes
What a late-night gem to stumble across on GitHub! At a time when modern AAA releases demand 16 GB of VRAM and over 200 GB of SSD space just to brute-force their way through unoptimized shaders, watching Grove Street, drivable cars, and voiced prologue cutscenes run inside the 4 MB memory footprint of a 2004 Nintendo DS is pure engineering poetry. This is far more than a novelty clip: the discipline behind Sammwy's memory budgets harks back to the golden era of cartridge programming, when every kilobyte had to be earned.
Digging through the C++17 commit logs alongside our developer Chaya "Chayane", one breakthrough stood out to both of us: the bottom-screen DMA optimization. Reclaiming 8.6 milliseconds of CPU time per frame simply by caching the 96 KB touchscreen framebuffer when the radar state hasn't changed, and replacing soft-float zone checks with 1/16-meter integers on an FPU-less ARM9 chip, is masterclass low-level optimization. Once the SCM mission virtual machine and save system are wired up, dust off your old flashcarts and DSi consoles, because this homebrew build is going to be a must-try.


















