Underworld:Important Hex Addresses

From TLoZ: ALTTP Hacking Resources
Jump to: navigation, search
This is a subpage of Underworld

Room Data

Room Headers

  • $027502 to $027781 = Pointer Table, 2 byte local addresses, indexed by room ID.
  • $027781 to $027FEF = Data

Headers are $0E (Decimal: 14) bytes formatted thusly:

  • Byte 0: aaab bbcd
    • The a bits are transformed into 0000 0aaa and stored to $0414 ("BG2" in Hyrule Magic)
    • The b bits are transformed into 0000 0bbb and stored to $046C ("Collision" in Hyrule Magic)
    • The c bit is unused
    • The d bit is stored to $7EC005 (If set, use a lights out routine in the room transition)
  • Byte 1: aabb bbbb
    • The a bits are unused
    • The b bits are transformed into bbbb bb00, thus making them a multiple of 4.

This value is used to load 4 different palettes for the dungeon, and corresponds to, you guessed it, Palette # in Hyrule Magic!

The resulting index is used to load values for $0AB6, $0AAC, $0AAD, and $0AAE

  • Byte 2: gets stored to $0AA2 (GFX # in Hyrule Magic)
  • Byte 3: value + #$40 gets stored to $0AA3 (Sprite GFX # in Hyrule Magic)
  • Byte 4: gets stored to $00AD ("Effect" in Hyrule Magic)
  • Byte 5: aabb bbbb
    • a = ?
    • The b bits are "Tag1" in Hyrule Magic and gets stored to $00AE.
  • Byte 6: aabb bbbb
    • a = ?
    • The b bits are "Tag2" in Hyrule Magic and get stored to $00AF

These are the planes to use for bytes 9 through D. This determines which BG you appear on, and possibly more.

  • Byte 7: aabb ccdd
    • The a bits are transformed into 0000 00aa and stored to $063F
    • The b bits are transformed into 0000 00bb and stored to $063E
    • The c bits are transformed into 0000 00cc and stored to $063D
    • The d bits are transformed into 0000 00dd and stored to $063C

Note, the only safe values for a plane seem to be 0,1, or 2. Hyrule Magic appears to violate this rule by letting you put 3 down, but nothing higher.

  • Byte 8: aaaa aabb
    • The a bits are unused
    • The b bits are transformed into 0000 00bb and stored to $0640
  • Byte 9: stored to $7EC000 These are all room numbers that you could possibly exit to.
  • Byte A: stored to $7EC001
  • Byte B: stored to $7EC002
  • Byte C: stored to $7EC003
  • Byte D: stored to $7EC004

Sprite Data

  • $04D62E to $04D92E = Pointer Table, 2 byte local addresses, indexed by room.
  • $04D92E to $04EC9D = Data

Sprite data is formatted thusly:

  • Byte 0: Stored to $0FB3. Corresponds with "Sort Spr" in Hyrule Magic. In a layered room this indicates sprites in the foreground are to be drawn on top of sprites in the background.
    • Bit 0 - If 0, sprites will sort
    • Bits 7,6,5,4,3,2,1 - Unknown, should all be 1

After the byte 0, you will see 3 byte clusters that break down thus:

  • Byte 0:
    • Bits 4,3,2,1,0 - Y coordinate (in pixels from the top, starting at 0) of the sprite divided by 16.
    • Bits 6,5 - If these are set, they will be used to generate a subtype, stored to $0E30, X.
    • Bit 7 - If set, the sprite is on BG2, if not it's on BG1
  • Byte 1:
    • Bits 4,3,2,1,0 - X coordinate (in pixels from the far left, starting at 0) of the sprite divided by 16.
    • Bits 7,6,5 - If all these bits are set then this is an Overlord, otherwise it's a normal sprite. If only some of them are set they can be used to generate a subtype, stored at $0E30, X
  • Byte 2: Sprite or Overlord type. If a sprite, this will get loaded into a slot at $0E20, X. If an Overlord, will get loaded to $0B00, X.

The array is terminated with a byte of $FF.

Object Data

Object data

Dungeon Secrets Data

  • $00DB69 to $00DDE8 = Pointer Table, 2 byte local addresses, indexed by room ID.
  • $00DDE9 to $00E6B1 = Data

Data comes in 3 byte chunks and is terminated by an instance of $FFFF

  • Bytes 0, 1: A word that denotes the VRAM address that the item is found at. This identifies the item as belonging to that part of the screen.
  • Byte 2: Identifies the type of item that is hiding there. E.g. $08 is a key

Push Block Data

The block data has three primary pointer locations. The pointer is stored as a long address.

Primary pointer location
USA JP GER
0x15AFA, 0x15B01, 0x15B08, 0x15B0F 0x1585E, 0x15865, 0x1586C, 0x15873 0x15B7C, 0x15B83, 0x15B8A, 0x15B91

The data has a total max in little endian at:

Total max location
USA
0x8896 (2)


  • In the USA version, the data is located at $0271DE to $027369.

4 bytes per entry: a a x y

  • a: Room number (byte swapped)
  • x: X Position of the block (expressed as tilemap coordinate)
  • y: Y Position of the block (expressed as tilemap coordinate)

(Inter Room) Torch Data

The torch data has three primary pointer locations. The pointers are stored as a long address.

Primary pointer location
USA JP GER
0x15B16, 0x15B1D, 0x15B24 0x1587A, 0x15881, 0x15888 0x15B98, 0x15B9F, 0x15BA6
  • In the USA version, the data goes from 0x2736A to 0x27489.

Consists of variable length segments consisting of:

a a x y x y ... $FFFF

  • a: Room number (byte swapped)
  • x: X Position of the torch (expressed as tilemap coordinate)
  • y: Y Position of the torch (expressed as tilemap coordinate)
  • $FFFF: Delimeter

Chest Contents

The chest contents have three primary pointer locations. The values at each location point to the same pointer. Yes, you read that right. The pointer is stored as a long address.

Primary pointer location
USA JP GER
0xEBFB, 0xEC0A, 0xEC10 0xEC08, 0xEC17, 0xEC26 0xEBD5, 0xEBE4, 0xEBF3

The addresses below contain the size limit for the data for each region:

Max Size
USA JP GER
0xEBF6 0xEBF4 0xEBD0
  • In the original USA version the data goes from $00E96E to $00EB65.

Array of chest information in 3 byte chunks. 168 entries in all (0xA8)

  • First word - Room number it is located in. MSB determines whether it is a big chest or not. (big chest if set)
  • Last byte - index of the type of item contained in the chest.

Room layout

In Hyrule Magic, there's a label and textbox for room layouts. The layout value goes from $0 to $7

The location:

USA JP
0x26F2F 0x26C0F

In the aforementioned location, there are 8 long pointers (Lo-Hi-Bank).

Entrance Data

There are $85 (Decimal: 133) normal entrances to the underworld from the overworld, and $7 (Decimal: 7) starting locations. Normal entrances and starting locations use mostly the same types of data formatted the same, however they are located in different places in the ROM. They are located and formatted thus:

Entrance Room

  • $014813 to $01491C = Normal Entrance Data
  • $015B6E to $015B7B = Starting Location Data

Each entry is a 2 byte Room ID where the player is placed after using an entrance.

Scroll Edges

  • $01491D to $014D44 = Normal Entrance Data
  • $015B7C to $015BB3 = Starting Location Data

Unsure about what these do exactly. Each entry is 8 bytes long.

  • Format: 1 byte each. Corresponds to hyrule magic values in the "More" a.k.a. Entrance Properties dialog box.
    • HU -
    • FU -
    • HD -
    • FD -
    • HL -
    • FL -
    • HR -
    • FR -

X Scroll

  • $014D45 to $014E4E = Normal Entrance Data
  • $015BB4 to $015BC1 = Starting Location Data

Y Scroll

  • $014E4F to $014F58 = Normal Entrance Data
  • $015BC2 to $015BCF = Starting Location Data

X Coordinate

  • $014F59 to $015062 = Normal Entrance Data
  • $015BD0 to $015BDD = Starting Location Data

Each entry is a 2 byte X coordinate where the player starts after using the corresponding entrance.

Y Coordinate

  • $015063 to $01516C = Normal Entrance Data
  • $015BDE to $015BEB = Starting Location Data

Each entry is a 2 byte y coordinate where the player starts after using the corresponding entrance.

X Camera Coordinate

  • $01516D to $015276 = Normal Entrance Data
  • $015BEC to $015BF9 = Starting Location Data

Lower bounds for scrolling (upper bounds = this plus 2) 2 bytes each.

Y Camera Coordinate

  • $015277 to $015380 = Normal Entrance Data
  • $015BFA to $015C07 = Starting Location Data

Lower bounds for scrolling (upper bounds = this plus 2) 2 bytes each.

Entrance Blockset

  • $015381 to $015405 = Normal Entrance Data
  • $015C08 to $015C0E = Starting Location Data

1 byte each. This blockset affects walls and a few other things and persists through all rooms the player accesses from this entrance.

Floor Values

  • $015406 to $01548A = Normal Entrance Data
  • $015C0F to $015C15 = Starting Location Data

This tells us what kind of properties the floor has. 1 byte each:

  • If 1, then it has floors that you can fall through to the next level
  • If 0, I think it means it can be fallen down to
  • If -1, has no pits
  • If -2, ????

Dungeon Values

  • $01548B to $01550F = Normal Entrance Data
  • $015C16 to $015C1C = Starting Location Data

1 Byte each. Dungeons actually in the game are numbered like so $00, $02, $04, ..., $18, $1A. $1C and $1E are unused (and hence could potentially be added.) Notice they are all even numbers. In asm routines these values are divided by two sometimes to provide an index into other arrays. That's why. The definition of a "dungeon" is something with a key, compass, and map.

A value of $FF (-1) denotes it doesn't belong to a dungeon.

Doorway Type

  • $015510 to $015594 = Normal Entrance Data
  • $015C2B to $015C31 = Starting Location Data

This is used only when you exit the given room. For example, let's say you enter through a skull doorway in Skullwoods. But that's not really a door way, it's just a set of tiles that are no different from a hole you might create after picking up a big rock. But if you entered from a building door, the game has to know whether to put the door frame when you exit.

  • 1 byte:
    • 0 = no doorway when exiting
    • 1 = draws a door frame upon exiting
    • 2 = ???? HM says vertical doorframe. But in the original game, no doorway is vertical.

Ladder And BG Settings

  • $015595 to $015619 = Normal Entrance Data
  • $015C1D to $015C23 = Starting Location Data
  • 1 byte each, with the following 2 bit layout: xxxaxxxb
    • x - unimportant
    • a - if set, then Link enters on the lower level (BG2)
    • b - if set... not sure what happens exactly. Check the game engine to be sure.

Horizontal And Vertical Scroll Properties

  • $01561A to $01569E = Normal Entrance Data
  • $015C24 to $015C2A = Starting Location Data

For these, I guess if the flags in the appropriate places are set, then the room will be able to scroll in those directions.

  • 1 byte each, with the following layout: xxaxxxbx
    • a - Horizontal flag
    • b - Vertical flag

Scroll Quadrant

  • $01569F to $015723 = Normal Entrance Data
  • 1 byte each, has four different expected values:
    • 0h, 2h, 10h, 12h

Exit Door Location

  • $015724 to $01582D = Normal Entrance Data
  • $015C32 to $015C3F = Starting Location Data

1 word each. Denotes X and Y coordinates for overworld?

Music

  • $01582E to $0158B2 = Normal Entrance Data (JP: 15592 - 15616)
  • $015C4E to $015C54 = Starting Location Data

1 byte each. A value of $FF plays the same music as the overworld screen from which the player entered.

Entrance Values

  • $015C40 to $015C4D = Starting Location Data

1 word each. Since the starting locations have to reference an entrance, this is necessary.

Navigate

Table of Contents
SpritesDungeonsOverworldUnderworldSRAM MapRAM MapROM MapMusicMonologueCreditsDumpsMiscellaneousTo-Do/Suggestions