Code notes

From z64 wiki
Jump to: navigation, search
code
Version VRom VRam Size
Debug 00A94000 00BCEF30 8001CE60 80157D90 13AF30
NTSC 1.0 00A87000 00B8AD30 800110A0 80114DD0 103D30

sakura89's Documentation

Offsets that follow are relative to start of ROM

Interface ( 2 bytes each )
00AEFD42 - beating heart R
00AEFD6A - beating heart G
00AEFD82 - beating heart B
00AEFDDE - beating heart outline R
00AEFE0A - beating heart outline G
00AEFE26 - beating heart outline B
00AEFC0A - normal heart R
00AEFC5E - normal heart G
         - normal heart B
00AF0CEE - hearts per line

----------------------------------------------
| values found in code.zdata's .data section |
----------------------------------------------

Navi Colours ( 4 byte RGBA )
00B8D134 - Navi's normal colour
00B8D144 - NPC's
00B8D14C - enemies
00B8D154 - signs, gossip stones
00B8D15C - checkable spots
00B8D16C - bosses

Rupee values ( 2 bytes )
00B9CC3C - green rupee
00B9CC3E - blue rupee
00B9CC40 - red rupee
00B9CC42 - purple rupee
00B9CC44 - orange rupee

Tunic Colours ( 3 byte RGB )
00B9D1A8 - Kokiri Tunic colour
00B9D1AB - Goron Tunic colour
00B9D1AE - Zora Tunic colour

Item maximums ( 2 bytes first, second and third upgrade size ( 6 bytes total ) )
00B9E39E - Quivers
00B9E3A6 - Bomb bags
00B9E3BC - Wallet amounts
00B9E3C6 - Deku Seed bags
00B9E3CE - Deku Sticks
00B9E3D6 - Deku Nuts

sakura89/Jisaan

Song activators:
BA8DA0  Minuet of Forest
BA8DA9  Bolero of Fire 
BA8DB2  Serenade of Water
BA8DBB  Requiem of Spirit
BA8DC4  Nocturne of Shadow
BA8DCD  Prelude to Light
BA8DD6  Saria's Song
BA8DDF  Epona's Song
BA8DE8  Zelda's Lullaby
BA8DF1  Sun's Song
BA8DFA  Song of Time
BA8E04  Song of Storms
BA8E0C  Scarecrow's Song
The first byte is the number of notes in the song, the rest are the notes, in the order they must be played, except the scarecrow's
song, which is just the length. These are the valid values:

A = 00
Down = 01
Right = 02
Left = 03
Up = 04

spinout's documentation

00A87000 - 00B8AD30 in 1.0
(Offsets that follow are relative to start of code, not start of ROM)
F9440 - FB5E0 actor table ( D7490 in 1.0 ) //range is incorrect
  xxxxxxxx yyyyyyyy aaaaaaaa bbbbbbbb
  ???????? cccccccc dddddddd ????????
    x-start offset of actor
    y-end offset of actor
    a-start virutal offset of actor
    b-end virtual offset of actor
    c-actor info offset of actor (virtual address)
      aaaaxxxx ???????? oooo????: actor info in actor
        a-actor number
        x-actor type
        o-object number
    d-offset in ram where actor name is (Subtract offset code is loaded to to get offset in code)

10A6C8 - 10B360 object table (E7F58 in OoT 1.0)
  xxxxxxxx yyyyyyyy: object entry
    x-start offset of object
    y-end offset of object

exit table (E8BF0-EA440 in 1.0 ROM, 10B360 - 10CBB0 in Debug)
  aabbccdd: exit table entry
    a-scene number
    b-entrance number
    c-fade in
    d-fade out 

10CBB0 - Scene table (EA440-EAC28 in 1.0 ROM)
  See Scene Table

11A1E0-11B744 actor name table
  [ascii text][null]: repeats for each entry

RAM-oriented

added 11/02/09

801274A0[u32][0x1A]: jump table for map reading functions
80127520[u16]: Adult link object number
80127522[u16]: Child link object number
80127524[u32]: Object table length (number of objects)
80127528[u32][number of objects]: object table

Link stuff

What still isn't known/known for sure:
hookshot tip (0x0602B288 ?)
hookshot string
deku stick
bow string
slingshot string

0x108D10	Adult hierarchy pointer
0x108D14	Child hierarchy pointer

most items
Format: AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDD
A - high polygon adult display list
B - high polygon child display list
C - low polygon adult display list
D - low polygon child display list

0x108E88	closed right hand
0x108E98	deku shield & hand
0x108EA8	hylian shield & hand
0x108EB8	mirror shield & hand
0x108EC8	kokiri sword in sheath
0x108ED8	kokiri sword in sheath with deku shield
0x108EE8	kokiri sword in sheath with hylian shield
0x108EF8	kokiri sword in sheath with mirror shield
0x108F08	unused slot
0x108F10	unused slot
0x108F18	? child link only: deku shield, matrix @ 0x06022648 pushed first ? (see dl @ 0x06022688)
0x108F28	kokiri sword sheath
0x108F38	kokiri sword sheath with deku shield
0x108F48	kokiri sword sheath with hylian shield
0x108F58	kokiri sword sheath with mirror shield
0x108F68	unused slot
0x108F78	? adult:sheath child: deku (see 0x108F20)
0x108F88	hand holding biggoron sword
0x108F98	broken giant's knife
0x108FA8	open left hand
0x108FB8	closed left hand
0x108FC8	kokiri sword & hand
0x108FD8	master sword & hand
0x108FE8	open right hand
0x108FF8	closed right hand
0x109008	slingshot & hand
0x109018	master sword in sheath
0x109028	master sword sheath
0x109038	? (guess: cloth at hips)
0x109048	bow & hand
0x109058	fairy ocarina & hand
0x109068	ocarina of time & hand
0x109078	hookshot
0x109088	megaton hammer
0x109098	boomerang & hand
0x1090A8	left hand (?)
0x1090B8	? Adult link only (0x06029918/0x06029F48)
0x1090C8	? Adult link: 0x06036E58/0x06029FA0 Child link: 0x06021AE8/0x00000000
0x1090D8	? slingshot/bow? (single size)

eye textures
0x109178	looking straight
0x10917C	half closed
0x109180	closed
0x109184	looking right
0x109188	looking left
0x10918c	surprised
0x109190	looking down
0x109194	hurt

mouth textures
0x109198	closed
0x10919C	open, teeth
0x1091A0	open, shouting
0x1091A4	open, got item

boots (adult link only)
0x1091BC	kokiri boots
0x1091C0	iron boots
0x1091C4	hover boots (1)
0x1091C8	hover boots (2)

? (adult link)
0x1092D4	maybe has to do with hookshot? (0x0602B108)

? (child link)
0x1092E4	slingshot string? (0x060221A8)

Bottles
0x109298	Adult
0x10929C	child

0x10A6C0	Adult link object (default 0x0014)
0x10A6C2	Child link object number (default 0x0015)

0x10A768	Adult link object ROM pointer (default entry 0x0014)
0x10A770	Child link object ROM pointer (default entry 0x0015)

See Mask Pointers for information on masks.

Other random crap

0x10A6B8	elf_message_field ROM pointer
0x10A6A0	elf_message_ydan ROM pointer
0x10A6C6	number of objects

Jisaan/BlooDMooN/Punk7890

Song that plays back:
BA8120  Minuet of Forest
BA81C0  Bolero of Fire
BA8260  Serande of Water
BA8300  Requiem of Spirit
BA83A0  Nocturne of Shadow
BA8440  Prelude to Light
BA84E0  Saria's Song
BA8580  Epona's Song
BA8620  Zelda's Lullaby
BA86C0  Sun's Song
BA8760  Song of Time
BA8800  Song of Storms

Format:
XX00 YYYY ZZZZ AABB

Where X is the value that determines the note, Y is the length of time it's held, Z is the volume, A is pitch, and B is vibrato.

Anyway, here are the valid values for X:

A = 02
Down = 05
Right = 09
Left = 0B
Up = 0E
End = 00

And it should be noted that both A and B are signed, so no going over 7F unless you want negative. In case you're wondering, this
is because both are normally controlled by the control stick, and that of course uses negative and positive values to represent
Up / Down and Right / Left.

Music Stuff

Sequence Pointer Table
The sequence pointer table starts at 0xBCC6A0 in the OoT Debug ROM and follows this format:
 
xxxx 0000 0000 0000 0000 0000 0000 0000
 
xxxx = number of sequences
 
The rest of the table looks like:
 
xxxxxxxx yyyyyyyy zzzz 0000 00000000
 
xxxxxxxx = Pointer to the start of the sequence in the sequenced music file (Audioseq)
yyyyyyyy = Length in bytes of the sequence
zzzz = Sequence type

Other

BD1537        start of level select
AA3EA0        Change 03E00008 to 00000000 to re-fight bosses