Hack64 Wiki
Other Titles
Hack64 Wiki
Other Titles
This is an old revision of the document!
Macro objects are objects that are loaded into the level from the level script command 0x39. Their main purpose is to save space in the ROM, since they only take up 10 bytes whereas regular objects take up 24 bytes. However, they are more limited than the regular objects loaded from the level script command 0x24.
ROM Hacks of SM64 usually won't use macro objects, since ROM space is not an issue.
The level script command 0x39 loads a list of macro commands from a segmented address. The list ends if the preset ID is either 0x00 or 0x1E.
[AA AA] [XX XX] [YY YY] [ZZ ZZ] [B1] [B2]
AAAA | First 7 bits = Y rotation, Last 9 bits = Preset ID |
XXXX | X position of object (signed 16 bits) |
YYYY | Y position of object (signed 16 bits) |
ZZZZ | Z position of object (signed 16 bits) |
B1 | Replaces B.Param 1 value if not zero* |
B2 | Replaces B.Param 2 value if not zero* |
* Needs to be confirmed
The Preset ID is used to get the Model ID, Behavior address, and the default Behavior parameters for the object. The location of this table differs based on the version of the game you are using.
Version | ROM Address |
---|---|
North America (US) | 0xEC7E0 |
Europe | 0xBD590 |
Japanese | 0xEB6D0 |
Japanese (Shindou Edition) | 0xC8D60 |
Chinese IQue | 0xCB220 |
There are 366 entries in this table, starting with preset ID 0x1F. Each entry in the table takes up 8 bytes.
[BS BS BS BS] [MM MM] [B1] [B2]
BSBSBSBS | Segment address of behavior |
MMMM | Model ID |
B1 | Default B.Param 1 value |
B2 | Default B.Param 2 value |
TBA
Preset ID | Object | Behavior address | Model ID | B.Param 1 | B.Param 2 |
---|---|---|---|---|---|