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.
Stale Reference Manipulation (SRM)
Stale Reference Manipulation (SRM) is a revolutionary glitch discovered in 2019 that fundamentally changed Ocarina of Time speedrunning. It exploits how the game handles memory references to unloaded objects, allowing players to manipulate nearly anything stored in the game's actor heap—including warping directly to the credits.
What is SRM?
SRM works by creating "stale" (outdated) references to actors (game objects) that have been unloaded from memory. When Link or the Boomerang carries an object, they maintain a pointer to that object's memory location. If the object is unloaded while still being "carried," the game continues writing position and rotation data to that memory address—even though it now contains something completely different.
How It Works
The Actor Heap
The game stores all active actors (enemies, items, NPCs, projectiles, etc.) in a memory region called the actor heap. This heap is structured as a doubly-linked list aligned to the nearest 0x10 bytes.
Key points about the actor heap:
- Actors are allocated when spawned (dropping bombs, opening chests)
- Actors are deallocated when destroyed (breaking pots, killing enemies)
- Loading new rooms reshuffles the heap entirely
Creating a Stale Reference
The most common method involves Link carrying an object:
- Pick up a liftable object (rock, bush, bomb)
- Move the object off-camera
- Cross a loading plane while the object is culled (unloaded due to being off-screen)
- Link's "carried object" pointer now references deallocated memory
- New actors load into that memory space
- Link's movement writes position/rotation data to the new actor
Three Levels of SRM
Level 1: Actor Variable Editing
The simplest form—modify position, rotation, animation data, or other actor attributes.
Applications:
- Move doors or enemies to unreachable locations
- Edit treasure chest contents before opening
- Manipulate actor states
Level 2: Function Pointer Manipulation (FPM)
Overwrites pointers to code, redirecting which existing code the game executes.
Applications:
- Title File Function - Fills inventory, quest status, and equipment screens instantly
- Age Change - Switch between child and adult without the Temple of Time
- Farore's Wind Warp - Warp to almost any location
Level 3: Arbitrary Code Execution (ACE)
The most powerful level—directly modifying or creating game code.
Applications:
- Credits Warp (used in Any% speedruns)
- Creating custom actors or items
- Modifying game behavior in any way imaginable
Note: ACE is banned in most speedrun categories due to its unlimited potential.
Credits Warp with SRM
The most famous SRM application warps directly to the credits from Kokiri Forest:
Basic Process
- Perform setup to create a stale reference
- Manipulate the actor heap to place specific data at the stale reference location
- Use Link's position/angle to write values that redirect code execution
- The game jumps to credits sequence
Common SRM Applications
| Application | Effect | SRM Level |
|---|---|---|
| Title File | Fills inventory with most items | FPM |
| F Boots | Removes gravity (flying Link) | FPM |
| Age Change | Child ↔ Adult without Temple of Time | FPM |
| Credits Warp | Skip to ending credits | ACE |
| Chest Contents | Change what's inside chests | Variable Edit |
Requirements
- Platform: Works on N64, GameCube, Virtual Console, and 3DS versions (with variations)
- Items Needed: Varies by setup, often requires bombs or liftable objects
- Skill Level: Intermediate to Advanced
Tips for Learning
- Start with simpler SRM applications like chest manipulation
- Use the practice ROM (kz) for save states and memory watching
- Understand actor heap mechanics before attempting complex setups
- Watch tutorial videos at reduced speed to learn precise movements
See Also
- Wrong Warp
- Arbitrary Code Execution (ACE)
- Deku Stick on B