SM64 N64 Item Box

By James S.

Updated: 2/9/9

Here I will talk about the item boxes that you can get caps, stars and other objects from.

Note: 0x means hex value.

The value at offset 0x147 (PAL UK) or 0x144 (NTSC USA) in an item box's object structure decides what item Mario gets from it. This value is used with an item box table loaded into the RAM that goes into detail as to what the item looks like and how it behaves.

Listed below is the start address of the item box table in the RAM for each of the game versions:

PAL (UK) 0x802FCD60

NTSC (USA) 0x80330BA0

Japanese original 0x8032FC40

Japanese Shindou Edition 0x803102D0

Note: some of the behaviour values for the Japanese original game are different to the other versions.

Here are the item box table values in hex (the value in brackets () is the offset from the start of the item box table):

(00) 00 00 00 87 13003DB8 Wing cap

(08) 01 00 00 86 13003DD8 Metal cap

(10) 02 00 00 88 13003E1C Vanish cap

(18) 03 00 00 BE 13001F3C Koopa shell

(20) 04 00 00 74 130009A4 x1 yellow coin

(28) 05 00 00 00 13000964 x3 yellow coins

(30) 06 00 00 00 13000984 x10 yellow coins

(38) 07 00 00 D4 13003FDC 1-up mushroom (moves slowly)

(40) 08 00 00 7A 130007F8 Star 1

(48) 09 00 00 D4 13004010 1-up mushroom (moves fast)

(50) 0A 00 01 7A 130007F8 Star 2

(58) 0B 00 02 7A 130007F8 Star 3

(60) 0C 00 03 7A 130007F8 Star 4

(68) 0D 00 04 7A 130007F8 Star 5

(70) 0E 00 05 7A 130007F8 Star 6

(78) 6300000000000000 (0x63=end of item table)

The above item box table is used by all item boxes so any changes made to the item box table will affect all item boxes. For example, if you modify any of the values on the first line of the item box table, it will modify what all wing cap boxes give. Note that the last line marks the end of the item table so it should not be changed.

The following is what each value means with example values used for star 2. The value in brackets () is the offset from the start of the line in the item box table.

(0) 0x0A Item type value (compared with the value from the item box object).

(1) 0x00 Unused (most likely acts as padding).

(2) 0x01Normally only used by the star objects to select the type of star.

(3) 0x7A Graphic ID (i.e., what the object to be spawned looks like).

(4) 0x130007F8 Behaviour (segment/offset) of the object to be spawned.

Note: Some Graphic IDs can be used in all levels, some in certain levels only, others select differents graphics depending on the level. Since animation is set by the behaviour, some graphics will only look right when used with the behaviour it was designed for. The behaviours can be used in all levels but some behaviours use data loaded only in a few levels.

Interestingly, rather than use the item type value to index the item box table as to get the values needed for spawning, the game loops through each set of item values until it finds the matching item type value from the item box object. This is why a value (0x63) is used so that the game knows where the item box table ends and thus will stop searching for the item if it finds that value and consequently, 0x63 cannot be used as an item type value.

Since a value (0x63) is used to set the end of the item box table, it would be possible to expand the item box table as to allow for more items, although the table would have to be moved elsewhere (such as to the expansion pack) if it were to be made bigger.

All content of this and related pages is copyright (c) James S. 2007-2009

You can email me at james.boshikoopa@gmail.com

For the main page please go to Super Mario 64 Exposed.