Difference between revisions of "Objects"
Jump to navigation
Jump to search
m (added unknown entries placeholders) |
m (→Object Data: Fixed offsets) |
||
Line 14: | Line 14: | ||
! Offset !! Size !! Description | ! Offset !! Size !! Description | ||
|- | |- | ||
| | | 7E1000 || 2 || X Position (signed) | ||
|- | |- | ||
| | | 7E1002 || 2 || Y Position (signed) | ||
|- | |- | ||
| | | 7E1004 || 2 || Interaction Flags | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 58: | Line 58: | ||
|- | |- | ||
| | | 7E1006 || 2 || Handler Invocation Mask | ||
|- | |- | ||
| | | 7E1008 || 2 || Sprite Flags | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 72: | Line 72: | ||
|- | |- | ||
| | | 7E100A || 3 || Script Pointer, also used for reentry | ||
|- | |- | ||
| | | 7E100E || 2 || Reentry Delay in frames | ||
|- | |- | ||
| | | 7E1012 || 1 || Bank for bounds data (used with ptr at 7F000A) | ||
|- | |- | ||
| | | 7E1016 || 2 || Elevation level (sprites on different levels can't hit each other) | ||
|- | |- | ||
| | | 7E102C || 2 || Previous Object in List | ||
|- | |- | ||
| | | 7E102E || 2 || Next Object in List | ||
|} | |} | ||
Line 90: | Line 90: | ||
! Offset !! Size !! Description | ! Offset !! Size !! Description | ||
|- | |- | ||
| | | 7F100A || 2 || Pointer to Bounding Rect Table [ROM], used with bank at 7E0012 | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 117: | Line 117: | ||
|- | |- | ||
| | | 7F1018 || 2 || Movement dx | ||
|- | |- | ||
| | | 7F101A || 2 || Movement dy | ||
|} | |} | ||
Line 127: | Line 127: | ||
! Offset !! Size !! Description | ! Offset !! Size !! Description | ||
|- | |- | ||
| | | 7F2022 || 2 || Fighting Data Ptr [ROM], Bank: 8D | ||
|- | |- | ||
| | | 7F202A || 2 || Current HP | ||
|} | |} | ||
Latest revision as of 16:38, 22 January 2020
The game uses objects to store runtime information about sprites and scripts, e.g. size and position of a sprite, or the current script address. Each object has a handle in range 0x1000...0x1F80, in steps of 0x40, allowing for a maximum of 63 objects. Object data is stored in chunks of 0x1000 bytes at various places in RAM. Objects are created by declaration in the Map Object Header or by script command.
Object Data
Offsets must be added to the object handle to get the memory address.
Offset | Size | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7E1000 | 2 | X Position (signed) | ||||||||||||||||||||||||||||||||||
7E1002 | 2 | Y Position (signed) | ||||||||||||||||||||||||||||||||||
7E1004 | 2 | Interaction Flags
| ||||||||||||||||||||||||||||||||||
7E1006 | 2 | Handler Invocation Mask | ||||||||||||||||||||||||||||||||||
7E1008 | 2 | Sprite Flags
| ||||||||||||||||||||||||||||||||||
7E100A | 3 | Script Pointer, also used for reentry | ||||||||||||||||||||||||||||||||||
7E100E | 2 | Reentry Delay in frames | ||||||||||||||||||||||||||||||||||
7E1012 | 1 | Bank for bounds data (used with ptr at 7F000A) | ||||||||||||||||||||||||||||||||||
7E1016 | 2 | Elevation level (sprites on different levels can't hit each other) | ||||||||||||||||||||||||||||||||||
7E102C | 2 | Previous Object in List | ||||||||||||||||||||||||||||||||||
7E102E | 2 | Next Object in List |
Offset | Size | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7F100A | 2 | Pointer to Bounding Rect Table [ROM], used with bank at 7E0012
Values are signed 8 bit pixel coordinates, relative to the object's X and Y position. | ||||||||||||||||||||||
7F1018 | 2 | Movement dx | ||||||||||||||||||||||
7F101A | 2 | Movement dy |
Offset | Size | Description |
---|---|---|
7F2022 | 2 | Fighting Data Ptr [ROM], Bank: 8D |
7F202A | 2 | Current HP |
Double Linked List
Objects are organized in a double linked list. The list defines, among other things, the order in which scripts run.
Offset | Description |
---|---|
0DFA | First entry |
0DFC | Last entry |
object[2C] | Predecessor |
object[2E] | Successor |