RAM: Bank 0x7F

From TLoZ: ALTTP Hacking Resources
Revision as of 23:33, 20 December 2016 by Superskuj (talk | contribs) (Superskuj moved page Rom/Page 0x7F to RAM: Bank 0x7F)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  • $7F0000[0x7E0] = tile index buffer for text
  • $7F0000[0x850] = no idea
  • $7F07E0[???] = ????
  • $7F1200[0x800] = text buffer for character data, using pointers loaded from the table at $7F71C0
  • $7F2000[0x2000] = at some point carries the tile map data for the rain overlay.
  • $7F2000[0x1000] = (Dungeons) BG2 tile attribute table - (after the level/room has loaded),

tile information for the room/map. In particular tells the game how to handle each 8x8 tile. For example, a chest will have the value 0x58 (or something similar) in 4 different locations, interlaced of course. List of Tile types: 0x00 - normal? 0x01 - collide 0x02 - ??? 0x03 - ???? what the hell is this? 0x08 - swim / deep water 0x09 - shallow water (not swimmable) 0x0A - ???? 0x0B - ???? 5960x0C - moving floor (Mothula's room) 0x0D - spike floor (hurts) 0x0E - ice floor 0x0F - more ice floor? 0x1C - top of water staircase 0x1D - in room staircase 0x1E - in room staircase 0x1F - in room staircase 0x20 - Pit / Hole tiles 0x21 - ???? 0x22 - stairs that slow you down 0x23 - Lower half of trigger tile (Object 1.1.0x35 also uses it, but it seems like a broken mess) 0x24 - Upper half of trigger tile 0x26 - Boundary tile for In-floor inter-room staircases 0x27 - white statues (dungeons) / fences (overworld) 0x28 - Ledge leading up 0x29 - Ledge leading down 0x2A - Ledge leading left 0x2B - Ledge leading right 0x2C - Ledge leading up + left 0x2D - Ledge leading down + left 0x2E - Ledge leading up + right 0x2F - Ledge leading down + right 0x30 - Up Staircase to room 1 of 5 0x31 - Up Staircase to room 2 ( " ) 0x32 - Up Staircase to room 3 ( " ) 0x33 - Up Staircase to room 4 ( " ) 0x34 - Down Staircase to room 1 of 5 0x35 - Down Staircase to room 2 ( " ) 0x36 - Down Staircase to room 3 ( " ) 0x37 - Down Staircase to room 4 ( " ) 0x38 - Boundary tile for straight up inter-room staircases 0x39 - Boundary tile for sraightt up inter-room staircases 0x3A - ???? 0x3B - star tiles that change up the floor 0x3D - inter-floor staircases? 0x3E - inter-floor staircases? 0x3F - inter-floor staircases? 5970x40 - Thick Grass (and smashed in moles?) 0x42 - Gravestone 0x44 - Spike Block (dungeon) / Cactus (overworld) 0x48 - (overworld) Normal blank ground 0x4A - ???? 0x4B - Orange Warp Tile (Dungeons) / Blue Warp Tile (Overworld) 0x4E - Mountain rock tile found in only a few select areas 0x4F - Mountaon rock tile found in only a few select areas 0x50 - (overworld) bush 0x51 - (overworld) off color bush 0x52 - (overworld) small light rock 0x53 - (overworld) small heavy rock 0x54 - (overworld) sign 0x55 - (overworld) large light rock 0x56 - (overworld) large heavy rock 0x57 - (overworld) rock pile 0x58 - chest 0 0x59 - chest 1 0x5A - chest 2 0x5B - chest 3 0x5C - chest 4 0x5D - chest 5 0x5E - upward staircase tile 0x60 - ???? 0x62 - bombable cracked floor 0x63 - minigame chests? 0x66 - blue / orange block that is down 0x67 - blue / orange block that is up 0x68 - conveyor belt 0x69 - conveyor belt 0x6A - conveyor belt 0x6B - conveyor belt 0x70 - pot or bush (or mole?) 0x71 - pot or bush 0x72 - pot or bush 0x73 - pot or bush 0x74 - pot or bush 0x75 - pot or bush 5980x76 - pot or bush 0x77 - pot or bush 0x78 - pot or bush 0x79 - pot or bush 0x7A - pot or bush 0x7B - pot or bush 0x7C - pot or bush 0x7D - pot or bush 0x7E - pot or bush 0x7F - pot or bush 0x80 - open door? 0x8E - send player to overworld? (well supported so far >_>) 0x90 - screen transition with BG toggle (BG0 <-> BG1) 0x91 - screen transition with BG toggle (BG0 <-> BG1) 0x92 - screen transition with BG toggle (BG0 <-> BG1) 0x93 - screen transition with BG toggle (BG0 <-> BG1) 0x94 - screen transition with BG toggle (BG0 <-> BG1) 0x95 - screen transition with BG toggle (BG0 <-> BG1) 0x96 - screen transition with BG toggle (BG0 <-> BG1) 0x97 - screen transition with BG toggle (BG0 <-> BG1) 0xA0 - screen transition with dungeon toggle 0xA1 - screen transition with dungeon toggle 0xA2 - screen transition with dungeon toggle 0xA3 - screen transition with dungeon toggle 0xA4 - screen transition with dungeon toggle 0xA5 - screen transition with dungeon toggle 0xB0 - Cane of Somaria line (up/down) 0xB1 - Cane of Somaria line (left/right) 0xB2 - ??? 0xB6 - Cane of Somaria line node (question mark shaped) 0xC0 - Torch 0x00 0xC1 - Torch 0x01 0xC2 - Torch 0x02 0xC3 - Torch 0x03 0xC4 - Torch 0x04 0xC5 - Torch 0x05 0xC6 - Torch 0x06 0xC7 - Torch 0x07 0xC8 - Torch 0x08 0xC9 - Torch 0x09 0xCA - Torch 0x0A 0xCB - Torch 0x0B 0xCC - Torch 0x0C 0xCD - Torch 0x0D 0xCE - Torch 0x0E 0xCF - Torch 0x0F 5990x0D0 - ???? 0xF0 - Key door 1 0xF1 - Key door 2 0xF2 - Key door 3 0xF3 - Key door 4 0xF4 - ????

  • $7F3000[0x1000] = Tile Attribute table for BG1. Same as $7F2000 but for a different background.
  • {{$|7F4000 - enemy related
  • $7F5000[0x800] = free ram
  • $7F5800[?] = used?
  • $7F5B00[{{0x|A0] -

Array of sound settings for overworld areas. The top 4 bits determine the ambient sound effect, which is written to $012D The bottom 4 bits determine the song number to play when the area is loaded ($012C) This array is preloaded with differing values depending on which stage of the game you're in. The stages are determined by $7EF3C5 (See $3C5 in Zelda_SRM.log)

  • $7F5BA0[0x60] = free ram
  • $7F6000[0x1000] = enemy damage related
  • $7F7000[0x1C0] = Used to generate the hdma table that the intro and outro spotlight effect uses
  • $7F71C0[0x4A7] = text / dialogue pointers (all of them!). Each one is a 3 byte long pointer.
  • $7F7667[0x6719] = free ram
  • $7FDD80[0x200] = Serves as a temporary buffer for storing a copy of the current palette buffer.

Sometimes the contents of $7EC500 gets stored here, and other times it's $7EC300 being preserved. The general idea here is that the game hopes to eventually (optionally) restore the palette to this set of colors later.

  • $7FDE00[0x180?] = ???
  • $7FDF80[0x280] = (indoors) I think this is used to describe which rooms have had their sprites loaded

(while in a dungeon)

  • $7FDF80[0x1000] = (outdoors) Memory region that indicates where sprites are in the currently loaded overworld map

(which map16 tile they're on)

  • $7FEF80[0x200] = death status for the overworld sprites?
  • $7FF180[0x{{{1}}}[0x10] = Array that seems to handle the objects you hold above your head?
  • $7FFA2C[{{0x|10] -
  • $7FFA3C[{{0x|10] -
  • $7FFA4C[{{0x|10] -
  • $7FFA5C[{{0x|10] -
  • $7FFA6C[{{0x|10] -
  • $7FFA7C[{{0x|10] -
  • $7FFA8C[{{0x|10] -
  • $7FFA9C[{{0x|10] -
  • $7FFAAC[{{0x|10] -
  • $7FFABC[{{0x|10] -
  • $7FFACC[{{0x|10] -
  • $7FFADC[{{0x|10] -
  • $7FFAEC[0x10] = free ram?
  • $7FFAFC[0x10] = free ram?
  • $7FFB0C[0x10] = free ram?
  • $7FFB1C[0x10] = used, but unknown
  • $7FFBDC[0x10] = used, but unknown
most of these seem to be referenced for Helmasaur King's tail (maybe other bosses too)
  • $7FFC00[??] = unknown
  • $7FFC80[??] = unknown
  • $7FFC9C[0x10?] = used, but unknown
  • $7FFD00[??] = unknown
  • $7FFD5C[0x01] = apparently Ganon related
  • $7FFD68[0x01] = apparently Ganon related
  • $7FFD80[??] = unknown
  • $7FFE00[0x80] = statue sentry uses if for something
  • $7FFE80[0x80] = statue sentry uses it for something
  • $7FFF00[0x80] = statue sentry uses it for something
  • $7FFF80[0x80] = free ram?

End of variables------------------------

Routines:

  • {{$|333

While this routine appears to be complicated and technical, it really serves two purposes. 602Depending upon the entry point to the routine, two 16 bit values will be written to VRAM. The value at $00 goes to

  • {{$|0000-$1FFF and the one in $02 goes to $6000-$67FF. That's it. The values are written non-incrementally, so it's just

those two values getting written over and over again.

  • {{$|07C0

Zeroes out the first $2000 bytes of WRAM. Checks the checksums on your save files to see if they are valid. Erases them if not.

  • {{$|00082E
  • {{$|0888

Loads SPC with data at specified address

  • {{$|0901

Sets up address for $8888 Address = $198000 => $0C8000

  • {{$|093D

Initializes the Screen

  • {{$|094A

Saves your game.

  • {{$|07C0

Sets up address for $8888 Address = $1A9EF5 => $D1EF5

  • {{$|12A1

Upon starting this routine, inspect the 8-bit value at the long address [$00], Y If it is positive, that value is stored at $04, Y is incremented, and the next value is stored at $03. Y increments. If the next value at [$00], Y is negative (AND 0x80 tells us this) then A will end up as 0x1, and 0x0 is the value was positive. This is stored at $07. The very same value is read in but this time we AND with 0x40, STA $05, and LSR A three times. The AND left a nonzero result, we will have A = 0x80, and if not, A = 0x00. Ultimately either are ORed with 0x01 so we have A = 0x81 or 0x01. The 0x01 tells us data will be being transferred in Mode 2 (a la register $4310). Data from the source is written to $2118. Summary: 1st Value read: XXXX XXXX (If negative, the SR exits) -> $04 2nd Value read: XXXX XXXX -> $03 3rd Value read: AXXX XXXX (A = 0:

  • {{$|D81B

If NOPed, you will not be able to pick up some types of pots in dungeons.

  • {{$|10054

The subroutine is used to verify that all the save files are uncorrupted. Each save file has one mirrored slot 0xF00 bytes offset from the original. If the first file is corrupt and the mirror is fine, it will copy the mirror to the original and use it. Basically it checks if the 0x500 bytes in the slot add up to 0x5A5A. When save files are saved a checksum is calculated to make sure this constraint is met. 603$17EBB I'm going to generalize this subroutine because the data extraction method is cumbersome to figure out at a moment's glance. Sub $175F5 is used to get a sequence of codes, and after each code follows data to be put in memory at

  • {{$|7F4000, Y. Update: After some serious thought, I've begun to think of this as a decompression routine, possibly for

OAM data. The way the data is handled depends on the three most significant bits of the code. The number of bytes to write is determined by the five least significant bits of the code plus one. Let this number be called R. [XXX | XXXXX] (Code), (R - 1) Example: [010 | 10001] Code = 010 R = 10001 + 1 = 10010 = 18d (d for decimal) Codes: [000] : Write R bytes after the code. For instance, 03 11 12 13 14 would have you write 11, 12, 13, and 14 in succession into memory. [001] : Write the one byte after the code R times. 23 15 would make you write 15 four times into memory. [100], [110], [101] : After the code is a 16-bit index. This means copy memory from $7F4000 + (the Index). You will copy R bytes of course [010] : This code is used for repeatedly storing a 16-bit number, rather than the [001] case. Over all R bytes will still be written. [011] : Whatever value is picked after the code will be incremented (R - 1) times and written R times. 34 01 for example would write 01 02 03 04 05

  • {{$|6FE77-$6FFC0 - Template for the status bar. That is, set of tile indices.

When the game begins these are mapped to $7EC700-$7EC849

  • {{$|3E245 Controls Link's movement, i.e. his speeds and different movement events, such as swimming and dashing.