2021-09-15 23:24:19 +00:00
|
|
|
#ifndef Z64ACTOR_H
|
|
|
|
#define Z64ACTOR_H
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2024-06-25 22:48:24 +00:00
|
|
|
#include "color.h"
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "z64dma.h"
|
|
|
|
#include "z64animation.h"
|
|
|
|
#include "z64math.h"
|
|
|
|
#include "z64collision_check.h"
|
2020-04-02 17:44:19 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
#define ACTOR_NUMBER_MAX 200
|
2022-06-20 20:17:09 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
#define INVISIBLE_ACTOR_MAX 20
|
2022-06-20 20:17:09 +00:00
|
|
|
|
2022-04-30 12:33:28 +00:00
|
|
|
#define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC colliders
|
|
|
|
#define MASS_HEAVY 0xFE // Can only be pushed by OC colliders from actors with IMMOVABLE or HEAVY mass.
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
struct Actor;
|
2024-06-25 22:48:24 +00:00
|
|
|
struct CollisionPoly;
|
2020-09-05 13:45:10 +00:00
|
|
|
struct Lights;
|
2024-06-25 22:48:24 +00:00
|
|
|
struct PlayState;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
typedef void (*ActorFunc)(struct Actor*, struct PlayState*);
|
|
|
|
typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState*);
|
2022-11-25 17:52:28 +00:00
|
|
|
typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*);
|
|
|
|
typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*);
|
2021-01-18 21:04:04 +00:00
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef struct ActorProfile {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ s16 id;
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x04 */ u32 flags;
|
|
|
|
/* 0x08 */ s16 objectId;
|
|
|
|
/* 0x0C */ u32 instanceSize;
|
|
|
|
/* 0x10 */ ActorFunc init; // Constructor
|
|
|
|
/* 0x14 */ ActorFunc destroy; // Destructor
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x18 */ ActorFunc update; // Update Function
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x1C */ ActorFunc draw; // Draw function
|
2024-08-02 21:50:02 +00:00
|
|
|
} ActorProfile; // size = 0x20
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-06-20 20:17:09 +00:00
|
|
|
/**
|
|
|
|
* @see ACTOROVL_ALLOC_ABSOLUTE
|
|
|
|
*/
|
2024-01-31 02:07:34 +00:00
|
|
|
#if OOT_DEBUG
|
2022-06-20 20:17:09 +00:00
|
|
|
#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x27A0
|
2024-01-31 02:07:34 +00:00
|
|
|
#else
|
|
|
|
#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x24E0
|
|
|
|
#endif
|
2022-06-20 20:17:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The actor overlay should be allocated memory for when loading,
|
|
|
|
* and the memory deallocated when there is no more actor using the overlay.
|
|
|
|
*
|
|
|
|
* `ACTOROVL_ALLOC_` defines indicate how an actor overlay should be loaded.
|
|
|
|
*
|
|
|
|
* @note Bitwise or-ing `ACTOROVL_ALLOC_` types is not meaningful.
|
|
|
|
* The `ACTOROVL_ALLOC_` types are 0, 1, 2 but checked against with a bitwise and.
|
|
|
|
*
|
|
|
|
* @see ACTOROVL_ALLOC_ABSOLUTE
|
|
|
|
* @see ACTOROVL_ALLOC_PERSISTENT
|
|
|
|
* @see actor_table.h
|
|
|
|
*/
|
|
|
|
#define ACTOROVL_ALLOC_NORMAL 0
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The actor overlay should be loaded to "absolute space".
|
|
|
|
*
|
|
|
|
* Absolute space is a fixed amount of memory allocated once.
|
|
|
|
* The overlay will still need to be loaded again if at some point there is no more actor using the overlay.
|
|
|
|
*
|
|
|
|
* @note Only one such overlay may be loaded at a time.
|
|
|
|
* This is not checked: a newly loaded overlay will overwrite the previous one in absolute space,
|
|
|
|
* even if actors are still relying on the previous one. Actors using absolute-allocated overlays should be deleted
|
|
|
|
* when another absolute-allocated overlay is about to be used.
|
|
|
|
*
|
|
|
|
* @see ACTOROVL_ABSOLUTE_SPACE_SIZE
|
|
|
|
* @see ActorContext.absoluteSpace
|
|
|
|
* @see ACTOROVL_ALLOC_NORMAL
|
|
|
|
*/
|
|
|
|
#define ACTOROVL_ALLOC_ABSOLUTE (1 << 0)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The actor overlay should be loaded persistently.
|
|
|
|
* It will stay loaded until the current game state instance ends.
|
|
|
|
*
|
|
|
|
* @see ACTOROVL_ALLOC_NORMAL
|
|
|
|
*/
|
|
|
|
#define ACTOROVL_ALLOC_PERSISTENT (1 << 1)
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef struct ActorOverlay {
|
2024-02-29 13:15:04 +00:00
|
|
|
/* 0x00 */ RomFile file;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x08 */ void* vramStart;
|
|
|
|
/* 0x0C */ void* vramEnd;
|
|
|
|
/* 0x10 */ void* loadedRamAddr; // original name: "allocp"
|
2024-08-02 21:50:02 +00:00
|
|
|
/* 0x14 */ ActorProfile* profile;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x18 */ char* name;
|
2022-06-20 20:17:09 +00:00
|
|
|
/* 0x1C */ u16 allocType; // See `ACTOROVL_ALLOC_` defines
|
2021-08-15 23:15:58 +00:00
|
|
|
/* 0x1E */ s8 numLoaded; // original name: "clients"
|
2020-03-17 04:31:30 +00:00
|
|
|
} ActorOverlay; // size = 0x20
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef struct DamageTable {
|
z_collision_check.c (#73)
* func_8005B280 ok
* func_8005B65C OK
* split out func_8005BD50
* func_8005B7C0 OK
* func_8005B7F4 OK
* func_8005B824 OK
* func_8005B860 ok
* improve sanity
* func_8005B6B0 ok, ColliderInit_Actor structs added
* func_8005B884 ok
* func_8005BBF8 ok, split out func_8005BF50
* split more stuff out of func_8005C050.s
* func_8005C050 OK
* func_8005BA30 fakish OK, func_8005BAD8 real OK
* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues
* func_8005BB10 Ok
* func_8005BF50 OK
* func_8005BE50 OK
* func_8005BD50 OK
* func_8005BCC8 Ok
* func_8005BC28
* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok
* save my work commit
* func_8005C2BC fake OK
* func_8005C5B0 ok
* func_8005C608 ok
* func_8005C6C0 ok
* func_8005C6F8 ok
* func_8005C730 ok
* func_8005C774 func_8005C798 func_8005C7BC OK
* func_8005C7E0 ok, func_8005C810 split
* func_8005C810 OK
* func_8005C8C8 ok
* func_8005C964 OK
* func_8005CA88 ok
* func_8005CBAC ok
* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK
* func_8005CD34 func_8005CDD0 Ok
* func_8005CE6C ok
* func_8005CEC4 ok
* func_8005CEDC ok
* func_8005CF90 Ok
* standardize type names/vars more
* func_8005D3BC ok
* func_8005D40C OK, z64.h CollisionCheckContext
* func_8005D4B4 func_8005D4C8 ok
* partial data section migration
* improve function documentation, OT->OC
* Actor_CollisionCheck_SetOC ok
* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok
* func_8005BA84 ok
* func_800611A0 ok
* func_80061274 ok
* clean up func_80061274
* func_8006139C ok
* func_8005E9C0 and dependencies OK
* minor cleanup to func_8005E9C0
* func_8005EC6C OK!
* func_8005E81C ok
* func_8005E604 ok
* func_8005E2EC func_8005E4F8 OK
* func_8005DE9C OK func_8005D8AC disassembled
* func_8006146C func_8006268C ok
* func_8005EEE0 ok
* func_8005F17C
* func_8005F39C ok
* func_8005F5B0 decompiled, not matching
* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK
* func_8005FA30 ok, split more functions
* func_8005FC04 ok
* func_8005FDCC k
* func_8005FF90 OK OK OK
* func_80060204 dead
* func_800604B0 ok
* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish
* func_800635D0 ok, func_80062ECC not so much
* OcLine oks
* D_8011DF28 functions disassembled
* D_8011DF5C functions OK
* setAT_SAC. setAC_SAC, setOC_SAC OK
* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK
* func_800617D4 ok, func_800614A4 disassembled
* CollisionCheck_OC D_8011DFAC functions OK
* func_80062530 ok
* CollisionCheck_generalLineOcCheck subfunctions OK
* func_800622E4 ok
* after a long fought battle, func_80061F64 has fallen.
* func_800628A4 disassembled
* func_800627A0 func_8006285C OK
* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok
* func_80062CD4 decompiled, import EffShield/EffSpark types from MM
* various SubActor98 struct functions OK
* func_8005D4DC func_8005D62C ok
* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs
* func_80060C2C ok
* minor code tweaks
* func_80061C98 ok somehow
* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types
* Apply changes
* formatting
* tweak a couple function names
* krim changes, func naming
* missed some things
* function renames
* Implement GenColliderInit.py utility
* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching
* func_800614A4 ok
* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE
* collisionCheckCtx -> colChkCtx, fix small things
2020-04-26 02:43:35 +00:00
|
|
|
u8 table[32];
|
|
|
|
} DamageTable;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef struct CollisionCheckInfoInit {
|
z_collision_check.c (#73)
* func_8005B280 ok
* func_8005B65C OK
* split out func_8005BD50
* func_8005B7C0 OK
* func_8005B7F4 OK
* func_8005B824 OK
* func_8005B860 ok
* improve sanity
* func_8005B6B0 ok, ColliderInit_Actor structs added
* func_8005B884 ok
* func_8005BBF8 ok, split out func_8005BF50
* split more stuff out of func_8005C050.s
* func_8005C050 OK
* func_8005BA30 fakish OK, func_8005BAD8 real OK
* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues
* func_8005BB10 Ok
* func_8005BF50 OK
* func_8005BE50 OK
* func_8005BD50 OK
* func_8005BCC8 Ok
* func_8005BC28
* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok
* save my work commit
* func_8005C2BC fake OK
* func_8005C5B0 ok
* func_8005C608 ok
* func_8005C6C0 ok
* func_8005C6F8 ok
* func_8005C730 ok
* func_8005C774 func_8005C798 func_8005C7BC OK
* func_8005C7E0 ok, func_8005C810 split
* func_8005C810 OK
* func_8005C8C8 ok
* func_8005C964 OK
* func_8005CA88 ok
* func_8005CBAC ok
* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK
* func_8005CD34 func_8005CDD0 Ok
* func_8005CE6C ok
* func_8005CEC4 ok
* func_8005CEDC ok
* func_8005CF90 Ok
* standardize type names/vars more
* func_8005D3BC ok
* func_8005D40C OK, z64.h CollisionCheckContext
* func_8005D4B4 func_8005D4C8 ok
* partial data section migration
* improve function documentation, OT->OC
* Actor_CollisionCheck_SetOC ok
* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok
* func_8005BA84 ok
* func_800611A0 ok
* func_80061274 ok
* clean up func_80061274
* func_8006139C ok
* func_8005E9C0 and dependencies OK
* minor cleanup to func_8005E9C0
* func_8005EC6C OK!
* func_8005E81C ok
* func_8005E604 ok
* func_8005E2EC func_8005E4F8 OK
* func_8005DE9C OK func_8005D8AC disassembled
* func_8006146C func_8006268C ok
* func_8005EEE0 ok
* func_8005F17C
* func_8005F39C ok
* func_8005F5B0 decompiled, not matching
* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK
* func_8005FA30 ok, split more functions
* func_8005FC04 ok
* func_8005FDCC k
* func_8005FF90 OK OK OK
* func_80060204 dead
* func_800604B0 ok
* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish
* func_800635D0 ok, func_80062ECC not so much
* OcLine oks
* D_8011DF28 functions disassembled
* D_8011DF5C functions OK
* setAT_SAC. setAC_SAC, setOC_SAC OK
* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK
* func_800617D4 ok, func_800614A4 disassembled
* CollisionCheck_OC D_8011DFAC functions OK
* func_80062530 ok
* CollisionCheck_generalLineOcCheck subfunctions OK
* func_800622E4 ok
* after a long fought battle, func_80061F64 has fallen.
* func_800628A4 disassembled
* func_800627A0 func_8006285C OK
* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok
* func_80062CD4 decompiled, import EffShield/EffSpark types from MM
* various SubActor98 struct functions OK
* func_8005D4DC func_8005D62C ok
* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs
* func_80060C2C ok
* minor code tweaks
* func_80061C98 ok somehow
* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types
* Apply changes
* formatting
* tweak a couple function names
* krim changes, func naming
* missed some things
* function renames
* Implement GenColliderInit.py utility
* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching
* func_800614A4 ok
* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE
* collisionCheckCtx -> colChkCtx, fix small things
2020-04-26 02:43:35 +00:00
|
|
|
/* 0x00 */ u8 health;
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x02 */ s16 cylRadius;
|
|
|
|
/* 0x04 */ s16 cylHeight;
|
z_collision_check.c (#73)
* func_8005B280 ok
* func_8005B65C OK
* split out func_8005BD50
* func_8005B7C0 OK
* func_8005B7F4 OK
* func_8005B824 OK
* func_8005B860 ok
* improve sanity
* func_8005B6B0 ok, ColliderInit_Actor structs added
* func_8005B884 ok
* func_8005BBF8 ok, split out func_8005BF50
* split more stuff out of func_8005C050.s
* func_8005C050 OK
* func_8005BA30 fakish OK, func_8005BAD8 real OK
* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues
* func_8005BB10 Ok
* func_8005BF50 OK
* func_8005BE50 OK
* func_8005BD50 OK
* func_8005BCC8 Ok
* func_8005BC28
* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok
* save my work commit
* func_8005C2BC fake OK
* func_8005C5B0 ok
* func_8005C608 ok
* func_8005C6C0 ok
* func_8005C6F8 ok
* func_8005C730 ok
* func_8005C774 func_8005C798 func_8005C7BC OK
* func_8005C7E0 ok, func_8005C810 split
* func_8005C810 OK
* func_8005C8C8 ok
* func_8005C964 OK
* func_8005CA88 ok
* func_8005CBAC ok
* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK
* func_8005CD34 func_8005CDD0 Ok
* func_8005CE6C ok
* func_8005CEC4 ok
* func_8005CEDC ok
* func_8005CF90 Ok
* standardize type names/vars more
* func_8005D3BC ok
* func_8005D40C OK, z64.h CollisionCheckContext
* func_8005D4B4 func_8005D4C8 ok
* partial data section migration
* improve function documentation, OT->OC
* Actor_CollisionCheck_SetOC ok
* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok
* func_8005BA84 ok
* func_800611A0 ok
* func_80061274 ok
* clean up func_80061274
* func_8006139C ok
* func_8005E9C0 and dependencies OK
* minor cleanup to func_8005E9C0
* func_8005EC6C OK!
* func_8005E81C ok
* func_8005E604 ok
* func_8005E2EC func_8005E4F8 OK
* func_8005DE9C OK func_8005D8AC disassembled
* func_8006146C func_8006268C ok
* func_8005EEE0 ok
* func_8005F17C
* func_8005F39C ok
* func_8005F5B0 decompiled, not matching
* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK
* func_8005FA30 ok, split more functions
* func_8005FC04 ok
* func_8005FDCC k
* func_8005FF90 OK OK OK
* func_80060204 dead
* func_800604B0 ok
* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish
* func_800635D0 ok, func_80062ECC not so much
* OcLine oks
* D_8011DF28 functions disassembled
* D_8011DF5C functions OK
* setAT_SAC. setAC_SAC, setOC_SAC OK
* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK
* func_800617D4 ok, func_800614A4 disassembled
* CollisionCheck_OC D_8011DFAC functions OK
* func_80062530 ok
* CollisionCheck_generalLineOcCheck subfunctions OK
* func_800622E4 ok
* after a long fought battle, func_80061F64 has fallen.
* func_800628A4 disassembled
* func_800627A0 func_8006285C OK
* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok
* func_80062CD4 decompiled, import EffShield/EffSpark types from MM
* various SubActor98 struct functions OK
* func_8005D4DC func_8005D62C ok
* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs
* func_80060C2C ok
* minor code tweaks
* func_80061C98 ok somehow
* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types
* Apply changes
* formatting
* tweak a couple function names
* krim changes, func naming
* missed some things
* function renames
* Implement GenColliderInit.py utility
* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching
* func_800614A4 ok
* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE
* collisionCheckCtx -> colChkCtx, fix small things
2020-04-26 02:43:35 +00:00
|
|
|
/* 0x06 */ u8 mass;
|
|
|
|
} CollisionCheckInfoInit;
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef struct CollisionCheckInfoInit2 {
|
z_collision_check.c (#73)
* func_8005B280 ok
* func_8005B65C OK
* split out func_8005BD50
* func_8005B7C0 OK
* func_8005B7F4 OK
* func_8005B824 OK
* func_8005B860 ok
* improve sanity
* func_8005B6B0 ok, ColliderInit_Actor structs added
* func_8005B884 ok
* func_8005BBF8 ok, split out func_8005BF50
* split more stuff out of func_8005C050.s
* func_8005C050 OK
* func_8005BA30 fakish OK, func_8005BAD8 real OK
* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues
* func_8005BB10 Ok
* func_8005BF50 OK
* func_8005BE50 OK
* func_8005BD50 OK
* func_8005BCC8 Ok
* func_8005BC28
* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok
* save my work commit
* func_8005C2BC fake OK
* func_8005C5B0 ok
* func_8005C608 ok
* func_8005C6C0 ok
* func_8005C6F8 ok
* func_8005C730 ok
* func_8005C774 func_8005C798 func_8005C7BC OK
* func_8005C7E0 ok, func_8005C810 split
* func_8005C810 OK
* func_8005C8C8 ok
* func_8005C964 OK
* func_8005CA88 ok
* func_8005CBAC ok
* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK
* func_8005CD34 func_8005CDD0 Ok
* func_8005CE6C ok
* func_8005CEC4 ok
* func_8005CEDC ok
* func_8005CF90 Ok
* standardize type names/vars more
* func_8005D3BC ok
* func_8005D40C OK, z64.h CollisionCheckContext
* func_8005D4B4 func_8005D4C8 ok
* partial data section migration
* improve function documentation, OT->OC
* Actor_CollisionCheck_SetOC ok
* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok
* func_8005BA84 ok
* func_800611A0 ok
* func_80061274 ok
* clean up func_80061274
* func_8006139C ok
* func_8005E9C0 and dependencies OK
* minor cleanup to func_8005E9C0
* func_8005EC6C OK!
* func_8005E81C ok
* func_8005E604 ok
* func_8005E2EC func_8005E4F8 OK
* func_8005DE9C OK func_8005D8AC disassembled
* func_8006146C func_8006268C ok
* func_8005EEE0 ok
* func_8005F17C
* func_8005F39C ok
* func_8005F5B0 decompiled, not matching
* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK
* func_8005FA30 ok, split more functions
* func_8005FC04 ok
* func_8005FDCC k
* func_8005FF90 OK OK OK
* func_80060204 dead
* func_800604B0 ok
* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish
* func_800635D0 ok, func_80062ECC not so much
* OcLine oks
* D_8011DF28 functions disassembled
* D_8011DF5C functions OK
* setAT_SAC. setAC_SAC, setOC_SAC OK
* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK
* func_800617D4 ok, func_800614A4 disassembled
* CollisionCheck_OC D_8011DFAC functions OK
* func_80062530 ok
* CollisionCheck_generalLineOcCheck subfunctions OK
* func_800622E4 ok
* after a long fought battle, func_80061F64 has fallen.
* func_800628A4 disassembled
* func_800627A0 func_8006285C OK
* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok
* func_80062CD4 decompiled, import EffShield/EffSpark types from MM
* various SubActor98 struct functions OK
* func_8005D4DC func_8005D62C ok
* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs
* func_80060C2C ok
* minor code tweaks
* func_80061C98 ok somehow
* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types
* Apply changes
* formatting
* tweak a couple function names
* krim changes, func naming
* missed some things
* function renames
* Implement GenColliderInit.py utility
* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching
* func_800614A4 ok
* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE
* collisionCheckCtx -> colChkCtx, fix small things
2020-04-26 02:43:35 +00:00
|
|
|
/* 0x00 */ u8 health;
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x02 */ s16 cylRadius;
|
|
|
|
/* 0x04 */ s16 cylHeight;
|
|
|
|
/* 0x06 */ s16 cylYShift;
|
z_collision_check.c (#73)
* func_8005B280 ok
* func_8005B65C OK
* split out func_8005BD50
* func_8005B7C0 OK
* func_8005B7F4 OK
* func_8005B824 OK
* func_8005B860 ok
* improve sanity
* func_8005B6B0 ok, ColliderInit_Actor structs added
* func_8005B884 ok
* func_8005BBF8 ok, split out func_8005BF50
* split more stuff out of func_8005C050.s
* func_8005C050 OK
* func_8005BA30 fakish OK, func_8005BAD8 real OK
* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues
* func_8005BB10 Ok
* func_8005BF50 OK
* func_8005BE50 OK
* func_8005BD50 OK
* func_8005BCC8 Ok
* func_8005BC28
* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok
* save my work commit
* func_8005C2BC fake OK
* func_8005C5B0 ok
* func_8005C608 ok
* func_8005C6C0 ok
* func_8005C6F8 ok
* func_8005C730 ok
* func_8005C774 func_8005C798 func_8005C7BC OK
* func_8005C7E0 ok, func_8005C810 split
* func_8005C810 OK
* func_8005C8C8 ok
* func_8005C964 OK
* func_8005CA88 ok
* func_8005CBAC ok
* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK
* func_8005CD34 func_8005CDD0 Ok
* func_8005CE6C ok
* func_8005CEC4 ok
* func_8005CEDC ok
* func_8005CF90 Ok
* standardize type names/vars more
* func_8005D3BC ok
* func_8005D40C OK, z64.h CollisionCheckContext
* func_8005D4B4 func_8005D4C8 ok
* partial data section migration
* improve function documentation, OT->OC
* Actor_CollisionCheck_SetOC ok
* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok
* func_8005BA84 ok
* func_800611A0 ok
* func_80061274 ok
* clean up func_80061274
* func_8006139C ok
* func_8005E9C0 and dependencies OK
* minor cleanup to func_8005E9C0
* func_8005EC6C OK!
* func_8005E81C ok
* func_8005E604 ok
* func_8005E2EC func_8005E4F8 OK
* func_8005DE9C OK func_8005D8AC disassembled
* func_8006146C func_8006268C ok
* func_8005EEE0 ok
* func_8005F17C
* func_8005F39C ok
* func_8005F5B0 decompiled, not matching
* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK
* func_8005FA30 ok, split more functions
* func_8005FC04 ok
* func_8005FDCC k
* func_8005FF90 OK OK OK
* func_80060204 dead
* func_800604B0 ok
* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish
* func_800635D0 ok, func_80062ECC not so much
* OcLine oks
* D_8011DF28 functions disassembled
* D_8011DF5C functions OK
* setAT_SAC. setAC_SAC, setOC_SAC OK
* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK
* func_800617D4 ok, func_800614A4 disassembled
* CollisionCheck_OC D_8011DFAC functions OK
* func_80062530 ok
* CollisionCheck_generalLineOcCheck subfunctions OK
* func_800622E4 ok
* after a long fought battle, func_80061F64 has fallen.
* func_800628A4 disassembled
* func_800627A0 func_8006285C OK
* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok
* func_80062CD4 decompiled, import EffShield/EffSpark types from MM
* various SubActor98 struct functions OK
* func_8005D4DC func_8005D62C ok
* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs
* func_80060C2C ok
* minor code tweaks
* func_80061C98 ok somehow
* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types
* Apply changes
* formatting
* tweak a couple function names
* krim changes, func naming
* missed some things
* function renames
* Implement GenColliderInit.py utility
* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching
* func_800614A4 ok
* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE
* collisionCheckCtx -> colChkCtx, fix small things
2020-04-26 02:43:35 +00:00
|
|
|
/* 0x08 */ u8 mass;
|
|
|
|
} CollisionCheckInfoInit2;
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef struct CollisionCheckInfo {
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x00 */ DamageTable* damageTable;
|
2022-03-16 21:14:56 +00:00
|
|
|
/* 0x04 */ Vec3f displacement; // Amount to correct actor velocity by when colliding into a body
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x10 */ s16 cylRadius; // Used for various purposes
|
|
|
|
/* 0x12 */ s16 cylHeight; // Used for various purposes
|
|
|
|
/* 0x14 */ s16 cylYShift; // Unused. Purpose inferred from Cylinder16 and CollisionCheck_CylSideVsLineSeg
|
|
|
|
/* 0x16 */ u8 mass; // Used to compute displacement for OC collisions
|
|
|
|
/* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one
|
|
|
|
/* 0x18 */ u8 damage; // Amount to decrement health by
|
|
|
|
/* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon
|
|
|
|
/* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC
|
|
|
|
/* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT
|
z_collision_check.c (#73)
* func_8005B280 ok
* func_8005B65C OK
* split out func_8005BD50
* func_8005B7C0 OK
* func_8005B7F4 OK
* func_8005B824 OK
* func_8005B860 ok
* improve sanity
* func_8005B6B0 ok, ColliderInit_Actor structs added
* func_8005B884 ok
* func_8005BBF8 ok, split out func_8005BF50
* split more stuff out of func_8005C050.s
* func_8005C050 OK
* func_8005BA30 fakish OK, func_8005BAD8 real OK
* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues
* func_8005BB10 Ok
* func_8005BF50 OK
* func_8005BE50 OK
* func_8005BD50 OK
* func_8005BCC8 Ok
* func_8005BC28
* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok
* save my work commit
* func_8005C2BC fake OK
* func_8005C5B0 ok
* func_8005C608 ok
* func_8005C6C0 ok
* func_8005C6F8 ok
* func_8005C730 ok
* func_8005C774 func_8005C798 func_8005C7BC OK
* func_8005C7E0 ok, func_8005C810 split
* func_8005C810 OK
* func_8005C8C8 ok
* func_8005C964 OK
* func_8005CA88 ok
* func_8005CBAC ok
* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK
* func_8005CD34 func_8005CDD0 Ok
* func_8005CE6C ok
* func_8005CEC4 ok
* func_8005CEDC ok
* func_8005CF90 Ok
* standardize type names/vars more
* func_8005D3BC ok
* func_8005D40C OK, z64.h CollisionCheckContext
* func_8005D4B4 func_8005D4C8 ok
* partial data section migration
* improve function documentation, OT->OC
* Actor_CollisionCheck_SetOC ok
* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok
* func_8005BA84 ok
* func_800611A0 ok
* func_80061274 ok
* clean up func_80061274
* func_8006139C ok
* func_8005E9C0 and dependencies OK
* minor cleanup to func_8005E9C0
* func_8005EC6C OK!
* func_8005E81C ok
* func_8005E604 ok
* func_8005E2EC func_8005E4F8 OK
* func_8005DE9C OK func_8005D8AC disassembled
* func_8006146C func_8006268C ok
* func_8005EEE0 ok
* func_8005F17C
* func_8005F39C ok
* func_8005F5B0 decompiled, not matching
* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK
* func_8005FA30 ok, split more functions
* func_8005FC04 ok
* func_8005FDCC k
* func_8005FF90 OK OK OK
* func_80060204 dead
* func_800604B0 ok
* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish
* func_800635D0 ok, func_80062ECC not so much
* OcLine oks
* D_8011DF28 functions disassembled
* D_8011DF5C functions OK
* setAT_SAC. setAC_SAC, setOC_SAC OK
* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK
* func_800617D4 ok, func_800614A4 disassembled
* CollisionCheck_OC D_8011DFAC functions OK
* func_80062530 ok
* CollisionCheck_generalLineOcCheck subfunctions OK
* func_800622E4 ok
* after a long fought battle, func_80061F64 has fallen.
* func_800628A4 disassembled
* func_800627A0 func_8006285C OK
* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok
* func_80062CD4 decompiled, import EffShield/EffSpark types from MM
* various SubActor98 struct functions OK
* func_8005D4DC func_8005D62C ok
* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs
* func_80060C2C ok
* minor code tweaks
* func_80061C98 ok somehow
* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types
* Apply changes
* formatting
* tweak a couple function names
* krim changes, func naming
* missed some things
* function renames
* Implement GenColliderInit.py utility
* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching
* func_800614A4 ok
* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE
* collisionCheckCtx -> colChkCtx, fix small things
2020-04-26 02:43:35 +00:00
|
|
|
} CollisionCheckInfo; // size = 0x1C
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef struct ActorShape {
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x00 */ Vec3s rot; // Current actor shape rotation
|
2024-03-23 16:21:45 +00:00
|
|
|
/* 0x06 */ s16 face; // Used to index eyes and mouth textures. Only used by player
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x08 */ f32 yOffset; // Model y axis offset. Represents model space units
|
|
|
|
/* 0x0C */ ActorShadowFunc shadowDraw; // Shadow draw function
|
|
|
|
/* 0x10 */ f32 shadowScale; // Changes the size of the shadow
|
|
|
|
/* 0x14 */ u8 shadowAlpha; // Default is 255
|
2022-04-29 18:29:49 +00:00
|
|
|
/* 0x15 */ u8 feetFloorFlag; // 0 if actor or feet aren't on ground, or 1 or 2 depending on feet positions
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x18 */ Vec3f feetPos[2]; // Update by using `Actor_SetFeetPos` in PostLimbDraw
|
2021-02-25 03:37:20 +00:00
|
|
|
} ActorShape; // size = 0x30
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_0 (1 << 0)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_2 (1 << 2)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_3 (1 << 3)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_4 (1 << 4)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_5 (1 << 5)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_6 (1 << 6)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
|
|
|
// hidden or revealed by Lens of Truth (depending on room lensMode)
|
|
|
|
#define ACTOR_FLAG_REACT_TO_LENS (1 << 7)
|
|
|
|
|
2023-11-19 16:11:59 +00:00
|
|
|
// Signals that player has accepted an offer to talk to an actor
|
|
|
|
// Player will retain this flag until the player is finished talking
|
|
|
|
// Actor will retain this flag until `Actor_TalkOfferAccepted` is called or manually turned off by the actor
|
|
|
|
#define ACTOR_FLAG_TALK (1 << 8)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_9 (1 << 9)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_10 (1 << 10)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-27 18:24:41 +00:00
|
|
|
#define ACTOR_FLAG_ENKUSA_CUT (1 << 11)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
|
|
|
// Actor will not shake when a quake occurs
|
|
|
|
#define ACTOR_FLAG_IGNORE_QUAKE (1 << 12)
|
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_13 (1 << 13)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_14 (1 << 14)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_15 (1 << 15)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_16 (1 << 16)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_17 (1 << 17)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_18 (1 << 18)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_19 (1 << 19)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_20 (1 << 20)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_21 (1 << 21)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
|
|
|
// ignores point lights but not directional lights (such as environment lights)
|
|
|
|
#define ACTOR_FLAG_IGNORE_POINT_LIGHTS (1 << 22)
|
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_23 (1 << 23)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_24 (1 << 24)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_25 (1 << 25)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_26 (1 << 26)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_27 (1 << 27)
|
2024-01-12 15:48:54 +00:00
|
|
|
|
2024-07-17 23:32:55 +00:00
|
|
|
//
|
2021-12-06 00:11:38 +00:00
|
|
|
#define ACTOR_FLAG_28 (1 << 28)
|
|
|
|
|
2022-12-13 02:23:14 +00:00
|
|
|
#define COLORFILTER_GET_COLORINTENSITY(colorFilterParams) (((colorFilterParams) & 0x1F00) >> 5)
|
|
|
|
#define COLORFILTER_GET_DURATION(colorFilterParams) ((colorFilterParams) & 0xFF)
|
|
|
|
|
|
|
|
#define COLORFILTER_COLORFLAG_GRAY 0x8000
|
|
|
|
#define COLORFILTER_COLORFLAG_RED 0x4000
|
|
|
|
#define COLORFILTER_COLORFLAG_BLUE 0x0000
|
|
|
|
|
|
|
|
#define COLORFILTER_INTENSITY_FLAG 0x8000
|
|
|
|
|
|
|
|
#define COLORFILTER_BUFFLAG_XLU 0x2000
|
|
|
|
#define COLORFILTER_BUFFLAG_OPA 0x0000
|
|
|
|
|
2022-02-19 02:16:19 +00:00
|
|
|
#define BGCHECKFLAG_GROUND (1 << 0) // Standing on the ground
|
|
|
|
#define BGCHECKFLAG_GROUND_TOUCH (1 << 1) // Has touched the ground (only active for 1 frame)
|
|
|
|
#define BGCHECKFLAG_GROUND_LEAVE (1 << 2) // Has left the ground (only active for 1 frame)
|
|
|
|
#define BGCHECKFLAG_WALL (1 << 3) // Touching a wall
|
|
|
|
#define BGCHECKFLAG_CEILING (1 << 4) // Touching a ceiling
|
|
|
|
#define BGCHECKFLAG_WATER (1 << 5) // In water
|
|
|
|
#define BGCHECKFLAG_WATER_TOUCH (1 << 6) // Has touched water (reset when leaving water)
|
|
|
|
#define BGCHECKFLAG_GROUND_STRICT (1 << 7) // Strictly on ground (BGCHECKFLAG_GROUND has some leeway)
|
|
|
|
#define BGCHECKFLAG_CRUSHED (1 << 8) // Crushed between a floor and ceiling (triggers a void for player)
|
|
|
|
#define BGCHECKFLAG_PLAYER_WALL_INTERACT (1 << 9) // Only set/used by player, related to interacting with walls
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct Actor {
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x000 */ s16 id; // Actor ID
|
|
|
|
/* 0x002 */ u8 category; // Actor category. Refer to the corresponding enum for values
|
|
|
|
/* 0x003 */ s8 room; // Room number the actor is in. -1 denotes that the actor won't despawn on a room change
|
|
|
|
/* 0x004 */ u32 flags; // Flags used for various purposes
|
|
|
|
/* 0x008 */ PosRot home; // Initial position/rotation when spawned. Can be used for other purposes
|
|
|
|
/* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data"
|
2023-09-19 18:10:12 +00:00
|
|
|
/* 0x01E */ s8 objectSlot; // Object slot (in ObjectContext) corresponding to the actor's object; original name: "bank"
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on
|
2022-07-30 13:05:27 +00:00
|
|
|
/* 0x020 */ u16 sfx; // SFX ID to play. Sfx plays when value is set, then is cleared the following update cycle
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x024 */ PosRot world; // Position/rotation in the world
|
|
|
|
/* 0x038 */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot
|
|
|
|
/* 0x04C */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position
|
|
|
|
/* 0x050 */ Vec3f scale; // Scale of the actor in each axis
|
|
|
|
/* 0x05C */ Vec3f velocity; // Velocity of the actor in each axis
|
2022-12-24 17:18:57 +00:00
|
|
|
/* 0x068 */ f32 speed; // Context dependent speed value. Can be used for XZ or XYZ depending on which move function is used
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x06C */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame
|
2022-12-30 18:55:14 +00:00
|
|
|
/* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap for velocity along the Y axis. Only relevant when moved with gravity.
|
2024-06-25 22:48:24 +00:00
|
|
|
/* 0x074 */ struct CollisionPoly* wallPoly; // Wall polygon the actor is touching
|
|
|
|
/* 0x078 */ struct CollisionPoly* floorPoly; // Floor polygon directly below the actor
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x07C */ u8 wallBgId; // Bg ID of the wall polygon the actor is touching
|
|
|
|
/* 0x07D */ u8 floorBgId; // Bg ID of the floor polygon directly below the actor
|
|
|
|
/* 0x07E */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching
|
|
|
|
/* 0x080 */ f32 floorHeight; // Y position of the floor polygon directly below the actor
|
2024-04-28 21:29:06 +00:00
|
|
|
/* 0x084 */ f32 depthInWater; // Distance below the surface of active waterbox. Positive value means under water, negative value means above water
|
2022-02-19 02:16:19 +00:00
|
|
|
/* 0x088 */ u16 bgCheckFlags; // Flags indicating how the actor is interacting with collision
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x08A */ s16 yawTowardsPlayer; // Y rotation difference between the actor and the player
|
2022-03-16 21:14:56 +00:00
|
|
|
/* 0x08C */ f32 xyzDistToPlayerSq; // Squared distance between the actor and the player
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x090 */ f32 xzDistToPlayer; // Distance between the actor and the player in the XZ plane
|
|
|
|
/* 0x094 */ f32 yDistToPlayer; // Dist is negative if the actor is above the player
|
|
|
|
/* 0x098 */ CollisionCheckInfo colChkInfo; // Variables related to the Collision Check system
|
|
|
|
/* 0x0B4 */ ActorShape shape; // Variables related to the physical shape of the actor
|
|
|
|
/* 0x0E4 */ Vec3f projectedPos; // Position of the actor in projected space
|
|
|
|
/* 0x0F0 */ f32 projectedW; // w component of the projected actor position
|
|
|
|
/* 0x0F4 */ f32 uncullZoneForward; // Amount to increase the uncull zone forward by (in projected space)
|
|
|
|
/* 0x0F8 */ f32 uncullZoneScale; // Amount to increase the uncull zone scale by (in projected space)
|
|
|
|
/* 0x0FC */ f32 uncullZoneDownward; // Amount to increase uncull zone downward by (in projected space)
|
|
|
|
/* 0x100 */ Vec3f prevPos; // World position from the previous update cycle
|
|
|
|
/* 0x10C */ u8 isTargeted; // Set to true if the actor is currently being targeted by the player
|
|
|
|
/* 0x10D */ u8 targetPriority; // Lower values have higher priority. Resets to 0 when player stops targeting
|
2022-08-30 21:35:00 +00:00
|
|
|
/* 0x10E */ u16 textId; // Text ID to pass to player/display when interacting with the actor
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x110 */ u16 freezeTimer; // Actor does not update when set. Timer decrements automatically
|
|
|
|
/* 0x112 */ u16 colorFilterParams; // Set color filter to red, blue, or white. Toggle opa or xlu
|
|
|
|
/* 0x114 */ u8 colorFilterTimer; // A non-zero value enables the color filter. Decrements automatically
|
|
|
|
/* 0x115 */ u8 isDrawn; // Set to true if the actor is currently being drawn. Always stays false for lens actors
|
|
|
|
/* 0x116 */ u8 dropFlag; // Configures what item is dropped by the actor from `Item_DropCollectibleRandom`
|
|
|
|
/* 0x117 */ u8 naviEnemyId; // Sets what 0600 dialog to display when talking to navi. Default 0xFF
|
|
|
|
/* 0x118 */ struct Actor* parent; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild`
|
|
|
|
/* 0x11C */ struct Actor* child; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild`
|
|
|
|
/* 0x120 */ struct Actor* prev; // Previous actor of this category
|
|
|
|
/* 0x124 */ struct Actor* next; // Next actor of this category
|
|
|
|
/* 0x128 */ ActorFunc init; // Initialization Routine. Called by `Actor_Init` or `Actor_UpdateAll`
|
|
|
|
/* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by `Actor_Destroy`
|
|
|
|
/* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll`
|
|
|
|
/* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw`
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor
|
2024-01-30 18:54:38 +00:00
|
|
|
#if OOT_DEBUG
|
2024-01-16 17:15:34 +00:00
|
|
|
/* 0x13C */ char dbgPad[0x10];
|
|
|
|
#endif
|
2020-03-17 04:31:30 +00:00
|
|
|
} Actor; // size = 0x14C
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum ActorFootIndex {
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0 */ FOOT_LEFT,
|
|
|
|
/* 1 */ FOOT_RIGHT
|
|
|
|
} ActorFootIndex;
|
|
|
|
|
|
|
|
/*
|
|
|
|
colorFilterParams WIP documentation
|
|
|
|
& 0x8000 : white
|
|
|
|
& 0x4000 : red
|
|
|
|
if neither of the above are set : blue
|
|
|
|
|
|
|
|
(& 0x1F00 >> 5) | 7 : color intensity
|
|
|
|
0x2000 : translucent, else opaque
|
|
|
|
*/
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-10-11 22:47:33 +00:00
|
|
|
#define DYNA_TRANSFORM_POS (1 << 0) // Position of the actors on top follows the dynapoly actor's movement.
|
|
|
|
#define DYNA_TRANSFORM_ROT_Y (1 << 1) // The Y rotation of the actors on top follows the dynapoly actor's Y rotation.
|
|
|
|
|
2022-06-25 13:53:26 +00:00
|
|
|
#define DYNA_INTERACT_ACTOR_ON_TOP (1 << 0) // There is an actor standing on the collision of the dynapoly actor
|
|
|
|
#define DYNA_INTERACT_PLAYER_ON_TOP (1 << 1) // The player actor is standing on the collision of the dynapoly actor
|
|
|
|
#define DYNA_INTERACT_PLAYER_ABOVE (1 << 2) // The player is directly above the collision of the dynapoly actor (any distance above)
|
|
|
|
#define DYNA_INTERACT_3 (1 << 3) // Like the ACTOR_ON_TOP flag but only actors with ACTOR_FLAG_26
|
|
|
|
|
z_bgcheck.c, 800430A0.c, 80043480.c (#256)
* beginning of migrating changes
* got matching
* changed order a bit
* clean up bgcheck
* fix conflict
* fix conflict again
* first stab at identifying types, some oks
* Clean up most bad structs/pointer math, move relevant structs to z64bgcheck.h, get some OKs
* more OKs, z_bgcheck.bss migration, update some sys_math3d.c args
* couple more OKs
* pushing some OKs
* fix compilation issues
* code_800430A0.c OK, more files decomp'd
* 8003A3E0 big OK :)
* Decomp most of func_8003C614, decomp helper funcs
* Decomp SurfaceType, CamData, and WaterBox property related functions
* more OKs, big OK in 8003C078
* more OKs, more progress, move a function definition in z_collision_check to functions.h
* more clean-ups, more OKs, dyn_vtx is now defined as u8*
* 8003A5B8, 8003A7D8, 8003C614, 8003DD6C OK, document function args better
* data migrated, more OKs
* 80041240 OK, func_8003B3C8 and func_8003BB18 disassembled
* func_80040284, 800409A8 non_matching, add IS_ZERO macro
* All asm files have C representations, some big OKs, lots of minor tweaks
* More OKs, non-matching code cleanup
* 8003FBF4 and 80040BE4 OK, improve codegen for most functions
* format z_bgcheck.c
* fix warnings, compile errors on NON_MATCHING
* func_8003EE80 is now NON_MATCHING
* begin documenting some functions
* formatting
* more documentation, func_8003A95C OK
* fix PHYSICAL_TO_VIRTUAL changes
* fix var rename
* More documentation, functions 80040E40, 80041648 OK, change types to not be compatible with ZAP
* func_8004239C ok, more NON_MATCHING improvements, more documentation
* Implement most suggested changes
* Convert comments to slower comments
* /**
* Implement ZAP2 changes
* my anti-virus ate my format.sh results
* Rename a couple hundred functions, fix minor stuff
* rename var so that clang formats correctly
* run format.sh
* implement Petrie's matches/suggestions
* format
* matches
* and the asm
* slight error
* Add SSList
* two more matches
* stuff
* implement code changes
* clean up Petrie's matchings
Co-authored-by: Arthur <arthurtilly413@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
2021-01-08 11:12:58 +00:00
|
|
|
typedef struct DynaPolyActor {
|
|
|
|
/* 0x000 */ struct Actor actor;
|
|
|
|
/* 0x14C */ s32 bgId;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x150 */ f32 unk_150;
|
|
|
|
/* 0x154 */ f32 unk_154;
|
z_bgcheck.c, 800430A0.c, 80043480.c (#256)
* beginning of migrating changes
* got matching
* changed order a bit
* clean up bgcheck
* fix conflict
* fix conflict again
* first stab at identifying types, some oks
* Clean up most bad structs/pointer math, move relevant structs to z64bgcheck.h, get some OKs
* more OKs, z_bgcheck.bss migration, update some sys_math3d.c args
* couple more OKs
* pushing some OKs
* fix compilation issues
* code_800430A0.c OK, more files decomp'd
* 8003A3E0 big OK :)
* Decomp most of func_8003C614, decomp helper funcs
* Decomp SurfaceType, CamData, and WaterBox property related functions
* more OKs, big OK in 8003C078
* more OKs, more progress, move a function definition in z_collision_check to functions.h
* more clean-ups, more OKs, dyn_vtx is now defined as u8*
* 8003A5B8, 8003A7D8, 8003C614, 8003DD6C OK, document function args better
* data migrated, more OKs
* 80041240 OK, func_8003B3C8 and func_8003BB18 disassembled
* func_80040284, 800409A8 non_matching, add IS_ZERO macro
* All asm files have C representations, some big OKs, lots of minor tweaks
* More OKs, non-matching code cleanup
* 8003FBF4 and 80040BE4 OK, improve codegen for most functions
* format z_bgcheck.c
* fix warnings, compile errors on NON_MATCHING
* func_8003EE80 is now NON_MATCHING
* begin documenting some functions
* formatting
* more documentation, func_8003A95C OK
* fix PHYSICAL_TO_VIRTUAL changes
* fix var rename
* More documentation, functions 80040E40, 80041648 OK, change types to not be compatible with ZAP
* func_8004239C ok, more NON_MATCHING improvements, more documentation
* Implement most suggested changes
* Convert comments to slower comments
* /**
* Implement ZAP2 changes
* my anti-virus ate my format.sh results
* Rename a couple hundred functions, fix minor stuff
* rename var so that clang formats correctly
* run format.sh
* implement Petrie's matches/suggestions
* format
* matches
* and the asm
* slight error
* Add SSList
* two more matches
* stuff
* implement code changes
* clean up Petrie's matchings
Co-authored-by: Arthur <arthurtilly413@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
2021-01-08 11:12:58 +00:00
|
|
|
/* 0x158 */ s16 unk_158; // y rotation?
|
2022-10-11 22:47:33 +00:00
|
|
|
/* 0x15C */ u32 transformFlags;
|
2022-06-25 13:53:26 +00:00
|
|
|
/* 0x160 */ u8 interactFlags;
|
2020-03-19 02:26:41 +00:00
|
|
|
/* 0x162 */ s16 unk_162;
|
2020-03-17 04:31:30 +00:00
|
|
|
} DynaPolyActor; // size = 0x164
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef struct BodyBreak {
|
2021-04-28 01:32:15 +00:00
|
|
|
/* 0x00 */ MtxF* matrices;
|
2023-09-19 18:10:12 +00:00
|
|
|
/* 0x04 */ s16* objectSlots;
|
2021-04-28 01:32:15 +00:00
|
|
|
/* 0x08 */ s16 count;
|
|
|
|
/* 0x0C */ Gfx** dLists;
|
|
|
|
/* 0x10 */ s32 val; // used for various purposes: both a status indicator and counter
|
|
|
|
/* 0x14 */ s32 prevLimbIndex;
|
|
|
|
} BodyBreak;
|
|
|
|
|
2023-09-19 18:10:12 +00:00
|
|
|
#define BODYBREAK_OBJECT_SLOT_DEFAULT -1 // use the same object as the actor
|
2021-04-28 01:32:15 +00:00
|
|
|
#define BODYBREAK_STATUS_READY -1
|
|
|
|
#define BODYBREAK_STATUS_FINISHED 0
|
2020-05-26 15:57:54 +00:00
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum Item00Type {
|
2020-07-12 23:03:38 +00:00
|
|
|
/* 0x00 */ ITEM00_RUPEE_GREEN,
|
|
|
|
/* 0x01 */ ITEM00_RUPEE_BLUE,
|
|
|
|
/* 0x02 */ ITEM00_RUPEE_RED,
|
2022-07-14 20:26:10 +00:00
|
|
|
/* 0x03 */ ITEM00_RECOVERY_HEART,
|
2020-07-12 23:03:38 +00:00
|
|
|
/* 0x04 */ ITEM00_BOMBS_A,
|
|
|
|
/* 0x05 */ ITEM00_ARROWS_SINGLE,
|
|
|
|
/* 0x06 */ ITEM00_HEART_PIECE,
|
|
|
|
/* 0x07 */ ITEM00_HEART_CONTAINER,
|
|
|
|
/* 0x08 */ ITEM00_ARROWS_SMALL,
|
|
|
|
/* 0x09 */ ITEM00_ARROWS_MEDIUM,
|
|
|
|
/* 0x0A */ ITEM00_ARROWS_LARGE,
|
|
|
|
/* 0x0B */ ITEM00_BOMBS_B,
|
|
|
|
/* 0x0C */ ITEM00_NUTS,
|
|
|
|
/* 0x0D */ ITEM00_STICK,
|
|
|
|
/* 0x0E */ ITEM00_MAGIC_LARGE,
|
|
|
|
/* 0x0F */ ITEM00_MAGIC_SMALL,
|
|
|
|
/* 0x10 */ ITEM00_SEEDS,
|
|
|
|
/* 0x11 */ ITEM00_SMALL_KEY,
|
|
|
|
/* 0x12 */ ITEM00_FLEXIBLE,
|
|
|
|
/* 0x13 */ ITEM00_RUPEE_ORANGE,
|
|
|
|
/* 0x14 */ ITEM00_RUPEE_PURPLE,
|
|
|
|
/* 0x15 */ ITEM00_SHIELD_DEKU,
|
|
|
|
/* 0x16 */ ITEM00_SHIELD_HYLIAN,
|
|
|
|
/* 0x17 */ ITEM00_TUNIC_ZORA,
|
|
|
|
/* 0x18 */ ITEM00_TUNIC_GORON,
|
2022-03-10 20:21:46 +00:00
|
|
|
/* 0x19 */ ITEM00_BOMBS_SPECIAL,
|
2022-04-30 12:33:28 +00:00
|
|
|
/* 0x1A */ ITEM00_MAX,
|
2022-03-10 20:21:46 +00:00
|
|
|
/* 0xFF */ ITEM00_NONE = 0xFF
|
2020-07-12 23:03:38 +00:00
|
|
|
} Item00Type;
|
|
|
|
|
|
|
|
struct EnItem00;
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
typedef void (*EnItem00ActionFunc)(struct EnItem00*, struct PlayState*);
|
2020-07-12 23:03:38 +00:00
|
|
|
|
|
|
|
typedef struct EnItem00 {
|
|
|
|
/* 0x000 */ Actor actor;
|
|
|
|
/* 0x14C */ EnItem00ActionFunc actionFunc;
|
|
|
|
/* 0x150 */ s16 collectibleFlag;
|
2021-08-04 16:41:56 +00:00
|
|
|
/* 0x152 */ s16 getItemId;
|
2020-07-12 23:03:38 +00:00
|
|
|
/* 0x154 */ s16 unk_154;
|
|
|
|
/* 0x156 */ s16 unk_156;
|
|
|
|
/* 0x158 */ s16 unk_158;
|
2022-06-12 23:15:15 +00:00
|
|
|
/* 0x15A */ s16 despawnTimer;
|
2021-08-04 16:41:56 +00:00
|
|
|
/* 0x15C */ f32 scale;
|
2020-07-12 23:03:38 +00:00
|
|
|
/* 0x160 */ ColliderCylinder collider;
|
|
|
|
} EnItem00; // size = 0x1AC
|
|
|
|
|
2021-10-22 19:54:30 +00:00
|
|
|
// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files.
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum AObjType {
|
2020-07-12 23:03:38 +00:00
|
|
|
/* 0x00 */ A_OBJ_BLOCK_SMALL,
|
|
|
|
/* 0x01 */ A_OBJ_BLOCK_LARGE,
|
|
|
|
/* 0x02 */ A_OBJ_BLOCK_HUGE,
|
|
|
|
/* 0x03 */ A_OBJ_BLOCK_SMALL_ROT,
|
|
|
|
/* 0x04 */ A_OBJ_BLOCK_LARGE_ROT,
|
|
|
|
/* 0x05 */ A_OBJ_CUBE_SMALL,
|
|
|
|
/* 0x06 */ A_OBJ_UNKNOWN_6,
|
|
|
|
/* 0x07 */ A_OBJ_GRASS_CLUMP,
|
|
|
|
/* 0x08 */ A_OBJ_TREE_STUMP,
|
|
|
|
/* 0x09 */ A_OBJ_SIGNPOST_OBLONG,
|
|
|
|
/* 0x0A */ A_OBJ_SIGNPOST_ARROW,
|
2021-10-22 19:54:30 +00:00
|
|
|
/* 0x0B */ A_OBJ_BOULDER_FRAGMENT,
|
|
|
|
/* 0x0C */ A_OBJ_MAX
|
2020-07-12 23:03:38 +00:00
|
|
|
} AObjType;
|
|
|
|
|
|
|
|
struct EnAObj;
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
typedef void (*EnAObjActionFunc)(struct EnAObj*, struct PlayState*);
|
2020-07-12 23:03:38 +00:00
|
|
|
|
|
|
|
typedef struct EnAObj {
|
|
|
|
/* 0x000 */ DynaPolyActor dyna;
|
|
|
|
/* 0x164 */ EnAObjActionFunc actionFunc;
|
2021-10-22 19:54:30 +00:00
|
|
|
/* 0x168 */ s32 rotateWaitTimer;
|
2020-07-12 23:03:38 +00:00
|
|
|
/* 0x16C */ s16 textId;
|
2021-10-22 19:54:30 +00:00
|
|
|
/* 0x16E */ s16 rotateState;
|
|
|
|
/* 0x170 */ s16 rotateForTimer;
|
|
|
|
/* 0x172 */ s16 rotSpeedY;
|
|
|
|
/* 0x174 */ s16 rotSpeedX;
|
|
|
|
/* 0x178 */ f32 focusYoffset;
|
2020-07-12 23:03:38 +00:00
|
|
|
/* 0x17C */ ColliderCylinder collider;
|
|
|
|
} EnAObj; // size = 0x1C8
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum ActorCategory {
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x00 */ ACTORCAT_SWITCH,
|
|
|
|
/* 0x01 */ ACTORCAT_BG,
|
|
|
|
/* 0x02 */ ACTORCAT_PLAYER,
|
|
|
|
/* 0x03 */ ACTORCAT_EXPLOSIVE,
|
|
|
|
/* 0x04 */ ACTORCAT_NPC,
|
|
|
|
/* 0x05 */ ACTORCAT_ENEMY,
|
|
|
|
/* 0x06 */ ACTORCAT_PROP,
|
|
|
|
/* 0x07 */ ACTORCAT_ITEMACTION,
|
|
|
|
/* 0x08 */ ACTORCAT_MISC,
|
|
|
|
/* 0x09 */ ACTORCAT_BOSS,
|
|
|
|
/* 0x0A */ ACTORCAT_DOOR,
|
2022-01-17 20:30:30 +00:00
|
|
|
/* 0x0B */ ACTORCAT_CHEST,
|
|
|
|
/* 0x0C */ ACTORCAT_MAX
|
2021-01-18 21:04:04 +00:00
|
|
|
} ActorCategory;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-06-06 19:51:03 +00:00
|
|
|
#define DEFINE_ACTOR(_0, enum, _2, _3) enum,
|
|
|
|
#define DEFINE_ACTOR_INTERNAL(_0, enum, _2, _3) enum,
|
2021-08-30 01:24:32 +00:00
|
|
|
#define DEFINE_ACTOR_UNSET(enum) enum,
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum ActorID {
|
2021-08-30 01:24:32 +00:00
|
|
|
#include "tables/actor_table.h"
|
|
|
|
/* 0x0192 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX"
|
2020-03-17 04:31:30 +00:00
|
|
|
} ActorID;
|
|
|
|
|
2021-08-30 01:24:32 +00:00
|
|
|
#undef DEFINE_ACTOR
|
|
|
|
#undef DEFINE_ACTOR_INTERNAL
|
|
|
|
#undef DEFINE_ACTOR_UNSET
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum DoorLockType {
|
2021-12-02 00:32:23 +00:00
|
|
|
DOORLOCK_NORMAL,
|
|
|
|
DOORLOCK_BOSS,
|
|
|
|
DOORLOCK_NORMAL_SPIRIT
|
|
|
|
} DoorLockType;
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum NaviEnemy {
|
2022-04-18 22:23:12 +00:00
|
|
|
/* 0x00 */ NAVI_ENEMY_DEFAULT,
|
|
|
|
/* 0x01 */ NAVI_ENEMY_GOHMA,
|
|
|
|
/* 0x02 */ NAVI_ENEMY_GOHMA_EGG,
|
|
|
|
/* 0x03 */ NAVI_ENEMY_GOHMA_LARVA,
|
|
|
|
/* 0x04 */ NAVI_ENEMY_SKULLTULA,
|
|
|
|
/* 0x05 */ NAVI_ENEMY_BIG_SKULLTULA,
|
|
|
|
/* 0x06 */ NAVI_ENEMY_TAILPASARAN,
|
|
|
|
/* 0x07 */ NAVI_ENEMY_DEKU_BABA,
|
|
|
|
/* 0x08 */ NAVI_ENEMY_BIG_DEKU_BABA,
|
|
|
|
/* 0x09 */ NAVI_ENEMY_WITHERED_DEKU_BABA,
|
|
|
|
/* 0x0A */ NAVI_ENEMY_DEKU_SCRUB,
|
|
|
|
/* 0x0B */ NAVI_ENEMY_UNUSED_B,
|
|
|
|
/* 0x0C */ NAVI_ENEMY_KING_DODONGO,
|
|
|
|
/* 0x0D */ NAVI_ENEMY_DODONGO,
|
|
|
|
/* 0x0E */ NAVI_ENEMY_BABY_DODONGO,
|
|
|
|
/* 0x0F */ NAVI_ENEMY_LIZALFOS,
|
|
|
|
/* 0x10 */ NAVI_ENEMY_DINOLFOS,
|
|
|
|
/* 0x11 */ NAVI_ENEMY_FIRE_KEESE,
|
|
|
|
/* 0x12 */ NAVI_ENEMY_KEESE,
|
|
|
|
/* 0x13 */ NAVI_ENEMY_ARMOS,
|
|
|
|
/* 0x14 */ NAVI_ENEMY_BARINADE,
|
|
|
|
/* 0x15 */ NAVI_ENEMY_PARASITIC_TENTACLE,
|
|
|
|
/* 0x16 */ NAVI_ENEMY_SHABOM,
|
|
|
|
/* 0x17 */ NAVI_ENEMY_BIRI,
|
|
|
|
/* 0x18 */ NAVI_ENEMY_BARI,
|
|
|
|
/* 0x19 */ NAVI_ENEMY_STINGER,
|
|
|
|
/* 0x1A */ NAVI_ENEMY_PHANTOM_GANON_PHASE_2,
|
|
|
|
/* 0x1B */ NAVI_ENEMY_STALFOS,
|
|
|
|
/* 0x1C */ NAVI_ENEMY_BLUE_BUBBLE,
|
|
|
|
/* 0x1D */ NAVI_ENEMY_WHITE_BUBBLE,
|
|
|
|
/* 0x1E */ NAVI_ENEMY_GREEN_BUBBLE,
|
|
|
|
/* 0x1F */ NAVI_ENEMY_SKULLWALLTULA,
|
|
|
|
/* 0x20 */ NAVI_ENEMY_GOLD_SKULLTULA,
|
|
|
|
/* 0x21 */ NAVI_ENEMY_VOLVAGIA,
|
|
|
|
/* 0x22 */ NAVI_ENEMY_FLARE_DANCER,
|
|
|
|
/* 0x23 */ NAVI_ENEMY_TORCH_SLUG,
|
|
|
|
/* 0x24 */ NAVI_ENEMY_RED_BUBBLE,
|
|
|
|
/* 0x25 */ NAVI_ENEMY_MORPHA,
|
|
|
|
/* 0x26 */ NAVI_ENEMY_DARK_LINK,
|
|
|
|
/* 0x27 */ NAVI_ENEMY_SHELL_BLADE,
|
|
|
|
/* 0x28 */ NAVI_ENEMY_SPIKE,
|
|
|
|
/* 0x29 */ NAVI_ENEMY_BONGO_BONGO,
|
|
|
|
/* 0x2A */ NAVI_ENEMY_REDEAD,
|
|
|
|
/* 0x2B */ NAVI_ENEMY_PHANTOM_GANON_PHASE_1,
|
|
|
|
/* 0x2C */ NAVI_ENEMY_UNUSED_2C,
|
|
|
|
/* 0x2D */ NAVI_ENEMY_GIBDO,
|
|
|
|
/* 0x2E */ NAVI_ENEMY_DEAD_HANDS_HAND,
|
|
|
|
/* 0x2F */ NAVI_ENEMY_DEAD_HAND,
|
|
|
|
/* 0x30 */ NAVI_ENEMY_WALLMASTER,
|
|
|
|
/* 0x31 */ NAVI_ENEMY_FLOORMASTER,
|
|
|
|
/* 0x32 */ NAVI_ENEMY_TWINROVA_KOUME,
|
|
|
|
/* 0x33 */ NAVI_ENEMY_TWINROVA_KOTAKE,
|
|
|
|
/* 0x34 */ NAVI_ENEMY_IRON_KNUCKLE_NABOORU,
|
|
|
|
/* 0x35 */ NAVI_ENEMY_IRON_KNUCKLE,
|
|
|
|
/* 0x36 */ NAVI_ENEMY_SKULL_KID_ADULT,
|
|
|
|
/* 0x37 */ NAVI_ENEMY_LIKE_LIKE,
|
|
|
|
/* 0x38 */ NAVI_ENEMY_UNUSED_38,
|
|
|
|
/* 0x39 */ NAVI_ENEMY_BEAMOS,
|
|
|
|
/* 0x3A */ NAVI_ENEMY_ANUBIS,
|
|
|
|
/* 0x3B */ NAVI_ENEMY_FREEZARD,
|
|
|
|
/* 0x3C */ NAVI_ENEMY_UNUSED_3C,
|
|
|
|
/* 0x3D */ NAVI_ENEMY_GANONDORF,
|
|
|
|
/* 0x3E */ NAVI_ENEMY_GANON,
|
|
|
|
/* 0x3F */ NAVI_ENEMY_SKULL_KID,
|
|
|
|
/* 0x40 */ NAVI_ENEMY_SKULL_KID_FRIENDLY,
|
|
|
|
/* 0x41 */ NAVI_ENEMY_SKULL_KID_MASK,
|
|
|
|
/* 0x42 */ NAVI_ENEMY_OCTOROK,
|
|
|
|
/* 0x43 */ NAVI_ENEMY_POE_COMPOSER,
|
|
|
|
/* 0x44 */ NAVI_ENEMY_POE,
|
|
|
|
/* 0x45 */ NAVI_ENEMY_RED_TEKTITE,
|
|
|
|
/* 0x46 */ NAVI_ENEMY_BLUE_TEKTITE,
|
|
|
|
/* 0x47 */ NAVI_ENEMY_LEEVER,
|
|
|
|
/* 0x48 */ NAVI_ENEMY_PEAHAT,
|
|
|
|
/* 0x49 */ NAVI_ENEMY_PEAHAT_LARVA,
|
|
|
|
/* 0x4A */ NAVI_ENEMY_MOBLIN,
|
|
|
|
/* 0x4B */ NAVI_ENEMY_MOBLIN_CLUB,
|
|
|
|
/* 0x4C */ NAVI_ENEMY_WOLFOS,
|
|
|
|
/* 0x4D */ NAVI_ENEMY_MAD_SCRUB,
|
|
|
|
/* 0x4E */ NAVI_ENEMY_BUSINESS_SCRUB,
|
|
|
|
/* 0x4F */ NAVI_ENEMY_DAMPES_GHOST,
|
|
|
|
/* 0x50 */ NAVI_ENEMY_POE_SISTER_MEG,
|
|
|
|
/* 0x51 */ NAVI_ENEMY_POE_SISTER_JOELLE,
|
|
|
|
/* 0x52 */ NAVI_ENEMY_POE_SISTER_BETH,
|
|
|
|
/* 0x53 */ NAVI_ENEMY_POE_SISTER_AMY,
|
|
|
|
/* 0x54 */ NAVI_ENEMY_GERUDO_THIEF,
|
|
|
|
/* 0x55 */ NAVI_ENEMY_STALCHILD,
|
|
|
|
/* 0x56 */ NAVI_ENEMY_ICE_KEESE,
|
|
|
|
/* 0x57 */ NAVI_ENEMY_WHITE_WOLFOS,
|
|
|
|
/* 0x58 */ NAVI_ENEMY_GUAY,
|
|
|
|
/* 0x59 */ NAVI_ENEMY_BIGOCTO,
|
|
|
|
/* 0x5A */ NAVI_ENEMY_BIG_POE,
|
|
|
|
/* 0x5B */ NAVI_ENEMY_TWINROVA,
|
|
|
|
/* 0x5C */ NAVI_ENEMY_POE_WASTELAND,
|
|
|
|
/* 0xFF */ NAVI_ENEMY_NONE = 0xFF
|
|
|
|
} NaviEnemy;
|
|
|
|
|
2024-06-25 19:13:31 +00:00
|
|
|
typedef struct TargetContextEntry {
|
|
|
|
/* 0x00 */ Vec3f pos;
|
|
|
|
/* 0x0C */ f32 unk_0C; // radius?
|
|
|
|
/* 0x10 */ Color_RGB8 color;
|
|
|
|
} TargetContextEntry; // size = 0x14
|
|
|
|
|
|
|
|
typedef struct TargetContext {
|
|
|
|
/* 0x00 */ Vec3f naviRefPos; // possibly wrong
|
|
|
|
/* 0x0C */ Vec3f targetCenterPos;
|
|
|
|
/* 0x18 */ Color_RGBAf naviInner;
|
|
|
|
/* 0x28 */ Color_RGBAf naviOuter;
|
|
|
|
/* 0x38 */ Actor* arrowPointedActor;
|
|
|
|
/* 0x3C */ Actor* targetedActor;
|
|
|
|
/* 0x40 */ f32 unk_40;
|
|
|
|
/* 0x44 */ f32 unk_44;
|
|
|
|
/* 0x48 */ s16 unk_48;
|
|
|
|
/* 0x4A */ u8 activeCategory;
|
|
|
|
/* 0x4B */ u8 unk_4B;
|
|
|
|
/* 0x4C */ s8 unk_4C;
|
|
|
|
/* 0x4D */ char unk_4D[0x03];
|
|
|
|
/* 0x50 */ TargetContextEntry arr_50[3];
|
|
|
|
/* 0x8C */ Actor* unk_8C;
|
|
|
|
/* 0x90 */ Actor* bgmEnemy; // The nearest enemy to player with the right flags that will trigger NA_BGM_ENEMY
|
|
|
|
/* 0x94 */ Actor* unk_94;
|
|
|
|
} TargetContext; // size = 0x98
|
|
|
|
|
|
|
|
typedef struct TitleCardContext {
|
|
|
|
/* 0x00 */ void* texture;
|
|
|
|
/* 0x04 */ s16 x;
|
|
|
|
/* 0x06 */ s16 y;
|
|
|
|
/* 0x08 */ u8 width;
|
|
|
|
/* 0x09 */ u8 height;
|
|
|
|
/* 0x0A */ u8 durationTimer; // how long the title card appears for before fading
|
|
|
|
/* 0x0B */ u8 delayTimer; // how long the title card waits to appear
|
|
|
|
/* 0x0C */ s16 alpha;
|
|
|
|
/* 0x0E */ s16 intensity;
|
|
|
|
} TitleCardContext; // size = 0x10
|
|
|
|
|
|
|
|
typedef struct ActorListEntry {
|
|
|
|
/* 0x00 */ s32 length; // number of actors loaded of this category
|
|
|
|
/* 0x04 */ Actor* head; // pointer to head of the linked list of this category (most recent actor added)
|
|
|
|
} ActorListEntry; // size = 0x08
|
|
|
|
|
|
|
|
typedef struct ActorContextSceneFlags {
|
|
|
|
/* 0x00 */ u32 swch;
|
|
|
|
/* 0x04 */ u32 tempSwch;
|
|
|
|
/* 0x08 */ u32 unk0;
|
|
|
|
/* 0x0C */ u32 unk1;
|
|
|
|
/* 0x10 */ u32 chest;
|
|
|
|
/* 0x14 */ u32 clear;
|
|
|
|
/* 0x18 */ u32 tempClear;
|
|
|
|
/* 0x1C */ u32 collect;
|
|
|
|
/* 0x20 */ u32 tempCollect;
|
|
|
|
} ActorContextSceneFlags; // size = 0x24
|
|
|
|
|
|
|
|
typedef struct ActorContext {
|
|
|
|
/* 0x000 */ u8 freezeFlashTimer;
|
|
|
|
/* 0x001 */ char unk_01[0x01];
|
|
|
|
/* 0x002 */ u8 unk_02;
|
|
|
|
/* 0x003 */ u8 lensActive;
|
|
|
|
/* 0x004 */ char unk_04[0x04];
|
|
|
|
/* 0x008 */ u8 total; // total number of actors loaded
|
|
|
|
/* 0x00C */ ActorListEntry actorLists[ACTORCAT_MAX];
|
|
|
|
/* 0x06C */ TargetContext targetCtx;
|
|
|
|
/* 0x104 */ ActorContextSceneFlags flags;
|
|
|
|
/* 0x128 */ TitleCardContext titleCtx;
|
|
|
|
/* 0x138 */ char unk_138[0x04];
|
|
|
|
/* 0x13C */ void* absoluteSpace; // Space used to allocate actor overlays with alloc type ACTOROVL_ALLOC_ABSOLUTE
|
|
|
|
} ActorContext; // size = 0x140
|
|
|
|
|
2022-07-31 00:57:44 +00:00
|
|
|
// EnDoor and DoorKiller share openAnim and playerIsOpening
|
|
|
|
// Due to alignment, a substruct cannot be used in the structs of these actors.
|
|
|
|
#define DOOR_ACTOR_BASE \
|
|
|
|
/* 0x0000 */ Actor actor; \
|
|
|
|
/* 0x014C */ SkelAnime skelAnime; \
|
|
|
|
/* 0x0190 */ u8 openAnim; \
|
|
|
|
/* 0x0191 */ u8 playerIsOpening
|
|
|
|
|
|
|
|
typedef struct DoorActorBase {
|
|
|
|
/* 0x0000 */ DOOR_ACTOR_BASE;
|
|
|
|
} DoorActorBase;
|
|
|
|
|
2022-12-19 01:42:24 +00:00
|
|
|
// DoorShutter and DoorGerudo share isActive
|
|
|
|
// Due to alignment, a substruct cannot be used in the structs of these actors.
|
|
|
|
#define SLIDING_DOOR_ACTOR_BASE \
|
|
|
|
/* 0x0000 */ DynaPolyActor dyna; \
|
|
|
|
/* 0x0164 */ s16 isActive // Set to true by player when using the door. Also a timer for niche cases in DoorShutter
|
|
|
|
|
|
|
|
typedef struct SlidingDoorActorBase {
|
|
|
|
/* 0x0000 */ SLIDING_DOOR_ACTOR_BASE;
|
|
|
|
} SlidingDoorActorBase;
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum DoorOpenAnim {
|
2022-07-31 00:57:44 +00:00
|
|
|
/* 0x00 */ DOOR_OPEN_ANIM_ADULT_L,
|
|
|
|
/* 0x01 */ DOOR_OPEN_ANIM_CHILD_L,
|
|
|
|
/* 0x02 */ DOOR_OPEN_ANIM_ADULT_R,
|
|
|
|
/* 0x03 */ DOOR_OPEN_ANIM_CHILD_R,
|
|
|
|
/* 0x04 */ DOOR_OPEN_ANIM_MAX
|
|
|
|
} DoorOpenAnim;
|
|
|
|
|
2022-02-20 23:41:55 +00:00
|
|
|
#define UPDBGCHECKINFO_FLAG_0 (1 << 0) // check wall
|
|
|
|
#define UPDBGCHECKINFO_FLAG_1 (1 << 1) // check ceiling
|
|
|
|
#define UPDBGCHECKINFO_FLAG_2 (1 << 2) // check floor and water
|
|
|
|
#define UPDBGCHECKINFO_FLAG_3 (1 << 3)
|
|
|
|
#define UPDBGCHECKINFO_FLAG_4 (1 << 4)
|
|
|
|
#define UPDBGCHECKINFO_FLAG_5 (1 << 5) // unused
|
|
|
|
#define UPDBGCHECKINFO_FLAG_6 (1 << 6) // disable water ripples
|
|
|
|
#define UPDBGCHECKINFO_FLAG_7 (1 << 7) // alternate wall check?
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum NpcTalkState {
|
2022-11-25 17:52:28 +00:00
|
|
|
/* 0x0 */ NPC_TALK_STATE_IDLE, // NPC not currently talking to player
|
|
|
|
/* 0x1 */ NPC_TALK_STATE_TALKING, // NPC is currently talking to player
|
|
|
|
/* 0x2 */ NPC_TALK_STATE_ACTION, // An NPC-defined action triggered in the conversation
|
|
|
|
/* 0x3 */ NPC_TALK_STATE_ITEM_GIVEN // NPC finished giving an item and text box is done
|
|
|
|
} NpcTalkState;
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef enum NpcTrackingMode {
|
2022-11-25 17:52:28 +00:00
|
|
|
/* 0x0 */ NPC_TRACKING_PLAYER_AUTO_TURN, // Determine tracking mode based on player position, see Npc_UpdateAutoTurn
|
|
|
|
/* 0x1 */ NPC_TRACKING_NONE, // Don't track the target (usually the player)
|
|
|
|
/* 0x2 */ NPC_TRACKING_HEAD_AND_TORSO, // Track target by turning the head and the torso
|
|
|
|
/* 0x3 */ NPC_TRACKING_HEAD, // Track target by turning the head
|
|
|
|
/* 0x4 */ NPC_TRACKING_FULL_BODY // Track target by turning the body, torso and head
|
|
|
|
} NpcTrackingMode;
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef struct NpcInteractInfo {
|
2022-11-25 17:52:28 +00:00
|
|
|
/* 0x00 */ s16 talkState;
|
|
|
|
/* 0x02 */ s16 trackingMode;
|
|
|
|
/* 0x04 */ s16 autoTurnTimer;
|
|
|
|
/* 0x06 */ s16 autoTurnState;
|
|
|
|
/* 0x08 */ Vec3s headRot;
|
|
|
|
/* 0x0E */ Vec3s torsoRot;
|
|
|
|
/* 0x14 */ f32 yOffset; // Y position offset to add to actor position when calculating angle to target
|
|
|
|
/* 0x18 */ Vec3f trackPos;
|
|
|
|
/* 0x24 */ char unk_24[0x4];
|
|
|
|
} NpcInteractInfo; // size = 0x28
|
|
|
|
|
2024-08-14 19:29:43 +00:00
|
|
|
// Converts a number of bits to a bitmask, helper for params macros
|
|
|
|
// e.g. 3 becomes 0b111 (7)
|
|
|
|
#define NBITS_TO_MASK(n) \
|
|
|
|
((1 << (n)) - 1)
|
|
|
|
|
|
|
|
// Extracts the `n`-bit value at position `s` in `p`, shifts then masks
|
|
|
|
// Unsigned variant, no possibility of sign extension
|
|
|
|
#define PARAMS_GET_U(p, s, n) \
|
|
|
|
(((p) >> (s)) & NBITS_TO_MASK(n))
|
|
|
|
|
|
|
|
// Extracts the `n`-bit value at position `s` in `p`, masks then shifts
|
|
|
|
// Signed variant, possibility of sign extension
|
|
|
|
#define PARAMS_GET_S(p, s, n) \
|
|
|
|
(((p) & (NBITS_TO_MASK(n) << (s))) >> (s))
|
|
|
|
|
|
|
|
// Extracts all bits past position `s` in `p`
|
|
|
|
#define PARAMS_GET_NOMASK(p, s) \
|
|
|
|
((p) >> (s))
|
|
|
|
|
|
|
|
// Extracts the `n`-bit value at position `s` in `p` without shifting it from its current position
|
|
|
|
#define PARAMS_GET_NOSHIFT(p, s, n) \
|
|
|
|
((p) & (NBITS_TO_MASK(n) << (s)))
|
|
|
|
|
|
|
|
// Generates a bitmask for bit position `s` of length `n`
|
|
|
|
#define PARAMS_MAKE_MASK(s, n) PARAMS_GET_NOSHIFT(~0, s, n)
|
|
|
|
|
|
|
|
#define TRANSITION_ACTOR_PARAMS_INDEX_SHIFT 10
|
|
|
|
#define GET_TRANSITION_ACTOR_INDEX(actor) PARAMS_GET_NOMASK((u16)(actor)->params, 10)
|
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
#endif
|