The Legend of Zelda: Ocarina of Time
BACK TO GAMES
The Legend of Zelda: Ocarina of Time

The Legend of Zelda: Ocarina of Time

Nintendo
1998

A revolutionary action-adventure game that set the standard for 3D gaming. Famous for its countless glitches and sequence breaks used in speedruns.

Nintendo 64GameCubeNintendo 3DSNintendo SwitchWiiWii U
BACK TO WIKI

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:

  1. Pick up a liftable object (rock, bush, bomb)
  2. Move the object off-camera
  3. Cross a loading plane while the object is culled (unloaded due to being off-screen)
  4. Link's "carried object" pointer now references deallocated memory
  5. New actors load into that memory space
  6. 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

  1. Perform setup to create a stale reference
  2. Manipulate the actor heap to place specific data at the stale reference location
  3. Use Link's position/angle to write values that redirect code execution
  4. The game jumps to credits sequence

Common SRM Applications

ApplicationEffectSRM Level
Title FileFills inventory with most itemsFPM
F BootsRemoves gravity (flying Link)FPM
Age ChangeChild ↔ Adult without Temple of TimeFPM
Credits WarpSkip to ending creditsACE
Chest ContentsChange what's inside chestsVariable 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

  1. Start with simpler SRM applications like chest manipulation
  2. Use the practice ROM (kz) for save states and memory watching
  3. Understand actor heap mechanics before attempting complex setups
  4. Watch tutorial videos at reduced speed to learn precise movements

See Also

  • Wrong Warp
  • Arbitrary Code Execution (ACE)
  • Deku Stick on B

Sources