The Legend of Zelda/RAM map: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Edited for consistency and readability, added frame counter)
Line 3: Line 3:
The corresponding ROM map can be found [[The Legend of Zelda:ROM map|here]].
The corresponding ROM map can be found [[The Legend of Zelda:ROM map|here]].


==Zero Page==
Address    Function                    Details
----------- --------------------------- -----------------------------------------
00          Multiple Functions          X-coords of sprite, ...   
01          Multiple Functions          Y-coords of sprite, ...   
02          Multiple Functions          Tile # for sprite (left half), ... 
03          Multiple Functions          Tile # for sprite (right half), ...   
04          Multiple Functions          Attributes for sprite (left half), ... 
05          Multiple Functions          Attributes for sprite (right half), ...   
06-0F        ?         
10          Current Level              (0 = overworld)
11          ?         
12          Game Mode                  0=Title/transitory    1=Selection Screen
                                        5=Normal              6=Preparing Scroll
                                        7=Scrolling          4=Finishing Scroll;
                                        E=Registration        F=Elimination
13          ?         
14          ?         
15          Frame counter     
16          Current save slot          $00=first, $01=second, $02=third; On selection/registration/elimination screens: $03=fourth option, $04=fifth option
17-4B        ?         
4C          Countdown until Link can use his sword again after touching a White Bubble 
4D-65        ? 
66          ROM Offset for start of current Song Data (low byte)   
67          ROM Offset for start of current Song Data (high byte) 
68          ? 
69          ? 
6A          Pulse-2 Channel Frequency Offset   
6B          Pulse-1 Channel Frequency Offset   
6C          Offset related to Music Pointers   
6D-6F        ? 
70          Link's screen X            X Position on screen
71          Enemy 1 X-position          Also used for dropped enemy item
72          Enemy 2 X-position          Also used for dropped enemy item
73          Enemy 3 X-position          Also used for dropped enemy item
74          Enemy 4 X-position          Also used for dropped enemy item
75          Enemy 5 X-position          Also used for dropped enemy item
76          Enemy 6 X-position          Also used for dropped enemy item
77          Enemy 7 X-position          Also used for dropped enemy item
78          Enemy 8 X-position          Also used for dropped enemy item
79          Projectile X-position 
7A          Projectile X-position 
7B          Projectile #1's X-position 
7C          ? 
7D          ? 
7E          Link's Sword X-position   
7F          Boomerang/Bait X-position 
80          ? 
81          ? 
82          Link's Arrow X-position   
83          ? 
84          Link's Y-position on the screen   
85          Enemy 1 Y-position          Also used for dropped enemy item
86          Enemy 2 Y-position          Also used for dropped enemy item
87          Enemy 3 Y-position          Also used for dropped enemy item
88          Enemy 4 Y-position          Also used for dropped enemy item
89          Enemy 5 Y-position          Also used for dropped enemy item
8A          Enemy 6 Y-position          Also used for dropped enemy item
8B          Enemy 7 Y-position          Also used for dropped enemy item
8C          Enemy 8 Y-position          Also used for dropped enemy item
8D          Projectile Y-position 
8E          Projectile Y-position 
8F          Projectile #1's Y-position 
90          ? 
91          ? 
92          Link's Sword Y-position   
93          Boomerang/Bait Y Position 
94          ? 
95          ? 
96          Link's Arrow Y-position   
97          Dungeon Floor Item 
98          Links direction            $08=North, $04=South, $01=East, $02=West
99-AA        ? 
AB          Type of item in screen  The value indicates item type (bomb, heart, rupee, etc)
AC          ? 
AD          Type of dropped enemy item #1
AE          Type of dropped enemy item #2
AF          Type of dropped enemy item #3
B0          Type of dropped enemy item #4
B1          Type of dropped enemy item #5
B2          Type of dropped enemy item #6
B3          Type of dropped enemy item #7
B4          Type of dropped enemy item #8
B5          Projectile Onscreen?   
B6          Projectile Onscreen?   
B7          Projectile Onscreen?   
B8-C1        ? 
C2          Dropped Enemy Item 
C3          Dropped Enemy Item 
C4-DF        ? 
E0          Game Paused?                $00=No, $01=Yes
E1-E7        ?         
E8          Screen Scrolling?          $00=No, $08=Northbound, $04=Southbound, $01=Eastbound, $02=Westbound
E9          ?         
EA          ?         
EB          Map location                Value equals map x location + 0x10 * map y location
EC-F7        ? 
F8          Player 1 Buttons            (Last Frame)  R = 1, L = 2, D = 4, U = 8, Start = 10, Select = 20, B = 40, A = 80
F9          Player 2 Buttons            (Last Frame)  (See above)
FA          Player 1 Buttons            Pressed    $08=Up, $04=Down, $01=Right, $02=Left $80=A, $40=B, $20=Select, $10=Start
FB          Player 2 Buttons            Pressed    (See above)
FC          Subscreen Y-scroll position Used for storyboard text and subscreen position
FD          Subscreen X-scroll position This is always zero when not scrolling.
FE          ? 
FF          ? 


{| border="1" cellpadding="1"
== RAM ==
| '''Zero Page''' || '''Function''' || '''Details'''
RAM    Function                   Details
|-
------- --------------------------- -----------------------
|0x0000 || Multiple Functions: X-coords of sprite, ...||
04CD    Screen options              The entry from ROM:0x18680 for the current room    Overworld: stair placement, quest secrets, Link's V placement, monster entry
|-
0513    Candle used                Whether Link has used the candle on the current screen  $00=No, $01=Yes
|0x0001 || Multiple Functions: Y-coords of sprite, ... ||
0526    Cave return screen          Overworld room to return to when exiting the underworld   
|-
052E    Sword disable              Red Bubble Sword Disable switch: $01 if Link's use of his sword has been disabled by a red bubble, $00 otherwise.
|0x0002 || Multiple Functions: Tile # for sprite (left half), ... ||
052F    Maze counter                Used for screens 0x61 (forest maze) and 0x1B (mountain room south of level 5)   
|-
05F0                                Related to current frequency being played by Triangle channel 
|0x0003 || Multiple Functions: Tile # for sprite (right half), ... ||
05F1    Triangle Reverb            Reverb on/off status for Triangle on current song 
|-
05F4    Rhythm table pointer        for current song 
|0x0004 || Multiple Functions: Attributes for sprite (left half), ...||
0605                                Related to incidental music?  
|-
0606    Sound Effects 
|0x0005 || Multiple Functions: Attributes for sprite (right half), ... ||
0607    Incidental Music   
|-
0609    Songtype currently active  $80=Title, $40=Dungeon, $20=Level 9, $10=Ending, $08=Item, $04=Triforce, $02=Ganon, $01=Overworld
|0x0006 || ? ||
060A    Pulse 2 pos                Current position within Pulse 2 part (with respect to overall music program)   
|-
060B    Pulse 1 pos                Current position within Pulse 1 part (with respect to overall music program)   
|0x0007 || ? ||
060C    Triangle pos                Current position within Triangle part (with respect to overall music program) 
|-
060D    Noise pos                  Current position within Noise part (with respect to overall music program) 
|0x0008 || ? ||
060E    ?
|-
060F    Pulse 1 cycle              Current cycle duration for notes played on Pulse 1 channel  Uses value from rhythm lookup table
|0x0009 || ? ||
0610    Pulse 2 cycle              Current cycle duration for notes played on Pulse 2 channel  Uses value from rhythm lookup table
|-
0611    Pulse 2 rhythm              Countdown from Pulse 2's current rhythm offset  Uses value from rhythm lookup table
|0x000A || ? ||
0612    Pulse 2 countdown          volume fade 
|-
0613    Pulse 1 rhythem            Countdown from Pulse 1's current rhythm offset  Uses value from rhythm lookup table
|0x000B || ? ||
0614    Pulse 1 countdown          volume fade 
|-
0615    Triangle cycle              Current cycle duration for notes played on Triangle channel    Uses value from rhythm lookup table
|0x000C || ? ||
0616    Note countdown              Countdown from value in $615 until next note is to be played   
|-
0617    ?
|0x000D || ? ||
0618                                Related to incidental music   
|-
0619    Pulse reverb                Reverb on/off status for BOTH Pulse channels on current song    $80=on, $01=off
|0x000E || ? ||
061A    ?
|-
061B    Pulse 2 rhythm counter      Countup to Pulse 2 rhythm offset   
|0x000F || ? ||
061C    Pulse 1 rhythm counter      Countup to Pulse 1 rhythm offset   
|-
061D                                ??? (seems to count upward as $616 counts down)    Value is always [$615] - [$616] + 1.
|0x0010 || Current Level Index||
061E    Triangle repeat counter    Number of repeats remaining if in Triangle repeat cycle   
|-
061F    Triangle Song pos          Position within song program of current Triangle repeat coda (return point)   
|0x0011 || ? ||
0620    Screen history write index  Contains the index of the next screen history slot to write to (see below)
|-
0621    Screen history 1            One of five recently visited map locations
|0x0012 || Game Mode || 0 = Title/transitory; 1 = Selection Screen; <br />5=Normal; 6=Preparing Scroll; 7=Scrolling; 4=Finishing Scroll; <br />E = Registration; F = Elimination
0622    Screen history 2            One of five recently visited map locations
|-
0623    Screen history 3            One of five recently visited map locations
|0x0013 || ? ||
0624    Screen history 4            One of five recently visited map locations
|-
0625    Screen history 5            One of five recently visited map locations
|0x0014 || ? ||
0626    ?
|-
0627    Killed enemy count          Number of killed enemies in current screen
|0x0015 || ? ||
0628    Unused 
|-
0629    Unused 
|0x0016 || Current save slot || $00=first, $01=second, $02=third; On selection/registration/elimination screens: $03=fourth option, $04=fifth option
062A    Unused 
|-
062B    Unused 
|0x0017 || ? ||
062C    Unused 
|-
062D    Current quest              save slot 1: $00=First, $01=Second
|0x0018 || ? ||
062E    Current quest              save slot 2: $00=First, $01=Second
|-
062F    Current quest              save slot 3: $00=First, $01=Second
|0x0019 || ? ||
0630    Number of deaths            save slot 1 
|-
0631    Number of deaths            save slot 2 
|0x001A || ? ||
0632    Number of deaths            save slot 3 
|-
0656    Selected item pos          Cursor position for selecting Link's B item   
|0x001B || ? ||
0657    Current sword              $00=None, $01=Sword, $02=White Sword, $03=Magical Sword
|-
0658    Number of Bombs   
|0x001C || ? ||
0659    Arrow status                $00=None, $01=Arrow, $02=Silver Arrow
|-
065A    Bow in Inventory            $00=False, $01=True
|0x001D || ? ||
065B    Status of candle            $00=None, $01=Blue Candle, $02=Red Candle
|-
065C    Whistle in Inventory        $00=False, $01=True
|0x001E || ? ||
065D    Food in Inventory          $00=False, $01=True
|-
065E    Potion in Inventory        $00=None/Letter, $01=Life Potion, $02=2nd Potion
|0x001F || ? ||
065F    Magical Rod in Inventory    $00=False, $01=True
|-
0660    Raft in Inventory          $00=False, $01=True
|0x0020 || ? ||
0661    Magic Book in Inventory    $00=False, $01=True
|-
0662    Ring in Inventory          $00-None, $01-Blue Ring, $02-Red Ring. Note: Changing this value will not change Link's color.
|0x0021 || ? ||
0663    Step Ladder in Inventory    $00=False, $01=True
|-
0664    Magical Key in Inventory    $00=False, $01=True
|0x0022 || ? ||
0665    Power Bracelet in Invenotry $00=False, $01=True
|-
0666    Letter in Inventory        $00=False, $01=True, Link can buy potions from the old woman if $02.
|0x0023 || ? ||
0667    Compass in Inventory        One bit per level
|-
0668    Map in Inventory            One bit per level
|0x0024 || ? ||
0669    Compass in Inventory        (Level 9)
|-
066A    Map in Inventory            (Level 9)
|0x0025 || ? ||
066C    Clock possessed            $00=False, $01=True
|-
066D    Number of Rupees
|0x0026 || ? ||
066E    Number of Keys
|-
066F    Heart Containers            Low Nibble = how many hearts are filled. High Nybble = Number of heart containers - 1
|0x0027 || ? ||
                                    Ex: $10 = 2 Heart Containers with none filled
|-
0670    Partial heart              $00 = empty, $01 to $7F = half full, $80 to $FF = full.
|0x0028 || ? ||
0671    Triforce pieces            One bit per piece
|-
0674    Boomerang in Inventory      $00=False, $01=True. Note: 0x0675 overrides this variable.
|0x0029 || ? ||
0675    Magical Boomerang in Inventory 
|-
                                    $00=False, $01=True.
|0x002A || ? ||
0676    Magic Shield in Inventory  $00=False, $01=True.
|-
067C    Maximum number of bombs    Starts out as $08.
|0x002B || ? ||
067D    Number of rupees to add   
|-
067E    Number of rupees to subtract   
|0x002C || ? ||
== WRAM ==
|-
RAM    Function                    Details
|0x002D || ? ||
------- --------------------------- -----------------------
|-
6804    Link's tunic color          $29 = green, $32 = blue, $16 = red
|0x002E || ? ||
6B92    Link's tunic color          Overwritten with 0x6804 when Link exits a cave or enters or exits a level
|-
A014    Name table drawing macro offset   
|0x002F || ? ||
                                    Pointer to a macro that writes name table data to PPU memory
|-
|0x0030 || ? ||
|-
|0x0031 || ? ||
|-
|0x0032 || ? ||
|-
|0x0033 || ? ||
|-
|0x0034 || ? ||
|-
|0x0035 || ? ||
|-
|0x0036 || ? ||
|-
|0x0037 || ? ||
|-
|0x0038 || ? ||
|-
|0x0039 || ? ||
|-
|0x003A || ? ||
|-
|0x003B || ? ||
|-
|0x003C || ? ||
|-
|0x003D || ? ||
|-
|0x003E || ? ||
|-
|0x003F || ? ||
|-
|0x0040 || ? ||
|-
|0x0041 || ? ||
|-
|0x0042 || ? ||
|-
|0x0043 || ? ||
|-
|0x0044 || ? ||
|-
|0x0045 || ? ||
|-
|0x0046 || ? ||
|-
|0x0047 || ? ||
|-
|0x0048 || ? ||
|-
|0x0049 || ? ||
|-
|0x004A || ? ||
|-
|0x004B || ? ||
|-
|0x004C || Countdown until Link can use his sword again after touching a White Bubble ||
|-
|0x004D || ? ||
|-
|0x004E || ? ||
|-
|0x004F || ? ||
|-
|0x0050 || ? ||
|-
|0x0051 || ? ||
|-
|0x0052 || ? ||
|-
|0x0053 || ? ||
|-
|0x0054 || ? ||
|-
|0x0055 || ? ||
|-
|0x0056 || ? ||
|-
|0x0057 || ? ||
|-
|0x0058 || ? ||
|-
|0x0059 || ? ||
|-
|0x005A || ? ||
|-
|0x005B || ? ||
|-
|0x005C || ? ||
|-
|0x005D || ? ||
|-
|0x005E || ? ||
|-
|0x005F || ? ||
|-
|0x0060 || ? ||
|-
|0x0061 || ? ||
|-
|0x0062 || ? ||
|-
|0x0063 || ? ||
|-
|0x0064 || ? ||
|-
|0x0065 || ? ||
|-
|0x0066 || ROM Offset for start of current Song Data (low byte) ||
|-
|0x0067 || ROM Offset for start of current Song Data (high byte) ||
|-
|0x0068 || ? ||
|-
|0x0069 || ? ||
|-
|0x006A || Pulse-2 Channel Frequency Offset ||
|-
|0x006B || Pulse-1 Channel Frequency Offset ||
|-
|0x006C || Offset related to Music Pointers ||
|-
|0x006D || ? ||
|-
|0x006E || ? ||
|-
|0x006F || ? ||
|-
|0x0070 || Link's X-position on the screen ||
|-
|0x0071 || Enemy #1's X-position || Also used for dropped enemy item
|-
|0x0072 || Enemy #2's X-position || Also used for dropped enemy item?
|-
|0x0073 || Enemy #3's X-position || Also used for dropped enemy item?
|-
|0x0074 || Enemy #4's X-position || Also used for dropped enemy item
|-
|0x0075 || Enemy #5's X-position || Also used for dropped enemy item?
|-
|0x0076 || Enemy #6's X-position || Also used for dropped enemy item?
|-
|0x0077 || Enemy #7's X-position || Also used for dropped enemy item?
|-
|0x0078 || Enemy #8's X-position || Also used for dropped enemy item?
|-
|0x0079 || Projectile X-position ||
|-
|0x007A || Projectile X-position ||
|-
|0x007B || Projectile #1's X-position ||
|-
|0x007C || ? ||
|-
|0x007D || ? ||
|-
|0x007E || Link's Sword X-position ||
|-
|0x007F || Boomerang/Bait X-position ||
|-
|0x0080 || ? ||
|-
|0x0081 || ? ||
|-
|0x0082 || Link's Arrow X-position ||
|-
|0x0083 || ? ||
|-
|0x0084 || Link's Y-position on the screen ||
|-
|0x0085 || Enemy #1's Y-position || Also used for dropped enemy item?
|-
|0x0086 || Enemy #2's Y-position || Also used for dropped enemy item?
|-
|0x0087 || Enemy #3's Y-position || Also used for dropped enemy item?
|-
|0x0088 || Enemy #4's Y-position || Also used for dropped enemy item
|-
|0x0089 || Enemy #5's Y-position || Also used for dropped enemy item?
|-
|0x008A || Enemy #6's Y-position || Also used for dropped enemy item?
|-
|0x008B || Enemy #7's Y-position || Also used for dropped enemy item?
|-
|0x008C || Enemy #8's Y-position || Also used for dropped enemy item?
|-
|0x008D || Projectile Y-position ||
|-
|0x008E || Projectile Y-position ||
|-
|0x008F || Projectile #1's Y-position ||
|-
|0x0090 || ? ||
|-
|0x0091 || ? ||
|-
|0x0092 || Link's Sword Y-position ||
|-
|0x0093 || Boomerang/Bait Y Position ||
|-
|0x0094 || ? ||
|-
|0x0095 || ? ||
|-
|0x0096 || Link's Arrow Y-position ||
|-
|0x0097 || Dungeon Floor Item ||
|-
|0x0098 || The direction Link is facing || $08=North, $04=South, $01=East, $02=West
|-
|0x0099 || ? ||
|-
|0x009A || ? ||
|-
|0x009B || ? ||
|-
|0x009C || ? ||
|-
|0x009D || ? ||
|-
|0x009E || ? ||
|-
|0x009F || ? ||
|-
|0x00A0 || ? ||
|-
|0x00A1 || ? ||
|-
|0x00A2 || ? ||
|-
|0x00A3 || ? ||
|-
|0x00A4 || ? ||
|-
|0x00A5 || ? ||
|-
|0x00A6 || ? ||
|-
|0x00A7 || ? ||
|-
|0x00A8 || ? ||
|-
|0x00A9 || ? ||
|-
|0x00AA || ? ||
|-
|0x00AB || Type of item in screen || The value indicates item type (bomb, heart, rupee, etc)
|-
|0x00AC || ? ||
|-
|0x00AD || Type of dropped enemy item #1 ||
|-
|0x00AE || Type of dropped enemy item #2? ||
|-
|0x00AF || Type of dropped enemy item #3 ||
|-
|0x00B0 || Type of dropped enemy item #4 ||
|-
|0x00B1 || Type of dropped enemy item #5? ||
|-
|0x00B2 || Type of dropped enemy item #6? ||
|-
|0x00B3 || Type of dropped enemy item #7? ||
|-
|0x00B4 || Type of dropped enemy item #8? ||
|-
|0x00B5 || Projectile Onscreen? ||
|-
|0x00B6 || Projectile Onscreen? ||
|-
|0x00B7 || Projectile Onscreen? ||
|-
|0x00B8 || ? ||
|-
|0x00B9 || ? ||
|-
|0x00BA || ? ||
|-
|0x00BB || ? ||
|-
|0x00BC || ? ||
|-
|0x00BD || ? ||
|-
|0x00BE || ? ||
|-
|0x00BF || ? ||
|-
|0x00C0 || ? ||
|-
|0x00C1 || ? ||
|-
|0x00C2 || Dropped Enemy Item ||
|-
|0x00C3 || Dropped Enemy Item ||
|-
|0x00C4 || ? ||
|-
|0x00C5 || ? ||
|-
|0x00C6 || ? ||
|-
|0x00C7 || ? ||
|-
|0x00C8 || ? ||
|-
|0x00C9 || ? ||
|-
|0x00CA || ? ||
|-
|0x00CB || ? ||
|-
|0x00CC || ? ||
|-
|0x00CD || ? ||
|-
|0x00CE || ? ||
|-
|0x00CF || ? ||
|-
|0x00D0 || ? ||
|-
|0x00D1 || ? ||
|-
|0x00D2 || ? ||
|-
|0x00D3 || ? ||
|-
|0x00D4 || ? ||
|-
|0x00D5 || ? ||
|-
|0x00D6 || ? ||
|-
|0x00D7 || ? ||
|-
|0x00D8 || ? ||
|-
|0x00D9 || ? ||
|-
|0x00DA || ? ||
|-
|0x00DB || ? ||
|-
|0x00DC || ? ||
|-
|0x00DD || ? ||
|-
|0x00DE || ? ||
|-
|0x00DF || ? ||
|-
|0x00E0 || Game Paused? || $=No, $01=Yes
|-
|0x00E1 || ? ||
|-
|0x00E2 || ? ||
|-
|0x00E3 || ? ||
|-
|0x00E4 || ? ||
|-
|0x00E5 || ? ||
|-
|0x00E6 || ? ||
|-
|0x00E7 || ? ||
|-
|0x00E8 || Screen Scrolling? || $00=No, $08=Northbound, $04=Southbound, $01=Eastbound, $02=Westbound
|-
|0x00E9 || ? ||
|-
|0x00EA || ? ||
|-
|0x00EB || Current map location || Value equals map x location + 0x10 * map y location
|-
|0x00EC || ? ||
|-
|0x00ED || ? ||
|-
|0x00EE || ? ||
|-
|0x00EF || ? ||
|-
|0x00F0 || ? ||
|-
|0x00F1 || ? ||
|-
|0x00F2 || ? ||
|-
|0x00F3 || ? ||
|-
|0x00F4 || ? ||
|-
|0x00F5 || ? ||
|-
|0x00F6 || ? ||
|-
|0x00F7 || ? ||
|-
|0x00F8 || Player 1 Buttons (Last Frame) || R = 1, L = 2, D = 4, U = 8, Start = 10, Select = 20, B = 40, A = 80
|-
|0x00F9 || Player 2 Buttons (Last Frame) || (See above)
|-
|0x00FA || Player 1 Buttons Pressed || $00=No, $08=Up, $04=Down, $01=Right, $02=Left $80=A, $40=B, $20=Select, $10=Start (these can be combined)
|-
|0x00FB || Player 2 Buttons Pressed || (See above)
|-
|0x00FC || Subscreen Y-scroll position || Used for storyboard text and subscreen position
|-
|0x00FD || Subscreen X-scroll position || This is always zero when not scrolling.
|-
|0x00FE || ? ||
|-
|0x00FF || ? ||
|-
|}
<br>
 
{| border="1" cellpadding="1"
| '''RAM''' || '''Function''' || '''Details'''
|-
|0x04CD || The entry from ROM:0x18680 for the current room || Overworld: stair placement, quest secrets, Link's V placement, monster entry
|-
|0x0513 || Whether Link has used the candle on the current screen || $00=No, $01=Yes
|-
|0x0526 || Overworld room to return to when exiting the underworld ||
|-
|0x052E || Red Bubble Sword Disable switch || $01 if Link's use of his sword has been disabled by a red bubble, $00 otherwise.
|-
|0x052F || Maze counter used for rooms 0x61 (forest maze) and 0x1B (mountain room south of level 5) ||
|-
|0x05F0 || Related to current frequency being played by Triangle channel ||
|-
|0x05F1 || Reverb on/off status for Triangle on current song ||
|-
|0x05F4 || Rhythm table pointer for current song ||
|-
|0x0605 || Related to incidental music? ||
|-
|0x0606 || Sound Effects ||
|-
|0x0607 || Incidental Music ||
|-
|0x0609 || Songtype currently active || $80=Title, $40=Dungeon, $20=Level 9, $10=Ending, $08=Item, $04=Triforce, $02=Ganon, $01=Overworld
|-
|0x060A || Current position within Pulse 2 part (with respect to overall music program) ||
|-
|0x060B || Current position within Pulse 1 part (with respect to overall music program) ||
|-
|0x060C || Current position within Triangle part (with respect to overall music program) ||
|-
|0x060D || Current position within Noise part (with respect to overall music program) ||
|-
|0x060E || ? ||
|-
|0x060F || Current cycle duration for notes played on Pulse 1 channel || Uses value from rhythm lookup table
|-
|0x0610 || Current cycle duration for notes played on Pulse 2 channel || Uses value from rhythm lookup table
|-
|0x0611 || Countdown from Pulse 2's current rhythm offset || Uses value from rhythm lookup table
|-
|0x0612 || Pulse 2 countdown; volume fade ||
|-
|0x0613 || Countdown from Pulse 1's current rhythm offset || Uses value from rhythm lookup table
|-
|0x0614 || Pulse 1 countdown; volume fade ||
|-
|0x0615 || Current cycle duration for notes played on Triangle channel || Uses value from rhythm lookup table
|-
|0x0616 || Countdown from value in $615 until next note is to be played ||
|-
|0x0617 || ? ||
|-
|0x0618 || Related to incidental music ||
|-
|0x0619 || Reverb on/off status for BOTH Pulse channels on current song || $80=on, $01=off
|-
|0x061A || ? ||
|-
|0x061B || Countup to Pulse 2 rhythm offset ||
|-
|0x061C || Countup to Pulse 1 rhythm offset ||
|-
|0x061D || ??? (seems to count upward as $616 counts down) || Value is always [$615] - [$616] + 1.
|-
|0x061E || Number of repeats remaining if in Triangle repeat cycle ||
|-
|0x061F || Position within song program of current Triangle repeat coda (return point) ||
|-
|0x0620 || Screen history write index || Contains the index of the next screen history slot to write to (see below)
|-
|0x0621 || Screen history 1 || One of five recently visited map locations
|-
|0x0622 || Screen history 2 || One of five recently visited map locations
|-
|0x0623 || Screen history 3 || One of five recently visited map locations
|-
|0x0624 || Screen history 4 || One of five recently visited map locations
|-
|0x0625 || Screen history 5 || One of five recently visited map locations
|-
|0x0626 || ? ||
|-
|0x0627 || Killed enemy count || Number of killed enemies in current screen
|-
|0x0628 || Unused ||
|-
|0x0629 || Unused ||
|-
|0x062A || Unused ||
|-
|0x062B || Unused ||
|-
|0x062C || Unused ||
|-
|0x062D || Current quest for first save slot || $00=First, $01=Second
|-
|0x062E || Current quest for second save slot || $00=First, $01=Second
|-
|0x062F || Current quest for third save slot || $00=First, $01=Second
|-
|0x0630 || Number of deaths for first save slot ||
|-
|0x0631 || Number of deaths for second save slot ||
|-
|0x0632 || Number of deaths for third save slot ||
|-
|0x0656 || Cursor position for selecting Link's B item ||
|-
|0x0657 || Current sword || $00=None, $01=Sword, $02=White Sword, $03=Magical Sword
|-
|0x0658 || Number of Bombs ||
|-
|0x0659 || Arrow status || $00=None, $01=Arrow, $02=Silver Arrow
|-
|0x065A || Bow in Inventory || $00=False, $01=True
|-
|0x065B || Status of candle || 00=None, $01=Blue Candle, $02=Red Candle
|-
|0x065C || Whistle in Inventory || $00=False, $01=True
|-
|0x065D || Food in Inventory || $00=False, $01=True
|-
|0x065E || Potion in Inventory || $00=None/Letter, $01=Life Potion, $02=2nd Potion
|-
|0x065F || Magical Rod in Inventory || $00=False, $01=True
|-
|0x0660 || Raft in Inventory || $00=False, $01=True
|-
|0x0661 || Magic Book in Inventory || $00=False, $01=True
|-
|0x0662 || Ring in Inventory || $00-None, $01-Blue Ring, $02-Red Ring.  Note: Changing this value will not change Link's color.
|-
|0x0663 || Step Ladder in Inventory || $00=False, $01=True
|-
|0x0664 || Magical Key in Inventory || $00=False, $01=True
|-
|0x0665 || Power Bracelet in Invenotry || $00=False, $01=True
|-
|0x0666 || Letter in Inventory || $00=False, $01=True, Link can buy potions from the old woman if $02.
|-
|0x0667 || Compass status for Levels 1 through 8 || When value is converted to binary, a $01 represents having the Compass and a $00 represents not having it.
|-
|0x0668 || Map status for Levels 1 through 8 || When value is converted to binary, a $01 represents having the Map and a $00 represents not having it.
|-
|0x0669 || Level 9 Compass possessed || $00=False, $01=True
|-
|0x066A || Level 9 Map possessed || $00=False, $01=True
|-
|0x066C || Clock possessed || $00=False, $01=True
|-
|0x066D || Number of Rupees
|-
|0x066E || Number of Keys
|-
|0x066F || Heart Containers || Low Nibble = how many hearts are filled. High Nybble = Number of heart containers - 1 <br> Ex: $10 = 2 Heart Containers with none filled
|-
|0x0670 || The heart following the last filled heart || $00 = empty, $01 to $7F = half full, $80 to $FF = full.
|-
|0x0671 || Triforce pieces || When value is converted to binary, a $01 represents having the piece and a $00 represents not having it.
See [http://img519.imageshack.us/img519/2193/tribitflags0mi.jpg this] image for a visualization.
|-
|0x0674 || Boomerang in Inventory || $00=False, $01=True. Note: 0x0675 overrides this variable.
|-
|0x0675 || Magical Boomerang in Inventory || $00=False, $01=True.
|-
|0x0676 || Magic Shield in Inventory || $00=False, $01=True.
|-
|0x067C || Maximum number of bombs || Starts out as $08.
|-
|0x067D || Number of rupees to add ||
|-
|0x067E || Number of rupees to subtract ||
|-
|0x6804 || Link's tunic color || $29 = green, $32 = blue, $16 = red
|-
|0x6B92 || Link's tunic color. Overwritten with 0x6804 when Link exits a cave or enters or exits a level
|-
|0xA014 || Name table drawing macro offset || Pointer to a macro that writes name table data to PPU memory
|-
|}

Revision as of 18:43, 16 March 2014

Chip tiny.png The following article is a RAM map for The Legend of Zelda.

The corresponding ROM map can be found here.

Zero Page

Address     Function                    Details
----------- --------------------------- -----------------------------------------
00          Multiple Functions          X-coords of sprite, ...     
01          Multiple Functions          Y-coords of sprite, ...     
02          Multiple Functions          Tile # for sprite (left half), ...  
03          Multiple Functions          Tile # for sprite (right half), ...     
04          Multiple Functions          Attributes for sprite (left half), ...  
05          Multiple Functions          Attributes for sprite (right half), ...     
06-0F        ?          
10          Current Level               (0 = overworld)
11           ?          
12          Game Mode                   0=Title/transitory    1=Selection Screen
                                        5=Normal              6=Preparing Scroll
                                        7=Scrolling           4=Finishing Scroll;
                                        E=Registration        F=Elimination 
13           ?          
14           ?          
15          Frame counter       
16          Current save slot           $00=first, $01=second, $02=third; On selection/registration/elimination screens: $03=fourth option, $04=fifth option
17-4B        ?          
4C          Countdown until Link can use his sword again after touching a White Bubble  
4D-65        ?  
66          ROM Offset for start of current Song Data (low byte)    
67          ROM Offset for start of current Song Data (high byte)   
68           ?  
69           ?  
6A          Pulse-2 Channel Frequency Offset    
6B          Pulse-1 Channel Frequency Offset    
6C          Offset related to Music Pointers    
6D-6F        ?  
70          Link's screen X             X Position on screen
71          Enemy 1 X-position          Also used for dropped enemy item
72          Enemy 2 X-position          Also used for dropped enemy item
73          Enemy 3 X-position          Also used for dropped enemy item
74          Enemy 4 X-position          Also used for dropped enemy item
75          Enemy 5 X-position          Also used for dropped enemy item
76          Enemy 6 X-position          Also used for dropped enemy item
77          Enemy 7 X-position          Also used for dropped enemy item
78          Enemy 8 X-position          Also used for dropped enemy item
79          Projectile X-position   
7A          Projectile X-position   
7B          Projectile #1's X-position  
7C           ?  
7D           ?  
7E          Link's Sword X-position     
7F          Boomerang/Bait X-position   
80           ?  
81           ?  
82          Link's Arrow X-position     
83           ?  
84          Link's Y-position on the screen     
85          Enemy 1 Y-position          Also used for dropped enemy item
86          Enemy 2 Y-position          Also used for dropped enemy item
87          Enemy 3 Y-position          Also used for dropped enemy item
88          Enemy 4 Y-position          Also used for dropped enemy item
89          Enemy 5 Y-position          Also used for dropped enemy item
8A          Enemy 6 Y-position          Also used for dropped enemy item
8B          Enemy 7 Y-position          Also used for dropped enemy item
8C          Enemy 8 Y-position          Also used for dropped enemy item
8D          Projectile Y-position   
8E          Projectile Y-position   
8F          Projectile #1's Y-position  
90           ?  
91           ?  
92          Link's Sword Y-position     
93          Boomerang/Bait Y Position   
94           ?  
95           ?  
96          Link's Arrow Y-position     
97          Dungeon Floor Item  
98          Links direction             $08=North, $04=South, $01=East, $02=West
99-AA        ?  
AB          Type of item in screen  The value indicates item type (bomb, heart, rupee, etc)
AC           ?  
AD          Type of dropped enemy item #1 
AE          Type of dropped enemy item #2 
AF          Type of dropped enemy item #3 
B0          Type of dropped enemy item #4 
B1          Type of dropped enemy item #5 
B2          Type of dropped enemy item #6 
B3          Type of dropped enemy item #7 
B4          Type of dropped enemy item #8 
B5          Projectile Onscreen?    
B6          Projectile Onscreen?    
B7          Projectile Onscreen?    
B8-C1        ?  
C2          Dropped Enemy Item  
C3          Dropped Enemy Item  
C4-DF        ?  
E0          Game Paused?                $00=No, $01=Yes
E1-E7        ?          
E8          Screen Scrolling?           $00=No, $08=Northbound, $04=Southbound, $01=Eastbound, $02=Westbound
E9           ?          
EA           ?          
EB          Map location                Value equals map x location + 0x10 * map y location
EC-F7        ?  
F8          Player 1 Buttons            (Last Frame)   R = 1, L = 2, D = 4, U = 8, Start = 10, Select = 20, B = 40, A = 80
F9          Player 2 Buttons            (Last Frame)   (See above)
FA          Player 1 Buttons            Pressed    $08=Up, $04=Down, $01=Right, $02=Left $80=A, $40=B, $20=Select, $10=Start 
FB          Player 2 Buttons            Pressed    (See above)
FC          Subscreen Y-scroll position Used for storyboard text and subscreen position
FD          Subscreen X-scroll position This is always zero when not scrolling.
FE           ?  
FF           ?  

RAM

RAM     Function                    Details
------- --------------------------- -----------------------
04CD    Screen options              The entry from ROM:0x18680 for the current room     Overworld: stair placement, quest secrets, Link's V placement, monster entry
0513    Candle used                 Whether Link has used the candle on the current screen  $00=No, $01=Yes
0526    Cave return screen          Overworld room to return to when exiting the underworld     
052E    Sword disable               Red Bubble Sword Disable switch: $01 if Link's use of his sword has been disabled by a red bubble, $00 otherwise.
052F    Maze counter                Used for screens 0x61 (forest maze) and 0x1B (mountain room south of level 5)    
05F0                                Related to current frequency being played by Triangle channel   
05F1    Triangle Reverb             Reverb on/off status for Triangle on current song   
05F4    Rhythm table pointer        for current song   
0605                                Related to incidental music?    
0606    Sound Effects   
0607    Incidental Music    
0609    Songtype currently active   $80=Title, $40=Dungeon, $20=Level 9, $10=Ending, $08=Item, $04=Triforce, $02=Ganon, $01=Overworld
060A    Pulse 2 pos                 Current position within Pulse 2 part (with respect to overall music program)    
060B    Pulse 1 pos                 Current position within Pulse 1 part (with respect to overall music program)    
060C    Triangle pos                Current position within Triangle part (with respect to overall music program)   
060D    Noise pos                   Current position within Noise part (with respect to overall music program)  
060E     ?  
060F    Pulse 1 cycle               Current cycle duration for notes played on Pulse 1 channel  Uses value from rhythm lookup table
0610    Pulse 2 cycle               Current cycle duration for notes played on Pulse 2 channel  Uses value from rhythm lookup table
0611    Pulse 2 rhythm              Countdown from Pulse 2's current rhythm offset  Uses value from rhythm lookup table
0612    Pulse 2 countdown           volume fade  
0613    Pulse 1 rhythem             Countdown from Pulse 1's current rhythm offset  Uses value from rhythm lookup table
0614    Pulse 1 countdown           volume fade  
0615    Triangle cycle              Current cycle duration for notes played on Triangle channel     Uses value from rhythm lookup table
0616    Note countdown              Countdown from value in $615 until next note is to be played    
0617     ?  
0618                                Related to incidental music     
0619    Pulse reverb                Reverb on/off status for BOTH Pulse channels on current song    $80=on, $01=off
061A     ?  
061B    Pulse 2 rhythm counter      Countup to Pulse 2 rhythm offset    
061C    Pulse 1 rhythm counter      Countup to Pulse 1 rhythm offset    
061D                                ??? (seems to count upward as $616 counts down)    Value is always [$615] - [$616] + 1.
061E    Triangle repeat counter     Number of repeats remaining if in Triangle repeat cycle     
061F    Triangle Song pos           Position within song program of current Triangle repeat coda (return point)     
0620    Screen history write index  Contains the index of the next screen history slot to write to (see below)
0621    Screen history 1            One of five recently visited map locations
0622    Screen history 2            One of five recently visited map locations
0623    Screen history 3            One of five recently visited map locations
0624    Screen history 4            One of five recently visited map locations
0625    Screen history 5            One of five recently visited map locations
0626     ?  
0627    Killed enemy count          Number of killed enemies in current screen
0628    Unused  
0629    Unused  
062A    Unused  
062B    Unused  
062C    Unused  
062D    Current quest               save slot 1: $00=First, $01=Second
062E    Current quest               save slot 2: $00=First, $01=Second
062F    Current quest               save slot 3: $00=First, $01=Second
0630    Number of deaths            save slot 1   
0631    Number of deaths            save slot 2   
0632    Number of deaths            save slot 3   
0656    Selected item pos           Cursor position for selecting Link's B item     
0657    Current sword               $00=None, $01=Sword, $02=White Sword, $03=Magical Sword
0658    Number of Bombs     
0659    Arrow status                $00=None, $01=Arrow, $02=Silver Arrow
065A    Bow in Inventory            $00=False, $01=True
065B    Status of candle            $00=None, $01=Blue Candle, $02=Red Candle
065C    Whistle in Inventory        $00=False, $01=True
065D    Food in Inventory           $00=False, $01=True
065E    Potion in Inventory         $00=None/Letter, $01=Life Potion, $02=2nd Potion
065F    Magical Rod in Inventory    $00=False, $01=True
0660    Raft in Inventory           $00=False, $01=True
0661    Magic Book in Inventory     $00=False, $01=True
0662    Ring in Inventory           $00-None, $01-Blue Ring, $02-Red Ring. Note: Changing this value will not change Link's color.
0663    Step Ladder in Inventory    $00=False, $01=True
0664    Magical Key in Inventory    $00=False, $01=True
0665    Power Bracelet in Invenotry $00=False, $01=True
0666    Letter in Inventory         $00=False, $01=True, Link can buy potions from the old woman if $02.
0667    Compass in Inventory        One bit per level
0668    Map in Inventory            One bit per level
0669    Compass in Inventory        (Level 9)
066A    Map in Inventory            (Level 9)
066C    Clock possessed             $00=False, $01=True
066D    Number of Rupees
066E    Number of Keys
066F    Heart Containers            Low Nibble = how many hearts are filled. High Nybble = Number of heart containers - 1
                                    Ex: $10 = 2 Heart Containers with none filled
0670    Partial heart               $00 = empty, $01 to $7F = half full, $80 to $FF = full.
0671    Triforce pieces             One bit per piece
0674    Boomerang in Inventory      $00=False, $01=True. Note: 0x0675 overrides this variable.
0675    Magical Boomerang in Inventory  
                                    $00=False, $01=True.
0676    Magic Shield in Inventory   $00=False, $01=True.
067C    Maximum number of bombs     Starts out as $08.
067D    Number of rupees to add     
067E    Number of rupees to subtract    

WRAM

RAM     Function                    Details
------- --------------------------- -----------------------
6804    Link's tunic color          $29 = green, $32 = blue, $16 = red
6B92    Link's tunic color          Overwritten with 0x6804 when Link exits a cave or enters or exits a level
A014    Name table drawing macro offset     
                                    Pointer to a macro that writes name table data to PPU memory