RAM: Bank 0x7E: Page 0x03

From TLoZ: ALTTP Hacking Resources
Revision as of 04:19, 29 December 2016 by Superskuj (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  • $0300 (01) = Link's state changes? Happens when using boomerang.
  • $0301 (01) = When non zero, Link has something in his hand, poised to strike. It's intended that only one bit in this flag be set at any time, though.
    • bmuaethr
      • b - Boomerang
      • m - Magic Powder
      • u - Unused
      • a - Bow and Arrow
      • e - Tested for, but doesn't seem to correspond to any actual item or action. Possibly could indicate an item that was cut from the game during development. It is, in fact, tested for simultaneously with the hammer in many locations. Perhaps this suggests another hammer-like item was in the works.
      • t - Tested for exclusively with the 'r' bit, but no code seems to set this particular bit. Perhaps at one point the bits for the two rods were separate at some point?
      • h - Hammer
      • r - Ice Rod or Fire Rod
  • $0302 (01) = ????
  • $0303 (01) = In conjunction with the above variable when set to 0x13, matching the above variable, the cape transformation is complete.
    • 0x01 - Bombs
    • 0x02 - Boomerang
    • 0x03 - Arrows
    • 0x04 - Hammer
    • 0x05 - Fire Rod
    • 0x06 - Ice Rod
    • 0x07 - Bug catching net
    • 0x08 - Flute
    • 0x09 - Torch
    • 0x0A - Magic Powder
    • 0x0B - Bottle
    • 0x0C - Book of Mudora
    • 0x0D - Cane of Byrna
    • 0x0E - Hookshot
    • 0x0F - Bombos Medallion
    • 0x10 - Ether Medallion
    • 0x12 - Quake Medallion
    • 0x13 - Cape
    • 0x14 - Magic Mirror
  • $0304 (01) = related to the magic cape transformation (a flag probably)
  • $0305 (01) = (Potentially) Debug variable only seen in Bank 07. If not equal to 0x01, it will cause $1E and $1F to not be zeroed out every frame
  • $0308 (01) = Bit 7 is set when Link is carrying something. Bit 1 set when Link is praying?
  • $0309 (01) =
    • 0: nothing.
    • 1: picking up something.
    • 2: throwing something or halfway done picking up something
  • $030A (01) = Step counter used with $030B. Also, $030A-B seem to be used for the opening of the desert palace
  • $030B (01) = Animation timer for throwing and picking up items like rocks or signs
  • $030C (01) = ??? free ram?
  • $0310 (02) = The Y velocity of a moving floor (Mothula's room)
  • $0312 (02) = The X velocity of a moving floor (Mothula's room)
  • $0314 (01) = The index (the X in $0DD0 for example) of the sprite that Link is "touching"
  • $0315 (01) = Seems to be a flag that is set to 0 if Link is not moving, and 1 if he is moving. However it doesn't seem to get reset to zero.
  • $0316 (02) = ???? bunny stuffs?
  • $0318 (02) = related to moving floor
  • $031A (02) = related to moving floor
  • $031C (01) = tells us the actual graphic/state to use on the given step of a spin attack
  • $031D (01) = step counter for the spin attack
  • $031E (01) = used as an offset for a table to retrieve values for $031C. The offset comes in increments of four, depending on which direction Link is facing when he begins to spin. This makes sense, given that he always spins the same direction, and allows for reusability between the different directions, each one being a sub set of the full sequence.
  • $031F (01) = Countdown timer that when it's set causes Link's sprite to blink, i.e. flash on and off
  • $0320 (02) = Bitfield for interaction with moving floor tiles
    • uuuuuuuu uuuummmm
      • m - Moving floor
      • u - free ram
  • $0322 (01) = ????
  • $0323 (01) = Mirror of $2F, which is an indicator for which direction you are facing. Only used in the rendering of Link's OAM data in Bank 0x0D
  • $0324 (01) = A flag telling a medallion spell it's okay to proceed with the effect.

If set to 1, the effect will wait until it is set to 0 to activate.

  • $0325 (01) = free ram, with the caveat that it is cleared in a few locations in Bank 0x08
  • $0326 (02) = ???? collision related?
  • $0328 (02) = ???? collision related?
  • $032A (01) = seems to be nonzero when you hit a button to swim faster. zero otherwise
  • $032B (02) = ???? collision related?
  • $032D (02) = ???? collision related?
  • $032F (02) = ???? collision related?
  • $0331 (02) = ???? collision related?
  • $0333 (01) = Stores the tile type that the lantern fire or fire rod shot is currently interacting with.
  • $0334 (02) = ???? collision related?
  • $0336 (02) = ???? collision related?
  • $0338 (02) = ???? collision related?
  • $033A (02) = ???? collision related?
  • $033C (02) = ???? collision related?
  • $033E (02) = ???? collision related?
  • $0340 (01) = ????
  • $0341 (02) = Bitfield for interaction with deep water and ??? tiles
    • uuuuuuuu ffffwwww
      • f - ??? (waterfall maybe?)
      • u - free ram
      • w - deep water
  • $0343 (02) = Bitfield for interaction with normal tiles
    • uuuuuuuu uuuunnnn
      • n - normal tile
      • u - free ram
  • $0345 (01) = Set to 1 when we are in water. 0 otherwise. Note this does not mean we are in shallow water. This means we are submerged.
  • $0346 (02) = Exclusively used in Bank 0x0D for the purposes of drawing Link. This value gets bitwise ORed in to supply the palette bits of Link's sprite. It's only intended to take on one of two values: 0x000E, or 0x0000.
    • 0x000E indicates that palette 7 is being used, and
    • 0x0000 indicates that palette 0 is being used.
    • Sometimes Link's palette swaps so that Link won't turn translucent when color addition is active. An example of this would be in the Flute Boy's meadow when he disappears. See $0ABD for more info.
  • $0348 (02) = Bitfield for interaction with icy floor tiles
    • uuuuuuuu jjjjiiii
      • i - icy tile 1
      • j - icy tile 2 (distinction is not quite understood right now)
      • u - free ram
  • $034A (01) = Flag indicating whether Link is moving or not. (I think)
  • $034B (01) = Debug variable, as it is never read, and only written to in the equipment screen code
  • $034C (02) = Bitfield for the top of water staircase tile interactions
    • uuuuuuuu uuuussss
      • s - water staircase
      • u - free ram
  • $034E (01) = Definitely related to Cane of Somaria and how Link is displayed when on a Somaria platform
  • $034F (01) = If nonzero, Link does the harder stroke while swimming. This is triggered by pressing the A, B, or Y buttons while swimming, but ends shortly. It has no bearing on his swimming speed, though.
  • $0350 (01) = free ram, though it would need to be reclaimed from the game engine as it's currently used in several places as an apparent debug variable
  • $0351 (01) = Value that if set to 1, draws the water ripples around Link's body while standing in water. The drawing, of course, uses sprites. If the value is 2, then a patch of tall grass is drawn around Link instead. Any value other than 2 (besides 0) produces the water effect.
  • $0352 (02) = Used exclusively during writing Link's OAM data (Bank 0x0D) as an offset into the OAM buffer ($0800)
  • $0354 (01) = Used exclusively during writing Link's OAM data for currently unknown purposes
  • $0355 (01) = Secondary water grass timer. Increments when $0356 reaches 9. Starts at 0 and reaches 3.
  • $0356 (01) = Primary water/grass timer. Starts at zero and resets at 9.
  • $0357 (02) = Bitfield for interaction with thick Grass / warp tiles
    • uuuuuuuu wwwwgggg
      • g - bits are for thick grass tiles
      • w - bits are for warp tiles (blue on OW, orange in dungeons)
      • u - free ram
  • $0359 (02) = Bitfield for interaction with shallow water tiles
    • uuuuuuuu uuuuwwww
      • w - water tiles
      • u - free ram
  • $035B (02) = Bitfield for interaction with destruction aftermath tiles (bushes, rockpiles, etc)
    • uuuuuuuu uuuuaaaa
      • a - aftermath tiles
      • b - free ram
  • $035D (02) = Used exclusively during writing Link's OAM data (bank 0x0D). Bitwise ORed in for some of the OAM data.
  • $035F (01) = Seems to be a flag indicating that the boomerang is in play. It shows up in many places so far. Not even sure why it needs this flag... maybe hackish coding by Nintendo?
  • $0360 (01) = A flag that when nonzero causes Link to be electrocuted when touching an enemy.

This seems counterintuitive to me, but whatever.

  • $0361 (01) = free ram
  • $0362 (01) = ????
  • $0363 (01) = ????
  • $0364 (02) = ???? (relates to Link's sprites's object priority somehow?) Hard to say if $0365 is coupled or separate from this variable at this point.
  • $0366 (02) = Flag stating that Link is about to read something (assuming he's facing north) Used with telepath tiles (dungeon), and signs (overworld)
  • $0368 (01) = The value of $036A shifted right once (divided by two). Used in the context of lifting tiles like bushes, rocks, etc.
    • 0x00 - sign
    • 0x01 - small light rock
    • 0x02 - green bush
    • 0x03 - off-color bush
    • 0x04 - small heavy rock
    • 0x05 - large light rock
    • 0x06 - large heavy rock
  • $0369 (01) = The value of $036A shifted left once (multiplied by two). While this variable may at first glance appear to be used, its value is never meaningfully inspected or put to good use. Thus we'll categorize it as "free ram" with the caveat that the modder would have to remove the current (useless) references to the variable, which number all of 2 times.
  • $036A (01) = When interacting with liftable tiles, this is an index that which type. Note: This value is always even, for whatever reason.
    • 0x00 - sign
    • 0x02 - small light rock
    • 0x04 - green bush
    • 0x06 - off-color bush
    • 0x08 - small heavy rock
    • 0x0A - large light rock
    • 0x0C - large heavy rock
  • $036B (01) = ????
  • $036C (01) = Action index when interacting with tiles, like pots, rocks, or chests.
    • 0x00 - ???
    • 0x01 - Picks up a pot or bush.
    • 0x02 - Starts dashing
    • 0x03 - Grabs a wall
    • 0x04 - Reads a sign.
    • 0x05 - Opens a chest.
    • 0x06 - ???
    • 0x07 - ???
  • $036D (01) = Detection bitfield for vertical ledge tiles
    • dddduuuu
    • d bits are for ledge tiles facing down
    • u bits are for ledge tiles facing up
  • $036E (01) = Detection bitfield for horizontal ledge tiles and up + horizontal ledge tiles
    • ddddhhhh
      • h bits are for ledge tiles facing left or right
      • d bits are for ledge tiles facing up + left or up + right
  • $036F (01) = Detection bitfield for down + horizontal ledge tiles
    • uuuudddd
      • d bits are for ledge tiles facing down + left or down + right
      • free ram
  • $0370 (01) = Bitfield for interaction with unknown tile types
    • bbbbaaaa
      • a - type 0x4C and 0x4D tiles (Overworld only)
      • b - type 0x4E and 0x4F tiles (Overworld only)
  • $0371 (01) = Countdown timer for frames it will take Link to become tired pushing against something solid. Once counted down, his appearance will look flushed and like he's dragging ass. Resets once you stop pushing or moving.
  • $0372 (01) = Flag indicating whether Link will bounce off if he touches a wall.
  • $0373 (01) = Putting a non-zero value here indicates how much life to subtract from Link.

(quick reference: 0x08 = one heart)

  • $0374 (01) = Countdown timer for when Link is about to dash. When it reaches 0 he starts dashing. starts as 0x1D
  • $0375 (01) = This is the timer that is used to count down how long it takes before Link can jump off a ledge. It is typically set to 19 (0x13) frames, though I don't believe it decrements every frame.
  • $0376 (01) = bit 0: Link is grabbing a wall.
  • $0377 (01) = Related to the Master Sword ceremony somehow. Maybe other uses.
  • $0378 (01) = Apparently a countdown timer of some sort. Only seen in Bank 0x07. Two domains of usage seem to be climbing staircases and pushing walls.
  • $0379 (01) = Flag that, if set, A button isn't read.
  • $037A (01) = Puts Link in various positions, 1 - shovel, 2 - praying, etc... cane of somaria. May also have something to do with bombs?
  • $037B (01) = If nonzero, disables Link's ability to receive hits from sprites. (But not pits)
  • $037C (01) = Determines the player's behavior during "player behavior" mode 0x16 (see variable $5D). Somewhat parallels $037D as it only is intended to have 3 states (0 through 2, inclusive).
  • $037D (01) = Used to determine the player sprite's pose during the opening sequence. It only takes on 3 values:
    • 0x00 - Player is in bed with eyes shut.
    • 0x01 - Player is in bed with eyes open.
    • 0x02 - Player is jumping out of bed.
    • This value also affects the player's bedspread (unfurls the covers once hitting state 1).
  • $037E (01) -
    • Bit 0 - Hookshot is dragging Link somewhere.
    • Bit 1 - ???? seems like it gets toggled every 3 frames, or something like that.
  • $037F (01) = Walk through walls and anytime warping in outdoors. Apparently if nonzero, all tile attributes are $00 (nothing / passable)
  • $0380 (02) = (Possibly of size 5 instead)
  • $0385 (0A) = special effect ???
  • $038F (05) = special effect ???
  • $0394 (05) = special effect ???
  • $0399 (02) = Used as a temporary copy of the boomerang's y coordinate when calculating where to place the wall hit object that results from the boomerang hitting a wall. No other uses.
  • $039B (02) = ????
  • $039D (01) = ????
  • $039E (01) = free ram
  • $039F (0A) = Special Effect Timers
  • $03A4 (0?) = Referenced in receive item initializer
  • $03A9 (05) = Special effect ???
  • $03AE (03) = free ram (Though I am not sure of this entirely)
  • $03B1 (05) = countdown timer for special objects (note that there are only 5 of these whereas there's usually 10 slots for special objects)
  • $03B6 (04) = 16-bit values relating to bomb doors
  • $03BA (04) = 16-bit values relating to bomb doors
  • $03BE (02) = 8-bit values relating to bomb doors
  • $03C0 (02) = Reserved for rock debris special object (0x08)
  • $03C2 (02) = Reserved for rock debris special object (0x08)
  • $03C4 (01) = Reserved for rock debris special object (0x08) and maybe bombs too.
  • $03C5 (05) = Special Object ram.
  • $03CA (05) = Special Object ram.
  • $03CF (03) = Special Object ram.
  • $03D2 (03) = Special Object ram.
  • $03D5 (06) = Special Object ram.
  • $03DB (06) = Special Object ram.
  • $03E1 (03) = Special Object ram.
  • $03E4 (02) = tiles that bombs are touching on the floor
  • $03E9 (01) = Flag that seems to set when moving gravestones are in play and puzzle sound is playing.
  • $03EA (0A) = special effect ???
  • $03EF (01) = Normally zero. If set to nonzero, it forces Link to the pose where he is holding his sword up. One example of where this is used is right after Ganon is defeated.
  • $03F0 (01) = ????
  • $03F3 (01) = ????
  • $03F4 (01) = Seems related to Cane of Somaria somehow
  • $03F5 (02) = The timer for Link's tempbunny state. When it counts down he returns to his normal state. When Link is hit it always falls to zero. Is always set to 0x100 when a yellow hunter (transformer) hits him. If Link is not in normal mode, however, it will have no effect on him. The value is given in frames, so if the value written is 0x80, you will be a bunny for 128 frames
  • $03F7 (01) = Flag indicating whether the "poof" needs to occur for Link to transform into the tempbunny.
  • $03F8 (0?) = Flag set if you are near a "pull for rupees" sprite
  • $03FA (02) = Relates to Link's OAM routine in Bank 0x0D somehow. Appears to be the 9th bit of the X coordinate of some sprite(s).
  • $03FC (01) = ????
  • $03FD (01) = ???? related to bombs seemingly
  • $03FE (02) = free ram.