The Legend of Zelda: Ocarina of Time
A revolutionary action-adventure game that set the standard for 3D gaming. Famous for its countless glitches and sequence breaks used in speedruns.
A revolutionary action-adventure game that set the standard for 3D gaming. Famous for its countless glitches and sequence breaks used in speedruns.
Arbitrary Code Execution (ACE)
Arbitrary Code Execution (ACE) represents the ultimate level of game exploitation in Ocarina of Time. It allows players to write and execute custom code through nothing but controller inputs, effectively reprogramming the game in real-time. This technique has enabled everything from credits warps to running entirely custom programs on unmodified N64 hardware.
What is ACE?
ACE is a glitch that causes the game's instruction pointer to jump to a section of memory that players can write to—such as file names, actor positions, or even raw controller inputs. When the instruction pointer reaches this memory, it executes the data there as if it were legitimate game code.
In simpler terms: you can write "code" using normal gameplay and make the game run it.
How ACE Works
The Two Requirements
Every ACE exploit needs two things:
- Writable Memory Region - A section of memory the player can control (filenames, positions, controller data)
- Code Redirection - A way to make the game execute that controlled memory as code
The SRM Connection
In Ocarina of Time, ACE typically builds on Stale Reference Manipulation (SRM):
- SRM provides control over memory regions
- Function Pointer Manipulation redirects code execution
- Player-controlled data becomes executable code
Controller Input as Code
The most mind-bending aspect of OoT ACE is using controller inputs as code:
"We modify an instruction in memory to start reading controller data as N64 instructions. Normally, this would crash, but with TASBot, we can simulate controllers and manipulate them at inhuman speeds to look like N64 instructions."
The TASBot Demonstration
At Games Done Quick 2022, the speedrunning community demonstrated the full power of ACE:
- Performed a series of glitches to create memory errors
- Connected TASBot to controller ports 2-4
- Streamed a custom ROM hack from a laptop to the N64's memory
- All through an unmodified US 1.0 cartridge on original hardware
Speedrun Applications
Credits Warp (Any%)
The primary speedrun use of ACE is warping directly to the credits:
| Method | Time Required | Difficulty |
|---|---|---|
| Kokiri Forest ACE | ~7 minutes | Very Hard |
| C-Up Method | ~10 minutes | Hard |
| Ramwrite Method | ~8 minutes | Expert |
Total Control
By performing ACE three times with specific filenames, runners can remove the character limit on file names entirely. This unlocks "Total Control"—the ability to input any payload and do practically anything:
- Force item spawns
- Modify Link's position instantly
- Change game state flags
- Load arbitrary scenes
The Technical Process
Step-by-Step Overview
- Setup SRM - Create stale references through actor heap manipulation
- Position Link Precisely - Your X/Y/Z coordinates become data values
- Manipulate Memory - Overwrite function pointers with SRM
- Execute Payload - The game runs your "code"
Filename Payloads
File names in OoT are stored in memory and can be used as code:
- Each character translates to specific byte values
- Specific character combinations create valid N64 instructions
- Multiple file names can be chained for longer payloads
Platform Differences
| Platform | ACE Viability | Notes |
|---|---|---|
| N64 (US 1.0) | Full Support | Most developed setups |
| N64 (US 1.2) | Partial | Some methods patched |
| GameCube | Full Support | Different memory layout |
| Virtual Console | Full Support | Wii/Wii U compatible |
| 3DS | Limited | Heavily modified engine |
Category Rules
Due to its power, ACE has specific rules in speedrunning:
- Any% - ACE allowed (Credits Warp is the primary route)
- No ACE - Specifically bans arbitrary code execution
- 100% - ACE typically banned
- Glitchless - All major glitches banned including ACE
Learning Resources
Prerequisites
Before attempting ACE, you should understand:
- Basic OoT glitches (superslides, bombs, etc.)
- Stale Reference Manipulation fundamentals
- N64 memory architecture basics
- Hexadecimal number systems
Practice Tools
- kz Practice ROM - Save states, memory watching, frame advance
- Project64 with debugging - Emulator-based memory analysis
- OoT Decomp - Decompiled source code for research
See Also
- Stale Reference Manipulation (SRM)
- Wrong Warp
- Deku Stick on B