Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
object_list_processor.h
Go to the documentation of this file.
1 #ifndef _OBJECT_LIST_PROCESSOR_H
2 #define _OBJECT_LIST_PROCESSOR_H
3 
4 struct Object;
5 struct SpawnInfo;
6 
7 
12 #define TIME_STOP_UNKNOWN_0 (1 << 0)
13 #define TIME_STOP_ENABLED (1 << 1)
14 #define TIME_STOP_UNKNOWN_2 (1 << 2)
15 #define TIME_STOP_MARIO_AND_DOORS (1 << 3)
16 #define TIME_STOP_ALL_OBJECTS (1 << 4)
17 #define TIME_STOP_MARIO_OPENED_DOOR (1 << 5)
18 #define TIME_STOP_ACTIVE (1 << 6)
19 
20 
24 #define OBJECT_POOL_CAPACITY 240
25 
31 {
32  OBJ_LIST_PLAYER, // (0) mario
33  OBJ_LIST_UNUSED_1, // (1) (unused)
34  OBJ_LIST_DESTRUCTIVE, // (2) things that can be used to destroy other objects, like
35  // bob-ombs and corkboxes
36  OBJ_LIST_UNUSED_3, // (3) (unused)
37  OBJ_LIST_GENACTOR, // (4) general actors. most normal 'enemies' or actors are
38  // on this list. (MIPS, bullet bill, bully, etc)
39  OBJ_LIST_PUSHABLE, // (5) pushable actors. This is a group of objects which
40  // can push each other around as well as their parent
41  // objects. (goombas, koopas, spinies)
42  OBJ_LIST_LEVEL, // (6) level objects. general level objects such as heart, star
43  OBJ_LIST_UNUSED_7, // (7) (unused)
44  OBJ_LIST_DEFAULT, // (8) default objects. objects that didnt start with a 00
45  // command are put here, so this is treated as a default.
46  OBJ_LIST_SURFACE, // (9) surface objects. objects that specifically have surface
47  // collision and not object collision. (thwomp, whomp, etc)
48  OBJ_LIST_POLELIKE, // (10) polelike objects. objects that attract or otherwise
49  // "cling" mario similar to a pole action. (hoot,
50  // whirlpool, trees/poles, etc)
51  OBJ_LIST_SPAWNER, // (11) spawners
52  OBJ_LIST_UNIMPORTANT, // (12) unimportant objects. objects that will not load
53  // if there are not enough object slots: they will also
54  // be manually unloaded to make room for slots if the list
55  // gets exhausted.
57 };
58 
59 
60 extern struct ObjectNode gObjectListArray[];
61 
62 extern s32 gDebugInfoFlags;
65 extern s32 gUnknownWallCount;
66 extern u32 gObjectCounter;
67 
69  /*0x00*/ s16 floor;
70  /*0x02*/ s16 ceil;
71  /*0x04*/ s16 wall;
72 };
73 
74 extern struct NumTimesCalled gNumCalls;
75 
76 extern s16 gDebugInfo[][8];
77 extern s16 gDebugInfoOverwrite[][8];
78 
79 extern u32 gTimeStopState;
80 extern struct Object gObjectPool[];
81 extern struct Object gMacroObjectDefaultParent;
82 extern struct ObjectNode *gObjectLists;
83 extern struct ObjectNode gFreeObjectList;
84 
85 extern struct Object *gMarioObject;
86 extern struct Object *gLuigiObject;
87 extern struct Object *gCurrentObject;
88 
89 extern u32 *gBehCommand;
91 
93 extern s32 gSurfacesAllocated;
95 extern s32 gNumStaticSurfaces;
96 
97 extern struct MemoryPool *gObjectMemoryPool;
98 
99 
100 void bhv_mario_update(void);
101 void set_object_respawn_info_bits(struct Object *obj, u8 bits);
102 void unload_objects_from_area(s32 unused, s32 areaIndex);
103 void spawn_objects_from_info(s32 unused, struct SpawnInfo *spawnInfo);
104 void clear_objects(void);
106 
107 
108 #endif /* _OBJECT_LIST_PROCESSOR_H */
Definition: area.h:121
struct NumTimesCalled gNumCalls
The number of times find_floor, find_ceil, and find_wall_collisions have been called respectively...
Definition: object_list_processor.c:56
void bhv_mario_update(void)
Mario&#39;s primary behavior update function.
Definition: object_list_processor.c:249
Definition: object_list_processor.h:33
Definition: object_list_processor.h:52
struct Object gObjectPool[]
The pool that objects are allocated from.
Definition: object_list_processor.c:74
Definition: types.h:115
Definition: object_list_processor.h:68
signed short int s16
Definition: ultratypes.h:13
Definition: object_list_processor.h:48
Definition: object_list_processor.h:37
void unload_objects_from_area(s32 unused, s32 areaIndex)
Definition: object_list_processor.h:51
u32 * gBehCommand
The next object behavior command to be executed.
Definition: object_list_processor.c:115
s16 gDebugInfo[][8]
An array of debug controls that could be used to tweak in-game parameters.
Definition: object_list_processor.c:62
s16 floor
Definition: object_list_processor.h:69
void set_object_respawn_info_bits(struct Object *obj, u8 bits)
OR the object&#39;s respawn info with bits << 8.
Definition: object_list_processor.c:390
void spawn_objects_from_info(s32 unused, struct SpawnInfo *spawnInfo)
struct Object * gLuigiObject
An object variable that may have been used to represent the planned second player.
Definition: object_list_processor.c:103
struct ObjectNode gFreeObjectList
A singly linked list of available slots in the object pool.
Definition: object_list_processor.c:91
u32 gObjectCounter
Roughly the number of objects that have been processed this frame so far.
Definition: object_list_processor.c:51
struct ObjectNode * gObjectLists
A pointer to gObjectListArray.
Definition: object_list_processor.c:86
s16 ceil
Definition: object_list_processor.h:70
struct ObjectNode gObjectListArray[]
Nodes used to represent the doubly linked object lists.
Definition: object_list_processor.c:27
struct Object * gCurrentObject
The object whose behavior script is currently being updated.
Definition: object_list_processor.c:110
s32 gNumStaticSurfaceNodes
The number of nodes that have been created for surfaces.
Definition: object_list_processor.c:139
struct Object * gMarioObject
The object representing mario.
Definition: object_list_processor.c:96
s32 gSurfaceNodesAllocated
The total number of surface nodes allocated (a node is allocated for each spatial partition cell that...
Definition: object_list_processor.c:129
Definition: object_list_processor.h:32
Definition: types.h:122
Definition: object_list_processor.h:56
s32 gDebugInfoFlags
Flags controlling what debug info is displayed.
Definition: object_list_processor.c:32
static UNUSED u32 unused
Definition: osContStartReadData.c:6
s16 gDebugInfoOverwrite[][8]
Definition: object_list_processor.c:63
Definition: object_list_processor.h:44
void clear_objects(void)
Clear objects, dynamic surfaces, and some miscellaneous level data used by objects.
Definition: object_list_processor.c:511
u32 gTimeStopState
A set of flags to control which objects are updated on a given frame.
Definition: object_list_processor.c:69
Definition: memory.c:34
s16 gPrevFrameObjectCount
The number of objects that were processed last frame, which may miss some objects that were spawned l...
Definition: object_list_processor.c:123
s32 gNumStaticSurfaces
The number of surfaces in the pool.
Definition: object_list_processor.c:144
void update_objects(s32 unused)
s16 wall
Definition: object_list_processor.h:71
unsigned char u8
Definition: ultratypes.h:12
Definition: object_list_processor.h:39
s32 gNumFindFloorMisses
The number of times per frame find_floor found no floor beneath an object, and therefore either retur...
Definition: object_list_processor.c:38
#define UNUSED
Definition: macros.h:13
s32 gSurfacesAllocated
The total number of surfaces allocated.
Definition: object_list_processor.c:134
struct Object gMacroObjectDefaultParent
A special object whose purpose is to act as a parent for macro objects.
Definition: object_list_processor.c:79
Definition: object_list_processor.h:42
Definition: object_list_processor.h:43
s32 gUnknownWallCount
An unused debug counter with the label "WALL".
Definition: object_list_processor.c:45
signed int s32
Definition: ultratypes.h:15
Definition: object_list_processor.h:46
Definition: object_list_processor.h:34
struct MemoryPool * gObjectMemoryPool
A pool used by chain chomp and wiggler to allocate their body parts.
Definition: object_list_processor.c:149
ObjectList
Every object is categorized into an object list, which controls the order they are processed and whic...
Definition: object_list_processor.h:30
unsigned int u32
Definition: ultratypes.h:16
Definition: object_list_processor.h:36
UNUSED s32 unused_8033BEF8
Definition: object_list_processor.c:40