User Tools

Site Tools


sm64:macro_objects

This is an old revision of the document!


Macro 3D Objects

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.


Limitations

  • You can only directly modify the position, Y rotation, and the first two behavior parameters of the object.
  • They will always appear in every act in the level, as they don't have an act mask.
  • Each macro object contains a preset ID, that references a list that tells the object what model ID and behavior are.

List Format

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


Macro Preset Table

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.

VersionROM Address
North America (US) 0xEC7E0
Europe 0xBD590
Japanese 0xEB6D0
Japanese (Shindou Edition) 0xC8D60
Chinese IQue 0xCB220

Format

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

Entries

TBA

Preset IDObjectBehavior addressModel IDB.Param 1B.Param 2
sm64/macro_objects.1539231411.txt.gz · Last modified: 2018/10/11 04:16 by David