ALTTPR SRAM Map
- 1 Overview
- 2 SRAM Map
- 2.1 Room Data: 0x000* to 0x24F*
- 2.2 Unused: 0x250* to 0x27F*
- 2.3 Overworld Event Information: 0x280* to 0x2FF*
- 2.4 Shop Purchase Counts: 0x302* to 0x33F*
- 2.5 Items & Equipment: 0x340* to 0x38B*
- 2.6 Rando Specific Assignments & Game Stats: 0x3F1* to 0x467*
- 2.7 Checksum: 0x4FE* - 0x4FF*
- 2.8 Unused: 0x510* - 0x1FFF*
- 2.9 Rom Name: 0x2000* - 0x2014*
- 2.10 Unused: 0x2015* - 0x7FFF*
- 3 Appendices
This document is intended to be an SRAM reference for the randomizer base ROM. The base ROM expands the SRAM size to 32k and removes the last two save files. Credit to MathOnNapkins, the editors of the vanilla ALttP wiki, and the randomizer ROM developers who have documented nearly all of this information elsewhere.
- Offsets on this page start from
$7EF000*in WRAM or at
0x00*in an .sram file. The ROM is mapped as LoROM, so the cartridge's SRAM is located at
- When bytes are laid out as individual bits, this indicates either bit flags or densely packed integers (i.e., smaller than one byte.)
- Values bigger than one byte are little-endian (e.g. a 16-bit number that is
0xAA*in a hex editor or debugger is actually
There are 296 (
0x128*) rooms in in the ROM. Each room's data occupies one word, or two bytes.
d- door opened (either unlocked, bombed or other means)
b- boss battle won
k- key or item (such as a 300 rupee gift)
c- chest, big key chest, or big key lock. Any combination of them totaling to 6 is valid.
r- special rupee tiles, whether they've been obtained or not.
q- quadrants visited:
The quadrant bits corresponds to quadrants
1 in that order which is also how the quadrants are laid out on a tile from left to right (upper left, upper right, lower left, lower right), so if quadrants
1 have been "seen" by Link, then
qqqq will look like
- Presumed unused in both vanilla and randomizer.
Overworld Event Information:
Each area occupies one byte.
? h o ? ? ? s ?
o- If set, the area will draw its designated overlay when you enter it. e.g. If you're triggered misery mire then the entrance shows up there the next time you enter that area. You can view overlays in the latest release of Hyrule Magic. Other overlays include stairs leading underground, and the removal of the weather vane after it has exploded.
s- If set, the area will draw its secondary overlay when you enter it.
h- If set, free-standing item has been collected in this area already. Also used for a handful of other sprites.
?- Unknown, possibly unused.
Shop Purchase Counts:
The randomizer ROM uses new shop code to handle loading and configuration of shops which allows the higher-level item and entrance randomizers to use easy abstractions for changing them. The higher-level randomizers can dictate a certain number of times that a shop item can be re-purchased (e.g. you can only buy capacity upgrades seven times.) The bytes here are used to count how many times a single item in a shop has been purchased. They are dynamically assigned at generation time, which is to say that any single byte should not be considered statically bound to a certain item in a specific shop. Take-Any caves as well as the old man with the sword in Retro world state are considered shops in this context.
- Note 1: This is noted as a "temporary home" for the shop purchase counts in the base rom's source code
- Note 2: Jumping into deep water without flippers and being placed back on land on the Hobo and Zora's Domain maps are known to overwrite
0x304*respectively. This has no effect if a shop item whose purchase count is located at these addresses can always be repurchased, but will lead to unintended behavior if the item can only be purchased a limited amount of times.
Items & Equipment:
||Bombs||How many bombs you have||Can exceed |
||Book of Mudora||
||Cane of Somaria||
||Cane of Byrna||
|Item||Address||Bit 0||Bit 1||Bit 2||Bit 3||Bit 4||Bit 5||Bit 6||Bit 7|
||Unused||Unused||Ganon's Tower||Turtle Rock||Thieves' Town||Tower of Hera||Ice Palace||Skull Woods|
||Misery Mire||Palace of Darkness||Swamp Palace||Hyrule Castle Tower||Desert Palace||Eastern Palace||Hyrule Castle||Sewer Passage|
Wishing Pond Rupee:
- Presumed unused
Heart Pieces collected:
- Number of heart pieces (out of four) you have earned
- Health Capacity. Each increment of
0x08*is worth one heart.
0x04*is a half heart. The max is generally
0xA0*. The game is coded to not accept health values beyond this.
- $36D. Actual Health. Same as above, but this reflects your current health status rather than potential.
- Magic power ranges from
0x80*. Each small bottle refills
0x10*. Setting Magic above
0x80*causes the magic meter to glitch and you can't use special items.
- Number of Keys you have in the dungeon you are currently in. If you're in a non-keyed dungeon it will generally read
Bomb Capacity Upgrades:
- Number of bombs you can hold above the default value (10).
Arrow Capacity Upgrades:
- Number of arrows you can hold above the default value (30)
- Write to this location to fill in a set number of hearts. Make sure to write in a multiple of
0x08*Otherwise, you will end up filling the whole life meter.
- Write to this location how much magic power you want filled up. The maximum effective value is
- - - - - g b r
r- Red Pendant
b- Blue Pendant
g- Green Pendant
- Number of bombs to be "filled" or added to the current bomb count. It will not exceed your maximum, defined at
- Number of arrows to be "filled" or added to the current arrow count. It will not exceed your maximum, defined at MemoryAddress/PC|371}}.
- Presumed unused.
- r t - p d s -
d- Run / Dash
- 3 4 2 7 5 1 6
Keys earned per dungeon:
- Sewer Passage:
- Hyrule Castle:
- Note: The Sewers and Hyrule Castle addresses will generally hold the same value and increment/decrement together in randomizer.
- Eastern Palace:
- Desert Palace:
- Hyrule Castle Tower:
- Swamp Palace:
- Palace of Darkness:
- Misery Mire:
- Skull Woods:
- Ice Palace:
- Tower of Hera:
- Thieves' Town:
- Turtle Rock:
- Ganon's Tower:
Inventory Item Tracking:
b r m p n s k f
b- Blue Boomerang
r- Red Boomerang
m- Mushroom Current
p- Magic Powder
n- Mushroom Past (turned in to the Witch)
k- Inactive Flute
f- Active Flute
Inventory Bow Tracking:
b s p - - - - -
s- Silver Arrow Bow
p- Second Progressive Bow
- There are two Progressive Bow items in the game. The
pbit represents whether the player has collected the "second" Progressive Bow independent of the "first." It does not indicate whether the player has silver arrows or not.
- Note: The first three values here are used in Standard Mode.
0x00*= Link is in bed, can't use sword.
0x01*= Have picked up the Uncle item.
0x02*= Indicates that Zelda is rescued.
0x03*= Indicates Agahnim 1 is defeated.
0x04*and above are meaningless. Though, you could write code using them to expand the event system perhaps.
? ? ? u ? z ? s
s- Set when you obtain the item from Uncle in the Secret Passage.
u- Set when uncle leaves in Standard Mode.
?- Uncertain. The sixth and fourth bits (from the right) are sometimes set in Open Mode.
Map Icons Indicator 2:
- Presumed unused in randomizer.
Starting Entrance to use:
0x00*= Start the game in Link's House always.
0x01*= Staring location menu or Pyramid of Power if Aga has been killed and the player has the Mirror.
0x02*= Start in Zelda's Cell.
0x03*= Secret Passage or Hyrule Castle front entrance if you've entered the castle.
0x04*= Castle Throne Room in Standard mode. Set when you touch the mantle.
0x05*= Start in the Old Man Cave with the Old Man.
Progress Indicator 3 (bitwise):
- - b p s - m h
h- Hobo gave you his item.
m- Bottle Merchant gave you his item.
s- Stumpy (DW) has been arborated
p- Purple Chest has been opened
b- Blacksmith's partner saved
- Note: The eighth bit was used in vanilla to indicate that the blacksmiths had your sword.
Lightworld / Darkworld:
- The seventh bit here is a toggle indicating if you are in the Dark World (
0x1*) or not (
- Presumed unused.
- Tagalong Indicator (who is following you, if anyone?) (value based)
Note: Don't use a value of
0x0F* or larger here, as it will likely crash the game.
0x00*= No follower
0x01*= Princess Zelda
0x04*= Old Man
0x06*= Blind Maiden
0x07*= Blacksmith Frog
0x08*= Blacksmith Dwarf
0x09*= Locksmith next to the sign East of the desert.
0x0C*= Purple Chest
0x0D*= Super Bomb
Y-Coordinate of Dropped Follower:
- Cached Y coordinate of follower after it has been lost by the player.
X-Coordinate of Dropped Follower:
- Cached X coordinate of follower after it has been lost by the player.
- Presumed unused
- Set to
0x00*normally. Set to
0x80*if a Super Bomb is going off.
- Presumed unused.
Player's Name (first four characters):
- The randomizer base ROM does not use the 2nd and 3rd save files, so the player can use all 12 characters for their name. The first four are here. The remaining characters can be found in two locations: immediately after the following validity value and at
- Note each of the six letters is represented by a 16-bit number.
- See Appendix 1[Appendix 1 1]
Validity of the File:
- There is a subroutine in the ROM that checks to make sure this word value is
0x55AA*. If changed, the save file will be deleted when the game boots.
Player's Name (characters 6-12)
- Characters 6-12 of the file name. Note that the above validity value occupies the space where the 5th character would be if the full name were present here.
- See Appendix 1[Appendix 1 2]
Rando Specific Assignments & Game Stats:
- Presumed unused
- Counts the number of times your saved or died in the game before you beat it.
Post-Game Death Counter:
- When you start the game this is written to with the value -1 (
0xFFFF*). On the game select screen, it will only display a number if this is not
0xFFFF*. The max displayable number is 999.
When you beat the game, the number of times you died gets recorded here.
NPC Flags 1:
NPC Flags 2:
s s h c p i - g
s- Progressive Shields
h- HUD flag (?)
c- Shame Chest (no longer in the game it seems)
p- Force pyramid (seems unused)
i- Ignore faeries, related to fake flipper insta-kill
g- Has Grove item (somehow related to heart pieces and containers)
Highest Sword Level:
- - - - - s s s
Programmable Item #1:
Programmable Item #2:
Programmable Item #3:
- Unused in regular ALTTPR Roms but reserved for programmable item data (e.g. in festive ROMs.)
- Counts a maximum of 99 bonks
y y y y y a a a
y- Y item count represented as five bit integer. There are a total of 27 Y items.
a- A item count represented as a three bit integer. Five in total.
Swords & Shields:
w w w h h - - -
- Number of swords and shields collected represented as three and two bit integers respectively.
Total Items Collected:
Mails & Small Keys:
m m k k k k k k
- Number of mails and small keys collected represented as two and six bit integers respectively.
k- Small Keys
Tempered & Gold Sword Boss Kills:
t t t t g g g g
Fighter & Master Sword Boss Kills:
f f f f m m m m
- Number of bosses killed with each sword represented as four byte integers.
t- Tempered Sword
g- Gold Sword
f- Fighter Sword
m- Master Sword
Big Keys & Big Chests:
k k k k c c c c
- Number of big keys collected and big chests opened represented as four bit integers.
k- Big Keys
c- Big Chests
Maps & Compasses:
m m m m c c c c
- Number of maps and compasses collected represented as four bit integers.
Heart Pieces & Pendants:
h h h h - - p p
- Number of heart pieces and pendants collected represented as four and two bit integers respectively.
h- Heart Pieces
Ganon's Tower Big Key:
b - s c c c c c
b- Bomb acquired
s- Silver Arrows Acquired
cLocations checked in Ganon's Tower up to and including the Big Key represented as a five bit integer.
- Number of rupees spent in game.
Save and Quits:
- Number of times the player has saved and quit.
- Total loop time (?) measured in frames.
- Used in calculating the lag time.
- Number of locations checked before the Pegasus Boots are found.
- Number of locations checked before the Magic Mirror is found.
Hyrule Castle & Palace of Darkness:
h h h h p p p p
- Locations checked in Hyrule Castle and Palace of Darkness represented as four bit integers.
h- Hyrule Castle
p- Palace of Darkness
Desert Palace, Tower of Hera, and Agahnim's Tower:
d d h h a a a a
- Locations checked in Desert Palace, Tower of Hera, and Agahnim's Tower represented as three, three, and two bit integers respectively.
d- Desert Palace
h- Tower of Hera
a- Agahnim's Tower
Ganon's Tower & Eastern Palace:
g g g g g e e e
- Locations checked in Ganon's Tower and Eastern Palace represented as five and three bit integers respectively.
g- Ganon's Tower
e- Eastern Palace
Skull Woods & Thieves' Town:
s s s s t t t t
- Locations checked in Skull Woods & Thieves' Town represented as four bit intgers.
s- Skull Woods
t- Thieves' Town
Ice Palace & Misery Mire:
i i i i m m m m
- Locations checked in Ice Palace and Misery Mire represented as four bit intgers.
i- Ice Palace
m- Misery Mire
Turtle Rock & Swamp Palace:
t t t t s s s s
- Locations checked in Turtle Rock and Swamp Palace represented as four bit intgers.
t- Turtle Rock
s- Swamp Palace
- Number of times the Magic Mirror is used on the overworld.
- Number of times the Magic Mirror is used in dungeons.
- Number of screen transitions.
- Total amount of time played measured in frames.
- Number of chests opened. Does not count NPC and free standing items.
- Total amount of time spent in the item menu measured in frames.
- Total number of Heart Pieces collected.
- Total deaths.
- Number of times the active Flute was used.
Swordless Bosses & Capacity Upgrades:
b b b b c c c c
- Number of bosses defeated without a sword and number of capacity upgrades purchased represented as four bit integers.
b - Bosses killed without a sword
c - Capacity upgrades purchased
- Number of times the player has been revived by a faerie.
First Sword Found:
- Time when the player collected their first sword, measured in frames.
- Time when the player collected the Pegasus Boots, measured in frames.
- Time when the player collected the Flute, measured in frames.
- Time when the player collected the Magic Mirror, measured in frames.
- Unknown, presumed unused except for a rando-specific file marker at
0x4F0*, which will always be
0xFF*on an active save file and
0x00*on a fresh file.
The SRAM save loading routine relies upon an "inverse" checksum. Changes to any byte in the SRAM between
0x4FE* must be added or subtracted to this checksum or the save file will be deleted. The checksum can be computed by adding every word between the beginning of the file and
0x4FE* and subtracting the sum from
0x5A5A*, using overflowing arithmetic for both operations.
Player's Name (characters 5-12):
- See Appendix 1[Appendix 1 3]
This space previously contained a second and third save file with the same layout as above. Currently unused.
- Name of the ROM, ASCII encoded. If the ROM was generated by the VT randomizer, this will also contain the hash id used for the permalink.
The remaining unused, expanded SRAM.
Appendix 1: File Screen Character Map
- Player's Name (1-4)
- Player's Name (6-12)
- Player's Name (5-12)
- Note: A blank character is encoded as
Appendix 2: SNES Button Alphabet
^This code is not the canon encoding of this character. ex.
0xAF* is the proper "I".
0x08* is not.