Difference between revisions of "RAM: Bank 0x7E: Page 0x00"

From TLoZ: ALTTP Hacking Resources
Jump to: navigation, search
m (Superskuj moved page Rom/Page 0x00 to RAM: Bank 0x7E: Page 0x00)
Line 5: Line 5:
 
* {{$|00}}[{{0x|10}}] = Mainly used as work registers. Storage of addresses and values.
 
* {{$|00}}[{{0x|10}}] = Mainly used as work registers. Storage of addresses and values.
 
* {{$|10}}[{{0x|01}}] = Main Module index
 
* {{$|10}}[{{0x|01}}] = Main Module index
* {{$|11}}[{{0x|01}}] = Submodule Index (See $B0)
+
** {{0x|00}} - Triforce / Zelda startup screens
 +
** {{0x|01}} - Game Select screen
 +
** {{0x|02}} - Copy Player Mode
 +
** {{0x|03}} - Erase Player Mode
 +
** {{0x|04}} - Name Player Mode
 +
** {{0x|05}} - Loading Game Mode
 +
** {{0x|06}} - Pre Dungeon Mode
 +
** {{0x|07}} - Dungeon Mode
 +
** {{0x|08}} - Pre Overworld Mode
 +
** {{0x|09}} - Overworld Mode
 +
** {{0x|0A}} - Pre Overworld Mode (special overworld)
 +
** {{0x|0B}} - Overworld Mode (special overworld)
 +
** {{0x|0C}} - ???? I think we can declare this one unused, almost with complete certainty.
 +
** {{0x|0D}} - Blank Screen
 +
** {{0x|0E}} - Text Mode/Item Screen/Map
 +
** {{0x|0F}} - Closing Spotlight
 +
** {{0x|10}} - Opening Spotlight
 +
** {{0x|11}} - Happens when you fall into a hole from the OW.
 +
** {{0x|12}} - Death Mode
 +
** {{0x|13}} - Boss Victory Mode (refills stats)
 +
** {{0x|14}} - History Mode
 +
** {{0x|15}} - Module for Magic Mirror
 +
** {{0x|16}} - Module for refilling stats after boss.
 +
** {{0x|17}} - Restart mode (save and quit)
 +
** {{0x|18}} - Ganon exits from Agahnim's body. Chase Mode.
 +
** {{0x|19}} - Triforce Room scene
 +
** {{0x|1A}} - End sequence
 +
** {{0x|1B}} - Screen to select where to start from (House, sanctuary, etc.)
 +
 
 +
* {{$|11}}[{{0x|01}}] = Submodule Index (See {{$|B0}})
 
* {{$|12}}[{{0x|01}}] = NMI Boolean.
 
* {{$|12}}[{{0x|01}}] = NMI Boolean.
** If set to zero, the game will wait at a certain loop until NMI executes. The NMI interrupt generally sets
+
** If set to zero, the game will wait at a certain loop until NMI executes. The NMI interrupt generally sets it to one after it's done so that the game can continue doing things other than updating the screen.
it to one after it's done so that the game can continue doing things other than updating the screen.
 
 
* {{$|13}}[{{0x|01}}] = Screen settings
 
* {{$|13}}[{{0x|01}}] = Screen settings
* {{$|14}}[{{0x|01] = Graphics Flag
+
* {{$|14}}[{{0x|01}}] = Graphics Flag
 
** Value based flag, that if nonzero, causes the tile map to update
 
** Value based flag, that if nonzero, causes the tile map to update
* {{$|15}}[{{0x|01] = Graphics Flag
+
* {{$|15}}[{{0x|01}}] = Graphics Flag
** update CGRAM (0x200 bytes)
+
** update CGRAM ({{0x|200}} bytes)
* {{$|16}}[{{0x|01] = Graphics Flag
+
* {{$|16}}[{{0x|01}}] = Graphics Flag
 
** update HUD portion of BG3 tile map from {{$|7EC700}} ({{0x|14A}} bytes)
 
** update HUD portion of BG3 tile map from {{$|7EC700}} ({{0x|14A}} bytes)
* {{$|17}}[{{0x|01] = Graphics Flag
+
* {{$|17}}[{{0x|01}}] = Graphics Flag
* {{$|18}}[{{0x|01] = Graphics Flag
+
* {{$|18}}[{{0x|01}}] = Graphics Flag
  
 
* {{$|19}}[{{0x|01}}] = Graphics flag.
 
* {{$|19}}[{{0x|01}}] = Graphics flag.
Line 35: Line 63:
 
* {{$|22}}[{{0x|02}}] = Link’s X-Coordinate (mirrored at {{$|0FC2}})
 
* {{$|22}}[{{0x|02}}] = Link’s X-Coordinate (mirrored at {{$|0FC2}})
 
* {{$|22}}[{{0x|01}}] = (alternate) Used as a step counter for the attract mode.
 
* {{$|22}}[{{0x|01}}] = (alternate) Used as a step counter for the attract mode.
* {{$|24}}[{{0x|02}}] = 0xFFFF usually, but if Link is elevated off the ground it is considered to be his Z coordinate i.e. it's his height off of the ground
+
* {{$|24}}[{{0x|02}}] = {{0x|FFFF}} usually, but if Link is elevated off the ground it is considered to be his Z coordinate i.e. it's his height off of the ground
 
* {{$|26}}[{{0x|01}}] = Link’s push state (These of course can be combined):
 
* {{$|26}}[{{0x|01}}] = Link’s push state (These of course can be combined):
 
** right = {{0x|1}}
 
** right = {{0x|1}}
Line 59: Line 87:
 
** 6 - right.
 
** 6 - right.
 
* {{$|30}}[{{0x|01}}] = When Link is moving down or up, this is the signed number of pixels that his Y coordinate will change by
 
* {{$|30}}[{{0x|01}}] = When Link is moving down or up, this is the signed number of pixels that his Y coordinate will change by
* {{$|31}}[{{0x|01}}] = Same as $30 except it's for X coordinates
+
* {{$|31}}[{{0x|01}}] = Same as {{$|30}} except it's for X coordinates
* {{$|32}}[{{0x|02}}] = seems to be used in some subsection of Bank 07, not sure which one though
+
* {{$|32}}[{{0x|02}}] = seems to be used in some subsection of Bank {{0x|07}}, not sure which one though
 
* {{$|34}}[{{0x|04}}] = ???? These seem to be free ram
 
* {{$|34}}[{{0x|04}}] = ???? These seem to be free ram
 
* {{$|38}}[{{0x|02}}] = seems to be set some of the time when going up diagonal walls.
 
* {{$|38}}[{{0x|02}}] = seems to be set some of the time when going up diagonal walls.
It's a bit field for tiles type 0x10 through 0x13
+
It's a bit field for tiles type {{0x|10}} through {{0x|13}}
 
* {{$|3A}}[{{0x|01}}] = Bit 7: the B button is held down or sword is out.
 
* {{$|3A}}[{{0x|01}}] = Bit 7: the B button is held down or sword is out.
 
** Bit 6: the Y button is down.
 
** Bit 6: the Y button is down.
Line 75: Line 103:
 
* {{$|40}}[{{0x|01}}] = Y coordinate related variable
 
* {{$|40}}[{{0x|01}}] = Y coordinate related variable
 
* {{$|41}}[{{0x|01}}] = X coordinate related variable
 
* {{$|41}}[{{0x|01}}] = X coordinate related variable
* {{$|42}}[{{0x|01}}] = set to 0x0F during preoverworld
+
* {{$|42}}[{{0x|01}}] = set to {{0x|0F}} during preoverworld
 
* {{$|43}}[{{0x|01}}] = "
 
* {{$|43}}[{{0x|01}}] = "
536$44}}[{{0x|01}}] = set to 0x80 during preoverworld
+
* {{$|44}}[{{0x|01}}] = set to {{0x|80}} during preoverworld
 
* {{$|45}}[{{0x|01}}] = "
 
* {{$|45}}[{{0x|01}}] = "
* {{$|46}}[{{0x|01}}] = A countdown timer that incapacitates Link when damaged or in recoil state.
+
* {{$|46}}[{{0x|01}}] = A countdown timer that incapacitates Link when damaged or in recoil state. If nonzero, no movement input is recorded for Link.
If nonzero, no movement input is recorded for Link.
 
 
* {{$|47}}[{{0x|01}}] = Set when damaging enemies, unsure of exact usage yet.
 
* {{$|47}}[{{0x|01}}] = Set when damaging enemies, unsure of exact usage yet.
 
* {{$|48}}[{{0x|01}}] = If set, when you push A Link will grab at the air.
 
* {{$|48}}[{{0x|01}}] = If set, when you push A Link will grab at the air.
 
* {{$|49}}[{{0x|01}}] = This address is written to make Link move in any given direction. Indoors it is cleared every frame.
 
* {{$|49}}[{{0x|01}}] = This address is written to make Link move in any given direction. Indoors it is cleared every frame.
 
Outdoors it is not cleared every frame so watch out.
 
Outdoors it is not cleared every frame so watch out.
* {{$|4B}}[{{0x|01}}] = Link's visibility status. If set to 0xC, Link will disappear.
+
* {{$|4B}}[{{0x|01}}] = Link's visibility status. If set to {{0x0C}}, Link will disappear.
* {{$|4C}}[{{0x|01}}] = Counter that decreases every frame when the Cape is in used. Starts at 4 and counts down to 0.
+
* {{$|4C}}[{{0x|01}}] = Counter that decreases every frame when the Cape is in used. Starts at 4 and counts down to 0. When it reaches 0, your magic meter is decremented based on whether you have full or 1/2 magic. There's a table in Bank {{0x|07}} that determines this
When it reaches 0, your magic meter is decremented based on whether you have full or 1/2 magic.
+
* {{$|4D}}[{{0x|01}}] = An Auxiliary Link handler. As far as I know:
There's a table in Bank 07 that determines this
+
** {{0x|00}} - ground state (normal)
* {{$|4D}}[{{0x|01}}] = An Auxiliary Link handler.
+
** {{0x|01}} - the recoil status
As far as I know:
+
** {{0x|02}} - jumping in and out of water?
** 0x00 - ground state (normal)
+
** {{0x|04}} - swimming state.
** 0x01 - the recoil status
 
** 0x02 - jumping in and out of water?
 
** 0x04 - swimming state.
 
 
* {{$|4E}}[{{0x|01}}] = ????
 
* {{$|4E}}[{{0x|01}}] = ????
 
* {{$|4F}}[{{0x|01}}] = Index for creating the dashing sound effect. If frozen to a single value, no sound occurs.
 
* {{$|4F}}[{{0x|01}}] = Index for creating the dashing sound effect. If frozen to a single value, no sound occurs.
 
* {{$|50}}[{{0x|01}}] = A flag indicating whether a change of the direction Link is facing is possible.For example, when the B button is held down with a sword.
 
* {{$|50}}[{{0x|01}}] = A flag indicating whether a change of the direction Link is facing is possible.For example, when the B button is held down with a sword.
 
** 0 - can change,
 
** 0 - can change,
** on zero - can't change.
+
** Non zero - can't change.
 
* {{$|51}}[{{0x|01}}] = ????
 
* {{$|51}}[{{0x|01}}] = ????
 
* {{$|53}}[{{0x|01}}] = ????
 
* {{$|53}}[{{0x|01}}] = ????
Line 107: Line 131:
 
** 0 = real link.
 
** 0 = real link.
 
* {{$|57}}[{{0x|01}}] = Modifier for Link's movement speed.
 
* {{$|57}}[{{0x|01}}] = Modifier for Link's movement speed.
** 0x00 to 0x-- = normal
+
** {{0x|00}} to {{0x|--}} = normal
** 0x01 to 0x0F = slow
+
** {{0x|01}} to {{0x|0F}} = slow
** 0x10 to 0xFF = fast
+
** {{0x|10}} to {{0x|FF}} = fast
 
Negative values actually reverse your direction!
 
Negative values actually reverse your direction!
 
* {{$|58}}[{{0x|01}}] = Bitfield describing interactions with stairs tiles. uuuussss
 
* {{$|58}}[{{0x|01}}] = Bitfield describing interactions with stairs tiles. uuuussss
 
** s - Stair tiles
 
** s - Stair tiles
 
** u - free ram
 
** u - free ram
If this masked with 0x07 equals 0x07, Link moves slowly, like he's on a small staircase
+
If this masked with {{0x|07}} equals {{0x|07}}, Link moves slowly, like he's on a small staircase
* {{$|02C0 also needs this variable to be nonzero to trigger
+
* {{$|02C0}} also needs this variable to be nonzero to trigger
 
* {{$|59}}[{{0x|01}}] = ????
 
* {{$|59}}[{{0x|01}}] = ????
 
* {{$|5A}}[{{0x|01}}] = ????
 
* {{$|5A}}[{{0x|01}}] = ????
* {{$|5B}}[{{0x|01}}] = 0: indicates nothing
+
* {{$|5B}}[{{0x|01}}] =  
1: Link is dangerously near the edge of a pit
+
** 0 - indicates nothing
2: Link is falling
+
** 1 - Link is dangerously near the edge of a pit
 +
** 2 - Link is falling
 
* {{$|5D}}[{{0x|01}}] = Link Handler or "State"
 
* {{$|5D}}[{{0x|01}}] = Link Handler or "State"
** 0x0 - ground state
+
** {{0x|00}} - ground state
** 0x1 - falling into a hole
+
** {{0x|01}} - falling into a hole
** 0x2 - recoil from hitting wall / enemies
+
** {{0x|02}} - recoil from hitting wall / enemies
** 0x3 - spin attacking
+
** {{0x|03}} - spin attacking
** 0x4 - swimming
+
** {{0x|04}} - swimming
** 0x5 - Turtle Rock platforms
+
** {{0x|05}} - Turtle Rock platforms
** 0x6 - recoil again (other movement)
+
** {{0x|06}} - recoil again (other movement)
** 0x7 - hit by Aghanim’s bug zapper
+
** {{0x|07}} - hit by Aghanim’s bug zapper
** 0x8 - using ether medallion
+
** {{0x|08}} - using ether medallion
** 0x9 - using bombos medallion
+
** {{0x|09}} - using bombos medallion
** 0xA - using quake medallion
+
** {{0x|0A}} - using quake medallion
** 0xB - ???
+
** {{0x|0B}} - ???
** 0xC - ???
+
** {{0x|0C}} - ???
** 0xD - ???
+
** {{0x|0D}} - ???
** 0xE - ???
+
** {{0x|0E}} - ???
** 0xF - ???
+
** {{0x|0F}} - ???
** 0x10 - ???
+
** {{0x|10}} - ???
** 0x11 - falling off a ledge
+
** {{0x|11}} - falling off a ledge
** 0x12 - used when coming out of a dash by pressing a direction other than the dash direction
+
** {{0x|12}} - used when coming out of a dash by pressing a direction other than the dash direction
** 0x13 - hookshot
+
** {{0x|13}} - hookshot
** 0x14 - magic mirror
+
** {{0x|14}} - magic mirror
** 0x15 - holding up an item
+
** {{0x|15}} - holding up an item
** 0x16 - asleep in his bed
+
** {{0x|16}} - asleep in his bed
** 0x17 - permabunny
+
** {{0x|17}} - permabunny
** 0x18 - stuck under a heavy rock
+
** {{0x|18}} - stuck under a heavy rock
** 0x19 - Receiving Ether Medallion
+
** {{0x|19}} - Receiving Ether Medallion
** 0x1A - Receiving Bombos Medallion
+
** {{0x|1A}} - Receiving Bombos Medallion
** 0x1B - Opening Desert Palace
+
** {{0x|1B}} - Opening Desert Palace
** 0x1C - temporary bunny
+
** {{0x|1C}} - temporary bunny
** 5380x1D - Rolling back from Gargoyle gate or PullForRupees object
+
** {{0x|1D}} - Rolling back from Gargoyle gate or PullForRupees object
** 0x1E - The actual spin attack motion.
+
** {{0x|1E}} - The actual spin attack motion.
 
* {{$|5E}}[{{0x|01}}] = Speed setting for Link. The different values this can be set to index into a table that sets his real speed. Some common values:
 
* {{$|5E}}[{{0x|01}}] = Speed setting for Link. The different values this can be set to index into a table that sets his real speed. Some common values:
** 0x00 - Normal walking speed
+
** {{0x|00}} - Normal walking speed
** 0x02 - Walking (or dashing) on stairs
+
** {{0x|02}} - Walking (or dashing) on stairs
** 0x10 - Dashing
+
** {{0x|10}} - Dashing
 
* {{$|60}}[{{0x|01}}] = During story mode, used as a counter for one set of jump tables.
 
* {{$|60}}[{{0x|01}}] = During story mode, used as a counter for one set of jump tables.
* {{$|64}}[{{0x|02}}] = 0x1000 if $EE = 1,
+
* {{$|64}}[{{0x|02}}] = {{0x|1000}} if {{$|EE}} = 1,
** 0x2000 if $EE = 0.
+
** {{0x|2000}} if {{$|EE}} = 0.
 
* {{$|66}}[{{0x|01}}] = Indicates the last direction Link moved towards. Value wise:
 
* {{$|66}}[{{0x|01}}] = Indicates the last direction Link moved towards. Value wise:
 
** 0 - Up,
 
** 0 - Up,
Line 175: Line 200:
 
* {{$|6A}}[{{0x|01}}] = ???
 
* {{$|6A}}[{{0x|01}}] = ???
 
* {{$|6B}}[{{0x|01}}] =
 
* {{$|6B}}[{{0x|01}}] =
** moving up against a \ wall: 0x1A
+
** moving up against a \ wall: {{0x|1A}}
** moving right against a \ wall: 0x25
+
** moving right against a \ wall: {{0x|25}}
** moving down against a \ wall: 0x15
+
** moving down against a \ wall: {{0x|15}}
** moving left against a \ wall: 0x2A
+
** moving left against a \ wall: {{0x|2A}}
** moving up against a / wall: 0x19
+
** moving up against a / wall: {{0x|19}}
** moving left against a / wall: 0x26
+
** moving left against a / wall: {{0x|26}}
** moving right against a / wall: 0x29
+
** moving right against a / wall: {{0x|29}}
** moving down against a / wall: 0x16
+
** moving down against a / wall: {{0x|16}}
 
* {{$|6C}}[{{0x|01}}] = Indicates whether you are standing in a doorway
 
* {{$|6C}}[{{0x|01}}] = Indicates whether you are standing in a doorway
 
** 0 - not standing in a doorway.
 
** 0 - not standing in a doorway.
Line 188: Line 213:
 
** 2 - standing in a horizontal door way
 
** 2 - standing in a horizontal door way
 
{{$|6D}}[{{0x|01}}] = When you are moving against a diagonal wall and you are deadlocked, i.e. you are pressing against it
 
{{$|6D}}[{{0x|01}}] = When you are moving against a diagonal wall and you are deadlocked, i.e. you are pressing against it
directly, but aren't going anywhere, this will contain the value that $6B}}[{{0x|01] would have.
+
directly, but aren't going anywhere, this will contain the value that {{$|6B}}[{{0x|01}}] would have.
 
* {{$|6E}}[{{0x|01}}] = (archiving but not sure if this is correct) Related to certain tile behaviours (see tile type 2 I think) nearby
 
* {{$|6E}}[{{0x|01}}] = (archiving but not sure if this is correct) Related to certain tile behaviours (see tile type 2 I think) nearby
 
** moving against a \ wall from below: 0
 
** moving against a \ wall from below: 0
Line 196: Line 221:
 
* {{$|6F}}[{{0x|03}}] = As of now, I consider this to be free ram
 
* {{$|6F}}[{{0x|03}}] = As of now, I consider this to be free ram
 
* {{$|72}}[{{0x|01}}] = ????
 
* {{$|72}}[{{0x|01}}] = ????
* {{$|73}}[{{0x|01}}] = has value 0x02 when master sword beam is active...
+
* {{$|73}}[{{0x|01}}] = has value {{0x|02}} when master sword beam is active...
 
* {{$|74}}[{{0x|02}}] = ??? Related to moving water?
 
* {{$|74}}[{{0x|02}}] = ??? Related to moving water?
 
* {{$|76}}[{{0x|02}}] = When link interacts with certain tile types, the index of that tile gets stored here.
 
* {{$|76}}[{{0x|02}}] = When link interacts with certain tile types, the index of that tile gets stored here.
 
* {{$|78}}[{{0x|01}}] = possibly used in the context of chests.
 
* {{$|78}}[{{0x|01}}] = possibly used in the context of chests.
 
* {{$|79}}[{{0x|01}}] = Controls whether to do a spin attack or not (Found by PARCCC from gshi)
 
* {{$|79}}[{{0x|01}}] = Controls whether to do a spin attack or not (Found by PARCCC from gshi)
* {{$|7B
+
* {{$|7B}}[{{0x|01}}] = Set to {{0x|00}} when in the Light World, and {{0x|40}} when in the Dark World. Often used for temporary calculations, so don't expect it to be reflective of the current status of the player at all times.
 
* {{$|82}}[{{0x|02}}] = ????
 
* {{$|82}}[{{0x|02}}] = ????
 
* {{$|84}}[{{0x|02}}] = not sure...
 
* {{$|84}}[{{0x|02}}] = not sure...
Line 211: Line 236:
 
* {{$|90}}[{{0x|02}}] = Points to current position in the low OAM buffer (the first 512 bytes)
 
* {{$|90}}[{{0x|02}}] = Points to current position in the low OAM buffer (the first 512 bytes)
 
* {{$|92}}[{{0x|02}}] = Points to current position in the high OAM table buffer (later 32 bytes)
 
* {{$|92}}[{{0x|02}}] = Points to current position in the high OAM table buffer (later 32 bytes)
* {{$|94}}[{{0x|01}}] = Screen Mode Register ($2105)
+
* {{$|94}}[{{0x|01}}] = Screen Mode Register ({{$|2105}})
* {{$|95}}[{{0x|01}}] = Mosaic Settings ($2106)
+
* {{$|95}}[{{0x|01}}] = Mosaic Settings ({{$|2106}})
* {{$|96}}[{{0x|01}}] = Window Masks for Backgrounds 1 and 2 ($2123)
+
* {{$|96}}[{{0x|01}}] = Window Masks for Backgrounds 1 and 2 ({{$|2123}})
* {{$|97}}[{{0x|01}}] = Window Masks for Backgrounds 3 and 4 ($2124)
+
* {{$|97}}[{{0x|01}}] = Window Masks for Backgrounds 3 and 4 ({{$|2124}})
* {{$|98}}[{{0x|01}}] = Window Masks for Obj and Color Add/Subtraction Layers ($2125)
+
* {{$|98}}[{{0x|01}}] = Window Masks for Obj and Color Add/Subtraction Layers ({{$|2125}})
* {{$|99}}[{{0x|01}}] = Enable Fixed Color +/- ($2130)
+
* {{$|99}}[{{0x|01}}] = Enable Fixed Color +/- ({{$|2130}})
* {{$|9A}}[{{0x|01}}] = Enable +/- per layer ($2131)
+
* {{$|9A}}[{{0x|01}}] = Enable +/- per layer ({{$|2131}})
* {{$|9B}}[{{0x|01}}] = HDMA channels to write to ($420C)
+
* {{$|9B}}[{{0x|01}}] = HDMA channels to write to ({{$|420C}})
* {{$|9C}}[{{0x|01}}] = writes to $2132. Red fixed color component
+
* {{$|9C}}[{{0x|01}}] = writes to {{$|2132}}. Red fixed color component
* {{$|9D}}[{{0x|01}}] = writes to $2132. Green fixed color component
+
* {{$|9D}}[{{0x|01}}] = writes to {{$|2132}}. Green fixed color component
* {{$|9E}}[{{0x|01}}] = writes to $2132. Blue fixed color component
+
* {{$|9E}}[{{0x|01}}] = writes to {{$|2132}}. Blue fixed color component
540$9F}}[{{0x|01}}] = free ram?
+
* {{$|9F}}[{{0x|01}}] = free ram?
 
* {{$|A0}}[{{0x|02}}] = The index used for loading a dungeon room. There are 296 rooms all in all. (mirrored in other variables).
 
* {{$|A0}}[{{0x|02}}] = The index used for loading a dungeon room. There are 296 rooms all in all. (mirrored in other variables).
 
* {{$|A2}}[{{0x|02}}] = Points to the previous dungeon room.
 
* {{$|A2}}[{{0x|02}}] = Points to the previous dungeon room.
Line 246: Line 271:
 
* {{$|B7}}[{{0x|03}}] = Used as storage during dungeon loading for a 3-bit pointer to be indirectly accessed.
 
* {{$|B7}}[{{0x|03}}] = Used as storage during dungeon loading for a 3-bit pointer to be indirectly accessed.
 
* {{$|BA}}[{{0x|02}}] = Often used as a position into a buffer of data during dungeon loading.
 
* {{$|BA}}[{{0x|02}}] = Often used as a position into a buffer of data during dungeon loading.
* {{$|BD}}[{{0x|0?}}] = ??? height for initializing sprites?
+
* {{$|BD}}[{{0x|0?}}] =  
Address recorded during tile interactions? (Bank 07)
+
** (Bank {{0x|08}}) Used as a temporary for the Cane of Somaria creation poof, or something like that.
 +
** (Bank {{0x|00}}) Temporary used in expanding 3bpp to 4bpp (high) graphics.
 +
** (Bank {{0x|07}}) Address recorded during tile interactions.
 +
** (Equipment) Seems to represent joypad input for selecting an item.
 
* {{$|BF}}[{{0x|??}}] = Used during the dungeon
 
* {{$|BF}}[{{0x|??}}] = Used during the dungeon
* {{$|C8}}[{{0x|01}}] = (in menus) keeps track of what part of a menu you are in.
+
* {{$|C8}}[{{0x|01}}] =  
For example,
+
** (in menus) keeps track of what part of a menu you are in. For example, 0 - 4 on the select game screen, 0 - 2 for each save game, 3 & 4 are copy and erase game.
0 - 4 on the select game screen,
+
** (in ending module) 16 bit timer used for stepping through each ending sequence.
0 - 2 for each save game,
+
* {{$|E0}}[{{0x|02}}] = BG1 horizontal scroll register ({{$|210F}})
3 & 4 are copy and erase game.
+
* {{$|E2}}[{{0x|02}}] = BG2 horizontal scroll register ({{$|210D}})
541(in ending module) 16 bit timer used for stepping through each ending sequence.
+
* {{$|E4}}[{{0x|02}}] = BG3 Horizontal Scroll Register ({{$|2111}})
* {{$|E0}}[{{0x|02}}] = BG1 horizontal scroll register ($210F)
+
* {{$|E6}}[{{0x|02}}] = BG1 Vertical scroll register ({{$|2110}})
* {{$|E2}}[{{0x|02}}] = BG2 horizontal scroll register ($210D)
+
* {{$|E8}}[{{0x|02}}] = BG2 Vertical scroll register ({{$|210E}})
* {{$|E4}}[{{0x|02}}] = BG3 Horizontal Scroll Register ($2111)
+
* {{$|EA}}[{{0x|02}}] = BG3 Vertical Scroll Register ({{$|2112}})
* {{$|E6}}[{{0x|02}}] = BG1 Vertical scroll register ($2110)
+
* {{$|EC}}[{{0x|02}}] = Tilemap location calculation mask. Is only ever set to {{0x|FFF8}} or {{0x|01F8}}
* {{$|E8}}[{{0x|02}}] = BG2 Vertical scroll register ($210E)
+
* {{$|EE}}[{{0x|01}}] = In dungeons, 0 Means you’re on the upper level. 1 Means you’re on a lower level. Important for interaction with different tile types.
* {{$|EA}}[{{0x|02}}] = BG3 Vertical Scroll Register ($2112)
 
* {{$|EC}}[{{0x|02}}] = Tilemap location calculation mask. Is only ever set to 0xFFF8 or 0x01F8
 
* {{$|EE}}[{{0x|01}}] = In dungeons, 0 Means you’re on the upper level.
 
1 Means you’re on a lower level. Important for interaction with different tile types.
 
 
* {{$|EF}}[{{0x|01}}] = Room Transitioning Value (bitwise)
 
* {{$|EF}}[{{0x|01}}] = Room Transitioning Value (bitwise)
 
bit 0 - Toggles between BG0 and BG1. One example: Sanctuary and Hyrule Castle. (see door type up-11)
 
bit 0 - Toggles between BG0 and BG1. One example: Sanctuary and Hyrule Castle. (see door type up-11)

Revision as of 00:32, 21 December 2016

This is a subpage of RAM

Note that these addresses are only one byte and you can assume that they are $7E00XX where XX are the byte addresses you see below.

  • $00[0x10] = Mainly used as work registers. Storage of addresses and values.
  • $10[0x01] = Main Module index
    • 0x00 - Triforce / Zelda startup screens
    • 0x01 - Game Select screen
    • 0x02 - Copy Player Mode
    • 0x03 - Erase Player Mode
    • 0x04 - Name Player Mode
    • 0x05 - Loading Game Mode
    • 0x06 - Pre Dungeon Mode
    • 0x07 - Dungeon Mode
    • 0x08 - Pre Overworld Mode
    • 0x09 - Overworld Mode
    • 0x0A - Pre Overworld Mode (special overworld)
    • 0x0B - Overworld Mode (special overworld)
    • 0x0C - ???? I think we can declare this one unused, almost with complete certainty.
    • 0x0D - Blank Screen
    • 0x0E - Text Mode/Item Screen/Map
    • 0x0F - Closing Spotlight
    • 0x10 - Opening Spotlight
    • 0x11 - Happens when you fall into a hole from the OW.
    • 0x12 - Death Mode
    • 0x13 - Boss Victory Mode (refills stats)
    • 0x14 - History Mode
    • 0x15 - Module for Magic Mirror
    • 0x16 - Module for refilling stats after boss.
    • 0x17 - Restart mode (save and quit)
    • 0x18 - Ganon exits from Agahnim's body. Chase Mode.
    • 0x19 - Triforce Room scene
    • 0x1A - End sequence
    • 0x1B - Screen to select where to start from (House, sanctuary, etc.)
  • $11[0x01] = Submodule Index (See $B0)
  • $12[0x01] = NMI Boolean.
    • If set to zero, the game will wait at a certain loop until NMI executes. The NMI interrupt generally sets it to one after it's done so that the game can continue doing things other than updating the screen.
  • $13[0x01] = Screen settings
  • $14[0x01] = Graphics Flag
    • Value based flag, that if nonzero, causes the tile map to update
  • $15[0x01] = Graphics Flag
    • update CGRAM (0x200 bytes)
  • $16[0x01] = Graphics Flag
    • update HUD portion of BG3 tile map from $7EC700 (0x14A bytes)
  • $17[0x01] = Graphics Flag
  • $18[0x01] = Graphics Flag
  • $19[0x01] = Graphics flag.
    • When nonzero, will trigger a transfer from $7FXXXX to vram address $YY00 XXXX is specified by variable $0118 YY is specified by this variable
  • $1A[0x01] = Frame Counter
  • $1B[0x01] = Flag is set to 1 if you are in a building. Set to 0 otherwise (credit: Euclid)
  • $1C[0x01] = Main Screen Designation ($212C): xxxsabcd
    • s - Sprite layer enabled
    • a - BG3 enabled
    • b - BG2 enabled
    • c - BG1 enabled
    • d - BG0 enabled
  • $1D[0x01] = Sub Screen Designation ($212D)
  • $1E[0x01] = Window Mask Activation ($212E)
  • $1F[0x01] = Subscreen Window Mask Activation ($212F)
  • $20[0x02] = Link’s Y-Coordinate (mirrored at $0FC4)
  • $22[0x02] = Link’s X-Coordinate (mirrored at $0FC2)
  • $22[0x01] = (alternate) Used as a step counter for the attract mode.
  • $24[0x02] = 0xFFFF usually, but if Link is elevated off the ground it is considered to be his Z coordinate i.e. it's his height off of the ground
  • $26[0x01] = Link’s push state (These of course can be combined):
    • right = 0x1
    • left = 0x2
    • down = 0x4
    • up = 0x8
    • nothing = Template:0x0
  • $26[0x01] = (alternate) Indicates the current 2bpp graphic to display in attract mode.
  • $27[0x01] = Link's Recoil for vertical collisions
  • $27[0x01] = (alternate) Flag indicating whether to display a new 2bpp graphic in attract mode.
  • $28[0x01] = Link's Recoil for horizontal collisions
  • $28[0x01] = (alternate) Aghanim’s base X coordinate relative to the screen. (history mode)
  • $29[0x01] = vertical resistance
  • $29[0x01] = (alternate) Aghanim’s base Y coordinate relative to the screen. (history mode)
  • $2A[0x01] = horizontal resistance
  • $2B[0x02] = ????
  • $2D[0x01] = ????
  • $2E[0x01] = animation steps.. seems to cycle from 0 to 5 then repeats
  • $2F[0x01] = The direction Link is facing:
    • 0 - up,
    • 2 - down,
    • 4 - left,
    • 6 - right.
  • $30[0x01] = When Link is moving down or up, this is the signed number of pixels that his Y coordinate will change by
  • $31[0x01] = Same as $30 except it's for X coordinates
  • $32[0x02] = seems to be used in some subsection of Bank 0x07, not sure which one though
  • $34[0x04] = ???? These seem to be free ram
  • $38[0x02] = seems to be set some of the time when going up diagonal walls.

It's a bit field for tiles type 0x10 through 0x13

  • $3A[0x01] = Bit 7: the B button is held down or sword is out.
    • Bit 6: the Y button is down.
    • Bit 0: Initial B button press
  • $3B[0x01] = Bit 7: the A button is down.
    • Bit 4: ???
  • $3C[0x01] = Lower Nibble: How many frames the B button has been held, approximately.

Upper nibble set to 9 on spin attack release.

  • $3D[0x01] = A delay timer for the spin attack. Used between shifts to make the animation flow with the flash effect.

Also used for delays between different graphics when swinging your sword.

  • $40[0x01] = Y coordinate related variable
  • $41[0x01] = X coordinate related variable
  • $42[0x01] = set to 0x0F during preoverworld
  • $43[0x01] = "
  • $44[0x01] = set to 0x80 during preoverworld
  • $45[0x01] = "
  • $46[0x01] = A countdown timer that incapacitates Link when damaged or in recoil state. If nonzero, no movement input is recorded for Link.
  • $47[0x01] = Set when damaging enemies, unsure of exact usage yet.
  • $48[0x01] = If set, when you push A Link will grab at the air.
  • $49[0x01] = This address is written to make Link move in any given direction. Indoors it is cleared every frame.

Outdoors it is not cleared every frame so watch out.

  • $4B[0x01] = Link's visibility status. If set to Template:0x0C, Link will disappear.
  • $4C[0x01] = Counter that decreases every frame when the Cape is in used. Starts at 4 and counts down to 0. When it reaches 0, your magic meter is decremented based on whether you have full or 1/2 magic. There's a table in Bank 0x07 that determines this
  • $4D[0x01] = An Auxiliary Link handler. As far as I know:
    • 0x00 - ground state (normal)
    • 0x01 - the recoil status
    • 0x02 - jumping in and out of water?
    • 0x04 - swimming state.
  • $4E[0x01] = ????
  • $4F[0x01] = Index for creating the dashing sound effect. If frozen to a single value, no sound occurs.
  • $50[0x01] = A flag indicating whether a change of the direction Link is facing is possible.For example, when the B button is held down with a sword.
    • 0 - can change,
    • Non zero - can't change.
  • $51[0x01] = ????
  • $53[0x01] = ????
  • $55[0x01] = Cape flag, when set, makes you invisible and invincible. You can also go through objects such as bungies.
  • $56[0x01] = Link's graphic status:
    • 1 = bunny link,
    • 0 = real link.
  • $57[0x01] = Modifier for Link's movement speed.
    • 0x00 to 0x-- = normal
    • 0x01 to 0x0F = slow
    • 0x10 to 0xFF = fast

Negative values actually reverse your direction!

  • $58[0x01] = Bitfield describing interactions with stairs tiles. uuuussss
    • s - Stair tiles
    • u - free ram

If this masked with 0x07 equals 0x07, Link moves slowly, like he's on a small staircase

  • $02C0 also needs this variable to be nonzero to trigger
  • $59[0x01] = ????
  • $5A[0x01] = ????
  • $5B[0x01] =
    • 0 - indicates nothing
    • 1 - Link is dangerously near the edge of a pit
    • 2 - Link is falling
  • $5D[0x01] = Link Handler or "State"
    • 0x00 - ground state
    • 0x01 - falling into a hole
    • 0x02 - recoil from hitting wall / enemies
    • 0x03 - spin attacking
    • 0x04 - swimming
    • 0x05 - Turtle Rock platforms
    • 0x06 - recoil again (other movement)
    • 0x07 - hit by Aghanim’s bug zapper
    • 0x08 - using ether medallion
    • 0x09 - using bombos medallion
    • 0x0A - using quake medallion
    • 0x0B - ???
    • 0x0C - ???
    • 0x0D - ???
    • 0x0E - ???
    • 0x0F - ???
    • 0x10 - ???
    • 0x11 - falling off a ledge
    • 0x12 - used when coming out of a dash by pressing a direction other than the dash direction
    • 0x13 - hookshot
    • 0x14 - magic mirror
    • 0x15 - holding up an item
    • 0x16 - asleep in his bed
    • 0x17 - permabunny
    • 0x18 - stuck under a heavy rock
    • 0x19 - Receiving Ether Medallion
    • 0x1A - Receiving Bombos Medallion
    • 0x1B - Opening Desert Palace
    • 0x1C - temporary bunny
    • 0x1D - Rolling back from Gargoyle gate or PullForRupees object
    • 0x1E - The actual spin attack motion.
  • $5E[0x01] = Speed setting for Link. The different values this can be set to index into a table that sets his real speed. Some common values:
    • 0x00 - Normal walking speed
    • 0x02 - Walking (or dashing) on stairs
    • 0x10 - Dashing
  • $60[0x01] = During story mode, used as a counter for one set of jump tables.
  • $64[0x02] = 0x1000 if $EE = 1,
    • 0x2000 if $EE = 0.
  • $66[0x01] = Indicates the last direction Link moved towards. Value wise:
    • 0 - Up,
    • 1 - Down,
    • 2 - Left,
    • 3 - Right
  • $67[0x01] = Indicates which direction Link is walking (even if not going anywhere)

bitwise: 0000abcd.

    • a - Up,
    • b - Down,
    • c - Left,
    • d - Right
  • $68[0x01] = ????
  • $69[0x01] = ???
  • $6A[0x01] = ???
  • $6B[0x01] =
    • moving up against a \ wall: 0x1A
    • moving right against a \ wall: 0x25
    • moving down against a \ wall: 0x15
    • moving left against a \ wall: 0x2A
    • moving up against a / wall: 0x19
    • moving left against a / wall: 0x26
    • moving right against a / wall: 0x29
    • moving down against a / wall: 0x16
  • $6C[0x01] = Indicates whether you are standing in a doorway
    • 0 - not standing in a doorway.
    • 1 - standing in a vertical doorway
    • 2 - standing in a horizontal door way

$6D[0x01] = When you are moving against a diagonal wall and you are deadlocked, i.e. you are pressing against it directly, but aren't going anywhere, this will contain the value that $6B[0x01] would have.

  • $6E[0x01] = (archiving but not sure if this is correct) Related to certain tile behaviours (see tile type 2 I think) nearby
    • moving against a \ wall from below: 0
    • moving against a \ wall from above: 2
    • moving against a / wall from below: 4
    • moving against a / wall from above: 6
  • $6F[0x03] = As of now, I consider this to be free ram
  • $72[0x01] = ????
  • $73[0x01] = has value 0x02 when master sword beam is active...
  • $74[0x02] = ??? Related to moving water?
  • $76[0x02] = When link interacts with certain tile types, the index of that tile gets stored here.
  • $78[0x01] = possibly used in the context of chests.
  • $79[0x01] = Controls whether to do a spin attack or not (Found by PARCCC from gshi)
  • $7B[0x01] = Set to 0x00 when in the Light World, and 0x40 when in the Dark World. Often used for temporary calculations, so don't expect it to be reflective of the current status of the player at all times.
  • $82[0x02] = ????
  • $84[0x02] = not sure...
  • $86[0x02] = not sure...
  • $88[0x02] = not sure...
  • $8A[0x02] = Overworld Screen Index
  • $8C[0x01] = Overlay index (credit: Euclid)
  • $8D[0x01] = ???
  • $90[0x02] = Points to current position in the low OAM buffer (the first 512 bytes)
  • $92[0x02] = Points to current position in the high OAM table buffer (later 32 bytes)
  • $94[0x01] = Screen Mode Register ($2105)
  • $95[0x01] = Mosaic Settings ($2106)
  • $96[0x01] = Window Masks for Backgrounds 1 and 2 ($2123)
  • $97[0x01] = Window Masks for Backgrounds 3 and 4 ($2124)
  • $98[0x01] = Window Masks for Obj and Color Add/Subtraction Layers ($2125)
  • $99[0x01] = Enable Fixed Color +/- ($2130)
  • $9A[0x01] = Enable +/- per layer ($2131)
  • $9B[0x01] = HDMA channels to write to ($420C)
  • $9C[0x01] = writes to $2132. Red fixed color component
  • $9D[0x01] = writes to $2132. Green fixed color component
  • $9E[0x01] = writes to $2132. Blue fixed color component
  • $9F[0x01] = free ram?
  • $A0[0x02] = The index used for loading a dungeon room. There are 296 rooms all in all. (mirrored in other variables).
  • $A2[0x02] = Points to the previous dungeon room.
  • $A4[0x02] = Indicates the current floor Link is on in a dungeon.
  • $A6[0x01] = Set to 0 or 2, but it depends upon the dungeon room's layout and the quadrant it was entered from.
  • $A7[0x01] = ""
  • $A8[0x01] = Composite of dungeon room layout info and quadrant info that gets updated periodically 000cccba
    • ccc - layout that the room uses (0 to 7 obviously)
    • b - ORed in value of $AA
    • a - ORed in value of $A9
  • $A9[0x01] = 0 if you are on the left half of the room.
    • 1 if you are on the right half.
  • $AA[0x01] = 2 if you are the lower half of the room.
    • 0 if you are on the upper half.
  • $AB[0x02] = free ram?
  • $AD[0x01] = ??? collision?
  • $AE[0x01] = In dungeons, holds the Tag1 Value. (see Hyrule Magic)
  • $AF[0x01] = In dungeons, holds the Tag2 Value. (see Hyrule Magic)
  • $B0[0x01] = Sub-submodule index. (Submodules of the $11 submodule index.)
  • $B1[0x01] = free ram?
  • $B2[0x02] = Width indicator for drawing dungeon objects
  • $B4[0x02] = Height indicator for drawing dungeon objects
  • $B7[0x03] = Used as storage during dungeon loading for a 3-bit pointer to be indirectly accessed.
  • $BA[0x02] = Often used as a position into a buffer of data during dungeon loading.
  • $BD[0x0?] =
    • (Bank 0x08) Used as a temporary for the Cane of Somaria creation poof, or something like that.
    • (Bank 0x00) Temporary used in expanding 3bpp to 4bpp (high) graphics.
    • (Bank 0x07) Address recorded during tile interactions.
    • (Equipment) Seems to represent joypad input for selecting an item.
  • $BF[0x??] = Used during the dungeon
  • $C8[0x01] =
    • (in menus) keeps track of what part of a menu you are in. For example, 0 - 4 on the select game screen, 0 - 2 for each save game, 3 & 4 are copy and erase game.
    • (in ending module) 16 bit timer used for stepping through each ending sequence.
  • $E0[0x02] = BG1 horizontal scroll register ($210F)
  • $E2[0x02] = BG2 horizontal scroll register ($210D)
  • $E4[0x02] = BG3 Horizontal Scroll Register ($2111)
  • $E6[0x02] = BG1 Vertical scroll register ($2110)
  • $E8[0x02] = BG2 Vertical scroll register ($210E)
  • $EA[0x02] = BG3 Vertical Scroll Register ($2112)
  • $EC[0x02] = Tilemap location calculation mask. Is only ever set to 0xFFF8 or 0x01F8
  • $EE[0x01] = In dungeons, 0 Means you’re on the upper level. 1 Means you’re on a lower level. Important for interaction with different tile types.
  • $EF[0x01] = Room Transitioning Value (bitwise)

bit 0 - Toggles between BG0 and BG1. One example: Sanctuary and Hyrule Castle. (see door type up-11) bit 1 - Transition between Sewer and Hyrule Castle. Xors the dungeon index by 0x02.

  • $F0[0x01] = Unfiltered Joypad 1 Register: Same as $F4, except it preserves buttons that were being

pressed in the previous frame.

  • $F1[0x01] = Unfiltered Joypad 2 Register: Same as $F5, except it preserves buttons that were being

pressed in the previous frame. Note: Input from joypad 2 is not read unless you do some ASM hacking.

  • $F2[0x01] = Unfiltered Joypad 1 Register: Same as $F6, except it preserves buttons that were being

pressed in the previous frame.

  • $F3[0x01] = Unfiltered Joypad 2 Register: Same as $F7, except it preserves buttons that were being

pressed in the previous frame. Note: Input from joypad 2 is not read unless you do some asm hacking

  • $F4[0x01] = Filtered Joypad 1 Register: [BYST | udlr].

Lower case represents the cardinal directions, T = start. S = select.

  • $F5[0x01] = Filtered Joypad 2 Register: [BYST | udlr].

Lower case represents the cardinal directions, T = start. S = select. Note: Input from joypad 2 is not read unless you do some asm hacking

  • $F6[0x01] = Filtered Joypad Register [AXLR | ????]

LR: The shoulder buttons. ? = unknown inputs

  • $F7[0x01] = Filtered Joypad Register [AXLR | ????]

LR: The shoulder buttons. ? = unknown inputs. Note: input from joypad 2 is not read unless you do some asm hacking.

  • $F8[0x01] = ???
  • $FC[0x02] = .... Overrides for dungeon room transitions? (Seen used with big bombable walls)
  • $FF[0x01] = Vertical IRQ Trigger (this is the vertical scanline that will trigger the IRQ)

Navigate

Table of Contents
SpritesDungeonsOverworldUnderworldSRAM MapRAM MapROM MapMusicMonologueCreditsDumpsMiscellaneousTo-Do/Suggestions