ZLAA
Overview
ZLAA turns the Nintendo Switch version of The Legend of Zelda: Link's Awakening (2019) into a native Android app. It runs on an AYN Thor at a steady 60 fps at 720p, with sound, movies and menus of its own, from the player's own copy of the game.
Outcome: Link's Awakening plays at 60 fps on an Android handheld, and anyone with their own copy can install it from the GitHub release.
- Year
- 2026
- Tools
- AYN Thor, Python, C, Vulkan, SDL 3, Zig, Claude Code
An emulator, like PocketCHIP, pretends to be a console and reads a game's instructions one by one while you play. ZLAA instead translates the whole game into C code ahead of time, once, so it runs directly on the phone's own processor. This is called static recompilation.
ZLAA doesn't actually include any of the game. It needs the player's own legally owned copy of the Switch game.
What ZLAA does, how to set it up and its known issues are all in the README on GitHub. This page is the story of how it was built: the stages, and the bugs along the way.
Skills
- Project direction and planning
- Static recompilation
- Reading and debugging C and Python code
- Test strategy (differential testing, fuzzing)
- Debugging graphics on real hardware
- Android development
- Performance and thermal tuning
- Hardware testing
- UI design
- Directing AI coding agents (Claude Code)
01 · Turning the Game into C
The first piece is the recompiler, written in Python. It reads the game's machine code (the raw instructions the Switch's ARM64 processor runs) and writes each of its functions out as a C function. The game has about 150,000 of them, which comes to roughly 670 MB of C code.
Testing every instruction
A translation that is almost right is still wrong, so the recompiler was tested before it ever saw the game. Small test programs are built twice, once normally and once through the recompiler, and their results are compared on about 800 inputs each. A second test, called fuzzing, throws thousands of random instructions at it and checks each answer bit for bit against an existing CPU emulator.
Cutting compilation time
The first full build of the game took 22 minutes on my powerful laptop's 22 cores. Most of the game's code reads like a recipe, one step after another. But in some places it says "now jump somewhere else", and the recompiler couldn't tell where. To be safe, it marked every step in those parts as a place the jump might land, which left the compiler with a huge tangle to sort out. The fix was teaching the recompiler to read the game's jump tables, the lists that say exactly where each jump can go. The build now takes about 6 minutes, and the game even runs slightly faster.
02 · Pretending to be a Switch
Translated code alone does nothing: the game constantly asks the Switch's operating system for things, like memory, files, the time, or the state of the controller. The runtime is the part of ZLAA, written in C, that answers those requests the way a Switch would.
First boot, with nothing to see
The first milestone was the game starting up and running its main loop at about 60 frames a second, with no picture, sound or input yet.
Controller trouble
Two controller bugs came up early. The Thor's controller labels its buttons the Xbox way, so its A button acted as the Switch's B. And because ZLAA first showed the game two controllers, the game kept disconnecting both and asking which one to use, so A presses at the file select did nothing for seconds. ZLAA now shows the game a single Switch Pro Controller.
03 · Getting the Graphics Right
The Switch draws with its own graphics system, called NVN, and its own NVIDIA graphics chip (GPU). Android phones use Vulkan instead, a standard way to talk to almost any GPU. So ZLAA rebuilds each NVN command on Vulkan.
The hardest part is shaders: small programs the game runs on the GPU to decide the colour of every pixel. The game's shaders are written in the Switch GPU's own machine code, so ZLAA translates each one into SPIR-V, the format Vulkan understands.
Lighting issues
At first, the 3D world was completely black. A few of the game's effects were missing a number the Switch fills in on its own, so they drew nothing, and one of them darkened the whole scene. Once that was fixed, everything glowed pure white instead: ZLAA was misreading some of the numbers the game uses for its lighting. Fixing that finally gave the world its real colours.
The missing dialogue text
A large issue that took a bunch of time to fix was that text boxes opened empty. The bug was in how the translator followed jumps inside the text shader: one detail of the Switch GPU's code layout was handled in one place but not the other, so the top corners of every letter pointed at blank space.
04 · Onto the Thor
Up to here, everything ran on my laptop. The goal was always to get this running on an Android handheld, so I started testing every change on it.
Pauses on every sword hit
While playing, the game froze for a moment every time my sword hit an enemy, and black bars flashed on screen. The Thor's GPU had hung. One of the translated shaders could loop forever, and each reset cost about a third of a second. Now a shader stops itself before it can loop forever, and the pauses are gone.
Heat
The Thor got HOT at first, running at almost 80 °C the entire time. Running the game at 720p in handheld mode by default, like a Switch on its own screen, took its graphics chip from 680 MHz down to 401 MHz.
06 · Building the Game on the Device
The translated game is still Nintendo's code, so it can never be shared, not even compiled. My first versions had it built on my laptop and copied over with a cable. To let anyone else play, the Thor had to build the game itself, from the player's own files.
Too hot to hold
The first test ran six compiles at once, and the Thor's processor reached 94 °C within minutes. Build Game now watches the temperature of the board and runs fewer jobs, or pauses, as it warms up.
From almost two hours to under one
The first complete build on the Thor took 108 minutes, which was far too slow. Making the generated code smaller and simpler, and tuning how hard the build pushes the Thor, brought the default build down to about 53 minutes, with the board hovering around 47 °C.
07 · An AI Recomp
Almost all of ZLAA's code and documentation was written by Claude, through Claude Code. I directed the project and its features, decided how it should look and feel, and tested every change on the Thor.
What I learned
- Recomps take a huge amount of work and time. I have tremendous respect for everyone who works in the scene.
- This was my first jump into Android development, and it's something I want to keep doing.
- This project is still very young and probably never-ending! There are so many more features I want to add.
What comes next
The README lists what's planned for players, like touch controls and building on a PC. Behind the scenes, the goal is support for more features, a smooth 1080p mode, and someday 120 fps.
Want to try it, or see the full details? Everything else, from what you need to set it up to the known issues, is in the README on GitHub.