From 868029b213128eaa24d0b80f854f71704cfafe8c Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Wed, 12 Oct 2022 23:26:35 -0400 Subject: [PATCH 01/12] Import Camera Data (#1097) * import camera data * cleanup * easier-to-read cam-hud-visibility * PR Suggestions * fix camflag macros * fix bss * camera data summary * small cleanup * cleanup camera data * cam data mode enums --- include/functions.h | 112 +- include/variables.h | 391 +--- include/z64.h | 11 - include/z64bgcheck.h | 4 +- include/z64camera.h | 1270 ++++++++++- include/z64scene.h | 2 +- spec | 2 - src/boot_O2_g3/idle.c | 1 + src/code/z_camera.c | 198 +- src/code/z_camera_data.inc.c | 3810 ++++++++++++++++++++++++++++++++ tools/disasm/functions.txt | 142 +- tools/disasm/variables.txt | 592 ++--- tools/sizes/code_functions.csv | 142 +- 13 files changed, 5631 insertions(+), 1046 deletions(-) create mode 100644 src/code/z_camera_data.inc.c diff --git a/include/functions.h b/include/functions.h index f238824d5..0c5948ed8 100644 --- a/include/functions.h +++ b/include/functions.h @@ -960,115 +960,6 @@ s32 DynaPolyActor_IsInSwitchPressedState(DynaPolyActor* dynaActor); s32 DynaPolyActor_IsInHeavySwitchPressedState(DynaPolyActor* dynaActor); s32 DynaPolyActor_ValidateMove(PlayState* play, DynaPolyActor* dynaActor, s16 startRadius, s16 endRadius, s16 startHeight); -// void func_800CBC84(void); -// void func_800CBFA4(void); -// void func_800CC000(void); -// void func_800CC128(void); -// void func_800CC1C4(void); -// void func_800CC260(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6); -// void func_800CC488(void); -// void func_800CC56C(void); -// void func_800CC5C8(void); -// void Camera_GetBgCamOrActorCsCamSetting(void); -// void Camera_GetBgCamOrActorCsCamFuncData(void); -// void Camera_GetBgCamIndex(void); -// void Camera_GetWaterBoxBgCamSetting(void); -// void func_800CC938(void); -// void func_800CC958(void); -// void func_800CC9C0(void); -// void func_800CCCEC(void); -// void func_800CD04C(void); -// void func_800CD288(void); -// void func_800CD2E0(void); -// void func_800CD2F0(void); -// void func_800CD3E4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -// void func_800CD44C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5); -// void func_800CD634(void); -// void func_800CD6CC(void); -// void func_800CD6F8(void); -// void func_800CD834(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -// void func_800CDA14(void); -// void func_800CDB6C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6); -// void func_800CDE6C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE2 param_8); -// void func_800CE2B8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE2 param_9); -// void func_800CE5E0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5); -// void func_800CE79C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5); -// void func_800CE930(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5); -// void func_800CEAD8(void); -// void func_800CEC38(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -// void func_800CED90(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); -s32 Camera_ModeNop(Camera* camera); -s32 Camera_ModeNORM1(Camera* camera); -s32 Camera_ModeNORM2(Camera* camera); -s32 Camera_ModeNORM3(Camera* camera); -s32 Camera_ModeNORM4(Camera* camera); -s32 Camera_ModeNORM0(Camera* camera); -s32 Camera_ModePARA1(Camera* camera); -s32 Camera_ModePARA2(Camera* camera); -s32 Camera_ModePARA3(Camera* camera); -s32 Camera_ModePARA4(Camera* camera); -s32 Camera_ModePARA0(Camera* camera); -s32 Camera_ModeJUMP1(Camera* camera); -s32 Camera_ModeJUMP2(Camera* camera); -s32 Camera_ModeJUMP3(Camera* camera); -s32 Camera_ModeJUMP4(Camera* camera); -s32 Camera_ModeJUMP0(Camera* camera); -s32 Camera_ModeBATT1(Camera* camera); -s32 Camera_ModeBATT2(Camera* camera); -s32 Camera_ModeBATT3(Camera* camera); -s32 Camera_ModeBATT4(Camera* camera); -s32 Camera_ModeBATT0(Camera* camera); -s32 Camera_ModeKEEP1(Camera* camera); -s32 Camera_ModeKEEP2(Camera* camera); -s32 Camera_ModeKEEP3(Camera* camera); -s32 Camera_ModeKEEP4(Camera* camera); -// void func_800D7C44(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5, UNK_TYPE1 param_6, UNK_TYPE1 param_7, UNK_TYPE1 param_8, UNK_TYPE1 param_9, UNK_TYPE1 param_10, UNK_TYPE2 param_11, UNK_TYPE2 param_12); -s32 Camera_ModeKEEP0(Camera* camera); -s32 Camera_ModeFIXD1(Camera* camera); -s32 Camera_ModeFIXD2(Camera* camera); -s32 Camera_ModeFIXD3(Camera* camera); -s32 Camera_ModeFIXD4(Camera* camera); -s32 Camera_ModeFIXD0(Camera* camera); -s32 Camera_ModeSUBJ1(Camera* camera); -s32 Camera_ModeSUBJ2(Camera* camera); -s32 Camera_ModeSUBJ3(Camera* camera); -s32 Camera_ModeSUBJ4(Camera* camera); -s32 Camera_ModeSUBJ0(Camera* camera); -s32 Camera_ModeDATA0(Camera* camera); -s32 Camera_ModeDATA1(Camera* camera); -s32 Camera_ModeDATA2(Camera* camera); -s32 Camera_ModeDATA3(Camera* camera); -s32 Camera_ModeDATA4(Camera* camera); -s32 Camera_ModeUNIQ1(Camera* camera); -s32 Camera_ModeUNIQ2(Camera* camera); -s32 Camera_ModeUNIQ3(Camera* camera); -s32 Camera_ModeUNIQ4(Camera* camera); -s32 Camera_ModeUNIQ5(Camera* camera); -s32 Camera_ModeUNIQ0(Camera* camera); -s32 Camera_ModeUNIQ6(Camera* camera); -s32 Camera_ModeUNIQ7(Camera* camera); -s32 Camera_ModeUNIQ8(Camera* camera); -s32 Camera_ModeUNIQ9(Camera* camera); -s32 Camera_ModeDEMO1(Camera* camera); -s32 Camera_ModeDEMO2(Camera* camera); -s32 Camera_ModeDEMO3(Camera* camera); -s32 Camera_ModeDEMO4(Camera* camera); -s32 Camera_ModeDEMO5(Camera* camera); -s32 Camera_ModeDEMO6(Camera* camera); -s32 Camera_ModeDEMO7(Camera* camera); -s32 Camera_ModeDEMO8(Camera* camera); -s32 Camera_ModeDEMO9(Camera* camera); -s32 Camera_ModeDEMO0(Camera* camera); -s32 Camera_ModeSPEC0(Camera* camera); -s32 Camera_ModeSPEC1(Camera* camera); -s32 Camera_ModeSPEC2(Camera* camera); -s32 Camera_ModeSPEC3(Camera* camera); -s32 Camera_ModeSPEC4(Camera* camera); -s32 Camera_ModeSPEC5(Camera* camera); -s32 Camera_ModeSPEC6(Camera* camera); -s32 Camera_ModeSPEC7(Camera* camera); -s32 Camera_ModeSPEC8(Camera* camera); -s32 Camera_ModeSPEC9(Camera* camera); Camera* Camera_Alloc(View* view, CollisionContext* bg, PlayState* play); void Camera_Free(Camera* camera); void Camera_Init(Camera* camera, View* view, CollisionContext* bg, PlayState* play); @@ -1102,7 +993,7 @@ s32 Camera_SetViewParam(Camera* camera, s32 viewFlag, void* param); // UNK_TYPE4 func_800DFF44(void); s16 Camera_SetFlags(Camera* iParm1, s16 flags); s16 Camera_ClearFlags(Camera* camera, s16 flags); -s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamDataId, f32 arg3, s16 timer1, s16 timer2, s16 timer3); +s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, s16 timer3); s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera); // UNK_TYPE4 func_800E01AC(void); Vec3f* Camera_GetQuakeOffset(Vec3f* dst, Camera* camera); @@ -1113,6 +1004,7 @@ void Camera_SetToTrackActor(Camera* camera, Actor* actor); void Camera_SetTargetActor(Camera* camera, Actor* actor); f32 Camera_GetWaterYPos(Camera* camera); void func_800E0348(Camera* camera); + DamageTable* DamageTable_Get(s32 index); void DamageTable_Clear(DamageTable* damageTable); f32 CollisionCheck_GetDamageAndEffectOnBumper(Collider* at, ColliderInfo* atInfo, Collider* ac, ColliderInfo* acInfo, u32* effect); diff --git a/include/variables.h b/include/variables.h index e865f890e..e223fe65e 100644 --- a/include/variables.h +++ b/include/variables.h @@ -433,392 +433,7 @@ extern s32 gMaxActorId; extern BgCheckSceneSubdivisionEntry sSceneSubdivisionList[]; extern BgSpecialSceneMaxObjects sCustomDynapolyMem[]; // extern UNK_TYPE1 D_801B4708; -// extern UNK_TYPE1 D_801B4710; -// extern UNK_TYPE1 D_801B4738; -// extern UNK_TYPE1 D_801B4768; -// extern UNK_TYPE1 D_801B4798; -// extern UNK_TYPE1 D_801B47CC; -// extern UNK_TYPE1 D_801B47F0; -// extern UNK_TYPE1 D_801B4824; -// extern UNK_TYPE1 D_801B4848; -// extern UNK_TYPE1 D_801B486C; -// extern UNK_TYPE1 D_801B4890; -// extern UNK_TYPE1 D_801B48B0; -// extern UNK_TYPE1 D_801B48D4; -// extern UNK_TYPE1 D_801B48F8; -// extern UNK_TYPE1 D_801B491C; -// extern UNK_TYPE1 D_801B4944; -// extern UNK_TYPE1 D_801B4974; -// extern UNK_TYPE1 D_801B49A4; -// extern UNK_TYPE1 D_801B49D4; -// extern UNK_TYPE1 D_801B4A04; -// extern UNK_TYPE1 D_801B4A34; -// extern UNK_TYPE1 D_801B4A5C; -// extern UNK_TYPE1 D_801B4A8C; -// extern UNK_TYPE1 D_801B4ABC; -// extern UNK_TYPE1 D_801B4AE0; -// extern UNK_TYPE1 D_801B4B08; -// extern UNK_TYPE1 D_801B4B38; -// extern UNK_TYPE1 D_801B4B60; -// extern UNK_TYPE1 D_801B4B90; -// extern UNK_TYPE1 D_801B4BB8; -// extern UNK_TYPE1 D_801B4BDC; -// extern UNK_TYPE1 D_801B4C04; -// extern UNK_TYPE1 D_801B4C34; -// extern UNK_TYPE1 D_801B4C5C; -// extern UNK_TYPE1 D_801B4C84; -// extern UNK_TYPE1 D_801B4CAC; -// extern UNK_TYPE1 D_801B4CD4; -// extern UNK_TYPE1 D_801B4CFC; -// extern UNK_TYPE1 D_801B4D24; -// extern UNK_TYPE1 D_801B4D34; -// extern UNK_TYPE1 D_801B4D44; -// extern UNK_TYPE1 D_801B4D68; -// extern UNK_TYPE1 D_801B4D8C; -// extern UNK_TYPE1 D_801B4DB0; -// extern UNK_TYPE1 D_801B4DD4; -// extern UNK_TYPE1 D_801B4DF8; -// extern UNK_TYPE1 D_801B4E2C; -// extern UNK_TYPE1 D_801B4E5C; -// extern UNK_TYPE1 D_801B4E90; -// extern UNK_TYPE1 D_801B4EB4; -// extern UNK_TYPE1 D_801B4ED8; -// extern UNK_TYPE1 D_801B4EDC; -// extern UNK_TYPE1 D_801B4EE4; -// extern UNK_TYPE1 D_801B4EF0; -// extern UNK_TYPE1 D_801B4EF4; -// extern UNK_TYPE1 D_801B4EF8; -// extern UNK_TYPE1 D_801B4F20; -// extern UNK_TYPE1 D_801B4F50; -// extern UNK_TYPE1 D_801B4F78; -// extern UNK_TYPE1 D_801B4FA0; -// extern UNK_TYPE1 D_801B4FC8; -// extern UNK_TYPE1 D_801B4FF0; -// extern UNK_TYPE1 D_801B5018; -// extern UNK_TYPE1 D_801B5034; -// extern UNK_TYPE1 D_801B5050; -// extern UNK_TYPE1 D_801B506C; -// extern UNK_TYPE1 D_801B507C; -// extern UNK_TYPE1 D_801B5094; -// extern UNK_TYPE1 D_801B50BC; -// extern UNK_TYPE1 D_801B50EC; -// extern UNK_TYPE1 D_801B511C; -// extern UNK_TYPE1 D_801B5150; -// extern UNK_TYPE1 D_801B5180; -// extern UNK_TYPE1 D_801B51A8; -// extern UNK_TYPE1 D_801B51D8; -// extern UNK_TYPE1 D_801B51FC; -// extern UNK_TYPE1 D_801B5220; -// extern UNK_TYPE1 D_801B5250; -// extern UNK_TYPE1 D_801B5280; -// extern UNK_TYPE1 D_801B52B0; -// extern UNK_TYPE1 D_801B52E0; -// extern UNK_TYPE1 D_801B5308; -// extern UNK_TYPE1 D_801B5338; -// extern UNK_TYPE1 D_801B535C; -// extern UNK_TYPE1 D_801B5380; -// extern UNK_TYPE1 D_801B53A4; -// extern UNK_TYPE1 D_801B53C8; -// extern UNK_TYPE1 D_801B53EC; -// extern UNK_TYPE1 D_801B5410; -// extern UNK_TYPE1 D_801B5434; -// extern UNK_TYPE1 D_801B5458; -// extern UNK_TYPE1 D_801B547C; -// extern UNK_TYPE1 D_801B54A0; -// extern UNK_TYPE1 D_801B54C4; -// extern UNK_TYPE1 D_801B54E8; -// extern UNK_TYPE1 D_801B550C; -// extern UNK_TYPE1 D_801B5530; -// extern UNK_TYPE1 D_801B5554; -// extern UNK_TYPE1 D_801B5578; -// extern UNK_TYPE1 D_801B559C; -// extern UNK_TYPE1 D_801B55C0; -// extern UNK_TYPE1 D_801B55E4; -// extern UNK_TYPE1 D_801B5608; -// extern UNK_TYPE1 D_801B562C; -// extern UNK_TYPE1 D_801B5650; -// extern UNK_TYPE1 D_801B5674; -// extern UNK_TYPE1 D_801B5698; -// extern UNK_TYPE1 D_801B56BC; -// extern UNK_TYPE1 D_801B56E0; -// extern UNK_TYPE1 D_801B5704; -// extern UNK_TYPE1 D_801B5728; -// extern UNK_TYPE1 D_801B574C; -// extern UNK_TYPE1 D_801B5770; -// extern UNK_TYPE1 D_801B577C; -// extern UNK_TYPE1 D_801B57A4; -// extern UNK_TYPE1 D_801B57CC; -// extern UNK_TYPE1 D_801B57F4; -// extern UNK_TYPE1 D_801B5824; -// extern UNK_TYPE1 D_801B5834; -// extern UNK_TYPE1 D_801B5844; -// extern UNK_TYPE1 D_801B5864; -// extern UNK_TYPE1 D_801B5884; -// extern UNK_TYPE1 D_801B58A0; -// extern UNK_TYPE1 D_801B58BC; -// extern UNK_TYPE1 D_801B58D8; -// extern UNK_TYPE1 D_801B58F4; -// extern UNK_TYPE1 D_801B5904; -// extern UNK_TYPE1 D_801B5928; -// extern UNK_TYPE1 D_801B5950; -// extern UNK_TYPE1 D_801B5978; -// extern UNK_TYPE1 D_801B59A8; -// extern UNK_TYPE1 D_801B59D0; -// extern UNK_TYPE1 D_801B59F4; -// extern UNK_TYPE1 D_801B5A00; -// extern UNK_TYPE1 D_801B5A0C; -// extern UNK_TYPE1 D_801B5A30; -// extern UNK_TYPE1 D_801B5A64; -// extern UNK_TYPE1 D_801B5A94; -// extern UNK_TYPE1 D_801B5ABC; -// extern UNK_TYPE1 D_801B5AF0; -// extern UNK_TYPE1 D_801B5B18; -// extern UNK_TYPE1 D_801B5B40; -// extern UNK_TYPE1 D_801B5B70; -// extern UNK_TYPE1 D_801B5B98; -// extern UNK_TYPE1 D_801B5BC8; -// extern UNK_TYPE1 D_801B5BFC; -// extern UNK_TYPE1 D_801B5C30; -// extern UNK_TYPE1 D_801B5C58; -// extern UNK_TYPE1 D_801B5C80; -// extern UNK_TYPE1 D_801B5CB0; -// extern UNK_TYPE1 D_801B5CCC; -// extern UNK_TYPE1 D_801B5CE8; -// extern UNK_TYPE1 D_801B5D10; -// extern UNK_TYPE1 D_801B5D40; -// extern UNK_TYPE1 D_801B5D74; -// extern UNK_TYPE1 D_801B5D9C; -// extern UNK_TYPE1 D_801B5DC4; -// extern UNK_TYPE1 D_801B5DD4; -// extern UNK_TYPE1 D_801B5DFC; -// extern UNK_TYPE1 D_801B5E2C; -// extern UNK_TYPE1 D_801B5E48; -// extern UNK_TYPE1 D_801B5E64; -// extern UNK_TYPE1 D_801B5E8C; -// extern UNK_TYPE1 D_801B5EB4; -// extern UNK_TYPE1 D_801B5EDC; -// extern UNK_TYPE1 D_801B5F0C; -// extern UNK_TYPE1 D_801B5F34; -// extern UNK_TYPE1 D_801B5F5C; -// extern UNK_TYPE1 D_801B5F8C; -// extern UNK_TYPE1 D_801B5FB0; -// extern UNK_TYPE1 D_801B5FD4; -// extern UNK_TYPE1 D_801B5FF8; -// extern UNK_TYPE1 D_801B601C; -// extern UNK_TYPE1 D_801B6044; -// extern UNK_TYPE1 D_801B6074; -// extern UNK_TYPE1 D_801B60A4; -// extern UNK_TYPE1 D_801B60D8; -// extern UNK_TYPE1 D_801B610C; -// extern UNK_TYPE1 D_801B6130; -// extern UNK_TYPE1 D_801B6154; -// extern UNK_TYPE1 D_801B617C; -// extern UNK_TYPE1 D_801B61AC; -// extern UNK_TYPE1 D_801B61DC; -// extern UNK_TYPE1 D_801B620C; -// extern UNK_TYPE1 D_801B623C; -// extern UNK_TYPE1 D_801B626C; -// extern UNK_TYPE1 D_801B6294; -// extern UNK_TYPE1 D_801B62C4; -// extern UNK_TYPE1 D_801B62F4; -// extern UNK_TYPE1 D_801B631C; -// extern UNK_TYPE1 D_801B634C; -// extern UNK_TYPE1 D_801B6374; -// extern UNK_TYPE1 D_801B63A4; -// extern UNK_TYPE1 D_801B63CC; -// extern UNK_TYPE1 D_801B63FC; -// extern UNK_TYPE1 D_801B6418; -// extern UNK_TYPE1 D_801B6434; -// extern UNK_TYPE1 D_801B645C; -// extern UNK_TYPE1 D_801B648C; -// extern UNK_TYPE1 D_801B64B4; -// extern UNK_TYPE1 D_801B64D8; -// extern UNK_TYPE1 D_801B64FC; -// extern UNK_TYPE1 D_801B652C; -// extern UNK_TYPE1 D_801B655C; -// extern UNK_TYPE1 D_801B6584; -// extern UNK_TYPE1 D_801B65AC; -// extern UNK_TYPE1 D_801B65DC; -// extern UNK_TYPE1 D_801B660C; -// extern UNK_TYPE1 D_801B6640; -// extern UNK_TYPE1 D_801B6674; -// extern UNK_TYPE1 D_801B6698; -// extern UNK_TYPE1 D_801B66C0; -// extern UNK_TYPE1 D_801B66E8; -// extern UNK_TYPE1 D_801B6710; -// extern UNK_TYPE1 D_801B6740; -// extern UNK_TYPE1 D_801B6774; -// extern UNK_TYPE1 D_801B679C; -// extern UNK_TYPE1 D_801B67C4; -// extern UNK_TYPE1 D_801B67EC; -// extern UNK_TYPE1 D_801B681C; -// extern UNK_TYPE1 D_801B684C; -// extern UNK_TYPE1 D_801B6880; -// extern UNK_TYPE1 D_801B68A8; -// extern UNK_TYPE1 D_801B68D0; -// extern UNK_TYPE1 D_801B68F8; -// extern UNK_TYPE1 D_801B692C; -// extern UNK_TYPE1 D_801B6954; -// extern UNK_TYPE1 D_801B697C; -// extern UNK_TYPE1 D_801B69A4; -// extern UNK_TYPE1 D_801B69CC; -// extern UNK_TYPE1 D_801B69FC; -// extern UNK_TYPE1 D_801B6A30; -// extern UNK_TYPE1 D_801B6A58; -// extern UNK_TYPE1 D_801B6A80; -// extern UNK_TYPE1 D_801B6AA8; -// extern UNK_TYPE1 D_801B6AD0; -// extern UNK_TYPE1 D_801B6AF8; -// extern UNK_TYPE1 D_801B6B28; -// extern UNK_TYPE1 D_801B6B50; -// extern UNK_TYPE1 D_801B6B78; -// extern UNK_TYPE1 D_801B6BA0; -// extern UNK_TYPE1 D_801B6BC8; -// extern UNK_TYPE1 D_801B6BF0; -// extern UNK_TYPE1 D_801B6C18; -// extern UNK_TYPE1 D_801B6C48; -// extern UNK_TYPE1 D_801B6C70; -// extern UNK_TYPE1 D_801B6C98; -// extern UNK_TYPE1 D_801B6CC0; -// extern UNK_TYPE1 D_801B6CF0; -// extern UNK_TYPE1 D_801B6D24; -// extern UNK_TYPE1 D_801B6D4C; -// extern UNK_TYPE1 D_801B6D74; -// extern UNK_TYPE1 D_801B6D90; -// extern UNK_TYPE1 D_801B6DB8; -// extern UNK_TYPE1 D_801B6DE0; -// extern UNK_TYPE1 D_801B6E08; -// extern UNK_TYPE1 D_801B6E30; -// extern UNK_TYPE1 D_801B6E58; -// extern UNK_TYPE1 D_801B6E80; -// extern UNK_TYPE1 D_801B6EA8; -// extern UNK_TYPE1 D_801B6ED0; -// extern UNK_TYPE1 D_801B6EF8; -// extern UNK_TYPE1 D_801B6F20; -// extern UNK_TYPE1 D_801B6F50; -// extern UNK_TYPE1 D_801B6F78; -// extern UNK_TYPE1 D_801B6FA0; -// extern UNK_TYPE1 D_801B6FB0; -// extern UNK_TYPE1 D_801B6FD8; -// extern UNK_TYPE1 D_801B7008; -// extern UNK_TYPE1 D_801B703C; -// extern UNK_TYPE1 D_801B7064; -// extern UNK_TYPE1 D_801B708C; -// extern UNK_TYPE1 D_801B70BC; -// extern UNK_TYPE1 D_801B70E4; -// extern UNK_TYPE1 D_801B7114; -// extern UNK_TYPE1 D_801B7148; -// extern UNK_TYPE1 D_801B7170; -// extern UNK_TYPE1 D_801B71A0; -// extern UNK_TYPE1 D_801B71D4; -// extern UNK_TYPE1 D_801B7204; -// extern UNK_TYPE1 D_801B7210; -// extern UNK_TYPE1 D_801B7244; -// extern UNK_TYPE1 D_801B7278; -// extern UNK_TYPE1 D_801B729C; -// extern UNK_TYPE1 D_801B72C0; -// extern UNK_TYPE1 D_801B72E4; -// extern UNK_TYPE1 D_801B7308; -// extern UNK_TYPE1 D_801B732C; -// extern UNK_TYPE1 D_801B7354; -// extern UNK_TYPE1 D_801B7384; -// extern UNK_TYPE1 D_801B73AC; -// extern UNK_TYPE1 D_801B73D4; -// extern UNK_TYPE1 D_801B74C4; -// extern UNK_TYPE1 D_801B759C; -// extern UNK_TYPE1 D_801B75F4; -// extern UNK_TYPE1 D_801B767C; -// extern UNK_TYPE1 D_801B7684; -// extern UNK_TYPE1 D_801B768C; -// extern UNK_TYPE1 D_801B7694; -// extern UNK_TYPE1 D_801B769C; -// extern UNK_TYPE1 D_801B76A4; -// extern UNK_TYPE1 D_801B76AC; -// extern UNK_TYPE1 D_801B777C; -// extern UNK_TYPE1 D_801B784C; -// extern UNK_TYPE1 D_801B791C; -// extern UNK_TYPE1 D_801B7984; -// extern UNK_TYPE1 D_801B79EC; -// extern UNK_TYPE1 D_801B79F4; -// extern UNK_TYPE1 D_801B7AE4; -// extern UNK_TYPE1 D_801B7B14; -// extern UNK_TYPE1 D_801B7B44; -// extern UNK_TYPE1 D_801B7B74; -// extern UNK_TYPE1 D_801B7BA4; -// extern UNK_TYPE1 D_801B7BAC; -// extern UNK_TYPE1 D_801B7BDC; -// extern UNK_TYPE1 D_801B7C0C; -// extern UNK_TYPE1 D_801B7C3C; -// extern UNK_TYPE1 D_801B7C44; -// extern UNK_TYPE1 D_801B7C54; -// extern UNK_TYPE1 D_801B7C5C; -// extern UNK_TYPE1 D_801B7C64; -// extern UNK_TYPE1 D_801B7D34; -// extern UNK_TYPE1 D_801B7D3C; -// extern UNK_TYPE1 D_801B7D44; -// extern UNK_TYPE1 D_801B7D4C; -// extern UNK_TYPE1 D_801B7D54; -// extern UNK_TYPE1 D_801B7D5C; -// extern UNK_TYPE1 D_801B7D64; -// extern UNK_TYPE1 D_801B7DCC; -// extern UNK_TYPE1 D_801B7DD4; -// extern UNK_TYPE1 D_801B7E3C; -// extern UNK_TYPE1 D_801B7F0C; -// extern UNK_TYPE1 D_801B7F14; -// extern UNK_TYPE1 D_801B7F1C; -// extern UNK_TYPE1 D_801B7F24; -// extern UNK_TYPE1 D_801B7F2C; -// extern UNK_TYPE1 D_801B7F34; -// extern UNK_TYPE1 D_801B7F3C; -// extern UNK_TYPE1 D_801B7FAC; -// extern UNK_TYPE1 D_801B807C; -// extern UNK_TYPE1 D_801B8084; -// extern UNK_TYPE1 D_801B8154; -// extern UNK_TYPE1 D_801B8224; -// extern UNK_TYPE1 D_801B82F4; -// extern UNK_TYPE1 D_801B82FC; -// extern UNK_TYPE1 D_801B8304; -// extern UNK_TYPE1 D_801B83D4; -// extern UNK_TYPE1 D_801B83DC; -// extern UNK_TYPE1 D_801B8434; -// extern UNK_TYPE1 D_801B843C; -// extern UNK_TYPE1 D_801B8444; -// extern UNK_TYPE1 D_801B8514; -// extern UNK_TYPE1 D_801B85E4; -// extern UNK_TYPE1 D_801B8664; -// extern UNK_TYPE1 D_801B8754; -// extern UNK_TYPE1 D_801B875C; -// extern UNK_TYPE1 D_801B87C4; -// extern UNK_TYPE1 D_801B8894; -// extern UNK_TYPE1 D_801B8964; -// extern UNK_TYPE1 D_801B8A34; -// extern UNK_TYPE1 D_801B8B04; -// extern UNK_TYPE1 D_801B8BD4; -// extern UNK_TYPE1 D_801B8CAC; -// extern UNK_TYPE1 D_801B8CB4; -// extern UNK_TYPE1 D_801B8D8C; -// extern UNK_TYPE1 D_801B8E5C; -// extern UNK_TYPE1 D_801B8F2C; -// extern UNK_TYPE1 D_801B8F34; -// extern UNK_TYPE1 D_801B900C; -// extern UNK_TYPE1 D_801B90D4; -// extern UNK_TYPE1 D_801B91A4; -// extern UNK_TYPE1 D_801B91AC; -// extern UNK_TYPE1 D_801B927C; -// extern UNK_TYPE1 D_801B9354; -// extern UNK_TYPE1 D_801B9424; -// extern UNK_TYPE1 D_801B94F4; -// extern UNK_TYPE1 D_801B95C4; -// extern UNK_TYPE1 D_801B95CC; -// extern UNK_TYPE1 D_801B969C; -// extern UNK_TYPE1 D_801B976C; -// extern UNK_TYPE1 D_801B979C; -// extern CameraStateParams cameraStates[91]; -// extern UNK_TYPE1 D_801B9CE2; -// extern UNK_PTR D_801B9CE4; -// extern camera_update_func cameraUpdateFuncs[71]; -// extern UNK_TYPE2 D_801B9E04; -// extern UNK_TYPE4 D_801B9E08; + // extern UNK_TYPE4 D_801B9E0C; // extern UNK_TYPE4 D_801B9E10; // extern UNK_TYPE4 D_801B9E14; @@ -833,8 +448,8 @@ extern BgSpecialSceneMaxObjects sCustomDynapolyMem[]; // extern UNK_TYPE1 D_801B9E84; // extern UNK_TYPE4 D_801B9EB4; // extern UNK_TYPE4 D_801B9ED4; -// extern UNK_TYPE4 D_801B9F04; -// extern UNK_TYPE2 D_801B9F0C; +// extern UNK_TYPE4 sEarthquakeFreq; +// extern UNK_TYPE2 sEarthquakeTimer; extern UNK_TYPE4 D_801B9F10; extern DamageTable sDamageTablePresets[23]; extern f32 damageMultipliers[16]; diff --git a/include/z64.h b/include/z64.h index b18ab8d86..dc01a5dc7 100644 --- a/include/z64.h +++ b/include/z64.h @@ -111,17 +111,6 @@ typedef struct { /* 0x8 */ void* end; } PolygonType2; // size = 0xC -typedef struct { - /* 0x0 */ s16 func; - /* 0x2 */ UNK_TYPE1 pad2[0x6]; -} CameraModeParams; // size = 0x8 - -typedef struct { - /* 0x0 */ u32 validModes; - /* 0x4 */ UNK_TYPE1 pad4[0x4]; - /* 0x8 */ CameraModeParams* modes; -} CameraStateParams; // size = 0xC - typedef struct { /* 0x0 */ s16 x; /* 0x2 */ s16 y; diff --git a/include/z64bgcheck.h b/include/z64bgcheck.h index c2a9bab7c..ad5d4c4fb 100644 --- a/include/z64bgcheck.h +++ b/include/z64bgcheck.h @@ -108,7 +108,7 @@ typedef struct { // 0x0008_0000 = ? // 0x0007_E000 = room index, 0x3F = all rooms // 0x0000_1F00 = lighting setting index - // 0x0000_00FF = CamData index + // 0x0000_00FF = bgCam index } WaterBox; // size = 0x10 typedef struct { @@ -122,7 +122,7 @@ typedef struct { // 0x001C_0000 = ? // 0x0003_E000 = ? // 0x0000_1F00 = scene exit index - // 0x0000_00FF = CamData index + // 0x0000_00FF = bgCam index // Word 1 // 0x0800_0000 = wall damage // 0x07E0_0000 = conveyor direction diff --git a/include/z64camera.h b/include/z64camera.h index e3b3a4483..9c101bf73 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -2,6 +2,7 @@ #define Z64CAMERA_H #include "ultra64.h" +#include "z64save.h" // these two angle conversion macros are slightly inaccurate #define CAM_DEG_TO_BINANG(degrees) (s16)((degrees) * ((f32)0xFFFF / 360) + .5f) @@ -16,6 +17,72 @@ #define SUB_CAM_ID_DONE 0 // Used in some actors for variables holding sub camera IDs to indicate "subcam is finished" +#define CAM_HUD_VISIBILITY_SHIFT 8 +#define CAM_HUD_VISIBILITY_MASK (0x0F00) +#define CAM_HUD_VISIBILITY(hudVisibility) (((hudVisibility) & 0xF) << CAM_HUD_VISIBILITY_SHIFT) + +#define CAM_HUD_VISIBILITY_ALL \ + CAM_HUD_VISIBILITY(0) // HUD_VISIBILITY_ALL +#define CAM_HUD_VISIBILITY_NONE \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_NONE) +#define CAM_HUD_VISIBILITY_NONE_ALT \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_NONE_ALT) +#define CAM_HUD_VISIBILITY_HEARTS_WITH_OVERWRITE \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_WITH_OVERWRITE) +#define CAM_HUD_VISIBILITY_A \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_A) +#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE) +#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_WITH_OVERWRITE \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_WITH_OVERWRITE) +#define CAM_HUD_VISIBILITY_ALL_NO_MINIMAP_W_DISABLED \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_ALL_NO_MINIMAP_W_DISABLED) +#define CAM_HUD_VISIBILITY_B \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_B) +#define CAM_HUD_VISIBILITY_HEARTS_MAGIC \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_MAGIC) +#define CAM_HUD_VISIBILITY_B_ALT \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_B_ALT) +#define CAM_HUD_VISIBILITY_HEARTS \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS) +#define CAM_HUD_VISIBILITY_A_B_MINIMAP \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_A_B_MINIMAP) +#define CAM_HUD_VISIBILITY_HEARTS_MAGIC_WITH_OVERWRITE \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_MAGIC_WITH_OVERWRITE) +#define CAM_HUD_VISIBILITY_HEARTS_MAGIC_C \ + CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_MAGIC_C) +// HUD_VISIBILITY_ALL_NO_MINIMAP and above can not be set using `CAM_HUD_VISIBILITY` +#define CAM_HUD_VISIBILITY_IGNORE \ + CAM_HUD_VISIBILITY(0xF) + +/** + * letterboxFlag: determines the size of the letter-box window. See CAM_LETTERBOX_* enums. + * Can also add on the flag ( | CAM_LETTERBOX_INSTANT) to make the size change immediately + * hudVisibility: hides certain hud icons + * - A value of 0 in camera is translated to a hudVisibility of 50, + * which is the value to restore all hud icons to the screen (CAM_HUD_VISIBILITY_ALL) + * - A value of 0xF in camera results in no change in the hudVisibility (CAM_HUD_VISIBILITY_IGNORE) + * funcFlags: Custom flags for functions + */ +#define CAM_INTERFACE_FLAGS(letterboxFlag, hudVisibility, funcFlags) \ + (((letterboxFlag) & CAM_LETTERBOX_MASK) | (hudVisibility) | ((funcFlags) & 0xFF)) + +// Shrinking the window from the top and bottom with black borders (letterboxing) +#define CAM_LETTERBOX_MASK 0xF000 + +#define CAM_LETTERBOX_SIZE_MASK 0x7000 +#define CAM_LETTERBOX_NONE 0x0000 +// small/medium/large black borders +#define CAM_LETTERBOX_SMALL 0x1000 +#define CAM_LETTERBOX_MEDIUM 0x2000 +#define CAM_LETTERBOX_LARGE 0x3000 +#define CAM_LETTERBOX_NONE_4 0x4000 + +#define CAM_LETTERBOX_INSTANT 0x8000 // Bit to determine whether to set the current value directly (on), or to set the size target (off) + +#define CAM_LETTERBOX_IGNORE 0xF000 // No change in letterbox size, keep the previous size + + // Camera behaviorFlags. Flags specifically for settings, modes, and bgCam // Used to store current state, only CAM_BEHAVIOR_SETTING_1 and CAM_BEHAVIOR_BG_2 are read from and used in logic // Setting (0x1, 0x10) @@ -280,9 +347,9 @@ typedef enum { /* 0x04 */ CAM_DATA_04, /* 0x05 */ CAM_DATA_05, /* 0x06 */ CAM_DATA_06, - /* 0x07 */ CAM_DATA_07, + /* 0x07 */ CAM_DATA_FOV, /* 0x08 */ CAM_DATA_08, - /* 0x09 */ CAM_DATA_09, + /* 0x09 */ CAM_DATA_INTERFACE_FLAGS, /* 0x0A */ CAM_DATA_10, /* 0x0B */ CAM_DATA_11, /* 0x0C */ CAM_DATA_12, @@ -297,31 +364,1188 @@ typedef enum { /* 0x15 */ CAM_DATA_21, } CameraDataType; -typedef struct { - /* 0x0 */ s16 val; - /* 0x2 */ s16 param; -} CameraModeValue; // size = 0x4 - -typedef struct { - /* 0x0 */ s16 funcId; - /* 0x2 */ s16 numValues; - /* 0x4 */ CameraModeValue* values; -} CameraMode; // size = 0x8 - -/** - * Flags: - * (flags & 0xF): Priority (lower value has higher priority) - * (flags & 0x40000000): Store previous setting and bgCamData, also ignores water checks - * (flags & 0x80000000): Set camera setting based on bg/scene data and reset action function state +/*================================ + * MISC DATA + *================================ */ + +// Camera Collision Check typedef struct { - /* 0x0 */ u32 validModes; - /* 0x4 */ u32 flags; - /* 0x8 */ CameraMode* cameraModes; -} CameraSetting; // size = 0xC + /* 0x00 */ Vec3f pos; + /* 0x0C */ Vec3f norm; + /* 0x18 */ CollisionPoly* poly; + /* 0x1C */ VecSph sphNorm; + /* 0x24 */ s32 bgId; +} CameraCollision; // size = 0x28 + +typedef struct { + /* 0x00 */ Vec3f collisionClosePoint; + /* 0x0C */ CameraCollision atEyeColChk; + /* 0x34 */ CameraCollision eyeAtColChk; + /* 0x5C */ f32 swingUpdateRate; + /* 0x60 */ s16 pitch; + /* 0x62 */ s16 yaw; + /* 0x64 */ s16 unk_64; + /* 0x66 */ s16 timer; // startSwingTimer +} SwingAnimation; // size = 0x68 + + +/*================================ + * Camera Update-Function Data + *================================ + */ + +#define CAM_FUNCDATA_INTERFACE_FLAGS(interfaceFlags) \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + + +/*================================ + * Camera_Normal1() Data + *================================ + */ + +#define CAM_FUNCDATA_NORM1(yOffset, data01, data02, pitchTarget, eyeStepScale, posStepScale, yawDiffRange, fov, data08, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { pitchTarget, CAM_DATA_03 }, \ + { eyeStepScale, CAM_DATA_04 }, \ + { posStepScale, CAM_DATA_05 }, \ + { yawDiffRange, CAM_DATA_06 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 unk_00; // yOffset + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; // attenuationYawDiffRange + /* 0x18 */ f32 unk_18; // fovTarget + /* 0x1C */ f32 unk_1C; + /* 0x20 */ s16 unk_20; // pitchTarget + /* 0x22 */ s16 interfaceFlags; +} Normal1ReadOnlyData; // size = 0x24 + +typedef struct { + /* 0x00 */ f32 unk_00; // yPos + /* 0x04 */ f32 unk_04; // xzSpeed + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; // angle + /* 0x0C */ s16 unk_0C; // flags (May be s32) + /* 0x0E */ s16 unk_0E; + /* 0x10 */ f32 unk_10; // set to float +} Normal1ReadWriteData; // size = 0x14 + +typedef struct { + /* 0x00 */ Normal1ReadOnlyData roData; + /* 0x24 */ Normal1ReadWriteData rwData; +} Normal1; // size = 0x38 + +#define NORMAL1_FLAG_0 (1 << 0) +#define NORMAL1_FLAG_1 (1 << 1) +#define NORMAL1_FLAG_2 (1 << 2) +#define NORMAL1_FLAG_3 (1 << 3) +#define NORMAL1_FLAG_4 (1 << 4) +#define NORMAL1_FLAG_5 (1 << 5) +#define NORMAL1_FLAG_6 (1 << 6) +#define NORMAL1_FLAG_7 (1 << 7) + + +/*================================ + * Camera_Normal2() Data + *================================ + */ + +// Unused Camera RemoteBomb Setting + +#define CAM_FUNCDATA_NORM2(yOffset, data01, data02, pitchTarget, data04, fov, data08, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { pitchTarget, CAM_DATA_03 }, \ + { data04, CAM_DATA_04 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +#define NORMAL2_FLAG_1 (1 << 1) + + +/*================================ + * Camera_Normal3() Data + *================================ + */ + +#define CAM_FUNCDATA_NORM3(yOffset, data01, data02, pitchTarget, eyeStepScale, posStepScale, fov, data08, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { pitchTarget, CAM_DATA_03 }, \ + { eyeStepScale, CAM_DATA_04 }, \ + { posStepScale, CAM_DATA_05 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 yOffset; + /* 0x04 */ f32 distMin; + /* 0x08 */ f32 distMax; + /* 0x0C */ f32 yawUpdateRateInv; + /* 0x10 */ f32 pitchUpdateRateInv; + /* 0x14 */ f32 fovTarget; + /* 0x18 */ f32 maxAtLERPScale; + /* 0x1C */ s16 pitchTarget; + /* 0x1E */ s16 interfaceFlags; +} Normal3ReadOnlyData; // size = 0x20 + +typedef struct { + /* 0x00 */ f32 isZero; // set but unused + /* 0x04 */ f32 yPosOffset; + /* 0x08 */ s16 curPitch; + /* 0x0A */ s16 yawUpdateRate; + /* 0x0C */ s16 yawTimer; + /* 0x0E */ s16 distTimer; + /* 0x10 */ s16 flag; + /* 0x12 */ s16 is1200; // set but unused +} Normal3ReadWriteData; // size = 0x14 + +typedef struct { + /* 0x00 */ Normal3ReadOnlyData roData; + /* 0x20 */ Normal3ReadWriteData rwData; +} Normal3; // size = 0x34 + +#define NORMAL3_FLAG_1 (1 << 1) +#define NORMAL3_FLAG_5 (1 << 5) +#define NORMAL3_FLAG_6 (1 << 6) +#define NORMAL3_FLAG_7 (1 << 7) + + +/*================================ + * Camera_Normal0() Data + *================================ + */ + +#define CAM_FUNCDATA_NORM0(yOffset, data01, data02, data21, data04, yawDiffRange, fov, data08, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { data21, CAM_DATA_21 }, \ + { data04, CAM_DATA_04 }, \ + { yawDiffRange, CAM_DATA_06 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ s16 unk_1C; + /* 0x1E */ s16 interfaceFlags; +} Normal0ReadOnlyData; // size = 0x20 + +typedef struct { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ Vec3f unk_0C; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ s16 unk_20; + /* 0x22 */ s16 unk_22; + /* 0x24 */ f32 unk_24; + /* 0x28 */ f32 unk_28; + /* 0x2C */ s16 unk_2C; +} Normal0ReadWriteData; // size = 0x30 + +typedef struct { + /* 0x00 */ Normal0ReadOnlyData roData; + /* 0x20 */ Normal0ReadWriteData rwData; +} Normal0; // size = 0x50 + +#define NORMAL0_FLAG_0 (1 << 0) +#define NORMAL0_FLAG_2 (1 << 2) +#define NORMAL0_FLAG_4 (1 << 4) +#define NORMAL0_FLAG_7 (1 << 7) + + +/*================================ + * Camera_Parallel1() Data + *================================ + */ + +#define CAM_FUNCDATA_PARA1(yOffset, data01, data02, pitchTarget, data10, data04, data05, fov, data08, interfaceFlags, data11, data12) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { pitchTarget, CAM_DATA_03 }, \ + { data10, CAM_DATA_10 }, \ + { data04, CAM_DATA_04 }, \ + { data05, CAM_DATA_05 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS }, \ + { data11, CAM_DATA_11 }, \ + { data12, CAM_DATA_12 } + +// Same as above but with extra unused entry +#define CAM_FUNCDATA_PARA1_ALT(yOffset, data01, data02, pitchTarget, data10, data04, data05, fov, data08, interfaceFlags, data11, data12, data18) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { pitchTarget, CAM_DATA_03 }, \ + { data10, CAM_DATA_10 }, \ + { data04, CAM_DATA_04 }, \ + { data05, CAM_DATA_05 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS }, \ + { data11, CAM_DATA_11 }, \ + { data12, CAM_DATA_12 }, \ + { data18, CAM_DATA_18 } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ s16 unk_20; + /* 0x22 */ s16 unk_22; + /* 0x24 */ s16 unk_24; + /* 0x26 */ s16 interfaceFlags; +} Parallel1ReadOnlyData; // size = 0x28 + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 timer1; + /* 0x10 */ Vec3f unk_10; + /* 0x1C */ s16 unk_1C; + /* 0x1E */ s16 unk_1E; + /* 0x20 */ s16 unk_20; + /* 0x22 */ s16 timer2; + /* 0x24 */ s16 timer3; + /* 0x26 */ s16 unk_26; +} Parallel1ReadWriteData; // size = 0x28 + +typedef struct { + /* 0x00 */ Parallel1ReadOnlyData roData; + /* 0x28 */ Parallel1ReadWriteData rwData; +} Parallel1; // size = 0x50 + +#define PARALLEL1_FLAG_0 (1 << 0) +#define PARALLEL1_FLAG_1 (1 << 1) +#define PARALLEL1_FLAG_2 (1 << 2) +#define PARALLEL1_FLAG_3 (1 << 3) +#define PARALLEL1_FLAG_4 (1 << 4) +#define PARALLEL1_FLAG_5 (1 << 5) +#define PARALLEL1_FLAG_6 (1 << 6) +#define PARALLEL1_FLAG_7 (1 << 7) + + +/*================================ + * Camera_Parallel2() Data + *================================ + */ + +// Unused Camera Maze Setting + +#define CAM_FUNCDATA_PARA2(yOffset, data02, data01, pitchTarget, data04, fov, data08, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data02, CAM_DATA_02 }, \ + { data01, CAM_DATA_01 }, \ + { pitchTarget, CAM_DATA_03 }, \ + { data04, CAM_DATA_04 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +#define PARALLEL2_FLAG_1 (1 << 1) + + +/*================================ + * Camera_Jump2() Data + *================================ + */ + +#define CAM_FUNCDATA_JUMP2(yOffset, data01, data02, data20, data04, data05, fov, data08, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { data20, CAM_DATA_20 }, \ + { data04, CAM_DATA_04 }, \ + { data05, CAM_DATA_05 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ s16 interfaceFlags; +} Jump2ReadOnlyData; // size = 0x24 + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ s16 timer; + /* 0x0E */ s16 unk_0E; + /* 0x10 */ s32 unk_10; // unused? + /* 0x1C */ s16 unk_1C; +} Jump2ReadWriteData; // size = 0x20 + +typedef struct { + /* 0x00 */ Jump2ReadOnlyData roData; + /* 0x24 */ Jump2ReadWriteData rwData; +} Jump2; // size = 0x44 + +#define JUMP2_FLAG_1 (1 << 1) +#define JUMP2_FLAG_2 (1 << 2) + + +/*================================ + * Camera_Jump3() Data + *================================ + */ + +#define CAM_FUNCDATA_JUMP3(yOffset, data01, data02, pitchTarget, data04, data05, yawDiffRange, fov, data08, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { pitchTarget, CAM_DATA_03 }, \ + { data04, CAM_DATA_04 }, \ + { data05, CAM_DATA_05 }, \ + { yawDiffRange, CAM_DATA_06 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 unk_00; // yOffset + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; // attenuationYawDiffRange + /* 0x18 */ f32 unk_18; // fovTarget + /* 0x1C */ f32 unk_1C; + /* 0x20 */ s16 unk_20; + /* 0x22 */ s16 interfaceFlags; +} Jump3ReadOnlyData; // size = 0x24 + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 timer1; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ s32 timer2; + /* 0x10 */ s16 unk_10; + /* 0x12 */ s16 unk_12; + /* 0x1C */ s16 unk_1C; +} Jump3ReadWriteData; // size = 0x20 + +typedef struct { + /* 0x00 */ Jump3ReadOnlyData roData; // yOffset + /* 0x24 */ Jump3ReadWriteData rwData; +} Jump3; // size = 0x44 + +#define JUMP3_FLAG_0 (1 << 0) +#define JUMP3_FLAG_2 (1 << 2) +#define JUMP3_FLAG_3 (1 << 3) +#define JUMP3_FLAG_4 (1 << 4) +#define JUMP3_FLAG_5 (1 << 5) +#define JUMP3_FLAG_6 (1 << 6) +#define JUMP3_FLAG_7 (1 << 7) + + +/*================================ + * Camera_Battle1() Data + *================================ + */ + +#define CAM_FUNCDATA_BATT1(yOffset, data01, data02, data13, data14, data15, data16, data17, fov, data08, interfaceFlags, data11, data18) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { data13, CAM_DATA_13 }, \ + { data14, CAM_DATA_14 }, \ + { data15, CAM_DATA_15 }, \ + { data16, CAM_DATA_16 }, \ + { data17, CAM_DATA_17 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS }, \ + { data11, CAM_DATA_11 }, \ + { data18, CAM_DATA_18 } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ f32 unk_20; + /* 0x24 */ f32 unk_24; + /* 0x28 */ f32 unk_28; + /* 0x2C */ f32 unk_2C; + /* 0x30 */ s16 interfaceFlags; +} Battle1ReadOnlyData; // size = 0x34 + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ Actor* unk_08; // targe3t + /* 0x0C */ s32 unk_0C; // unused? + /* 0x10 */ s16 unk_10; + /* 0x12 */ s16 unk_12; + /* 0x14 */ s16 unk_14; + /* 0x16 */ s16 unk_16; + /* 0x18 */ s16 unk_18; + /* 0x1A */ s16 unk_1A; +} Battle1ReadWriteData; // size = 0x1C + +typedef struct { + /* 0x00 */ Battle1ReadOnlyData roData; + /* 0x24 */ Battle1ReadWriteData rwData; +} Battle1; // size = 0x50 + +#define BATTLE1_FLAG_0 (1 << 0) +#define BATTLE1_FLAG_1 (1 << 1) +#define BATTLE1_FLAG_4 (1 << 4) +#define BATTLE1_FLAG_7 (1 << 7) + + +/*================================ + * Camera_KeepOn1() Data + *================================ + */ + +#define CAM_FUNCDATA_KEEP1(yOffset, data01, data02, data13, data14, data15, data16, data17, fov, data08, interfaceFlags, data11) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { data13, CAM_DATA_13 }, \ + { data14, CAM_DATA_14 }, \ + { data15, CAM_DATA_15 }, \ + { data16, CAM_DATA_16 }, \ + { data17, CAM_DATA_17 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS }, \ + { data11, CAM_DATA_11 } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ f32 unk_20; + /* 0x24 */ f32 unk_24; + /* 0x28 */ f32 unk_28; + /* 0x2C */ s16 interfaceFlags; +} KeepOn1ReadOnlyData; // size = 0x30 + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ Actor* unk_0C; + /* 0x10 */ s16 unk_10; + /* 0x12 */ s16 unk_12; + /* 0x14 */ s16 unk_14; + /* 0x16 */ s16 unk_16; + /* 0x18 */ s16 unk_18; +} KeepOn1ReadWriteData; // size = 0x1C + +typedef struct { + /* 0x00 */ KeepOn1ReadOnlyData roData; + /* 0x30 */ KeepOn1ReadWriteData rwData; +} KeepOn1; // size = 0x4C + +#define KEEPON1_FLAG_0 (1 << 0) +#define KEEPON1_FLAG_1 (1 << 1) +#define KEEPON1_FLAG_4 (1 << 4) +#define KEEPON1_FLAG_7 (1 << 7) + + +/*================================ + * Camera_KeepOn3() Data + *================================ + */ + +#define CAM_FUNCDATA_KEEP3(yOffset, data01, data02, data13, data14, data15, data16, data17, fov, data08, timer, interfaceFlags, data18) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { data13, CAM_DATA_13 }, \ + { data14, CAM_DATA_14 }, \ + { data15, CAM_DATA_15 }, \ + { data16, CAM_DATA_16 }, \ + { data17, CAM_DATA_17 }, \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { timer, CAM_DATA_04 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS }, \ + { data18, CAM_DATA_18 } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ f32 unk_20; + /* 0x24 */ f32 unk_24; + /* 0x28 */ f32 unk_28; + /* 0x2C */ s16 timer; // initial timer, stored at twice the value used in code + /* 0x2E */ s16 interfaceFlags; +} KeepOn3ReadOnlyData; // size = 0x30 + +typedef struct { + /* 0x00 */ f32 unk_00; // Vec3f? + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ Actor* unk_0C; + /* 0x10 */ Vec3f unk_10; + /* 0x1C */ s16 timer; +} KeepOn3ReadWriteData; // size = 0x20 + +typedef struct { + /* 0x00 */ KeepOn3ReadOnlyData roData; + /* 0x30 */ KeepOn3ReadWriteData rwData; +} KeepOn3; // size = 0x50 + +#define KEEPON3_FLAG_5 (1 << 5) +#define KEEPON3_FLAG_6 (1 << 6) +#define KEEPON3_FLAG_7 (1 << 7) + + +/*================================ + * Camera_KeepOn4() Data + *================================ + */ + +#define CAM_FUNCDATA_KEEP4(yOffset, data01, pitchTarget, data10, data18, fov, interfaceFlags, data04, timer) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { pitchTarget, CAM_DATA_03 }, \ + { data10, CAM_DATA_10 }, \ + { data18, CAM_DATA_18 }, \ + { fov, CAM_DATA_FOV }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS }, \ + { data04, CAM_DATA_04 }, \ + { timer, CAM_DATA_12 } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ s16 interfaceFlags; + /* 0x1E */ s16 timer; +} KeepOn4ReadOnlyData; // size = 0x20 + +typedef struct { + /* 0x00 */ f32 unk_00; // Vec3f? + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ Actor* unk_0C; + /* 0x10 */ s16 unk_10; + /* 0x12 */ s16 unk_12; + /* 0x14 */ s16 timer; + /* 0x16 */ s16 unk_16; + /* 0x18 */ s16 unk_18; +} KeepOn4ReadWriteData; // size = 0x1C + +typedef struct { + /* 0x00 */ KeepOn4ReadOnlyData roData; + /* 0x20 */ KeepOn4ReadWriteData rwData; +} KeepOn4; // size = 0x3C + +#define KEEPON4_FLAG_1 (1 << 1) +#define KEEPON4_FLAG_2 (1 << 2) +#define KEEPON4_FLAG_3 (1 << 3) +#define KEEPON4_FLAG_6 (1 << 6) + + +/*================================ + * Camera_Fixed1() Data + *================================ + */ + +#define CAM_FUNCDATA_FIXD1(yOffset, data04, fov, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data04, CAM_DATA_04 }, \ + { fov, CAM_DATA_FOV }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 fov; + /* 0x0C */ s16 interfaceFlags; +} Fixed1ReadOnlyData; // size = 0x10 + +typedef struct { + /* 0x00 */ PosRot eyePosRotTarget; + /* 0x14 */ s16 fov; + /* 0x18 */ Actor* focalActor; +} Fixed1ReadWriteData; // size = 0x1C + +typedef struct { + /* 0x00 */ Fixed1ReadOnlyData roData; + /* 0x10 */ Fixed1ReadWriteData rwData; +} Fixed1; // size = 0x2C + +#define FIXED1_FLAG_4 (1 << 4) + + +/*================================ + * Camera_Fixed2() Data + *================================ + */ + +#define CAM_FUNCDATA_FIXD2(yOffset, data01, data02, data04, data05, fov, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { data04, CAM_DATA_04 }, \ + { data05, CAM_DATA_05 }, \ + { fov, CAM_DATA_FOV }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ s16 interfaceFlags; +} Fixed2ReadOnlyData; // size = 0x1C + +typedef struct { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ s16 unk_1C; +} Fixed2ReadWriteData; // size = 0x20 + +typedef struct { + /* 0x00 */ Fixed2ReadOnlyData roData; + /* 0x1C */ Fixed2ReadWriteData rwData; +} Fixed2; // size = 0x3C + +#define FIXED2_FLAG_0 (1 << 0) +#define FIXED2_FLAG_1 (1 << 1) +#define FIXED2_FLAG_2 (1 << 2) +#define FIXED2_FLAG_3 (1 << 3) +#define FIXED2_FLAG_4 (1 << 4) +#define FIXED2_FLAG_5 (1 << 5) +#define FIXED2_FLAG_6 (1 << 6) +#define FIXED2_FLAG_7 (1 << 7) + + +/*================================ + * Camera_Fixed3() Data + *================================ + */ + +#define CAM_FUNCDATA_FIXD3(interfaceFlags) \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + + +/*================================ + * Camera_Subject1() Data + *================================ + */ + +#define CAM_FUNCDATA_SUBJ1(yOffset, data01, data02, data04, data19, data17, data18, fov, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { data02, CAM_DATA_02 }, \ + { data04, CAM_DATA_04 }, \ + { data19, CAM_DATA_19 }, \ + { data17, CAM_DATA_17 }, \ + { data18, CAM_DATA_18 }, \ + { fov, CAM_DATA_FOV }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ s16 interfaceFlags; +} Subject1ReadOnlyData; // size = 0x24 + +typedef struct { + /* 0x0 */ f32 unk_00; + /* 0x4 */ s16 unk_04; // yaw + /* 0x6 */ s16 unk_06; // pitch + /* 0x8 */ s16 timer; +} Subject1ReadWriteData; // size = 0xC + +typedef struct { + /* 0x00 */ Subject1ReadOnlyData roData; + /* 0x24 */ Subject1ReadWriteData rwData; +} Subject1; // size = 0x30 + +#define SUBJECT1_FLAG_4 (1 << 4) + + +/*================================ + * Camera_Unique2() Data + *================================ + */ + +#define CAM_FUNCDATA_UNIQ2(yOffset, data01, fov, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data01, CAM_DATA_01 }, \ + { fov, CAM_DATA_FOV }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ s16 interfaceFlags; +} Unique2ReadOnlyData; // size = 0x14 + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ s16 unk_04; +} Unique2ReadWriteData; // size = 0x8 + +typedef struct { + /* 0x00 */ Unique2ReadOnlyData roData; + /* 0x14 */ Unique2ReadWriteData rwData; +} Unique2; // size = 0x1C + +#define UNIQUE2_FLAG_0 (1 << 0) +#define UNIQUE2_FLAG_1 (1 << 1) +#define UNIQUE2_FLAG_4 (1 << 4) +#define UNIQUE2_FLAG_5 (1 << 5) + + +/*================================ + * Camera_Unique0() Data + *================================ + */ + +#define CAM_FUNCDATA_UNIQ0(yOffset, data04, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { data04, CAM_DATA_04 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x0 */ f32 unk_00; + /* 0x4 */ f32 unk_04; + /* 0x8 */ s16 interfaceFlags; +} Unique0ReadOnlyData; // size = 0xC + +typedef struct { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ Vec3f unk_0C; + /* 0x18 */ f32 unk_18; + /* 0x1C */ Vec3f unk_1C; + /* 0x28 */ Vec3f unk_28; + /* 0x34 */ Vec3s unk_34; + /* 0x3A */ s16 unk_3A; + /* 0x3C */ s16 timer; + /* 0x3E */ s16 unk_3E; +} Unique0ReadWriteData; // size = 0x40 + +typedef struct { + /* 0x00 */ Unique0ReadOnlyData roData; + /* 0x0C */ Unique0ReadWriteData rwData; +} Unique0; // size = 0x4C + +#define UNIQUE0_FLAG_0 (1 << 0) +#define UNIQUE0_FLAG_1 (1 << 1) +#define UNIQUE0_FLAG_4 (1 << 4) + + +/*================================ + * Camera_Unique6() Data + *================================ + */ + +typedef struct { + /* 0x00 */ s16 interfaceFlags; +} Unique6ReadOnlyData; // size = 0x4 + +typedef struct { + /* 0x00 */ Unique6ReadOnlyData roData; +} Unique6; // size = 0x4 + +#define UNIQUE6_FLAG_0 (1 << 0) + + +/*================================ + * Camera_Unique7() Data + *================================ + */ + +#define CAM_FUNCDATA_UNIQ7(fov, interfaceFlags) \ + { fov, CAM_DATA_FOV }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + + +/*================================ + * Camera_Demo1() Data + *================================ + */ + +typedef struct { + /* 0x00 */ s16 interfaceFlags; +} Demo1ReadOnlyData; // size = 0x4 + +typedef struct { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ VecSph unk_0C; + /* 0x14 */ VecSph unk_14; + /* 0x1C */ s16 unk_1C; +} Demo1ReadWriteData; // size = 0x20 + +typedef struct { + /* 0x00 */ Demo1ReadOnlyData roData; + /* 0x04 */ Demo1ReadWriteData rwData; +} Demo1; // size = 0x24 + + +/*================================ + * Camera_Demo2() Data + *================================ + */ + +#define CAM_FUNCDATA_DEMO2(fov, data08, interfaceFlags) \ + { fov, CAM_DATA_FOV }, \ + { data08, CAM_DATA_08 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 fov; + /* 0x04 */ f32 unk_04; // unused + /* 0x08 */ s16 interfaceFlags; +} Demo2ReadOnlyData; // size = 0xC + +typedef struct { + /* 0x00 */ Vec3f initialAt; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ s16 animFrame; + /* 0x12 */ s16 yawDir; +} Demo2ReadWriteData; // size = 0x14 + +typedef struct { + /* 0x08 */ Demo2ReadOnlyData roData; + /* 0x0C */ Demo2ReadWriteData rwData; +} Demo2; // size = 0x20 + + +/*================================ + * Camera_Demo3() Data + *================================ + */ + +typedef struct { + /* 0x00 */ s16 interfaceFlags; +} Demo3ReadOnlyData; // size = 0x4 + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 timer; +} Demo3ReadWriteData; // size = 0x8 + +typedef struct { + /* 0x00 */ Demo3ReadOnlyData roData; + /* 0x04 */ Demo3ReadWriteData rwData; +} Demo3; // size = 0xC + + +/*================================ + * Camera_Demo4() Data + *================================ + */ + +typedef struct { + /* 0x00 */ s16 interfaceFlags; +} Demo4ReadOnlyData; // size = 0x4 + +typedef struct { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ VecSph unk_18; // sp18-1C-20--24-26-28 // CutsceneCameraPoint? + /* 0x20 */ s16 unk_20; + /* 0x22 */ s16 timer; +} Demo4ReadWriteData; // size = 0x24 + +typedef struct { + /* 0x00 */ Demo4ReadOnlyData roData; + /* 0x04 */ Demo4ReadWriteData rwData; +} Demo4; // size = 0x28 + + +/*================================ + * Camera_Demo5() Data + *================================ + */ + +typedef struct { + /* 0x00 */ s16 interfaceFlags; +} Demo5ReadOnlyData; // size = 0x4 + +typedef struct { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ VecSph unk_1C; + /* 0x24 */ s16 unk_24; + /* 0x26 */ s16 timer; +} Demo5ReadWriteData; // size = 0x28 + +typedef struct { + /* 0x00 */ Demo5ReadOnlyData roData; + /* 0x04 */ Demo5ReadWriteData rwData; +} Demo5; // size = 0x2C + + +/*================================ + * Camera_Demo0() Data + *================================ + */ + +typedef struct { + /* 0x00 */ s16 interfaceFlags; +} Demo0ReadOnlyData; // size = 0x4 + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ VecSph subAtToEye; + /* 0x0C */ VecSph atToEye; + /* 0x14 */ s16 unk_14; + /* 0x16 */ s16 unk_16; + /* 0x18 */ s16 unk_18; + /* 0x1A */ s16 timer; +} Demo0ReadWriteData; // size = 0x1C + +typedef struct { + /* 0x00 */ Demo0ReadOnlyData roData; + /* 0x04 */ Demo0ReadWriteData rwData; +} Demo0; // size = 0x20 + + +/*================================ + * Camera_Special5() Data + *================================ + */ + +#define CAM_FUNCDATA_SPEC5(yOffset, eyeDist, minDistForRot, fov, atMaxLERPScale, timerInit, pitch, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { eyeDist, CAM_DATA_01 }, \ + { minDistForRot, CAM_DATA_02 }, \ + { fov, CAM_DATA_03 }, \ + { atMaxLERPScale, CAM_DATA_FOV }, \ + { timerInit, CAM_DATA_08 }, \ + { pitch, CAM_DATA_12 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 yOffset; + /* 0x04 */ f32 eyeDist; + /* 0x08 */ f32 minDistForRot; + /* 0x0C */ f32 fovTarget; + /* 0x10 */ f32 atMaxLERPScale; + /* 0x14 */ s16 timerInit; + /* 0x16 */ s16 pitch; + /* 0x18 */ s16 interfaceFlags; +} Special5ReadOnlyData; // size = 0x1C + +typedef struct { + /* 0x00 */ s16 animTimer; +} Special5ReadWriteData; // size = 0x4 + +typedef struct { + /* 0x00 */ Special5ReadOnlyData roData; + /* 0x1C */ Special5ReadWriteData rwData; +} Special5; // size = 0x20 + + +/*================================ + * DOOR Data + *================================ + */ + +// For functions that deal with doors, an extra struct is added to the paramData + +typedef struct { + /* 0x00 */ Actor* doorActor; + /* 0x04 */ s16 bgCamIndex; + /* 0x06 */ union { + Vec3s eye; // position of the camera while exiting a spiral staircase + struct { + s16 timer1; // timer while camera is fixed in front of the door + s16 timer2; // timer while camera is behind the door looking at player + s16 timer3; // timer while camera turns around to face forward + }; + }; +} DoorParams; // size = 0xC + +#define CAM_GET_DOOR_PARAMS(type) &((type*)camera->paramData)->doorParams + + +/*================================ + * Camera_Special8() Data + *================================ + */ + +#define CAM_FUNCDATA_SPEC8(yOffset, eyeStepScale, posStepScale, fov, spiralDoorCsLength, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { eyeStepScale, CAM_DATA_04 }, \ + { posStepScale, CAM_DATA_05 }, \ + { fov, CAM_DATA_FOV }, \ + { spiralDoorCsLength, CAM_DATA_12 }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 yOffset; + /* 0x04 */ f32 eyeStepScale; + /* 0x08 */ f32 posStepScale; + /* 0x0C */ f32 fov; + /* 0x10 */ s16 spiralDoorCsLength; + /* 0x12 */ s16 interfaceFlags; +} Special8ReadOnlyData; // size = 0x14 + +typedef struct { + /* 0x00 */ Vec3f eye; + /* 0x0C */ s16 spiralDoorCsFrame; // 1/5th of the length of the cutscene + /* 0x0E */ s16 fov; +} Special8ReadWriteData; // size = 0x10 + +typedef struct { + /* 0x00 */ Special8ReadOnlyData roData; + /* 0x14 */ Special8ReadWriteData rwData; +} Special8; // size = 0x24 + +#define SPECIAL8_FLAG_0 (1 << 0) +#define SPECIAL8_FLAG_3 (1 << 3) + + +/*================================ + * Camera_Special9() Data + *================================ + */ + +#define CAM_FUNCDATA_SPEC9(yOffset, fov, interfaceFlags) \ + { yOffset, CAM_DATA_00 }, \ + { fov, CAM_DATA_FOV }, \ + { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } + +typedef struct { + /* 0x00 */ f32 yOffset; + /* 0x04 */ f32 fov; + /* 0x08 */ s16 interfaceFlags; +} Special9ReadOnlyData; // size = 0xC + +typedef struct { + /* 0x00 */ s16 unk_00; +} Special9ReadWriteData; // size = 0x4 + +typedef struct { + /* 0x00 */ Special9ReadOnlyData roData; + /* 0x0C */ Special9ReadWriteData rwData; +} Special9; // size = 0x10 + +#define SPECIAL9_FLAG_0 (1 << 0) +#define SPECIAL9_FLAG_1 (1 << 1) +#define SPECIAL9_FLAG_3 (1 << 3) + +typedef union { + Normal1 norm1; + Normal3 norm3; + Normal0 norm0; + Parallel1 para1; + Jump2 jump2; + Jump3 jump3; + Battle1 batt1; + KeepOn1 keep1; + KeepOn3 keep3; + KeepOn4 keep4; + Fixed1 fixd1; + Fixed2 fixd2; + Subject1 subj1; + Unique2 uniq2; + Unique0 uniq0; + Unique6 uniq6; + Demo1 demo1; + Demo2 demo2; + Demo3 demo3; + Demo4 demo4; + Demo5 demo5; + Demo0 demo0; + Special5 spec5; + struct { + /* 0x0 */ DoorParams doorParams; + /* 0xC */ union { + Special8 spec8; + Special9 spec9; + }; + }; +} CamParamData; // size = 0x50 + +/*================================ + * MAIN CAMERA STRUCT + *================================ + */ typedef struct Camera { - /* 0x000 */ u8 paramData[0x50]; // function Data, acts like a heap that's reset every time a new action function is switched to + /* 0x000 */ CamParamData paramData; // update function data that's reset every time a new update function is switched to /* 0x050 */ Vec3f at; /* 0x05C */ Vec3f eye; /* 0x068 */ Vec3f up; diff --git a/include/z64scene.h b/include/z64scene.h index bb82574f8..3af90e02c 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -289,7 +289,7 @@ typedef struct { typedef struct { struct { s8 room; // Room to switch to - s8 bgCamDataId; // How the camera reacts during the transition. -2 for spiral staircase. -1 for generic door. 0+ will index scene CamData + s8 bgCamIndex; // How the camera reacts during the transition. -2 for spiral staircase. -1 for generic door. 0+ will index scene CamData } /* 0x0 */ sides[2]; // 0 = front, 1 = back /* 0x4 */ s16 id; /* 0x6 */ Vec3s pos; diff --git a/spec b/spec index 428de2321..52dfd5ba8 100644 --- a/spec +++ b/spec @@ -451,8 +451,6 @@ beginseg include "build/src/code/z_bg_collect.o" include "build/src/code/z_bg_item.o" include "build/src/code/z_camera.o" - include "build/data/code/z_camera.data.o" - include "build/data/code/z_camera.bss.o" include "build/src/code/z_collision_btltbls.o" pad_text include "build/src/code/z_collision_check.o" diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c index 942435fa7..da93f13fd 100644 --- a/src/boot_O2_g3/idle.c +++ b/src/boot_O2_g3/idle.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" u8 D_80096B20 = 1; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index da8a5f35a..b4b6e5785 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -1,8 +1,23 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "z64quake.h" #include "z64shrink_window.h" #include "z64view.h" +#include "z_camera_data.inc.c" + +// BSS +s16 D_801EDBF0; +f32 D_801EDBF4; +f32 D_801EDBF8; +CameraCollision D_801EDC00; + +PlayState* sCamPlayState; +SwingAnimation D_801EDC30[4]; +Vec3f D_801EDDD0; +Vec3f D_801EDDE0; +Vec3f D_801EDDF0; + /** * Returns the absolute value for floats */ @@ -535,6 +550,9 @@ s32 Camera_GetWaterBoxBgCamSetting(Camera* camera, f32* waterY) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800CC9C0.s") +s32 D_801B9E5C = 0; +f32 D_801B9E60 = 0.0f; + #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800CCCEC.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800CD04C.s") @@ -577,147 +595,175 @@ s32 Camera_GetWaterBoxBgCamSetting(Camera* camera, f32* waterY) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800CED90.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeNop.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Noop.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeNORM1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Normal1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeNORM2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Normal2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeNORM3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Normal3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeNORM4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Normal4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeNORM0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Normal0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModePARA1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Parallel1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModePARA2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Parallel2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModePARA3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Parallel3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModePARA4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Parallel4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModePARA0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Parallel0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeJUMP1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Jump1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeJUMP2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Jump2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeJUMP3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Jump3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeJUMP4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Jump4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeJUMP0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Jump0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeBATT1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Battle1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeBATT2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Battle2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeBATT3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Battle3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeBATT4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Battle4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeBATT0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Battle0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeKEEP1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_KeepOn1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeKEEP2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_KeepOn2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeKEEP3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_KeepOn3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeKEEP4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_KeepOn4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeKEEP0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_KeepOn0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeFIXD1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Fixed1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeFIXD2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Fixed2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeFIXD3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Fixed3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeFIXD4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Fixed4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeFIXD0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Fixed0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSUBJ1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Subject1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSUBJ2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Subject2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSUBJ3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Subject3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSUBJ4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Subject4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSUBJ0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Subject0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDATA0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Data0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDATA1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Data1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDATA2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Data2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDATA3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Data3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDATA4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Data4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ5.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique5.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ6.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique6.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ7.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique7.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ8.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique8.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeUNIQ9.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Unique9.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO2.s") +// Data for opening chests (default) +VecSph D_801B9E64[] = { + { 50.0f, 0xEE3A, 0xD558 }, + { 75.0f, 0x0000, 0x8008 }, + { 80.0f, 0xEE3A, 0x8008 }, + { 15.0f, 0xEE3A, 0x8008 }, +}; +Vec3f D_801B9E84[] = { + { 0.0f, 40.0f, 20.0f }, + { 0.0f, 40.0f, 0.0f }, + { 0.0f, 3.0f, -3.0f }, + { 0.0f, 3.0f, -3.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO3.s") +// Data for opening chests (goron) +VecSph D_801B9EB4[] = { + { 60.0f, 0xEE3A, 0xD558 }, + { 95.0f, 0x0000, 0x8008 }, + { 90.0f, 0xEE3A, 0x8008 }, + { 20.0f, 0xEE3A, 0x8008 }, +}; +Vec3f D_801B9ED4[] = { + { 0.0f, 40.0f, 20.0f }, + { 0.0f, 40.0f, 0.0f }, + { 0.0f, 3.0f, -3.0f }, + { 0.0f, 3.0f, -3.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO5.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO6.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO7.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo5.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO8.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo6.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO9.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo7.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeDEMO0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo8.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo9.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC1.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Demo0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC2.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special0.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC3.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special1.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special2.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC5.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special3.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC6.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special4.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC7.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special5.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC8.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special6.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ModeSPEC9.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special7.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Special9.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Alloc.s") @@ -735,6 +781,14 @@ s32 Camera_GetWaterBoxBgCamSetting(Camera* camera, f32* waterY) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DE324.s") +s16 sEarthquakeFreq[] = { + 0xFFC, // 1 Large Earthquake between CLOCK_TIME(0, 00) to CLOCK_TIME(1, 30) + 0x7FC, // 2 Large Earthquakes between CLOCK_TIME(1, 30) to CLOCK_TIME(3, 00) + 0x3FC, // 4 Large Earthquakes between CLOCK_TIME(3, 00) to CLOCK_TIME(4, 30) + 0x1FC, // 8 Large Earthquakes between CLOCK_TIME(4, 30) to CLOCK_TIME(6, 00) +}; +s16 sEarthquakeTimer = 0; + #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DE62C.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DE840.s") @@ -745,6 +799,8 @@ s32 Camera_GetWaterBoxBgCamSetting(Camera* camera, f32* waterY) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_Update.s") +s32 sModeChangeFlags = 0; + #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DF498.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_SetMode.s") diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c new file mode 100644 index 000000000..a8e9fbb80 --- /dev/null +++ b/src/code/z_camera_data.inc.c @@ -0,0 +1,3810 @@ +#include "ultra64.h" +#include "global.h" + +/** + * All the data from `CameraSetting`, `CameraMode`, `sCameraUpdateHandlers`, and `CameraModeValue` below + * can be thought of as a single 2D ragged array table with holes in it, indexed by `[camSetting][camMode]`. + * + * The `CameraSetting` and `CameraMode` together build this 2D table, with data/functions/flags for each entry. + * + * Each entry in this 2D table consists of a both a camera-update function to run (`sCameraUpdateHandlers`), + * and a set of data to accompany that camera-update function (`CameraModeValue`). Often, `CameraModeValue` + * data entries are reused. Not every entry is valid, and the flags in the entry are used to indicate this. + */ + +typedef s32 (*CameraUpdateFunc)(Camera*); + +typedef struct { + /* 0x0 */ s16 val; + /* 0x2 */ s16 param; +} CameraModeValue; // size = 0x4 + +typedef struct { + /* 0x0 */ s16 funcId; + /* 0x2 */ s16 numValues; + /* 0x4 */ CameraModeValue* values; +} CameraMode; // size = 0x8 + +/** + * Flags: + * (flags & 0xF): Priority (lower value has higher priority) + * (flags & 0x40000000): Store previous setting and bgCamData, also ignores water checks + * (flags & 0x80000000): Set camera setting based on bg/scene data and reset action function state + */ +typedef struct { + /* 0x0 */ u32 validModes; + /* 0x4 */ u32 flags; + /* 0x8 */ CameraMode* cameraModes; +} CameraSetting; // size = 0xC + +/*===================================================================== + * Default Data: NORMAL0 Setting + *===================================================================== + */ + +CameraModeValue sSetNormal0ModeNormalData[] = { + CAM_FUNCDATA_NORM1(-20, 280, 320, 10, 22, 15, 40, 60, 84, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetNormal0ModeTargetData[] = { + CAM_FUNCDATA_PARA1(0, 350, 50, 0, 0, 5, 5, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 60, 0), +}; + +CameraModeValue sSetNormal0ModeFollowTargetData[] = { + CAM_FUNCDATA_KEEP1(-30, 180, 200, 20, 40, -5, 10, 15, 45, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 30), +}; + +CameraModeValue sSetNormal0ModeBattleData[] = { + CAM_FUNCDATA_BATT1(-30, 150, 250, 10, 60, -5, 20, 35, 55, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 25, 40), +}; + +CameraModeValue sSetNormal0ModeFirstPersonData[] = { + CAM_FUNCDATA_SUBJ1(0, 5, 50, 10, 0, 0, 0, 45, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetNormal0ModeTalkData[] = { + CAM_FUNCDATA_KEEP3(-20, 80, 150, 50, 5, 20, 5, 40, 35, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, 0), + 60), +}; + +CameraModeValue sSetNormal0ModeClimbData[] = { + CAM_FUNCDATA_JUMP2(-20, 280, 320, 20, 5, 5, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetNormal0ModeBowArrowData[] = { + CAM_FUNCDATA_SUBJ1(0xFFF9, 0xE, 50, 10, 0, -30, -5, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetNormal0ModeBowArrowZData[] = { + CAM_FUNCDATA_SUBJ1(20, 70, 70, 10, 0xFF88, 20, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetNormal0ModeHookshotData[] = { + CAM_FUNCDATA_SPEC5(-20, 80, 250, 45, 60, 40, 6, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetNormal0ModeBoomerangData[] = { + CAM_FUNCDATA_SUBJ1(5, 50, 50, 10, 0, 0, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetNormal0ModeSlingshotData[] = { + CAM_FUNCDATA_SUBJ1(0xFFF9, 14, 50, 10, 0, -50, -10, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetNormal0ModeClimbZData[] = { + CAM_FUNCDATA_JUMP2(-20, 280, 320, 20, 999, 5, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, JUMP2_FLAG_2 | JUMP2_FLAG_1)), +}; + +CameraModeValue sSetNormal0ModeJumpData[] = { + CAM_FUNCDATA_NORM1(-20, 240, 340, 10, 30, 12, 40, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetNormal0ModeHangData[] = { + CAM_FUNCDATA_PARA1(-40, 320, 50, 40, 0, 8, 5, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_7 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 60, 12), +}; + +CameraModeValue sSetNormal0ModeHangZData[] = { + CAM_FUNCDATA_PARA1(0xFFB0, 300, 50, 70, 0, 12, 5, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_7 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 60, 2), +}; + +CameraModeValue sSetNormal0ModeFreeFallData[] = { + CAM_FUNCDATA_PARA1( + -10, 320, 100, 70, 0, 4, 5, 70, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_7 | PARALLEL1_FLAG_3), 60, 12), +}; + +CameraModeValue sSetNormal0ModeChargeData[] = { + CAM_FUNCDATA_PARA1(0xFFB0, 300, -20, 50, 0, 50, 5, 80, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0), 60, 10), +}; + +CameraModeValue sSetNormal0ModeChargeZData[] = { + CAM_FUNCDATA_PARA1(0xFFB0, 300, -20, 40, 0, 50, 5, 80, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 60, 0), +}; + +CameraModeValue sSetNormal0ModeStillData[] = { + CAM_FUNCDATA_NORM1(-20, 280, 320, 10, 100, 100, 100, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetNormal0ModePushPullData[] = { + CAM_FUNCDATA_PARA1( + 0, 350, 5, 45, 0, 5, 5, 70, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_5 | PARALLEL1_FLAG_1), 80, 0), +}; + +CameraModeValue sSetNormal0ModeFollowBoomerangData[] = { + CAM_FUNCDATA_KEEP1(-5, 220, 240, 5, 75, 10, 5, 40, 50, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 30), +}; + +CameraModeValue sSetNormal0ModeDekuShootData[] = { + CAM_FUNCDATA_SUBJ1(0, 5, 50, 10, 0, 50, 65, 45, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetNormal0ModeGoronDashData[] = { + CAM_FUNCDATA_NORM1(50, 160, 255, -2, 12, 10, 40, 92, 88, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_2 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetNormal0ModeDekuHideData[] = { + CAM_FUNCDATA_PARA1( + 100, 300, -20, 40, 0, 4, 5, 80, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, PARALLEL1_FLAG_5 | PARALLEL1_FLAG_1), 80, + 20), +}; + +CameraModeValue sSetNormal0ModeDekuFlyData[] = { + CAM_FUNCDATA_NORM1(0xFFB0, 280, 320, 40, 20, 12, 40, 80, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetNormal0ModeDekuFlyZData[] = { + CAM_FUNCDATA_PARA1(0xFFBA, 350, 10, 10, 0, 5, 5, 70, 90, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_3 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 90, 0), +}; + +CameraModeValue sSetNormal0ModeGoronJumpData[] = { + CAM_FUNCDATA_NORM1( + -10, 160, 400, 0, 18, 12, 40, 80, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_2 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetNormal0ModeZoraFinData[] = { + CAM_FUNCDATA_SUBJ1(5, 100, 100, 10, 0, 0, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +/*===================================================================== + * Custom Data: NORMAL3 Setting + *===================================================================== + */ + +CameraModeValue sSetNormal3ModeNormalData[] = { + CAM_FUNCDATA_JUMP3(-40, 280, 300, 20, 15, 5, 40, 60, 100, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_7 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetNormal3ModeTargetData[] = { + CAM_FUNCDATA_PARA1( + -50, 280, 40, 10, 0, 15, 5, 60, 100, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1 | PARALLEL1_FLAG_0), 80, 0), +}; + +CameraModeValue sSetNormal3ModeFreeFallData[] = { + CAM_FUNCDATA_JUMP3(0, 80, 100, 30, 10, 5, 40, 80, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_2)), +}; + +CameraModeValue sSetNormal3ModeGoronJumpData[] = { + CAM_FUNCDATA_JUMP3(-40, 150, 240, -5, 18, 5, 40, 70, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_3 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetNormal3ModeDekuFlyData[] = { + CAM_FUNCDATA_JUMP3(-40, 150, 250, 10, 18, 5, 60, 60, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_2 | JUMP3_FLAG_0)), +}; + +CameraModeValue sSetNormal3ModeDekuHideData[] = { + CAM_FUNCDATA_JUMP3( + 0xFFC4, 150, 250, -15, 18, 5, 60, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_7 | JUMP3_FLAG_2 | JUMP3_FLAG_0)), +}; + +CameraModeValue sSetNormal3ModeStillData[] = { + CAM_FUNCDATA_NORM1(-40, 80, 300, 20, 100, 100, 100, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetNormal3ModeGoronDashData[] = { + CAM_FUNCDATA_JUMP3(-40, 180, 200, 5, 20, 5, 40, 80, 35, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_3 | JUMP3_FLAG_2)), +}; + +/*===================================================================== + * Custom Data: PIVOT_DIVING Setting + *===================================================================== + */ + +CameraModeValue sSetPivotDivingModeNormalData[] = { + CAM_FUNCDATA_UNIQ2(-40, 60, 60, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, UNIQUE2_FLAG_1)), +}; + +CameraModeValue sSetPivotDivingModeTargetData[] = { + CAM_FUNCDATA_UNIQ2(-30, 45, 100, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, UNIQUE2_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: HORSE Setting + *===================================================================== + */ + +CameraModeValue sSetHorseModeNormalData[] = { + CAM_FUNCDATA_NORM3(-50, 220, 250, 10, 10, 20, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_WITH_OVERWRITE, + NORMAL3_FLAG_5)), +}; + +CameraModeValue sSetHorseModeTargetData[] = { + CAM_FUNCDATA_NORM3(-40, 180, 200, -3, 2, 100, 50, 90, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, + CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_WITH_OVERWRITE, NORMAL3_FLAG_1)), +}; + +CameraModeValue sSetHorseModeJumpData[] = { + CAM_FUNCDATA_NORM3( + -50, 220, 260, 10, 10, 20, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_WITH_OVERWRITE, 0)), +}; + +CameraModeValue sSetHorseModeBowArrowData[] = { + CAM_FUNCDATA_SUBJ1( + 0xFFF9, 14, 100, 10, 0, -30, -5, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_WITH_OVERWRITE, 0)), +}; + +CameraModeValue sSetHorseModeSlingShotData[] = { + CAM_FUNCDATA_SUBJ1(0xFFF9, 14, 100, 10, 0, -50, -10, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetHorseModeBattleData[] = { + CAM_FUNCDATA_BATT1(0xFFC4, 180, 280, 10, 60, -5, 20, 60, 60, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 25, 40), +}; + +CameraModeValue sSetHorseModeFollowTargetData[] = { + CAM_FUNCDATA_KEEP1(0xFFC4, 180, 220, 25, 45, -5, 15, 15, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, + CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_WITH_OVERWRITE, KEEPON1_FLAG_0), + 20), +}; + +CameraModeValue sSetHorseModeTalkData[] = { + CAM_FUNCDATA_KEEP3(-50, 140, 200, 40, 10, 0, 5, 100, 45, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, 0), + 60), +}; + +CameraModeValue sSetHorseModeStillData[] = { + CAM_FUNCDATA_NORM3(-40, 180, 200, -3, 100, 100, 60, 10, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, NORMAL3_FLAG_7)), +}; + +/*===================================================================== + * Custom Data: ZORA_DIVING Setting + *===================================================================== + */ + +CameraModeValue sSetZoraDivingModeNormalData[] = { + CAM_FUNCDATA_NORM3(-20, 250, 250, 0, 20, 20, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_WITH_OVERWRITE, + NORMAL3_FLAG_7)), +}; + +/*===================================================================== + * Custom Data: PREREND_FIXED Setting + *===================================================================== + */ + +CameraModeValue sSetPrerendFixedModeNormalData[] = { + CAM_FUNCDATA_FIXD3(CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +/*===================================================================== + * Custom Data: PREREND_PIVOT Setting + *===================================================================== + */ + +CameraModeValue sSetPrerendPivotModeNormalData[] = { + CAM_FUNCDATA_UNIQ7(60, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +/*===================================================================== + * Custom Data: DOORC Setting + *===================================================================== + */ + +CameraModeValue sSetDoorCModeNormalData[] = { + CAM_FUNCDATA_SPEC9(-5, 60, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE_4, CAM_HUD_VISIBILITY_NONE_ALT, SPECIAL9_FLAG_1)), +}; + +/*===================================================================== + * Custom Data: DEMO0 Setting + *===================================================================== + */ + +CameraModeValue D_801B4EF0[] = { + CAM_FUNCDATA_INTERFACE_FLAGS(CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_NONE_ALT, 0)), +}; + +/*===================================================================== + * Custom Data: Various Cutscenes + *===================================================================== + */ + +// Camera Settings: FREE0, NAVI, TRANSFORM, ATTENTION, WARP1, STOP0, CONNECT0 +CameraModeValue sSetCutscenesModeNormalData[] = { + CAM_FUNCDATA_INTERFACE_FLAGS(CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0)), +}; + +/*===================================================================== + * Custom Data: FUKAN0 Setting + *===================================================================== + */ + +CameraModeValue D_801B4EF8[] = { + CAM_FUNCDATA_NORM1( + -40, 600, 600, 45, 50, 10, 50, 45, 90, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_6 | NORMAL1_FLAG_1)), +}; + +CameraModeValue D_801B4F20[] = { + CAM_FUNCDATA_PARA1(-40, 400, 25, 60, 0, 5, 5, 60, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 80, 0), +}; + +CameraModeValue D_801B4F50[] = { + CAM_FUNCDATA_NORM1(-40, 600, 600, 45, 50, 10, 50, 45, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B4F78[] = { + CAM_FUNCDATA_NORM1(-40, 600, 600, 45, 100, 100, 100, 45, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: NORMAL1 Setting + *===================================================================== + */ + +CameraModeValue sSetNormal1ModeNormalData[] = { + CAM_FUNCDATA_NORM1(-20, 280, 320, 15, 18, 12, 70, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_1)), +}; + +CameraModeValue sSetNormal1ModeStillData[] = { + CAM_FUNCDATA_NORM1(-20, 280, 320, 15, 100, 100, 100, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: NANAME Setting + *===================================================================== + */ + +// Normal4 +CameraModeValue D_801B4FF0[] = { + CAM_FUNCDATA_NORM1( + -20, 280, 320, 10, 18, 12, 40, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: CIRCLE0 Setting + *===================================================================== + */ + +CameraModeValue D_801B5018[] = { + CAM_FUNCDATA_FIXD2(-40, 40, 0x3200, 10, 20, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, FIXED2_FLAG_0)), +}; + +CameraModeValue D_801B5034[] = { + CAM_FUNCDATA_FIXD2(-40, 40, 0x3200, 100, 80, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, FIXED2_FLAG_6)), +}; + +CameraModeValue D_801B5050[] = { + CAM_FUNCDATA_FIXD2(-40, 40, 200, 100, 50, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, FIXED2_FLAG_7)), +}; + +/*===================================================================== + * Custom Data: FIXED0 Setting + *===================================================================== + */ + +CameraModeValue D_801B506C[] = { + CAM_FUNCDATA_FIXD1(-40, 10, 60, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +/*===================================================================== + * Custom Data: SPIRAL_DOOR Setting + *===================================================================== + */ + +CameraModeValue sSetSpiralDoorModeNormalData[] = { + CAM_FUNCDATA_SPEC8(-40, 50, 80, 60, 10, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, SPECIAL8_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: DUNGEON0 Setting + *===================================================================== + */ + +CameraModeValue sSetDungeon0ModeNormalData[] = { + CAM_FUNCDATA_NORM1(-20, 150, 250, 5, 18, 5, 45, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon0ModeTargetData[] = { + CAM_FUNCDATA_PARA1( + 0, 200, 25, 5, 0, 5, 5, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_6 | PARALLEL1_FLAG_1), 80, 0), +}; + +CameraModeValue sSetDungeon0ModeFollowTargetData[] = { + CAM_FUNCDATA_KEEP1(-20, 120, 140, 25, 45, -5, 15, 15, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 20), +}; + +CameraModeValue sSetDungeon0ModeBattleData[] = { + CAM_FUNCDATA_BATT1(-30, 150, 240, 10, 50, 5, 10, 25, 50, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 25, 50), +}; + +CameraModeValue sSetDungeon0ModeFollowBoomerangData[] = { + CAM_FUNCDATA_KEEP1(-5, 150, 240, 5, 65, 10, 5, 40, 55, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 30), +}; + +CameraModeValue sSetDungeon0ModeJumpData[] = { + CAM_FUNCDATA_NORM1(-20, 150, 250, 5, 24, 5, 50, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon0ModeFreeFallData[] = { + CAM_FUNCDATA_PARA1( + -10, 250, 100, 70, 0, 4, 5, 70, 10, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_7 | PARALLEL1_FLAG_3), 70, 12), +}; + +CameraModeValue sSetDungeon0ModeClimbData[] = { + CAM_FUNCDATA_JUMP2(-40, 150, 250, 20, 5, 5, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue sSetDungeon0ModeClimbZData[] = { + CAM_FUNCDATA_JUMP2(-40, 250, 250, 20, 999, 5, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, JUMP2_FLAG_2 | JUMP2_FLAG_1)), +}; + +CameraModeValue sSetDungeon0ModeChargeData[] = { + CAM_FUNCDATA_PARA1(0, 250, -20, 50, 0, 50, 5, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0), 60, 10), +}; + +CameraModeValue sSetDungeon0ModeChargeZData[] = { + CAM_FUNCDATA_PARA1(50, 250, -20, 40, 0, 50, 5, 80, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 60, 0), +}; + +CameraModeValue sSetDungeon0ModeHangData[] = { + CAM_FUNCDATA_PARA1(-40, 220, 50, 40, 0, 12, 5, 60, 10, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_7 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 60, 12), +}; + +CameraModeValue sSetDungeon0ModeHangZData[] = { + CAM_FUNCDATA_PARA1(0xFFB0, 250, 50, 70, 0, 10, 5, 45, 10, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_7 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 60, 2), +}; + +CameraModeValue sSetDungeon0ModeStillData[] = { + CAM_FUNCDATA_NORM1( + -10, 180, 220, 10, 100, 100, 100, 60, 10, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon0ModePushPullData[] = { + CAM_FUNCDATA_PARA1( + 0, 250, 5, 30, 0, 5, 5, 70, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_5 | PARALLEL1_FLAG_1), 80, 0), +}; + +/*===================================================================== + * Custom Data: ITEM0 Setting + *===================================================================== + */ + +CameraModeValue D_801B5338[] = { + CAM_FUNCDATA_KEEP4(5, 70, 25, 0, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B535C[] = { + CAM_FUNCDATA_KEEP4(-30, 35, 40, 0, 6, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B5380[] = { + CAM_FUNCDATA_KEEP4(-15, 90, -8, 0, 0, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B53A4[] = { + CAM_FUNCDATA_KEEP4(20, 45, 0x0037, 0, 12, 55, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B53C8[] = { + CAM_FUNCDATA_KEEP4(10, 70, 30, 0, 4, 42, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +/*===================================================================== + * Custom Data: ITEM1 Setting + *===================================================================== + */ + +CameraModeValue D_801B53EC[] = { + CAM_FUNCDATA_KEEP4(-45, 75, 0xFFF4, 165, 5, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B5410[] = { + CAM_FUNCDATA_KEEP4(-40, 70, 20, 140, 5, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B5434[] = { + CAM_FUNCDATA_KEEP4(-20, 85, -5, 140, 15, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B5458[] = { + CAM_FUNCDATA_KEEP4(-50, 0x005F, -15, 160, 6, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B547C[] = { + CAM_FUNCDATA_KEEP4( + 0xFFC4, 70, -15, 0xFF74, 30, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_3 | KEEPON4_FLAG_2), 25, 6), +}; + +/*===================================================================== + * Custom Data: ITEM2 Setting + *===================================================================== + */ + +CameraModeValue D_801B54A0[] = { + CAM_FUNCDATA_KEEP4(-40, 0x006E, 5, 150, 5, 65, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B54C4[] = { + CAM_FUNCDATA_KEEP4(0xFFC4, 0x0082, -10, 0x00AA, 5, 65, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B54E8[] = { + CAM_FUNCDATA_KEEP4(-40, 0x006E, 0, 140, 5, 65, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B550C[] = { + CAM_FUNCDATA_KEEP4(-50, 140, -10, 160, 5, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B5530[] = { + CAM_FUNCDATA_KEEP4(0xFFC4, 120, -8, 150, 5, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +/*===================================================================== + * Custom Data: ITEM3 Setting + *===================================================================== + */ + +CameraModeValue D_801B5554[] = { + CAM_FUNCDATA_KEEP4( + -15, 65, 50, 0xFF65, 5, 75, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_3 | KEEPON4_FLAG_2), 25, 6), +}; + +CameraModeValue D_801B5578[] = { + CAM_FUNCDATA_KEEP4( + -20, 60, 50, 0xFF65, 5, 75, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_3 | KEEPON4_FLAG_2), 25, 6), +}; + +CameraModeValue D_801B559C[] = { + CAM_FUNCDATA_KEEP4(-15, 60, 40, 0x00AA, 5, 75, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 6), +}; + +CameraModeValue D_801B55C0[] = { + CAM_FUNCDATA_KEEP4( + -25, 0x005F, 50, 0xFF65, 5, 75, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_3 | KEEPON4_FLAG_2), 25, 6), +}; + +CameraModeValue D_801B55E4[] = { + CAM_FUNCDATA_KEEP4( + -20, 75, 45, 0xFF6A, -5, 75, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_3 | KEEPON4_FLAG_2), 25, 6), +}; + +/*===================================================================== + * Custom Data: WARP0 Setting + *===================================================================== + */ + +CameraModeValue D_801B5608[] = { + CAM_FUNCDATA_KEEP4(-45, 165, 0, 0x00B2, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, + KEEPON4_FLAG_6 | KEEPON4_FLAG_3 | KEEPON4_FLAG_2 | KEEPON4_FLAG_1), + 30, 10), +}; + +CameraModeValue D_801B562C[] = { + CAM_FUNCDATA_KEEP4(0xFFC9, 180, 0, 0x00B2, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, + KEEPON4_FLAG_6 | KEEPON4_FLAG_3 | KEEPON4_FLAG_2 | KEEPON4_FLAG_1), + 30, 10), +}; + +CameraModeValue D_801B5650[] = { + CAM_FUNCDATA_KEEP4(-20, 0x00AF, 0, 0x00B2, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, + KEEPON4_FLAG_6 | KEEPON4_FLAG_3 | KEEPON4_FLAG_2 | KEEPON4_FLAG_1), + 30, 10), +}; + +CameraModeValue D_801B5674[] = { + CAM_FUNCDATA_KEEP4(-50, 220, 0, 0x00B2, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, + KEEPON4_FLAG_6 | KEEPON4_FLAG_3 | KEEPON4_FLAG_2 | KEEPON4_FLAG_1), + 30, 10), +}; + +CameraModeValue D_801B5698[] = { + CAM_FUNCDATA_KEEP4(0xFFC4, 200, 0, 0x00B2, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, + KEEPON4_FLAG_6 | KEEPON4_FLAG_3 | KEEPON4_FLAG_2 | KEEPON4_FLAG_1), + 30, 10), +}; + +/*===================================================================== + * Custom Data: DEATH Setting + *===================================================================== + */ + +CameraModeValue sSetDeathModeNormalData[] = { + CAM_FUNCDATA_KEEP4(0xFFBA, 160, 0, 0, 10, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0), 5, 100), +}; + +CameraModeValue sSetDeathModeJumpData[] = { + CAM_FUNCDATA_KEEP4(0xFFBA, 160, 0, 0, 5, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0), 5, 100), +}; + +CameraModeValue sSetDeathModeDekuShootData[] = { + CAM_FUNCDATA_KEEP4(0xFFBA, 150, 0, 0, 5, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0), 5, 100), +}; + +/*===================================================================== + * Custom Data: REBIRTH Setting + *===================================================================== + */ + +CameraModeValue D_801B5728[] = { + CAM_FUNCDATA_KEEP4( + 0xFFC4, 160, 30, 160, 10, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_2 | KEEPON4_FLAG_1), 5, 100), +}; + +CameraModeValue D_801B574C[] = { + CAM_FUNCDATA_KEEP4( + -20, 140, 30, 160, 10, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_2 | KEEPON4_FLAG_1), 5, 100), +}; + +/*===================================================================== + * Custom Data: LONG_CHEST_OPENING Setting + *===================================================================== + */ + +CameraModeValue sSetLongChestOpeningModeNormalData[] = { + CAM_FUNCDATA_DEMO2(60, 30, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0)), +}; + +/*===================================================================== + * Custom Data: DUNGEON1 Setting + *===================================================================== + */ + +CameraModeValue sSetDungeon1ModeNormalData[] = { + CAM_FUNCDATA_NORM1(-20, 350, 400, 45, 50, 20, 70, 50, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon1ModeJumpData[] = { + CAM_FUNCDATA_NORM1(-20, 350, 400, 40, 50, 20, 50, 50, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon1ModeStillData[] = { + CAM_FUNCDATA_NORM1(-20, 350, 400, 45, 100, 100, 100, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon1ModePushPullData[] = { + CAM_FUNCDATA_PARA1( + 0, 250, 5, 30, 0, 5, 5, 70, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_5 | PARALLEL1_FLAG_1), 30, 0), +}; + +/*===================================================================== + * Custom Data: FIXED1 Setting + *===================================================================== + */ + +CameraModeValue D_801B5824[] = { + CAM_FUNCDATA_FIXD1(-40, 100, 60, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0)), +}; + +/*===================================================================== + * Custom Data: FIXED2 Setting + *===================================================================== + */ + +CameraModeValue D_801B5834[] = { + CAM_FUNCDATA_FIXD1(-40, 10, 60, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0)), +}; + +/*===================================================================== + * Custom Data: MAZE Setting + *===================================================================== + */ + +CameraModeValue sSetMazeModeNormalData[] = { + CAM_FUNCDATA_PARA2(0xFFDD, 160, 65, -5, 2, 70, 99, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, PARALLEL2_FLAG_1)), +}; + +/*===================================================================== + * Custom Data: REMOTEBOMB Setting + *===================================================================== + */ + +CameraModeValue sSetRemoteBombModeNormalData[] = { + CAM_FUNCDATA_NORM2(20, 200, 800, 15, 6, 70, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL2_FLAG_1)), +}; + +/*===================================================================== + * Custom Data: CIRCLE1 Setting + *===================================================================== + */ + +CameraModeValue D_801B5884[] = { + CAM_FUNCDATA_FIXD2(-40, 40, 0x3200, 10, 20, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, FIXED2_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: CIRCLE2 Setting + *===================================================================== + */ + +CameraModeValue D_801B58A0[] = { + CAM_FUNCDATA_FIXD2(-40, 40, 0x3200, 100, 80, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0)), +}; + +/*===================================================================== + * Custom Data: CIRCLE3 Setting + *===================================================================== + */ + +CameraModeValue D_801B58BC[] = { + CAM_FUNCDATA_FIXD2(-40, 40, 0x3200, 100, 80, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +/*===================================================================== + * Custom Data: CIRCLE4 Setting + *===================================================================== + */ + +CameraModeValue D_801B58D8[] = { + CAM_FUNCDATA_FIXD2( + -40, 40, 0x3200, 100, 10, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, FIXED2_FLAG_3 | FIXED2_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: FIXED3 Setting + *===================================================================== + */ + +CameraModeValue D_801B58F4[] = { + CAM_FUNCDATA_FIXD1(-40, 100, 60, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +/*===================================================================== + * Custom Data: CAM_SET_TOWER_ASCENT Setting + *===================================================================== + */ + +CameraModeValue sSetTowerClimbModeNormalData[] = { + CAM_FUNCDATA_NORM0(0, 350, 400, 20, 20, 50, 65, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL0_FLAG_0)), +}; + +CameraModeValue sSetTowerClimbModeJumpData[] = { + CAM_FUNCDATA_NORM1(-20, 340, 400, 10, 30, 12, 40, 65, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetTowerClimbModeStillData[] = { + CAM_FUNCDATA_NORM1(0, 350, 400, 10, 100, 100, 100, 65, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: PARALLEL0 Setting + *===================================================================== + */ + +CameraModeValue D_801B5978[] = { + CAM_FUNCDATA_PARA1( + 0, 400, 20, 0, 0, 20, 5, 70, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_3 | PARALLEL1_FLAG_1), 80, 0), +}; + +/*===================================================================== + * Custom Data: NORMALD Setting + *===================================================================== + */ + +CameraModeValue D_801B59A8[] = { + CAM_FUNCDATA_NORM1( + 0, 400, 0x01F4, 15, 18, 12, 35, 70, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: SUBJECTD Setting + *===================================================================== + */ + +CameraModeValue D_801B59D0[] = { + CAM_FUNCDATA_SUBJ1(0, 5, 50, 10, 0, 0, 10, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0)), +}; + +/*===================================================================== + * Custom Data: START0 Setting + *===================================================================== + */ + +CameraModeValue D_801B59F4[] = { + CAM_FUNCDATA_UNIQ0(0, 100, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, UNIQUE0_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: START2 Setting + *===================================================================== + */ + +CameraModeValue D_801B5A00[] = { + CAM_FUNCDATA_UNIQ0( + 0, 30, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, UNIQUE0_FLAG_4 | UNIQUE0_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: BOAT_CRUISE Setting + *===================================================================== + */ + +CameraModeValue sSetBoatCruiseModeNormalData[] = { + CAM_FUNCDATA_SUBJ1(20, 90, 80, 10, 0, 50, 0xFF38, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +/*===================================================================== + * Custom Data: VERTICAL_CLIMB Setting + *===================================================================== + */ + +CameraModeValue sSetVerticalClimbModeClimbData[] = { + CAM_FUNCDATA_PARA1_ALT(0, 400, 50, 0, 0, 5, 5, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 70, 0, + 50), +}; + +/*===================================================================== + * Custom Data: SIDED Setting + *===================================================================== + */ + +CameraModeValue D_801B5A64[] = { + CAM_FUNCDATA_PARA1(0, 400, 10, 0, 0xFFA6, 20, 5, 70, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_5 | PARALLEL1_FLAG_3 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 70, 0), +}; + +/*===================================================================== + * Custom Data: DUNGEON2 Setting + *===================================================================== + */ + +CameraModeValue sSetDungeon2ModeNormalData[] = { + CAM_FUNCDATA_NORM1(-10, 270, 300, 20, 0x001C, 20, 65, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon2ModeBattleData[] = { + CAM_FUNCDATA_BATT1(-40, 200, 240, 50, 20, 5, 10, 20, 50, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 25, 40), +}; + +CameraModeValue sSetDungeon2ModeJumpData[] = { + CAM_FUNCDATA_NORM1(-20, 270, 300, 40, 50, 20, 50, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon2ModeStillData[] = { + CAM_FUNCDATA_NORM1(-10, 270, 300, 20, 100, 100, 100, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon2ModePushPullData[] = { + CAM_FUNCDATA_PARA1( + 0, 200, 5, 15, 0, 5, 5, 70, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_5 | PARALLEL1_FLAG_1), 30, 0), +}; + +/*===================================================================== + * Custom Data: BOSS_ODOLWA Setting + *===================================================================== + */ + +CameraModeValue sSetBossOdolwaModeNormalData[] = { + CAM_FUNCDATA_NORM1(-20, 250, 350, 10, 24, 12, 40, 65, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetBossOdolwaModeFollowTargetData[] = { + CAM_FUNCDATA_KEEP1(-50, 300, 350, 10, 20, 5, 12, 70, 60, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0), 20), +}; + +CameraModeValue sSetBossOdolwaModeTalkData[] = { + CAM_FUNCDATA_KEEP3( + -20, 230, 260, 20, 10, 20, 15, 40, 55, 20, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, KEEPON3_FLAG_5), 40), +}; + +CameraModeValue sSetBossOdolwaModeBattleData[] = { + CAM_FUNCDATA_BATT1(0xFFC4, 200, 220, 20, 10, 0, 10, 60, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 10, 40), +}; + +CameraModeValue sSetBossOdolwaModeJumpData[] = { + CAM_FUNCDATA_NORM1(-20, 250, 350, 10, 30, 12, 40, 65, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetBossOdolwaModeStillData[] = { + CAM_FUNCDATA_NORM1(-20, 250, 350, 10, 100, 100, 100, 65, 15, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: KEEP_BACK Setting + *===================================================================== + */ + +CameraModeValue D_801B5C80[] = { + CAM_FUNCDATA_PARA1( + 100, 300, -20, 40, 0, 4, 5, 80, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_5 | PARALLEL1_FLAG_1), 60, 20), +}; + +/*===================================================================== + * Custom Data: CIRCLE6 Setting + *===================================================================== + */ + +CameraModeValue D_801B5CB0[] = { + CAM_FUNCDATA_FIXD2( + -40, 60, 0x3200, 10, 20, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, FIXED2_FLAG_1 | FIXED2_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: CIRCLE7 Setting + *===================================================================== + */ + +CameraModeValue D_801B5CCC[] = { + CAM_FUNCDATA_FIXD2(-40, 40, 200, 10, 20, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, FIXED2_FLAG_5)), +}; + +/*===================================================================== + * Custom Data: MINI_BOSS Setting + *===================================================================== + */ + +CameraModeValue sSetMiniBossModeNormalData[] = { + CAM_FUNCDATA_NORM1(-15, 220, 280, 17, 14, 5, 65, 70, 75, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetMiniBossModeFollowTargetData[] = { + CAM_FUNCDATA_KEEP1(0, 200, 250, 25, 45, 40, 15, 40, 60, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 20), +}; + +CameraModeValue sSetMiniBossModeBattleData[] = { + CAM_FUNCDATA_BATT1(-25, 180, 220, 10, 40, 10, 0, 40, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 20, 50), +}; + +CameraModeValue sSetMiniBossModeJumpData[] = { + CAM_FUNCDATA_NORM1(-15, 220, 280, 16, 12, 5, 60, 70, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetMiniBossModeStillData[] = { + CAM_FUNCDATA_NORM1(-15, 220, 280, 16, 100, 100, 100, 70, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: RFIXED1 Setting + *===================================================================== + */ + +CameraModeValue D_801B5DC4[] = { + CAM_FUNCDATA_FIXD1(-40, 10, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, FIXED1_FLAG_4)), +}; + +/*===================================================================== + * Custom Data: TRESURE1 Setting + *===================================================================== + */ + +CameraModeValue sSetTreasureChestMinigameModeNormalData[] = { + CAM_FUNCDATA_NORM1( + -20, 80, 120, -10, 15, 20, 40, 70, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_7 | NORMAL1_FLAG_1)), +}; + +CameraModeValue sSetTreasureChestMinigameModeTargetData[] = { + CAM_FUNCDATA_PARA1( + 0xFFC4, 0x0226, 0, 65, 0, 5, 5, 75, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_6 | PARALLEL1_FLAG_1), 60, 0), +}; + +/*===================================================================== + * Custom Data: BOMBBASKET Setting + *===================================================================== + */ + +CameraModeValue D_801B5E2C[] = { + CAM_FUNCDATA_FIXD2(70, 50, 0x3200, 100, 30, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, FIXED2_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: CIRCLE8 Setting + *===================================================================== + */ + +CameraModeValue D_801B5E48[] = { + CAM_FUNCDATA_FIXD2(-40, 40, 0x3200, 100, 20, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, FIXED2_FLAG_3)), +}; + +/*===================================================================== + * Custom Data: BIRDS_EYE_VIEW_1 Setting + *===================================================================== + */ + +CameraModeValue D_801B5E64[] = { + CAM_FUNCDATA_NORM1( + -20, 800, 800, 60, 50, 10, 50, 45, 90, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_6 | NORMAL1_FLAG_1)), +}; + +CameraModeValue D_801B5E8C[] = { + CAM_FUNCDATA_NORM1(-20, 800, 800, 60, 100, 100, 100, 45, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: DUNGEON3 Setting + *===================================================================== + */ + +CameraModeValue sSetDungeon3ModeNormalData[] = { + CAM_FUNCDATA_NORM1( + -30, 180, 250, -5, 18, 20, 60, 55, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_7 | NORMAL1_FLAG_1)), +}; + +CameraModeValue sSetDungeon3ModeTargetData[] = { + CAM_FUNCDATA_PARA1( + -30, 180, 20, 0, 0, 5, 5, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_6 | PARALLEL1_FLAG_1), 80, 0), +}; + +CameraModeValue sSetDungeon3ModeJumpData[] = { + CAM_FUNCDATA_NORM1(-30, 160, 190, 0, 30, 20, 60, 55, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon3ModeStillData[] = { + CAM_FUNCDATA_NORM1(-40, 0x00AA, 200, 0, 100, 100, 100, 55, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon3ModePushPullData[] = { + CAM_FUNCDATA_PARA1( + 0, 180, 5, 5, 0, 5, 5, 70, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_5 | PARALLEL1_FLAG_1), 30, 0), +}; + +/*===================================================================== + * Custom Data: TELESCOPE Setting + *===================================================================== + */ + +CameraModeValue sSetTelescopeModeNormalData[] = { + CAM_FUNCDATA_SUBJ1(0, 5, 50, 10, 0, 0, 0, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_NONE_ALT, 0)), +}; + +CameraModeValue sSetTelescopeModeTargetData[] = { + CAM_FUNCDATA_SUBJ1(0, 5, 50, 10, 0, 0, 0, 15, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_NONE_ALT, 0)), +}; + +CameraModeValue sSetTelescopeModeFirstPersonData[] = { + CAM_FUNCDATA_SUBJ1(0, 5, 50, 10, 0, 0, 0, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_NONE_ALT, SUBJECT1_FLAG_4)), +}; + +CameraModeValue sSetTelescopeModeDekuHideData[] = { + CAM_FUNCDATA_SUBJ1(0, 5, 50, 0x0001, 0, 0, 0, 45, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_NONE_ALT, SUBJECT1_FLAG_4)), +}; + +/*===================================================================== + * Custom Data: ROOM0 Setting + *===================================================================== + */ + +CameraModeValue D_801B601C[] = { + CAM_FUNCDATA_NORM1(0xFFDD, 100, 220, 15, 0x0011, 12, 35, 65, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B6044[] = { + CAM_FUNCDATA_PARA1(-10, 200, 50, 0, 0, 5, 5, 65, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_6 | PARALLEL1_FLAG_4 | PARALLEL1_FLAG_1), + 60, 0), +}; + +CameraModeValue D_801B6074[] = { + CAM_FUNCDATA_KEEP1(-30, 60, 200, 20, 40, -5, 10, 30, 45, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 30), +}; + +CameraModeValue D_801B60A4[] = { + CAM_FUNCDATA_KEEP3( + -20, 50, 100, 50, 5, 20, 5, 40, 35, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, KEEPON3_FLAG_5), 60), +}; + +CameraModeValue D_801B60D8[] = { + CAM_FUNCDATA_BATT1(-25, 100, 140, 10, 40, -2, 10, 25, 50, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 25, 50), +}; + +CameraModeValue D_801B610C[] = { + CAM_FUNCDATA_JUMP2(-20, 100, 220, 20, 5, 5, 65, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue D_801B6130[] = { + CAM_FUNCDATA_JUMP2(-20, 120, 240, 20, 999, 5, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, JUMP2_FLAG_2 | JUMP2_FLAG_1)), +}; + +CameraModeValue D_801B6154[] = { + CAM_FUNCDATA_NORM1(-30, 100, 220, 10, 30, 12, 80, 65, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B617C[] = { + CAM_FUNCDATA_PARA1(-40, 200, 50, 40, 0, 8, 5, 65, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_7 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 60, 12), +}; + +CameraModeValue D_801B61AC[] = { + CAM_FUNCDATA_PARA1(0xFFB0, 240, 50, 70, 0, 12, 5, 45, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_7 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 60, 2), +}; + +CameraModeValue D_801B61DC[] = { + CAM_FUNCDATA_PARA1( + -10, 200, 100, 70, 0, 4, 5, 70, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_7 | PARALLEL1_FLAG_3), 65, 12), +}; + +CameraModeValue D_801B620C[] = { + CAM_FUNCDATA_PARA1(0xFFB0, 240, -20, 50, 0, 50, 5, 80, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0), 65, 10), +}; + +CameraModeValue D_801B623C[] = { + CAM_FUNCDATA_PARA1(0xFFB0, 240, -20, 40, 0, 50, 5, 80, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 65, 0), +}; + +CameraModeValue D_801B626C[] = { + CAM_FUNCDATA_NORM1(-20, 100, 220, 10, 100, 100, 100, 65, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B6294[] = { + CAM_FUNCDATA_PARA1(0, 200, 5, 45, 0, 5, 5, 70, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_5 | PARALLEL1_FLAG_4 | PARALLEL1_FLAG_1), + 80, 0), +}; + +CameraModeValue D_801B62C4[] = { + CAM_FUNCDATA_KEEP1(-5, 120, 140, 5, 85, 10, 5, 25, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 30), +}; + +CameraModeValue D_801B62F4[] = { + CAM_FUNCDATA_NORM1(50, 140, 220, 0, 0xC, 10, 40, 90, 90, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_2 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B631C[] = { + CAM_FUNCDATA_PARA1( + 100, 220, -20, 40, 0, 4, 5, 80, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, PARALLEL1_FLAG_5 | PARALLEL1_FLAG_1), 80, + 20), +}; + +CameraModeValue D_801B634C[] = { + CAM_FUNCDATA_NORM1(0xFFC4, 150, 250, 40, 20, 12, 40, 80, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B6374[] = { + CAM_FUNCDATA_PARA1(0xFFC4, 220, 20, 10, 0, 5, 5, 60, 90, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_3 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 90, 0), +}; + +CameraModeValue D_801B63A4[] = { + CAM_FUNCDATA_NORM1( + -10, 120, 240, 0, 18, 12, 40, 80, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_2 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B63CC[] = { + CAM_FUNCDATA_PARA1(0, 220, 50, 0, 0, 5, 5, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 60, 0), +}; + +/*===================================================================== + * Custom Data: RCIRC0 Setting + *===================================================================== + */ + +CameraModeValue D_801B63FC[] = { + CAM_FUNCDATA_FIXD2( + -10, 40, 0x3200, 100, 20, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, FIXED2_FLAG_4 | FIXED2_FLAG_3)), +}; + +/*===================================================================== + * Custom Data: CIRC9 Setting + *===================================================================== + */ + +CameraModeValue D_801B6418[] = { + CAM_FUNCDATA_FIXD2(-40, 40, 0x3200, 5, 25, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, FIXED2_FLAG_2 | FIXED2_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: ONTHEPOLE Setting + *===================================================================== + */ + +CameraModeValue D_801B6434[] = { + CAM_FUNCDATA_NORM1(-15, 60, 600, 35, 40, 20, 60, 45, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_1)), +}; + +CameraModeValue D_801B645C[] = { + CAM_FUNCDATA_PARA1( + 0, 300, 5, 35, 0, 5, 5, 60, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_6 | PARALLEL1_FLAG_1), 80, 0), +}; + +CameraModeValue D_801B648C[] = { + CAM_FUNCDATA_NORM1(-10, 320, 0x017C, 30, 0x0016, 10, 0x0020, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B64B4[] = { + CAM_FUNCDATA_JUMP2(-20, 280, 320, 20, 5, 5, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue D_801B64D8[] = { + CAM_FUNCDATA_JUMP2(-20, 280, 320, 20, 999, 5, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, JUMP2_FLAG_2 | JUMP2_FLAG_1)), +}; + +CameraModeValue D_801B64FC[] = { + CAM_FUNCDATA_PARA1(-40, 320, 50, 40, 0, 8, 5, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_7 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 50, 12), +}; + +CameraModeValue D_801B652C[] = { + CAM_FUNCDATA_PARA1(0xFFB0, 300, 50, 70, 0, 12, 5, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, + PARALLEL1_FLAG_7 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1), + 50, 2), +}; + +CameraModeValue D_801B655C[] = { + CAM_FUNCDATA_NORM1(-15, 340, 350, 30, 100, 100, 100, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: INBUSH Setting + *===================================================================== + */ + +CameraModeValue D_801B6584[] = { + CAM_FUNCDATA_NORM1( + 0, 260, 280, 20, 20, 12, 50, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_7 | NORMAL1_FLAG_1)), +}; + +CameraModeValue D_801B65AC[] = { + CAM_FUNCDATA_PARA1(10, 260, 50, 15, 0, 5, 5, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 60, 0), +}; + +CameraModeValue D_801B65DC[] = { + CAM_FUNCDATA_KEEP1(10, 200, 220, 20, 40, 20, 30, 15, 45, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 30), +}; + +CameraModeValue D_801B660C[] = { + CAM_FUNCDATA_KEEP3( + 10, 180, 200, 30, 10, 30, 30, 70, 45, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, KEEPON3_FLAG_6), 60), +}; + +CameraModeValue D_801B6640[] = { + CAM_FUNCDATA_BATT1(10, 220, 220, 10, 80, 20, 30, 25, 50, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 25, 60), +}; + +CameraModeValue D_801B6674[] = { + CAM_FUNCDATA_SUBJ1(0, 10, 60, 10, 0, 50, 0, 45, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), +}; + +CameraModeValue D_801B6698[] = { + CAM_FUNCDATA_NORM1(0, 260, 280, 40, 20, 12, 40, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1)), +}; + +CameraModeValue D_801B66C0[] = { + CAM_FUNCDATA_NORM1(0, 260, 280, 20, 100, 100, 100, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: BOSS_MAJORA Setting + *===================================================================== + */ + +CameraModeValue sSetBossMajoraModeNormalData[] = { + CAM_FUNCDATA_NORM1(0, 280, 320, -5, 24, 12, 0x0020, 65, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetBossMajoraModeFollowTargetData[] = { + CAM_FUNCDATA_KEEP1(-30, 240, 260, 20, 40, 10, 5, 60, 50, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0), 30), +}; + +CameraModeValue sSetBossMajoraModeBattleData[] = { + CAM_FUNCDATA_BATT1(0xFFC4, 180, 200, 10, 20, 20, 10, 20, 70, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 10, 40), +}; + +CameraModeValue sSetBossMajoraModeJumpData[] = { + CAM_FUNCDATA_NORM1(-20, 280, 320, 10, 30, 12, 40, 65, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetBossMajoraModeStillData[] = { + CAM_FUNCDATA_NORM1(0, 280, 320, 0, 100, 100, 100, 65, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: BOSS_TWINMOLD Setting + *===================================================================== + */ + +CameraModeValue sSetBossTwinmoldModeNormalData[] = { + CAM_FUNCDATA_NORM1(20, 350, 400, 0, 0x001A, 12, 0x0020, 75, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetBossTwinmoldModeTargetData[] = { + CAM_FUNCDATA_PARA1(0, 400, 50, 0, 0, 5, 5, 55, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 60, 0), +}; + +CameraModeValue sSetBossTwinmoldModeFollowTargetData[] = { + CAM_FUNCDATA_KEEP1(-30, 250, 300, 20, 40, 10, 5, 60, 50, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0), 30), +}; + +CameraModeValue sSetBossTwinmoldModeBattleData[] = { + CAM_FUNCDATA_BATT1(0, 150, 200, 10, 30, 10, 0, 20, 70, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 10, 40), +}; + +CameraModeValue sSetBossTwinmoldModeJumpData[] = { + CAM_FUNCDATA_NORM1(-20, 350, 400, 10, 30, 12, 40, 75, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetBossTwinmoldModeStillData[] = { + CAM_FUNCDATA_NORM1(-20, 280, 320, 10, 100, 100, 100, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_4 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: BOSS_GOHT Setting + *===================================================================== + */ + +CameraModeValue sSetBossGohtModeNormalData[] = { + CAM_FUNCDATA_NORM1(-20, 280, 320, 10, 20, 12, 50, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetBossGohtModeBattleData[] = { + CAM_FUNCDATA_BATT1(-25, 220, 220, 10, 80, -2, 10, 25, 50, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 25, 50), +}; + +CameraModeValue sSetBossGohtModeJumpData[] = { + CAM_FUNCDATA_NORM1(-20, 280, 320, 10, 30, 12, 40, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetBossGohtModeStillData[] = { + CAM_FUNCDATA_NORM1(-20, 280, 320, 10, 100, 100, 100, 60, 15, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetBossGohtModeGoronDashData[] = { + CAM_FUNCDATA_NORM1(60, 200, 340, 10, 15, 10, 50, 85, 90, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_2 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: BOSS_GYORG Setting + *===================================================================== + */ + +CameraModeValue sSetBossGyorgModeNormalData[] = { + CAM_FUNCDATA_JUMP3(-20, 280, 320, 10, 20, 12, 40, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_7 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetBossGyorgModeFollowTargetData[] = { + CAM_FUNCDATA_KEEP1(-30, 200, 240, 20, 40, -5, 10, 15, 45, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 30), +}; + +CameraModeValue sSetBossGyorgModeBattleData[] = { + CAM_FUNCDATA_BATT1(-30, 190, 250, 10, 50, 0, 10, 20, 50, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 25, 50), +}; + +CameraModeValue sSetBossGyorgModeGoronJumpData[] = { + CAM_FUNCDATA_JUMP3(-40, 160, 260, -5, 18, 5, 40, 70, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_3 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetBossGyorgModeDekuFlyData[] = { + CAM_FUNCDATA_JUMP3(-30, 220, 280, 0, 18, 5, 60, 60, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_2 | JUMP3_FLAG_0)), +}; + +CameraModeValue sSetBossGyorgModeDekuHideData[] = { + CAM_FUNCDATA_JUMP3( + 0xFFC4, 160, 280, -15, 18, 5, 60, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_7 | JUMP3_FLAG_2 | JUMP3_FLAG_0)), +}; + +CameraModeValue sSetBossGyorgModeStillData[] = { + CAM_FUNCDATA_NORM1(-40, 100, 320, 20, 100, 100, 100, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: PINNACLE_ROCK Setting + *===================================================================== + */ + +CameraModeValue sSetPinnacleRockModeNormalData[] = { + CAM_FUNCDATA_JUMP3(-40, 250, 350, 30, 15, 5, 40, 60, 100, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_7 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetPinnacleRockModeTargetData[] = { + CAM_FUNCDATA_PARA1( + -50, 350, 40, 10, 0, 15, 5, 60, 100, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1 | PARALLEL1_FLAG_0), 80, 0), +}; + +CameraModeValue sSetPinnacleRockModeGoronJumpData[] = { + CAM_FUNCDATA_JUMP3(-40, 320, 400, -5, 18, 5, 40, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_3 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetPinnacleRockModeDekuFlyData[] = { + CAM_FUNCDATA_JUMP3(-40, 300, 350, 10, 18, 5, 60, 60, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_2 | JUMP3_FLAG_0)), +}; + +CameraModeValue sSetPinnacleRockModeDekuHideData[] = { + CAM_FUNCDATA_JUMP3( + 0xFFC4, 150, 250, -18, 18, 5, 60, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_7 | JUMP3_FLAG_2 | JUMP3_FLAG_0)), +}; + +CameraModeValue sSetPinnacleRockModeStillData[] = { + CAM_FUNCDATA_NORM1(-40, 250, 350, 30, 100, 100, 100, 60, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetPinnacleRockModeGoronDashData[] = { + CAM_FUNCDATA_JUMP3(-40, 250, 280, 5, 0x0011, 5, 40, 75, 35, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_3 | JUMP3_FLAG_2)), +}; + +/*===================================================================== + * Custom Data: NORMAL2 Setting + *===================================================================== + */ + +CameraModeValue sSetNormal2ModeNormalData[] = { + CAM_FUNCDATA_NORM1(-10, 350, 400, 14, 25, 14, 60, 65, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetNormal2ModeTargetData[] = { + CAM_FUNCDATA_PARA1(0, 350, 80, 0, 0, 5, 5, 50, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 60, 0), +}; + +CameraModeValue sSetNormal2ModeJumpData[] = { + CAM_FUNCDATA_NORM1(-10, 350, 0x01A4, 10, 30, 10, 40, 65, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetNormal2ModeStillData[] = { + CAM_FUNCDATA_NORM1(-10, 350, 400, 14, 100, 100, 100, 65, 16, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: BOMBBOWL Setting + *===================================================================== + */ + +CameraModeValue D_801B6C98[] = { + CAM_FUNCDATA_NORM1(-30, 300, 320, 15, 0x0016, 12, 30, 55, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B6CC0[] = { + CAM_FUNCDATA_KEEP1(-30, 180, 200, 20, 30, -5, 10, 40, 45, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 30), +}; + +CameraModeValue D_801B6CF0[] = { + CAM_FUNCDATA_KEEP3( + -30, 65, 70, 10, 10, 5, 5, 20, 45, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, KEEPON3_FLAG_5), 50), +}; + +CameraModeValue D_801B6D24[] = { + CAM_FUNCDATA_NORM1(-20, 300, 320, 10, 30, 12, 40, 55, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B6D4C[] = { + CAM_FUNCDATA_NORM1(-30, 300, 320, 15, 100, 100, 100, 55, 25, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: CIRCA Setting + *===================================================================== + */ + +CameraModeValue D_801B6D74[] = { + CAM_FUNCDATA_FIXD2(-40, 60, 0x3200, 100, 20, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, + FIXED2_FLAG_3 | FIXED2_FLAG_1 | FIXED2_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: WHIRLPOOL Setting + *===================================================================== + */ + +CameraModeValue sSetWhirlpoolModeNormalData[] = { + CAM_FUNCDATA_JUMP3( + -10, 280, 350, 50, 12, 5, 30, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_7 | JUMP3_FLAG_5 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetWhirlpoolModeFreeFallData[] = { + CAM_FUNCDATA_JUMP3(0, 180, 300, 30, 12, 5, 25, 75, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_4 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetWhirlpoolModeGoronJumpData[] = { + CAM_FUNCDATA_JUMP3( + -40, 320, 350, -5, 12, 5, 25, 65, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_4 | JUMP3_FLAG_3 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetWhirlpoolModeDekuFlyData[] = { + CAM_FUNCDATA_JUMP3( + -40, 300, 350, 10, 15, 5, 30, 65, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_5 | JUMP3_FLAG_2 | JUMP3_FLAG_0)), +}; + +CameraModeValue sSetWhirlpoolModeDekuHideData[] = { + CAM_FUNCDATA_JUMP3( + 0xFFC4, 150, 250, -18, 15, 5, 30, 60, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_7 | JUMP3_FLAG_4 | JUMP3_FLAG_2)), +}; + +CameraModeValue sSetWhirlpoolModeGoronDashData[] = { + CAM_FUNCDATA_JUMP3( + -40, 220, 260, 5, 8, 5, 20, 75, 35, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_4 | JUMP3_FLAG_3 | JUMP3_FLAG_2)), +}; + +/*===================================================================== + * Custom Data: CUCCO_SHACK Setting + *===================================================================== + */ + +CameraModeValue sSetCuccoShackModeNormalData[] = { + CAM_FUNCDATA_NORM1(0xFFBA, 250, 0x01F4, 5, 30, 12, 45, 50, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetCuccoShackModeStillData[] = { + CAM_FUNCDATA_NORM1(-40, 250, 0x01F4, 5, 100, 100, 100, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetCuccoShackModeDekuHideData[] = { + CAM_FUNCDATA_NORM1(-40, 250, 0x01F4, 5, 25, 12, 40, 50, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: GIANT Setting + *===================================================================== + */ + +CameraModeValue sSetGiantModeNormalData[] = { + CAM_FUNCDATA_NORM1(-40, 150, 160, -15, 25, 14, 50, 50, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetGiantModeTargetData[] = { + CAM_FUNCDATA_PARA1(-40, 180, 80, 0, 0, 5, 5, 50, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 60, 0), +}; + +CameraModeValue sSetGiantModeJumpData[] = { + CAM_FUNCDATA_NORM1(-10, 100, 150, 10, 30, 10, 40, 70, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetGiantModeStillData[] = { + CAM_FUNCDATA_NORM1(-40, 150, 160, 0xFFF4, 25, 14, 50, 50, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/*===================================================================== + * Custom Data: SCENE0 Setting + *===================================================================== + */ + +CameraModeValue D_801B6FA0[] = { + CAM_FUNCDATA_UNIQ2(-40, 20, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + UNIQUE2_FLAG_5 | UNIQUE2_FLAG_4 | UNIQUE2_FLAG_1)), +}; + +/*===================================================================== + * Custom Data: ROOM1 Setting + *===================================================================== + */ + +CameraModeValue D_801B6FB0[] = { + CAM_FUNCDATA_NORM1(-15, 120, 250, 16, 16, 5, 65, 60, 75, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B6FD8[] = { + CAM_FUNCDATA_KEEP1(-20, 100, 150, 0, 4, 20, 10, 40, 60, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_0), 20), +}; + +CameraModeValue D_801B7008[] = { + CAM_FUNCDATA_BATT1(-25, 100, 180, 10, 40, 10, 0, 40, 60, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_1), 20, 50), +}; + +CameraModeValue D_801B703C[] = { + CAM_FUNCDATA_NORM1(-15, 120, 250, 16, 12, 5, 60, 70, 40, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B7064[] = { + CAM_FUNCDATA_NORM1(-15, 120, 250, 16, 100, 100, 100, 70, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_5 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue D_801B708C[] = { + CAM_FUNCDATA_PARA1( + 0, 200, 5, 30, 0, 5, 5, 70, 30, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_5 | PARALLEL1_FLAG_1), 80, 0), +}; + +/*===================================================================== + * Custom Data: WATER2 Setting + *===================================================================== + */ + +CameraModeValue D_801B70BC[] = { + CAM_FUNCDATA_JUMP3(-10, 270, 300, 20, 30, 20, 65, 60, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_7 | JUMP3_FLAG_2)), +}; + +CameraModeValue D_801B70E4[] = { + CAM_FUNCDATA_PARA1( + -30, 280, 40, 10, 0, 15, 5, 60, 100, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1 | PARALLEL1_FLAG_0), 60, 0), +}; + +CameraModeValue D_801B7114[] = { + CAM_FUNCDATA_KEEP3(-20, 50, 100, 50, 5, 20, 10, 40, 45, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, 0), + 60), +}; + +CameraModeValue D_801B7148[] = { + CAM_FUNCDATA_JUMP3(-40, 180, 200, 5, 20, 5, 40, 75, 35, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, JUMP3_FLAG_3 | JUMP3_FLAG_2)), +}; + +/*===================================================================== + * Custom Data: FORCEKEEP Setting + *===================================================================== + */ + +CameraModeValue D_801B7170[] = { + CAM_FUNCDATA_KEEP1( + -30, 180, 200, 20, 40, -5, 10, 15, 45, 60, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, KEEPON1_FLAG_4 | KEEPON1_FLAG_0), 30), +}; + +CameraModeValue D_801B71A0[] = { + CAM_FUNCDATA_BATT1( + -30, 150, 250, 10, 60, -5, 20, 35, 55, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, BATTLE1_FLAG_4 | BATTLE1_FLAG_1), 25, 40), +}; + +/*===================================================================== + * Custom Data: PARALLEL1 Setting + *===================================================================== + */ + +CameraModeValue D_801B71D4[] = { + CAM_FUNCDATA_PARA1( + 0, 400, 20, 20, 0, 20, 5, 70, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_3 | PARALLEL1_FLAG_1), 80, 0), +}; + +/*===================================================================== + * Custom Data: START1 Setting + *===================================================================== + */ + +CameraModeValue D_801B7204[] = { + CAM_FUNCDATA_UNIQ0(0, 100, CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, UNIQUE0_FLAG_1)), +}; + +/*===================================================================== + * Custom Data: ROOM2 Setting + *===================================================================== + */ + +CameraModeValue D_801B7210[] = { + CAM_FUNCDATA_KEEP3( + -10, 120, 180, 50, 5, 10, 5, 70, 35, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, KEEPON3_FLAG_5), 60), +}; + +/*===================================================================== + * Custom Data: NORMAL4 Setting + *===================================================================== + */ + +CameraModeValue sSetNormal4ModeTalkData[] = { + CAM_FUNCDATA_KEEP3( + -20, 0x006E, 160, 80, 15, 10, 0, 70, 40, 50, 20, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, KEEPON3_FLAG_5), 50), +}; + +/*===================================================================== + * Custom Data: ELEGY_SHELL Setting + *===================================================================== + */ + +CameraModeValue sSetElegyShellModeNormalData[] = { + CAM_FUNCDATA_KEEP4(-45, 150, -10, 165, 5, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 30), +}; + +CameraModeValue sSetElegyShellModeJumpData[] = { + CAM_FUNCDATA_KEEP4(-40, 150, 18, 140, 5, 70, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 30), +}; + +CameraModeValue sSetElegyShellModeDekuShootData[] = { + CAM_FUNCDATA_KEEP4(-20, 150, -2, 140, 15, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 30), +}; + +CameraModeValue sSetElegyShellModeGoronDashData[] = { + CAM_FUNCDATA_KEEP4(-50, 150, 0xFFF4, 160, 6, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_1), 25, 30), +}; + +CameraModeValue sSetElegyShellModeDekuFlyData[] = { + CAM_FUNCDATA_KEEP4( + 0xFFC4, 150, 0xFFF4, 0xFF74, 30, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, KEEPON4_FLAG_3 | KEEPON4_FLAG_2), 25, 30), +}; + +/*===================================================================== + * Custom Data: DUNGEON4 Setting + *===================================================================== + */ + +CameraModeValue sSetDungeon4ModeNormalData[] = { + CAM_FUNCDATA_NORM1(0, 150, 250, -5, 16, 5, 0x0034, 55, 80, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon4ModeTargetData[] = { + CAM_FUNCDATA_PARA1(0, 200, 25, 5, 0, 5, 5, 45, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, PARALLEL1_FLAG_1), 80, 0), +}; + +CameraModeValue sSetDungeon4ModeJumpData[] = { + CAM_FUNCDATA_NORM1(0, 150, 250, 0, 24, 5, 50, 55, 50, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, + NORMAL1_FLAG_7 | NORMAL1_FLAG_3 | NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +CameraModeValue sSetDungeon4ModeStillData[] = { + CAM_FUNCDATA_NORM1( + 0, 180, 220, 5, 100, 100, 100, 55, 10, + CAM_INTERFACE_FLAGS(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_ALL, NORMAL1_FLAG_1 | NORMAL1_FLAG_0)), +}; + +/** + * ===================================================================== + * CAMERA SETTINGS: USAGE OF FUNCTIONS AND DATA FOR SPECIFIC MODES + * ===================================================================== + */ + +#define CAM_SETTING_MODE_ENTRY(func, data) \ + { func, ARRAY_COUNT(data), data } + +#define CAM_SETTING_MODE_NULL \ + { CAM_FUNC_NONE, 0, NULL } + +CameraMode sCamSetNormal0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronJumpData), // CAM_MODE_GORONJUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBoomerangData), // CAM_MODE_BOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeZData), // CAM_MODE_CHARGEZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_ZORAFINZ +}; + +CameraMode sCamSetNormal3Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal3ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_NULL, // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal3ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLYZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeGoronJumpData), // CAM_MODE_GORONJUMP +}; + +CameraMode sCamSetPivotDivingModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE2, sSetPivotDivingModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_NULL, // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_NULL, // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_NULL, // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE2, sSetPivotDivingModeTargetData), // CAM_MODE_TARGET +}; + +CameraMode sCamSetHorseModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL3, sSetHorseModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL3, sSetHorseModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_NULL, // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_NULL, // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetHorseModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL3, sSetHorseModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetHorseModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetHorseModeSlingShotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetHorseModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetHorseModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL3, sSetHorseModeStillData), // CAM_MODE_STILL +}; + +CameraMode sCamSetZoraDivingModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL3, sSetZoraDivingModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetPreRendFixedModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED3, sSetPrerendFixedModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetPreRendPivotModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE7, sSetPrerendPivotModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetDoorCModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL9, sSetDoorCModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetDemo0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_DEMO1, D_801B4EF0), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetFree0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE6, sSetCutscenesModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetFukan0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B4EF8), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B4F50), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B4F20), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B4F78), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B4EF8), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetNormal1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal1ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal1ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetNanameModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL4, D_801B4FF0), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetCirc0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5018), // CAM_MODE_NORMAL + CAM_SETTING_MODE_NULL, // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5034), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5050), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT +}; + +CameraMode sCamSetFixed0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED1, D_801B506C), // CAM_MODE_NORMAL + CAM_SETTING_MODE_NULL, // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT +}; + +CameraMode sCamSetSpiralDoorModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL8, sSetSpiralDoorModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetDungeon0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon0ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetDungeon0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon0ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronJumpData), // CAM_MODE_GORONJUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBoomerangData), // CAM_MODE_BOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeZData), // CAM_MODE_CHARGEZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_ZORAFINZ +}; + +CameraMode sCamSetItem0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5338), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B535C), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B53A4), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5380), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B53C8), // CAM_MODE_DEKUFLY +}; + +CameraMode sCamSetItem1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B53EC), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5410), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5458), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5434), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B547C), // CAM_MODE_DEKUFLY +}; + +CameraMode sCamSetItem2Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B54A0), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B54C4), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B550C), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B54E8), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5530), // CAM_MODE_DEKUFLY +}; + +CameraMode sCamSetItem3Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5554), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5578), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B55C0), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B559C), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B55E4), // CAM_MODE_DEKUFLY +}; + +CameraMode sCamSetNaviModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE6, sSetCutscenesModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetWarp0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5608), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B562C), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5674), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5650), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5698), // CAM_MODE_DEKUFLY +}; + +CameraMode sCamSetDeathModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetDeathModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetDeathModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetDeathModeJumpData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetDeathModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetDeathModeJumpData), // CAM_MODE_DEKUFLY +}; + +CameraMode sCamSetRebirthModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5728), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5728), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5728), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B574C), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, D_801B5728), // CAM_MODE_DEKUFLY +}; + +CameraMode sCamSetLongChestOpeningModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_DEMO2, sSetLongChestOpeningModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetMaskTransformationModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_DEMO4, sSetCutscenesModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_DEMO5, sSetCutscenesModeNormalData), // CAM_MODE_JUMP +}; + +CameraMode sCamSetAttentionModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_DEMO1, sSetCutscenesModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetWarp1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_DEMO3, sSetCutscenesModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetDungeon1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon1ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon1ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetDungeon0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon1ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon1ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetFixed1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED1, D_801B5824), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetFixed2Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED1, D_801B5834), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetMazeModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL2, sSetMazeModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetRemoteBombModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL2, sSetRemoteBombModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetCirc1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5884), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetCirc2Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B58A0), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetCirc3Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B58BC), // CAM_MODE_NORMAL + CAM_SETTING_MODE_NULL, // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5034), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5050), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT +}; + +CameraMode sCamSetCirc4Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B58D8), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetFixed3Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED1, D_801B58F4), // CAM_MODE_NORMAL + CAM_SETTING_MODE_NULL, // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT +}; + +CameraMode sCamSetTowerClimbModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL0, sSetTowerClimbModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetTowerClimbModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetTowerClimbModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetParallel0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B5978), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetNormDModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B59A8), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetSubjectDModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, D_801B59D0), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetStart0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE0, D_801B59F4), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetStart2Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE0, D_801B5A00), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetStop0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE6, sSetCutscenesModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetBoatCruiseModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetBoatCruiseModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_NULL, // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_NULL, // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW +}; + +CameraMode sCamSetVerticalClimbModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetVerticalClimbModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetVerticalClimbModeClimbData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetSidedModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B5A64), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetDungeon2Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon2ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon2ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetDungeon2ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon2ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon2ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetBossOdolwaModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossOdolwaModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossOdolwaModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetBossOdolwaModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetBossOdolwaModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetBossOdolwaModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossOdolwaModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetKeepBackModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B5C80), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetVerticalClimbModeClimbData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetCirc6Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5CB0), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetCirc7Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5CCC), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetMiniBossModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetMiniBossModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetMiniBossModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetMiniBossModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetMiniBossModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetMiniBossModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetRFixed1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED1, D_801B5DC4), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetTreasureChestMinigameModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetTreasureChestMinigameModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_NULL, // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_NULL, // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_NULL, // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetTreasureChestMinigameModeTargetData), // CAM_MODE_TARGET +}; + +CameraMode sCamSetBombBasketModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5E2C), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetCirc8Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5E48), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetFukan1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B5E64), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B4F50), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B4F20), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B5E8C), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B4EF8), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetDungeon3Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon3ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon3ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon3ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetDungeon0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon3ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon3ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetTelescopeModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetTelescopeModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_NULL, // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetTelescopeModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_NULL, // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_NULL, // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetTelescopeModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TALK + CAM_SETTING_MODE_NULL, // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROW + CAM_SETTING_MODE_NULL, // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetTelescopeModeDekuHideData), // CAM_MODE_DEKUHIDE +}; + +CameraMode sCamSetRoom0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B601C), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B6154), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B62F4), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B634C), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B62C4), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B6074), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B6044), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, D_801B60A4), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, D_801B60D8), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B631C), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B626C), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B620C), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, D_801B610C), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, D_801B6130), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B61DC), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B617C), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B61AC), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B6294), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B6374), // CAM_MODE_DEKUFLYZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B63A4), // CAM_MODE_GORONJUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBoomerangData), // CAM_MODE_BOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B623C), // CAM_MODE_CHARGEZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B63CC), // CAM_MODE_ZORAFINZ +}; + +CameraMode sCamSetRCirc0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B63FC), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetCirc9Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B6418), // CAM_MODE_NORMAL + CAM_SETTING_MODE_NULL, // CAM_MODE_JUMP + CAM_SETTING_MODE_NULL, // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5034), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_NULL, // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B5050), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT +}; + +CameraMode sCamSetOnThePoleModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B6434), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B648C), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B645C), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetDungeon0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B655C), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, D_801B64B4), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, D_801B64D8), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B64FC), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B652C), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon1ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetInBushModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B6584), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B6698), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, D_801B6674), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B65DC), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B65AC), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, D_801B660C), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, D_801B6640), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B66C0), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B4EF8), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetBossMajoraModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossMajoraModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossMajoraModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetBossMajoraModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetBossMajoraModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossMajoraModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetBossTwinmoldModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossTwinmoldModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossTwinmoldModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetBossTwinmoldModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetBossTwinmoldModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetBossTwinmoldModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossTwinmoldModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetBossGohtModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossGohtModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossGohtModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossGohtModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetBossGohtModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossGohtModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetBossGyorgModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetBossGyorgModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetBossGyorgModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetBossGyorgModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_NULL, // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetBossGyorgModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetBossGyorgModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetBossGyorgModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLYZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetBossGyorgModeGoronJumpData), // CAM_MODE_GORONJUMP +}; + +CameraMode sCamSetConnect0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_DEMO0, sSetCutscenesModeNormalData), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetPinnacleRockModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetPinnacleRockModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetPinnacleRockModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetPinnacleRockModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetPinnacleRockModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_NULL, // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetPinnacleRockModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetPinnacleRockModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLYZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetPinnacleRockModeGoronJumpData), // CAM_MODE_GORONJUMP +}; + +CameraMode sCamSetNormal2Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal2ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal2ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal2ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal2ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetBombBowlModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B6C98), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B6D24), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B62F4), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B634C), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B62C4), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B6CC0), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B6044), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, D_801B6CF0), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, D_801B60D8), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B631C), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B6D4C), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B620C), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, D_801B610C), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, D_801B6130), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B61DC), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B617C), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B61AC), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B6294), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B6374), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetCircAModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXED2, D_801B6D74), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetWhirlpoolModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetWhirlpoolModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetWhirlpoolModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetWhirlpoolModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetPinnacleRockModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_NULL, // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetWhirlpoolModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetWhirlpoolModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLYZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetWhirlpoolModeGoronJumpData), // CAM_MODE_GORONJUMP +}; + +CameraMode sCamSetCuccoShackModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetCuccoShackModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal2ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal2ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetCuccoShackModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetCuccoShackModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL +}; + +CameraMode sCamSetGiantModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetGiantModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetGiantModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetGiantModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetGiantModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetScene0Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE2, D_801B6FA0), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetRoom1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B6FB0), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B703C), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B62C4), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B6FD8), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, D_801B60A4), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, D_801B7008), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B7064), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B708C), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetWater2Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, D_801B70BC), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, D_801B7148), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B70E4), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, D_801B7114), // CAM_MODE_TALK + CAM_SETTING_MODE_NULL, // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal3ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_NULL, // CAM_MODE_DEKUFLYZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP3, sSetNormal3ModeGoronJumpData), // CAM_MODE_GORONJUMP +}; + +CameraMode sCamSetWoodfallSwampModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE3, D_801B6584), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE3, D_801B6698), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE3, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE3, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, D_801B6674), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B65DC), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE4, D_801B65AC), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, D_801B660C), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE5, D_801B6640), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE4, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE3, D_801B66C0), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE4, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE4, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE4, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE4, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE3, D_801B6584), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE4, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetForceKeepModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B7170), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, D_801B71A0), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetParallel1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B71D4), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetStart1Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQUE0, D_801B7204), // CAM_MODE_NORMAL +}; + +CameraMode sCamSetRoom2Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B6FB0), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B703C), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B62C4), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, D_801B6FD8), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, D_801B7210), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, D_801B7008), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, D_801B7064), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, D_801B708C), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetNorm4Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetNormal0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal4ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetNormal0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraMode sCamSetElegyShellModes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetElegyShellModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetElegyShellModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetElegyShellModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetElegyShellModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_NULL, // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON4, sSetElegyShellModeDekuFlyData), // CAM_MODE_DEKUFLY +}; + +CameraMode sCamSetDungeon4Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon4ModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon4ModeJumpData), // CAM_MODE_JUMP + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeGoronDashData), // CAM_MODE_GORONDASH + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeDekuShootData), // CAM_MODE_DEKUSHOOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowZData), // CAM_MODE_BOWARROWZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetNormal0ModeDekuFlyData), // CAM_MODE_DEKUFLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRSTPERSON + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowBoomerangData), // CAM_MODE_FOLLOWBOOMERANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeZoraFinData), // CAM_MODE_ZORAFIN + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON1, sSetDungeon0ModeFollowTargetData), // CAM_MODE_FOLLOWTARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon4ModeTargetData), // CAM_MODE_TARGET + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEPON3, sSetNormal0ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeSlingshotData), // CAM_MODE_SLINGSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJECT1, sSetNormal0ModeBowArrowData), // CAM_MODE_BOWARROW + CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATTLE1, sSetDungeon0ModeBattleData), // CAM_MODE_BATTLE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuHideData), // CAM_MODE_DEKUHIDE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORMAL1, sSetDungeon4ModeStillData), // CAM_MODE_STILL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeChargeData), // CAM_MODE_CHARGE + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbData), // CAM_MODE_CLIMB + CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetDungeon0ModeClimbZData), // CAM_MODE_CLIMBZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_SPECIAL5, sSetNormal0ModeHookshotData), // CAM_MODE_HOOKSHOT + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeFreeFallData), // CAM_MODE_FREEFALL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangData), // CAM_MODE_HANG + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModeHangZData), // CAM_MODE_HANGZ + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetDungeon0ModePushPullData), // CAM_MODE_PUSHPULL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARALLEL1, sSetNormal0ModeDekuFlyZData), // CAM_MODE_DEKUFLYZ +}; + +CameraSetting sCameraSettings[] = { + { 0x00000000, 0x00000000, NULL }, // CAM_SET_NONE + { 0x3FFFFFFF, 0x00000005, sCamSetNormal0Modes }, // CAM_SET_NORMAL0 + { 0x05FFEFF7, 0x00000005, sCamSetNormal3Modes }, // CAM_SET_NORMAL3 + { 0x00000401, 0x00000005, sCamSetPivotDivingModes }, // CAM_SET_PIVOT_DIVING + { 0x00017E13, 0x80000005, sCamSetHorseModes }, // CAM_SET_HORSE + { 0x00000001, 0x80000005, sCamSetZoraDivingModes }, // CAM_SET_ZORA_DIVING + { 0x00000001, 0x8000000C, sCamSetPreRendFixedModes }, // CAM_SET_PREREND_FIXED + { 0x00000001, 0x8000000C, sCamSetPreRendPivotModes }, // CAM_SET_PREREND_PIVOT + { 0x00000001, 0xC0000007, sCamSetDoorCModes }, // CAM_SET_DOORC + { 0x00000001, 0xC000000E, sCamSetDemo0Modes }, // CAM_SET_DEMO0 + { 0x00000001, 0x80000005, sCamSetFree0Modes }, // CAM_SET_FREE0 + { 0x03FFFFFF, 0x00000005, sCamSetFukan0Modes }, // CAM_SET_BIRDS_EYE_VIEW_0 + { 0x03FFFFFF, 0x00000005, sCamSetNormal1Modes }, // CAM_SET_NORMAL1 + { 0x03FFFFFF, 0x80000005, sCamSetNanameModes }, // CAM_SET_NANAME + { 0x00001BD9, 0x80000005, sCamSetCirc0Modes }, // CAM_SET_CIRCLE0 + { 0x000011D9, 0x80000005, sCamSetFixed0Modes }, // CAM_SET_FIXED0 + { 0x00000001, 0x40000005, sCamSetSpiralDoorModes }, // CAM_SET_SPIRAL_DOOR + { 0x3FFFFFFF, 0x00000005, sCamSetDungeon0Modes }, // CAM_SET_DUNGEON0 + { 0x0000002F, 0x00000005, sCamSetItem0Modes }, // CAM_SET_ITEM0 + { 0x0000002F, 0x00000005, sCamSetItem1Modes }, // CAM_SET_ITEM1 + { 0x0000002F, 0x00000005, sCamSetItem2Modes }, // CAM_SET_ITEM2 + { 0x0000002F, 0x00000005, sCamSetItem3Modes }, // CAM_SET_ITEM3 + { 0x00000001, 0x00000005, sCamSetNaviModes }, // CAM_SET_NAVI + { 0x0000002F, 0x00000005, sCamSetWarp0Modes }, // CAM_SET_WARP_PAD_MOON + { 0x0000002F, 0x00000005, sCamSetDeathModes }, // CAM_SET_DEATH + { 0x0000002F, 0x00000005, sCamSetRebirthModes }, // CAM_SET_REBIRTH + { 0x00000001, 0x40000005, sCamSetLongChestOpeningModes }, // CAM_SET_LONG_CHEST_OPENING + { 0x00000003, 0x00000005, sCamSetMaskTransformationModes }, // CAM_SET_MASK_TRANSFORMATION + { 0x00000001, 0x00000005, sCamSetAttentionModes }, // CAM_SET_ATTENTION + { 0x00000001, 0x00000005, sCamSetWarp1Modes }, // CAM_SET_WARP_PAD_ENTRANCE + { 0x03FFFFFF, 0x00000005, sCamSetDungeon1Modes }, // CAM_SET_DUNGEON1 + { 0x00000001, 0x80000005, sCamSetFixed1Modes }, // CAM_SET_FIXED1 + { 0x00000001, 0x80000005, sCamSetFixed2Modes }, // CAM_SET_FIXED2 + { 0x00000001, 0x00000005, sCamSetMazeModes }, // CAM_SET_MAZE + { 0x00000001, 0x00000005, sCamSetRemoteBombModes }, // CAM_SET_REMOTEBOMB + { 0x00000001, 0x80000005, sCamSetCirc1Modes }, // CAM_SET_CIRCLE1 + { 0x00000001, 0x80000005, sCamSetCirc2Modes }, // CAM_SET_CIRCLE2 + { 0x00001BD9, 0x80000005, sCamSetCirc3Modes }, // CAM_SET_CIRCLE3 + { 0x00000001, 0x80000005, sCamSetCirc4Modes }, // CAM_SET_CIRCLE4 + { 0x000011D9, 0x80000005, sCamSetFixed3Modes }, // CAM_SET_FIXED3 + { 0x03FFFFFF, 0x80000005, sCamSetTowerClimbModes }, // CAM_SET_TOWER_ASCENT + { 0x00000001, 0x80000005, sCamSetParallel0Modes }, // CAM_SET_PARALLEL0 + { 0x00000001, 0x00000005, sCamSetNormDModes }, // CAM_SET_NORMALD + { 0x00000001, 0x00000005, sCamSetSubjectDModes }, // CAM_SET_SUBJECTD + { 0x00000001, 0xC0000008, sCamSetStart0Modes }, // CAM_SET_START0 + { 0x00000001, 0xC0000008, sCamSetStart2Modes }, // CAM_SET_START2 + { 0x00000001, 0x00000005, sCamSetStop0Modes }, // CAM_SET_STOP0 + { 0x00003051, 0x00000005, sCamSetBoatCruiseModes }, // CAM_SET_BOAT_CRUISE + { 0x03FFFFFF, 0x00000005, sCamSetVerticalClimbModes }, // CAM_SET_VERTICAL_CLIMB + { 0x00000001, 0x00000005, sCamSetSidedModes }, // CAM_SET_SIDED + { 0x03FFFFFF, 0x00000005, sCamSetDungeon2Modes }, // CAM_SET_DUNGEON2 + { 0x03FFFFFF, 0x00000005, sCamSetBossOdolwaModes }, // CAM_SET_BOSS_ODOLWA + { 0x03FFFFFF, 0x80000005, sCamSetKeepBackModes }, // CAM_SET_KEEPBACK + { 0x00000001, 0x80000005, sCamSetCirc6Modes }, // CAM_SET_CIRCLE6 + { 0x00000001, 0x80000005, sCamSetCirc7Modes }, // CAM_SET_CIRCLE7 + { 0x03FFFFFF, 0x00000005, sCamSetMiniBossModes }, // CAM_SET_MINI_BOSS + { 0x00000001, 0x80000005, sCamSetRFixed1Modes }, // CAM_SET_RFIXED1 + { 0x00000401, 0x00000005, sCamSetTreasureChestMinigameModes }, // CAM_SET_TREASURE_CHEST_MINIGAME + { 0x00000001, 0x80000005, sCamSetBombBasketModes }, // CAM_SET_HONEY_AND_DARLING_1 + { 0x00000001, 0x80000005, sCamSetCirc8Modes }, // CAM_SET_CIRCLE8 + { 0x03FFFFFF, 0x00000005, sCamSetFukan1Modes }, // CAM_SET_BIRDS_EYE_VIEW_1 + { 0x03FFFFFF, 0x00000005, sCamSetDungeon3Modes }, // CAM_SET_DUNGEON3 + { 0x00008441, 0x0000000A, sCamSetTelescopeModes }, // CAM_SET_TELESCOPE + { 0x3FFFFFFF, 0x00000005, sCamSetRoom0Modes }, // CAM_SET_ROOM0 + { 0x00000001, 0x80000005, sCamSetRCirc0Modes }, // CAM_SET_RCIRC0 + { 0x00001BD9, 0x80000005, sCamSetCirc9Modes }, // CAM_SET_CIRCLE9 + { 0x03FFFFFF, 0x00000005, sCamSetOnThePoleModes }, // CAM_SET_ONTHEPOLE + { 0x03FFFFFF, 0x00000005, sCamSetInBushModes }, // CAM_SET_INBUSH + { 0x03FFFFFF, 0x00000005, sCamSetBossMajoraModes }, // CAM_SET_BOSS_MAJORA + { 0x03FFFFFF, 0x00000005, sCamSetBossTwinmoldModes }, // CAM_SET_BOSS_TWINMOLD + { 0x03FFFFFF, 0x00000005, sCamSetBossGohtModes }, // CAM_SET_BOSS_GOHT + { 0x05FFEFF7, 0x00000005, sCamSetBossGyorgModes }, // CAM_SET_BOSS_GYORG + { 0x00000001, 0x00000005, sCamSetConnect0Modes }, // CAM_SET_CONNECT0 + { 0x05FFEFF7, 0x00000005, sCamSetPinnacleRockModes }, // CAM_SET_PINNACLE_ROCK + { 0x03FFFFFF, 0x00000005, sCamSetNormal2Modes }, // CAM_SET_NORMAL2 + { 0x03FFFFFF, 0x00000005, sCamSetBombBowlModes }, // CAM_SET_HONEY_AND_DARLING_2 + { 0x00000001, 0x80000005, sCamSetCircAModes }, // CAM_SET_CIRCLEA + { 0x05FFEFF7, 0x00000005, sCamSetWhirlpoolModes }, // CAM_SET_WHIRLPOOL + { 0x01FFFFDF, 0x00000005, sCamSetCuccoShackModes }, // CAM_SET_CUCCO_SHACK + { 0x03FFFFFF, 0x00000005, sCamSetGiantModes }, // CAM_SET_GIANT + { 0x00000001, 0x00000008, sCamSetScene0Modes }, // CAM_SET_SCENE0 + { 0x03FFFFFF, 0x00000005, sCamSetRoom1Modes }, // CAM_SET_ROOM1 + { 0x05FFEFF7, 0x00000005, sCamSetWater2Modes }, // CAM_SET_WATER2 + { 0x03FFFFFF, 0x00000005, sCamSetWoodfallSwampModes }, // CAM_SET_WOODFALL_SWAMP + { 0x03FFFFFF, 0x00000005, sCamSetForceKeepModes }, // CAM_SET_FORCEKEEP + { 0x03FFFFFF, 0x80000005, sCamSetParallel1Modes }, // CAM_SET_PARALLEL1 + { 0x00000001, 0xC0000008, sCamSetStart1Modes }, // CAM_SET_START1 + { 0x03FFFFFF, 0x00000005, sCamSetRoom2Modes }, // CAM_SET_ROOM2 + { 0x03FFFFFF, 0x00000005, sCamSetNorm4Modes }, // CAM_SET_NORMAL4 + { 0x0000002F, 0x00000005, sCamSetElegyShellModes }, // CAM_SET_ELEGY_SHELL + { 0x03FFFFFF, 0x00000005, sCamSetDungeon4Modes }, // CAM_SET_DUNGEON4 +}; + +s16 sGlobalCamDataSettings[] = { + /* -25 */ CAM_SET_ELEGY_SHELL, + /* -24 */ CAM_SET_SIDED, + /* -23 */ CAM_SET_BOAT_CRUISE, + /* -22 */ CAM_SET_NONE, + /* -21 */ CAM_SET_SUBJECTD, + /* -20 */ CAM_SET_NORMALD, + /* -19 */ CAM_SET_NONE, + /* -18 */ CAM_SET_NONE, + /* -17 */ CAM_SET_NONE, + /* -16 */ CAM_SET_WARP_PAD_ENTRANCE, + /* -15 */ CAM_SET_ATTENTION, + /* -14 */ CAM_SET_CONNECT0, + /* -13 */ CAM_SET_REMOTEBOMB, + /* -12 */ CAM_SET_NONE, + /* -11 */ CAM_SET_MASK_TRANSFORMATION, + /* -10 */ CAM_SET_LONG_CHEST_OPENING, + /* -9 */ CAM_SET_REBIRTH, + /* -8 */ CAM_SET_DEATH, + /* -7 */ CAM_SET_WARP_PAD_MOON, + /* -6 */ CAM_SET_NAVI, + /* -5 */ CAM_SET_ITEM3, + /* -4 */ CAM_SET_ITEM2, + /* -3 */ CAM_SET_ITEM1, + /* -2 */ CAM_SET_ITEM0, + /* -1 */ CAM_SET_STOP0, + /* 0 */ CAM_SET_NONE, +}; + +s16* sGlobalCamDataSettingsPtr = &sGlobalCamDataSettings[ARRAY_COUNT(sGlobalCamDataSettings) - 1]; + +s32 Camera_Noop(Camera* camera); +s32 Camera_Normal1(Camera* camera); +s32 Camera_Normal2(Camera* camera); +s32 Camera_Normal3(Camera* camera); +s32 Camera_Normal4(Camera* camera); +s32 Camera_Normal0(Camera* camera); +s32 Camera_Parallel1(Camera* camera); +s32 Camera_Parallel2(Camera* camera); +s32 Camera_Parallel3(Camera* camera); +s32 Camera_Parallel4(Camera* camera); +s32 Camera_Parallel0(Camera* camera); +s32 Camera_Jump1(Camera* camera); +s32 Camera_Jump2(Camera* camera); +s32 Camera_Jump3(Camera* camera); +s32 Camera_Jump4(Camera* camera); +s32 Camera_Jump0(Camera* camera); +s32 Camera_Battle1(Camera* camera); +s32 Camera_Battle2(Camera* camera); +s32 Camera_Battle3(Camera* camera); +s32 Camera_Battle4(Camera* camera); +s32 Camera_Battle0(Camera* camera); +s32 Camera_KeepOn1(Camera* camera); +s32 Camera_KeepOn2(Camera* camera); +s32 Camera_KeepOn3(Camera* camera); +s32 Camera_KeepOn4(Camera* camera); +s32 Camera_KeepOn0(Camera* camera); +s32 Camera_Fixed1(Camera* camera); +s32 Camera_Fixed2(Camera* camera); +s32 Camera_Fixed3(Camera* camera); +s32 Camera_Fixed4(Camera* camera); +s32 Camera_Fixed0(Camera* camera); +s32 Camera_Subject1(Camera* camera); +s32 Camera_Subject2(Camera* camera); +s32 Camera_Subject3(Camera* camera); +s32 Camera_Subject4(Camera* camera); +s32 Camera_Subject0(Camera* camera); +s32 Camera_Data0(Camera* camera); +s32 Camera_Data1(Camera* camera); +s32 Camera_Data2(Camera* camera); +s32 Camera_Data3(Camera* camera); +s32 Camera_Data4(Camera* camera); +s32 Camera_Unique1(Camera* camera); +s32 Camera_Unique2(Camera* camera); +s32 Camera_Unique3(Camera* camera); +s32 Camera_Unique4(Camera* camera); +s32 Camera_Unique5(Camera* camera); +s32 Camera_Unique0(Camera* camera); +s32 Camera_Unique6(Camera* camera); +s32 Camera_Unique7(Camera* camera); +s32 Camera_Unique8(Camera* camera); +s32 Camera_Unique9(Camera* camera); +s32 Camera_Demo1(Camera* camera); +s32 Camera_Demo2(Camera* camera); +s32 Camera_Demo3(Camera* camera); +s32 Camera_Demo4(Camera* camera); +s32 Camera_Demo5(Camera* camera); +s32 Camera_Demo6(Camera* camera); +s32 Camera_Demo7(Camera* camera); +s32 Camera_Demo8(Camera* camera); +s32 Camera_Demo9(Camera* camera); +s32 Camera_Demo0(Camera* camera); +s32 Camera_Special0(Camera* camera); +s32 Camera_Special1(Camera* camera); +s32 Camera_Special2(Camera* camera); +s32 Camera_Special3(Camera* camera); +s32 Camera_Special4(Camera* camera); +s32 Camera_Special5(Camera* camera); +s32 Camera_Special6(Camera* camera); +s32 Camera_Special7(Camera* camera); +s32 Camera_Special8(Camera* camera); +s32 Camera_Special9(Camera* camera); + +CameraUpdateFunc sCameraUpdateHandlers[] = { + NULL, + Camera_Normal0, + Camera_Normal1, + Camera_Normal2, + Camera_Normal3, + Camera_Normal4, + Camera_Parallel0, + Camera_Parallel1, + Camera_Parallel2, + Camera_Parallel3, + Camera_Parallel4, + Camera_KeepOn0, + Camera_KeepOn1, + Camera_KeepOn2, + Camera_KeepOn3, + Camera_KeepOn4, + Camera_Subject0, + Camera_Subject1, + Camera_Subject2, + Camera_Subject3, + Camera_Subject4, + Camera_Jump0, + Camera_Jump1, + Camera_Jump2, + Camera_Jump3, + Camera_Jump4, + Camera_Battle0, + Camera_Battle1, + Camera_Battle2, + Camera_Battle3, + Camera_Battle4, + Camera_Fixed0, + Camera_Fixed1, + Camera_Fixed2, + Camera_Fixed3, + Camera_Fixed4, + Camera_Data0, + Camera_Data1, + Camera_Data2, + Camera_Data3, + Camera_Data4, + Camera_Unique0, + Camera_Unique1, + Camera_Unique2, + Camera_Unique3, + Camera_Unique4, + Camera_Unique5, + Camera_Unique6, + Camera_Unique7, + Camera_Unique8, + Camera_Unique9, + Camera_Demo0, + Camera_Demo1, + Camera_Demo2, + Camera_Demo3, + Camera_Demo4, + Camera_Demo5, + Camera_Demo6, + Camera_Demo7, + Camera_Demo8, + Camera_Demo9, + Camera_Special0, + Camera_Special1, + Camera_Special2, + Camera_Special3, + Camera_Special4, + Camera_Special5, + Camera_Special6, + Camera_Special7, + Camera_Special8, + Camera_Special9, +}; + +s16 sCameraNextUID = 0; +s32 sCameraInterfaceFlags = 1; +s32 sCameraHudVisibility = 2; +s32 sCameraLetterboxSize = 32; +s32 sCameraNegOne = -1; + +// VecSph yaw data +s16 D_801B9E18[] = { + 0x0AAA, 0xF556, 0x1555, 0xEAAB, 0x2AAA, 0xD556, 0x3FFF, 0xC001, 0x5555, 0xAAAB, 0x6AAA, 0x9556, 0x7FFF, 0x0000, +}; + +// VecSph pitch data +s16 D_801B9E34[] = { + 0x0000, 0x02C6, 0x058C, 0x0000, 0x0000, 0xFD3A, 0x0000, 0x0852, 0x0000, 0x0000, 0x0B18, 0x02C6, 0xFA74, 0x0000, +}; + +s32 sUpdateCameraDirection = false; +static s32 sIsFalse = false; +s32 sCameraInitSceneTimer = 0; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 4165363f8..e6ace2b97 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -1182,77 +1182,77 @@ 0x800CEAD8:("func_800CEAD8",), 0x800CEC38:("func_800CEC38",), 0x800CED90:("func_800CED90",), - 0x800CF3A4:("Camera_ModeNop",), - 0x800CF3B4:("Camera_ModeNORM1",), - 0x800D0874:("Camera_ModeNORM2",), - 0x800D0894:("Camera_ModeNORM3",), - 0x800D1228:("Camera_ModeNORM4",), - 0x800D12B8:("Camera_ModeNORM0",), - 0x800D1A78:("Camera_ModePARA1",), - 0x800D2AA8:("Camera_ModePARA2",), - 0x800D2AC8:("Camera_ModePARA3",), - 0x800D2AE8:("Camera_ModePARA4",), - 0x800D2B08:("Camera_ModePARA0",), - 0x800D2B28:("Camera_ModeJUMP1",), - 0x800D2B48:("Camera_ModeJUMP2",), - 0x800D3520:("Camera_ModeJUMP3",), - 0x800D41E0:("Camera_ModeJUMP4",), - 0x800D4200:("Camera_ModeJUMP0",), - 0x800D4220:("Camera_ModeBATT1",), - 0x800D55A8:("Camera_ModeBATT2",), - 0x800D55C8:("Camera_ModeBATT3",), - 0x800D55E8:("Camera_ModeBATT4",), - 0x800D5608:("Camera_ModeBATT0",), - 0x800D5628:("Camera_ModeKEEP1",), - 0x800D67DC:("Camera_ModeKEEP2",), - 0x800D67FC:("Camera_ModeKEEP3",), - 0x800D73C8:("Camera_ModeKEEP4",), - 0x800D7FA4:("Camera_ModeKEEP0",), - 0x800D7FC4:("Camera_ModeFIXD1",), - 0x800D83C8:("Camera_ModeFIXD2",), - 0x800D8E08:("Camera_ModeFIXD3",), - 0x800D8E28:("Camera_ModeFIXD4",), - 0x800D8E48:("Camera_ModeFIXD0",), - 0x800D8E68:("Camera_ModeSUBJ1",), - 0x800D947C:("Camera_ModeSUBJ2",), - 0x800D949C:("Camera_ModeSUBJ3",), - 0x800D94BC:("Camera_ModeSUBJ4",), - 0x800D94DC:("Camera_ModeSUBJ0",), - 0x800D94FC:("Camera_ModeDATA0",), - 0x800D951C:("Camera_ModeDATA1",), - 0x800D953C:("Camera_ModeDATA2",), - 0x800D955C:("Camera_ModeDATA3",), - 0x800D957C:("Camera_ModeDATA4",), - 0x800D959C:("Camera_ModeUNIQ1",), - 0x800D95BC:("Camera_ModeUNIQ2",), - 0x800D99D0:("Camera_ModeUNIQ3",), - 0x800D9A2C:("Camera_ModeUNIQ4",), - 0x800D9A88:("Camera_ModeUNIQ5",), - 0x800D9AE4:("Camera_ModeUNIQ0",), - 0x800DA3B8:("Camera_ModeUNIQ6",), - 0x800DA4EC:("Camera_ModeUNIQ7",), - 0x800DA50C:("Camera_ModeUNIQ8",), - 0x800DA52C:("Camera_ModeUNIQ9",), - 0x800DA54C:("Camera_ModeDEMO1",), - 0x800DAD10:("Camera_ModeDEMO2",), - 0x800DB804:("Camera_ModeDEMO3",), - 0x800DBB14:("Camera_ModeDEMO4",), - 0x800DC270:("Camera_ModeDEMO5",), - 0x800DC718:("Camera_ModeDEMO6",), - 0x800DC738:("Camera_ModeDEMO7",), - 0x800DC758:("Camera_ModeDEMO8",), - 0x800DC778:("Camera_ModeDEMO9",), - 0x800DC798:("Camera_ModeDEMO0",), - 0x800DCC90:("Camera_ModeSPEC0",), - 0x800DCCB0:("Camera_ModeSPEC1",), - 0x800DCCD0:("Camera_ModeSPEC2",), - 0x800DCCF0:("Camera_ModeSPEC3",), - 0x800DCD10:("Camera_ModeSPEC4",), - 0x800DCD30:("Camera_ModeSPEC5",), - 0x800DD0FC:("Camera_ModeSPEC6",), - 0x800DD11C:("Camera_ModeSPEC7",), - 0x800DD13C:("Camera_ModeSPEC8",), - 0x800DD5B8:("Camera_ModeSPEC9",), + 0x800CF3A4:("Camera_Noop",), + 0x800CF3B4:("Camera_Normal1",), + 0x800D0874:("Camera_Normal2",), + 0x800D0894:("Camera_Normal3",), + 0x800D1228:("Camera_Normal4",), + 0x800D12B8:("Camera_Normal0",), + 0x800D1A78:("Camera_Parallel1",), + 0x800D2AA8:("Camera_Parallel2",), + 0x800D2AC8:("Camera_Parallel3",), + 0x800D2AE8:("Camera_Parallel4",), + 0x800D2B08:("Camera_Parallel0",), + 0x800D2B28:("Camera_Jump1",), + 0x800D2B48:("Camera_Jump2",), + 0x800D3520:("Camera_Jump3",), + 0x800D41E0:("Camera_Jump4",), + 0x800D4200:("Camera_Jump0",), + 0x800D4220:("Camera_Battle1",), + 0x800D55A8:("Camera_Battle2",), + 0x800D55C8:("Camera_Battle3",), + 0x800D55E8:("Camera_Battle4",), + 0x800D5608:("Camera_Battle0",), + 0x800D5628:("Camera_KeepOn1",), + 0x800D67DC:("Camera_KeepOn2",), + 0x800D67FC:("Camera_KeepOn3",), + 0x800D73C8:("Camera_KeepOn4",), + 0x800D7FA4:("Camera_KeepOn0",), + 0x800D7FC4:("Camera_Fixed1",), + 0x800D83C8:("Camera_Fixed2",), + 0x800D8E08:("Camera_Fixed3",), + 0x800D8E28:("Camera_Fixed4",), + 0x800D8E48:("Camera_Fixed0",), + 0x800D8E68:("Camera_Subject1",), + 0x800D947C:("Camera_Subject2",), + 0x800D949C:("Camera_Subject3",), + 0x800D94BC:("Camera_Subject4",), + 0x800D94DC:("Camera_Subject0",), + 0x800D94FC:("Camera_Data0",), + 0x800D951C:("Camera_Data1",), + 0x800D953C:("Camera_Data2",), + 0x800D955C:("Camera_Data3",), + 0x800D957C:("Camera_Data4",), + 0x800D959C:("Camera_Unique1",), + 0x800D95BC:("Camera_Unique2",), + 0x800D99D0:("Camera_Unique3",), + 0x800D9A2C:("Camera_Unique4",), + 0x800D9A88:("Camera_Unique5",), + 0x800D9AE4:("Camera_Unique0",), + 0x800DA3B8:("Camera_Unique6",), + 0x800DA4EC:("Camera_Unique7",), + 0x800DA50C:("Camera_Unique8",), + 0x800DA52C:("Camera_Unique9",), + 0x800DA54C:("Camera_Demo1",), + 0x800DAD10:("Camera_Demo2",), + 0x800DB804:("Camera_Demo3",), + 0x800DBB14:("Camera_Demo4",), + 0x800DC270:("Camera_Demo5",), + 0x800DC718:("Camera_Demo6",), + 0x800DC738:("Camera_Demo7",), + 0x800DC758:("Camera_Demo8",), + 0x800DC778:("Camera_Demo9",), + 0x800DC798:("Camera_Demo0",), + 0x800DCC90:("Camera_Special0",), + 0x800DCCB0:("Camera_Special1",), + 0x800DCCD0:("Camera_Special2",), + 0x800DCCF0:("Camera_Special3",), + 0x800DCD10:("Camera_Special4",), + 0x800DCD30:("Camera_Special5",), + 0x800DD0FC:("Camera_Special6",), + 0x800DD11C:("Camera_Special7",), + 0x800DD13C:("Camera_Special8",), + 0x800DD5B8:("Camera_Special9",), 0x800DDD58:("Camera_Alloc",), 0x800DDDA8:("Camera_Free",), 0x800DDDD0:("Camera_Init",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index f8023eb2c..ae80ee368 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -454,87 +454,100 @@ 0x801B46DC:("sSceneSubdivisionList","BgCheckSceneSubdivisionEntry","[3]",0x24), 0x801B4700:("sCustomDynapolyMem","BgSpecialSceneMaxObjects","[1]",0x8), 0x801B4708:("D_801B4708","UNK_TYPE1","",0x1), - 0x801B4710:("D_801B4710","UNK_TYPE1","",0x1), - 0x801B4738:("D_801B4738","UNK_TYPE1","",0x1), - 0x801B4768:("D_801B4768","UNK_TYPE1","",0x1), - 0x801B4798:("D_801B4798","UNK_TYPE1","",0x1), - 0x801B47CC:("D_801B47CC","UNK_TYPE1","",0x1), - 0x801B47F0:("D_801B47F0","UNK_TYPE1","",0x1), - 0x801B4824:("D_801B4824","UNK_TYPE1","",0x1), - 0x801B4848:("D_801B4848","UNK_TYPE1","",0x1), - 0x801B486C:("D_801B486C","UNK_TYPE1","",0x1), - 0x801B4890:("D_801B4890","UNK_TYPE1","",0x1), - 0x801B48B0:("D_801B48B0","UNK_TYPE1","",0x1), - 0x801B48D4:("D_801B48D4","UNK_TYPE1","",0x1), - 0x801B48F8:("D_801B48F8","UNK_TYPE1","",0x1), - 0x801B491C:("D_801B491C","UNK_TYPE1","",0x1), - 0x801B4944:("D_801B4944","UNK_TYPE1","",0x1), - 0x801B4974:("D_801B4974","UNK_TYPE1","",0x1), - 0x801B49A4:("D_801B49A4","UNK_TYPE1","",0x1), - 0x801B49D4:("D_801B49D4","UNK_TYPE1","",0x1), - 0x801B4A04:("D_801B4A04","UNK_TYPE1","",0x1), - 0x801B4A34:("D_801B4A34","UNK_TYPE1","",0x1), - 0x801B4A5C:("D_801B4A5C","UNK_TYPE1","",0x1), - 0x801B4A8C:("D_801B4A8C","UNK_TYPE1","",0x1), - 0x801B4ABC:("D_801B4ABC","UNK_TYPE1","",0x1), - 0x801B4AE0:("D_801B4AE0","UNK_TYPE1","",0x1), - 0x801B4B08:("D_801B4B08","UNK_TYPE1","",0x1), - 0x801B4B38:("D_801B4B38","UNK_TYPE1","",0x1), - 0x801B4B60:("D_801B4B60","UNK_TYPE1","",0x1), - 0x801B4B90:("D_801B4B90","UNK_TYPE1","",0x1), - 0x801B4BB8:("D_801B4BB8","UNK_TYPE1","",0x1), - 0x801B4BDC:("D_801B4BDC","UNK_TYPE1","",0x1), - 0x801B4C04:("D_801B4C04","UNK_TYPE1","",0x1), - 0x801B4C34:("D_801B4C34","UNK_TYPE1","",0x1), - 0x801B4C5C:("D_801B4C5C","UNK_TYPE1","",0x1), - 0x801B4C84:("D_801B4C84","UNK_TYPE1","",0x1), - 0x801B4CAC:("D_801B4CAC","UNK_TYPE1","",0x1), - 0x801B4CD4:("D_801B4CD4","UNK_TYPE1","",0x1), - 0x801B4CFC:("D_801B4CFC","UNK_TYPE1","",0x1), - 0x801B4D24:("D_801B4D24","UNK_TYPE1","",0x1), - 0x801B4D34:("D_801B4D34","UNK_TYPE1","",0x1), - 0x801B4D44:("D_801B4D44","UNK_TYPE1","",0x1), - 0x801B4D68:("D_801B4D68","UNK_TYPE1","",0x1), - 0x801B4D8C:("D_801B4D8C","UNK_TYPE1","",0x1), - 0x801B4DB0:("D_801B4DB0","UNK_TYPE1","",0x1), - 0x801B4DD4:("D_801B4DD4","UNK_TYPE1","",0x1), - 0x801B4DF8:("D_801B4DF8","UNK_TYPE1","",0x1), - 0x801B4E2C:("D_801B4E2C","UNK_TYPE1","",0x1), - 0x801B4E5C:("D_801B4E5C","UNK_TYPE1","",0x1), - 0x801B4E90:("D_801B4E90","UNK_TYPE1","",0x1), - 0x801B4EB4:("D_801B4EB4","UNK_TYPE1","",0x1), - 0x801B4ED8:("D_801B4ED8","UNK_TYPE1","",0x1), - 0x801B4EDC:("D_801B4EDC","UNK_TYPE1","",0x1), - 0x801B4EE4:("D_801B4EE4","UNK_TYPE1","",0x1), + 0x801B4710:("sSetNormal0ModeNormalData","UNK_TYPE1","",0x1), + 0x801B4738:("sSetNormal0ModeTargetData","UNK_TYPE1","",0x1), + 0x801B4768:("sSetNormal0ModeFollowTargetData","UNK_TYPE1","",0x1), + 0x801B4798:("sSetNormal0ModeBattleData","UNK_TYPE1","",0x1), + 0x801B47CC:("sSetNormal0ModeFirstPersonData","UNK_TYPE1","",0x1), + 0x801B47F0:("sSetNormal0ModeTalkData","UNK_TYPE1","",0x1), + 0x801B4824:("sSetNormal0ModeClimbData","UNK_TYPE1","",0x1), + 0x801B4848:("sSetNormal0ModeBowArrowData","UNK_TYPE1","",0x1), + 0x801B486C:("sSetNormal0ModeBowArrowZData","UNK_TYPE1","",0x1), + 0x801B4890:("sSetNormal0ModeHookshotData","UNK_TYPE1","",0x1), + 0x801B48B0:("sSetNormal0ModeBoomerangData","UNK_TYPE1","",0x1), + 0x801B48D4:("sSetNormal0ModeSlingshotData","UNK_TYPE1","",0x1), + 0x801B48F8:("sSetNormal0ModeClimbZData","UNK_TYPE1","",0x1), + 0x801B4710:("sSetNormal0ModeNormalData","UNK_TYPE1","",0x1), + 0x801B4738:("sSetNormal0ModeTargetData","UNK_TYPE1","",0x1), + 0x801B4768:("sSetNormal0ModeFollowTargetData","UNK_TYPE1","",0x1), + 0x801B4798:("sSetNormal0ModeBattleData","UNK_TYPE1","",0x1), + 0x801B47CC:("sSetNormal0ModeFirstPersonData","UNK_TYPE1","",0x1), + 0x801B47F0:("sSetNormal0ModeTalkData","UNK_TYPE1","",0x1), + 0x801B4824:("sSetNormal0ModeClimbData","UNK_TYPE1","",0x1), + 0x801B4848:("sSetNormal0ModeBowArrowData","UNK_TYPE1","",0x1), + 0x801B486C:("sSetNormal0ModeBowArrowZData","UNK_TYPE1","",0x1), + 0x801B4890:("sSetNormal0ModeHookshotData","UNK_TYPE1","",0x1), + 0x801B48B0:("sSetNormal0ModeBoomerangData","UNK_TYPE1","",0x1), + 0x801B48D4:("sSetNormal0ModeSlingshotData","UNK_TYPE1","",0x1), + 0x801B48F8:("sSetNormal0ModeClimbZData","UNK_TYPE1","",0x1), + 0x801B491C:("sSetNormal0ModeJumpData","UNK_TYPE1","",0x1), + 0x801B4944:("sSetNormal0ModeHangData","UNK_TYPE1","",0x1), + 0x801B4974:("sSetNormal0ModeHangZData","UNK_TYPE1","",0x1), + 0x801B49A4:("sSetNormal0ModeFreeFallData","UNK_TYPE1","",0x1), + 0x801B49D4:("sSetNormal0ModeChargeData","UNK_TYPE1","",0x1), + 0x801B4A04:("sSetNormal0ModeChargeZData","UNK_TYPE1","",0x1), + 0x801B4A34:("sSetNormal0ModeStillData","UNK_TYPE1","",0x1), + 0x801B4A5C:("sSetNormal0ModePushPullData","UNK_TYPE1","",0x1), + 0x801B4A8C:("sSetNormal0ModeFollowBoomerangData","UNK_TYPE1","",0x1), + 0x801B4ABC:("sSetNormal0ModeDekuShootData","UNK_TYPE1","",0x1), + 0x801B4AE0:("sSetNormal0ModeGoronDashData","UNK_TYPE1","",0x1), + 0x801B4B08:("sSetNormal0ModeDekuHideData","UNK_TYPE1","",0x1), + 0x801B4B38:("sSetNormal0ModeDekuFlyData","UNK_TYPE1","",0x1), + 0x801B4B60:("sSetNormal0ModeDekuFlyZData","UNK_TYPE1","",0x1), + 0x801B4B90:("sSetNormal0ModeGoronJumpData","UNK_TYPE1","",0x1), + 0x801B4BB8:("sSetNormal0ModeZoraFinData","UNK_TYPE1","",0x1), + 0x801B4BDC:("sSetNormal3ModeNormalData","UNK_TYPE1","",0x1), + 0x801B4C04:("sSetNormal3ModeTargetData","UNK_TYPE1","",0x1), + 0x801B4C34:("sSetNormal3ModeFreeFallData","UNK_TYPE1","",0x1), + 0x801B4C5C:("sSetNormal3ModeGoronJumpData","UNK_TYPE1","",0x1), + 0x801B4C84:("sSetNormal3ModeDekuFlyData","UNK_TYPE1","",0x1), + 0x801B4CAC:("sSetNormal3ModeDekuHideData","UNK_TYPE1","",0x1), + 0x801B4CD4:("sSetNormal3ModeStillData","UNK_TYPE1","",0x1), + 0x801B4CFC:("sSetNormal3ModeGoronDashData","UNK_TYPE1","",0x1), + 0x801B4D24:("sSetPivotDivingModeNormalData","UNK_TYPE1","",0x1), + 0x801B4D34:("sSetPivotDivingModeTargetData","UNK_TYPE1","",0x1), + 0x801B4D44:("sSetHorseModeNormalData","UNK_TYPE1","",0x1), + 0x801B4D68:("sSetHorseModeTargetData","UNK_TYPE1","",0x1), + 0x801B4D8C:("sSetHorseModeJumpData","UNK_TYPE1","",0x1), + 0x801B4DB0:("sSetHorseModeBowArrowData","UNK_TYPE1","",0x1), + 0x801B4DD4:("sSetHorseModeSlingShotData","UNK_TYPE1","",0x1), + 0x801B4DF8:("sSetHorseModeBattleData","UNK_TYPE1","",0x1), + 0x801B4E2C:("sSetHorseModeFollowTargetData","UNK_TYPE1","",0x1), + 0x801B4E5C:("sSetHorseModeTalkData","UNK_TYPE1","",0x1), + 0x801B4E90:("sSetHorseModeStillData","UNK_TYPE1","",0x1), + 0x801B4EB4:("sSetZoraDivingModeNormalData","UNK_TYPE1","",0x1), + 0x801B4ED8:("sSetPrerendFixedModeNormalData","UNK_TYPE1","",0x1), + 0x801B4EDC:("sSetPrerendPivotModeNormalData","UNK_TYPE1","",0x1), + 0x801B4EE4:("sSetDoorCModeNormalData","UNK_TYPE1","",0x1), 0x801B4EF0:("D_801B4EF0","UNK_TYPE1","",0x1), - 0x801B4EF4:("D_801B4EF4","UNK_TYPE1","",0x1), + 0x801B4EF4:("sSetCutscenesModeNormalData","UNK_TYPE1","",0x1), 0x801B4EF8:("D_801B4EF8","UNK_TYPE1","",0x1), 0x801B4F20:("D_801B4F20","UNK_TYPE1","",0x1), 0x801B4F50:("D_801B4F50","UNK_TYPE1","",0x1), 0x801B4F78:("D_801B4F78","UNK_TYPE1","",0x1), - 0x801B4FA0:("D_801B4FA0","UNK_TYPE1","",0x1), - 0x801B4FC8:("D_801B4FC8","UNK_TYPE1","",0x1), + 0x801B4FA0:("sSetNormal1ModeNormalData","UNK_TYPE1","",0x1), + 0x801B4FC8:("sSetNormal1ModeStillData","UNK_TYPE1","",0x1), 0x801B4FF0:("D_801B4FF0","UNK_TYPE1","",0x1), 0x801B5018:("D_801B5018","UNK_TYPE1","",0x1), 0x801B5034:("D_801B5034","UNK_TYPE1","",0x1), 0x801B5050:("D_801B5050","UNK_TYPE1","",0x1), 0x801B506C:("D_801B506C","UNK_TYPE1","",0x1), - 0x801B507C:("D_801B507C","UNK_TYPE1","",0x1), - 0x801B5094:("D_801B5094","UNK_TYPE1","",0x1), - 0x801B50BC:("D_801B50BC","UNK_TYPE1","",0x1), - 0x801B50EC:("D_801B50EC","UNK_TYPE1","",0x1), - 0x801B511C:("D_801B511C","UNK_TYPE1","",0x1), - 0x801B5150:("D_801B5150","UNK_TYPE1","",0x1), - 0x801B5180:("D_801B5180","UNK_TYPE1","",0x1), - 0x801B51A8:("D_801B51A8","UNK_TYPE1","",0x1), - 0x801B51D8:("D_801B51D8","UNK_TYPE1","",0x1), - 0x801B51FC:("D_801B51FC","UNK_TYPE1","",0x1), - 0x801B5220:("D_801B5220","UNK_TYPE1","",0x1), - 0x801B5250:("D_801B5250","UNK_TYPE1","",0x1), - 0x801B5280:("D_801B5280","UNK_TYPE1","",0x1), - 0x801B52B0:("D_801B52B0","UNK_TYPE1","",0x1), - 0x801B52E0:("D_801B52E0","UNK_TYPE1","",0x1), - 0x801B5308:("D_801B5308","UNK_TYPE1","",0x1), + 0x801B507C:("sSetSpiralDoorModeNormalData","UNK_TYPE1","",0x1), + 0x801B5094:("sSetDungeon0ModeNormalData","UNK_TYPE1","",0x1), + 0x801B50BC:("sSetDungeon0ModeTargetData","UNK_TYPE1","",0x1), + 0x801B50EC:("sSetDungeon0ModeFollowTargetData","UNK_TYPE1","",0x1), + 0x801B511C:("sSetDungeon0ModeBattleData","UNK_TYPE1","",0x1), + 0x801B5150:("sSetDungeon0ModeFollowBoomerangData","UNK_TYPE1","",0x1), + 0x801B5180:("sSetDungeon0ModeJumpData","UNK_TYPE1","",0x1), + 0x801B51A8:("sSetDungeon0ModeFreeFallData","UNK_TYPE1","",0x1), + 0x801B51D8:("sSetDungeon0ModeClimbData","UNK_TYPE1","",0x1), + 0x801B51FC:("sSetDungeon0ModeClimbZData","UNK_TYPE1","",0x1), + 0x801B5220:("sSetDungeon0ModeChargeData","UNK_TYPE1","",0x1), + 0x801B5250:("sSetDungeon0ModeChargeZData","UNK_TYPE1","",0x1), + 0x801B5280:("sSetDungeon0ModeHangData","UNK_TYPE1","",0x1), + 0x801B52B0:("sSetDungeon0ModeHangZData","UNK_TYPE1","",0x1), + 0x801B52E0:("sSetDungeon0ModeStillData","UNK_TYPE1","",0x1), + 0x801B5308:("sSetDungeon0ModePushPullData","UNK_TYPE1","",0x1), 0x801B5338:("D_801B5338","UNK_TYPE1","",0x1), 0x801B535C:("D_801B535C","UNK_TYPE1","",0x1), 0x801B5380:("D_801B5380","UNK_TYPE1","",0x1), @@ -560,71 +573,71 @@ 0x801B5650:("D_801B5650","UNK_TYPE1","",0x1), 0x801B5674:("D_801B5674","UNK_TYPE1","",0x1), 0x801B5698:("D_801B5698","UNK_TYPE1","",0x1), - 0x801B56BC:("D_801B56BC","UNK_TYPE1","",0x1), - 0x801B56E0:("D_801B56E0","UNK_TYPE1","",0x1), - 0x801B5704:("D_801B5704","UNK_TYPE1","",0x1), + 0x801B56BC:("sSetDeathModeNormalData","UNK_TYPE1","",0x1), + 0x801B56E0:("sSetDeathModeJumpData","UNK_TYPE1","",0x1), + 0x801B5704:("sSetDeathModeDekuShootData","UNK_TYPE1","",0x1), 0x801B5728:("D_801B5728","UNK_TYPE1","",0x1), 0x801B574C:("D_801B574C","UNK_TYPE1","",0x1), - 0x801B5770:("D_801B5770","UNK_TYPE1","",0x1), - 0x801B577C:("D_801B577C","UNK_TYPE1","",0x1), - 0x801B57A4:("D_801B57A4","UNK_TYPE1","",0x1), - 0x801B57CC:("D_801B57CC","UNK_TYPE1","",0x1), - 0x801B57F4:("D_801B57F4","UNK_TYPE1","",0x1), + 0x801B5770:("sSetLongChestOpeningModeNormalData","UNK_TYPE1","",0x1), + 0x801B577C:("sSetDungeon1ModeNormalData","UNK_TYPE1","",0x1), + 0x801B57A4:("sSetDungeon1ModeJumpData","UNK_TYPE1","",0x1), + 0x801B57CC:("sSetDungeon1ModeStillData","UNK_TYPE1","",0x1), + 0x801B57F4:("sSetDungeon1ModePushPullData","UNK_TYPE1","",0x1), 0x801B5824:("D_801B5824","UNK_TYPE1","",0x1), 0x801B5834:("D_801B5834","UNK_TYPE1","",0x1), - 0x801B5844:("D_801B5844","UNK_TYPE1","",0x1), - 0x801B5864:("D_801B5864","UNK_TYPE1","",0x1), + 0x801B5844:("sSetMazeModeNormalData","UNK_TYPE1","",0x1), + 0x801B5864:("sSetRemoteBombModeNormalData","UNK_TYPE1","",0x1), 0x801B5884:("D_801B5884","UNK_TYPE1","",0x1), 0x801B58A0:("D_801B58A0","UNK_TYPE1","",0x1), 0x801B58BC:("D_801B58BC","UNK_TYPE1","",0x1), 0x801B58D8:("D_801B58D8","UNK_TYPE1","",0x1), 0x801B58F4:("D_801B58F4","UNK_TYPE1","",0x1), - 0x801B5904:("D_801B5904","UNK_TYPE1","",0x1), - 0x801B5928:("D_801B5928","UNK_TYPE1","",0x1), - 0x801B5950:("D_801B5950","UNK_TYPE1","",0x1), + 0x801B5904:("sSetTowerClimbModeNormalData","UNK_TYPE1","",0x1), + 0x801B5928:("sSetTowerClimbModeJumpData","UNK_TYPE1","",0x1), + 0x801B5950:("sSetTowerClimbModeStillData","UNK_TYPE1","",0x1), 0x801B5978:("D_801B5978","UNK_TYPE1","",0x1), 0x801B59A8:("D_801B59A8","UNK_TYPE1","",0x1), 0x801B59D0:("D_801B59D0","UNK_TYPE1","",0x1), 0x801B59F4:("D_801B59F4","UNK_TYPE1","",0x1), 0x801B5A00:("D_801B5A00","UNK_TYPE1","",0x1), - 0x801B5A0C:("D_801B5A0C","UNK_TYPE1","",0x1), - 0x801B5A30:("D_801B5A30","UNK_TYPE1","",0x1), + 0x801B5A0C:("sSetBoatCruiseModeNormalData","UNK_TYPE1","",0x1), + 0x801B5A30:("sSetVerticalClimbModeClimbData","UNK_TYPE1","",0x1), 0x801B5A64:("D_801B5A64","UNK_TYPE1","",0x1), - 0x801B5A94:("D_801B5A94","UNK_TYPE1","",0x1), - 0x801B5ABC:("D_801B5ABC","UNK_TYPE1","",0x1), - 0x801B5AF0:("D_801B5AF0","UNK_TYPE1","",0x1), - 0x801B5B18:("D_801B5B18","UNK_TYPE1","",0x1), - 0x801B5B40:("D_801B5B40","UNK_TYPE1","",0x1), - 0x801B5B70:("D_801B5B70","UNK_TYPE1","",0x1), - 0x801B5B98:("D_801B5B98","UNK_TYPE1","",0x1), - 0x801B5BC8:("D_801B5BC8","UNK_TYPE1","",0x1), - 0x801B5BFC:("D_801B5BFC","UNK_TYPE1","",0x1), - 0x801B5C30:("D_801B5C30","UNK_TYPE1","",0x1), - 0x801B5C58:("D_801B5C58","UNK_TYPE1","",0x1), + 0x801B5A94:("sSetDungeon2ModeNormalData","UNK_TYPE1","",0x1), + 0x801B5ABC:("sSetDungeon2ModeBattleData","UNK_TYPE1","",0x1), + 0x801B5AF0:("sSetDungeon2ModeJumpData","UNK_TYPE1","",0x1), + 0x801B5B18:("sSetDungeon2ModeStillData","UNK_TYPE1","",0x1), + 0x801B5B40:("sSetDungeon2ModePushPullData","UNK_TYPE1","",0x1), + 0x801B5B70:("sSetBossOdolwaModeNormalData","UNK_TYPE1","",0x1), + 0x801B5B98:("sSetBossOdolwaModeFollowTargetData","UNK_TYPE1","",0x1), + 0x801B5BC8:("sSetBossOdolwaModeTalkData","UNK_TYPE1","",0x1), + 0x801B5BFC:("sSetBossOdolwaModeBattleData","UNK_TYPE1","",0x1), + 0x801B5C30:("sSetBossOdolwaModeJumpData","UNK_TYPE1","",0x1), + 0x801B5C58:("sSetBossOdolwaModeStillData","UNK_TYPE1","",0x1), 0x801B5C80:("D_801B5C80","UNK_TYPE1","",0x1), 0x801B5CB0:("D_801B5CB0","UNK_TYPE1","",0x1), 0x801B5CCC:("D_801B5CCC","UNK_TYPE1","",0x1), - 0x801B5CE8:("D_801B5CE8","UNK_TYPE1","",0x1), - 0x801B5D10:("D_801B5D10","UNK_TYPE1","",0x1), - 0x801B5D40:("D_801B5D40","UNK_TYPE1","",0x1), - 0x801B5D74:("D_801B5D74","UNK_TYPE1","",0x1), - 0x801B5D9C:("D_801B5D9C","UNK_TYPE1","",0x1), + 0x801B5CE8:("sSetMiniBossModeNormalData","UNK_TYPE1","",0x1), + 0x801B5D10:("sSetMiniBossModeFollowTargetData","UNK_TYPE1","",0x1), + 0x801B5D40:("sSetMiniBossModeBattleData","UNK_TYPE1","",0x1), + 0x801B5D74:("sSetMiniBossModeJumpData","UNK_TYPE1","",0x1), + 0x801B5D9C:("sSetMiniBossModeStillData","UNK_TYPE1","",0x1), 0x801B5DC4:("D_801B5DC4","UNK_TYPE1","",0x1), - 0x801B5DD4:("D_801B5DD4","UNK_TYPE1","",0x1), - 0x801B5DFC:("D_801B5DFC","UNK_TYPE1","",0x1), + 0x801B5DD4:("sSetTreasureChestMinigameModeNormalData","UNK_TYPE1","",0x1), + 0x801B5DFC:("sSetTreasureChestMinigameModeTargetData","UNK_TYPE1","",0x1), 0x801B5E2C:("D_801B5E2C","UNK_TYPE1","",0x1), 0x801B5E48:("D_801B5E48","UNK_TYPE1","",0x1), 0x801B5E64:("D_801B5E64","UNK_TYPE1","",0x1), 0x801B5E8C:("D_801B5E8C","UNK_TYPE1","",0x1), - 0x801B5EB4:("D_801B5EB4","UNK_TYPE1","",0x1), - 0x801B5EDC:("D_801B5EDC","UNK_TYPE1","",0x1), - 0x801B5F0C:("D_801B5F0C","UNK_TYPE1","",0x1), - 0x801B5F34:("D_801B5F34","UNK_TYPE1","",0x1), - 0x801B5F5C:("D_801B5F5C","UNK_TYPE1","",0x1), - 0x801B5F8C:("D_801B5F8C","UNK_TYPE1","",0x1), - 0x801B5FB0:("D_801B5FB0","UNK_TYPE1","",0x1), - 0x801B5FD4:("D_801B5FD4","UNK_TYPE1","",0x1), - 0x801B5FF8:("D_801B5FF8","UNK_TYPE1","",0x1), + 0x801B5EB4:("sSetDungeon3ModeNormalData","UNK_TYPE1","",0x1), + 0x801B5EDC:("sSetDungeon3ModeTargetData","UNK_TYPE1","",0x1), + 0x801B5F0C:("sSetDungeon3ModeJumpData","UNK_TYPE1","",0x1), + 0x801B5F34:("sSetDungeon3ModeStillData","UNK_TYPE1","",0x1), + 0x801B5F5C:("sSetDungeon3ModePushPullData","UNK_TYPE1","",0x1), + 0x801B5F8C:("sSetTelescopeModeNormalData","UNK_TYPE1","",0x1), + 0x801B5FB0:("sSetTelescopeModeTargetData","UNK_TYPE1","",0x1), + 0x801B5FD4:("sSetTelescopeModeFirstPersonData","UNK_TYPE1","",0x1), + 0x801B5FF8:("sSetTelescopeModeDekuHideData","UNK_TYPE1","",0x1), 0x801B601C:("D_801B601C","UNK_TYPE1","",0x1), 0x801B6044:("D_801B6044","UNK_TYPE1","",0x1), 0x801B6074:("D_801B6074","UNK_TYPE1","",0x1), @@ -665,59 +678,59 @@ 0x801B6674:("D_801B6674","UNK_TYPE1","",0x1), 0x801B6698:("D_801B6698","UNK_TYPE1","",0x1), 0x801B66C0:("D_801B66C0","UNK_TYPE1","",0x1), - 0x801B66E8:("D_801B66E8","UNK_TYPE1","",0x1), - 0x801B6710:("D_801B6710","UNK_TYPE1","",0x1), - 0x801B6740:("D_801B6740","UNK_TYPE1","",0x1), - 0x801B6774:("D_801B6774","UNK_TYPE1","",0x1), - 0x801B679C:("D_801B679C","UNK_TYPE1","",0x1), - 0x801B67C4:("D_801B67C4","UNK_TYPE1","",0x1), - 0x801B67EC:("D_801B67EC","UNK_TYPE1","",0x1), - 0x801B681C:("D_801B681C","UNK_TYPE1","",0x1), - 0x801B684C:("D_801B684C","UNK_TYPE1","",0x1), - 0x801B6880:("D_801B6880","UNK_TYPE1","",0x1), - 0x801B68A8:("D_801B68A8","UNK_TYPE1","",0x1), - 0x801B68D0:("D_801B68D0","UNK_TYPE1","",0x1), - 0x801B68F8:("D_801B68F8","UNK_TYPE1","",0x1), - 0x801B692C:("D_801B692C","UNK_TYPE1","",0x1), - 0x801B6954:("D_801B6954","UNK_TYPE1","",0x1), - 0x801B697C:("D_801B697C","UNK_TYPE1","",0x1), - 0x801B69A4:("D_801B69A4","UNK_TYPE1","",0x1), - 0x801B69CC:("D_801B69CC","UNK_TYPE1","",0x1), - 0x801B69FC:("D_801B69FC","UNK_TYPE1","",0x1), - 0x801B6A30:("D_801B6A30","UNK_TYPE1","",0x1), - 0x801B6A58:("D_801B6A58","UNK_TYPE1","",0x1), - 0x801B6A80:("D_801B6A80","UNK_TYPE1","",0x1), - 0x801B6AA8:("D_801B6AA8","UNK_TYPE1","",0x1), - 0x801B6AD0:("D_801B6AD0","UNK_TYPE1","",0x1), - 0x801B6AF8:("D_801B6AF8","UNK_TYPE1","",0x1), - 0x801B6B28:("D_801B6B28","UNK_TYPE1","",0x1), - 0x801B6B50:("D_801B6B50","UNK_TYPE1","",0x1), - 0x801B6B78:("D_801B6B78","UNK_TYPE1","",0x1), - 0x801B6BA0:("D_801B6BA0","UNK_TYPE1","",0x1), - 0x801B6BC8:("D_801B6BC8","UNK_TYPE1","",0x1), - 0x801B6BF0:("D_801B6BF0","UNK_TYPE1","",0x1), - 0x801B6C18:("D_801B6C18","UNK_TYPE1","",0x1), - 0x801B6C48:("D_801B6C48","UNK_TYPE1","",0x1), - 0x801B6C70:("D_801B6C70","UNK_TYPE1","",0x1), + 0x801B66E8:("sSetBossMajoraModeNormalData","UNK_TYPE1","",0x1), + 0x801B6710:("sSetBossMajoraModeFollowTargetData","UNK_TYPE1","",0x1), + 0x801B6740:("sSetBossMajoraModeBattleData","UNK_TYPE1","",0x1), + 0x801B6774:("sSetBossMajoraModeJumpData","UNK_TYPE1","",0x1), + 0x801B679C:("sSetBossMajoraModeStillData","UNK_TYPE1","",0x1), + 0x801B67C4:("sSetBossTwinmoldModeNormalData","UNK_TYPE1","",0x1), + 0x801B67EC:("sSetBossTwinmoldModeTargetData","UNK_TYPE1","",0x1), + 0x801B681C:("sSetBossTwinmoldModeFollowTargetData","UNK_TYPE1","",0x1), + 0x801B684C:("sSetBossTwinmoldModeBattleData","UNK_TYPE1","",0x1), + 0x801B6880:("sSetBossTwinmoldModeJumpData","UNK_TYPE1","",0x1), + 0x801B68A8:("sSetBossTwinmoldModeStillData","UNK_TYPE1","",0x1), + 0x801B68D0:("sSetBossGohtModeNormalData","UNK_TYPE1","",0x1), + 0x801B68F8:("sSetBossGohtModeBattleData","UNK_TYPE1","",0x1), + 0x801B692C:("sSetBossGohtModeJumpData","UNK_TYPE1","",0x1), + 0x801B6954:("sSetBossGohtModeStillData","UNK_TYPE1","",0x1), + 0x801B697C:("sSetBossGohtModeGoronDashData","UNK_TYPE1","",0x1), + 0x801B69A4:("sSetBossGyorgModeNormalData","UNK_TYPE1","",0x1), + 0x801B69CC:("sSetBossGyorgModeFollowTargetData","UNK_TYPE1","",0x1), + 0x801B69FC:("sSetBossGyorgModeBattleData","UNK_TYPE1","",0x1), + 0x801B6A30:("sSetBossGyorgModeGoronJumpData","UNK_TYPE1","",0x1), + 0x801B6A58:("sSetBossGyorgModeDekuFlyData","UNK_TYPE1","",0x1), + 0x801B6A80:("sSetBossGyorgModeDekuHideData","UNK_TYPE1","",0x1), + 0x801B6AA8:("sSetBossGyorgModeStillData","UNK_TYPE1","",0x1), + 0x801B6AD0:("sSetPinnacleRockModeNormalData","UNK_TYPE1","",0x1), + 0x801B6AF8:("sSetPinnacleRockModeTargetData","UNK_TYPE1","",0x1), + 0x801B6B28:("sSetPinnacleRockModeGoronJumpData","UNK_TYPE1","",0x1), + 0x801B6B50:("sSetPinnacleRockModeDekuFlyData","UNK_TYPE1","",0x1), + 0x801B6B78:("sSetPinnacleRockModeDekuHideData","UNK_TYPE1","",0x1), + 0x801B6BA0:("sSetPinnacleRockModeStillData","UNK_TYPE1","",0x1), + 0x801B6BC8:("sSetPinnacleRockModeGoronDashData","UNK_TYPE1","",0x1), + 0x801B6BF0:("sSetNormal2ModeNormalData","UNK_TYPE1","",0x1), + 0x801B6C18:("sSetNormal2ModeTargetData","UNK_TYPE1","",0x1), + 0x801B6C48:("sSetNormal2ModeJumpData","UNK_TYPE1","",0x1), + 0x801B6C70:("sSetNormal2ModeStillData","UNK_TYPE1","",0x1), 0x801B6C98:("D_801B6C98","UNK_TYPE1","",0x1), 0x801B6CC0:("D_801B6CC0","UNK_TYPE1","",0x1), 0x801B6CF0:("D_801B6CF0","UNK_TYPE1","",0x1), 0x801B6D24:("D_801B6D24","UNK_TYPE1","",0x1), 0x801B6D4C:("D_801B6D4C","UNK_TYPE1","",0x1), 0x801B6D74:("D_801B6D74","UNK_TYPE1","",0x1), - 0x801B6D90:("D_801B6D90","UNK_TYPE1","",0x1), - 0x801B6DB8:("D_801B6DB8","UNK_TYPE1","",0x1), - 0x801B6DE0:("D_801B6DE0","UNK_TYPE1","",0x1), - 0x801B6E08:("D_801B6E08","UNK_TYPE1","",0x1), - 0x801B6E30:("D_801B6E30","UNK_TYPE1","",0x1), - 0x801B6E58:("D_801B6E58","UNK_TYPE1","",0x1), - 0x801B6E80:("D_801B6E80","UNK_TYPE1","",0x1), - 0x801B6EA8:("D_801B6EA8","UNK_TYPE1","",0x1), - 0x801B6ED0:("D_801B6ED0","UNK_TYPE1","",0x1), - 0x801B6EF8:("D_801B6EF8","UNK_TYPE1","",0x1), - 0x801B6F20:("D_801B6F20","UNK_TYPE1","",0x1), - 0x801B6F50:("D_801B6F50","UNK_TYPE1","",0x1), - 0x801B6F78:("D_801B6F78","UNK_TYPE1","",0x1), + 0x801B6D90:("sSetWhirlpoolModeNormalData","UNK_TYPE1","",0x1), + 0x801B6DB8:("sSetWhirlpoolModeFreeFallData","UNK_TYPE1","",0x1), + 0x801B6DE0:("sSetWhirlpoolModeGoronJumpData","UNK_TYPE1","",0x1), + 0x801B6E08:("sSetWhirlpoolModeDekuFlyData","UNK_TYPE1","",0x1), + 0x801B6E30:("sSetWhirlpoolModeDekuHideData","UNK_TYPE1","",0x1), + 0x801B6E58:("sSetWhirlpoolModeGoronDashData","UNK_TYPE1","",0x1), + 0x801B6E80:("sSetCuccoShackModeNormalData","UNK_TYPE1","",0x1), + 0x801B6EA8:("sSetCuccoShackModeStillData","UNK_TYPE1","",0x1), + 0x801B6ED0:("sSetCuccoShackModeDekuHideData","UNK_TYPE1","",0x1), + 0x801B6EF8:("sSetGiantModeNormalData","UNK_TYPE1","",0x1), + 0x801B6F20:("sSetGiantModeTargetData","UNK_TYPE1","",0x1), + 0x801B6F50:("sSetGiantModeJumpData","UNK_TYPE1","",0x1), + 0x801B6F78:("sSetGiantModeStillData","UNK_TYPE1","",0x1), 0x801B6FA0:("D_801B6FA0","UNK_TYPE1","",0x1), 0x801B6FB0:("D_801B6FB0","UNK_TYPE1","",0x1), 0x801B6FD8:("D_801B6FD8","UNK_TYPE1","",0x1), @@ -734,130 +747,129 @@ 0x801B71D4:("D_801B71D4","UNK_TYPE1","",0x1), 0x801B7204:("D_801B7204","UNK_TYPE1","",0x1), 0x801B7210:("D_801B7210","UNK_TYPE1","",0x1), - 0x801B7244:("D_801B7244","UNK_TYPE1","",0x1), - 0x801B7278:("D_801B7278","UNK_TYPE1","",0x1), - 0x801B729C:("D_801B729C","UNK_TYPE1","",0x1), - 0x801B72C0:("D_801B72C0","UNK_TYPE1","",0x1), - 0x801B72E4:("D_801B72E4","UNK_TYPE1","",0x1), - 0x801B7308:("D_801B7308","UNK_TYPE1","",0x1), - 0x801B732C:("D_801B732C","UNK_TYPE1","",0x1), - 0x801B7354:("D_801B7354","UNK_TYPE1","",0x1), - 0x801B7384:("D_801B7384","UNK_TYPE1","",0x1), - 0x801B73AC:("D_801B73AC","UNK_TYPE1","",0x1), - 0x801B73D4:("D_801B73D4","UNK_TYPE1","",0x1), - 0x801B74C4:("D_801B74C4","UNK_TYPE1","",0x1), - 0x801B759C:("D_801B759C","UNK_TYPE1","",0x1), - 0x801B75F4:("D_801B75F4","UNK_TYPE1","",0x1), - 0x801B767C:("D_801B767C","UNK_TYPE1","",0x1), - 0x801B7684:("D_801B7684","UNK_TYPE1","",0x1), - 0x801B768C:("D_801B768C","UNK_TYPE1","",0x1), - 0x801B7694:("D_801B7694","UNK_TYPE1","",0x1), - 0x801B769C:("D_801B769C","UNK_TYPE1","",0x1), - 0x801B76A4:("D_801B76A4","UNK_TYPE1","",0x1), - 0x801B76AC:("D_801B76AC","UNK_TYPE1","",0x1), - 0x801B777C:("D_801B777C","UNK_TYPE1","",0x1), - 0x801B784C:("D_801B784C","UNK_TYPE1","",0x1), - 0x801B791C:("D_801B791C","UNK_TYPE1","",0x1), - 0x801B7984:("D_801B7984","UNK_TYPE1","",0x1), - 0x801B79EC:("D_801B79EC","UNK_TYPE1","",0x1), - 0x801B79F4:("D_801B79F4","UNK_TYPE1","",0x1), - 0x801B7AE4:("D_801B7AE4","UNK_TYPE1","",0x1), - 0x801B7B14:("D_801B7B14","UNK_TYPE1","",0x1), - 0x801B7B44:("D_801B7B44","UNK_TYPE1","",0x1), - 0x801B7B74:("D_801B7B74","UNK_TYPE1","",0x1), - 0x801B7BA4:("D_801B7BA4","UNK_TYPE1","",0x1), - 0x801B7BAC:("D_801B7BAC","UNK_TYPE1","",0x1), - 0x801B7BDC:("D_801B7BDC","UNK_TYPE1","",0x1), - 0x801B7C0C:("D_801B7C0C","UNK_TYPE1","",0x1), - 0x801B7C3C:("D_801B7C3C","UNK_TYPE1","",0x1), - 0x801B7C44:("D_801B7C44","UNK_TYPE1","",0x1), - 0x801B7C54:("D_801B7C54","UNK_TYPE1","",0x1), - 0x801B7C5C:("D_801B7C5C","UNK_TYPE1","",0x1), - 0x801B7C64:("D_801B7C64","UNK_TYPE1","",0x1), - 0x801B7D34:("D_801B7D34","UNK_TYPE1","",0x1), - 0x801B7D3C:("D_801B7D3C","UNK_TYPE1","",0x1), - 0x801B7D44:("D_801B7D44","UNK_TYPE1","",0x1), - 0x801B7D4C:("D_801B7D4C","UNK_TYPE1","",0x1), - 0x801B7D54:("D_801B7D54","UNK_TYPE1","",0x1), - 0x801B7D5C:("D_801B7D5C","UNK_TYPE1","",0x1), - 0x801B7D64:("D_801B7D64","UNK_TYPE1","",0x1), - 0x801B7DCC:("D_801B7DCC","UNK_TYPE1","",0x1), - 0x801B7DD4:("D_801B7DD4","UNK_TYPE1","",0x1), - 0x801B7E3C:("D_801B7E3C","UNK_TYPE1","",0x1), - 0x801B7F0C:("D_801B7F0C","UNK_TYPE1","",0x1), - 0x801B7F14:("D_801B7F14","UNK_TYPE1","",0x1), - 0x801B7F1C:("D_801B7F1C","UNK_TYPE1","",0x1), - 0x801B7F24:("D_801B7F24","UNK_TYPE1","",0x1), - 0x801B7F2C:("D_801B7F2C","UNK_TYPE1","",0x1), - 0x801B7F34:("D_801B7F34","UNK_TYPE1","",0x1), - 0x801B7F3C:("D_801B7F3C","UNK_TYPE1","",0x1), - 0x801B7FAC:("D_801B7FAC","UNK_TYPE1","",0x1), - 0x801B807C:("D_801B807C","UNK_TYPE1","",0x1), - 0x801B8084:("D_801B8084","UNK_TYPE1","",0x1), - 0x801B8154:("D_801B8154","UNK_TYPE1","",0x1), - 0x801B8224:("D_801B8224","UNK_TYPE1","",0x1), - 0x801B82F4:("D_801B82F4","UNK_TYPE1","",0x1), - 0x801B82FC:("D_801B82FC","UNK_TYPE1","",0x1), - 0x801B8304:("D_801B8304","UNK_TYPE1","",0x1), - 0x801B83D4:("D_801B83D4","UNK_TYPE1","",0x1), - 0x801B83DC:("D_801B83DC","UNK_TYPE1","",0x1), - 0x801B8434:("D_801B8434","UNK_TYPE1","",0x1), - 0x801B843C:("D_801B843C","UNK_TYPE1","",0x1), - 0x801B8444:("D_801B8444","UNK_TYPE1","",0x1), - 0x801B8514:("D_801B8514","UNK_TYPE1","",0x1), - 0x801B85E4:("D_801B85E4","UNK_TYPE1","",0x1), - 0x801B8664:("D_801B8664","UNK_TYPE1","",0x1), - 0x801B8754:("D_801B8754","UNK_TYPE1","",0x1), - 0x801B875C:("D_801B875C","UNK_TYPE1","",0x1), - 0x801B87C4:("D_801B87C4","UNK_TYPE1","",0x1), - 0x801B8894:("D_801B8894","UNK_TYPE1","",0x1), - 0x801B8964:("D_801B8964","UNK_TYPE1","",0x1), - 0x801B8A34:("D_801B8A34","UNK_TYPE1","",0x1), - 0x801B8B04:("D_801B8B04","UNK_TYPE1","",0x1), - 0x801B8BD4:("D_801B8BD4","UNK_TYPE1","",0x1), - 0x801B8CAC:("D_801B8CAC","UNK_TYPE1","",0x1), - 0x801B8CB4:("D_801B8CB4","UNK_TYPE1","",0x1), - 0x801B8D8C:("D_801B8D8C","UNK_TYPE1","",0x1), - 0x801B8E5C:("D_801B8E5C","UNK_TYPE1","",0x1), - 0x801B8F2C:("D_801B8F2C","UNK_TYPE1","",0x1), - 0x801B8F34:("D_801B8F34","UNK_TYPE1","",0x1), - 0x801B900C:("D_801B900C","UNK_TYPE1","",0x1), - 0x801B90D4:("D_801B90D4","UNK_TYPE1","",0x1), - 0x801B91A4:("D_801B91A4","UNK_TYPE1","",0x1), - 0x801B91AC:("D_801B91AC","UNK_TYPE1","",0x1), - 0x801B927C:("D_801B927C","UNK_TYPE1","",0x1), - 0x801B9354:("D_801B9354","UNK_TYPE1","",0x1), - 0x801B9424:("D_801B9424","UNK_TYPE1","",0x1), - 0x801B94F4:("D_801B94F4","UNK_TYPE1","",0x1), - 0x801B95C4:("D_801B95C4","UNK_TYPE1","",0x1), - 0x801B95CC:("D_801B95CC","UNK_TYPE1","",0x1), - 0x801B969C:("D_801B969C","UNK_TYPE1","",0x1), - 0x801B976C:("D_801B976C","UNK_TYPE1","",0x1), - 0x801B979C:("D_801B979C","UNK_TYPE1","",0x1), - 0x801B986C:("cameraStates","CameraStateParams","[91]",0x444), - 0x801B9CB0:("D_801B9CB0","UNK_TYPE1","",0x1), - 0x801B9CE2:("D_801B9CE2","UNK_TYPE1","",0x1), - 0x801B9CE4:("D_801B9CE4","UNK_PTR","",0x4), - 0x801B9CE8:("cameraUpdateFuncs","camera_update_func","[71]",0x11c), - 0x801B9E04:("D_801B9E04","UNK_TYPE2","",0x2), - 0x801B9E08:("D_801B9E08","UNK_TYPE4","",0x4), - 0x801B9E0C:("D_801B9E0C","UNK_TYPE4","",0x4), - 0x801B9E10:("D_801B9E10","UNK_TYPE4","",0x4), - 0x801B9E14:("D_801B9E14","UNK_TYPE4","",0x4), + 0x801B7244:("sSetNormal4ModeTalkData","UNK_TYPE1","",0x1), + 0x801B7278:("sSetElegyShellModeNormalData","UNK_TYPE1","",0x1), + 0x801B729C:("sSetElegyShellModeJumpData","UNK_TYPE1","",0x1), + 0x801B72C0:("sSetElegyShellModeDekuShootData","UNK_TYPE1","",0x1), + 0x801B72E4:("sSetElegyShellModeGoronDashData","UNK_TYPE1","",0x1), + 0x801B7308:("sSetElegyShellModeDekuFlyData","UNK_TYPE1","",0x1), + 0x801B732C:("sSetDungeon4ModeNormalData","UNK_TYPE1","",0x1), + 0x801B7354:("sSetDungeon4ModeTargetData","UNK_TYPE1","",0x1), + 0x801B7384:("sSetDungeon4ModeJumpData","UNK_TYPE1","",0x1), + 0x801B73AC:("sSetDungeon4ModeStillData","UNK_TYPE1","",0x1), + 0x801B73D4:("sCamSetNormal0Modes","UNK_TYPE1","",0x1), + 0x801B74C4:("sCamSetNormal3Modes","UNK_TYPE1","",0x1), + 0x801B759C:("sCamSetPivotDivingModes","UNK_TYPE1","",0x1), + 0x801B75F4:("sCamSetHorseModes","UNK_TYPE1","",0x1), + 0x801B767C:("sCamSetZoraDivingModes","UNK_TYPE1","",0x1), + 0x801B7684:("sCamSetPreRendFixedModes","UNK_TYPE1","",0x1), + 0x801B768C:("sCamSetPreRendPivotModes","UNK_TYPE1","",0x1), + 0x801B7694:("sCamSetDoorCModes","UNK_TYPE1","",0x1), + 0x801B769C:("sCamSetDemo0Modes","UNK_TYPE1","",0x1), + 0x801B76A4:("sCamSetFree0Modes","UNK_TYPE1","",0x1), + 0x801B76AC:("sCamSetFukan0Modes","UNK_TYPE1","",0x1), + 0x801B777C:("sCamSetNormal1Modes","UNK_TYPE1","",0x1), + 0x801B784C:("sCamSetNanameModes","UNK_TYPE1","",0x1), + 0x801B791C:("sCamSetCirc0Modes","UNK_TYPE1","",0x1), + 0x801B7984:("sCamSetFixed0Modes","UNK_TYPE1","",0x1), + 0x801B79EC:("sCamSetSpiralDoorModes","UNK_TYPE1","",0x1), + 0x801B79F4:("sCamSetDungeon0Modes","UNK_TYPE1","",0x1), + 0x801B7AE4:("sCamSetItem0Modes","UNK_TYPE1","",0x1), + 0x801B7B14:("sCamSetItem1Modes","UNK_TYPE1","",0x1), + 0x801B7B44:("sCamSetItem2Modes","UNK_TYPE1","",0x1), + 0x801B7B74:("sCamSetItem3Modes","UNK_TYPE1","",0x1), + 0x801B7BA4:("sCamSetNaviModes","UNK_TYPE1","",0x1), + 0x801B7BAC:("sCamSetWarp0Modes","UNK_TYPE1","",0x1), + 0x801B7BDC:("sCamSetDeathModes","UNK_TYPE1","",0x1), + 0x801B7C0C:("sCamSetRebirthModes","UNK_TYPE1","",0x1), + 0x801B7C3C:("sCamSetLongChestOpeningModes","UNK_TYPE1","",0x1), + 0x801B7C44:("sCamSetMaskTransformationModes","UNK_TYPE1","",0x1), + 0x801B7C54:("sCamSetAttentionModes","UNK_TYPE1","",0x1), + 0x801B7C5C:("sCamSetWarp1Modes","UNK_TYPE1","",0x1), + 0x801B7C64:("sCamSetDungeon1Modes","UNK_TYPE1","",0x1), + 0x801B7D34:("sCamSetFixed1Modes","UNK_TYPE1","",0x1), + 0x801B7D3C:("sCamSetFixed2Modes","UNK_TYPE1","",0x1), + 0x801B7D44:("sCamSetMazeModes","UNK_TYPE1","",0x1), + 0x801B7D4C:("sCamSetRemoteBombModes","UNK_TYPE1","",0x1), + 0x801B7D54:("sCamSetCirc1Modes","UNK_TYPE1","",0x1), + 0x801B7D5C:("sCamSetCirc2Modes","UNK_TYPE1","",0x1), + 0x801B7D64:("sCamSetCirc3Modes","UNK_TYPE1","",0x1), + 0x801B7DCC:("sCamSetCirc4Modes","UNK_TYPE1","",0x1), + 0x801B7DD4:("sCamSetFixed3Modes","UNK_TYPE1","",0x1), + 0x801B7E3C:("sCamSetTowerClimbModes","UNK_TYPE1","",0x1), + 0x801B7F0C:("sCamSetParallel0Modes","UNK_TYPE1","",0x1), + 0x801B7F14:("sCamSetNormDModes","UNK_TYPE1","",0x1), + 0x801B7F1C:("sCamSetSubjectDModes","UNK_TYPE1","",0x1), + 0x801B7F24:("sCamSetStart0Modes","UNK_TYPE1","",0x1), + 0x801B7F2C:("sCamSetStart2Modes","UNK_TYPE1","",0x1), + 0x801B7F34:("sCamSetStop0Modes","UNK_TYPE1","",0x1), + 0x801B7F3C:("sCamSetBoatCruiseModes","UNK_TYPE1","",0x1), + 0x801B7FAC:("sCamSetVerticalClimbModes","UNK_TYPE1","",0x1), + 0x801B807C:("sCamSetSidedModes","UNK_TYPE1","",0x1), + 0x801B8084:("sCamSetDungeon2Modes","UNK_TYPE1","",0x1), + 0x801B8154:("sCamSetBossOdolwaModes","UNK_TYPE1","",0x1), + 0x801B8224:("sCamSetKeepBackModes","UNK_TYPE1","",0x1), + 0x801B82F4:("sCamSetCirc6Modes","UNK_TYPE1","",0x1), + 0x801B82FC:("sCamSetCirc7Modes","UNK_TYPE1","",0x1), + 0x801B8304:("sCamSetMiniBossModes","UNK_TYPE1","",0x1), + 0x801B83D4:("sCamSetRFixed1Modes","UNK_TYPE1","",0x1), + 0x801B83DC:("sCamSetTreasureChestMinigameModes","UNK_TYPE1","",0x1), + 0x801B8434:("sCamSetBombBasketModes","UNK_TYPE1","",0x1), + 0x801B843C:("sCamSetCirc8Modes","UNK_TYPE1","",0x1), + 0x801B8444:("sCamSetFukan1Modes","UNK_TYPE1","",0x1), + 0x801B8514:("sCamSetDungeon3Modes","UNK_TYPE1","",0x1), + 0x801B85E4:("sCamSetTelescopeModes","UNK_TYPE1","",0x1), + 0x801B8664:("sCamSetRoom0Modes","UNK_TYPE1","",0x1), + 0x801B8754:("sCamSetRCirc0Modes","UNK_TYPE1","",0x1), + 0x801B875C:("sCamSetCirc9Modes","UNK_TYPE1","",0x1), + 0x801B87C4:("sCamSetOnThePoleModes","UNK_TYPE1","",0x1), + 0x801B8894:("sCamSetInBushModes","UNK_TYPE1","",0x1), + 0x801B8964:("sCamSetBossMajoraModes","UNK_TYPE1","",0x1), + 0x801B8A34:("sCamSetBossTwinmoldModes","UNK_TYPE1","",0x1), + 0x801B8B04:("sCamSetBossGohtModes","UNK_TYPE1","",0x1), + 0x801B8BD4:("sCamSetBossGyorgModes","UNK_TYPE1","",0x1), + 0x801B8CAC:("sCamSetConnect0Modes","UNK_TYPE1","",0x1), + 0x801B8CB4:("sCamSetPinnacleRockModes","UNK_TYPE1","",0x1), + 0x801B8D8C:("sCamSetNormal2Modes","UNK_TYPE1","",0x1), + 0x801B8E5C:("sCamSetBombBowlModes","UNK_TYPE1","",0x1), + 0x801B8F2C:("sCamSetCircAModes","UNK_TYPE1","",0x1), + 0x801B8F34:("sCamSetWhirlpoolModes","UNK_TYPE1","",0x1), + 0x801B900C:("sCamSetCuccoShackModes","UNK_TYPE1","",0x1), + 0x801B90D4:("sCamSetGiantModes","UNK_TYPE1","",0x1), + 0x801B91A4:("sCamSetScene0Modes","UNK_TYPE1","",0x1), + 0x801B91AC:("sCamSetRoom1Modes","UNK_TYPE1","",0x1), + 0x801B927C:("sCamSetWater2Modes","UNK_TYPE1","",0x1), + 0x801B9354:("sCamSetWoodfallSwampModes","UNK_TYPE1","",0x1), + 0x801B9424:("sCamSetForceKeepModes","UNK_TYPE1","",0x1), + 0x801B94F4:("sCamSetParallel1Modes","UNK_TYPE1","",0x1), + 0x801B95C4:("sCamSetStart1Modes","UNK_TYPE1","",0x1), + 0x801B95CC:("sCamSetRoom2Modes","UNK_TYPE1","",0x1), + 0x801B969C:("sCamSetNorm4Modes","UNK_TYPE1","",0x1), + 0x801B976C:("sCamSetElegyShellModes","UNK_TYPE1","",0x1), + 0x801B979C:("sCamSetDungeon4Modes","UNK_TYPE1","",0x1), + 0x801B986C:("sCameraSettings","CameraSetting","[91]",0x444), + 0x801B9CB0:("sGlobalCamDataSettings","s16","[26]",0x34), + 0x801B9CE4:("sGlobalCamDataSettingsPtr","s16*","",0x4), + 0x801B9CE8:("sCameraUpdateHandlers","camera_update_func","[71]",0x11c), + 0x801B9E04:("sCameraNextUID","UNK_TYPE2","",0x2), + 0x801B9E08:("sCameraInterfaceFlags","UNK_TYPE4","",0x4), + 0x801B9E0C:("sCameraHudVisibility","UNK_TYPE4","",0x4), + 0x801B9E10:("sCameraLetterboxSize","UNK_TYPE4","",0x4), + 0x801B9E14:("sCameraNegOne","UNK_TYPE4","",0x4), 0x801B9E18:("D_801B9E18","UNK_TYPE2","",0x2), 0x801B9E34:("D_801B9E34","UNK_TYPE2","",0x2), - 0x801B9E50:("D_801B9E50","UNK_TYPE4","",0x4), - 0x801B9E54:("D_801B9E54","UNK_TYPE4","",0x4), - 0x801B9E58:("D_801B9E58","UNK_TYPE4","",0x4), + 0x801B9E50:("sUpdateCameraDirection","UNK_TYPE4","",0x4), + 0x801B9E54:("sIsFalse","UNK_TYPE4","",0x4), + 0x801B9E58:("sCameraInitSceneTimer","UNK_TYPE4","",0x4), 0x801B9E5C:("D_801B9E5C","UNK_TYPE4","",0x4), 0x801B9E60:("D_801B9E60","f32","",0x4), 0x801B9E64:("D_801B9E64","UNK_TYPE1","",0x1), 0x801B9E84:("D_801B9E84","UNK_TYPE1","",0x1), 0x801B9EB4:("D_801B9EB4","UNK_TYPE4","",0x4), 0x801B9ED4:("D_801B9ED4","UNK_TYPE4","",0x4), - 0x801B9F04:("D_801B9F04","UNK_TYPE4","",0x4), - 0x801B9F0C:("D_801B9F0C","UNK_TYPE2","",0x2), - 0x801B9F10:("D_801B9F10","UNK_TYPE4","",0x4), + 0x801B9F04:("sEarthquakeFreq","UNK_TYPE4","",0x4), + 0x801B9F0C:("sEarthquakeTimer","UNK_TYPE2","",0x2), + 0x801B9F10:("sModeChangeFlags","UNK_TYPE4","",0x4), 0x801B9F20:("sDamageTablePresets","DamageTable","[23]",0x2e0), 0x801BA200:("damageMultipliers","f32","[16]",0x40), 0x801BA240:("defaultCollider","Collider","",0x18), @@ -3861,26 +3873,14 @@ 0x801EDBA8:("D_801EDBA8","Sphere16","",0x8), 0x801EDBB0:("D_801EDBB0","TriNorm","",0x34), 0x801EDBF0:("D_801EDBF0","s16","",0x2), - 0x801EDBF4:("D_801EDBF4","UNK_TYPE1","",0x1), - 0x801EDBF8:("D_801EDBF8","UNK_TYPE1","",0x1), - 0x801EDC00:("D_801EDC00","UNK_TYPE1","",0x1), - 0x801EDC04:("D_801EDC04","UNK_TYPE1","",0x1), - 0x801EDC08:("D_801EDC08","UNK_TYPE1","",0x1), - 0x801EDC0C:("D_801EDC0C","UNK_TYPE1","",0x1), - 0x801EDC10:("D_801EDC10","UNK_TYPE1","",0x1), - 0x801EDC14:("D_801EDC14","UNK_TYPE1","",0x1), - 0x801EDC28:("D_801EDC28","UNK_TYPE1","",0x1), - 0x801EDC30:("D_801EDC30","UNK_TYPE1","",0x1), - 0x801EDC8C:("D_801EDC8C","UNK_TYPE1","",0x1), - 0x801EDC90:("D_801EDC90","UNK_TYPE1","",0x1), - 0x801EDC92:("D_801EDC92","UNK_TYPE1","",0x1), - 0x801EDC94:("D_801EDC94","UNK_TYPE1","",0x1), - 0x801EDC96:("D_801EDC96","UNK_TYPE1","",0x1), - 0x801EDDD0:("D_801EDDD0","UNK_TYPE1","",0x1), - 0x801EDDD4:("D_801EDDD4","UNK_TYPE1","",0x1), - 0x801EDDD8:("D_801EDDD8","UNK_TYPE1","",0x1), - 0x801EDDE0:("D_801EDDE0","UNK_TYPE1","",0x1), - 0x801EDDF0:("D_801EDDF0","UNK_TYPE1","",0x1), + 0x801EDBF4:("D_801EDBF4","f32","",0x4), + 0x801EDBF8:("D_801EDBF8","f32","",0x4), + 0x801EDC00:("D_801EDC00","CameraCollision","",0x28), + 0x801EDC28:("sCamPlayState","PlayState*","",0x4), + 0x801EDC30:("D_801EDC30","SwingAnimation","[4]",0x1A0), + 0x801EDDD0:("D_801EDDD0","Vec3f","",0xc), + 0x801EDDE0:("D_801EDDE0","Vec3f","",0xc), + 0x801EDDF0:("D_801EDDF0","Vec3f","",0xc), 0x801EDE00:("D_801EDE00","Vec3f","",0xc), 0x801EDE10:("D_801EDE10","Vec3f","",0xc), 0x801EDE20:("D_801EDE20","Vec3f","",0xc), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index d18b02616..f1d994d11 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -696,77 +696,77 @@ asm/non_matchings/code/z_camera/func_800CE930.s,func_800CE930,0x800CE930,0x6A asm/non_matchings/code/z_camera/func_800CEAD8.s,func_800CEAD8,0x800CEAD8,0x58 asm/non_matchings/code/z_camera/func_800CEC38.s,func_800CEC38,0x800CEC38,0x56 asm/non_matchings/code/z_camera/func_800CED90.s,func_800CED90,0x800CED90,0x185 -asm/non_matchings/code/z_camera/Camera_ModeNop.s,Camera_ModeNop,0x800CF3A4,0x4 -asm/non_matchings/code/z_camera/Camera_ModeNORM1.s,Camera_ModeNORM1,0x800CF3B4,0x530 -asm/non_matchings/code/z_camera/Camera_ModeNORM2.s,Camera_ModeNORM2,0x800D0874,0x8 -asm/non_matchings/code/z_camera/Camera_ModeNORM3.s,Camera_ModeNORM3,0x800D0894,0x265 -asm/non_matchings/code/z_camera/Camera_ModeNORM4.s,Camera_ModeNORM4,0x800D1228,0x24 -asm/non_matchings/code/z_camera/Camera_ModeNORM0.s,Camera_ModeNORM0,0x800D12B8,0x1F0 -asm/non_matchings/code/z_camera/Camera_ModePARA1.s,Camera_ModePARA1,0x800D1A78,0x40C -asm/non_matchings/code/z_camera/Camera_ModePARA2.s,Camera_ModePARA2,0x800D2AA8,0x8 -asm/non_matchings/code/z_camera/Camera_ModePARA3.s,Camera_ModePARA3,0x800D2AC8,0x8 -asm/non_matchings/code/z_camera/Camera_ModePARA4.s,Camera_ModePARA4,0x800D2AE8,0x8 -asm/non_matchings/code/z_camera/Camera_ModePARA0.s,Camera_ModePARA0,0x800D2B08,0x8 -asm/non_matchings/code/z_camera/Camera_ModeJUMP1.s,Camera_ModeJUMP1,0x800D2B28,0x8 -asm/non_matchings/code/z_camera/Camera_ModeJUMP2.s,Camera_ModeJUMP2,0x800D2B48,0x276 -asm/non_matchings/code/z_camera/Camera_ModeJUMP3.s,Camera_ModeJUMP3,0x800D3520,0x330 -asm/non_matchings/code/z_camera/Camera_ModeJUMP4.s,Camera_ModeJUMP4,0x800D41E0,0x8 -asm/non_matchings/code/z_camera/Camera_ModeJUMP0.s,Camera_ModeJUMP0,0x800D4200,0x8 -asm/non_matchings/code/z_camera/Camera_ModeBATT1.s,Camera_ModeBATT1,0x800D4220,0x4E2 -asm/non_matchings/code/z_camera/Camera_ModeBATT2.s,Camera_ModeBATT2,0x800D55A8,0x8 -asm/non_matchings/code/z_camera/Camera_ModeBATT3.s,Camera_ModeBATT3,0x800D55C8,0x8 -asm/non_matchings/code/z_camera/Camera_ModeBATT4.s,Camera_ModeBATT4,0x800D55E8,0x8 -asm/non_matchings/code/z_camera/Camera_ModeBATT0.s,Camera_ModeBATT0,0x800D5608,0x8 -asm/non_matchings/code/z_camera/Camera_ModeKEEP1.s,Camera_ModeKEEP1,0x800D5628,0x46D -asm/non_matchings/code/z_camera/Camera_ModeKEEP2.s,Camera_ModeKEEP2,0x800D67DC,0x8 -asm/non_matchings/code/z_camera/Camera_ModeKEEP3.s,Camera_ModeKEEP3,0x800D67FC,0x2F3 -asm/non_matchings/code/z_camera/Camera_ModeKEEP4.s,Camera_ModeKEEP4,0x800D73C8,0x2F7 -asm/non_matchings/code/z_camera/Camera_ModeKEEP0.s,Camera_ModeKEEP0,0x800D7FA4,0x8 -asm/non_matchings/code/z_camera/Camera_ModeFIXD1.s,Camera_ModeFIXD1,0x800D7FC4,0x101 -asm/non_matchings/code/z_camera/Camera_ModeFIXD2.s,Camera_ModeFIXD2,0x800D83C8,0x290 -asm/non_matchings/code/z_camera/Camera_ModeFIXD3.s,Camera_ModeFIXD3,0x800D8E08,0x8 -asm/non_matchings/code/z_camera/Camera_ModeFIXD4.s,Camera_ModeFIXD4,0x800D8E28,0x8 -asm/non_matchings/code/z_camera/Camera_ModeFIXD0.s,Camera_ModeFIXD0,0x800D8E48,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSUBJ1.s,Camera_ModeSUBJ1,0x800D8E68,0x185 -asm/non_matchings/code/z_camera/Camera_ModeSUBJ2.s,Camera_ModeSUBJ2,0x800D947C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSUBJ3.s,Camera_ModeSUBJ3,0x800D949C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSUBJ4.s,Camera_ModeSUBJ4,0x800D94BC,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSUBJ0.s,Camera_ModeSUBJ0,0x800D94DC,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDATA0.s,Camera_ModeDATA0,0x800D94FC,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDATA1.s,Camera_ModeDATA1,0x800D951C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDATA2.s,Camera_ModeDATA2,0x800D953C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDATA3.s,Camera_ModeDATA3,0x800D955C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDATA4.s,Camera_ModeDATA4,0x800D957C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeUNIQ1.s,Camera_ModeUNIQ1,0x800D959C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeUNIQ2.s,Camera_ModeUNIQ2,0x800D95BC,0x105 -asm/non_matchings/code/z_camera/Camera_ModeUNIQ3.s,Camera_ModeUNIQ3,0x800D99D0,0x17 -asm/non_matchings/code/z_camera/Camera_ModeUNIQ4.s,Camera_ModeUNIQ4,0x800D9A2C,0x17 -asm/non_matchings/code/z_camera/Camera_ModeUNIQ5.s,Camera_ModeUNIQ5,0x800D9A88,0x17 -asm/non_matchings/code/z_camera/Camera_ModeUNIQ0.s,Camera_ModeUNIQ0,0x800D9AE4,0x235 -asm/non_matchings/code/z_camera/Camera_ModeUNIQ6.s,Camera_ModeUNIQ6,0x800DA3B8,0x4D -asm/non_matchings/code/z_camera/Camera_ModeUNIQ7.s,Camera_ModeUNIQ7,0x800DA4EC,0x8 -asm/non_matchings/code/z_camera/Camera_ModeUNIQ8.s,Camera_ModeUNIQ8,0x800DA50C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeUNIQ9.s,Camera_ModeUNIQ9,0x800DA52C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDEMO1.s,Camera_ModeDEMO1,0x800DA54C,0x1F1 -asm/non_matchings/code/z_camera/Camera_ModeDEMO2.s,Camera_ModeDEMO2,0x800DAD10,0x2BD -asm/non_matchings/code/z_camera/Camera_ModeDEMO3.s,Camera_ModeDEMO3,0x800DB804,0xC4 -asm/non_matchings/code/z_camera/Camera_ModeDEMO4.s,Camera_ModeDEMO4,0x800DBB14,0x1D7 -asm/non_matchings/code/z_camera/Camera_ModeDEMO5.s,Camera_ModeDEMO5,0x800DC270,0x12A -asm/non_matchings/code/z_camera/Camera_ModeDEMO6.s,Camera_ModeDEMO6,0x800DC718,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDEMO7.s,Camera_ModeDEMO7,0x800DC738,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDEMO8.s,Camera_ModeDEMO8,0x800DC758,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDEMO9.s,Camera_ModeDEMO9,0x800DC778,0x8 -asm/non_matchings/code/z_camera/Camera_ModeDEMO0.s,Camera_ModeDEMO0,0x800DC798,0x13E -asm/non_matchings/code/z_camera/Camera_ModeSPEC0.s,Camera_ModeSPEC0,0x800DCC90,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSPEC1.s,Camera_ModeSPEC1,0x800DCCB0,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSPEC2.s,Camera_ModeSPEC2,0x800DCCD0,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSPEC3.s,Camera_ModeSPEC3,0x800DCCF0,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSPEC4.s,Camera_ModeSPEC4,0x800DCD10,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSPEC5.s,Camera_ModeSPEC5,0x800DCD30,0xF3 -asm/non_matchings/code/z_camera/Camera_ModeSPEC6.s,Camera_ModeSPEC6,0x800DD0FC,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSPEC7.s,Camera_ModeSPEC7,0x800DD11C,0x8 -asm/non_matchings/code/z_camera/Camera_ModeSPEC8.s,Camera_ModeSPEC8,0x800DD13C,0x11F -asm/non_matchings/code/z_camera/Camera_ModeSPEC9.s,Camera_ModeSPEC9,0x800DD5B8,0x1E8 +asm/non_matchings/code/z_camera/Camera_Noop.s,Camera_Noop,0x800CF3A4,0x4 +asm/non_matchings/code/z_camera/Camera_Normal1.s,Camera_Normal1,0x800CF3B4,0x530 +asm/non_matchings/code/z_camera/Camera_Normal2.s,Camera_Normal2,0x800D0874,0x8 +asm/non_matchings/code/z_camera/Camera_Normal3.s,Camera_Normal3,0x800D0894,0x265 +asm/non_matchings/code/z_camera/Camera_Normal4.s,Camera_Normal4,0x800D1228,0x24 +asm/non_matchings/code/z_camera/Camera_Normal0.s,Camera_Normal0,0x800D12B8,0x1F0 +asm/non_matchings/code/z_camera/Camera_Parallel1.s,Camera_Parallel1,0x800D1A78,0x40C +asm/non_matchings/code/z_camera/Camera_Parallel2.s,Camera_Parallel2,0x800D2AA8,0x8 +asm/non_matchings/code/z_camera/Camera_Parallel3.s,Camera_Parallel3,0x800D2AC8,0x8 +asm/non_matchings/code/z_camera/Camera_Parallel4.s,Camera_Parallel4,0x800D2AE8,0x8 +asm/non_matchings/code/z_camera/Camera_Parallel0.s,Camera_Parallel0,0x800D2B08,0x8 +asm/non_matchings/code/z_camera/Camera_Jump1.s,Camera_Jump1,0x800D2B28,0x8 +asm/non_matchings/code/z_camera/Camera_Jump2.s,Camera_Jump2,0x800D2B48,0x276 +asm/non_matchings/code/z_camera/Camera_Jump3.s,Camera_Jump3,0x800D3520,0x330 +asm/non_matchings/code/z_camera/Camera_Jump4.s,Camera_Jump4,0x800D41E0,0x8 +asm/non_matchings/code/z_camera/Camera_Jump0.s,Camera_Jump0,0x800D4200,0x8 +asm/non_matchings/code/z_camera/Camera_Battle1.s,Camera_Battle1,0x800D4220,0x4E2 +asm/non_matchings/code/z_camera/Camera_Battle2.s,Camera_Battle2,0x800D55A8,0x8 +asm/non_matchings/code/z_camera/Camera_Battle3.s,Camera_Battle3,0x800D55C8,0x8 +asm/non_matchings/code/z_camera/Camera_Battle4.s,Camera_Battle4,0x800D55E8,0x8 +asm/non_matchings/code/z_camera/Camera_Battle0.s,Camera_Battle0,0x800D5608,0x8 +asm/non_matchings/code/z_camera/Camera_KeepOn1.s,Camera_KeepOn1,0x800D5628,0x46D +asm/non_matchings/code/z_camera/Camera_KeepOn2.s,Camera_KeepOn2,0x800D67DC,0x8 +asm/non_matchings/code/z_camera/Camera_KeepOn3.s,Camera_KeepOn3,0x800D67FC,0x2F3 +asm/non_matchings/code/z_camera/Camera_KeepOn4.s,Camera_KeepOn4,0x800D73C8,0x2F7 +asm/non_matchings/code/z_camera/Camera_KeepOn0.s,Camera_KeepOn0,0x800D7FA4,0x8 +asm/non_matchings/code/z_camera/Camera_Fixed1.s,Camera_Fixed1,0x800D7FC4,0x101 +asm/non_matchings/code/z_camera/Camera_Fixed2.s,Camera_Fixed2,0x800D83C8,0x290 +asm/non_matchings/code/z_camera/Camera_Fixed3.s,Camera_Fixed3,0x800D8E08,0x8 +asm/non_matchings/code/z_camera/Camera_Fixed4.s,Camera_Fixed4,0x800D8E28,0x8 +asm/non_matchings/code/z_camera/Camera_Fixed0.s,Camera_Fixed0,0x800D8E48,0x8 +asm/non_matchings/code/z_camera/Camera_Subject1.s,Camera_Subject1,0x800D8E68,0x185 +asm/non_matchings/code/z_camera/Camera_Subject2.s,Camera_Subject2,0x800D947C,0x8 +asm/non_matchings/code/z_camera/Camera_Subject3.s,Camera_Subject3,0x800D949C,0x8 +asm/non_matchings/code/z_camera/Camera_Subject4.s,Camera_Subject4,0x800D94BC,0x8 +asm/non_matchings/code/z_camera/Camera_Subject0.s,Camera_Subject0,0x800D94DC,0x8 +asm/non_matchings/code/z_camera/Camera_Data0.s,Camera_Data0,0x800D94FC,0x8 +asm/non_matchings/code/z_camera/Camera_Data1.s,Camera_Data1,0x800D951C,0x8 +asm/non_matchings/code/z_camera/Camera_Data2.s,Camera_Data2,0x800D953C,0x8 +asm/non_matchings/code/z_camera/Camera_Data3.s,Camera_Data3,0x800D955C,0x8 +asm/non_matchings/code/z_camera/Camera_Data4.s,Camera_Data4,0x800D957C,0x8 +asm/non_matchings/code/z_camera/Camera_Unique1.s,Camera_Unique1,0x800D959C,0x8 +asm/non_matchings/code/z_camera/Camera_Unique2.s,Camera_Unique2,0x800D95BC,0x105 +asm/non_matchings/code/z_camera/Camera_Unique3.s,Camera_Unique3,0x800D99D0,0x17 +asm/non_matchings/code/z_camera/Camera_Unique4.s,Camera_Unique4,0x800D9A2C,0x17 +asm/non_matchings/code/z_camera/Camera_Unique5.s,Camera_Unique5,0x800D9A88,0x17 +asm/non_matchings/code/z_camera/Camera_Unique0.s,Camera_Unique0,0x800D9AE4,0x235 +asm/non_matchings/code/z_camera/Camera_Unique6.s,Camera_Unique6,0x800DA3B8,0x4D +asm/non_matchings/code/z_camera/Camera_Unique7.s,Camera_Unique7,0x800DA4EC,0x8 +asm/non_matchings/code/z_camera/Camera_Unique8.s,Camera_Unique8,0x800DA50C,0x8 +asm/non_matchings/code/z_camera/Camera_Unique9.s,Camera_Unique9,0x800DA52C,0x8 +asm/non_matchings/code/z_camera/Camera_Demo1.s,Camera_Demo1,0x800DA54C,0x1F1 +asm/non_matchings/code/z_camera/Camera_Demo2.s,Camera_Demo2,0x800DAD10,0x2BD +asm/non_matchings/code/z_camera/Camera_Demo3.s,Camera_Demo3,0x800DB804,0xC4 +asm/non_matchings/code/z_camera/Camera_Demo4.s,Camera_Demo4,0x800DBB14,0x1D7 +asm/non_matchings/code/z_camera/Camera_Demo5.s,Camera_Demo5,0x800DC270,0x12A +asm/non_matchings/code/z_camera/Camera_Demo6.s,Camera_Demo6,0x800DC718,0x8 +asm/non_matchings/code/z_camera/Camera_Demo7.s,Camera_Demo7,0x800DC738,0x8 +asm/non_matchings/code/z_camera/Camera_Demo8.s,Camera_Demo8,0x800DC758,0x8 +asm/non_matchings/code/z_camera/Camera_Demo9.s,Camera_Demo9,0x800DC778,0x8 +asm/non_matchings/code/z_camera/Camera_Demo0.s,Camera_Demo0,0x800DC798,0x13E +asm/non_matchings/code/z_camera/Camera_Special0.s,Camera_Special0,0x800DCC90,0x8 +asm/non_matchings/code/z_camera/Camera_Special1.s,Camera_Special1,0x800DCCB0,0x8 +asm/non_matchings/code/z_camera/Camera_Special2.s,Camera_Special2,0x800DCCD0,0x8 +asm/non_matchings/code/z_camera/Camera_Special3.s,Camera_Special3,0x800DCCF0,0x8 +asm/non_matchings/code/z_camera/Camera_Special4.s,Camera_Special4,0x800DCD10,0x8 +asm/non_matchings/code/z_camera/Camera_Special5.s,Camera_Special5,0x800DCD30,0xF3 +asm/non_matchings/code/z_camera/Camera_Special6.s,Camera_Special6,0x800DD0FC,0x8 +asm/non_matchings/code/z_camera/Camera_Special7.s,Camera_Special7,0x800DD11C,0x8 +asm/non_matchings/code/z_camera/Camera_Special8.s,Camera_Special8,0x800DD13C,0x11F +asm/non_matchings/code/z_camera/Camera_Special9.s,Camera_Special9,0x800DD5B8,0x1E8 asm/non_matchings/code/z_camera/Camera_Alloc.s,Camera_Alloc,0x800DDD58,0x14 asm/non_matchings/code/z_camera/Camera_Free.s,Camera_Free,0x800DDDA8,0xA asm/non_matchings/code/z_camera/Camera_Init.s,Camera_Init,0x800DDDD0,0x84 From f3db0299367c4dd7cf44ab9e12cf6c8b56d598ab Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Wed, 12 Oct 2022 23:39:39 -0400 Subject: [PATCH 02/12] z_kaleido_collect.c (1 non-matching) and Mostly Documented (Pause Menu Quest Page) (#1108) * import quest docs * cleanup * eol * temp change to non-eq * more missed stuff * fix questVtx * PR suggestions * adjust comment * missed two * PR Suggestions --- include/functions.h | 2 +- include/regs.h | 3 + include/variables.h | 4 +- include/z64.h | 8 +- include/z64item.h | 10 +- src/code/audio/code_8019AF00.c | 2 +- src/code/code_8012EC80.c | 12 +- src/code/z_demo.c | 2 +- src/code/z_kaleido_setup.c | 4 +- src/code/z_message.c | 2 +- src/code/z_parameter.c | 6 +- .../actors/ovl_Door_Warp1/z_door_warp1.c | 4 +- src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c | 6 +- src/overlays/actors/ovl_En_Fall/z_en_fall.c | 2 +- .../actors/ovl_En_Gakufu/z_en_gakufu.c | 5 +- src/overlays/actors/ovl_En_Giant/z_en_giant.c | 2 +- .../actors/ovl_En_Time_Tag/z_en_time_tag.c | 2 +- .../ovl_kaleido_scope/z_kaleido_collect.c | 1064 +++++++++++++++-- .../ovl_kaleido_scope/z_kaleido_debug.c | 2 +- .../ovl_kaleido_scope/z_kaleido_item.c | 16 +- .../ovl_kaleido_scope/z_kaleido_map.c | 6 +- .../ovl_kaleido_scope/z_kaleido_mask.c | 14 +- .../ovl_kaleido_scope/z_kaleido_scope.h | 26 +- .../ovl_kaleido_scope/z_kaleido_scope_NES.c | 179 ++- tools/disasm/functions.txt | 8 +- tools/disasm/variables.txt | 62 +- tools/namefixer.py | 1 + 27 files changed, 1262 insertions(+), 192 deletions(-) diff --git a/include/functions.h b/include/functions.h index 0c5948ed8..1439401fc 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2929,7 +2929,7 @@ void AudioOcarina_StartDefault(u32 ocarinaFlags); u8 func_8019B5AC(void); void AudioOcarina_ResetAndReadInput(void); void AudioOcarina_SetOcarinaDisableTimer(u8 unused, u8 timer); -u32 AudioOcarina_SetInstrument(u8 ocarinaInstrumentId); +void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId); void AudioOcarina_SetPlaybackSong(s8 songIndexPlusOne, u8 playbackState); void AudioOcarina_SetRecordingState(u8 recordingState); OcarinaStaff* AudioOcarina_GetRecordingStaff(void); diff --git a/include/regs.h b/include/regs.h index 4ad6acbfb..ab31e6d25 100644 --- a/include/regs.h +++ b/include/regs.h @@ -50,6 +50,9 @@ #define R_PAUSE_WORLD_MAP_YAW YREG(24) #define R_PAUSE_WORLD_MAP_Y_OFFSET YREG(25) #define R_PAUSE_WORLD_MAP_DEPTH YREG(26) +#define R_PAUSE_DBG_QUEST_CURSOR_ON YREG(69) +#define R_PAUSE_DBG_QUEST_CURSOR_X YREG(70) +#define R_PAUSE_DBG_QUEST_CURSOR_Y YREG(71) #define R_MAGIC_FILL_COLOR(i) ZREG(0 + i) #define R_C_BTN_COLOR(i) ZREG(39 + i) #define R_B_BTN_COLOR(i) ZREG(43 + i) diff --git a/include/variables.h b/include/variables.h index e223fe65e..1719d4c6f 100644 --- a/include/variables.h +++ b/include/variables.h @@ -924,7 +924,7 @@ extern u8 gUpgradeShifts[8]; extern u16 gUpgradeCapacities[][4]; extern u32 gGsFlagsMask[]; extern u32 gGsFlagsShift[]; -extern void* gItemIcons[]; +extern TexturePtr gItemIcons[]; extern u8 gItemSlots[]; extern s16 gItemPrices[]; extern u16 gSceneIdsPerRegion[11][27]; @@ -973,7 +973,7 @@ extern struct_801C5F44 D_801C5F44[]; // D_801C5F44 extern u8 D_801CFC98; extern s16 D_801CFCA4[9]; // extern UNK_TYPE2 D_801CFCAC; -// extern UNK_TYPE1 D_801CFCB8; +extern s16 gOcarinaSongItemMap[]; // extern UNK_TYPE2 D_801CFCD8; // extern UNK_TYPE2 D_801CFCE4; // extern UNK_TYPE2 D_801CFCF0; diff --git a/include/z64.h b/include/z64.h index dc01a5dc7..da1f88323 100644 --- a/include/z64.h +++ b/include/z64.h @@ -407,7 +407,7 @@ typedef struct { /* 0x1E8 */ OSMesg loadMsg; /* 0x1EC */ u16 state; /* 0x1EE */ u16 debugEditor; - /* 0x1F0 */ u8 unk_1F0; + /* 0x1F0 */ u8 bombersNotebookOpen; /* 0x1F4 */ Vec3f eye; /* 0x200 */ u16 unk_200; /* 0x202 */ u16 mode; @@ -452,7 +452,7 @@ typedef struct { /* 0x298 */ f32 unk_298; /* 0x29C */ s16 promptChoice; // save/continue choice: 0 = yes; 4 = no /* 0x29E */ s16 promptAlpha; - /* 0x2A0 */ s16 unk_2A0; + /* 0x2A0 */ s16 ocarinaSongIndex; /* 0x2A2 */ u8 worldMapPoints[20]; /* 0x2B6 */ u8 unk_2B6; /* 0x2B7 */ u8 unk_2B7; @@ -460,9 +460,9 @@ typedef struct { /* 0x2B9 */ u8 itemDescriptionOn; // helpful description of item given through a message box /* 0x2BA */ s16 equipAnimScale; // scale of item icon while moving being equipped to c-button /* 0x2BC */ s16 equipAnimShrinkRate; // rate the scale is shrinking for the item icon while moving being equipped to c-button - /* 0x2BE */ s16 unk_2BE[5]; + /* 0x2BE */ s16 ocarinaButtonsY[5]; /* 0x2C8 */ u16 unk_2C8; // Uses PauseMenuPage enum for Owl Warp. Never set. - /* 0x2CA */ s16 unk_2CA; // Uses OwlStatueId enum for Owl Warp. Never set. + /* 0x2CA */ s16 unk_2CA; // Uses OwlWarpId enum for Owl Warp. Never set. } PauseContext; // size = 0x2D0 typedef struct { diff --git a/include/z64item.h b/include/z64item.h index 7c6b719ca..2f17c67c7 100644 --- a/include/z64item.h +++ b/include/z64item.h @@ -40,7 +40,7 @@ typedef enum { } UpgradeType; typedef enum { - /* 0x00 */ QUEST_REMAINS_ODOWLA, + /* 0x00 */ QUEST_REMAINS_ODOLWA, /* 0x01 */ QUEST_REMAINS_GOHT, /* 0x02 */ QUEST_REMAINS_GYORG, /* 0x03 */ QUEST_REMAINS_TWINMOLD, @@ -59,8 +59,12 @@ typedef enum { /* 0x10 */ QUEST_SONG_STORMS, /* 0x11 */ QUEST_SONG_SUN, /* 0x12 */ QUEST_BOMBERS_NOTEBOOK, // Obtained Bombers Notebook - /* 0x13 */ QUEST_SKULL_TOKEN, - /* 0x18 */ QUEST_SONG_LULLABY_INTRO = 0x18, + /* 0x13 */ QUEST_QUIVER, + /* 0x14 */ QUEST_BOMB_BAG, + /* 0x15 */ QUEST_SKULL_TOKEN, + /* 0x16 */ QUEST_HEART_PIECE, // for `pauseCtx->cursorPoint[PAUSE_QUEST]` + /* 0x17 */ QUEST_17, // Used in a conditional for quest cursors + /* 0x18 */ QUEST_SONG_LULLABY_INTRO, /* 0x19 */ QUEST_PICTOGRAPH, // A photo from the pictograph box is saved /* 0x1C */ QUEST_HEART_PIECE_COUNT = 0x1C } QuestItem; diff --git a/src/code/audio/code_8019AF00.c b/src/code/audio/code_8019AF00.c index 6d1468d82..9df12e7fe 100644 --- a/src/code/audio/code_8019AF00.c +++ b/src/code/audio/code_8019AF00.c @@ -2733,7 +2733,7 @@ void AudioOcarina_SetOcarinaDisableTimer(u8 unused, u8 timer) { sOcarinaUnused = unused; } -u32 AudioOcarina_SetInstrument(u8 ocarinaInstrumentId) { +void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId) { if ((sOcarinaInstrumentId != ocarinaInstrumentId) || (ocarinaInstrumentId == OCARINA_INSTRUMENT_DEFAULT)) { Audio_QueueSeqCmd(0x80000000 | ((u32)(SEQ_PLAYER_SFX) << 24) | ((u32)(1) << 16) | ((u32)(SFX_CHANNEL_OCARINA) << 8) | (u32)(ocarinaInstrumentId)); diff --git a/src/code/code_8012EC80.c b/src/code/code_8012EC80.c index eb70cfbc8..fb6f0743d 100644 --- a/src/code/code_8012EC80.c +++ b/src/code/code_8012EC80.c @@ -661,17 +661,17 @@ void Inventory_SetWorldMapCloudVisibility(s16 tingleIndex) { i++; } - if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[0]) { + if (*tingleMapSceneIds == sSceneIdsPerTingleMap[TINGLE_MAP_CLOCK_TOWN]) { gSaveContext.save.worldMapCloudVisibility |= 3; - } else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[1]) { + } else if (*tingleMapSceneIds == sSceneIdsPerTingleMap[TINGLE_MAP_WOODFALL]) { gSaveContext.save.worldMapCloudVisibility |= 0x1C; - } else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[2]) { + } else if (*tingleMapSceneIds == sSceneIdsPerTingleMap[TINGLE_MAP_SNOWHEAD]) { gSaveContext.save.worldMapCloudVisibility |= 0xE0; - } else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[3]) { + } else if (*tingleMapSceneIds == sSceneIdsPerTingleMap[TINGLE_MAP_ROMANI_RANCH]) { gSaveContext.save.worldMapCloudVisibility |= 0x100; - } else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[4]) { + } else if (*tingleMapSceneIds == sSceneIdsPerTingleMap[TINGLE_MAP_GREAT_BAY]) { gSaveContext.save.worldMapCloudVisibility |= 0x1E00; - } else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[5]) { + } else if (*tingleMapSceneIds == sSceneIdsPerTingleMap[TINGLE_MAP_STONE_TOWER]) { gSaveContext.save.worldMapCloudVisibility |= 0x6000; } } diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 1fa041be1..25b2b471a 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -990,7 +990,7 @@ void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdText D_801BB160 = CS_TEXTBOX_TYPE_1; D_801BB124 = cmd->base; if (cmd->type == CS_TEXTBOX_TYPE_BOSSES_REMAINS) { - if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) && + if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) && CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) { if (cmd->textId1 != 0xFFFF) { Message_StartTextbox(play, cmd->textId1, NULL); diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index 2f2e3c388..a096aaabe 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -137,8 +137,8 @@ void KaleidoSetup_Init(PlayState* play) { pauseCtx->cursorSlot[PAUSE_ITEM] = 0; pauseCtx->cursorSlot[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1); - pauseCtx->cursorColorSet = 2; - pauseCtx->unk_2A0 = -1; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW; + pauseCtx->ocarinaSongIndex = -1; pauseCtx->equipAnimScale = 320; pauseCtx->equipAnimShrinkRate = 40; pauseCtx->promptAlpha = 100; diff --git a/src/code/z_message.c b/src/code/z_message.c index de3a81c73..5b3598617 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -329,7 +329,7 @@ void func_80151938(PlayState* play, u16 textId) { } msgCtx->unk1203C = msgCtx->unk1203A; - if (play->pauseCtx.unk_1F0 != 0) { + if (play->pauseCtx.bombersNotebookOpen) { msgCtx->unk12004 = 0x22; msgCtx->unk12006 = 0x15E; func_80149C18(play); diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 4620dd816..d463edff3 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1172,7 +1172,9 @@ u8 Item_Give(PlayState* play, u8 item) { } if (item == ITEM_SKULL_TOKEN) { - SET_QUEST_ITEM(item - ITEM_SKULL_TOKEN + QUEST_SKULL_TOKEN); + //! @bug: Sets QUEST_QUIVER instead of QUEST_SKULL_TOKEN + // Setting `QUEST_SKULL_TOKEN` will result in misplaced digits on the pause menu - Quest Status page. + SET_QUEST_ITEM(item - ITEM_SKULL_TOKEN + QUEST_QUIVER); Inventory_IncrementSkullTokenCount(play->sceneId); return ITEM_NONE; @@ -1446,7 +1448,7 @@ u8 Item_Give(PlayState* play, u8 item) { return ITEM_NONE; } else if ((item >= ITEM_REMAINS_ODOLWA) && (item <= ITEM_REMAINS_TWINMOLD)) { - SET_QUEST_ITEM(item - ITEM_REMAINS_ODOLWA + QUEST_REMAINS_ODOWLA); + SET_QUEST_ITEM(item - ITEM_REMAINS_ODOLWA + QUEST_REMAINS_ODOLWA); return ITEM_NONE; } else if (item == ITEM_RECOVERY_HEART) { diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 03531bb31..2d384ccf6 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -75,7 +75,7 @@ void DoorWarp1_SetupAction(DoorWarp1* this, DoorWarp1ActionFunc actionFunc) { s32 func_808B849C(DoorWarp1* this, PlayState* play) { s32 ret = 0; - if ((play->sceneId == SCENE_MITURIN_BS) && !CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA)) { + if ((play->sceneId == SCENE_MITURIN_BS) && !CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA)) { ret = 1; } else if ((play->sceneId == SCENE_HAKUGIN_BS) && !CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT)) { ret = 2; @@ -239,7 +239,7 @@ void func_808B8C48(DoorWarp1* this, PlayState* play) { this->dyna.actor.world.pos.z, 200, 255, 255, 255); Lights_PointNoGlowSetInfo(&this->unk_1F4, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 200, 255, 255, 255); - if (((DOORWARP1_GET_FF(&this->dyna.actor) == ENDOORWARP1_FF_2) && CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA)) || + if (((DOORWARP1_GET_FF(&this->dyna.actor) == ENDOORWARP1_FF_2) && CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA)) || ((DOORWARP1_GET_FF(&this->dyna.actor) == ENDOORWARP1_FF_3) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT)) || ((DOORWARP1_GET_FF(&this->dyna.actor) == ENDOORWARP1_FF_4) && CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG)) || ((DOORWARP1_GET_FF(&this->dyna.actor) == ENDOORWARP1_FF_5) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD))) { diff --git a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c index e8c874df4..c21da42b0 100644 --- a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c +++ b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c @@ -41,7 +41,7 @@ static InitChainEntry sInitChain[] = { }; s32 func_80BA15A0(void) { - if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && !(gSaveContext.save.weekEventReg[87] & 0x10)) { + if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA) && !(gSaveContext.save.weekEventReg[87] & 0x10)) { return true; } @@ -61,7 +61,7 @@ s32 func_80BA15A0(void) { } void func_80BA165C(void) { - if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA)) { + if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA)) { gSaveContext.save.weekEventReg[87] |= 0x10; } @@ -88,7 +88,7 @@ s32 func_80BA16F4(ElfMsg6* this, PlayState* play) { return true; } - if (!CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA)) { + if (!CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA)) { this->actor.textId = 0x256; return false; } diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c index d7d3e446e..508090fd5 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -324,7 +324,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, PlayState* play) { break; case 2: - if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) && + if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) && CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) { if (gSaveContext.save.weekEventReg[93] & 4) { if (ActorCutscene_GetCanPlayNext(0xC)) { diff --git a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c index cc19acb63..9b4836637 100644 --- a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c +++ b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c @@ -115,9 +115,12 @@ void EnGakufu_ProcessNotes(EnGakufu* this) { songIndex = this->songIndex; ocarinaSongButtons = &gOcarinaSongButtons[songIndex]; + + //! FAKE: + if (1) {} songNumButtons = gOcarinaSongButtons[this->songIndex].numButtons; - for (i = 0; i < songNumButtons; i++) { + for (i = 0; i < (u8)songNumButtons; i++) { this->buttonIndex[i] = ocarinaSongButtons->buttonIndex[i]; } diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.c b/src/overlays/actors/ovl_En_Giant/z_en_giant.c index 7d2819ff9..10951f76d 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.c +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.c @@ -110,7 +110,7 @@ s32 EnGiant_IsImprisoned(EnGiant* this) { case GIANT_TYPE_SWAMP_CLOCK_TOWER_SUCCESS: case GIANT_TYPE_SWAMP_GIANTS_CHAMBER_AND_ENDING: case GIANT_TYPE_SWAMP_CLOCK_TOWER_FAILURE: - if (!CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA)) { + if (!CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA)) { return true; } break; diff --git a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c index 04e44bb16..a8e74ff6e 100644 --- a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c +++ b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c @@ -91,7 +91,7 @@ void func_80AC9FE4(EnTimeTag* this, PlayState* play) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); this->actionFunc = func_80AC9FD4; gSaveContext.timerStates[TIMER_ID_MOON_CRASH] = TIMER_STATE_OFF; - if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) && + if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) && CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) { gSaveContext.save.weekEventReg[25] |= 2; } diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c index 316ad3355..90a1a0eff 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c @@ -1,103 +1,1003 @@ /* * File: z_kaleido_collect.c * Overlay: ovl_kaleido_scope - * Description: + * Description: Pause Menu - Quest Status Page */ #include "z_kaleido_scope.h" +#include "interface/parameter_static/parameter_static.h" -extern UNK_TYPE D_02001360; -extern UNK_TYPE D_020044A0; -extern UNK_TYPE D_02004AA0; -extern UNK_TYPE D_0200B998; -extern UNK_TYPE D_08062000; -extern UNK_TYPE D_08064340; -extern UNK_TYPE D_0B000000; -extern UNK_TYPE D_0C000000; -extern UNK_TYPE D_0C006C00; +s32 KaleidoScope_UpdateQuestStatusPoint(PauseContext* pauseCtx, s16 point); -s16 D_8082AED0[] = { 120, 60, 2, 80 }; +extern TexturePtr D_08061000; // gBombersNotebookIconTex +extern TexturePtr D_08062000; // gSongNoteIconTex -s16 D_8082AED8[] = { 20, 4, 20, 10 }; - -s32 D_8082AEE0 = 0; - -s32 D_8082AEE4[] = { 0, 0, 0 }; - -s32 D_8082AEF0[] = { 0, 0, 0, 0, 0 }; - -s16 D_8082AF04[] = { - 255, 0, 0, 255, 255, 70, 0, 150, 255, 70, 0, 150, 255, 0, 0, 255, +s16 sQuestRemainsColorTimerInit[] = { 120, 60, 2, 80 }; +s16 sQuestHpColorTimerInit[] = { 20, 4, 20, 10 }; +s16 sQuestSongPlayedOcarinaButtonsNum = 0; +u8 sQuestSongPlayedOcarinaButtons[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +s16 sQuestSongPlayedOcarinaButtonsAlpha[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +s16 sQuestHpPrimColorTargets[][4] = { + { 255, 0, 0, 255 }, + { 255, 70, 0, 150 }, + { 255, 70, 0, 150 }, + { 255, 0, 0, 255 }, +}; +s16 sQuestRemainsEnvTargets[][3] = { + { 0, 0, 0 }, // QUEST_REMAINS_ODOLWA Target 1 + { 0, 0, 0 }, // QUEST_REMAINS_GOHT Target 1 + { 0, 0, 0 }, // QUEST_REMAINS_GYORG Target 1 + { 0, 0, 0 }, // QUEST_REMAINS_TWINMOLD Target 1 + { 0, 0, 0 }, // Unused + { 0, 0, 0 }, // Unused + { 0, 60, 0 }, // QUEST_REMAINS_ODOLWA Target 2 + { 90, 0, 0 }, // QUEST_REMAINS_GOHT Target 2 + { 0, 40, 110 }, // QUEST_REMAINS_GYORG Target 2 + { 80, 40, 0 }, // QUEST_REMAINS_TWINMOLD Target 2 + { 70, 0, 90 }, // Unused + { 90, 90, 0 }, // Unused +}; +s16 sQuestRemainsEnvRed[] = { + 255, // QUEST_REMAINS_ODOLWA + 255, // QUEST_REMAINS_GOHT + 255, // QUEST_REMAINS_GYORG + 255, // QUEST_REMAINS_TWINMOLD + 255, // Unused + 255, // Unused +}; +s16 sQuestRemainsEnvGreen[] = { + 255, // QUEST_REMAINS_ODOLWA + 255, // QUEST_REMAINS_GOHT + 255, // QUEST_REMAINS_GYORG + 255, // QUEST_REMAINS_TWINMOLD + 255, // Unused + 255, // Unused +}; +s16 sQuestRemainsEnvBlue[] = { + 150, // QUEST_REMAINS_ODOLWA + 150, // QUEST_REMAINS_GOHT + 150, // QUEST_REMAINS_GYORG + 150, // QUEST_REMAINS_TWINMOLD + 150, // Unused + 150, // Unused }; -s16 D_8082AF24[] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x003C, 0x0000, 0x005A, 0x0000, 0x0000, - 0x0000, 0x0028, 0x006E, 0x0050, 0x0028, 0x0000, 0x0046, 0x0000, 0x005A, 0x005A, 0x005A, 0x0000, +#ifdef NON_EQUIVALENT +// TODO: is actually NON_MATCHING, update once `z_kaleido_scope_NES.c` is decompiled +// A single small regalloc at the first `func_8010DC58` for the heart piece count (see `gItemIcons`) +void KaleidoScope_DrawQuestStatus(PlayState* play) { + static s16 sQuestRemainsColorTimer = 20; + static s16 sQuestRemainsColorTimerIndex = 0; + static s16 sQuestHpPrimRed = 0; + static s16 sQuestHpPrimGreen = 0; + static s16 sQuestHpPrimBlue = 0; + static s16 sQuestHpPrimAlpha = 0; + static s16 sQuestHpColorTimer = 20; + static s16 sQuestHpPrimColorTargetIndex = 0; + static TexturePtr sOcarinaButtonTextures[] = { + gOcarinaATex, gOcarinaCDownTex, gOcarinaCRightTex, gOcarinaCLeftTex, gOcarinaCUpTex, + }; + static s16 sQuestSongsPrimRed[] = { + 150, // QUEST_SONG_SONATA + 255, // QUEST_SONG_LULLABY + 100, // QUEST_SONG_BOSSA_NOVA + 255, // QUEST_SONG_ELEGY + 255, // QUEST_SONG_OATH + 255, // QUEST_SONG_SARIA + 255, // QUEST_SONG_TIME + 255, // QUEST_SONG_HEALING + 255, // QUEST_SONG_EPONA + 255, // QUEST_SONG_SOARING + 255, // QUEST_SONG_STORMS + 255, // QUEST_SONG_SUN + }; + static s16 sQuestSongsPrimGreen[] = { + 255, // QUEST_SONG_SONATA + 80, // QUEST_SONG_LULLABY + 150, // QUEST_SONG_BOSSA_NOVA + 160, // QUEST_SONG_ELEGY + 100, // QUEST_SONG_OATH + 240, // QUEST_SONG_SARIA + 255, // QUEST_SONG_TIME + 255, // QUEST_SONG_HEALING + 255, // QUEST_SONG_EPONA + 255, // QUEST_SONG_SOARING + 255, // QUEST_SONG_STORMS + 255, // QUEST_SONG_SUN + }; + static s16 sQuestSongsPrimBlue[] = { + 100, // QUEST_SONG_SONATA + 40, // QUEST_SONG_LULLABY + 255, // QUEST_SONG_BOSSA_NOVA + 0, // QUEST_SONG_ELEGY + 255, // QUEST_SONG_OATH + 100, // QUEST_SONG_SARIA + 255, // QUEST_SONG_TIME + 255, // QUEST_SONG_HEALING + 255, // QUEST_SONG_EPONA + 255, // QUEST_SONG_SOARING + 255, // QUEST_SONG_STORMS + 255, // QUEST_SONG_SUN + }; + static TexturePtr sQuestUpgradeTextures[][3] = { + { 0x08053000, 0x08054000, 0x08055000 }, // UPG_QUIVER + { 0x08056000, 0x08057000, 0x08058000 }, // UPG_BOMB_BAG + }; + static u8 sQuestUpgrades[] = { UPG_QUIVER, UPG_BOMB_BAG }; + PauseContext* pauseCtx = &play->pauseCtx; + s16 sp1CA; // colorSetR and numOcarinaButtons + s16 sp1C8; // colorSetG and ocarinaButtonIndex + s16 sp1C6; + s16 sp1C4; + s16 var_v1; + s16 i; + s16 j; + s16 k; + s16 skullTokenDigits[3]; + u16 isDigitDrawn; + + OPEN_DISPS(play->state.gfxCtx); + + KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_QUEST] * 4, pauseCtx->questVtx); + + gDPPipeSync(POLY_OPA_DISP++); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, + ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + + // Draw the Boss Remains icons + sQuestRemainsColorTimer--; + for (i = 0, j = 0; i < 4; i++, j += 4) { + if ((sQuestRemainsColorTimerIndex != 1) && (sQuestRemainsColorTimerIndex != 3)) { + var_v1 = (sQuestRemainsColorTimerIndex != 0) ? (i + 6) : i; + + if (sQuestRemainsColorTimer != 0) { + sp1CA = ABS_ALT(sQuestRemainsEnvRed[i] - sQuestRemainsEnvTargets[var_v1][0]) / sQuestRemainsColorTimer; + sp1C8 = + ABS_ALT(sQuestRemainsEnvGreen[i] - sQuestRemainsEnvTargets[var_v1][1]) / sQuestRemainsColorTimer; + sp1C6 = ABS_ALT(sQuestRemainsEnvBlue[i] - sQuestRemainsEnvTargets[var_v1][2]) / sQuestRemainsColorTimer; + + if (sQuestRemainsEnvRed[i] >= sQuestRemainsEnvTargets[var_v1][0]) { + sQuestRemainsEnvRed[i] -= sp1CA; + } else { + sQuestRemainsEnvRed[i] += sp1CA; + } + if (sQuestRemainsEnvGreen[i] >= sQuestRemainsEnvTargets[var_v1][1]) { + sQuestRemainsEnvGreen[i] -= sp1C8; + } else { + sQuestRemainsEnvGreen[i] += sp1C8; + } + if (sQuestRemainsEnvBlue[i] >= sQuestRemainsEnvTargets[var_v1][2]) { + sQuestRemainsEnvBlue[i] -= sp1C6; + } else { + sQuestRemainsEnvBlue[i] += sp1C6; + } + } else { + sQuestRemainsEnvRed[i] = sQuestRemainsEnvTargets[var_v1][0]; + sQuestRemainsEnvGreen[i] = sQuestRemainsEnvTargets[var_v1][1]; + sQuestRemainsEnvBlue[i] = sQuestRemainsEnvTargets[var_v1][2]; + } + } + + if (CHECK_QUEST_ITEM(i)) { + gDPPipeSync(POLY_OPA_DISP++); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + gDPSetEnvColor(POLY_OPA_DISP++, sQuestRemainsEnvRed[i], sQuestRemainsEnvGreen[i], sQuestRemainsEnvBlue[i], + 0); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + KaleidoScope_DrawTexQuadRGBA32(play->state.gfxCtx, gItemIcons[ITEM_REMAINS_ODOLWA + i], 32, 32, 0); + } + } + + if (sQuestRemainsColorTimer == 0) { + sQuestRemainsColorTimer = sQuestRemainsColorTimerInit[sQuestRemainsColorTimerIndex]; + if (++sQuestRemainsColorTimerIndex > 3) { + sQuestRemainsColorTimerIndex = 0; + } + } + + // Draw shield + gDPPipeSync(POLY_OPA_DISP++); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + + if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD) != EQUIP_VALUE_SHIELD_NONE) { + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + KaleidoScope_DrawTexQuadRGBA32(play->state.gfxCtx, gItemIcons[(ITEM_SHIELD_HERO - 1) + GET_CUR_EQUIP_VALUE(1)], + 32, 32, 0); + } + + j += 4; + + // Draw Sword + if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) != EQUIP_VALUE_SWORD_NONE) { + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + KaleidoScope_DrawTexQuadRGBA32(play->state.gfxCtx, gItemIcons[(ITEM_SWORD_KOKIRI - 1) + GET_CUR_EQUIP_VALUE(0)], + 32, 32, 0); + } + + j += 4; + + // Draw Songs + gDPPipeSync(POLY_OPA_DISP++); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + + gDPLoadTextureBlock(POLY_OPA_DISP++, &D_08062000, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + for (i = 0; i < 12; i++, j += 4) { + if (CHECK_QUEST_ITEM(i + QUEST_SONG_SONATA) || + ((i == (QUEST_SONG_LULLABY - QUEST_SONG_SONATA)) && !CHECK_QUEST_ITEM(i + QUEST_SONG_SONATA) && + CHECK_QUEST_ITEM(QUEST_SONG_LULLABY_INTRO))) { + if ((i + QUEST_SONG_SONATA) == pauseCtx->cursorSlot[PAUSE_QUEST]) { + pauseCtx->questVtx[j + 0].v.ob[0] = pauseCtx->questVtx[j + 2].v.ob[0] = + pauseCtx->questVtx[j + 0].v.ob[0] - 2; + + pauseCtx->questVtx[j + 1].v.ob[0] = pauseCtx->questVtx[j + 3].v.ob[0] = + pauseCtx->questVtx[j + 1].v.ob[0] + 4; + + pauseCtx->questVtx[j + 0].v.ob[1] = pauseCtx->questVtx[j + 1].v.ob[1] = + pauseCtx->questVtx[j + 0].v.ob[1] + 2; + + pauseCtx->questVtx[j + 2].v.ob[1] = pauseCtx->questVtx[j + 3].v.ob[1] = + pauseCtx->questVtx[j + 2].v.ob[1] - 4; + } + + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sQuestSongsPrimRed[i], sQuestSongsPrimGreen[i], + sQuestSongsPrimBlue[i], pauseCtx->alpha); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); + } + } + + // Draw Bombers Notebook + gDPPipeSync(POLY_OPA_DISP++); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + + if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + KaleidoScope_DrawTexQuadRGBA32(play->state.gfxCtx, &D_08061000, 32, 32, 0); + } + + j += 4; + + gDPPipeSync(POLY_OPA_DISP++); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + + // Loop over quest item upgrades + for (i = 0; i < 2; i++, j += 4) { + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + + if (GET_CUR_UPG_VALUE(sQuestUpgrades[i]) != 0) { + KaleidoScope_DrawTexQuadRGBA32( + play->state.gfxCtx, sQuestUpgradeTextures[i][GET_CUR_UPG_VALUE(sQuestUpgrades[i]) - 1], 32, 32, 0); + } + } + + // Skip over &pauseCtx->questVtx[84], which should be `QUEST_SKULL_TOKEN` + j += 4; + + sp1CA = ABS_ALT(sQuestHpPrimRed - sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][0]) / sQuestHpColorTimer; + sp1C8 = ABS_ALT(sQuestHpPrimGreen - sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][1]) / sQuestHpColorTimer; + sp1C6 = ABS_ALT(sQuestHpPrimBlue - sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][2]) / sQuestHpColorTimer; + sp1C4 = ABS_ALT(sQuestHpPrimAlpha - sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][3]) / sQuestHpColorTimer; + + if (sQuestHpPrimRed >= sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][0]) { + sQuestHpPrimRed -= sp1CA; + } else { + sQuestHpPrimRed += sp1CA; + } + + if (sQuestHpPrimGreen >= sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][1]) { + sQuestHpPrimGreen -= sp1C8; + } else { + sQuestHpPrimGreen += sp1C8; + } + + if (sQuestHpPrimBlue >= sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][2]) { + sQuestHpPrimBlue -= sp1C6; + } else { + sQuestHpPrimBlue += sp1C6; + } + + if (sQuestHpPrimAlpha >= sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][3]) { + sQuestHpPrimAlpha -= sp1C4; + } else { + sQuestHpPrimAlpha += sp1C4; + } + + sQuestHpColorTimer--; + if (sQuestHpColorTimer == 0) { + sQuestHpPrimRed = sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][0]; + sQuestHpPrimGreen = sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][1]; + sQuestHpPrimBlue = sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][2]; + sQuestHpPrimAlpha = sQuestHpPrimColorTargets[sQuestHpPrimColorTargetIndex][3]; + sQuestHpColorTimer = sQuestHpColorTimerInit[sQuestHpPrimColorTargetIndex]; + if (++sQuestHpPrimColorTargetIndex > 3) { + sQuestHpPrimColorTargetIndex = 0; + } + } + + if ((GET_SAVE_INVENTORY_QUEST_ITEMS >> QUEST_HEART_PIECE_COUNT) != 0) { + gDPPipeSync(POLY_OPA_DISP++); + gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + + if ((pauseCtx->state == 4) || (pauseCtx->state == 0x1A)) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sQuestHpPrimColorTargets[0][0], sQuestHpPrimColorTargets[0][1], + sQuestHpPrimColorTargets[0][2], pauseCtx->alpha); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sQuestHpPrimRed, sQuestHpPrimGreen, sQuestHpPrimBlue, + sQuestHpPrimAlpha); + } + + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + + POLY_OPA_DISP = func_8010DC58( + POLY_OPA_DISP, + gItemIcons[(0x7A + ((GET_SAVE_INVENTORY_QUEST_ITEMS & 0xF0000000) >> QUEST_HEART_PIECE_COUNT))], 48, 48, 0); + } + + j += 4; + + if (pauseCtx->state == 6) { + gDPPipeSync(POLY_OPA_DISP++); + gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + + if (pauseCtx->unk_200 == 2) { + // Draw ocarina buttons as they are played back + pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); + + if (pauseCtx->ocarinaStaff->pos != 0) { + if (sQuestSongPlayedOcarinaButtonsNum == (pauseCtx->ocarinaStaff->pos - 1)) { + sQuestSongPlayedOcarinaButtonsNum++; + sQuestSongPlayedOcarinaButtons[pauseCtx->ocarinaStaff->pos - 1] = + pauseCtx->ocarinaStaff->buttonIndex; + } + + for (i = 0, k = 0; i < 8; i++, k += 4, j += 4) { + if (sQuestSongPlayedOcarinaButtons[i] == OCARINA_BTN_INVALID) { + break; + } + + if (sQuestSongPlayedOcarinaButtonsAlpha[i] != 255) { + sQuestSongPlayedOcarinaButtonsAlpha[i] += 50; + if (sQuestSongPlayedOcarinaButtonsAlpha[i] >= 255) { + sQuestSongPlayedOcarinaButtonsAlpha[i] = 255; + } + } + + pauseCtx->questVtx[j + 0].v.ob[1] = pauseCtx->questVtx[j + 1].v.ob[1] = + pauseCtx->ocarinaButtonsY[sQuestSongPlayedOcarinaButtons[i]]; + + pauseCtx->questVtx[j + 2].v.ob[1] = pauseCtx->questVtx[j + 3].v.ob[1] = + pauseCtx->questVtx[j + 0].v.ob[1] - 12; + + gDPPipeSync(POLY_OPA_DISP++); + + if (sQuestSongPlayedOcarinaButtons[i] == OCARINA_BTN_A) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 80, 150, 255, sQuestSongPlayedOcarinaButtonsAlpha[i]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 50, sQuestSongPlayedOcarinaButtonsAlpha[i]); + } + + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + + POLY_OPA_DISP = func_8010DC58(POLY_OPA_DISP, + sOcarinaButtonTextures[sQuestSongPlayedOcarinaButtons[i]], 16, 16, 0); + } + } + } else if (((pauseCtx->unk_200 >= 4) && (pauseCtx->unk_200 <= 6)) || (pauseCtx->unk_200 == 8)) { + // Draw the buttons for playing a song + sp1C8 = pauseCtx->ocarinaSongIndex; + sp1CA = gOcarinaSongButtons[sp1C8].numButtons; + + i = j; + + for (k = 0; k < sp1CA; k++, j += 4) { + pauseCtx->questVtx[j + 0].v.ob[1] = pauseCtx->questVtx[j + 1].v.ob[1] = + pauseCtx->ocarinaButtonsY[gOcarinaSongButtons[sp1C8].buttonIndex[k]]; + + pauseCtx->questVtx[j + 2].v.ob[1] = pauseCtx->questVtx[j + 3].v.ob[1] = + pauseCtx->questVtx[j + 0].v.ob[1] - 12; + + gDPPipeSync(POLY_OPA_DISP++); + + if (pauseCtx->unk_200 == 8) { + // Draw ocarina buttons colored + if (gOcarinaSongButtons[sp1C8].buttonIndex[k] == OCARINA_BTN_A) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 80, 150, 255, 200); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 50, 200); + } + } else { + // Gray out buttons while reading ocarina song inputs + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 150, 150, 150, 150); + } + + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + + POLY_OPA_DISP = func_8010DC58( + POLY_OPA_DISP, sOcarinaButtonTextures[gOcarinaSongButtons[sp1C8].buttonIndex[k]], 16, 16, 0); + } + + if (pauseCtx->unk_200 != 8) { + pauseCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); + + // Update ocarina song inputs + if (pauseCtx->ocarinaStaff->pos != 0) { + if (sQuestSongPlayedOcarinaButtonsNum == (pauseCtx->ocarinaStaff->pos - 1)) { + if (pauseCtx->ocarinaStaff->buttonIndex <= OCARINA_BTN_C_UP) { + sQuestSongPlayedOcarinaButtons[pauseCtx->ocarinaStaff->pos - 1] = + pauseCtx->ocarinaStaff->buttonIndex; + sQuestSongPlayedOcarinaButtons[pauseCtx->ocarinaStaff->pos] = OCARINA_BTN_INVALID; + sQuestSongPlayedOcarinaButtonsNum++; + } + } + } + + // Draw the buttons colored as the ocarina song inputs are read from + j = i + 32; + k = 0; + for (; k < 8; k++, j += 4) { + if (sQuestSongPlayedOcarinaButtons[k] == OCARINA_BTN_INVALID) { + continue; + } + + if (sQuestSongPlayedOcarinaButtonsAlpha[k] != 255) { + sQuestSongPlayedOcarinaButtonsAlpha[k] += 50; + if (sQuestSongPlayedOcarinaButtonsAlpha[k] >= 255) { + sQuestSongPlayedOcarinaButtonsAlpha[k] = 255; + } + } + + pauseCtx->questVtx[j + 0].v.ob[1] = pauseCtx->questVtx[j + 1].v.ob[1] = + pauseCtx->ocarinaButtonsY[sQuestSongPlayedOcarinaButtons[k]]; + + pauseCtx->questVtx[j + 2].v.ob[1] = pauseCtx->questVtx[j + 3].v.ob[1] = + pauseCtx->questVtx[j + 0].v.ob[1] - 12; + + gDPPipeSync(POLY_OPA_DISP++); + + if (sQuestSongPlayedOcarinaButtons[k] == OCARINA_BTN_A) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 80, 150, 255, sQuestSongPlayedOcarinaButtonsAlpha[k]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 50, sQuestSongPlayedOcarinaButtonsAlpha[k]); + } + + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[j], 4, 0); + + POLY_OPA_DISP = func_8010DC58(POLY_OPA_DISP, + sOcarinaButtonTextures[sQuestSongPlayedOcarinaButtons[k]], 16, 16, 0); + } + + if (pauseCtx->unk_200 == 4) { + for (k = 0; k < 8; k++) { + sQuestSongPlayedOcarinaButtons[k] = OCARINA_BTN_INVALID; + sQuestSongPlayedOcarinaButtonsAlpha[k] = 0; + } + + sQuestSongPlayedOcarinaButtonsNum = 0; + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); + AudioOcarina_StartDefault((1 << pauseCtx->ocarinaSongIndex) | 0x80000000); + pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); + pauseCtx->ocarinaStaff->pos = 0; + pauseCtx->ocarinaStaff->state = 0xFE; + pauseCtx->unk_200 = 5; + } + } + } + } + + // Draw Skull Token Count + // QUEST_SKULL_TOKEN never properly set, see Item_Give(), + // Vertices not well placed, digits are not aligned and placed in unintended positions + if (CHECK_QUEST_ITEM(QUEST_SKULL_TOKEN) && ((play->sceneId == SCENE_KINSTA1) || (play->sceneId == SCENE_KINDAN2))) { + gDPPipeSync(POLY_OPA_DISP++); + gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); + + skullTokenDigits[0] = skullTokenDigits[1] = 0; + skullTokenDigits[2] = Inventory_GetSkullTokenCount(play->sceneId); + + while (skullTokenDigits[2] >= 100) { + skullTokenDigits[0]++; + skullTokenDigits[2] -= 100; + } + + while (skullTokenDigits[2] >= 10) { + skullTokenDigits[1]++; + skullTokenDigits[2] -= 10; + } + + //! @bug: &pauseCtx->questVtx[84] is the questVtx for skull tokens + gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[152], 24, 0); + + // Loop over two sets of digits, the first is shadowed, the second is colored + for (k = 0, i = 0; k < 2; k++) { + if (k == 0) { + // shadow + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, pauseCtx->alpha); + } else { + if (Inventory_GetSkullTokenCount(play->sceneId) == 100) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 200, 50, 50, pauseCtx->alpha); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); + } + } + + isDigitDrawn = false; + for (j = 0; j < 3; j++, i += 4) { + if ((j >= 2) || (skullTokenDigits[j] != 0) || isDigitDrawn) { + gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gCounterDigit0Tex + (8 * 16 * skullTokenDigits[j])), + G_IM_FMT_I, G_IM_SIZ_8b, 8, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + gSP1Quadrangle(POLY_OPA_DISP++, i, i + 2, i + 3, i + 1, 0); + + isDigitDrawn = true; + } + } + } + } + + CLOSE_DISPS(play->state.gfxCtx); +} +#else +s16 sQuestRemainsColorTimer = 20; +s16 sQuestRemainsColorTimerIndex = 0; +s16 sQuestHpPrimRed = 0; +s16 sQuestHpPrimGreen = 0; +s16 sQuestHpPrimBlue = 0; +s16 sQuestHpPrimAlpha = 0; +s16 sQuestHpColorTimer = 20; +s16 sQuestHpPrimColorTargetIndex = 0; +TexturePtr sOcarinaButtonTextures[] = { + gOcarinaATex, gOcarinaCDownTex, gOcarinaCRightTex, gOcarinaCLeftTex, gOcarinaCUpTex, }; - -s16 D_8082AF6C[] = { - 255, 255, 255, 255, 255, 255, -}; - -s16 D_8082AF78[] = { - 255, 255, 255, 255, 255, 255, -}; - -s16 D_8082AF84[] = { - 150, 150, 150, 150, 150, 150, -}; - -s16 D_8082AF90 = 20; - -s32 D_8082AF94 = 0; - -s32 D_8082AF98 = 0; - -s32 D_8082AF9C = 0; - -s32 D_8082AFA0 = 0; - -s32 D_8082AFA4 = 0; - -s16 D_8082AFA8 = 20; - -s32 D_8082AFAC = 0; - -void* D_8082AFB0[] = { - 0x020024A0, 0x020025A0, 0x020026A0, 0x020027A0, 0x020028A0, -}; - -s16 D_8082AFC4[] = { +s16 sQuestSongsPrimRed[] = { 150, 255, 100, 255, 255, 255, 255, 255, 255, 255, 255, 255, }; - -s16 D_8082AFDC[] = { +s16 sQuestSongsPrimGreen[] = { 255, 80, 150, 160, 100, 240, 255, 255, 255, 255, 255, 255, }; - -s16 D_8082AFF4[] = { 100, 40, 255, 0, 255, 100, 255, 255, 255, 255, 255, 255 }; - -void* D_8082B00C[] = { - 0x08053000, 0x08054000, 0x08055000, 0x08056000, 0x08057000, 0x08058000, +s16 sQuestSongsPrimBlue[] = { + 100, 40, 255, 0, 255, 100, 255, 255, 255, 255, 255, 255, }; - -s16 D_8082B024 = 1; - -s16 D_8082B028 = 0; - -s16 D_8082B02C[] = { - 0xFFFF, 0x0003, 0x0002, 0x0001, 0x0000, 0x0004, 0x0003, 0xFFFE, 0x0000, 0x0005, 0x0016, 0x0003, 0x0000, 0x0004, - 0x0002, 0x0001, 0x0001, 0x0014, 0x0005, 0xFFFE, 0x0002, 0x0013, 0x0010, 0x0004, 0x000C, 0xFFFF, 0xFFFD, 0x0007, - 0x000D, 0xFFFF, 0x0006, 0x0008, 0x000E, 0xFFFF, 0x0007, 0x0009, 0x000F, 0xFFFF, 0x0008, 0x000A, 0x0010, 0xFFFF, - 0x0009, 0x0013, 0x0011, 0xFFFF, 0x000A, 0x0005, 0x0012, 0x0006, 0xFFFD, 0x000D, 0x0012, 0x0007, 0x000C, 0x000E, - 0x0016, 0x0008, 0x000D, 0x000F, 0x0016, 0x0009, 0x000E, 0x0010, 0x0016, 0x000A, 0x000F, 0x0005, 0x0016, 0x000B, - 0x0010, 0x0005, 0xFFFF, 0x000C, 0xFFFD, 0x0016, 0x0005, 0xFFFF, 0x000A, 0x0014, 0x0004, 0xFFFF, 0x0013, 0xFFFE, - 0x0013, 0x000C, 0xFFFD, 0x0016, 0xFFFF, 0x0010, 0x0012, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +TexturePtr sQuestUpgradeTextures[][3] = { + { 0x08053000, 0x08054000, 0x08055000 }, + { 0x08056000, 0x08057000, 0x08058000 }, }; +u8 sQuestUpgrades[] = { UPG_QUIVER, UPG_BOMB_BAG }; +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_DrawQuestStatus.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_808160A0.s") +typedef enum { + /* -3 */ CURSOR_TO_LEFT = -3, // Cursor on the "scroll to left page" position + /* -2 */ CURSOR_TO_RIGHT, // Cursor on the "scroll to right page" position + /* -1 */ CURSOR_NONE // No position in that direction, cursor stays where it is +} CursorPointNext; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80817B5C.s") +typedef struct { + /* 0x0 */ s16 up; + /* 0x2 */ s16 down; + /* 0x4 */ s16 left; + /* 0x6 */ s16 right; +} CursorPointDirection; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80818904.s") +void KaleidoScope_UpdateQuestCursor(PlayState* play) { + static s16 sQuestSongPlaybackDelayTimer = 0; + static CursorPointDirection sCursorPointLinks[] = { + { CURSOR_NONE, QUEST_REMAINS_TWINMOLD, QUEST_REMAINS_GYORG, QUEST_REMAINS_GOHT }, // QUEST_REMAINS_ODOLWA + { QUEST_REMAINS_ODOLWA, QUEST_SHIELD, QUEST_REMAINS_TWINMOLD, CURSOR_TO_RIGHT }, // QUEST_REMAINS_GOHT + { QUEST_REMAINS_ODOLWA, QUEST_SWORD, QUEST_HEART_PIECE, QUEST_REMAINS_TWINMOLD }, // QUEST_REMAINS_GYORG + { QUEST_REMAINS_ODOLWA, QUEST_SHIELD, QUEST_REMAINS_GYORG, QUEST_REMAINS_GOHT }, // QUEST_REMAINS_TWINMOLD + { QUEST_REMAINS_GOHT, QUEST_BOMB_BAG, QUEST_SWORD, CURSOR_TO_RIGHT }, // QUEST_SHIELD + { QUEST_REMAINS_GYORG, QUEST_QUIVER, QUEST_SONG_STORMS, QUEST_SHIELD }, // QUEST_SWORD + { QUEST_SONG_TIME, CURSOR_NONE, CURSOR_TO_LEFT, QUEST_SONG_LULLABY }, // QUEST_SONG_SONATA + { QUEST_SONG_HEALING, CURSOR_NONE, QUEST_SONG_SONATA, QUEST_SONG_BOSSA_NOVA }, // QUEST_SONG_LULLABY + { QUEST_SONG_EPONA, CURSOR_NONE, QUEST_SONG_LULLABY, QUEST_SONG_ELEGY }, // QUEST_SONG_BOSSA_NOVA + { QUEST_SONG_SOARING, CURSOR_NONE, QUEST_SONG_BOSSA_NOVA, QUEST_SONG_OATH }, // QUEST_SONG_ELEGY + { QUEST_SONG_STORMS, CURSOR_NONE, QUEST_SONG_ELEGY, QUEST_QUIVER }, // QUEST_SONG_OATH + { QUEST_SONG_SUN, CURSOR_NONE, QUEST_SONG_OATH, QUEST_SWORD }, // QUEST_SONG_SARIA + { QUEST_BOMBERS_NOTEBOOK, QUEST_SONG_SONATA, CURSOR_TO_LEFT, QUEST_SONG_HEALING }, // QUEST_SONG_TIME + { QUEST_BOMBERS_NOTEBOOK, QUEST_SONG_LULLABY, QUEST_SONG_TIME, QUEST_SONG_EPONA }, // QUEST_SONG_HEALING + { QUEST_HEART_PIECE, QUEST_SONG_BOSSA_NOVA, QUEST_SONG_HEALING, QUEST_SONG_SOARING }, // QUEST_SONG_EPONA + { QUEST_HEART_PIECE, QUEST_SONG_ELEGY, QUEST_SONG_EPONA, QUEST_SONG_STORMS }, // QUEST_SONG_SOARING + { QUEST_HEART_PIECE, QUEST_SONG_OATH, QUEST_SONG_SOARING, QUEST_SWORD }, // QUEST_SONG_STORMS + { QUEST_HEART_PIECE, QUEST_SONG_SARIA, QUEST_SONG_STORMS, QUEST_SWORD }, // QUEST_SONG_SUN + { CURSOR_NONE, QUEST_SONG_TIME, CURSOR_TO_LEFT, QUEST_HEART_PIECE }, // QUEST_BOMBERS_NOTEBOOK + { QUEST_SWORD, CURSOR_NONE, QUEST_SONG_OATH, QUEST_BOMB_BAG }, // QUEST_QUIVER + { QUEST_SHIELD, CURSOR_NONE, QUEST_QUIVER, CURSOR_TO_RIGHT }, // QUEST_BOMB_BAG + { QUEST_QUIVER, QUEST_SONG_TIME, CURSOR_TO_LEFT, QUEST_HEART_PIECE }, // QUEST_SKULL_TOKEN + { CURSOR_NONE, QUEST_SONG_STORMS, QUEST_BOMBERS_NOTEBOOK, QUEST_REMAINS_GYORG }, // QUEST_HEART_PIECE + }; + PauseContext* pauseCtx = &play->pauseCtx; + MessageContext* msgCtx = &play->msgCtx; + InterfaceContext* interfaceCtx = &play->interfaceCtx; + s32 pad; + s16 nextCursorPoint; + s16 oldCursorPoint; + s16 i; + u16 cursor; + u16 cursorItem; + + pauseCtx->nameColorSet = PAUSE_NAME_COLOR_SET_WHITE; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; + + // != 0 + if ((pauseCtx->state == 6) && (!pauseCtx->unk_200 || (pauseCtx->unk_200 == 5) || (pauseCtx->unk_200 == 8)) && + (pauseCtx->pageIndex == PAUSE_QUEST) && !pauseCtx->itemDescriptionOn) { + if (pauseCtx->cursorSpecialPos == 0) { + oldCursorPoint = pauseCtx->cursorPoint[PAUSE_QUEST]; + + if (pauseCtx->stickAdjX < -30) { + // Move cursor left + if (pauseCtx->unk_200 == 5) { + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + } + pauseCtx->unk_298 = 4.0f; + + nextCursorPoint = sCursorPointLinks[oldCursorPoint].left; + if (nextCursorPoint == CURSOR_TO_LEFT) { + KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); + pauseCtx->unk_200 = 0; + if (interfaceCtx->unk_212 == 6) { + func_8011552C(play, 0x15); + } + return; + } else { + while (nextCursorPoint > CURSOR_NONE) { + if (KaleidoScope_UpdateQuestStatusPoint(pauseCtx, nextCursorPoint)) { + break; + } + nextCursorPoint = sCursorPointLinks[nextCursorPoint].left; + } + } + } else if (pauseCtx->stickAdjX > 30) { + // Move cursor right + if (pauseCtx->unk_200 == 5) { + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + } + pauseCtx->unk_298 = 4.0f; + nextCursorPoint = sCursorPointLinks[oldCursorPoint].right; + + if (nextCursorPoint == CURSOR_TO_RIGHT) { + KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT); + pauseCtx->unk_200 = 0; + return; + } + + while (nextCursorPoint > CURSOR_NONE) { + if (KaleidoScope_UpdateQuestStatusPoint(pauseCtx, nextCursorPoint)) { + break; + } + nextCursorPoint = sCursorPointLinks[nextCursorPoint].right; + } + } + + if (pauseCtx->stickAdjY < -30) { + // Move cursor down + if (pauseCtx->unk_200 == 5) { + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + } + nextCursorPoint = sCursorPointLinks[oldCursorPoint].down; + + while (nextCursorPoint > CURSOR_NONE) { + pauseCtx->unk_298 = 4.0f; + if (KaleidoScope_UpdateQuestStatusPoint(pauseCtx, nextCursorPoint)) { + break; + } + nextCursorPoint = sCursorPointLinks[nextCursorPoint].down; + } + } else if (pauseCtx->stickAdjY > 30) { + // Move cursor up + if (pauseCtx->unk_200 == 5) { + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + } + nextCursorPoint = sCursorPointLinks[oldCursorPoint].up; + while (nextCursorPoint > CURSOR_NONE) { + pauseCtx->unk_298 = 4.0f; + if (KaleidoScope_UpdateQuestStatusPoint(pauseCtx, nextCursorPoint)) { + break; + } + nextCursorPoint = sCursorPointLinks[nextCursorPoint].up; + } + } + + // if the cursor point changed + if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_QUEST]) { + pauseCtx->unk_200 = 0; + play_sound(NA_SE_SY_CURSOR); + } + + // Update cursor item and slot + if (pauseCtx->cursorPoint[PAUSE_QUEST] != QUEST_HEART_PIECE) { + if (pauseCtx->cursorPoint[PAUSE_QUEST] <= QUEST_REMAINS_TWINMOLD) { + // Boss Remains + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { + cursorItem = ITEM_REMAINS_ODOLWA + pauseCtx->cursorPoint[PAUSE_QUEST]; + } else { + cursorItem = PAUSE_ITEM_NONE; + } + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] == QUEST_BOMBERS_NOTEBOOK) { + // Bombers Notebook + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { + cursorItem = ITEM_BOMBERS_NOTEBOOK; + } else { + cursorItem = PAUSE_ITEM_NONE; + } + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] == QUEST_SHIELD) { + // Shield + if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD) != EQUIP_VALUE_SHIELD_NONE) { + cursorItem = (ITEM_SHIELD_HERO - EQUIP_TYPE_SHIELD) + GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD); + } else { + cursorItem = PAUSE_ITEM_NONE; + } + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] == QUEST_SWORD) { + // Sword + if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) != EQUIP_VALUE_SWORD_NONE) { + cursorItem = + (ITEM_SWORD_KOKIRI - EQUIP_VALUE_SWORD_KOKIRI) + GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD); + } else { + cursorItem = PAUSE_ITEM_NONE; + } + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] <= QUEST_SONG_SUN) { + // Songs + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { + cursorItem = ITEM_WALLET_GIANT + pauseCtx->cursorPoint[PAUSE_QUEST]; + } else if ((pauseCtx->cursorPoint[PAUSE_QUEST] == QUEST_SONG_LULLABY) && + CHECK_QUEST_ITEM(QUEST_SONG_LULLABY_INTRO)) { + cursorItem = ITEM_SONG_LULLABY_INTRO; + } else { + cursorItem = PAUSE_ITEM_NONE; + } + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] == QUEST_QUIVER) { + // Quiver Upgrade + if (GET_CUR_UPG_VALUE(UPG_QUIVER) != 0) { + cursorItem = (ITEM_QUIVER_30 - 1) + GET_CUR_UPG_VALUE(UPG_QUIVER); + } else { + cursorItem = PAUSE_ITEM_NONE; + } + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] == QUEST_BOMB_BAG) { + // Bomb Bag Upgrade + if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) != 0) { + cursorItem = (ITEM_BOMB_BAG_20 - 1) + GET_CUR_UPG_VALUE(UPG_BOMB_BAG); + } else { + cursorItem = PAUSE_ITEM_NONE; + } + } else { + cursorItem = PAUSE_ITEM_NONE; + } + } else { + // Heart Piece Count + if ((GET_SAVE_INVENTORY_QUEST_ITEMS >> QUEST_HEART_PIECE_COUNT) != 0) { + cursorItem = ITEM_HEART_CONTAINER; + } else { + cursorItem = PAUSE_ITEM_NONE; + } + } + + cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; + pauseCtx->cursorItem[pauseCtx->pageIndex] = cursorItem; + pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor; + + if ((pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && (pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && + (pauseCtx->cursorSpecialPos == 0)) { + if ((cursor >= QUEST_SONG_SONATA) && (cursor <= QUEST_SONG_SUN)) { + // Handle part of the ocarina songs playback + if ((CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST]) || + ((cursor == QUEST_SONG_LULLABY) && !CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST]) && + CHECK_QUEST_ITEM(QUEST_SONG_LULLABY_INTRO))) && + (msgCtx->msgLength == 0)) { + // The cursor is on a learned song + // Set some things up for song playback + + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { + cursor = pauseCtx->cursorSlot[PAUSE_QUEST]; + } else { + cursor = QUEST_BOMB_BAG; + } + + pauseCtx->ocarinaSongIndex = gOcarinaSongItemMap[cursor - QUEST_SONG_SONATA]; + sQuestSongPlaybackDelayTimer = 10; + + for (i = 0; i < 8; i++) { + sQuestSongPlayedOcarinaButtons[i] = OCARINA_BTN_INVALID; + sQuestSongPlayedOcarinaButtonsAlpha[i] = 0; + } + + sQuestSongPlayedOcarinaButtonsNum = 0; + + // Setup the song to receive user input, immediately cancelled below + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); + AudioOcarina_StartDefault((1 << pauseCtx->ocarinaSongIndex) | 0x80000000); + + // Clear the playback staff + pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); + pauseCtx->ocarinaStaff->pos = 0; + pauseCtx->ocarinaStaff->state = 0xFF; + + pauseCtx->ocarinaButtonsY[OCARINA_BTN_A] = -62; + pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_DOWN] = -56; + pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_RIGHT] = -49; + pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_LEFT] = -46; + pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_UP] = -41; + + pauseCtx->unk_200 = 8; + + if (interfaceCtx->unk_212 != 6) { + func_8011552C(play, 6); + } + + // Stop receiving input to play a song as mentioned above + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + + if (gSaveContext.buttonStatus[EQUIP_SLOT_A] == BTN_DISABLED) { + gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_ENABLED; + gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE; + Interface_SetHudVisibility(HUD_VISIBILITY_ALL); + } + } else { + if (interfaceCtx->unk_212 != 6) { + func_8011552C(play, 6); + } + if (gSaveContext.buttonStatus[EQUIP_SLOT_A] != BTN_DISABLED) { + gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_DISABLED; + gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE; + Interface_SetHudVisibility(HUD_VISIBILITY_ALL); + } + } + } else { + if ((cursor == QUEST_BOMBERS_NOTEBOOK) && (pauseCtx->cursorItem[PAUSE_QUEST] != PAUSE_ITEM_NONE)) { + if (interfaceCtx->unk_212 != 6) { + func_8011552C(play, 6); + } + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; + } else if (interfaceCtx->unk_212 == 6) { + func_8011552C(play, 0x15); + } + + if ((pauseCtx->cursorItem[PAUSE_QUEST] != PAUSE_ITEM_NONE) && (msgCtx->msgLength == 0)) { + if (gSaveContext.buttonStatus[EQUIP_SLOT_A] == BTN_DISABLED) { + gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_ENABLED; + gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE; + Interface_SetHudVisibility(HUD_VISIBILITY_ALL); + } + + if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && (msgCtx->msgLength == 0)) { + if (pauseCtx->cursorPoint[PAUSE_QUEST] == QUEST_BOMBERS_NOTEBOOK) { + play->pauseCtx.bombersNotebookOpen = true; + pauseCtx->unk_200 = 0x10; + play_sound(NA_SE_SY_DECIDE); + } else { + pauseCtx->itemDescriptionOn = true; + if (pauseCtx->cursorYIndex[PAUSE_QUEST] < 2) { + if (pauseCtx->cursorItem[PAUSE_QUEST] < ITEM_REMAINS_ODOLWA) { + func_801514B0(play, 0x1737 + pauseCtx->cursorItem[PAUSE_QUEST], 1); + } else { + func_801514B0(play, 0x173B + pauseCtx->cursorItem[PAUSE_QUEST], 3); + } + } else { + if (pauseCtx->cursorItem[PAUSE_QUEST] < ITEM_REMAINS_ODOLWA) { + func_801514B0(play, 0x1737 + pauseCtx->cursorItem[PAUSE_QUEST], 1); + } else { + func_801514B0(play, 0x173B + pauseCtx->cursorItem[PAUSE_QUEST], 1); + } + } + } + } + } else if (gSaveContext.buttonStatus[EQUIP_SLOT_A] != BTN_DISABLED) { + gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_DISABLED; + gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE; + Interface_SetHudVisibility(HUD_VISIBILITY_ALL); + } + } + } else if (pauseCtx->unk_200 == 5) { + // Abort reading ocarina song input if the stick is moved + if ((pauseCtx->stickAdjX != 0) || (pauseCtx->stickAdjY != 0)) { + pauseCtx->unk_200 = 0; + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + } + } else if ((pauseCtx->unk_200 == 8) && CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && + (msgCtx->msgLength == 0) && (cursor >= QUEST_SONG_SONATA) && (cursor <= QUEST_SONG_SUN)) { + pauseCtx->unk_200 = 9; + sQuestSongPlaybackDelayTimer = 10; + } + + if (pauseCtx->cursorSpecialPos == 0) { + if ((pauseCtx->cursorSlot[PAUSE_QUEST] >= 6) && (pauseCtx->cursorSlot[PAUSE_QUEST] < 0x12) && + ((pauseCtx->unk_200 <= 2) || (pauseCtx->unk_200 == 5) || (pauseCtx->unk_200 == 8)) && + (pauseCtx->cursorItem[pauseCtx->pageIndex] != PAUSE_ITEM_NONE)) { + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; + if ((pauseCtx->unk_200 >= 2) && (pauseCtx->unk_200 <= 6)) { + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; + } + } + } + } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { + if (pauseCtx->stickAdjX > 30) { + if (pauseCtx->unk_200 == 5) { + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + } + + func_80821A04(play); + + pauseCtx->cursorPoint[PAUSE_QUEST] = QUEST_BOMBERS_NOTEBOOK; + if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { + cursorItem = ITEM_BOMBERS_NOTEBOOK; + } else { + cursorItem = PAUSE_ITEM_NONE; + } + + cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; + pauseCtx->cursorItem[pauseCtx->pageIndex] = cursorItem; + pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor; + } + } else if (pauseCtx->stickAdjX < -30) { + if (pauseCtx->unk_200 == 5) { + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + } + + func_80821A04(play); + + pauseCtx->cursorPoint[PAUSE_QUEST] = QUEST_REMAINS_GOHT; + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { + cursorItem = (ITEM_REMAINS_GOHT - 1) + pauseCtx->cursorPoint[PAUSE_QUEST]; + if (pauseCtx->cursorPoint[PAUSE_QUEST] != QUEST_REMAINS_ODOLWA) { + // This condition is always true as `cursorPoint` is set three lines above + cursorItem = ITEM_MASK_GIANT; + } + } else { + cursorItem = PAUSE_ITEM_NONE; + } + + cursor = pauseCtx->cursorPoint[PAUSE_QUEST]; + pauseCtx->cursorItem[pauseCtx->pageIndex] = cursorItem; + pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor; + } + } else if (pauseCtx->unk_200 == 9) { + // After a short delay, start the playback of the selected song + + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; + sQuestSongPlaybackDelayTimer--; + if (sQuestSongPlaybackDelayTimer == 0) { + for (i = 0; i < 8; i++) { + sQuestSongPlayedOcarinaButtons[i] = OCARINA_BTN_INVALID; + sQuestSongPlayedOcarinaButtonsAlpha[i] = 0; + } + sQuestSongPlayedOcarinaButtonsNum = 0; + + pauseCtx->ocarinaButtonsY[OCARINA_BTN_A] = -62; + pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_DOWN] = -56; + pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_RIGHT] = -49; + pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_LEFT] = -46; + pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_UP] = -41; + + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { + cursor = pauseCtx->cursorSlot[PAUSE_QUEST]; + } else { + cursor = QUEST_BOMB_BAG; + } + + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); + pauseCtx->ocarinaSongIndex = gOcarinaSongItemMap[cursor - QUEST_SONG_SONATA]; + AudioOcarina_SetPlaybackSong(pauseCtx->ocarinaSongIndex + 1, 1); + pauseCtx->unk_200 = 2; + pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); + pauseCtx->ocarinaStaff->pos = 0; + } + } +} + +s32 KaleidoScope_UpdateQuestStatusPoint(PauseContext* pauseCtx, s16 point) { + pauseCtx->cursorPoint[PAUSE_QUEST] = point; + + return true; +} diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c index c1f67b079..1152db202 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c @@ -472,7 +472,7 @@ void KaleidoScope_DrawInventoryEditor(PlayState* play) { // Loop over columns (i), (counterDigits[1] stores rectLeft) for (counterDigits[1] = 44, i = 0; i < 4; i++) { counterDigits[2] = 0; - if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA + i)) { + if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA + i)) { counterDigits[2] = 1; } KaleidoScope_DrawDigit(play, counterDigits[2], counterDigits[1], 112); diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c index be23b56de..120a07c0a 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c @@ -306,8 +306,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { } gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j + 0], 4, 0); - KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, - gItemIcons[((void)0, gSaveContext.save.inventory.items[i])], 32, 32, 0); + KaleidoScope_DrawTexQuadRGBA32(play->state.gfxCtx, + gItemIcons[((void)0, gSaveContext.save.inventory.items[i])], 32, 32, 0); } } @@ -354,8 +354,8 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { s16 moveCursorResult; s16 pad2; - pauseCtx->cursorColorSet = 0; - pauseCtx->nameColorSet = 0; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; + pauseCtx->nameColorSet = PAUSE_NAME_COLOR_SET_WHITE; if ((pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_ITEM) && !pauseCtx->itemDescriptionOn) { @@ -367,7 +367,7 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { // Move cursor left/right if (pauseCtx->cursorSpecialPos == 0) { // cursor is currently on a slot - pauseCtx->cursorColorSet = 2; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW; if (ABS_ALT(pauseCtx->stickAdjX) > 30) { cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; @@ -561,7 +561,7 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { } cursorSlot = pauseCtx->cursorPoint[PAUSE_ITEM]; - pauseCtx->cursorColorSet = 2; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW; if (moveCursorResult == PAUSE_CURSOR_RESULT_SLOT) { cursorItem = gSaveContext.save.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]; @@ -571,7 +571,7 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { if (cursorItem == ITEM_NONE) { cursorItem = PAUSE_ITEM_NONE; - pauseCtx->cursorColorSet = 0; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; } if ((cursorItem != (u32)PAUSE_ITEM_NONE) && (msgCtx->msgLength == 0)) { @@ -691,7 +691,7 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { play_sound(NA_SE_SY_CURSOR); } } else if ((pauseCtx->unk_200 == 3) && (pauseCtx->pageIndex == PAUSE_ITEM)) { - pauseCtx->cursorColorSet = 2; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW; } } diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c index 5f4c136e0..823a3d63f 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c @@ -306,7 +306,7 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) { if (pauseCtx->state == 6) { if ((pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_MAP)) { - pauseCtx->cursorColorSet = 0; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_MAP]; if (pauseCtx->stickAdjX > 30) { pauseCtx->unk_298 = 4.0f; @@ -826,7 +826,7 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) { s16 oldCursorPoint; if ((pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_MAP)) { - pauseCtx->cursorColorSet = 0; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; if (gSaveContext.buttonStatus[EQUIP_SLOT_A] != BTN_DISABLED) { @@ -937,7 +937,7 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) { play_sound(NA_SE_SY_CURSOR); } } else if (pauseCtx->state == 0x17) { - pauseCtx->cursorColorSet = 4; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; if (pauseCtx->stickAdjX > 30) { diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c index cedcbf8f3..77835026f 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c @@ -257,7 +257,7 @@ void KaleidoScope_DrawMaskSelect(PlayState* play) { } gSPVertex(POLY_OPA_DISP++, &pauseCtx->maskVtx[j + 0], 4, 0); - KaleidoScope_DrawQuadTextureRGBA32( + KaleidoScope_DrawTexQuadRGBA32( play->state.gfxCtx, gItemIcons[((void)0, gSaveContext.save.inventory.items[i + NUM_ITEM_SLOTS])], 32, 32, 0); } @@ -285,8 +285,8 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { s16 moveCursorResult; s16 pad2; - pauseCtx->cursorColorSet = 0; - pauseCtx->nameColorSet = 0; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; + pauseCtx->nameColorSet = PAUSE_NAME_COLOR_SET_WHITE; if ((pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_MASK) && !pauseCtx->itemDescriptionOn) { @@ -298,7 +298,7 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { // Move cursor left/right if (pauseCtx->cursorSpecialPos == 0) { // cursor is currently on a slot - pauseCtx->cursorColorSet = 2; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW; if (ABS_ALT(pauseCtx->stickAdjX) > 30) { cursorPoint = pauseCtx->cursorPoint[PAUSE_MASK]; @@ -497,7 +497,7 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { } cursorSlot = pauseCtx->cursorPoint[PAUSE_MASK]; - pauseCtx->cursorColorSet = 2; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW; if (moveCursorResult == PAUSE_CURSOR_RESULT_SLOT) { cursorItem = gSaveContext.save.inventory.items[pauseCtx->cursorPoint[PAUSE_MASK] + NUM_ITEM_SLOTS]; @@ -513,7 +513,7 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { if (cursorItem == ITEM_NONE) { cursorItem = PAUSE_ITEM_NONE; - pauseCtx->cursorColorSet = 0; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; } if ((cursorItem != PAUSE_ITEM_NONE) && (msgCtx->msgLength == 0)) { @@ -614,7 +614,7 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { play_sound(NA_SE_SY_CURSOR); } } else if ((pauseCtx->unk_200 == 0xF) && (pauseCtx->pageIndex == PAUSE_MASK)) { - pauseCtx->cursorColorSet = 2; + pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW; } } diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h index 72392390b..14c16ddcd 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h @@ -30,12 +30,19 @@ typedef enum { } EquipState; typedef enum { - /* 0 */ DEBUG_EDITOR_NONE, - /* 1 */ DEBUG_EDITOR_INVENTORY_INIT, - /* 2 */ DEBUG_EDITOR_INVENTORY, - /* 3 */ DEBUG_EDITOR_EVENTS + /* 0 */ DEBUG_EDITOR_NONE, + /* 1 */ DEBUG_EDITOR_INVENTORY_INIT, + /* 2 */ DEBUG_EDITOR_INVENTORY, + /* 3 */ DEBUG_EDITOR_EVENTS } DebugEditor; +#define PAUSE_NAME_COLOR_SET_WHITE 0 +#define PAUSE_NAME_COLOR_SET_GREY 1 + +#define PAUSE_CURSOR_COLOR_SET_WHITE 0 +#define PAUSE_CURSOR_COLOR_SET_YELLOW 2 +#define PAUSE_CURSOR_COLOR_SET_BLUE 4 + // To be used for Item-Page cursor and Mask-Page cursor typedef enum { /* 0 */ PAUSE_CURSOR_RESULT_NONE, @@ -51,8 +58,8 @@ typedef enum { // NES void KaleidoScope_MoveCursorToSpecialPos(PlayState* play, s16 cursorSpecialPos); -void KaleidoScope_DrawQuadTextureRGBA32(GraphicsContext* gfxCtx, TexturePtr texture, u16 width, u16 height, u16 point); -void KaleidoScope_SetView(PauseContext* pauseCtx, f32 x, f32 y, f32 z); +void KaleidoScope_DrawTexQuadRGBA32(GraphicsContext* gfxCtx, TexturePtr texture, u16 width, u16 height, u16 point); +void KaleidoScope_SetView(PauseContext* pauseCtx, f32 eyeX, f32 eyeY, f32 eyeZ); void func_80821A04(PlayState* play); // Map @@ -61,6 +68,10 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play); void KaleidoScope_DrawWorldMap(PlayState* play); void KaleidoScope_UpdateWorldMapCursor(PlayState* play); +// Collect +void KaleidoScope_DrawQuestStatus(PlayState* play); +void KaleidoScope_UpdateQuestCursor(PlayState* play); + // Item void KaleidoScope_SetCursorVtx(PauseContext* pauseCtx, u16 index, Vtx* vtx); void KaleidoScope_DrawItemSelect(PlayState* play); @@ -72,6 +83,9 @@ void KaleidoScope_DrawMaskSelect(PlayState* play); void KaleidoScope_UpdateMaskCursor(PlayState* play); void KaleidoScope_UpdateMaskEquip(PlayState* play); +// Prompt +void KaleidoScope_UpdatePrompt(PlayState* play); + // Debug void KaleidoScope_DrawInventoryEditor(PlayState* play); void KaleidoScope_UpdateInventoryEditor(PlayState* play); diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c index 6c6754b3d..a322fda1f 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c @@ -222,30 +222,173 @@ s16 D_8082BB68[] = { 0x000E, 0xFFFE, 0xFFFE, 0xFFEE, 0xFFEE, 0x0000, }; -s16 D_8082BB74[] = { - 0x002D, 0x004E, 0x000A, 0x002D, 0x0050, 0x000B, 0xFF93, 0xFFA9, 0xFFBF, 0xFFD7, 0xFFED, 0xFFEE, 0xFF93, 0xFFA9, - 0xFFBF, 0xFFD7, 0xFFED, 0xFFEE, 0xFF99, 0x0007, 0x0052, 0xFF92, 0xFFCA, 0xFF9E, 0xFFAA, 0xFFB6, 0xFFC2, 0xFFCE, - 0xFFDA, 0xFFE6, 0xFFF2, 0xFF9E, 0xFFAA, 0xFFB6, 0xFFC2, 0xFFCE, 0xFFDA, 0xFFE6, 0xFFF2, 0x0000, +s16 sQuestVtxRectLeft[] = { + 45, // QUEST_REMAINS_ODOLWA + 78, // QUEST_REMAINS_GOHT + 10, // QUEST_REMAINS_GYORG + 45, // QUEST_REMAINS_TWINMOLD + 80, // QUEST_SHIELD + 11, // QUEST_SWORD + -109, // QUEST_SONG_SONATA + -87, // QUEST_SONG_LULLABY + -65, // QUEST_SONG_BOSSA_NOVA + -41, // QUEST_SONG_ELEGY + -19, // QUEST_SONG_OATH + -18, // QUEST_SONG_SARIA + -109, // QUEST_SONG_TIME + -87, // QUEST_SONG_HEALING + -65, // QUEST_SONG_EPONA + -41, // QUEST_SONG_SOARING + -19, // QUEST_SONG_STORMS + -18, // QUEST_SONG_SUN + -103, // QUEST_BOMBERS_NOTEBOOK + 7, // QUEST_QUIVER + 82, // QUEST_BOMB_BAG + -110, // QUEST_SKULL_TOKEN (unused) + -54, // QUEST_HEART_PIECE + -98, // ocarina song button index 0 + -86, // ocarina song button index 1 + -74, // ocarina song button index 2 + -62, // ocarina song button index 3 + -50, // ocarina song button index 4 + -38, // ocarina song button index 5 + -26, // ocarina song button index 6 + -14, // ocarina song button index 7 + -98, // ocarina input button index 0 + -86, // ocarina input button index 1 + -74, // ocarina input button index 2 + -62, // ocarina input button index 3 + -50, // ocarina input button index 4 + -38, // ocarina input button index 5 + -26, // ocarina input button index 6 + -14, // ocarina input button index 7 }; -s16 D_8082BBC4[] = { - 0x003E, 0x002A, 0x002A, 0x0014, 0xFFF7, 0xFFF7, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0xFFEC, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0036, 0xFFD4, 0xFFD4, 0x0022, 0x003A, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, - 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0x0000, +s16 sQuestVtxRectTop[] = { + 62, // QUEST_REMAINS_ODOLWA + 42, // QUEST_REMAINS_GOHT + 42, // QUEST_REMAINS_GYORG + 20, // QUEST_REMAINS_TWINMOLD + -9, // QUEST_SHIELD + -9, // QUEST_SWORD + -20, // QUEST_SONG_SONATA + -20, // QUEST_SONG_LULLABY + -20, // QUEST_SONG_BOSSA_NOVA + -20, // QUEST_SONG_ELEGY + -20, // QUEST_SONG_OATH + -20, // QUEST_SONG_SARIA + 2, // QUEST_SONG_TIME + 2, // QUEST_SONG_HEALING + 2, // QUEST_SONG_EPONA + 2, // QUEST_SONG_SOARING + 2, // QUEST_SONG_STORMS + 2, // QUEST_SONG_SUN + 54, // QUEST_BOMBERS_NOTEBOOK + -44, // QUEST_QUIVER + -44, // QUEST_BOMB_BAG + 34, // QUEST_SKULL_TOKEN (unused) + 58, // QUEST_HEART_PIECE + -52, // ocarina song button index 0 + -52, // ocarina song button index 1 + -52, // ocarina song button index 2 + -52, // ocarina song button index 3 + -52, // ocarina song button index 4 + -52, // ocarina song button index 5 + -52, // ocarina song button index 6 + -52, // ocarina song button index 7 + -52, // ocarina input button index 0 + -52, // ocarina input button index 1 + -52, // ocarina input button index 2 + -52, // ocarina input button index 3 + -52, // ocarina input button index 4 + -52, // ocarina input button index 5 + -52, // ocarina input button index 6 + -52, // ocarina input button index 7 }; -s16 D_8082BC14[] = { - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, - 0x0010, 0x0010, 0x0010, 0x0010, 0x0020, 0x0020, 0x0020, 0x0018, 0x0030, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, - 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0000, +s16 sQuestVtxWidths[] = { + 32, // QUEST_REMAINS_ODOLWA + 32, // QUEST_REMAINS_GOHT + 32, // QUEST_REMAINS_GYORG + 32, // QUEST_REMAINS_TWINMOLD + 32, // QUEST_SHIELD + 32, // QUEST_SWORD + 16, // QUEST_SONG_SONATA + 16, // QUEST_SONG_LULLABY + 16, // QUEST_SONG_BOSSA_NOVA + 16, // QUEST_SONG_ELEGY + 16, // QUEST_SONG_OATH + 16, // QUEST_SONG_SARIA + 16, // QUEST_SONG_TIME + 16, // QUEST_SONG_HEALING + 16, // QUEST_SONG_EPONA + 16, // QUEST_SONG_SOARING + 16, // QUEST_SONG_STORMS + 16, // QUEST_SONG_SUN + 32, // QUEST_BOMBERS_NOTEBOOK + 32, // QUEST_QUIVER + 32, // QUEST_BOMB_BAG + 24, // QUEST_SKULL_TOKEN (unused) + 48, // QUEST_HEART_PIECE + 16, // ocarina song button index 0 + 16, // ocarina song button index 1 + 16, // ocarina song button index 2 + 16, // ocarina song button index 3 + 16, // ocarina song button index 4 + 16, // ocarina song button index 5 + 16, // ocarina song button index 6 + 16, // ocarina song button index 7 + 16, // ocarina input button index 0 + 16, // ocarina input button index 1 + 16, // ocarina input button index 2 + 16, // ocarina input button index 3 + 16, // ocarina input button index 4 + 16, // ocarina input button index 5 + 16, // ocarina input button index 6 + 16, // ocarina input button index 7 }; -s16 D_8082BC64[] = { - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0020, 0x0020, 0x0020, 0x0018, 0x0030, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, - 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0000, +s16 sQuestVtxHeights[] = { + 32, // QUEST_REMAINS_ODOLWA + 32, // QUEST_REMAINS_GOHT + 32, // QUEST_REMAINS_GYORG + 32, // QUEST_REMAINS_TWINMOLD + 32, // QUEST_SHIELD + 32, // QUEST_SWORD + 24, // QUEST_SONG_SONATA + 24, // QUEST_SONG_LULLABY + 24, // QUEST_SONG_BOSSA_NOVA + 24, // QUEST_SONG_ELEGY + 24, // QUEST_SONG_OATH + 24, // QUEST_SONG_SARIA + 24, // QUEST_SONG_TIME + 24, // QUEST_SONG_HEALING + 24, // QUEST_SONG_EPONA + 24, // QUEST_SONG_SOARING + 24, // QUEST_SONG_STORMS + 24, // QUEST_SONG_SUN + 32, // QUEST_BOMBERS_NOTEBOOK + 32, // QUEST_QUIVER + 32, // QUEST_BOMB_BAG + 24, // QUEST_SKULL_TOKEN (unused) + 48, // QUEST_HEART_PIECE + 16, // ocarina song button index 0 + 16, // ocarina song button index 1 + 16, // ocarina song button index 2 + 16, // ocarina song button index 3 + 16, // ocarina song button index 4 + 16, // ocarina song button index 5 + 16, // ocarina song button index 6 + 16, // ocarina song button index 7 + 16, // ocarina input button index 0 + 16, // ocarina input button index 1 + 16, // ocarina input button index 2 + 16, // ocarina input button index 3 + 16, // ocarina input button index 4 + 16, // ocarina input button index 5 + 16, // ocarina input button index 6 + 16, // ocarina input button index 7 }; - f32 D_8082BCB4[] = { -62.0f, -36.0f, -10.0f, 16.0f, 42.0f, 68.0f, }; @@ -323,7 +466,7 @@ s32 D_8082BEB8[] = { 0, 0 }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821A04.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_DrawQuadTextureRGBA32.s") +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_DrawTexQuadRGBA32.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821CC4.s") diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index e6ace2b97..77810cc22 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -4197,9 +4197,9 @@ 0x80815770:("DayTelop_Noop",), 0x8081577C:("DayTelop_LoadGraphics",), 0x80815820:("DayTelop_Init",), - 0x808160A0:("func_808160A0",), - 0x80817B5C:("func_80817B5C",), - 0x80818904:("func_80818904",), + 0x808160A0:("KaleidoScope_DrawQuestStatus",), + 0x80817B5C:("KaleidoScope_UpdateQuestCursor",), + 0x80818904:("KaleidoScope_UpdateQuestStatusPoint",), 0x80818920:("KaleidoScope_DrawInventoryEditorText",), 0x808190C4:("KaleidoScope_DrawDigit",), 0x80819238:("KaleidoScope_DrawInventoryEditor",), @@ -4223,7 +4223,7 @@ 0x80821958:("func_80821958",), 0x80821984:("KaleidoScope_MoveCursorToSpecialPos",), 0x80821A04:("func_80821A04",), - 0x80821AD4:("KaleidoScope_DrawQuadTextureRGBA32",), + 0x80821AD4:("KaleidoScope_DrawTexQuadRGBA32",), 0x80821CC4:("func_80821CC4",), 0x80821D84:("func_80821D84",), 0x80821F30:("func_80821F30",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index ae80ee368..4a5017ad5 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -2003,7 +2003,7 @@ 0x801CFC98:("D_801CFC98","UNK_TYPE1","",0x1), 0x801CFCA4:("D_801CFCA4","UNK_TYPE2","",0x2), 0x801CFCAC:("D_801CFCAC","UNK_TYPE2","",0x2), - 0x801CFCB8:("D_801CFCB8","UNK_TYPE1","",0x1), + 0x801CFCB8:("gOcarinaSongItemMap","UNK_TYPE1","",0x1), 0x801CFCD8:("D_801CFCD8","UNK_TYPE2","",0x2), 0x801CFCE4:("D_801CFCE4","UNK_TYPE2","",0x2), 0x801CFCF0:("D_801CFCF0","UNK_TYPE2","",0x2), @@ -4660,32 +4660,32 @@ 0x80815FF4:("sDayLeftTextures","TexturePtr","[4]",0x10), 0x80816004:("sDayRightTextures","TexturePtr","[4]",0x10), 0x80816014:("sHoursLeftTextures","TexturePtr","[3]",0xC), - 0x8082AED0:("D_8082AED0","UNK_TYPE1","",0x1), - 0x8082AED8:("D_8082AED8","UNK_TYPE1","",0x1), - 0x8082AEE0:("D_8082AEE0","UNK_TYPE2","",0x2), - 0x8082AEE4:("D_8082AEE4","UNK_TYPE1","",0x1), - 0x8082AEF0:("D_8082AEF0","UNK_TYPE2","",0x2), - 0x8082AF04:("D_8082AF04","UNK_TYPE2","",0x2), - 0x8082AF24:("D_8082AF24","UNK_TYPE1","",0x1), - 0x8082AF6C:("D_8082AF6C","UNK_TYPE2","",0x2), - 0x8082AF78:("D_8082AF78","UNK_TYPE2","",0x2), - 0x8082AF84:("D_8082AF84","UNK_TYPE2","",0x2), - 0x8082AF90:("D_8082AF90","UNK_TYPE2","",0x2), - 0x8082AF94:("D_8082AF94","UNK_TYPE2","",0x2), - 0x8082AF98:("D_8082AF98","UNK_TYPE2","",0x2), - 0x8082AF9C:("D_8082AF9C","UNK_TYPE2","",0x2), - 0x8082AFA0:("D_8082AFA0","UNK_TYPE2","",0x2), - 0x8082AFA4:("D_8082AFA4","UNK_TYPE2","",0x2), - 0x8082AFA8:("D_8082AFA8","UNK_TYPE2","",0x2), - 0x8082AFAC:("D_8082AFAC","UNK_TYPE2","",0x2), - 0x8082AFB0:("D_8082AFB0","UNK_TYPE1","",0x1), - 0x8082AFC4:("D_8082AFC4","UNK_TYPE2","",0x2), - 0x8082AFDC:("D_8082AFDC","UNK_TYPE2","",0x2), - 0x8082AFF4:("D_8082AFF4","s16","[12]",0x18), - 0x8082B00C:("D_8082B00C","void*","[6]",0x18), - 0x8082B024:("D_8082B024","UNK_TYPE1","",0x1), - 0x8082B028:("D_8082B028","UNK_TYPE2","",0x2), - 0x8082B02C:("D_8082B02C","s16","[98]",0xC4), + 0x8082AED0:("sQuestRemainsColorTimerInit","UNK_TYPE1","",0x1), + 0x8082AED8:("sQuestHpColorTimerInit","UNK_TYPE1","",0x1), + 0x8082AEE0:("sQuestSongPlayedOcarinaButtonsNum","UNK_TYPE2","",0x2), + 0x8082AEE4:("sQuestSongPlayedOcarinaButtons","UNK_TYPE1","",0x1), + 0x8082AEF0:("sQuestSongPlayedOcarinaButtonsAlpha","UNK_TYPE2","",0x2), + 0x8082AF04:("sQuestHpPrimColorTargets","UNK_TYPE2","",0x2), + 0x8082AF24:("sQuestRemainsEnvTargets","UNK_TYPE1","",0x1), + 0x8082AF6C:("sQuestRemainsEnvRed","UNK_TYPE2","",0x2), + 0x8082AF78:("sQuestRemainsEnvGreen","UNK_TYPE2","",0x2), + 0x8082AF84:("sQuestRemainsEnvBlue","UNK_TYPE2","",0x2), + 0x8082AF90:("sQuestRemainsColorTimer","UNK_TYPE2","",0x2), + 0x8082AF94:("sQuestRemainsColorTimerIndex","UNK_TYPE2","",0x2), + 0x8082AF98:("sQuestHpPrimRed","UNK_TYPE2","",0x2), + 0x8082AF9C:("sQuestHpPrimGreen","UNK_TYPE2","",0x2), + 0x8082AFA0:("sQuestHpPrimBlue","UNK_TYPE2","",0x2), + 0x8082AFA4:("sQuestHpPrimAlpha","UNK_TYPE2","",0x2), + 0x8082AFA8:("sQuestHpColorTimer","UNK_TYPE2","",0x2), + 0x8082AFAC:("sQuestHpPrimColorTargetIndex","UNK_TYPE2","",0x2), + 0x8082AFB0:("sOcarinaButtonTextures","UNK_TYPE1","",0x1), + 0x8082AFC4:("sQuestSongsPrimRed","UNK_TYPE2","",0x2), + 0x8082AFDC:("sQuestSongsPrimGreen","UNK_TYPE2","",0x2), + 0x8082AFF4:("sQuestSongsPrimBlue","s16","[12]",0x18), + 0x8082B00C:("sQuestUpgradeTextures","void*","[6]",0x18), + 0x8082B024:("sQuestUpgrades","UNK_TYPE1","",0x1), + 0x8082B028:("sQuestSongPlaybackDelayTimer","UNK_TYPE2","",0x2), + 0x8082B02C:("sCursorPointLinks","s16","[98]",0xC4), 0x8082B0F0:("sCurSection","UNK_TYPE2","",0x2), 0x8082B0F4:("sCurRow","UNK_TYPE2","",0x2), 0x8082B0F8:("sSectionPositions","s16","[280]",0x230), @@ -4808,10 +4808,10 @@ 0x8082BB38:("D_8082BB38","UNK_PTR","",0x4), 0x8082BB50:("D_8082BB50","UNK_PTR","",0x4), 0x8082BB68:("D_8082BB68","UNK_TYPE2","",0x2), - 0x8082BB74:("D_8082BB74","UNK_TYPE2","",0x2), - 0x8082BBC4:("D_8082BBC4","UNK_TYPE2","",0x2), - 0x8082BC14:("D_8082BC14","UNK_TYPE2","",0x2), - 0x8082BC64:("D_8082BC64","UNK_TYPE2","",0x2), + 0x8082BB74:("sQuestVtxRectLeft","UNK_TYPE2","",0x2), + 0x8082BBC4:("sQuestVtxRectTop","UNK_TYPE2","",0x2), + 0x8082BC14:("sQuestVtxWidths","UNK_TYPE2","",0x2), + 0x8082BC64:("sQuestVtxHeights","UNK_TYPE2","",0x2), 0x8082BCB4:("D_8082BCB4","UNK_TYPE1","",0x1), 0x8082BCCC:("D_8082BCCC","UNK_TYPE1","",0x1), 0x8082BCDC:("D_8082BCDC","UNK_TYPE1","",0x1), diff --git a/tools/namefixer.py b/tools/namefixer.py index 4f596ecef..1aed5ead3 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -748,6 +748,7 @@ wordReplace = { "play->actorCtx.unk4": "play->actorCtx.lensMaskSize", "play->nextEntranceIndex": "play->nextEntrance", "play->sceneNum": "play->sceneId", + "play->pauseCtx.unk_1F0": "play->pauseCtx.bombersNotebookOpen", "gSaveContext.unk_3DC8": "gSaveContext.timerOsTime", "gSaveContext.unk_3DD0": "gSaveContext.timerStates", From 7204b0849838c0fa63b30591f9063a76c54307a7 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Thu, 13 Oct 2022 16:17:27 -0400 Subject: [PATCH 03/12] Rename audio context (#1114) --- include/variables.h | 4 +- include/z64audio.h | 2 +- src/code/audio/audio_effects.c | 2 +- src/code/audio/audio_heap.c | 564 ++++++++++++++--------------- src/code/audio/audio_init_params.c | 2 +- src/code/audio/audio_load.c | 558 ++++++++++++++-------------- src/code/audio/audio_playback.c | 118 +++--- src/code/audio/audio_seqplayer.c | 117 +++--- src/code/audio/audio_synthesis.c | 115 +++--- src/code/audio/code_8019AF00.c | 42 +-- src/code/audio/code_801A5BD0.c | 6 +- tools/disasm/variables.txt | 4 +- 12 files changed, 756 insertions(+), 778 deletions(-) diff --git a/include/variables.h b/include/variables.h index 1719d4c6f..5b40e1161 100644 --- a/include/variables.h +++ b/include/variables.h @@ -1186,7 +1186,7 @@ extern f32 gDefaultPanVolume[]; // extern UNK_TYPE1 D_801D5FD4; extern UNK_PTR D_801D5FE0; // extern UNK_TYPE1 D_801D5FE4; -extern s32 gAudioContextInitalized; +extern s32 gAudioCtxInitalized; // extern UNK_TYPE4 D_801D5FEC; // extern UNK_TYPE4 D_801D5FF0; // extern UNK_TYPE4 D_801D5FF4; @@ -3081,7 +3081,7 @@ extern ActiveSequence gActiveSeqs[]; // extern UNK_TYPE1 D_80200BCC; // extern UNK_TYPE1 D_80200BCE; // extern UNK_TYPE1 D_80200BD0; -extern AudioContext gAudioContext; // at 0x80200C70 +extern AudioContext gAudioCtx; // at 0x80200C70 extern void (*gCustomAudioUpdateFunction)(void); extern u32 (*gCustomAudioSeqFunction)(s8 value, SequenceChannel* channel); extern s32 (*gCustomAudioReverbFunction)(Sample*, s32, s8, s32); diff --git a/include/z64audio.h b/include/z64audio.h index 264e8d9e3..17f0e84f9 100644 --- a/include/z64audio.h +++ b/include/z64audio.h @@ -7,7 +7,7 @@ #define TATUMS_PER_BEAT 48 -#define IS_SEQUENCE_CHANNEL_VALID(ptr) ((uintptr_t)(ptr) != (uintptr_t)&gAudioContext.sequenceChannelNone) +#define IS_SEQUENCE_CHANNEL_VALID(ptr) ((uintptr_t)(ptr) != (uintptr_t)&gAudioCtx.sequenceChannelNone) #define SEQ_NUM_CHANNELS 16 #define SEQ_IO_VAL_NONE -1 diff --git a/src/code/audio/audio_effects.c b/src/code/audio/audio_effects.c index bc27a6e22..3f50f003c 100644 --- a/src/code/audio/audio_effects.c +++ b/src/code/audio/audio_effects.c @@ -268,7 +268,7 @@ f32 AudioEffects_AdsrUpdate(AdsrState* adsr) { break; default: - adsr->delay *= gAudioContext.audioBufferParameters.updatesPerFrameScaled; + adsr->delay *= gAudioCtx.audioBufferParameters.updatesPerFrameScaled; if (adsr->delay == 0) { adsr->delay = 1; } diff --git a/src/code/audio/audio_heap.c b/src/code/audio/audio_heap.c index 8412220a3..1c05e9441 100644 --- a/src/code/audio/audio_heap.c +++ b/src/code/audio/audio_heap.c @@ -20,7 +20,7 @@ void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 isFirst * i.e. (256.0f * `updatesPerFrameInvScaled`) is just `updatesPerFrameInv` */ f32 AudioHeap_CalculateAdsrDecay(f32 scaleInv) { - return 256.0f * gAudioContext.audioBufferParameters.updatesPerFrameInvScaled / scaleInv; + return 256.0f * gAudioCtx.audioBufferParameters.updatesPerFrameInvScaled / scaleInv; } /** @@ -29,45 +29,45 @@ f32 AudioHeap_CalculateAdsrDecay(f32 scaleInv) { void AudioHeap_InitAdsrDecayTable(void) { s32 i; - gAudioContext.adsrDecayTable[255] = AudioHeap_CalculateAdsrDecay(0.25f); - gAudioContext.adsrDecayTable[254] = AudioHeap_CalculateAdsrDecay(0.33f); - gAudioContext.adsrDecayTable[253] = AudioHeap_CalculateAdsrDecay(0.5f); - gAudioContext.adsrDecayTable[252] = AudioHeap_CalculateAdsrDecay(0.66f); - gAudioContext.adsrDecayTable[251] = AudioHeap_CalculateAdsrDecay(0.75f); + gAudioCtx.adsrDecayTable[255] = AudioHeap_CalculateAdsrDecay(0.25f); + gAudioCtx.adsrDecayTable[254] = AudioHeap_CalculateAdsrDecay(0.33f); + gAudioCtx.adsrDecayTable[253] = AudioHeap_CalculateAdsrDecay(0.5f); + gAudioCtx.adsrDecayTable[252] = AudioHeap_CalculateAdsrDecay(0.66f); + gAudioCtx.adsrDecayTable[251] = AudioHeap_CalculateAdsrDecay(0.75f); for (i = 128; i < 251; i++) { - gAudioContext.adsrDecayTable[i] = AudioHeap_CalculateAdsrDecay(251 - i); + gAudioCtx.adsrDecayTable[i] = AudioHeap_CalculateAdsrDecay(251 - i); } for (i = 16; i < 128; i++) { - gAudioContext.adsrDecayTable[i] = AudioHeap_CalculateAdsrDecay(4 * (143 - i)); + gAudioCtx.adsrDecayTable[i] = AudioHeap_CalculateAdsrDecay(4 * (143 - i)); } for (i = 1; i < 16; i++) { - gAudioContext.adsrDecayTable[i] = AudioHeap_CalculateAdsrDecay(60 * (23 - i)); + gAudioCtx.adsrDecayTable[i] = AudioHeap_CalculateAdsrDecay(60 * (23 - i)); } - gAudioContext.adsrDecayTable[0] = 0.0f; + gAudioCtx.adsrDecayTable[0] = 0.0f; } void AudioHeap_ResetLoadStatus(void) { s32 i; - for (i = 0; i < ARRAY_COUNT(gAudioContext.fontLoadStatus); i++) { - if (gAudioContext.fontLoadStatus[i] != LOAD_STATUS_PERMANENT) { - gAudioContext.fontLoadStatus[i] = LOAD_STATUS_NOT_LOADED; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.fontLoadStatus); i++) { + if (gAudioCtx.fontLoadStatus[i] != LOAD_STATUS_PERMANENT) { + gAudioCtx.fontLoadStatus[i] = LOAD_STATUS_NOT_LOADED; } } - for (i = 0; i < ARRAY_COUNT(gAudioContext.sampleFontLoadStatus); i++) { - if (gAudioContext.sampleFontLoadStatus[i] != LOAD_STATUS_PERMANENT) { - gAudioContext.sampleFontLoadStatus[i] = LOAD_STATUS_NOT_LOADED; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.sampleFontLoadStatus); i++) { + if (gAudioCtx.sampleFontLoadStatus[i] != LOAD_STATUS_PERMANENT) { + gAudioCtx.sampleFontLoadStatus[i] = LOAD_STATUS_NOT_LOADED; } } - for (i = 0; i < ARRAY_COUNT(gAudioContext.seqLoadStatus); i++) { - if (gAudioContext.seqLoadStatus[i] != LOAD_STATUS_PERMANENT) { - gAudioContext.seqLoadStatus[i] = LOAD_STATUS_NOT_LOADED; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.seqLoadStatus); i++) { + if (gAudioCtx.seqLoadStatus[i] != LOAD_STATUS_PERMANENT) { + gAudioCtx.seqLoadStatus[i] = LOAD_STATUS_NOT_LOADED; } } } @@ -75,8 +75,8 @@ void AudioHeap_ResetLoadStatus(void) { void AudioHeap_DiscardFont(s32 fontId) { s32 i; - for (i = 0; i < gAudioContext.numNotes; i++) { - Note* note = &gAudioContext.notes[i]; + for (i = 0; i < gAudioCtx.numNotes; i++) { + Note* note = &gAudioCtx.notes[i]; if (note->playbackState.fontId == fontId) { if ((note->playbackState.status == PLAYBACK_STATUS_0) && (note->playbackState.priority != 0)) { @@ -86,7 +86,7 @@ void AudioHeap_DiscardFont(s32 fontId) { AudioPlayback_NoteDisable(note); AudioPlayback_AudioListRemove(¬e->listItem); - AudioSeq_AudioListPushBack(&gAudioContext.noteFreeLists.disabled, ¬e->listItem); + AudioSeq_AudioListPushBack(&gAudioCtx.noteFreeLists.disabled, ¬e->listItem); } } } @@ -94,14 +94,14 @@ void AudioHeap_DiscardFont(s32 fontId) { void AudioHeap_ReleaseNotesForFont(s32 fontId) { s32 i; - for (i = 0; i < gAudioContext.numNotes; i++) { - Note* note = &gAudioContext.notes[i]; + for (i = 0; i < gAudioCtx.numNotes; i++) { + Note* note = &gAudioCtx.notes[i]; NotePlaybackState* playbackState = ¬e->playbackState; if (playbackState->fontId == fontId) { if (playbackState->priority != 0) { playbackState->priority = 1; - playbackState->adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv; + playbackState->adsr.fadeOutVel = gAudioCtx.audioBufferParameters.updatesPerFrameInv; playbackState->adsr.action.s.release = true; } } @@ -111,9 +111,9 @@ void AudioHeap_ReleaseNotesForFont(s32 fontId) { void AudioHeap_DiscardSequence(s32 seqId) { s32 i; - for (i = 0; i < gAudioContext.audioBufferParameters.numSequencePlayers; i++) { - if (gAudioContext.seqPlayers[i].enabled && gAudioContext.seqPlayers[i].seqId == seqId) { - AudioSeq_SequencePlayerDisable(&gAudioContext.seqPlayers[i]); + for (i = 0; i < gAudioCtx.audioBufferParameters.numSequencePlayers; i++) { + if (gAudioCtx.seqPlayers[i].enabled && gAudioCtx.seqPlayers[i].seqId == seqId) { + AudioSeq_SequencePlayerDisable(&gAudioCtx.seqPlayers[i]); } } } @@ -137,8 +137,8 @@ void* AudioHeap_WritebackDCache(void* addr, size_t size) { void* AudioHeap_AllocZeroedAttemptExternal(AudioAllocPool* pool, size_t size) { void* addr = NULL; - if (gAudioContext.externalPool.startAddr != NULL) { - addr = AudioHeap_AllocZeroed(&gAudioContext.externalPool, size); + if (gAudioCtx.externalPool.startAddr != NULL) { + addr = AudioHeap_AllocZeroed(&gAudioCtx.externalPool, size); } if (addr == NULL) { @@ -155,8 +155,8 @@ void* AudioHeap_AllocZeroedAttemptExternal(AudioAllocPool* pool, size_t size) { void* AudioHeap_AllocAttemptExternal(AudioAllocPool* pool, size_t size) { void* addr = NULL; - if (gAudioContext.externalPool.startAddr != NULL) { - addr = AudioHeap_Alloc(&gAudioContext.externalPool, size); + if (gAudioCtx.externalPool.startAddr != NULL) { + addr = AudioHeap_Alloc(&gAudioCtx.externalPool, size); } if (addr == NULL) { @@ -277,18 +277,18 @@ void AudioHeap_PopPersistentCache(s32 tableType) { switch (tableType) { case SEQUENCE_TABLE: - loadedCache = &gAudioContext.seqCache; - loadStatus = gAudioContext.seqLoadStatus; + loadedCache = &gAudioCtx.seqCache; + loadStatus = gAudioCtx.seqLoadStatus; break; case FONT_TABLE: - loadedCache = &gAudioContext.fontCache; - loadStatus = gAudioContext.fontLoadStatus; + loadedCache = &gAudioCtx.fontCache; + loadStatus = gAudioCtx.fontLoadStatus; break; case SAMPLE_TABLE: - loadedCache = &gAudioContext.sampleBankCache; - loadStatus = gAudioContext.sampleFontLoadStatus; + loadedCache = &gAudioCtx.sampleBankCache; + loadStatus = gAudioCtx.sampleFontLoadStatus; break; } @@ -315,64 +315,63 @@ void AudioHeap_PopPersistentCache(s32 tableType) { } void AudioHeap_InitMainPool(size_t initPoolSize) { - AudioHeap_InitPool(&gAudioContext.initPool, gAudioContext.audioHeap, initPoolSize); - AudioHeap_InitPool(&gAudioContext.sessionPool, gAudioContext.audioHeap + initPoolSize, - gAudioContext.audioHeapSize - initPoolSize); + AudioHeap_InitPool(&gAudioCtx.initPool, gAudioCtx.audioHeap, initPoolSize); + AudioHeap_InitPool(&gAudioCtx.sessionPool, gAudioCtx.audioHeap + initPoolSize, + gAudioCtx.audioHeapSize - initPoolSize); - gAudioContext.externalPool.startAddr = NULL; + gAudioCtx.externalPool.startAddr = NULL; } void AudioHeap_InitSessionPool(AudioSessionPoolSplit* split) { - gAudioContext.sessionPool.curAddr = gAudioContext.sessionPool.startAddr; + gAudioCtx.sessionPool.curAddr = gAudioCtx.sessionPool.startAddr; - AudioHeap_InitPool(&gAudioContext.miscPool, AudioHeap_Alloc(&gAudioContext.sessionPool, split->miscPoolSize), + AudioHeap_InitPool(&gAudioCtx.miscPool, AudioHeap_Alloc(&gAudioCtx.sessionPool, split->miscPoolSize), split->miscPoolSize); - AudioHeap_InitPool(&gAudioContext.cachePool, AudioHeap_Alloc(&gAudioContext.sessionPool, split->cachePoolSize), + AudioHeap_InitPool(&gAudioCtx.cachePool, AudioHeap_Alloc(&gAudioCtx.sessionPool, split->cachePoolSize), split->cachePoolSize); } void AudioHeap_InitCachePool(AudioCachePoolSplit* split) { - gAudioContext.cachePool.curAddr = gAudioContext.cachePool.startAddr; + gAudioCtx.cachePool.curAddr = gAudioCtx.cachePool.startAddr; - AudioHeap_InitPool(&gAudioContext.persistentCommonPool, - AudioHeap_Alloc(&gAudioContext.cachePool, split->persistentCommonPoolSize), + AudioHeap_InitPool(&gAudioCtx.persistentCommonPool, + AudioHeap_Alloc(&gAudioCtx.cachePool, split->persistentCommonPoolSize), split->persistentCommonPoolSize); - AudioHeap_InitPool(&gAudioContext.temporaryCommonPool, - AudioHeap_Alloc(&gAudioContext.cachePool, split->temporaryCommonPoolSize), + AudioHeap_InitPool(&gAudioCtx.temporaryCommonPool, + AudioHeap_Alloc(&gAudioCtx.cachePool, split->temporaryCommonPoolSize), split->temporaryCommonPoolSize); } void AudioHeap_InitPersistentPoolsAndCaches(AudioCommonPoolSplit* split) { - gAudioContext.persistentCommonPool.curAddr = gAudioContext.persistentCommonPool.startAddr; + gAudioCtx.persistentCommonPool.curAddr = gAudioCtx.persistentCommonPool.startAddr; - AudioHeap_InitPool(&gAudioContext.seqCache.persistent.pool, - AudioHeap_Alloc(&gAudioContext.persistentCommonPool, split->seqCacheSize), split->seqCacheSize); - AudioHeap_InitPool(&gAudioContext.fontCache.persistent.pool, - AudioHeap_Alloc(&gAudioContext.persistentCommonPool, split->fontCacheSize), - split->fontCacheSize); - AudioHeap_InitPool(&gAudioContext.sampleBankCache.persistent.pool, - AudioHeap_Alloc(&gAudioContext.persistentCommonPool, split->sampleBankCacheSize), + AudioHeap_InitPool(&gAudioCtx.seqCache.persistent.pool, + AudioHeap_Alloc(&gAudioCtx.persistentCommonPool, split->seqCacheSize), split->seqCacheSize); + AudioHeap_InitPool(&gAudioCtx.fontCache.persistent.pool, + AudioHeap_Alloc(&gAudioCtx.persistentCommonPool, split->fontCacheSize), split->fontCacheSize); + AudioHeap_InitPool(&gAudioCtx.sampleBankCache.persistent.pool, + AudioHeap_Alloc(&gAudioCtx.persistentCommonPool, split->sampleBankCacheSize), split->sampleBankCacheSize); - AudioHeap_InitPersistentCache(&gAudioContext.seqCache.persistent); - AudioHeap_InitPersistentCache(&gAudioContext.fontCache.persistent); - AudioHeap_InitPersistentCache(&gAudioContext.sampleBankCache.persistent); + AudioHeap_InitPersistentCache(&gAudioCtx.seqCache.persistent); + AudioHeap_InitPersistentCache(&gAudioCtx.fontCache.persistent); + AudioHeap_InitPersistentCache(&gAudioCtx.sampleBankCache.persistent); } void AudioHeap_InitTemporaryPoolsAndCaches(AudioCommonPoolSplit* split) { - gAudioContext.temporaryCommonPool.curAddr = gAudioContext.temporaryCommonPool.startAddr; + gAudioCtx.temporaryCommonPool.curAddr = gAudioCtx.temporaryCommonPool.startAddr; - AudioHeap_InitPool(&gAudioContext.seqCache.temporary.pool, - AudioHeap_Alloc(&gAudioContext.temporaryCommonPool, split->seqCacheSize), split->seqCacheSize); - AudioHeap_InitPool(&gAudioContext.fontCache.temporary.pool, - AudioHeap_Alloc(&gAudioContext.temporaryCommonPool, split->fontCacheSize), split->fontCacheSize); - AudioHeap_InitPool(&gAudioContext.sampleBankCache.temporary.pool, - AudioHeap_Alloc(&gAudioContext.temporaryCommonPool, split->sampleBankCacheSize), + AudioHeap_InitPool(&gAudioCtx.seqCache.temporary.pool, + AudioHeap_Alloc(&gAudioCtx.temporaryCommonPool, split->seqCacheSize), split->seqCacheSize); + AudioHeap_InitPool(&gAudioCtx.fontCache.temporary.pool, + AudioHeap_Alloc(&gAudioCtx.temporaryCommonPool, split->fontCacheSize), split->fontCacheSize); + AudioHeap_InitPool(&gAudioCtx.sampleBankCache.temporary.pool, + AudioHeap_Alloc(&gAudioCtx.temporaryCommonPool, split->sampleBankCacheSize), split->sampleBankCacheSize); - AudioHeap_InitTemporaryCache(&gAudioContext.seqCache.temporary); - AudioHeap_InitTemporaryCache(&gAudioContext.fontCache.temporary); - AudioHeap_InitTemporaryCache(&gAudioContext.sampleBankCache.temporary); + AudioHeap_InitTemporaryCache(&gAudioCtx.seqCache.temporary); + AudioHeap_InitTemporaryCache(&gAudioCtx.fontCache.temporary); + AudioHeap_InitTemporaryCache(&gAudioCtx.sampleBankCache.temporary); } void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) { @@ -389,18 +388,18 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) { switch (tableType) { case SEQUENCE_TABLE: - loadedCache = &gAudioContext.seqCache; - loadStatus = gAudioContext.seqLoadStatus; + loadedCache = &gAudioCtx.seqCache; + loadStatus = gAudioCtx.seqLoadStatus; break; case FONT_TABLE: - loadedCache = &gAudioContext.fontCache; - loadStatus = gAudioContext.fontLoadStatus; + loadedCache = &gAudioCtx.fontCache; + loadStatus = gAudioCtx.fontLoadStatus; break; case SAMPLE_TABLE: - loadedCache = &gAudioContext.sampleBankCache; - loadStatus = gAudioContext.sampleFontLoadStatus; + loadedCache = &gAudioCtx.sampleBankCache; + loadStatus = gAudioCtx.sampleFontLoadStatus; break; } @@ -419,28 +418,28 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) { if (tableType == FONT_TABLE) { if (loadStatusEntry0 == LOAD_STATUS_MAYBE_DISCARDABLE) { - for (i = 0; i < gAudioContext.numNotes; i++) { - if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[0].id) && - gAudioContext.notes[i].sampleState.bitField0.enabled) { + for (i = 0; i < gAudioCtx.numNotes; i++) { + if ((gAudioCtx.notes[i].playbackState.fontId == temporaryCache->entries[0].id) && + gAudioCtx.notes[i].sampleState.bitField0.enabled) { break; } } - if (i == gAudioContext.numNotes) { + if (i == gAudioCtx.numNotes) { AudioLoad_SetFontLoadStatus(temporaryCache->entries[0].id, LOAD_STATUS_DISCARDABLE); loadStatusEntry0 = LOAD_STATUS_DISCARDABLE; } } if (loadStatusEntry1 == LOAD_STATUS_MAYBE_DISCARDABLE) { - for (i = 0; i < gAudioContext.numNotes; i++) { - if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[1].id) && - gAudioContext.notes[i].sampleState.bitField0.enabled) { + for (i = 0; i < gAudioCtx.numNotes; i++) { + if ((gAudioCtx.notes[i].playbackState.fontId == temporaryCache->entries[1].id) && + gAudioCtx.notes[i].sampleState.bitField0.enabled) { break; } } - if (i == gAudioContext.numNotes) { + if (i == gAudioCtx.numNotes) { AudioLoad_SetFontLoadStatus(temporaryCache->entries[1].id, LOAD_STATUS_DISCARDABLE); loadStatusEntry1 = LOAD_STATUS_DISCARDABLE; } @@ -461,54 +460,54 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) { // Check if there is a side which isn't in active use, if so, evict that one. if (tableType == SEQUENCE_TABLE) { if (loadStatusEntry0 == LOAD_STATUS_COMPLETE) { - for (i = 0; i < gAudioContext.audioBufferParameters.numSequencePlayers; i++) { - if (gAudioContext.seqPlayers[i].enabled && - gAudioContext.seqPlayers[i].seqId == temporaryCache->entries[0].id) { + for (i = 0; i < gAudioCtx.audioBufferParameters.numSequencePlayers; i++) { + if (gAudioCtx.seqPlayers[i].enabled && + gAudioCtx.seqPlayers[i].seqId == temporaryCache->entries[0].id) { break; } } - if (i == gAudioContext.audioBufferParameters.numSequencePlayers) { + if (i == gAudioCtx.audioBufferParameters.numSequencePlayers) { temporaryCache->nextSide = 0; goto done; } } if (loadStatusEntry1 == LOAD_STATUS_COMPLETE) { - for (i = 0; i < gAudioContext.audioBufferParameters.numSequencePlayers; i++) { - if (gAudioContext.seqPlayers[i].enabled && - gAudioContext.seqPlayers[i].seqId == temporaryCache->entries[1].id) { + for (i = 0; i < gAudioCtx.audioBufferParameters.numSequencePlayers; i++) { + if (gAudioCtx.seqPlayers[i].enabled && + gAudioCtx.seqPlayers[i].seqId == temporaryCache->entries[1].id) { break; } } - if (i == gAudioContext.audioBufferParameters.numSequencePlayers) { + if (i == gAudioCtx.audioBufferParameters.numSequencePlayers) { temporaryCache->nextSide = 1; goto done; } } } else if (tableType == FONT_TABLE) { if (loadStatusEntry0 == LOAD_STATUS_COMPLETE) { - for (i = 0; i < gAudioContext.numNotes; i++) { - if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[0].id) && - gAudioContext.notes[i].sampleState.bitField0.enabled) { + for (i = 0; i < gAudioCtx.numNotes; i++) { + if ((gAudioCtx.notes[i].playbackState.fontId == temporaryCache->entries[0].id) && + gAudioCtx.notes[i].sampleState.bitField0.enabled) { break; } } - if (i == gAudioContext.numNotes) { + if (i == gAudioCtx.numNotes) { temporaryCache->nextSide = 0; goto done; } } if (loadStatusEntry1 == LOAD_STATUS_COMPLETE) { - for (i = 0; i < gAudioContext.numNotes; i++) { - if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[1].id) && - gAudioContext.notes[i].sampleState.bitField0.enabled) { + for (i = 0; i < gAudioCtx.numNotes; i++) { + if ((gAudioCtx.notes[i].playbackState.fontId == temporaryCache->entries[1].id) && + gAudioCtx.notes[i].sampleState.bitField0.enabled) { break; } } - if (i == gAudioContext.numNotes) { + if (i == gAudioCtx.numNotes) { temporaryCache->nextSide = 1; goto done; } @@ -667,15 +666,15 @@ void* AudioHeap_SearchRegularCaches(s32 tableType, s32 cache, s32 id) { switch (tableType) { case SEQUENCE_TABLE: - loadedCache = &gAudioContext.seqCache; + loadedCache = &gAudioCtx.seqCache; break; case FONT_TABLE: - loadedCache = &gAudioContext.fontCache; + loadedCache = &gAudioCtx.fontCache; break; case SAMPLE_TABLE: - loadedCache = &gAudioContext.sampleBankCache; + loadedCache = &gAudioCtx.sampleBankCache; break; } @@ -817,15 +816,15 @@ void AudioHeap_UpdateReverbs(void) { s32 reverbIndex; s32 j; - if (gAudioContext.audioBufferParameters.specUnk4 == 2) { + if (gAudioCtx.audioBufferParameters.specUnk4 == 2) { count = 2; } else { count = 1; } - for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) { + for (reverbIndex = 0; reverbIndex < gAudioCtx.numSynthesisReverbs; reverbIndex++) { for (j = 0; j < count; j++) { - AudioHeap_UpdateReverb(&gAudioContext.synthesisReverbs[reverbIndex]); + AudioHeap_UpdateReverb(&gAudioCtx.synthesisReverbs[reverbIndex]); } } } @@ -834,13 +833,13 @@ void AudioHeap_UpdateReverbs(void) { * Clear the Audio Interface Buffers */ void AudioHeap_ClearAiBuffers(void) { - s32 curAiBufferIndex = gAudioContext.curAiBufferIndex; + s32 curAiBufferIndex = gAudioCtx.curAiBufferIndex; s32 i; - gAudioContext.aiBufNumSamples[curAiBufferIndex] = gAudioContext.audioBufferParameters.numSamplesPerFrameMin; + gAudioCtx.aiBufNumSamples[curAiBufferIndex] = gAudioCtx.audioBufferParameters.numSamplesPerFrameMin; for (i = 0; i < AIBUF_LEN; i++) { - gAudioContext.aiBuffers[curAiBufferIndex][i] = 0; + gAudioCtx.aiBuffers[curAiBufferIndex][i] = 0; } } @@ -849,55 +848,55 @@ s32 AudioHeap_ResetStep(void) { s32 j; s32 count; - if (gAudioContext.audioBufferParameters.specUnk4 == 2) { + if (gAudioCtx.audioBufferParameters.specUnk4 == 2) { count = 2; } else { count = 1; } - switch (gAudioContext.resetStatus) { + switch (gAudioCtx.resetStatus) { case 5: - for (i = 0; i < gAudioContext.audioBufferParameters.numSequencePlayers; i++) { - AudioSeq_SequencePlayerDisableAsFinished(&gAudioContext.seqPlayers[i]); + for (i = 0; i < gAudioCtx.audioBufferParameters.numSequencePlayers; i++) { + AudioSeq_SequencePlayerDisableAsFinished(&gAudioCtx.seqPlayers[i]); } - gAudioContext.audioResetFadeOutFramesLeft = 2 / count; - gAudioContext.resetStatus--; + gAudioCtx.audioResetFadeOutFramesLeft = 2 / count; + gAudioCtx.resetStatus--; break; case 4: - if (gAudioContext.audioResetFadeOutFramesLeft != 0) { - gAudioContext.audioResetFadeOutFramesLeft--; + if (gAudioCtx.audioResetFadeOutFramesLeft != 0) { + gAudioCtx.audioResetFadeOutFramesLeft--; AudioHeap_UpdateReverbs(); } else { - for (i = 0; i < gAudioContext.numNotes; i++) { - if (gAudioContext.notes[i].sampleState.bitField0.enabled && - gAudioContext.notes[i].playbackState.adsr.action.s.state != ADSR_STATE_DISABLED) { - gAudioContext.notes[i].playbackState.adsr.fadeOutVel = - gAudioContext.audioBufferParameters.updatesPerFrameInv; - gAudioContext.notes[i].playbackState.adsr.action.s.release = true; + for (i = 0; i < gAudioCtx.numNotes; i++) { + if (gAudioCtx.notes[i].sampleState.bitField0.enabled && + gAudioCtx.notes[i].playbackState.adsr.action.s.state != ADSR_STATE_DISABLED) { + gAudioCtx.notes[i].playbackState.adsr.fadeOutVel = + gAudioCtx.audioBufferParameters.updatesPerFrameInv; + gAudioCtx.notes[i].playbackState.adsr.action.s.release = true; } } - gAudioContext.audioResetFadeOutFramesLeft = 8 / count; - gAudioContext.resetStatus--; + gAudioCtx.audioResetFadeOutFramesLeft = 8 / count; + gAudioCtx.resetStatus--; } break; case 3: - if (gAudioContext.audioResetFadeOutFramesLeft != 0) { - gAudioContext.audioResetFadeOutFramesLeft--; + if (gAudioCtx.audioResetFadeOutFramesLeft != 0) { + gAudioCtx.audioResetFadeOutFramesLeft--; AudioHeap_UpdateReverbs(); } else { - gAudioContext.audioResetFadeOutFramesLeft = 2 / count; - gAudioContext.resetStatus--; + gAudioCtx.audioResetFadeOutFramesLeft = 2 / count; + gAudioCtx.resetStatus--; } break; case 2: AudioHeap_ClearAiBuffers(); - if (gAudioContext.audioResetFadeOutFramesLeft != 0) { - gAudioContext.audioResetFadeOutFramesLeft--; + if (gAudioCtx.audioResetFadeOutFramesLeft != 0) { + gAudioCtx.audioResetFadeOutFramesLeft--; } else { - gAudioContext.resetStatus--; + gAudioCtx.resetStatus--; AudioHeap_DiscardSampleCaches(); AudioHeap_DiscardSampleBanks(); } @@ -905,17 +904,17 @@ s32 AudioHeap_ResetStep(void) { case 1: AudioHeap_Init(); - gAudioContext.resetStatus = 0; - for (i = 0; i < ARRAY_COUNT(gAudioContext.aiBufNumSamples); i++) { - gAudioContext.aiBufNumSamples[i] = gAudioContext.audioBufferParameters.numSamplesPerFrameMax; + gAudioCtx.resetStatus = 0; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.aiBufNumSamples); i++) { + gAudioCtx.aiBufNumSamples[i] = gAudioCtx.audioBufferParameters.numSamplesPerFrameMax; for (j = 0; j < AIBUF_LEN; j++) { - gAudioContext.aiBuffers[i][j] = 0; + gAudioCtx.aiBuffers[i][j] = 0; } } break; } - if (gAudioContext.resetStatus < 3) { + if (gAudioCtx.resetStatus < 3) { return false; } @@ -933,72 +932,67 @@ void AudioHeap_Init(void) { s32 reverbIndex; s32 i; s32 pad2; - AudioSpec* spec = &gAudioSpecs[gAudioContext.audioResetSpecIdToLoad]; // Audio Specifications + AudioSpec* spec = &gAudioSpecs[gAudioCtx.audioResetSpecIdToLoad]; // Audio Specifications - gAudioContext.sampleDmaCount = 0; + gAudioCtx.sampleDmaCount = 0; // audio buffer parameters - gAudioContext.audioBufferParameters.samplingFreq = spec->samplingFreq; - gAudioContext.audioBufferParameters.aiSamplingFreq = - osAiSetFrequency(gAudioContext.audioBufferParameters.samplingFreq); + gAudioCtx.audioBufferParameters.samplingFreq = spec->samplingFreq; + gAudioCtx.audioBufferParameters.aiSamplingFreq = osAiSetFrequency(gAudioCtx.audioBufferParameters.samplingFreq); - gAudioContext.audioBufferParameters.numSamplesPerFrameTarget = - ALIGN16(gAudioContext.audioBufferParameters.samplingFreq / gAudioContext.refreshRate); - gAudioContext.audioBufferParameters.numSamplesPerFrameMin = - gAudioContext.audioBufferParameters.numSamplesPerFrameTarget - 0x10; - gAudioContext.audioBufferParameters.numSamplesPerFrameMax = - gAudioContext.audioBufferParameters.numSamplesPerFrameTarget + 0x10; - gAudioContext.audioBufferParameters.updatesPerFrame = - ((gAudioContext.audioBufferParameters.numSamplesPerFrameTarget + 0x10) / 0xD0) + 1; - gAudioContext.audioBufferParameters.numSamplesPerUpdate = - (gAudioContext.audioBufferParameters.numSamplesPerFrameTarget / - gAudioContext.audioBufferParameters.updatesPerFrame) & + gAudioCtx.audioBufferParameters.numSamplesPerFrameTarget = + ALIGN16(gAudioCtx.audioBufferParameters.samplingFreq / gAudioCtx.refreshRate); + gAudioCtx.audioBufferParameters.numSamplesPerFrameMin = + gAudioCtx.audioBufferParameters.numSamplesPerFrameTarget - 0x10; + gAudioCtx.audioBufferParameters.numSamplesPerFrameMax = + gAudioCtx.audioBufferParameters.numSamplesPerFrameTarget + 0x10; + gAudioCtx.audioBufferParameters.updatesPerFrame = + ((gAudioCtx.audioBufferParameters.numSamplesPerFrameTarget + 0x10) / 0xD0) + 1; + gAudioCtx.audioBufferParameters.numSamplesPerUpdate = + (gAudioCtx.audioBufferParameters.numSamplesPerFrameTarget / gAudioCtx.audioBufferParameters.updatesPerFrame) & ~7; - gAudioContext.audioBufferParameters.numSamplesPerUpdateMax = - gAudioContext.audioBufferParameters.numSamplesPerUpdate + 8; - gAudioContext.audioBufferParameters.numSamplesPerUpdateMin = - gAudioContext.audioBufferParameters.numSamplesPerUpdate - 8; - gAudioContext.audioBufferParameters.resampleRate = 32000.0f / (s32)gAudioContext.audioBufferParameters.samplingFreq; - gAudioContext.audioBufferParameters.updatesPerFrameInvScaled = - (1.0f / 256.0f) / gAudioContext.audioBufferParameters.updatesPerFrame; - gAudioContext.audioBufferParameters.updatesPerFrameScaled = - gAudioContext.audioBufferParameters.updatesPerFrame / 4.0f; - gAudioContext.audioBufferParameters.updatesPerFrameInv = 1.0f / gAudioContext.audioBufferParameters.updatesPerFrame; + gAudioCtx.audioBufferParameters.numSamplesPerUpdateMax = gAudioCtx.audioBufferParameters.numSamplesPerUpdate + 8; + gAudioCtx.audioBufferParameters.numSamplesPerUpdateMin = gAudioCtx.audioBufferParameters.numSamplesPerUpdate - 8; + gAudioCtx.audioBufferParameters.resampleRate = 32000.0f / (s32)gAudioCtx.audioBufferParameters.samplingFreq; + gAudioCtx.audioBufferParameters.updatesPerFrameInvScaled = + (1.0f / 256.0f) / gAudioCtx.audioBufferParameters.updatesPerFrame; + gAudioCtx.audioBufferParameters.updatesPerFrameScaled = gAudioCtx.audioBufferParameters.updatesPerFrame / 4.0f; + gAudioCtx.audioBufferParameters.updatesPerFrameInv = 1.0f / gAudioCtx.audioBufferParameters.updatesPerFrame; // sample dma size - gAudioContext.sampleDmaBufSize1 = spec->sampleDmaBufSize1; - gAudioContext.sampleDmaBufSize2 = spec->sampleDmaBufSize2; + gAudioCtx.sampleDmaBufSize1 = spec->sampleDmaBufSize1; + gAudioCtx.sampleDmaBufSize2 = spec->sampleDmaBufSize2; - gAudioContext.numNotes = spec->numNotes; - gAudioContext.audioBufferParameters.numSequencePlayers = spec->numSequencePlayers; + gAudioCtx.numNotes = spec->numNotes; + gAudioCtx.audioBufferParameters.numSequencePlayers = spec->numSequencePlayers; - if (gAudioContext.audioBufferParameters.numSequencePlayers > 5) { - gAudioContext.audioBufferParameters.numSequencePlayers = 5; + if (gAudioCtx.audioBufferParameters.numSequencePlayers > 5) { + gAudioCtx.audioBufferParameters.numSequencePlayers = 5; } - gAudioContext.unk_29BC = 8; - gAudioContext.unk_2 = spec->unk_14; - gAudioContext.tempoInternalToExternal = (u32)(gAudioContext.audioBufferParameters.updatesPerFrame * 2880000.0f / - gTatumsPerBeat / gAudioContext.unk_2960); + gAudioCtx.unk_29BC = 8; + gAudioCtx.unk_2 = spec->unk_14; + gAudioCtx.tempoInternalToExternal = + (u32)(gAudioCtx.audioBufferParameters.updatesPerFrame * 2880000.0f / gTatumsPerBeat / gAudioCtx.unk_2960); - gAudioContext.unk_2870 = gAudioContext.refreshRate; - gAudioContext.unk_2870 *= gAudioContext.audioBufferParameters.updatesPerFrame; - gAudioContext.unk_2870 /= gAudioContext.audioBufferParameters.aiSamplingFreq; - gAudioContext.unk_2870 /= gAudioContext.tempoInternalToExternal; + gAudioCtx.unk_2870 = gAudioCtx.refreshRate; + gAudioCtx.unk_2870 *= gAudioCtx.audioBufferParameters.updatesPerFrame; + gAudioCtx.unk_2870 /= gAudioCtx.audioBufferParameters.aiSamplingFreq; + gAudioCtx.unk_2870 /= gAudioCtx.tempoInternalToExternal; - gAudioContext.audioBufferParameters.specUnk4 = spec->unk_04; - gAudioContext.audioBufferParameters.numSamplesPerFrameTarget *= gAudioContext.audioBufferParameters.specUnk4; - gAudioContext.audioBufferParameters.numSamplesPerFrameMax *= gAudioContext.audioBufferParameters.specUnk4; - gAudioContext.audioBufferParameters.numSamplesPerFrameMin *= gAudioContext.audioBufferParameters.specUnk4; - gAudioContext.audioBufferParameters.updatesPerFrame *= gAudioContext.audioBufferParameters.specUnk4; + gAudioCtx.audioBufferParameters.specUnk4 = spec->unk_04; + gAudioCtx.audioBufferParameters.numSamplesPerFrameTarget *= gAudioCtx.audioBufferParameters.specUnk4; + gAudioCtx.audioBufferParameters.numSamplesPerFrameMax *= gAudioCtx.audioBufferParameters.specUnk4; + gAudioCtx.audioBufferParameters.numSamplesPerFrameMin *= gAudioCtx.audioBufferParameters.specUnk4; + gAudioCtx.audioBufferParameters.updatesPerFrame *= gAudioCtx.audioBufferParameters.specUnk4; - if (gAudioContext.audioBufferParameters.specUnk4 >= 2) { - gAudioContext.audioBufferParameters.numSamplesPerFrameMax -= 0x10; + if (gAudioCtx.audioBufferParameters.specUnk4 >= 2) { + gAudioCtx.audioBufferParameters.numSamplesPerFrameMax -= 0x10; } // Determine the maximum allowable number of audio command list entries for the rsp microcode - gAudioContext.maxAudioCmds = - gAudioContext.numNotes * 20 * gAudioContext.audioBufferParameters.updatesPerFrame + spec->numReverbs * 30 + 800; + gAudioCtx.maxAudioCmds = + gAudioCtx.numNotes * 20 * gAudioCtx.audioBufferParameters.updatesPerFrame + spec->numReverbs * 30 + 800; // Calculate sizes for various caches on the audio heap persistentSize = @@ -1006,81 +1000,81 @@ void AudioHeap_Init(void) { temporarySize = spec->temporarySeqCacheSize + spec->temporaryFontCacheSize + spec->temporarySampleBankCacheSize + 0x10; cachePoolSize = persistentSize + temporarySize; - miscPoolSize = gAudioContext.sessionPool.size - cachePoolSize - 0x100; + miscPoolSize = gAudioCtx.sessionPool.size - cachePoolSize - 0x100; - if (gAudioContext.externalPool.startAddr != NULL) { - gAudioContext.externalPool.curAddr = gAudioContext.externalPool.startAddr; + if (gAudioCtx.externalPool.startAddr != NULL) { + gAudioCtx.externalPool.curAddr = gAudioCtx.externalPool.startAddr; } // Session Pool Split (split into Cache and Misc heaps) - gAudioContext.sessionPoolSplit.miscPoolSize = miscPoolSize; - gAudioContext.sessionPoolSplit.cachePoolSize = cachePoolSize; - AudioHeap_InitSessionPool(&gAudioContext.sessionPoolSplit); + gAudioCtx.sessionPoolSplit.miscPoolSize = miscPoolSize; + gAudioCtx.sessionPoolSplit.cachePoolSize = cachePoolSize; + AudioHeap_InitSessionPool(&gAudioCtx.sessionPoolSplit); // Cache Pool Split (Split into Persistent and Temporary heaps) - gAudioContext.cachePoolSplit.persistentCommonPoolSize = persistentSize; - gAudioContext.cachePoolSplit.temporaryCommonPoolSize = temporarySize; - AudioHeap_InitCachePool(&gAudioContext.cachePoolSplit); + gAudioCtx.cachePoolSplit.persistentCommonPoolSize = persistentSize; + gAudioCtx.cachePoolSplit.temporaryCommonPoolSize = temporarySize; + AudioHeap_InitCachePool(&gAudioCtx.cachePoolSplit); // Persistent Pool Split (Split into Sequences, SoundFonts, Samples) - gAudioContext.persistentCommonPoolSplit.seqCacheSize = spec->persistentSeqCacheSize; - gAudioContext.persistentCommonPoolSplit.fontCacheSize = spec->persistentFontCacheSize; - gAudioContext.persistentCommonPoolSplit.sampleBankCacheSize = spec->persistentSampleBankCacheSize; - AudioHeap_InitPersistentPoolsAndCaches(&gAudioContext.persistentCommonPoolSplit); + gAudioCtx.persistentCommonPoolSplit.seqCacheSize = spec->persistentSeqCacheSize; + gAudioCtx.persistentCommonPoolSplit.fontCacheSize = spec->persistentFontCacheSize; + gAudioCtx.persistentCommonPoolSplit.sampleBankCacheSize = spec->persistentSampleBankCacheSize; + AudioHeap_InitPersistentPoolsAndCaches(&gAudioCtx.persistentCommonPoolSplit); // Temporary Pool Split (Split into Sequences, SoundFonts, Samples) - gAudioContext.temporaryCommonPoolSplit.seqCacheSize = spec->temporarySeqCacheSize; - gAudioContext.temporaryCommonPoolSplit.fontCacheSize = spec->temporaryFontCacheSize; - gAudioContext.temporaryCommonPoolSplit.sampleBankCacheSize = spec->temporarySampleBankCacheSize; - AudioHeap_InitTemporaryPoolsAndCaches(&gAudioContext.temporaryCommonPoolSplit); + gAudioCtx.temporaryCommonPoolSplit.seqCacheSize = spec->temporarySeqCacheSize; + gAudioCtx.temporaryCommonPoolSplit.fontCacheSize = spec->temporaryFontCacheSize; + gAudioCtx.temporaryCommonPoolSplit.sampleBankCacheSize = spec->temporarySampleBankCacheSize; + AudioHeap_InitTemporaryPoolsAndCaches(&gAudioCtx.temporaryCommonPoolSplit); AudioHeap_ResetLoadStatus(); // Initialize notes - gAudioContext.notes = AudioHeap_AllocZeroed(&gAudioContext.miscPool, gAudioContext.numNotes * sizeof(Note)); + gAudioCtx.notes = AudioHeap_AllocZeroed(&gAudioCtx.miscPool, gAudioCtx.numNotes * sizeof(Note)); AudioPlayback_NoteInitAll(); AudioPlayback_InitNoteFreeList(); - gAudioContext.sampleStateList = - AudioHeap_AllocZeroed(&gAudioContext.miscPool, gAudioContext.audioBufferParameters.updatesPerFrame * - gAudioContext.numNotes * sizeof(NoteSampleState)); + gAudioCtx.sampleStateList = + AudioHeap_AllocZeroed(&gAudioCtx.miscPool, gAudioCtx.audioBufferParameters.updatesPerFrame * + gAudioCtx.numNotes * sizeof(NoteSampleState)); // Initialize audio binary interface command list buffer - for (i = 0; i < ARRAY_COUNT(gAudioContext.abiCmdBufs); i++) { - gAudioContext.abiCmdBufs[i] = - AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool, gAudioContext.maxAudioCmds * sizeof(Acmd)); + for (i = 0; i < ARRAY_COUNT(gAudioCtx.abiCmdBufs); i++) { + gAudioCtx.abiCmdBufs[i] = + AudioHeap_AllocDmaMemoryZeroed(&gAudioCtx.miscPool, gAudioCtx.maxAudioCmds * sizeof(Acmd)); } // Initialize the decay rate table for ADSR - gAudioContext.adsrDecayTable = AudioHeap_Alloc(&gAudioContext.miscPool, 0x100 * sizeof(f32)); + gAudioCtx.adsrDecayTable = AudioHeap_Alloc(&gAudioCtx.miscPool, 0x100 * sizeof(f32)); AudioHeap_InitAdsrDecayTable(); // Initialize reverbs - for (reverbIndex = 0; reverbIndex < ARRAY_COUNT(gAudioContext.synthesisReverbs); reverbIndex++) { - gAudioContext.synthesisReverbs[reverbIndex].useReverb = 0; + for (reverbIndex = 0; reverbIndex < ARRAY_COUNT(gAudioCtx.synthesisReverbs); reverbIndex++) { + gAudioCtx.synthesisReverbs[reverbIndex].useReverb = 0; } - gAudioContext.numSynthesisReverbs = spec->numReverbs; - for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) { + gAudioCtx.numSynthesisReverbs = spec->numReverbs; + for (reverbIndex = 0; reverbIndex < gAudioCtx.numSynthesisReverbs; reverbIndex++) { AudioHeap_InitReverb(reverbIndex, &spec->reverbSettings[reverbIndex], true); } // Initialize sequence players AudioSeq_InitSequencePlayers(); - for (i = 0; i < gAudioContext.audioBufferParameters.numSequencePlayers; i++) { + for (i = 0; i < gAudioCtx.audioBufferParameters.numSequencePlayers; i++) { AudioSeq_InitSequencePlayerChannels(i); - AudioSeq_ResetSequencePlayer(&gAudioContext.seqPlayers[i]); + AudioSeq_ResetSequencePlayer(&gAudioCtx.seqPlayers[i]); } // Initialize two additional caches on the audio heap to store individual audio samples AudioHeap_InitSampleCaches(spec->persistentSampleCacheSize, spec->temporarySampleCacheSize); - AudioLoad_InitSampleDmaBuffers(gAudioContext.numNotes); + AudioLoad_InitSampleDmaBuffers(gAudioCtx.numNotes); // Initalize Loads - gAudioContext.preloadSampleStackTop = 0; + gAudioCtx.preloadSampleStackTop = 0; AudioLoad_InitSlowLoads(); AudioLoad_InitScriptLoads(); AudioLoad_InitAsyncLoads(); - gAudioContext.unk_4 = 0x1000; + gAudioCtx.unk_4 = 0x1000; AudioLoad_LoadPermanentSamples(); intMask = osSetIntMask(1); @@ -1091,9 +1085,9 @@ void AudioHeap_Init(void) { void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id) { s32 i; - for (i = 0; i < gAudioContext.permanentPool.count; i++) { - if (gAudioContext.permanentEntries[i].tableType == tableType && gAudioContext.permanentEntries[i].id == id) { - return gAudioContext.permanentEntries[i].addr; + for (i = 0; i < gAudioCtx.permanentPool.count; i++) { + if (gAudioCtx.permanentEntries[i].tableType == tableType && gAudioCtx.permanentEntries[i].id == id) { + return gAudioCtx.permanentEntries[i].addr; } } return NULL; @@ -1101,18 +1095,18 @@ void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id) { void* AudioHeap_AllocPermanent(s32 tableType, s32 id, size_t size) { void* addr; - s32 index = gAudioContext.permanentPool.count; + s32 index = gAudioCtx.permanentPool.count; - addr = AudioHeap_Alloc(&gAudioContext.permanentPool, size); - gAudioContext.permanentEntries[index].addr = addr; + addr = AudioHeap_Alloc(&gAudioCtx.permanentPool, size); + gAudioCtx.permanentEntries[index].addr = addr; if (addr == NULL) { return NULL; } - gAudioContext.permanentEntries[index].tableType = tableType; - gAudioContext.permanentEntries[index].id = id; - gAudioContext.permanentEntries[index].size = size; + gAudioCtx.permanentEntries[index].tableType = tableType; + gAudioCtx.permanentEntries[index].id = id; + gAudioCtx.permanentEntries[index].size = size; //! @bug UB: missing return. "addr" is in v0 at this point, but doing an // explicit return uses an additional register. // return addr; @@ -1143,22 +1137,22 @@ void* AudioHeap_AllocSampleCache(size_t size, s32 sampleBankId, void* sampleAddr void AudioHeap_InitSampleCaches(size_t persistentSampleCacheSize, size_t temporarySampleCacheSize) { void* addr; - addr = AudioHeap_AllocAttemptExternal(&gAudioContext.miscPool, persistentSampleCacheSize); + addr = AudioHeap_AllocAttemptExternal(&gAudioCtx.miscPool, persistentSampleCacheSize); if (addr == NULL) { - gAudioContext.persistentSampleCache.pool.size = 0; + gAudioCtx.persistentSampleCache.pool.size = 0; } else { - AudioHeap_InitPool(&gAudioContext.persistentSampleCache.pool, addr, persistentSampleCacheSize); + AudioHeap_InitPool(&gAudioCtx.persistentSampleCache.pool, addr, persistentSampleCacheSize); } - addr = AudioHeap_AllocAttemptExternal(&gAudioContext.miscPool, temporarySampleCacheSize); + addr = AudioHeap_AllocAttemptExternal(&gAudioCtx.miscPool, temporarySampleCacheSize); if (addr == NULL) { - gAudioContext.temporarySampleCache.pool.size = 0; + gAudioCtx.temporarySampleCache.pool.size = 0; } else { - AudioHeap_InitPool(&gAudioContext.temporarySampleCache.pool, addr, temporarySampleCacheSize); + AudioHeap_InitPool(&gAudioCtx.temporarySampleCache.pool, addr, temporarySampleCacheSize); } - gAudioContext.persistentSampleCache.numEntries = 0; - gAudioContext.temporarySampleCache.numEntries = 0; + gAudioCtx.persistentSampleCache.numEntries = 0; + gAudioCtx.temporarySampleCache.numEntries = 0; } SampleCacheEntry* AudioHeap_AllocTemporarySampleCacheEntry(size_t size) { @@ -1176,7 +1170,7 @@ SampleCacheEntry* AudioHeap_AllocTemporarySampleCacheEntry(size_t size) { u8* startAddr; u8* endAddr; - cache = &gAudioContext.temporarySampleCache; + cache = &gAudioCtx.temporarySampleCache; allocBefore = cache->pool.curAddr; addr = AudioHeap_Alloc(&cache->pool, size); if (addr == NULL) { @@ -1197,8 +1191,8 @@ SampleCacheEntry* AudioHeap_AllocTemporarySampleCacheEntry(size_t size) { allocAfter = cache->pool.curAddr; index = -1; - for (i = 0; i < gAudioContext.preloadSampleStackTop; i++) { - preload = &gAudioContext.preloadSampleStack[i]; + for (i = 0; i < gAudioCtx.preloadSampleStackTop; i++) { + preload = &gAudioCtx.preloadSampleStack[i]; if (preload->isFree == false) { startAddr = preload->ramAddr; endAddr = preload->ramAddr + preload->sample->size - 1; @@ -1270,7 +1264,7 @@ void AudioHeap_UnapplySampleCacheForFont(SampleCacheEntry* entry, s32 fontId) { s32 drumId; s32 sfxId; - for (instId = 0; instId < gAudioContext.soundFontList[fontId].numInstruments; instId++) { + for (instId = 0; instId < gAudioCtx.soundFontList[fontId].numInstruments; instId++) { inst = AudioPlayback_GetInstrumentInner(fontId, instId); if (inst != NULL) { if (inst->normalRangeLo != 0) { @@ -1283,14 +1277,14 @@ void AudioHeap_UnapplySampleCacheForFont(SampleCacheEntry* entry, s32 fontId) { } } - for (drumId = 0; drumId < gAudioContext.soundFontList[fontId].numDrums; drumId++) { + for (drumId = 0; drumId < gAudioCtx.soundFontList[fontId].numDrums; drumId++) { drum = AudioPlayback_GetDrum(fontId, drumId); if (drum != NULL) { AudioHeap_UnapplySampleCache(entry, drum->tunedSample.sample); } } - for (sfxId = 0; sfxId < gAudioContext.soundFontList[fontId].numSfx; sfxId++) { + for (sfxId = 0; sfxId < gAudioCtx.soundFontList[fontId].numSfx; sfxId++) { soundEffect = AudioPlayback_GetSoundEffect(fontId, sfxId); if (soundEffect != NULL) { AudioHeap_UnapplySampleCache(entry, soundEffect->tunedSample.sample); @@ -1304,10 +1298,10 @@ void AudioHeap_DiscardSampleCacheEntry(SampleCacheEntry* entry) { s32 sampleBankId2; s32 fontId; - numFonts = gAudioContext.soundFontTable->numEntries; + numFonts = gAudioCtx.soundFontTable->numEntries; for (fontId = 0; fontId < numFonts; fontId++) { - sampleBankId1 = gAudioContext.soundFontList[fontId].sampleBankId1; - sampleBankId2 = gAudioContext.soundFontList[fontId].sampleBankId2; + sampleBankId1 = gAudioCtx.soundFontList[fontId].sampleBankId1; + sampleBankId2 = gAudioCtx.soundFontList[fontId].sampleBankId2; if (((sampleBankId1 != 0xFF) && (entry->sampleBankId == sampleBankId1)) || ((sampleBankId2 != 0xFF) && (entry->sampleBankId == sampleBankId2)) || entry->sampleBankId == 0 || entry->sampleBankId == 0xFE) { @@ -1335,7 +1329,7 @@ SampleCacheEntry* AudioHeap_AllocPersistentSampleCacheEntry(size_t size) { SampleCacheEntry* entry; void* addr; - cache = &gAudioContext.persistentSampleCache; + cache = &gAudioCtx.persistentSampleCache; addr = AudioHeap_Alloc(&cache->pool, size); if (addr == NULL) { return NULL; @@ -1368,10 +1362,10 @@ void AudioHeap_DiscardSampleCaches(void) { s32 fontId; s32 j; - numFonts = gAudioContext.soundFontTable->numEntries; + numFonts = gAudioCtx.soundFontTable->numEntries; for (fontId = 0; fontId < numFonts; fontId++) { - sampleBankId1 = gAudioContext.soundFontList[fontId].sampleBankId1; - sampleBankId2 = gAudioContext.soundFontList[fontId].sampleBankId2; + sampleBankId1 = gAudioCtx.soundFontList[fontId].sampleBankId1; + sampleBankId2 = gAudioCtx.soundFontList[fontId].sampleBankId2; if ((sampleBankId1 == 0xFF) && (sampleBankId2 == 0xFF)) { continue; } @@ -1380,12 +1374,12 @@ void AudioHeap_DiscardSampleCaches(void) { continue; } - for (j = 0; j < gAudioContext.persistentSampleCache.numEntries; j++) { - AudioHeap_DiscardSampleCacheForFont(&gAudioContext.persistentSampleCache.entries[j], sampleBankId1, + for (j = 0; j < gAudioCtx.persistentSampleCache.numEntries; j++) { + AudioHeap_DiscardSampleCacheForFont(&gAudioCtx.persistentSampleCache.entries[j], sampleBankId1, sampleBankId2, fontId); } - for (j = 0; j < gAudioContext.temporarySampleCache.numEntries; j++) { - AudioHeap_DiscardSampleCacheForFont(&gAudioContext.temporarySampleCache.entries[j], sampleBankId1, + for (j = 0; j < gAudioCtx.temporarySampleCache.numEntries; j++) { + AudioHeap_DiscardSampleCacheForFont(&gAudioCtx.temporarySampleCache.entries[j], sampleBankId1, sampleBankId2, fontId); } } @@ -1442,8 +1436,8 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) { uintptr_t* newAddr; s32 pad[4]; - sampleBankTable = gAudioContext.sampleBankTable; - numFonts = gAudioContext.soundFontTable->numEntries; + sampleBankTable = gAudioCtx.sampleBankTable; + numFonts = gAudioCtx.soundFontTable->numEntries; change.oldAddr = AudioHeap_SearchCaches(SAMPLE_TABLE, CACHE_EITHER, sampleBankId); if (change.oldAddr == 0) { return; @@ -1465,8 +1459,8 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) { } for (fontId = 0; fontId < numFonts; fontId++) { - sampleBankId1 = gAudioContext.soundFontList[fontId].sampleBankId1; - sampleBankId2 = gAudioContext.soundFontList[fontId].sampleBankId2; + sampleBankId1 = gAudioCtx.soundFontList[fontId].sampleBankId1; + sampleBankId2 = gAudioCtx.soundFontList[fontId].sampleBankId2; if ((sampleBankId1 != 0xFF) || (sampleBankId2 != 0xFF)) { if (!AudioLoad_IsFontLoadComplete(fontId) || AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, fontId) == NULL) { @@ -1479,7 +1473,7 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) { continue; } - for (instId = 0; instId < gAudioContext.soundFontList[fontId].numInstruments; instId++) { + for (instId = 0; instId < gAudioCtx.soundFontList[fontId].numInstruments; instId++) { inst = AudioPlayback_GetInstrumentInner(fontId, instId); if (inst != NULL) { if (inst->normalRangeLo != 0) { @@ -1492,14 +1486,14 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) { } } - for (drumId = 0; drumId < gAudioContext.soundFontList[fontId].numDrums; drumId++) { + for (drumId = 0; drumId < gAudioCtx.soundFontList[fontId].numDrums; drumId++) { drum = AudioPlayback_GetDrum(fontId, drumId); if (drum != NULL) { AudioHeap_ChangeStorage(&change, drum->tunedSample.sample); } } - for (sfxId = 0; sfxId < gAudioContext.soundFontList[fontId].numSfx; sfxId++) { + for (sfxId = 0; sfxId < gAudioCtx.soundFontList[fontId].numSfx; sfxId++) { soundEffect = AudioPlayback_GetSoundEffect(fontId, sfxId); if (soundEffect != NULL) { AudioHeap_ChangeStorage(&change, soundEffect->tunedSample.sample); @@ -1515,7 +1509,7 @@ void AudioHeap_DiscardSampleBanks(void) { AudioTemporaryCache* temporary; u32 i; - cache = &gAudioContext.sampleBankCache; + cache = &gAudioCtx.sampleBankCache; temporary = &cache->temporary; if (temporary->entries[0].id != -1) { @@ -1534,7 +1528,7 @@ void AudioHeap_DiscardSampleBanks(void) { void AudioHeap_SetReverbData(s32 reverbIndex, u32 dataType, s32 data, s32 isFirstInit) { s32 delayNumSamples; - SynthesisReverb* reverb = &gAudioContext.synthesisReverbs[reverbIndex]; + SynthesisReverb* reverb = &gAudioCtx.synthesisReverbs[reverbIndex]; switch (dataType) { case REVERB_DATA_TYPE_SETTINGS: @@ -1568,14 +1562,10 @@ void AudioHeap_SetReverbData(s32 reverbIndex, u32 dataType, s32 data, s32 isFirs if ((reverb->downsampleRate != 1) || reverb->resampleEffectOn) { reverb->downsamplePitch = 0x8000 / reverb->downsampleRate; if (reverb->leftLoadResampleBuf == NULL) { - reverb->leftLoadResampleBuf = - AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE)); - reverb->rightLoadResampleBuf = - AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE)); - reverb->leftSaveResampleBuf = - AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE)); - reverb->rightSaveResampleBuf = - AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE)); + reverb->leftLoadResampleBuf = AudioHeap_AllocZeroed(&gAudioCtx.miscPool, sizeof(RESAMPLE_STATE)); + reverb->rightLoadResampleBuf = AudioHeap_AllocZeroed(&gAudioCtx.miscPool, sizeof(RESAMPLE_STATE)); + reverb->leftSaveResampleBuf = AudioHeap_AllocZeroed(&gAudioCtx.miscPool, sizeof(RESAMPLE_STATE)); + reverb->rightSaveResampleBuf = AudioHeap_AllocZeroed(&gAudioCtx.miscPool, sizeof(RESAMPLE_STATE)); if (reverb->rightSaveResampleBuf == NULL) { reverb->downsampleRate = 1; } @@ -1584,31 +1574,31 @@ void AudioHeap_SetReverbData(s32 reverbIndex, u32 dataType, s32 data, s32 isFirs break; case REVERB_DATA_TYPE_DECAY: - gAudioContext.synthesisReverbs[reverbIndex].decayRatio = data; + gAudioCtx.synthesisReverbs[reverbIndex].decayRatio = data; break; case REVERB_DATA_TYPE_SUB_VOLUME: - gAudioContext.synthesisReverbs[reverbIndex].subVolume = data; + gAudioCtx.synthesisReverbs[reverbIndex].subVolume = data; break; case REVERB_DATA_TYPE_VOLUME: - gAudioContext.synthesisReverbs[reverbIndex].volume = data; + gAudioCtx.synthesisReverbs[reverbIndex].volume = data; break; case REVERB_DATA_TYPE_LEAK_RIGHT: - gAudioContext.synthesisReverbs[reverbIndex].leakRtl = data; + gAudioCtx.synthesisReverbs[reverbIndex].leakRtl = data; break; case REVERB_DATA_TYPE_LEAK_LEFT: - gAudioContext.synthesisReverbs[reverbIndex].leakLtr = data; + gAudioCtx.synthesisReverbs[reverbIndex].leakLtr = data; break; case REVERB_DATA_TYPE_FILTER_LEFT: if (data != 0) { if (isFirstInit || (reverb->filterLeftInit == NULL)) { - reverb->filterLeftState = AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool, - 2 * (FILTER_BUF_PART1 + FILTER_BUF_PART2)); - reverb->filterLeftInit = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, FILTER_SIZE); + reverb->filterLeftState = + AudioHeap_AllocDmaMemoryZeroed(&gAudioCtx.miscPool, 2 * (FILTER_BUF_PART1 + FILTER_BUF_PART2)); + reverb->filterLeftInit = AudioHeap_AllocDmaMemory(&gAudioCtx.miscPool, FILTER_SIZE); } reverb->filterLeft = reverb->filterLeftInit; @@ -1627,9 +1617,9 @@ void AudioHeap_SetReverbData(s32 reverbIndex, u32 dataType, s32 data, s32 isFirs case REVERB_DATA_TYPE_FILTER_RIGHT: if (data != 0) { if (isFirstInit || (reverb->filterRightInit == NULL)) { - reverb->filterRightState = AudioHeap_AllocDmaMemoryZeroed( - &gAudioContext.miscPool, 2 * (FILTER_BUF_PART1 + FILTER_BUF_PART2)); - reverb->filterRightInit = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, FILTER_SIZE); + reverb->filterRightState = + AudioHeap_AllocDmaMemoryZeroed(&gAudioCtx.miscPool, 2 * (FILTER_BUF_PART1 + FILTER_BUF_PART2)); + reverb->filterRightInit = AudioHeap_AllocDmaMemory(&gAudioCtx.miscPool, FILTER_SIZE); } reverb->filterRight = reverb->filterRightInit; if (reverb->filterRight != NULL) { @@ -1658,7 +1648,7 @@ void AudioHeap_SetReverbData(s32 reverbIndex, u32 dataType, s32 data, s32 isFirs } void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 isFirstInit) { - SynthesisReverb* reverb = &gAudioContext.synthesisReverbs[reverbIndex]; + SynthesisReverb* reverb = &gAudioCtx.synthesisReverbs[reverbIndex]; if (isFirstInit) { reverb->delayNumSamplesAfterDownsampling = settings->delayNumSamples / settings->downsampleRate; @@ -1684,10 +1674,8 @@ void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 isFirst reverb->useReverb = 8; // used as a boolean if (isFirstInit) { - reverb->leftReverbBuf = - AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->delayNumSamples * 2); - reverb->rightReverbBuf = - AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->delayNumSamples * 2); + reverb->leftReverbBuf = AudioHeap_AllocZeroedAttemptExternal(&gAudioCtx.miscPool, reverb->delayNumSamples * 2); + reverb->rightReverbBuf = AudioHeap_AllocZeroedAttemptExternal(&gAudioCtx.miscPool, reverb->delayNumSamples * 2); reverb->resampleFlags = 1; reverb->nextReverbBufPos = 0; reverb->delayNumSamplesUnk = 0; diff --git a/src/code/audio/audio_init_params.c b/src/code/audio/audio_init_params.c index 59c6658ac..6bba865e9 100644 --- a/src/code/audio/audio_init_params.c +++ b/src/code/audio/audio_init_params.c @@ -14,7 +14,7 @@ const s16 gAudioTatumInit[] = { #define SOUNDFONT_2_SIZE 0xCE0 // Sizes of everything on the init pool -#define AI_BUFFERS_SIZE (AIBUF_SIZE * ARRAY_COUNT(gAudioContext.aiBuffers)) +#define AI_BUFFERS_SIZE (AIBUF_SIZE * ARRAY_COUNT(gAudioCtx.aiBuffers)) #define SOUNDFONT_LIST_SIZE (NUM_SOUNDFONTS * sizeof(SoundFont)) // 0x19BD0 diff --git a/src/code/audio/audio_load.c b/src/code/audio/audio_load.c index c9b5ad30b..d101b53f5 100644 --- a/src/code/audio/audio_load.c +++ b/src/code/audio/audio_load.c @@ -92,38 +92,38 @@ s32 D_801FD1E0; DmaHandler sDmaHandler = osEPiStartDma; void* sUnusedHandler = NULL; -s32 gAudioContextInitalized = false; +s32 gAudioCtxInitalized = false; void AudioLoad_DecreaseSampleDmaTtls(void) { u32 i; - for (i = 0; i < gAudioContext.sampleDmaListSize1; i++) { - SampleDma* dma = &gAudioContext.sampleDmas[i]; + for (i = 0; i < gAudioCtx.sampleDmaListSize1; i++) { + SampleDma* dma = &gAudioCtx.sampleDmas[i]; if (dma->ttl != 0) { dma->ttl--; if (dma->ttl == 0) { - dma->reuseIndex = gAudioContext.sampleDmaReuseQueue1WrPos; - gAudioContext.sampleDmaReuseQueue1[gAudioContext.sampleDmaReuseQueue1WrPos] = i; - gAudioContext.sampleDmaReuseQueue1WrPos++; + dma->reuseIndex = gAudioCtx.sampleDmaReuseQueue1WrPos; + gAudioCtx.sampleDmaReuseQueue1[gAudioCtx.sampleDmaReuseQueue1WrPos] = i; + gAudioCtx.sampleDmaReuseQueue1WrPos++; } } } - for (i = gAudioContext.sampleDmaListSize1; i < gAudioContext.sampleDmaCount; i++) { - SampleDma* dma = &gAudioContext.sampleDmas[i]; + for (i = gAudioCtx.sampleDmaListSize1; i < gAudioCtx.sampleDmaCount; i++) { + SampleDma* dma = &gAudioCtx.sampleDmas[i]; if (dma->ttl != 0) { dma->ttl--; if (dma->ttl == 0) { - dma->reuseIndex = gAudioContext.sampleDmaReuseQueue2WrPos; - gAudioContext.sampleDmaReuseQueue2[gAudioContext.sampleDmaReuseQueue2WrPos] = i; - gAudioContext.sampleDmaReuseQueue2WrPos++; + dma->reuseIndex = gAudioCtx.sampleDmaReuseQueue2WrPos; + gAudioCtx.sampleDmaReuseQueue2[gAudioCtx.sampleDmaReuseQueue2WrPos] = i; + gAudioCtx.sampleDmaReuseQueue2WrPos++; } } } - gAudioContext.unused2648 = 0; + gAudioCtx.unused2648 = 0; } void* AudioLoad_DmaSampleData(uintptr_t devAddr, size_t size, s32 arg2, u8* dmaIndexRef, s32 medium) { @@ -137,24 +137,22 @@ void* AudioLoad_DmaSampleData(uintptr_t devAddr, size_t size, s32 arg2, u8* dmaI s32 bufferPos; u32 i; - if (arg2 != 0 || *dmaIndexRef >= gAudioContext.sampleDmaListSize1) { - for (i = gAudioContext.sampleDmaListSize1; i < gAudioContext.sampleDmaCount; i++) { - dma = &gAudioContext.sampleDmas[i]; + if (arg2 != 0 || *dmaIndexRef >= gAudioCtx.sampleDmaListSize1) { + for (i = gAudioCtx.sampleDmaListSize1; i < gAudioCtx.sampleDmaCount; i++) { + dma = &gAudioCtx.sampleDmas[i]; bufferPos = devAddr - dma->devAddr; if (0 <= bufferPos && ((u32)bufferPos <= dma->size - size)) { // We already have a DMA request for this memory range. - if (dma->ttl == 0 && - gAudioContext.sampleDmaReuseQueue2RdPos != gAudioContext.sampleDmaReuseQueue2WrPos) { + if (dma->ttl == 0 && gAudioCtx.sampleDmaReuseQueue2RdPos != gAudioCtx.sampleDmaReuseQueue2WrPos) { // Move the DMA out of the reuse queue, by swapping it with the // read pos, and then incrementing the read pos. - if (dma->reuseIndex != gAudioContext.sampleDmaReuseQueue2RdPos) { - gAudioContext.sampleDmaReuseQueue2[dma->reuseIndex] = - gAudioContext.sampleDmaReuseQueue2[gAudioContext.sampleDmaReuseQueue2RdPos]; - gAudioContext - .sampleDmas[gAudioContext.sampleDmaReuseQueue2[gAudioContext.sampleDmaReuseQueue2RdPos]] + if (dma->reuseIndex != gAudioCtx.sampleDmaReuseQueue2RdPos) { + gAudioCtx.sampleDmaReuseQueue2[dma->reuseIndex] = + gAudioCtx.sampleDmaReuseQueue2[gAudioCtx.sampleDmaReuseQueue2RdPos]; + gAudioCtx.sampleDmas[gAudioCtx.sampleDmaReuseQueue2[gAudioCtx.sampleDmaReuseQueue2RdPos]] .reuseIndex = dma->reuseIndex; } - gAudioContext.sampleDmaReuseQueue2RdPos++; + gAudioCtx.sampleDmaReuseQueue2RdPos++; } dma->ttl = 32; *dmaIndexRef = (u8)i; @@ -166,16 +164,16 @@ void* AudioLoad_DmaSampleData(uintptr_t devAddr, size_t size, s32 arg2, u8* dmaI goto search_short_lived; } - if (gAudioContext.sampleDmaReuseQueue2RdPos != gAudioContext.sampleDmaReuseQueue2WrPos && arg2 != 0) { + if (gAudioCtx.sampleDmaReuseQueue2RdPos != gAudioCtx.sampleDmaReuseQueue2WrPos && arg2 != 0) { // Allocate a DMA from reuse queue 2, unless full. - dmaIndex = gAudioContext.sampleDmaReuseQueue2[gAudioContext.sampleDmaReuseQueue2RdPos]; - gAudioContext.sampleDmaReuseQueue2RdPos++; - dma = gAudioContext.sampleDmas + dmaIndex; + dmaIndex = gAudioCtx.sampleDmaReuseQueue2[gAudioCtx.sampleDmaReuseQueue2RdPos]; + gAudioCtx.sampleDmaReuseQueue2RdPos++; + dma = gAudioCtx.sampleDmas + dmaIndex; hasDma = true; } } else { search_short_lived: - dma = gAudioContext.sampleDmas + *dmaIndexRef; + dma = gAudioCtx.sampleDmas + *dmaIndexRef; i = 0; again: bufferPos = devAddr - dma->devAddr; @@ -184,31 +182,30 @@ void* AudioLoad_DmaSampleData(uintptr_t devAddr, size_t size, s32 arg2, u8* dmaI if (dma->ttl == 0) { // Move the DMA out of the reuse queue, by swapping it with the // read pos, and then incrementing the read pos. - if (dma->reuseIndex != gAudioContext.sampleDmaReuseQueue1RdPos) { - gAudioContext.sampleDmaReuseQueue1[dma->reuseIndex] = - gAudioContext.sampleDmaReuseQueue1[gAudioContext.sampleDmaReuseQueue1RdPos]; - gAudioContext - .sampleDmas[gAudioContext.sampleDmaReuseQueue1[gAudioContext.sampleDmaReuseQueue1RdPos]] + if (dma->reuseIndex != gAudioCtx.sampleDmaReuseQueue1RdPos) { + gAudioCtx.sampleDmaReuseQueue1[dma->reuseIndex] = + gAudioCtx.sampleDmaReuseQueue1[gAudioCtx.sampleDmaReuseQueue1RdPos]; + gAudioCtx.sampleDmas[gAudioCtx.sampleDmaReuseQueue1[gAudioCtx.sampleDmaReuseQueue1RdPos]] .reuseIndex = dma->reuseIndex; } - gAudioContext.sampleDmaReuseQueue1RdPos++; + gAudioCtx.sampleDmaReuseQueue1RdPos++; } dma->ttl = 2; return dma->ramAddr + (devAddr - dma->devAddr); } - dma = gAudioContext.sampleDmas + i++; - if (i <= gAudioContext.sampleDmaListSize1) { + dma = gAudioCtx.sampleDmas + i++; + if (i <= gAudioCtx.sampleDmaListSize1) { goto again; } } if (!hasDma) { - if (gAudioContext.sampleDmaReuseQueue1RdPos == gAudioContext.sampleDmaReuseQueue1WrPos) { + if (gAudioCtx.sampleDmaReuseQueue1RdPos == gAudioCtx.sampleDmaReuseQueue1WrPos) { return NULL; } // Allocate a DMA from reuse queue 1. - dmaIndex = gAudioContext.sampleDmaReuseQueue1[gAudioContext.sampleDmaReuseQueue1RdPos++]; - dma = gAudioContext.sampleDmas + dmaIndex; + dmaIndex = gAudioCtx.sampleDmaReuseQueue1[gAudioCtx.sampleDmaReuseQueue1RdPos++]; + dma = gAudioCtx.sampleDmas + dmaIndex; hasDma = true; } @@ -217,9 +214,8 @@ void* AudioLoad_DmaSampleData(uintptr_t devAddr, size_t size, s32 arg2, u8* dmaI dma->ttl = 3; dma->devAddr = dmaDevAddr; dma->sizeUnused = transfer; - AudioLoad_Dma(&gAudioContext.currAudioFrameDmaIoMesgBuf[gAudioContext.curAudioFrameDmaCount++], OS_MESG_PRI_NORMAL, - OS_READ, dmaDevAddr, dma->ramAddr, transfer, &gAudioContext.curAudioFrameDmaQueue, medium, - "SUPERDMA"); + AudioLoad_Dma(&gAudioCtx.currAudioFrameDmaIoMesgBuf[gAudioCtx.curAudioFrameDmaCount++], OS_MESG_PRI_NORMAL, OS_READ, + dmaDevAddr, dma->ramAddr, transfer, &gAudioCtx.curAudioFrameDmaQueue, medium, "SUPERDMA"); *dmaIndexRef = dmaIndex; return (devAddr - dmaDevAddr) + dma->ramAddr; } @@ -233,78 +229,77 @@ void AudioLoad_InitSampleDmaBuffers(s32 numNotes) { s32 t2; s32 j; - gAudioContext.sampleDmaBufSize = gAudioContext.sampleDmaBufSize1; - gAudioContext.sampleDmas = - AudioHeap_Alloc(&gAudioContext.miscPool, - 4 * gAudioContext.numNotes * sizeof(SampleDma) * gAudioContext.audioBufferParameters.specUnk4); - t2 = 3 * gAudioContext.numNotes * gAudioContext.audioBufferParameters.specUnk4; + gAudioCtx.sampleDmaBufSize = gAudioCtx.sampleDmaBufSize1; + gAudioCtx.sampleDmas = AudioHeap_Alloc(&gAudioCtx.miscPool, 4 * gAudioCtx.numNotes * sizeof(SampleDma) * + gAudioCtx.audioBufferParameters.specUnk4); + t2 = 3 * gAudioCtx.numNotes * gAudioCtx.audioBufferParameters.specUnk4; // First 3/4 sampleDmas for (i = 0; i < t2; i++) { - dma = &gAudioContext.sampleDmas[gAudioContext.sampleDmaCount]; - dma->ramAddr = AudioHeap_AllocAttemptExternal(&gAudioContext.miscPool, gAudioContext.sampleDmaBufSize); + dma = &gAudioCtx.sampleDmas[gAudioCtx.sampleDmaCount]; + dma->ramAddr = AudioHeap_AllocAttemptExternal(&gAudioCtx.miscPool, gAudioCtx.sampleDmaBufSize); if (dma->ramAddr == NULL) { break; } else { - AudioHeap_WritebackDCache(dma->ramAddr, gAudioContext.sampleDmaBufSize); - dma->size = gAudioContext.sampleDmaBufSize; + AudioHeap_WritebackDCache(dma->ramAddr, gAudioCtx.sampleDmaBufSize); + dma->size = gAudioCtx.sampleDmaBufSize; dma->devAddr = 0; dma->sizeUnused = 0; dma->unused = 0; dma->ttl = 0; - gAudioContext.sampleDmaCount++; + gAudioCtx.sampleDmaCount++; } } - for (i = 0; (u32)i < gAudioContext.sampleDmaCount; i++) { - gAudioContext.sampleDmaReuseQueue1[i] = i; - gAudioContext.sampleDmas[i].reuseIndex = i; + for (i = 0; (u32)i < gAudioCtx.sampleDmaCount; i++) { + gAudioCtx.sampleDmaReuseQueue1[i] = i; + gAudioCtx.sampleDmas[i].reuseIndex = i; } - for (i = gAudioContext.sampleDmaCount; i < 0x100; i++) { - gAudioContext.sampleDmaReuseQueue1[i] = 0; + for (i = gAudioCtx.sampleDmaCount; i < 0x100; i++) { + gAudioCtx.sampleDmaReuseQueue1[i] = 0; } - gAudioContext.sampleDmaReuseQueue1RdPos = 0; - gAudioContext.sampleDmaReuseQueue1WrPos = gAudioContext.sampleDmaCount; - gAudioContext.sampleDmaListSize1 = gAudioContext.sampleDmaCount; - gAudioContext.sampleDmaBufSize = gAudioContext.sampleDmaBufSize2; + gAudioCtx.sampleDmaReuseQueue1RdPos = 0; + gAudioCtx.sampleDmaReuseQueue1WrPos = gAudioCtx.sampleDmaCount; + gAudioCtx.sampleDmaListSize1 = gAudioCtx.sampleDmaCount; + gAudioCtx.sampleDmaBufSize = gAudioCtx.sampleDmaBufSize2; - for (j = 0; j < gAudioContext.numNotes; j++) { - dma = &gAudioContext.sampleDmas[gAudioContext.sampleDmaCount]; - dma->ramAddr = AudioHeap_AllocAttemptExternal(&gAudioContext.miscPool, gAudioContext.sampleDmaBufSize); + for (j = 0; j < gAudioCtx.numNotes; j++) { + dma = &gAudioCtx.sampleDmas[gAudioCtx.sampleDmaCount]; + dma->ramAddr = AudioHeap_AllocAttemptExternal(&gAudioCtx.miscPool, gAudioCtx.sampleDmaBufSize); if (dma->ramAddr == NULL) { break; } else { - AudioHeap_WritebackDCache(dma->ramAddr, gAudioContext.sampleDmaBufSize); - dma->size = gAudioContext.sampleDmaBufSize; + AudioHeap_WritebackDCache(dma->ramAddr, gAudioCtx.sampleDmaBufSize); + dma->size = gAudioCtx.sampleDmaBufSize; dma->devAddr = 0; dma->sizeUnused = 0; dma->unused = 0; dma->ttl = 0; - gAudioContext.sampleDmaCount++; + gAudioCtx.sampleDmaCount++; } } - for (i = gAudioContext.sampleDmaListSize1; (u32)i < gAudioContext.sampleDmaCount; i++) { - gAudioContext.sampleDmaReuseQueue2[i - gAudioContext.sampleDmaListSize1] = i; - gAudioContext.sampleDmas[i].reuseIndex = i - gAudioContext.sampleDmaListSize1; + for (i = gAudioCtx.sampleDmaListSize1; (u32)i < gAudioCtx.sampleDmaCount; i++) { + gAudioCtx.sampleDmaReuseQueue2[i - gAudioCtx.sampleDmaListSize1] = i; + gAudioCtx.sampleDmas[i].reuseIndex = i - gAudioCtx.sampleDmaListSize1; } - for (i = gAudioContext.sampleDmaCount; i < 0x100; i++) { - gAudioContext.sampleDmaReuseQueue2[i] = gAudioContext.sampleDmaListSize1; + for (i = gAudioCtx.sampleDmaCount; i < 0x100; i++) { + gAudioCtx.sampleDmaReuseQueue2[i] = gAudioCtx.sampleDmaListSize1; } - gAudioContext.sampleDmaReuseQueue2RdPos = 0; - gAudioContext.sampleDmaReuseQueue2WrPos = gAudioContext.sampleDmaCount - gAudioContext.sampleDmaListSize1; + gAudioCtx.sampleDmaReuseQueue2RdPos = 0; + gAudioCtx.sampleDmaReuseQueue2WrPos = gAudioCtx.sampleDmaCount - gAudioCtx.sampleDmaListSize1; } s32 AudioLoad_IsFontLoadComplete(s32 fontId) { if (fontId == 0xFF) { return true; - } else if (gAudioContext.fontLoadStatus[fontId] >= LOAD_STATUS_COMPLETE) { + } else if (gAudioCtx.fontLoadStatus[fontId] >= LOAD_STATUS_COMPLETE) { return true; - } else if (gAudioContext.fontLoadStatus[AudioLoad_GetRealTableIndex(FONT_TABLE, fontId)] >= LOAD_STATUS_COMPLETE) { + } else if (gAudioCtx.fontLoadStatus[AudioLoad_GetRealTableIndex(FONT_TABLE, fontId)] >= LOAD_STATUS_COMPLETE) { return true; } else { return false; @@ -314,10 +309,9 @@ s32 AudioLoad_IsFontLoadComplete(s32 fontId) { s32 AudioLoad_IsSeqLoadComplete(s32 seqId) { if (seqId == 0xFF) { return true; - } else if (gAudioContext.seqLoadStatus[seqId] >= LOAD_STATUS_COMPLETE) { + } else if (gAudioCtx.seqLoadStatus[seqId] >= LOAD_STATUS_COMPLETE) { return true; - } else if (gAudioContext.seqLoadStatus[AudioLoad_GetRealTableIndex(SEQUENCE_TABLE, seqId)] >= - LOAD_STATUS_COMPLETE) { + } else if (gAudioCtx.seqLoadStatus[AudioLoad_GetRealTableIndex(SEQUENCE_TABLE, seqId)] >= LOAD_STATUS_COMPLETE) { return true; } else { return false; @@ -327,9 +321,9 @@ s32 AudioLoad_IsSeqLoadComplete(s32 seqId) { s32 AudioLoad_IsSampleLoadComplete(s32 sampleBankId) { if (sampleBankId == 0xFF) { return true; - } else if (gAudioContext.sampleFontLoadStatus[sampleBankId] >= LOAD_STATUS_COMPLETE) { + } else if (gAudioCtx.sampleFontLoadStatus[sampleBankId] >= LOAD_STATUS_COMPLETE) { return true; - } else if (gAudioContext.sampleFontLoadStatus[AudioLoad_GetRealTableIndex(SAMPLE_TABLE, sampleBankId)] >= + } else if (gAudioCtx.sampleFontLoadStatus[AudioLoad_GetRealTableIndex(SAMPLE_TABLE, sampleBankId)] >= LOAD_STATUS_COMPLETE) { return true; } else { @@ -338,33 +332,33 @@ s32 AudioLoad_IsSampleLoadComplete(s32 sampleBankId) { } void AudioLoad_SetFontLoadStatus(s32 fontId, s32 loadStatus) { - if ((fontId != 0xFF) && (gAudioContext.fontLoadStatus[fontId] != LOAD_STATUS_PERMANENT)) { - gAudioContext.fontLoadStatus[fontId] = loadStatus; + if ((fontId != 0xFF) && (gAudioCtx.fontLoadStatus[fontId] != LOAD_STATUS_PERMANENT)) { + gAudioCtx.fontLoadStatus[fontId] = loadStatus; } } void AudioLoad_SetSeqLoadStatus(s32 seqId, s32 loadStatus) { - if ((seqId != 0xFF) && (gAudioContext.seqLoadStatus[seqId] != LOAD_STATUS_PERMANENT)) { - gAudioContext.seqLoadStatus[seqId] = loadStatus; + if ((seqId != 0xFF) && (gAudioCtx.seqLoadStatus[seqId] != LOAD_STATUS_PERMANENT)) { + gAudioCtx.seqLoadStatus[seqId] = loadStatus; } } void AudioLoad_SetSampleFontLoadStatusAndApplyCaches(s32 sampleBankId, s32 loadStatus) { if (sampleBankId != 0xFF) { - if (gAudioContext.sampleFontLoadStatus[sampleBankId] != LOAD_STATUS_PERMANENT) { - gAudioContext.sampleFontLoadStatus[sampleBankId] = loadStatus; + if (gAudioCtx.sampleFontLoadStatus[sampleBankId] != LOAD_STATUS_PERMANENT) { + gAudioCtx.sampleFontLoadStatus[sampleBankId] = loadStatus; } - if ((gAudioContext.sampleFontLoadStatus[sampleBankId] == LOAD_STATUS_PERMANENT) || - (gAudioContext.sampleFontLoadStatus[sampleBankId] == LOAD_STATUS_COMPLETE)) { + if ((gAudioCtx.sampleFontLoadStatus[sampleBankId] == LOAD_STATUS_PERMANENT) || + (gAudioCtx.sampleFontLoadStatus[sampleBankId] == LOAD_STATUS_COMPLETE)) { AudioHeap_ApplySampleBankCache(sampleBankId); } } } void AudioLoad_SetSampleFontLoadStatus(s32 sampleBankId, s32 loadStatus) { - if ((sampleBankId != 0xFF) && (gAudioContext.sampleFontLoadStatus[sampleBankId] != LOAD_STATUS_PERMANENT)) { - gAudioContext.sampleFontLoadStatus[sampleBankId] = loadStatus; + if ((sampleBankId != 0xFF) && (gAudioCtx.sampleFontLoadStatus[sampleBankId] != LOAD_STATUS_PERMANENT)) { + gAudioCtx.sampleFontLoadStatus[sampleBankId] = loadStatus; } } @@ -389,16 +383,16 @@ SoundFontData* AudioLoad_SyncLoadSeqFonts(s32 seqId, u32* outDefaultFontId) { s32 fontId; s32 i; - if (seqId >= gAudioContext.numSequences) { + if (seqId >= gAudioCtx.numSequences) { return NULL; } fontId = 0xFF; - index = ((u16*)gAudioContext.sequenceFontTable)[seqId]; - numFonts = gAudioContext.sequenceFontTable[index++]; + index = ((u16*)gAudioCtx.sequenceFontTable)[seqId]; + numFonts = gAudioCtx.sequenceFontTable[index++]; while (numFonts > 0) { - fontId = gAudioContext.sequenceFontTable[index++]; + fontId = gAudioCtx.sequenceFontTable[index++]; fontData = AudioLoad_SyncLoadFont(fontId); numFonts--; } @@ -411,7 +405,7 @@ void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 arg1, s32 arg2, OSMesgQueue* arg3 s32 pad; u32 defaultFontId; - if (seqId < gAudioContext.numSequences) { + if (seqId < gAudioCtx.numSequences) { if (arg1 & 2) { AudioLoad_SyncLoadSeqFonts(seqId, &defaultFontId); } @@ -437,7 +431,7 @@ s32 AudioLoad_SyncLoadSample(Sample* sample, s32 fontId) { if (sample->medium == MEDIUM_UNK) { AudioLoad_SyncDmaUnkMedium(sample->sampleAddr, sampleAddr, sample->size, - gAudioContext.sampleBankTable->unkMediumParam); + gAudioCtx.sampleBankTable->unkMediumParam); } else { AudioLoad_SyncDma(sample->sampleAddr, sampleAddr, sample->size, sample->medium); } @@ -493,23 +487,23 @@ void AudioLoad_AsyncLoadFont(s32 fontId, s32 arg1, s32 retData, OSMesgQueue* ret } u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts) { - s32 index = ((u16*)gAudioContext.sequenceFontTable)[seqId]; + s32 index = ((u16*)gAudioCtx.sequenceFontTable)[seqId]; - *outNumFonts = gAudioContext.sequenceFontTable[index++]; + *outNumFonts = gAudioCtx.sequenceFontTable[index++]; if (*outNumFonts == 0) { return NULL; } - return &gAudioContext.sequenceFontTable[index]; + return &gAudioCtx.sequenceFontTable[index]; } void AudioLoad_DiscardSeqFonts(s32 seqId) { s32 fontId; - s32 index = ((u16*)gAudioContext.sequenceFontTable)[seqId]; - s32 numFonts = gAudioContext.sequenceFontTable[index++]; + s32 index = ((u16*)gAudioCtx.sequenceFontTable)[seqId]; + s32 numFonts = gAudioCtx.sequenceFontTable[index++]; while (numFonts > 0) { numFonts--; - fontId = AudioLoad_GetRealTableIndex(FONT_TABLE, gAudioContext.sequenceFontTable[index++]); + fontId = AudioLoad_GetRealTableIndex(FONT_TABLE, gAudioCtx.sequenceFontTable[index++]); if (AudioHeap_SearchPermanentCache(FONT_TABLE, fontId) == NULL) { AudioLoad_DiscardFont(fontId); AudioLoad_SetFontLoadStatus(fontId, LOAD_STATUS_NOT_LOADED); @@ -519,7 +513,7 @@ void AudioLoad_DiscardSeqFonts(s32 seqId) { void AudioLoad_DiscardFont(s32 fontId) { u32 i; - AudioCache* pool = &gAudioContext.fontCache; + AudioCache* pool = &gAudioCtx.fontCache; AudioPersistentCache* persistent; if (fontId == pool->temporary.entries[0].id) { @@ -556,11 +550,11 @@ void func_8018FA60(u32 tableType, u32 id, s32 type, s32 data) { } s32 AudioLoad_SyncInitSeqPlayer(s32 playerIndex, s32 seqId, s32 arg2) { - if (gAudioContext.resetTimer != 0) { + if (gAudioCtx.resetTimer != 0) { return 0; } - gAudioContext.seqPlayers[playerIndex].skipTicks = 0; + gAudioCtx.seqPlayers[playerIndex].skipTicks = 0; AudioLoad_SyncInitSeqPlayerInternal(playerIndex, seqId, arg2); // Intentionally missing return. Returning the result of the above function // call matches but is UB because it too is missing a return, and using the @@ -569,23 +563,23 @@ s32 AudioLoad_SyncInitSeqPlayer(s32 playerIndex, s32 seqId, s32 arg2) { } s32 AudioLoad_SyncInitSeqPlayerSkipTicks(s32 playerIndex, s32 seqId, s32 skipTicks) { - if (gAudioContext.resetTimer != 0) { + if (gAudioCtx.resetTimer != 0) { return 0; } - gAudioContext.seqPlayers[playerIndex].skipTicks = skipTicks; + gAudioCtx.seqPlayers[playerIndex].skipTicks = skipTicks; AudioLoad_SyncInitSeqPlayerInternal(playerIndex, seqId, 0); // Missing return, see above. } s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIndex, s32 seqId, s32 arg2) { - SequencePlayer* seqPlayer = &gAudioContext.seqPlayers[playerIndex]; + SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[playerIndex]; u8* seqData; s32 index; s32 numFonts; s32 fontId; - if (seqId >= gAudioContext.numSequences) { + if (seqId >= gAudioCtx.numSequences) { return 0; } @@ -593,11 +587,11 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIndex, s32 seqId, s32 arg2) { if (1) {} fontId = 0xFF; - index = ((u16*)gAudioContext.sequenceFontTable)[seqId]; - numFonts = gAudioContext.sequenceFontTable[index++]; + index = ((u16*)gAudioCtx.sequenceFontTable)[seqId]; + numFonts = gAudioCtx.sequenceFontTable[index++]; while (numFonts > 0) { - fontId = gAudioContext.sequenceFontTable[index++]; + fontId = gAudioCtx.sequenceFontTable[index++]; AudioLoad_SyncLoadFont(fontId); numFonts--; } @@ -630,7 +624,7 @@ u8* AudioLoad_SyncLoadSeq(s32 seqId) { s32 pad; s32 didAllocate; - if (gAudioContext.seqLoadStatus[AudioLoad_GetRealTableIndex(SEQUENCE_TABLE, seqId)] == LOAD_STATUS_IN_PROGRESS) { + if (gAudioCtx.seqLoadStatus[AudioLoad_GetRealTableIndex(SEQUENCE_TABLE, seqId)] == LOAD_STATUS_IN_PROGRESS) { return NULL; } @@ -651,7 +645,7 @@ u32 AudioLoad_TrySyncLoadSampleBank(u32 sampleBankId, u32* outMedium, s32 noLoad addr = AudioLoad_SearchCaches(SAMPLE_TABLE, realTableId); if (addr != NULL) { - if (gAudioContext.sampleFontLoadStatus[realTableId] != LOAD_STATUS_IN_PROGRESS) { + if (gAudioCtx.sampleFontLoadStatus[realTableId] != LOAD_STATUS_IN_PROGRESS) { AudioLoad_SetSampleFontLoadStatus(realTableId, LOAD_STATUS_COMPLETE); } @@ -684,12 +678,12 @@ SoundFontData* AudioLoad_SyncLoadFont(u32 fontId) { SampleBankRelocInfo sampleBankReloc; s32 realFontId = AudioLoad_GetRealTableIndex(FONT_TABLE, fontId); - if (gAudioContext.fontLoadStatus[realFontId] == LOAD_STATUS_IN_PROGRESS) { + if (gAudioCtx.fontLoadStatus[realFontId] == LOAD_STATUS_IN_PROGRESS) { return NULL; } - sampleBankId1 = gAudioContext.soundFontList[realFontId].sampleBankId1; - sampleBankId2 = gAudioContext.soundFontList[realFontId].sampleBankId2; + sampleBankId1 = gAudioCtx.soundFontList[realFontId].sampleBankId1; + sampleBankId2 = gAudioCtx.soundFontList[realFontId].sampleBankId2; sampleBankReloc.sampleBankId1 = sampleBankId1; sampleBankReloc.sampleBankId2 = sampleBankId2; @@ -780,7 +774,7 @@ void* AudioLoad_SyncLoad(s32 tableType, u32 id, s32* didAllocate) { } if (tableType == FONT_TABLE) { - SoundFont* soundFont = &gAudioContext.soundFontList[realId]; + SoundFont* soundFont = &gAudioCtx.soundFontList[realId]; soundFont->numInstruments = ((UnloadedFonts*)romAddr)->numInstruments; soundFont->numDrums = ((UnloadedFonts*)romAddr)->numDrums; @@ -847,16 +841,16 @@ AudioTable* AudioLoad_GetLoadTable(s32 tableType) { switch (tableType) { case SEQUENCE_TABLE: - table = gAudioContext.sequenceTable; + table = gAudioCtx.sequenceTable; break; case FONT_TABLE: - table = gAudioContext.soundFontTable; + table = gAudioCtx.soundFontTable; break; default: table = NULL; break; case SAMPLE_TABLE: - table = gAudioContext.sampleBankTable; + table = gAudioCtx.sampleBankTable; break; } return table; @@ -877,9 +871,9 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample Drum* drum; SoundEffect* soundEffect; s32 i; - s32 numDrums = gAudioContext.soundFontList[fontId].numDrums; - s32 numInstruments = gAudioContext.soundFontList[fontId].numInstruments; - s32 numSfx = gAudioContext.soundFontList[fontId].numSfx; + s32 numDrums = gAudioCtx.soundFontList[fontId].numDrums; + s32 numInstruments = gAudioCtx.soundFontList[fontId].numInstruments; + s32 numSfx = gAudioCtx.soundFontList[fontId].numSfx; u32* fontData = (u32*)fontDataStartAddr; // Relocate an offset (relative to the start of the font data) to a pointer (a ram address) @@ -985,14 +979,14 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample #undef RELOC_TO_RAM // Store the relocated pointers - gAudioContext.soundFontList[fontId].drums = (Drum**)fontData[0]; - gAudioContext.soundFontList[fontId].soundEffects = (SoundEffect*)fontData[1]; - gAudioContext.soundFontList[fontId].instruments = (Instrument**)(&fontData[2]); + gAudioCtx.soundFontList[fontId].drums = (Drum**)fontData[0]; + gAudioCtx.soundFontList[fontId].soundEffects = (SoundEffect*)fontData[1]; + gAudioCtx.soundFontList[fontId].instruments = (Instrument**)(&fontData[2]); } void AudioLoad_SyncDma(uintptr_t devAddr, u8* ramAddr, size_t size, s32 medium) { - OSMesgQueue* msgQueue = &gAudioContext.syncDmaQueue; - OSIoMesg* ioMesg = &gAudioContext.syncDmaIoMesg; + OSMesgQueue* msgQueue = &gAudioCtx.syncDmaQueue; + OSIoMesg* ioMesg = &gAudioCtx.syncDmaIoMesg; size = ALIGN16(size); Audio_InvalDCache(ramAddr, size); @@ -1021,19 +1015,19 @@ s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, uintptr_t devAddr OSMesgQueue* reqQueue, s32 medium, const char* dmaFuncType) { OSPiHandle* handle; - if (gAudioContext.resetTimer > 16) { + if (gAudioCtx.resetTimer > 16) { return -1; } switch (medium) { case MEDIUM_CART: - handle = gAudioContext.cartHandle; + handle = gAudioCtx.cartHandle; break; case MEDIUM_DISK_DRIVE: // driveHandle is uninitialized and corresponds to stubbed-out disk drive support. // SM64 Shindou called osDriveRomInit here. - handle = gAudioContext.driveHandle; + handle = gAudioCtx.driveHandle; break; default: @@ -1077,19 +1071,19 @@ void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, switch (tableType) { case SEQUENCE_TABLE: - if (gAudioContext.seqLoadStatus[realId] == LOAD_STATUS_IN_PROGRESS) { + if (gAudioCtx.seqLoadStatus[realId] == LOAD_STATUS_IN_PROGRESS) { return NULL; } break; case FONT_TABLE: - if (gAudioContext.fontLoadStatus[realId] == LOAD_STATUS_IN_PROGRESS) { + if (gAudioCtx.fontLoadStatus[realId] == LOAD_STATUS_IN_PROGRESS) { return NULL; } break; case SAMPLE_TABLE: - if (gAudioContext.sampleFontLoadStatus[realId] == LOAD_STATUS_IN_PROGRESS) { + if (gAudioCtx.sampleFontLoadStatus[realId] == LOAD_STATUS_IN_PROGRESS) { return NULL; } break; @@ -1146,7 +1140,7 @@ void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, } if (tableType == FONT_TABLE) { - soundFont = &gAudioContext.soundFontList[realId]; + soundFont = &gAudioCtx.soundFontList[realId]; soundFont->numInstruments = ((UnloadedFonts*)romAddr)->numInstruments; soundFont->numDrums = ((UnloadedFonts*)romAddr)->numDrums; @@ -1199,8 +1193,8 @@ void AudioLoad_SetUnusedHandler(void* callback) { } void AudioLoad_InitSoundFont(s32 fontId) { - SoundFont* font = &gAudioContext.soundFontList[fontId]; - AudioTableEntry* entry = &gAudioContext.soundFontTable->entries[fontId]; + SoundFont* font = &gAudioCtx.soundFontList[fontId]; + AudioTableEntry* entry = &gAudioCtx.soundFontTable->entries[fontId]; font->sampleBankId1 = (entry->shortData1 >> 8) & 0xFF; font->sampleBankId2 = (entry->shortData1) & 0xFF; @@ -1213,7 +1207,7 @@ void AudioLoad_Init(void* heap, size_t heapSize) { s32 pad1[9]; s32 numFonts; s32 pad2[2]; - u8* audioContextPtr; + u8* audioCtxPtr; void* addr; s32 i; s32 j; @@ -1222,120 +1216,120 @@ void AudioLoad_Init(void* heap, size_t heapSize) { gCustomAudioReverbFunction = NULL; gCustomAudioSynthFunction = NULL; - for (i = 0; i < ARRAY_COUNT(gAudioContext.unk_29A8); i++) { - gAudioContext.unk_29A8[i] = NULL; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.unk_29A8); i++) { + gAudioCtx.unk_29A8[i] = NULL; } - gAudioContext.resetTimer = 0; - gAudioContext.unk_29B8 = false; + gAudioCtx.resetTimer = 0; + gAudioCtx.unk_29B8 = false; - // Set all of gAudioContext to 0 - audioContextPtr = (u8*)&gAudioContext; - for (j = sizeof(gAudioContext); j >= 0; j--) { - *audioContextPtr++ = 0; + // Set all of gAudioCtx to 0 + audioCtxPtr = (u8*)&gAudioCtx; + for (j = sizeof(gAudioCtx); j >= 0; j--) { + *audioCtxPtr++ = 0; } switch (osTvType) { case OS_TV_PAL: - gAudioContext.unk_2960 = 20.03042f; - gAudioContext.refreshRate = 50; + gAudioCtx.unk_2960 = 20.03042f; + gAudioCtx.refreshRate = 50; break; case OS_TV_MPAL: - gAudioContext.unk_2960 = 16.546f; - gAudioContext.refreshRate = 60; + gAudioCtx.unk_2960 = 16.546f; + gAudioCtx.refreshRate = 60; break; case OS_TV_NTSC: default: - gAudioContext.unk_2960 = 16.713f; - gAudioContext.refreshRate = 60; + gAudioCtx.unk_2960 = 16.713f; + gAudioCtx.refreshRate = 60; } AudioThread_InitMesgQueues(); - for (i = 0; i < ARRAY_COUNT(gAudioContext.aiBufNumSamples); i++) { - gAudioContext.aiBufNumSamples[i] = 0xA0; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.aiBufNumSamples); i++) { + gAudioCtx.aiBufNumSamples[i] = 0xA0; } - gAudioContext.totalTaskCount = 0; - gAudioContext.rspTaskIndex = 0; - gAudioContext.curAiBufferIndex = 0; - gAudioContext.soundMode = SOUNDMODE_STEREO; - gAudioContext.curTask = NULL; - gAudioContext.rspTask[0].task.t.dataSize = 0; - gAudioContext.rspTask[1].task.t.dataSize = 0; + gAudioCtx.totalTaskCount = 0; + gAudioCtx.rspTaskIndex = 0; + gAudioCtx.curAiBufferIndex = 0; + gAudioCtx.soundMode = SOUNDMODE_STEREO; + gAudioCtx.curTask = NULL; + gAudioCtx.rspTask[0].task.t.dataSize = 0; + gAudioCtx.rspTask[1].task.t.dataSize = 0; - osCreateMesgQueue(&gAudioContext.syncDmaQueue, &gAudioContext.syncDmaMesg, 1); - osCreateMesgQueue(&gAudioContext.curAudioFrameDmaQueue, gAudioContext.currAudioFrameDmaMesgBuf, - ARRAY_COUNT(gAudioContext.currAudioFrameDmaMesgBuf)); - osCreateMesgQueue(&gAudioContext.externalLoadQueue, gAudioContext.externalLoadMesgBuf, - ARRAY_COUNT(gAudioContext.externalLoadMesgBuf)); - osCreateMesgQueue(&gAudioContext.preloadSampleQueue, gAudioContext.preloadSampleMesgBuf, - ARRAY_COUNT(gAudioContext.preloadSampleMesgBuf)); - gAudioContext.curAudioFrameDmaCount = 0; - gAudioContext.sampleDmaCount = 0; - gAudioContext.cartHandle = osCartRomInit(); + osCreateMesgQueue(&gAudioCtx.syncDmaQueue, &gAudioCtx.syncDmaMesg, 1); + osCreateMesgQueue(&gAudioCtx.curAudioFrameDmaQueue, gAudioCtx.currAudioFrameDmaMesgBuf, + ARRAY_COUNT(gAudioCtx.currAudioFrameDmaMesgBuf)); + osCreateMesgQueue(&gAudioCtx.externalLoadQueue, gAudioCtx.externalLoadMesgBuf, + ARRAY_COUNT(gAudioCtx.externalLoadMesgBuf)); + osCreateMesgQueue(&gAudioCtx.preloadSampleQueue, gAudioCtx.preloadSampleMesgBuf, + ARRAY_COUNT(gAudioCtx.preloadSampleMesgBuf)); + gAudioCtx.curAudioFrameDmaCount = 0; + gAudioCtx.sampleDmaCount = 0; + gAudioCtx.cartHandle = osCartRomInit(); if (heap == NULL) { - gAudioContext.audioHeap = gAudioHeap; - gAudioContext.audioHeapSize = gAudioHeapInitSizes.heapSize; + gAudioCtx.audioHeap = gAudioHeap; + gAudioCtx.audioHeapSize = gAudioHeapInitSizes.heapSize; } else { void** hp = &heap; - gAudioContext.audioHeap = *hp; - gAudioContext.audioHeapSize = heapSize; + gAudioCtx.audioHeap = *hp; + gAudioCtx.audioHeapSize = heapSize; } - for (i = 0; i < ((s32)gAudioContext.audioHeapSize / (s32)sizeof(u64)); i++) { - ((u64*)gAudioContext.audioHeap)[i] = 0; + for (i = 0; i < ((s32)gAudioCtx.audioHeapSize / (s32)sizeof(u64)); i++) { + ((u64*)gAudioCtx.audioHeap)[i] = 0; } // Main Pool Split (split entirety of audio heap into initPool and sessionPool) AudioHeap_InitMainPool(gAudioHeapInitSizes.initPoolSize); // Initialize the audio interface buffers - for (i = 0; i < ARRAY_COUNT(gAudioContext.aiBuffers); i++) { - gAudioContext.aiBuffers[i] = AudioHeap_AllocZeroed(&gAudioContext.initPool, AIBUF_LEN * sizeof(s16)); + for (i = 0; i < ARRAY_COUNT(gAudioCtx.aiBuffers); i++) { + gAudioCtx.aiBuffers[i] = AudioHeap_AllocZeroed(&gAudioCtx.initPool, AIBUF_LEN * sizeof(s16)); } // Connect audio tables to their tables in memory - gAudioContext.sequenceTable = (AudioTable*)gSequenceTable; - gAudioContext.soundFontTable = (AudioTable*)gSoundFontTable; - gAudioContext.sampleBankTable = (AudioTable*)gSampleBankTable; - gAudioContext.sequenceFontTable = gSequenceFontTable; + gAudioCtx.sequenceTable = (AudioTable*)gSequenceTable; + gAudioCtx.soundFontTable = (AudioTable*)gSoundFontTable; + gAudioCtx.sampleBankTable = (AudioTable*)gSampleBankTable; + gAudioCtx.sequenceFontTable = gSequenceFontTable; - gAudioContext.numSequences = gAudioContext.sequenceTable->numEntries; + gAudioCtx.numSequences = gAudioCtx.sequenceTable->numEntries; - gAudioContext.audioResetSpecIdToLoad = 0; - gAudioContext.resetStatus = 1; // Set reset to immediately initialize the audio heap + gAudioCtx.audioResetSpecIdToLoad = 0; + gAudioCtx.resetStatus = 1; // Set reset to immediately initialize the audio heap AudioHeap_ResetStep(); // Initialize audio tables - AudioLoad_InitTable(gAudioContext.sequenceTable, SEGMENT_ROM_START(Audioseq), 0); - AudioLoad_InitTable(gAudioContext.soundFontTable, SEGMENT_ROM_START(Audiobank), 0); - AudioLoad_InitTable(gAudioContext.sampleBankTable, SEGMENT_ROM_START(Audiotable), 0); + AudioLoad_InitTable(gAudioCtx.sequenceTable, SEGMENT_ROM_START(Audioseq), 0); + AudioLoad_InitTable(gAudioCtx.soundFontTable, SEGMENT_ROM_START(Audiobank), 0); + AudioLoad_InitTable(gAudioCtx.sampleBankTable, SEGMENT_ROM_START(Audiotable), 0); - numFonts = gAudioContext.soundFontTable->numEntries; - gAudioContext.soundFontList = AudioHeap_Alloc(&gAudioContext.initPool, numFonts * sizeof(SoundFont)); + numFonts = gAudioCtx.soundFontTable->numEntries; + gAudioCtx.soundFontList = AudioHeap_Alloc(&gAudioCtx.initPool, numFonts * sizeof(SoundFont)); for (i = 0; i < numFonts; i++) { AudioLoad_InitSoundFont(i); } - if (addr = AudioHeap_Alloc(&gAudioContext.initPool, gAudioHeapInitSizes.permanentPoolSize), addr == NULL) { + if (addr = AudioHeap_Alloc(&gAudioCtx.initPool, gAudioHeapInitSizes.permanentPoolSize), addr == NULL) { // cast away const from gAudioHeapInitSizes *((u32*)&gAudioHeapInitSizes.permanentPoolSize) = 0; } - AudioHeap_InitPool(&gAudioContext.permanentPool, addr, gAudioHeapInitSizes.permanentPoolSize); - gAudioContextInitalized = true; - osSendMesg(gAudioContext.taskStartQueueP, (void*)gAudioContext.totalTaskCount, OS_MESG_NOBLOCK); + AudioHeap_InitPool(&gAudioCtx.permanentPool, addr, gAudioHeapInitSizes.permanentPoolSize); + gAudioCtxInitalized = true; + osSendMesg(gAudioCtx.taskStartQueueP, (void*)gAudioCtx.totalTaskCount, OS_MESG_NOBLOCK); } void AudioLoad_InitSlowLoads(void) { - gAudioContext.slowLoads[0].status = 0; - gAudioContext.slowLoads[1].status = 0; + gAudioCtx.slowLoads[0].status = 0; + gAudioCtx.slowLoads[1].status = 0; } s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* isDone) { @@ -1353,7 +1347,7 @@ s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* isDone) { return 0; } - slowLoad = &gAudioContext.slowLoads[gAudioContext.slowLoadPos]; + slowLoad = &gAudioCtx.slowLoads[gAudioCtx.slowLoadPos]; if (slowLoad->status == LOAD_STATUS_DONE) { slowLoad->status = LOAD_STATUS_WAITING; } @@ -1382,10 +1376,10 @@ s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* isDone) { slowLoad->instId = instId; if (slowLoad->medium == MEDIUM_UNK) { - slowLoad->unkMediumParam = gAudioContext.sampleBankTable->unkMediumParam; + slowLoad->unkMediumParam = gAudioCtx.sampleBankTable->unkMediumParam; } - gAudioContext.slowLoadPos ^= 1; + gAudioCtx.slowLoadPos ^= 1; return 0; } @@ -1442,9 +1436,9 @@ void AudioLoad_ProcessSlowLoads(s32 resetStatus) { AudioSlowLoad* slowLoad; s32 i; - for (i = 0; i < ARRAY_COUNT(gAudioContext.slowLoads); i++) { - slowLoad = &gAudioContext.slowLoads[i]; - switch (gAudioContext.slowLoads[i].status) { + for (i = 0; i < ARRAY_COUNT(gAudioCtx.slowLoads); i++) { + slowLoad = &gAudioCtx.slowLoads[i]; + switch (gAudioCtx.slowLoads[i].status) { case LOAD_STATUS_LOADING: if (slowLoad->medium != MEDIUM_UNK) { osRecvMesg(&slowLoad->msgqueue, NULL, OS_MESG_BLOCK); @@ -1501,14 +1495,14 @@ s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* isDone) { AudioTable* seqTable; size_t size; - if (seqId >= gAudioContext.numSequences) { + if (seqId >= gAudioCtx.numSequences) { *isDone = 0; return -1; } seqId = AudioLoad_GetRealTableIndex(SEQUENCE_TABLE, seqId); seqTable = AudioLoad_GetLoadTable(SEQUENCE_TABLE); - slowLoad = &gAudioContext.slowLoads[gAudioContext.slowLoadPos]; + slowLoad = &gAudioCtx.slowLoads[gAudioCtx.slowLoadPos]; if (slowLoad->status == LOAD_STATUS_DONE) { slowLoad->status = LOAD_STATUS_WAITING; } @@ -1529,15 +1523,15 @@ s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* isDone) { slowLoad->unkMediumParam = seqTable->unkMediumParam; } - gAudioContext.slowLoadPos ^= 1; + gAudioCtx.slowLoadPos ^= 1; return 0; } void AudioLoad_InitAsyncLoads(void) { s32 i; - for (i = 0; i < ARRAY_COUNT(gAudioContext.asyncLoads); i++) { - gAudioContext.asyncLoads[i].status = 0; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.asyncLoads); i++) { + gAudioCtx.asyncLoads[i].status = 0; } } @@ -1550,7 +1544,7 @@ AudioAsyncLoad* AudioLoad_StartAsyncLoadUnkMedium(s32 unkMediumParam, uintptr_t return NULL; } - osSendMesg(&gAudioContext.asyncLoadUnkMediumQueue, asyncLoad, OS_MESG_NOBLOCK); + osSendMesg(&gAudioCtx.asyncLoadUnkMediumQueue, asyncLoad, OS_MESG_NOBLOCK); asyncLoad->unkMediumParam = unkMediumParam; return asyncLoad; } @@ -1560,15 +1554,15 @@ AudioAsyncLoad* AudioLoad_StartAsyncLoad(uintptr_t devAddr, void* ramAddr, size_ AudioAsyncLoad* asyncLoad; s32 i; - for (i = 0; i < ARRAY_COUNT(gAudioContext.asyncLoads); i++) { - if (gAudioContext.asyncLoads[i].status == 0) { - asyncLoad = &gAudioContext.asyncLoads[i]; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.asyncLoads); i++) { + if (gAudioCtx.asyncLoads[i].status == 0) { + asyncLoad = &gAudioCtx.asyncLoads[i]; break; } } // no more available async loads - if (i == ARRAY_COUNT(gAudioContext.asyncLoads)) { + if (i == ARRAY_COUNT(gAudioCtx.asyncLoads)) { return NULL; } @@ -1601,29 +1595,29 @@ void AudioLoad_ProcessAsyncLoads(s32 resetStatus) { AudioAsyncLoad* asyncLoad; s32 i; - if (gAudioContext.resetTimer == 1) { + if (gAudioCtx.resetTimer == 1) { return; } - if (gAudioContext.curUnkMediumLoad == NULL) { + if (gAudioCtx.curUnkMediumLoad == NULL) { if (resetStatus != 0) { // Clear and ignore queue if resetting. do { - } while (osRecvMesg(&gAudioContext.asyncLoadUnkMediumQueue, (OSMesg*)&asyncLoad, OS_MESG_NOBLOCK) != -1); - } else if (osRecvMesg(&gAudioContext.asyncLoadUnkMediumQueue, (OSMesg*)&asyncLoad, OS_MESG_NOBLOCK) == -1) { - gAudioContext.curUnkMediumLoad = NULL; + } while (osRecvMesg(&gAudioCtx.asyncLoadUnkMediumQueue, (OSMesg*)&asyncLoad, OS_MESG_NOBLOCK) != -1); + } else if (osRecvMesg(&gAudioCtx.asyncLoadUnkMediumQueue, (OSMesg*)&asyncLoad, OS_MESG_NOBLOCK) == -1) { + gAudioCtx.curUnkMediumLoad = NULL; } else { - gAudioContext.curUnkMediumLoad = asyncLoad; + gAudioCtx.curUnkMediumLoad = asyncLoad; } } - if (gAudioContext.curUnkMediumLoad != NULL) { - AudioLoad_ProcessAsyncLoadUnkMedium(gAudioContext.curUnkMediumLoad, resetStatus); + if (gAudioCtx.curUnkMediumLoad != NULL) { + AudioLoad_ProcessAsyncLoadUnkMedium(gAudioCtx.curUnkMediumLoad, resetStatus); } - for (i = 0; i < ARRAY_COUNT(gAudioContext.asyncLoads); i++) { - if (gAudioContext.asyncLoads[i].status == 1) { - asyncLoad = &gAudioContext.asyncLoads[i]; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.asyncLoads); i++) { + if (gAudioCtx.asyncLoads[i].status == 1) { + asyncLoad = &gAudioCtx.asyncLoads[i]; if (asyncLoad->medium != MEDIUM_UNK) { AudioLoad_ProcessAsyncLoad(asyncLoad, resetStatus); } @@ -1653,8 +1647,8 @@ void AudioLoad_FinishAsyncLoad(AudioAsyncLoad* asyncLoad) { break; case FONT_TABLE: fontId = ASYNC_ID(retMsg); - sampleBankId1 = gAudioContext.soundFontList[fontId].sampleBankId1; - sampleBankId2 = gAudioContext.soundFontList[fontId].sampleBankId2; + sampleBankId1 = gAudioCtx.soundFontList[fontId].sampleBankId1; + sampleBankId2 = gAudioCtx.soundFontList[fontId].sampleBankId2; sampleBankReloc.sampleBankId1 = sampleBankId1; sampleBankReloc.sampleBankId2 = sampleBankId2; sampleBankReloc.baseAddr1 = @@ -1673,7 +1667,7 @@ void AudioLoad_FinishAsyncLoad(AudioAsyncLoad* asyncLoad) { } void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus) { - AudioTable* sampleBankTable = gAudioContext.sampleBankTable; + AudioTable* sampleBankTable = gAudioCtx.sampleBankTable; if (asyncLoad->delay >= 2) { asyncLoad->delay--; @@ -1797,7 +1791,7 @@ void AudioLoad_RelocateSample(TunedSample* tunedSample, SoundFontData* fontData, sample->isRelocated = true; if (sample->unk_bit26 && (sample->medium != MEDIUM_RAM)) { - gAudioContext.usedSamples[gAudioContext.numUsedSamples++] = sample; + gAudioCtx.usedSamples[gAudioCtx.numUsedSamples++] = sample; } } } @@ -1823,27 +1817,27 @@ void AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, SoundFontData* fontData s32 i; preloadInProgress = false; - if (gAudioContext.preloadSampleStackTop != 0) { + if (gAudioCtx.preloadSampleStackTop != 0) { preloadInProgress = true; } else { D_801FD1E0 = 0; } - gAudioContext.numUsedSamples = 0; + gAudioCtx.numUsedSamples = 0; AudioLoad_RelocateFont(fontId, fontData, sampleBankReloc); size = 0; - for (i = 0; i < gAudioContext.numUsedSamples; i++) { - size += ALIGN16(gAudioContext.usedSamples[i]->size); + for (i = 0; i < gAudioCtx.numUsedSamples; i++) { + size += ALIGN16(gAudioCtx.usedSamples[i]->size); } if (size && size) {} - for (i = 0; i < gAudioContext.numUsedSamples; i++) { - if (gAudioContext.preloadSampleStackTop == 120) { + for (i = 0; i < gAudioCtx.numUsedSamples; i++) { + if (gAudioCtx.preloadSampleStackTop == 120) { break; } - sample = gAudioContext.usedSamples[i]; + sample = gAudioCtx.usedSamples[i]; sampleRamAddr = NULL; switch (isAsync) { case false: @@ -1883,7 +1877,7 @@ void AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, SoundFontData* fontData case false: if (sample->medium == MEDIUM_UNK) { AudioLoad_SyncDmaUnkMedium((uintptr_t)sample->sampleAddr, sampleRamAddr, sample->size, - gAudioContext.sampleBankTable->unkMediumParam); + gAudioCtx.sampleBankTable->unkMediumParam); sample->sampleAddr = sampleRamAddr; sample->medium = MEDIUM_RAM; } else { @@ -1895,27 +1889,27 @@ void AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, SoundFontData* fontData break; case true: - preload = &gAudioContext.preloadSampleStack[gAudioContext.preloadSampleStackTop]; + preload = &gAudioCtx.preloadSampleStack[gAudioCtx.preloadSampleStackTop]; preload->sample = sample; preload->ramAddr = sampleRamAddr; - preload->encodedInfo = (gAudioContext.preloadSampleStackTop << 24) | 0xFFFFFF; + preload->encodedInfo = (gAudioCtx.preloadSampleStackTop << 24) | 0xFFFFFF; preload->isFree = false; preload->endAndMediumKey = (uintptr_t)sample->sampleAddr + sample->size + sample->medium; - gAudioContext.preloadSampleStackTop++; + gAudioCtx.preloadSampleStackTop++; break; default: break; } } - gAudioContext.numUsedSamples = 0; + gAudioCtx.numUsedSamples = 0; - if (gAudioContext.preloadSampleStackTop != 0 && !preloadInProgress) { - topPreload = &gAudioContext.preloadSampleStack[gAudioContext.preloadSampleStackTop - 1]; + if (gAudioCtx.preloadSampleStackTop != 0 && !preloadInProgress) { + topPreload = &gAudioCtx.preloadSampleStack[gAudioCtx.preloadSampleStackTop - 1]; sample = topPreload->sample; nChunks = (sample->size >> 12) + 1; AudioLoad_StartAsyncLoad((uintptr_t)sample->sampleAddr, topPreload->ramAddr, sample->size, sample->medium, - nChunks, &gAudioContext.preloadSampleQueue, topPreload->encodedInfo); + nChunks, &gAudioCtx.preloadSampleQueue, topPreload->encodedInfo); } } @@ -1927,20 +1921,20 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) { u32 nChunks; s32 pad; - if (gAudioContext.preloadSampleStackTop > 0) { + if (gAudioCtx.preloadSampleStackTop > 0) { if (resetStatus != 0) { // Clear result queue and preload stack and return. - osRecvMesg(&gAudioContext.preloadSampleQueue, (OSMesg*)&preloadIndex, OS_MESG_NOBLOCK); - gAudioContext.preloadSampleStackTop = 0; + osRecvMesg(&gAudioCtx.preloadSampleQueue, (OSMesg*)&preloadIndex, OS_MESG_NOBLOCK); + gAudioCtx.preloadSampleStackTop = 0; return false; } - if (osRecvMesg(&gAudioContext.preloadSampleQueue, (OSMesg*)&preloadIndex, OS_MESG_NOBLOCK) == -1) { + if (osRecvMesg(&gAudioCtx.preloadSampleQueue, (OSMesg*)&preloadIndex, OS_MESG_NOBLOCK) == -1) { // Previous preload is not done yet. return false; } preloadIndex >>= 24; - preload = &gAudioContext.preloadSampleStack[preloadIndex]; + preload = &gAudioCtx.preloadSampleStack[preloadIndex]; if (preload->isFree == false) { sample = preload->sample; @@ -1956,12 +1950,12 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) { // Pop requests with isFree = true off the stack, as far as possible, // and dispatch the next DMA. for (;;) { - if (gAudioContext.preloadSampleStackTop <= 0) { + if (gAudioCtx.preloadSampleStackTop <= 0) { break; } - preload = &gAudioContext.preloadSampleStack[gAudioContext.preloadSampleStackTop - 1]; + preload = &gAudioCtx.preloadSampleStack[gAudioCtx.preloadSampleStackTop - 1]; if (preload->isFree == true) { - gAudioContext.preloadSampleStackTop--; + gAudioCtx.preloadSampleStackTop--; continue; } @@ -1970,10 +1964,10 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) { key = (uintptr_t)sample->sampleAddr + sample->size + sample->medium; if (key != preload->endAndMediumKey) { preload->isFree = true; - gAudioContext.preloadSampleStackTop--; + gAudioCtx.preloadSampleStackTop--; } else { AudioLoad_StartAsyncLoad((uintptr_t)sample->sampleAddr, preload->ramAddr, sample->size, sample->medium, - nChunks, &gAudioContext.preloadSampleQueue, preload->encodedInfo); + nChunks, &gAudioCtx.preloadSampleQueue, preload->encodedInfo); break; } } @@ -2001,8 +1995,8 @@ s32 AudioLoad_AddToSampleSet(Sample* sample, s32 numSamples, Sample** sampleSet) s32 AudioLoad_GetSamplesForFont(s32 fontId, Sample** sampleSet) { s32 i; s32 numSamples = 0; - s32 numDrums = gAudioContext.soundFontList[fontId].numDrums; - s32 numInstruments = gAudioContext.soundFontList[fontId].numInstruments; + s32 numDrums = gAudioCtx.soundFontList[fontId].numDrums; + s32 numInstruments = gAudioCtx.soundFontList[fontId].numInstruments; for (i = 0; i < numDrums; i++) { Drum* drum = AudioPlayback_GetDrum(fontId, i); @@ -2035,7 +2029,7 @@ void AudioLoad_AddUsedSample(TunedSample* tunedSample) { Sample* sample = tunedSample->sample; if ((sample->size != 0) && (sample->unk_bit26) && (sample->medium != MEDIUM_RAM)) { - gAudioContext.usedSamples[gAudioContext.numUsedSamples++] = sample; + gAudioCtx.usedSamples[gAudioCtx.numUsedSamples++] = sample; } } @@ -2056,15 +2050,15 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo* s32 nChunks; preloadInProgress = false; - if (gAudioContext.preloadSampleStackTop != 0) { + if (gAudioCtx.preloadSampleStackTop != 0) { preloadInProgress = true; } - gAudioContext.numUsedSamples = 0; + gAudioCtx.numUsedSamples = 0; - numDrums = gAudioContext.soundFontList[fontId].numDrums; - numInstruments = gAudioContext.soundFontList[fontId].numInstruments; - numSfx = gAudioContext.soundFontList[fontId].numSfx; + numDrums = gAudioCtx.soundFontList[fontId].numDrums; + numInstruments = gAudioCtx.soundFontList[fontId].numInstruments; + numSfx = gAudioCtx.soundFontList[fontId].numSfx; for (i = 0; i < numInstruments; i++) { instrument = AudioPlayback_GetInstrumentInner(fontId, i); @@ -2093,22 +2087,22 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo* } } - if (gAudioContext.numUsedSamples == 0) { + if (gAudioCtx.numUsedSamples == 0) { return; } size = 0; - for (i = 0; i < gAudioContext.numUsedSamples; i++) { - size += ALIGN16(gAudioContext.usedSamples[i]->size); + for (i = 0; i < gAudioCtx.numUsedSamples; i++) { + size += ALIGN16(gAudioCtx.usedSamples[i]->size); } if (size) {} - for (i = 0; i < gAudioContext.numUsedSamples; i++) { - if (gAudioContext.preloadSampleStackTop == 120) { + for (i = 0; i < gAudioCtx.numUsedSamples; i++) { + if (gAudioCtx.preloadSampleStackTop == 120) { break; } - sample = gAudioContext.usedSamples[i]; + sample = gAudioCtx.usedSamples[i]; if (sample->medium == MEDIUM_RAM) { continue; } @@ -2142,7 +2136,7 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo* case false: if (sample->medium == MEDIUM_UNK) { AudioLoad_SyncDmaUnkMedium((uintptr_t)sample->sampleAddr, addr, sample->size, - gAudioContext.sampleBankTable->unkMediumParam); + gAudioCtx.sampleBankTable->unkMediumParam); sample->sampleAddr = addr; sample->medium = MEDIUM_RAM; } else { @@ -2153,24 +2147,24 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo* break; case true: - preload = &gAudioContext.preloadSampleStack[gAudioContext.preloadSampleStackTop]; + preload = &gAudioCtx.preloadSampleStack[gAudioCtx.preloadSampleStackTop]; preload->sample = sample; preload->ramAddr = addr; - preload->encodedInfo = (gAudioContext.preloadSampleStackTop << 24) | 0xFFFFFF; + preload->encodedInfo = (gAudioCtx.preloadSampleStackTop << 24) | 0xFFFFFF; preload->isFree = false; preload->endAndMediumKey = (uintptr_t)sample->sampleAddr + sample->size + sample->medium; - gAudioContext.preloadSampleStackTop++; + gAudioCtx.preloadSampleStackTop++; break; } } - gAudioContext.numUsedSamples = 0; + gAudioCtx.numUsedSamples = 0; - if (gAudioContext.preloadSampleStackTop != 0 && !preloadInProgress) { - topPreload = &gAudioContext.preloadSampleStack[gAudioContext.preloadSampleStackTop - 1]; + if (gAudioCtx.preloadSampleStackTop != 0 && !preloadInProgress) { + topPreload = &gAudioCtx.preloadSampleStack[gAudioCtx.preloadSampleStackTop - 1]; sample = topPreload->sample; nChunks = (sample->size >> 12) + 1; AudioLoad_StartAsyncLoad((uintptr_t)sample->sampleAddr, topPreload->ramAddr, sample->size, sample->medium, - nChunks, &gAudioContext.preloadSampleQueue, topPreload->encodedInfo); + nChunks, &gAudioCtx.preloadSampleQueue, topPreload->encodedInfo); } } @@ -2182,13 +2176,13 @@ void AudioLoad_LoadPermanentSamples(void) { s32 i; sampleBankTable = AudioLoad_GetLoadTable(SAMPLE_TABLE); - for (i = 0; i < gAudioContext.permanentPool.count; i++) { + for (i = 0; i < gAudioCtx.permanentPool.count; i++) { SampleBankRelocInfo sampleBankReloc; - if (gAudioContext.permanentEntries[i].tableType == FONT_TABLE) { - fontId = AudioLoad_GetRealTableIndex(FONT_TABLE, gAudioContext.permanentEntries[i].id); - sampleBankReloc.sampleBankId1 = gAudioContext.soundFontList[fontId].sampleBankId1; - sampleBankReloc.sampleBankId2 = gAudioContext.soundFontList[fontId].sampleBankId2; + if (gAudioCtx.permanentEntries[i].tableType == FONT_TABLE) { + fontId = AudioLoad_GetRealTableIndex(FONT_TABLE, gAudioCtx.permanentEntries[i].id); + sampleBankReloc.sampleBankId1 = gAudioCtx.soundFontList[fontId].sampleBankId1; + sampleBankReloc.sampleBankId2 = gAudioCtx.soundFontList[fontId].sampleBankId2; if (sampleBankReloc.sampleBankId1 != 0xFF) { sampleBankReloc.sampleBankId1 = diff --git a/src/code/audio/audio_playback.c b/src/code/audio/audio_playback.c index a7cc9a588..07315d56e 100644 --- a/src/code/audio/audio_playback.c +++ b/src/code/audio/audio_playback.c @@ -35,7 +35,7 @@ void AudioPlayback_InitSampleState(Note* note, NoteSampleState* sampleState, Not sampleState->bitField0.strongLeft = false; sampleState->bitField0.strongReverbRight = stereoData.strongReverbRight; sampleState->bitField0.strongReverbLeft = stereoData.strongReverbLeft; - if (stereoHeadsetEffects && (gAudioContext.soundMode == SOUNDMODE_HEADSET)) { + if (stereoHeadsetEffects && (gAudioCtx.soundMode == SOUNDMODE_HEADSET)) { halfPanIndex = pan >> 1; if (halfPanIndex > 0x3F) { halfPanIndex = 0x3F; @@ -47,7 +47,7 @@ void AudioPlayback_InitSampleState(Note* note, NoteSampleState* sampleState, Not volLeft = gHeadsetPanVolume[pan]; volRight = gHeadsetPanVolume[0x7F - pan]; - } else if (stereoHeadsetEffects && (gAudioContext.soundMode == SOUNDMODE_STEREO)) { + } else if (stereoHeadsetEffects && (gAudioCtx.soundMode == SOUNDMODE_STEREO)) { strongLeft = strongRight = false; sampleState->haasEffectLeftDelaySize = 0; sampleState->haasEffectRightDelaySize = 0; @@ -85,7 +85,7 @@ void AudioPlayback_InitSampleState(Note* note, NoteSampleState* sampleState, Not break; } - } else if (gAudioContext.soundMode == SOUNDMODE_MONO) { + } else if (gAudioCtx.soundMode == SOUNDMODE_MONO) { sampleState->bitField0.strongReverbRight = false; sampleState->bitField0.strongReverbLeft = false; volLeft = 0.707f; // approx 1/sqrt(2) @@ -170,9 +170,9 @@ void AudioPlayback_ProcessNotes(void) { f32 scale; s32 i; - for (i = 0; i < gAudioContext.numNotes; i++) { - note = &gAudioContext.notes[i]; - sampleState = &gAudioContext.sampleStateList[gAudioContext.sampleStateOffset + i]; + for (i = 0; i < gAudioCtx.numNotes; i++) { + note = &gAudioCtx.notes[i]; + sampleState = &gAudioCtx.sampleStateList[gAudioCtx.sampleStateOffset + i]; playbackState = ¬e->playbackState; if (playbackState->parentLayer != NO_LAYER) { if ((u32)playbackState->parentLayer < 0x7FFFFFFF) { @@ -181,7 +181,7 @@ void AudioPlayback_ProcessNotes(void) { if ((note != playbackState->parentLayer->note) && (playbackState->status == PLAYBACK_STATUS_0)) { playbackState->adsr.action.s.release = true; - playbackState->adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv; + playbackState->adsr.fadeOutVel = gAudioCtx.audioBufferParameters.updatesPerFrameInv; playbackState->priority = 1; playbackState->status = PLAYBACK_STATUS_2; goto out; @@ -316,7 +316,7 @@ void AudioPlayback_ProcessNotes(void) { } subAttrs.frequency *= playbackState->vibratoFreqScale * playbackState->portamentoFreqScale; - subAttrs.frequency *= gAudioContext.audioBufferParameters.resampleRate; + subAttrs.frequency *= gAudioCtx.audioBufferParameters.resampleRate; subAttrs.velocity *= scale; AudioPlayback_InitSampleState(note, sampleState, &subAttrs); noteSampleState->bitField1.bookOffset = bookOffset; @@ -347,18 +347,18 @@ Instrument* AudioPlayback_GetInstrumentInner(s32 fontId, s32 instId) { } if (!AudioLoad_IsFontLoadComplete(fontId)) { - gAudioContext.audioErrorFlags = AUDIO_ERROR(0, fontId, AUDIO_ERROR_FONT_NOT_LOADED); + gAudioCtx.audioErrorFlags = AUDIO_ERROR(0, fontId, AUDIO_ERROR_FONT_NOT_LOADED); return NULL; } - if (instId >= gAudioContext.soundFontList[fontId].numInstruments) { - gAudioContext.audioErrorFlags = AUDIO_ERROR(fontId, instId, AUDIO_ERROR_INVALID_INST_ID); + if (instId >= gAudioCtx.soundFontList[fontId].numInstruments) { + gAudioCtx.audioErrorFlags = AUDIO_ERROR(fontId, instId, AUDIO_ERROR_INVALID_INST_ID); return NULL; } - inst = gAudioContext.soundFontList[fontId].instruments[instId]; + inst = gAudioCtx.soundFontList[fontId].instruments[instId]; if (inst == NULL) { - gAudioContext.audioErrorFlags = AUDIO_ERROR(fontId, instId, AUDIO_ERROR_NO_INST); + gAudioCtx.audioErrorFlags = AUDIO_ERROR(fontId, instId, AUDIO_ERROR_NO_INST); return inst; } @@ -373,21 +373,21 @@ Drum* AudioPlayback_GetDrum(s32 fontId, s32 drumId) { } if (!AudioLoad_IsFontLoadComplete(fontId)) { - gAudioContext.audioErrorFlags = AUDIO_ERROR(0, fontId, AUDIO_ERROR_FONT_NOT_LOADED); + gAudioCtx.audioErrorFlags = AUDIO_ERROR(0, fontId, AUDIO_ERROR_FONT_NOT_LOADED); return NULL; } - if (drumId >= gAudioContext.soundFontList[fontId].numDrums) { - gAudioContext.audioErrorFlags = AUDIO_ERROR(fontId, drumId, AUDIO_ERROR_INVALID_DRUM_SFX_ID); + if (drumId >= gAudioCtx.soundFontList[fontId].numDrums) { + gAudioCtx.audioErrorFlags = AUDIO_ERROR(fontId, drumId, AUDIO_ERROR_INVALID_DRUM_SFX_ID); return NULL; } - if ((u32)gAudioContext.soundFontList[fontId].drums < AUDIO_RELOCATED_ADDRESS_START) { + if ((u32)gAudioCtx.soundFontList[fontId].drums < AUDIO_RELOCATED_ADDRESS_START) { return NULL; } - drum = gAudioContext.soundFontList[fontId].drums[drumId]; + drum = gAudioCtx.soundFontList[fontId].drums[drumId]; if (drum == NULL) { - gAudioContext.audioErrorFlags = AUDIO_ERROR(fontId, drumId, AUDIO_ERROR_NO_DRUM_SFX); + gAudioCtx.audioErrorFlags = AUDIO_ERROR(fontId, drumId, AUDIO_ERROR_NO_DRUM_SFX); } return drum; @@ -401,23 +401,23 @@ SoundEffect* AudioPlayback_GetSoundEffect(s32 fontId, s32 sfxId) { } if (!AudioLoad_IsFontLoadComplete(fontId)) { - gAudioContext.audioErrorFlags = AUDIO_ERROR(0, fontId, AUDIO_ERROR_FONT_NOT_LOADED); + gAudioCtx.audioErrorFlags = AUDIO_ERROR(0, fontId, AUDIO_ERROR_FONT_NOT_LOADED); return NULL; } - if (sfxId >= gAudioContext.soundFontList[fontId].numSfx) { - gAudioContext.audioErrorFlags = AUDIO_ERROR(fontId, sfxId, AUDIO_ERROR_INVALID_DRUM_SFX_ID); + if (sfxId >= gAudioCtx.soundFontList[fontId].numSfx) { + gAudioCtx.audioErrorFlags = AUDIO_ERROR(fontId, sfxId, AUDIO_ERROR_INVALID_DRUM_SFX_ID); return NULL; } - if ((u32)gAudioContext.soundFontList[fontId].soundEffects < AUDIO_RELOCATED_ADDRESS_START) { + if ((u32)gAudioCtx.soundFontList[fontId].soundEffects < AUDIO_RELOCATED_ADDRESS_START) { return NULL; } - soundEffect = &gAudioContext.soundFontList[fontId].soundEffects[sfxId]; + soundEffect = &gAudioCtx.soundFontList[fontId].soundEffects[sfxId]; if (soundEffect == NULL) { - gAudioContext.audioErrorFlags = AUDIO_ERROR(fontId, sfxId, AUDIO_ERROR_NO_DRUM_SFX); + gAudioCtx.audioErrorFlags = AUDIO_ERROR(fontId, sfxId, AUDIO_ERROR_NO_DRUM_SFX); } if (soundEffect->tunedSample.sample == NULL) { @@ -438,24 +438,24 @@ s32 AudioPlayback_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, v switch (instrumentType) { case 0: - if (index >= gAudioContext.soundFontList[fontId].numDrums) { + if (index >= gAudioCtx.soundFontList[fontId].numDrums) { return -3; } - gAudioContext.soundFontList[fontId].drums[index] = value; + gAudioCtx.soundFontList[fontId].drums[index] = value; break; case 1: - if (index >= gAudioContext.soundFontList[fontId].numSfx) { + if (index >= gAudioCtx.soundFontList[fontId].numSfx) { return -3; } - gAudioContext.soundFontList[fontId].soundEffects[index] = *(SoundEffect*)value; + gAudioCtx.soundFontList[fontId].soundEffects[index] = *(SoundEffect*)value; break; default: - if (index >= gAudioContext.soundFontList[fontId].numInstruments) { + if (index >= gAudioCtx.soundFontList[fontId].numInstruments) { return -3; } - gAudioContext.soundFontList[fontId].instruments[index] = value; + gAudioCtx.soundFontList[fontId].instruments[index] = value; break; } @@ -488,7 +488,7 @@ void AudioPlayback_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) { if (note->playbackState.parentLayer != layer) { if (note->playbackState.parentLayer == NO_LAYER && note->playbackState.wantedParentLayer == NO_LAYER && note->playbackState.prevParentLayer == layer && target != ADSR_STATE_DECAY) { - note->playbackState.adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv; + note->playbackState.adsr.fadeOutVel = gAudioCtx.audioBufferParameters.updatesPerFrameInv; note->playbackState.adsr.action.s.release = true; } return; @@ -549,16 +549,16 @@ void AudioPlayback_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) { note->playbackState.prevParentLayer = note->playbackState.parentLayer; note->playbackState.parentLayer = NO_LAYER; if (target == ADSR_STATE_RELEASE) { - note->playbackState.adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv; + note->playbackState.adsr.fadeOutVel = gAudioCtx.audioBufferParameters.updatesPerFrameInv; note->playbackState.adsr.action.s.release = true; note->playbackState.status = PLAYBACK_STATUS_2; } else { note->playbackState.status = PLAYBACK_STATUS_1; note->playbackState.adsr.action.s.decay = true; if (layer->adsr.decayIndex == 0) { - note->playbackState.adsr.fadeOutVel = gAudioContext.adsrDecayTable[layer->channel->adsr.decayIndex]; + note->playbackState.adsr.fadeOutVel = gAudioCtx.adsrDecayTable[layer->channel->adsr.decayIndex]; } else { - note->playbackState.adsr.fadeOutVel = gAudioContext.adsrDecayTable[layer->adsr.decayIndex]; + note->playbackState.adsr.fadeOutVel = gAudioCtx.adsrDecayTable[layer->adsr.decayIndex]; } note->playbackState.adsr.sustain = ((f32)(s32)(layer->channel->adsr.sustain) * note->playbackState.adsr.current) / 256.0f; @@ -665,11 +665,11 @@ void AudioPlayback_InitNoteLists(NotePool* pool) { void AudioPlayback_InitNoteFreeList(void) { s32 i; - AudioPlayback_InitNoteLists(&gAudioContext.noteFreeLists); - for (i = 0; i < gAudioContext.numNotes; i++) { - gAudioContext.notes[i].listItem.u.value = &gAudioContext.notes[i]; - gAudioContext.notes[i].listItem.prev = NULL; - AudioSeq_AudioListPushBack(&gAudioContext.noteFreeLists.disabled, &gAudioContext.notes[i].listItem); + AudioPlayback_InitNoteLists(&gAudioCtx.noteFreeLists); + for (i = 0; i < gAudioCtx.numNotes; i++) { + gAudioCtx.notes[i].listItem.u.value = &gAudioCtx.notes[i]; + gAudioCtx.notes[i].listItem.prev = NULL; + AudioSeq_AudioListPushBack(&gAudioCtx.noteFreeLists.disabled, &gAudioCtx.notes[i].listItem); } } @@ -683,22 +683,22 @@ void AudioPlayback_NotePoolClear(NotePool* pool) { switch (i) { case 0: source = &pool->disabled; - dest = &gAudioContext.noteFreeLists.disabled; + dest = &gAudioCtx.noteFreeLists.disabled; break; case 1: source = &pool->decaying; - dest = &gAudioContext.noteFreeLists.decaying; + dest = &gAudioCtx.noteFreeLists.decaying; break; case 2: source = &pool->releasing; - dest = &gAudioContext.noteFreeLists.releasing; + dest = &gAudioCtx.noteFreeLists.releasing; break; case 3: source = &pool->active; - dest = &gAudioContext.noteFreeLists.active; + dest = &gAudioCtx.noteFreeLists.active; break; } @@ -729,22 +729,22 @@ void AudioPlayback_NotePoolFill(NotePool* pool, s32 count) { switch (i) { case 0: - source = &gAudioContext.noteFreeLists.disabled; + source = &gAudioCtx.noteFreeLists.disabled; dest = &pool->disabled; break; case 1: - source = &gAudioContext.noteFreeLists.decaying; + source = &gAudioCtx.noteFreeLists.decaying; dest = &pool->decaying; break; case 2: - source = &gAudioContext.noteFreeLists.releasing; + source = &gAudioCtx.noteFreeLists.releasing; dest = &pool->releasing; break; case 3: - source = &gAudioContext.noteFreeLists.active; + source = &gAudioCtx.noteFreeLists.active; dest = &pool->active; break; } @@ -862,7 +862,7 @@ void AudioPlayback_NoteReleaseAndTakeOwnership(Note* note, SequenceLayer* layer) note->playbackState.wantedParentLayer = layer; note->playbackState.priority = layer->channel->notePriority; - note->playbackState.adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv; + note->playbackState.adsr.fadeOutVel = gAudioCtx.audioBufferParameters.updatesPerFrameInv; note->playbackState.adsr.action.s.release = true; } @@ -958,9 +958,9 @@ Note* AudioPlayback_AllocNote(SequenceLayer* layer) { } if (policy & 8) { - if (!(note = AudioPlayback_AllocNoteFromDisabled(&gAudioContext.noteFreeLists, layer)) && - !(note = AudioPlayback_AllocNoteFromDecaying(&gAudioContext.noteFreeLists, layer)) && - !(note = AudioPlayback_AllocNoteFromActive(&gAudioContext.noteFreeLists, layer))) { + if (!(note = AudioPlayback_AllocNoteFromDisabled(&gAudioCtx.noteFreeLists, layer)) && + !(note = AudioPlayback_AllocNoteFromDecaying(&gAudioCtx.noteFreeLists, layer)) && + !(note = AudioPlayback_AllocNoteFromActive(&gAudioCtx.noteFreeLists, layer))) { goto null_return; } return note; @@ -968,13 +968,13 @@ Note* AudioPlayback_AllocNote(SequenceLayer* layer) { if (!(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->notePool, layer)) && !(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->seqPlayer->notePool, layer)) && - !(note = AudioPlayback_AllocNoteFromDisabled(&gAudioContext.noteFreeLists, layer)) && + !(note = AudioPlayback_AllocNoteFromDisabled(&gAudioCtx.noteFreeLists, layer)) && !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->notePool, layer)) && !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->seqPlayer->notePool, layer)) && - !(note = AudioPlayback_AllocNoteFromDecaying(&gAudioContext.noteFreeLists, layer)) && + !(note = AudioPlayback_AllocNoteFromDecaying(&gAudioCtx.noteFreeLists, layer)) && !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->notePool, layer)) && !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->seqPlayer->notePool, layer)) && - !(note = AudioPlayback_AllocNoteFromActive(&gAudioContext.noteFreeLists, layer))) { + !(note = AudioPlayback_AllocNoteFromActive(&gAudioCtx.noteFreeLists, layer))) { goto null_return; } return note; @@ -988,8 +988,8 @@ void AudioPlayback_NoteInitAll(void) { Note* note; s32 i; - for (i = 0; i < gAudioContext.numNotes; i++) { - note = &gAudioContext.notes[i]; + for (i = 0; i < gAudioCtx.numNotes; i++) { + note = &gAudioCtx.notes[i]; note->sampleState = gZeroedSampleState; note->playbackState.priority = 0; note->playbackState.status = PLAYBACK_STATUS_0; @@ -1006,7 +1006,7 @@ void AudioPlayback_NoteInitAll(void) { note->playbackState.stereoHeadsetEffects = false; note->playbackState.startSamplePos = 0; note->synthesisState.synthesisBuffers = - AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, sizeof(NoteSynthesisBuffers)); - note->playbackState.attributes.filterBuf = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, FILTER_SIZE); + AudioHeap_AllocDmaMemory(&gAudioCtx.miscPool, sizeof(NoteSynthesisBuffers)); + note->playbackState.attributes.filterBuf = AudioHeap_AllocDmaMemory(&gAudioCtx.miscPool, FILTER_SIZE); } } diff --git a/src/code/audio/audio_seqplayer.c b/src/code/audio/audio_seqplayer.c index bc5115f8f..099f646fe 100644 --- a/src/code/audio/audio_seqplayer.c +++ b/src/code/audio/audio_seqplayer.c @@ -269,7 +269,7 @@ s32 AudioSeq_HandleScriptFlowControl(SequencePlayer* seqPlayer, SeqScriptState* void AudioSeq_InitSequenceChannel(SequenceChannel* channel) { s32 i; - if (channel == &gAudioContext.sequenceChannelNone) { + if (channel == &gAudioCtx.sequenceChannelNone) { return; } @@ -330,7 +330,7 @@ s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) { s32 pad; if (channel->layers[layerIndex] == NULL) { - layer = AudioSeq_AudioListPopBack(&gAudioContext.layerFreeList); + layer = AudioSeq_AudioListPopBack(&gAudioCtx.layerFreeList); channel->layers[layerIndex] = layer; if (layer == NULL) { channel->layers[layerIndex] = NULL; @@ -384,7 +384,7 @@ s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) { void AudioSeq_SeqLayerDisable(SequenceLayer* layer) { if (layer != NULL) { - if ((layer->channel != &gAudioContext.sequenceChannelNone) && (layer->channel->seqPlayer->finished == true)) { + if ((layer->channel != &gAudioCtx.sequenceChannelNone) && (layer->channel->seqPlayer->finished == true)) { AudioPlayback_SeqLayerNoteRelease(layer); } else { AudioPlayback_SeqLayerNoteDecay(layer); @@ -398,7 +398,7 @@ void AudioSeq_SeqLayerFree(SequenceChannel* channel, s32 layerIndex) { SequenceLayer* layer = channel->layers[layerIndex]; if (layer != NULL) { - AudioSeq_AudioListPushBack(&gAudioContext.layerFreeList, &layer->listItem); + AudioSeq_AudioListPushBack(&gAudioCtx.layerFreeList, &layer->listItem); AudioSeq_SeqLayerDisable(layer); channel->layers[layerIndex] = NULL; } @@ -484,10 +484,10 @@ void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) { AudioLoad_SetFontLoadStatus(seqPlayer->defaultFont, LOAD_STATUS_MAYBE_DISCARDABLE); } - if (seqPlayer->defaultFont == gAudioContext.fontCache.temporary.entries[0].id) { - gAudioContext.fontCache.temporary.nextSide = 1; - } else if (seqPlayer->defaultFont == gAudioContext.fontCache.temporary.entries[1].id) { - gAudioContext.fontCache.temporary.nextSide = 0; + if (seqPlayer->defaultFont == gAudioCtx.fontCache.temporary.entries[0].id) { + gAudioCtx.fontCache.temporary.nextSide = 1; + } else if (seqPlayer->defaultFont == gAudioCtx.fontCache.temporary.entries[1].id) { + gAudioCtx.fontCache.temporary.nextSide = 0; } } @@ -520,15 +520,15 @@ void* AudioSeq_AudioListPopBack(AudioListItem* list) { void AudioSeq_InitLayerFreelist(void) { s32 i; - gAudioContext.layerFreeList.prev = &gAudioContext.layerFreeList; - gAudioContext.layerFreeList.next = &gAudioContext.layerFreeList; - gAudioContext.layerFreeList.u.count = 0; - gAudioContext.layerFreeList.pool = NULL; + gAudioCtx.layerFreeList.prev = &gAudioCtx.layerFreeList; + gAudioCtx.layerFreeList.next = &gAudioCtx.layerFreeList; + gAudioCtx.layerFreeList.u.count = 0; + gAudioCtx.layerFreeList.pool = NULL; - for (i = 0; i < ARRAY_COUNT(gAudioContext.sequenceLayers); i++) { - gAudioContext.sequenceLayers[i].listItem.u.value = &gAudioContext.sequenceLayers[i]; - gAudioContext.sequenceLayers[i].listItem.prev = NULL; - AudioSeq_AudioListPushBack(&gAudioContext.layerFreeList, &gAudioContext.sequenceLayers[i].listItem); + for (i = 0; i < ARRAY_COUNT(gAudioCtx.sequenceLayers); i++) { + gAudioCtx.sequenceLayers[i].listItem.u.value = &gAudioCtx.sequenceLayers[i]; + gAudioCtx.sequenceLayers[i].listItem.prev = NULL; + AudioSeq_AudioListPushBack(&gAudioCtx.layerFreeList, &gAudioCtx.sequenceLayers[i].listItem); } } @@ -918,7 +918,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) { layer->tunedSample = NULL; tuning = 1.0f; if (instOrWave >= 0xC0) { - layer->tunedSample = &gAudioContext.synthesisReverbs[instOrWave - 0xC0].tunedSample; + layer->tunedSample = &gAudioCtx.synthesisReverbs[instOrWave - 0xC0].tunedSample; } } @@ -948,12 +948,12 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) { portamento->extent = (freqScale2 / freqScale) - 1.0f; if (PORTAMENTO_IS_SPECIAL(*portamento)) { - speed = seqPlayer->tempo * 0x8000 / gAudioContext.tempoInternalToExternal; + speed = seqPlayer->tempo * 0x8000 / gAudioCtx.tempoInternalToExternal; if (layer->delay != 0) { speed = speed * 0x100 / (layer->delay * layer->portamentoTime); } } else { - speed = 0x20000 / (layer->portamentoTime * gAudioContext.audioBufferParameters.updatesPerFrame); + speed = 0x20000 / (layer->portamentoTime * gAudioCtx.audioBufferParameters.updatesPerFrame); } if (speed >= 0x7FFF) { @@ -980,7 +980,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) { layer->tunedSample = NULL; layer->freqScale = gPitchFrequencies[semitone2]; if (instOrWave >= 0xC0) { - layer->tunedSample = &gAudioContext.synthesisReverbs[instOrWave - 0xC0].tunedSample; + layer->tunedSample = &gAudioCtx.synthesisReverbs[instOrWave - 0xC0].tunedSample; } } break; @@ -996,7 +996,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) { time = 0.0f; } time *= seqPlayer->tempo; - time *= gAudioContext.unk_2870; + time *= gAudioCtx.unk_2870; time /= layer->freqScale; //! FAKE: if (1) {} @@ -1011,7 +1011,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) { // (It's a bit unclear if 'portamento' has actually always been // set when this is reached...) if (PORTAMENTO_IS_SPECIAL(*portamento)) { - speed2 = seqPlayer->tempo * 0x8000 / gAudioContext.tempoInternalToExternal; + speed2 = seqPlayer->tempo * 0x8000 / gAudioCtx.tempoInternalToExternal; speed2 = speed2 * 0x100 / (layer->delay * layer->portamentoTime); if (speed2 >= 0x7FFF) { speed2 = 0x7FFF; @@ -1090,8 +1090,8 @@ s32 AudioSeq_SeqLayerProcessScriptStep3(SequenceLayer* layer, s32 cmd) { } if (channel->velocityRandomVariance != 0) { - floatDelta = layer->velocitySquare * (gAudioContext.audioRandom % channel->velocityRandomVariance) / 100.0f; - if ((gAudioContext.audioRandom & 0x8000) != 0) { + floatDelta = layer->velocitySquare * (gAudioCtx.audioRandom % channel->velocityRandomVariance) / 100.0f; + if ((gAudioCtx.audioRandom & 0x8000) != 0) { floatDelta = -floatDelta; } @@ -1111,8 +1111,8 @@ s32 AudioSeq_SeqLayerProcessScriptStep3(SequenceLayer* layer, s32 cmd) { if (channel->gateTimeRandomVariance != 0) { //! @bug should probably be gateTimeRandomVariance - intDelta = (layer->gateDelay * (gAudioContext.audioRandom % channel->velocityRandomVariance)) / 100; - if ((gAudioContext.audioRandom & 0x4000) != 0) { + intDelta = (layer->gateDelay * (gAudioCtx.audioRandom % channel->velocityRandomVariance)) / 100; + if ((gAudioCtx.audioRandom & 0x4000) != 0) { intDelta = -intDelta; } @@ -1297,9 +1297,9 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) { cmd = (u8)cmdArgs[0]; if (seqPlayer->defaultFont != 0xFF) { - cmdArgU16 = ((u16*)gAudioContext.sequenceFontTable)[seqPlayer->seqId]; - lowBits = gAudioContext.sequenceFontTable[cmdArgU16]; - cmd = gAudioContext.sequenceFontTable[cmdArgU16 + lowBits - cmd]; + cmdArgU16 = ((u16*)gAudioCtx.sequenceFontTable)[seqPlayer->seqId]; + lowBits = gAudioCtx.sequenceFontTable[cmdArgU16]; + cmd = gAudioCtx.sequenceFontTable[cmdArgU16 + lowBits - cmd]; } if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, cmd)) { @@ -1426,9 +1426,9 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) { cmd = (u8)cmdArgs[0]; if (seqPlayer->defaultFont != 0xFF) { - cmdArgU16 = ((u16*)gAudioContext.sequenceFontTable)[seqPlayer->seqId]; - lowBits = gAudioContext.sequenceFontTable[cmdArgU16]; - cmd = gAudioContext.sequenceFontTable[cmdArgU16 + lowBits - cmd]; + cmdArgU16 = ((u16*)gAudioCtx.sequenceFontTable)[seqPlayer->seqId]; + lowBits = gAudioCtx.sequenceFontTable[cmdArgU16]; + cmd = gAudioCtx.sequenceFontTable[cmdArgU16 + lowBits - cmd]; } if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, cmd)) { @@ -1625,13 +1625,13 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) { break; case 0xB7: // channel: random large - channel->unk_22 = (cmdArgs[0] == 0) ? (gAudioContext.audioRandom & 0xFFFF) - : (gAudioContext.audioRandom % cmdArgs[0]); + channel->unk_22 = + (cmdArgs[0] == 0) ? (gAudioCtx.audioRandom & 0xFFFF) : (gAudioCtx.audioRandom % cmdArgs[0]); break; case 0xB8: // channel: random value - scriptState->value = (cmdArgs[0] == 0) ? (gAudioContext.audioRandom & 0xFFFF) - : (gAudioContext.audioRandom % cmdArgs[0]); + scriptState->value = + (cmdArgs[0] == 0) ? (gAudioCtx.audioRandom & 0xFFFF) : (gAudioCtx.audioRandom % cmdArgs[0]); break; case 0xA8: // channel: random range large (only cmd that differs from OoT) @@ -1667,8 +1667,8 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) { case 0xBE: // channel: if (cmdArgs[0] < 5) { if (1) {} - if (gAudioContext.unk_29A8[cmdArgs[0]] != NULL) { - gCustomAudioSeqFunction = gAudioContext.unk_29A8[cmdArgs[0]]; + if (gAudioCtx.unk_29A8[cmdArgs[0]] != NULL) { + gCustomAudioSeqFunction = gAudioCtx.unk_29A8[cmdArgs[0]]; scriptState->value = gCustomAudioSeqFunction(scriptState->value, channel); } } @@ -1880,17 +1880,17 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { seqPlayer->scriptCounter++; tempoChange = seqPlayer->tempo + seqPlayer->unk_0C; - if (tempoChange > gAudioContext.tempoInternalToExternal) { - tempoChange = gAudioContext.tempoInternalToExternal; + if (tempoChange > gAudioCtx.tempoInternalToExternal) { + tempoChange = gAudioCtx.tempoInternalToExternal; } seqPlayer->tempoAcc += tempoChange; - if (seqPlayer->tempoAcc < gAudioContext.tempoInternalToExternal) { + if (seqPlayer->tempoAcc < gAudioCtx.tempoInternalToExternal) { return; } - seqPlayer->tempoAcc -= (u16)gAudioContext.tempoInternalToExternal; + seqPlayer->tempoAcc -= (u16)gAudioCtx.tempoInternalToExternal; seqPlayer->unk_16++; if (seqPlayer->stopScript == true) { @@ -1943,8 +1943,8 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { case 0xDD: // seqPlayer: set tempo seqPlayer->tempo = AudioSeq_ScriptReadU8(seqScript) * TATUMS_PER_BEAT; - if (seqPlayer->tempo > gAudioContext.tempoInternalToExternal) { - seqPlayer->tempo = gAudioContext.tempoInternalToExternal; + if (seqPlayer->tempo > gAudioCtx.tempoInternalToExternal) { + seqPlayer->tempo = gAudioCtx.tempoInternalToExternal; } if ((s16)seqPlayer->tempo <= 0) { @@ -2041,9 +2041,9 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { case 0xCE: // seqPlayer: random value cmd = AudioSeq_ScriptReadU8(seqScript); if (cmd == 0) { - seqScript->value = (gAudioContext.audioRandom >> 2) & 0xFF; + seqScript->value = (gAudioCtx.audioRandom >> 2) & 0xFF; } else { - seqScript->value = (gAudioContext.audioRandom >> 2) % cmd; + seqScript->value = (gAudioCtx.audioRandom >> 2) % cmd; } break; @@ -2198,11 +2198,10 @@ void AudioSeq_ProcessSequences(s32 arg0) { SequencePlayer* seqPlayer; u32 i; - gAudioContext.sampleStateOffset = - (gAudioContext.audioBufferParameters.updatesPerFrame - arg0 - 1) * gAudioContext.numNotes; + gAudioCtx.sampleStateOffset = (gAudioCtx.audioBufferParameters.updatesPerFrame - arg0 - 1) * gAudioCtx.numNotes; - for (i = 0; i < (u32)gAudioContext.audioBufferParameters.numSequencePlayers; i++) { - seqPlayer = &gAudioContext.seqPlayers[i]; + for (i = 0; i < (u32)gAudioCtx.audioBufferParameters.numSequencePlayers; i++) { + seqPlayer = &gAudioCtx.seqPlayers[i]; if (seqPlayer->enabled == true) { AudioSeq_SequencePlayerProcessSequence(seqPlayer); AudioEffects_SequencePlayerProcessSound(seqPlayer); @@ -2250,14 +2249,14 @@ void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer) { void AudioSeq_InitSequencePlayerChannels(s32 playerIndex) { SequenceChannel* channel; - SequencePlayer* seqPlayer = &gAudioContext.seqPlayers[playerIndex]; + SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[playerIndex]; s32 i; s32 j; for (i = 0; i < SEQ_NUM_CHANNELS; i++) { - seqPlayer->channels[i] = AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(SequenceChannel)); + seqPlayer->channels[i] = AudioHeap_AllocZeroed(&gAudioCtx.miscPool, sizeof(SequenceChannel)); if (seqPlayer->channels[i] == NULL) { - seqPlayer->channels[i] = &gAudioContext.sequenceChannelNone; + seqPlayer->channels[i] = &gAudioCtx.sequenceChannelNone; } else { channel = seqPlayer->channels[i]; channel->seqPlayer = seqPlayer; @@ -2277,7 +2276,7 @@ void AudioSeq_InitSequencePlayer(SequencePlayer* seqPlayer) { s32 j; for (i = 0; i < SEQ_NUM_CHANNELS; i++) { - seqPlayer->channels[i] = &gAudioContext.sequenceChannelNone; + seqPlayer->channels[i] = &gAudioCtx.sequenceChannelNone; } seqPlayer->enabled = false; @@ -2303,12 +2302,12 @@ void AudioSeq_InitSequencePlayers(void) { AudioSeq_InitLayerFreelist(); - for (i = 0; i < ARRAY_COUNT(gAudioContext.sequenceLayers); i++) { - gAudioContext.sequenceLayers[i].channel = NULL; - gAudioContext.sequenceLayers[i].enabled = false; + for (i = 0; i < ARRAY_COUNT(gAudioCtx.sequenceLayers); i++) { + gAudioCtx.sequenceLayers[i].channel = NULL; + gAudioCtx.sequenceLayers[i].enabled = false; } - for (i = 0; i < ARRAY_COUNT(gAudioContext.seqPlayers); i++) { - AudioSeq_InitSequencePlayer(&gAudioContext.seqPlayers[i]); + for (i = 0; i < ARRAY_COUNT(gAudioCtx.seqPlayers); i++) { + AudioSeq_InitSequencePlayer(&gAudioCtx.seqPlayers[i]); } } diff --git a/src/code/audio/audio_synthesis.c b/src/code/audio/audio_synthesis.c index d3b25f446..5c72c4452 100644 --- a/src/code/audio/audio_synthesis.c +++ b/src/code/audio/audio_synthesis.c @@ -80,13 +80,13 @@ void AudioSynth_AddReverbBufferEntry(s32 numSamples, s32 updateIndex, s32 reverb s32 count2; s32 nextReverbSubBufPos; - reverb = &gAudioContext.synthesisReverbs[reverbIndex]; + reverb = &gAudioCtx.synthesisReverbs[reverbIndex]; entry = &reverb->bufEntry[reverb->curFrame][updateIndex]; - numSamplesAfterDownsampling = numSamples / gAudioContext.synthesisReverbs[reverbIndex].downsampleRate; + numSamplesAfterDownsampling = numSamples / gAudioCtx.synthesisReverbs[reverbIndex].downsampleRate; // Apply resampling effect - if (gAudioContext.synthesisReverbs[reverbIndex].resampleEffectOn) { + if (gAudioCtx.synthesisReverbs[reverbIndex].resampleEffectOn) { if (reverb->downsampleRate == 1) { count1 = 0; count2 = 0; @@ -199,10 +199,10 @@ void AudioSynth_SyncSampleStates(s32 updateIndex) { s32 sampleStateBaseIndex; s32 i; - sampleStateBaseIndex = gAudioContext.numNotes * updateIndex; - for (i = 0; i < gAudioContext.numNotes; i++) { - noteSampleState = &gAudioContext.notes[i].sampleState; - sampleState = &gAudioContext.sampleStateList[sampleStateBaseIndex + i]; + sampleStateBaseIndex = gAudioCtx.numNotes * updateIndex; + for (i = 0; i < gAudioCtx.numNotes; i++) { + noteSampleState = &gAudioCtx.notes[i].sampleState; + sampleState = &gAudioCtx.sampleStateList[sampleStateBaseIndex + i]; if (noteSampleState->bitField0.enabled) { noteSampleState->bitField0.needsInit = false; } else { @@ -221,51 +221,51 @@ Acmd* AudioSynth_Update(Acmd* abiCmdStart, s32* numAbiCmds, s16* aiBufStart, s32 s32 reverbIndex; SynthesisReverb* reverb; - for (reverseUpdateIndex = gAudioContext.audioBufferParameters.updatesPerFrame; reverseUpdateIndex > 0; + for (reverseUpdateIndex = gAudioCtx.audioBufferParameters.updatesPerFrame; reverseUpdateIndex > 0; reverseUpdateIndex--) { AudioSeq_ProcessSequences(reverseUpdateIndex - 1); - AudioSynth_SyncSampleStates(gAudioContext.audioBufferParameters.updatesPerFrame - reverseUpdateIndex); + AudioSynth_SyncSampleStates(gAudioCtx.audioBufferParameters.updatesPerFrame - reverseUpdateIndex); } curAiBufPos = aiBufStart; - gAudioContext.adpcmCodeBook = NULL; + gAudioCtx.adpcmCodeBook = NULL; // Process/Update all samples multiple times in a single frame - for (reverseUpdateIndex = gAudioContext.audioBufferParameters.updatesPerFrame; reverseUpdateIndex > 0; + for (reverseUpdateIndex = gAudioCtx.audioBufferParameters.updatesPerFrame; reverseUpdateIndex > 0; reverseUpdateIndex--) { if (reverseUpdateIndex == 1) { // Final Update numSamplesPerUpdate = numSamplesPerFrame; } else if ((numSamplesPerFrame / reverseUpdateIndex) >= - gAudioContext.audioBufferParameters.numSamplesPerUpdateMax) { - numSamplesPerUpdate = gAudioContext.audioBufferParameters.numSamplesPerUpdateMax; + gAudioCtx.audioBufferParameters.numSamplesPerUpdateMax) { + numSamplesPerUpdate = gAudioCtx.audioBufferParameters.numSamplesPerUpdateMax; } else if ((numSamplesPerFrame / reverseUpdateIndex) <= - gAudioContext.audioBufferParameters.numSamplesPerUpdateMin) { - numSamplesPerUpdate = gAudioContext.audioBufferParameters.numSamplesPerUpdateMin; + gAudioCtx.audioBufferParameters.numSamplesPerUpdateMin) { + numSamplesPerUpdate = gAudioCtx.audioBufferParameters.numSamplesPerUpdateMin; } else { - numSamplesPerUpdate = gAudioContext.audioBufferParameters.numSamplesPerUpdate; + numSamplesPerUpdate = gAudioCtx.audioBufferParameters.numSamplesPerUpdate; } - for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) { - if (gAudioContext.synthesisReverbs[reverbIndex].useReverb) { - AudioSynth_AddReverbBufferEntry( - numSamplesPerUpdate, gAudioContext.audioBufferParameters.updatesPerFrame - reverseUpdateIndex, - reverbIndex); + for (reverbIndex = 0; reverbIndex < gAudioCtx.numSynthesisReverbs; reverbIndex++) { + if (gAudioCtx.synthesisReverbs[reverbIndex].useReverb) { + AudioSynth_AddReverbBufferEntry(numSamplesPerUpdate, + gAudioCtx.audioBufferParameters.updatesPerFrame - reverseUpdateIndex, + reverbIndex); } } curCmd = AudioSynth_ProcessSamples(curAiBufPos, numSamplesPerUpdate, curCmd, - gAudioContext.audioBufferParameters.updatesPerFrame - reverseUpdateIndex); + gAudioCtx.audioBufferParameters.updatesPerFrame - reverseUpdateIndex); numSamplesPerFrame -= numSamplesPerUpdate; curAiBufPos += numSamplesPerUpdate * SAMPLE_SIZE; } // Update reverb frame info - for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) { - if (gAudioContext.synthesisReverbs[reverbIndex].framesToIgnore != 0) { - gAudioContext.synthesisReverbs[reverbIndex].framesToIgnore--; + for (reverbIndex = 0; reverbIndex < gAudioCtx.numSynthesisReverbs; reverbIndex++) { + if (gAudioCtx.synthesisReverbs[reverbIndex].framesToIgnore != 0) { + gAudioCtx.synthesisReverbs[reverbIndex].framesToIgnore--; } - gAudioContext.synthesisReverbs[reverbIndex].curFrame ^= 1; + gAudioCtx.synthesisReverbs[reverbIndex].curFrame ^= 1; } *numAbiCmds = curCmd - abiCmdStart; @@ -276,8 +276,8 @@ void AudioSynth_DisableSampleStates(s32 updateIndex, s32 noteIndex) { NoteSampleState* sampleState; s32 i; - for (i = updateIndex + 1; i < gAudioContext.audioBufferParameters.updatesPerFrame; i++) { - sampleState = &gAudioContext.sampleStateList[(gAudioContext.numNotes * i) + noteIndex]; + for (i = updateIndex + 1; i < gAudioCtx.audioBufferParameters.updatesPerFrame; i++) { + sampleState = &gAudioCtx.sampleStateList[(gAudioCtx.numNotes * i) + noteIndex]; if (sampleState->bitField0.needsInit) { break; } @@ -572,11 +572,11 @@ Acmd* AudioSynth_FilterReverb(Acmd* cmd, s32 size, SynthesisReverb* reverb) { Acmd* AudioSynth_MixOtherReverbIndex(Acmd* cmd, SynthesisReverb* reverb, s32 updateIndex) { SynthesisReverb* mixReverb; - if (reverb->mixReverbIndex >= gAudioContext.numSynthesisReverbs) { + if (reverb->mixReverbIndex >= gAudioCtx.numSynthesisReverbs) { return cmd; } - mixReverb = &gAudioContext.synthesisReverbs[reverb->mixReverbIndex]; + mixReverb = &gAudioCtx.synthesisReverbs[reverb->mixReverbIndex]; if (mixReverb->downsampleRate == 1) { cmd = AudioSynth_LoadMixedReverbSamples(cmd, mixReverb, updateIndex); aMix(cmd++, DMEM_2CH_SIZE >> 4, reverb->mixReverbStrength, DMEM_WET_LEFT_CH, DMEM_WET_TEMP); @@ -758,31 +758,31 @@ Acmd* AudioSynth_ProcessSamples(s16* aiBuf, s32 numSamplesPerUpdate, Acmd* cmd, s16 reverbIndex; SynthesisReverb* reverb; s32 useReverb; - s32 sampleStateOffset = gAudioContext.numNotes * updateIndex; + s32 sampleStateOffset = gAudioCtx.numNotes * updateIndex; s32 i; - if (gAudioContext.numSynthesisReverbs == 0) { - for (i = 0; i < gAudioContext.numNotes; i++) { - if (gAudioContext.sampleStateList[sampleStateOffset + i].bitField0.enabled) { + if (gAudioCtx.numSynthesisReverbs == 0) { + for (i = 0; i < gAudioCtx.numNotes; i++) { + if (gAudioCtx.sampleStateList[sampleStateOffset + i].bitField0.enabled) { noteIndices[noteCount++] = i; } } } else { NoteSampleState* sampleState; - for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) { - for (i = 0; i < gAudioContext.numNotes; i++) { - sampleState = &gAudioContext.sampleStateList[sampleStateOffset + i]; + for (reverbIndex = 0; reverbIndex < gAudioCtx.numSynthesisReverbs; reverbIndex++) { + for (i = 0; i < gAudioCtx.numNotes; i++) { + sampleState = &gAudioCtx.sampleStateList[sampleStateOffset + i]; if (sampleState->bitField0.enabled && (sampleState->bitField1.reverbIndex == reverbIndex)) { noteIndices[noteCount++] = i; } } } - for (i = 0; i < gAudioContext.numNotes; i++) { - sampleState = &gAudioContext.sampleStateList[sampleStateOffset + i]; + for (i = 0; i < gAudioCtx.numNotes; i++) { + sampleState = &gAudioCtx.sampleStateList[sampleStateOffset + i]; if (sampleState->bitField0.enabled && - (sampleState->bitField1.reverbIndex >= gAudioContext.numSynthesisReverbs)) { + (sampleState->bitField1.reverbIndex >= gAudioCtx.numSynthesisReverbs)) { noteIndices[noteCount++] = i; } } @@ -791,11 +791,11 @@ Acmd* AudioSynth_ProcessSamples(s16* aiBuf, s32 numSamplesPerUpdate, Acmd* cmd, aClearBuffer(cmd++, DMEM_LEFT_CH, DMEM_2CH_SIZE); i = 0; - for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) { + for (reverbIndex = 0; reverbIndex < gAudioCtx.numSynthesisReverbs; reverbIndex++) { s32 subDelay; NoteSampleState* sampleState; - reverb = &gAudioContext.synthesisReverbs[reverbIndex]; + reverb = &gAudioCtx.synthesisReverbs[reverbIndex]; useReverb = reverb->useReverb; if (useReverb) { @@ -815,7 +815,7 @@ Acmd* AudioSynth_ProcessSamples(s16* aiBuf, s32 numSamplesPerUpdate, Acmd* cmd, // Decays reverb over time. The (+ 0x8000) here is -100% aMix(cmd++, DMEM_2CH_SIZE >> 4, reverb->decayRatio + 0x8000, DMEM_WET_LEFT_CH, DMEM_WET_LEFT_CH); - if (((reverb->leakRtl != 0) || (reverb->leakLtr != 0)) && (gAudioContext.soundMode != SOUNDMODE_MONO)) { + if (((reverb->leakRtl != 0) || (reverb->leakLtr != 0)) && (gAudioCtx.soundMode != SOUNDMODE_MONO)) { cmd = AudioSynth_LeakReverb(cmd, reverb); } @@ -830,13 +830,12 @@ Acmd* AudioSynth_ProcessSamples(s16* aiBuf, s32 numSamplesPerUpdate, Acmd* cmd, } while (i < noteCount) { - sampleState = &gAudioContext.sampleStateList[sampleStateOffset + noteIndices[i]]; + sampleState = &gAudioCtx.sampleStateList[sampleStateOffset + noteIndices[i]]; if (sampleState->bitField1.reverbIndex != reverbIndex) { break; } - cmd = AudioSynth_ProcessSample(noteIndices[i], sampleState, - &gAudioContext.notes[noteIndices[i]].synthesisState, aiBuf, - numSamplesPerUpdate, cmd, updateIndex); + cmd = AudioSynth_ProcessSample(noteIndices[i], sampleState, &gAudioCtx.notes[noteIndices[i]].synthesisState, + aiBuf, numSamplesPerUpdate, cmd, updateIndex); i++; } @@ -858,9 +857,9 @@ Acmd* AudioSynth_ProcessSamples(s16* aiBuf, s32 numSamplesPerUpdate, Acmd* cmd, } while (i < noteCount) { - cmd = AudioSynth_ProcessSample( - noteIndices[i], &gAudioContext.sampleStateList[sampleStateOffset + noteIndices[i]], - &gAudioContext.notes[noteIndices[i]].synthesisState, aiBuf, numSamplesPerUpdate, cmd, updateIndex); + cmd = AudioSynth_ProcessSample(noteIndices[i], &gAudioCtx.sampleStateList[sampleStateOffset + noteIndices[i]], + &gAudioCtx.notes[noteIndices[i]].synthesisState, aiBuf, numSamplesPerUpdate, cmd, + updateIndex); i++; } @@ -928,7 +927,7 @@ Acmd* AudioSynth_ProcessSample(s32 noteIndex, NoteSampleState* sampleState, Note s32 sampleDataChunkSize; s16 sampleDataDmemAddr; - note = &gAudioContext.notes[noteIndex]; + note = &gAudioCtx.notes[noteIndex]; flags = A_CONTINUE; // Initialize the synthesis state @@ -1013,23 +1012,23 @@ Acmd* AudioSynth_ProcessSample(s32 noteIndex, NoteSampleState* sampleState, Note // Load the ADPCM codeBook if ((sample->codec == CODEC_ADPCM) || (sample->codec == CODEC_SMALL_ADPCM)) { - if (gAudioContext.adpcmCodeBook != sample->book->codeBook) { + if (gAudioCtx.adpcmCodeBook != sample->book->codeBook) { u32 numEntries; switch (bookOffset) { case 1: - gAudioContext.adpcmCodeBook = &gInvalidAdpcmCodeBook[1]; + gAudioCtx.adpcmCodeBook = &gInvalidAdpcmCodeBook[1]; break; case 2: case 3: default: - gAudioContext.adpcmCodeBook = sample->book->codeBook; + gAudioCtx.adpcmCodeBook = sample->book->codeBook; break; } numEntries = SAMPLES_PER_FRAME * sample->book->order * sample->book->numPredictors; - aLoadADPCM(cmd++, numEntries, gAudioContext.adpcmCodeBook); + aLoadADPCM(cmd++, numEntries, gAudioCtx.adpcmCodeBook); } } @@ -1163,7 +1162,7 @@ Acmd* AudioSynth_ProcessSample(s32 noteIndex, NoteSampleState* sampleState, Note if (sample->medium == MEDIUM_RAM) { // Sample is already loaded into ram samplesToLoadAddr = sampleAddr + (zeroOffset + sampleAddrOffset); - } else if (gAudioContext.unk_29B8) { // always false + } else if (gAudioCtx.unk_29B8) { // always false return cmd; } else if (sample->medium == MEDIUM_UNK) { // This medium is unsupported so terminate processing this note @@ -1405,7 +1404,7 @@ Acmd* AudioSynth_ProcessSample(s32 noteIndex, NoteSampleState* sampleState, Note } // Apply an unknown effect based on the surround sound-mode - if (gAudioContext.soundMode == SOUNDMODE_SURROUND) { + if (gAudioCtx.soundMode == SOUNDMODE_SURROUND) { sampleState->targetVolLeft = sampleState->targetVolLeft >> 1; sampleState->targetVolRight = sampleState->targetVolRight >> 1; if (sampleState->surroundEffectIndex != 0xFF) { @@ -1512,7 +1511,7 @@ Acmd* AudioSynth_ProcessEnvelope(Acmd* cmd, NoteSampleState* sampleState, NoteSy targetVolRight = sampleState->targetVolRight; targetVolRight <<= 4; - if ((gAudioContext.soundMode == SOUNDMODE_SURROUND) && (sampleState->surroundEffectIndex != 0xFF)) { + if ((gAudioCtx.soundMode == SOUNDMODE_SURROUND) && (sampleState->surroundEffectIndex != 0xFF)) { defaultPanVolume = gDefaultPanVolume[sampleState->surroundEffectIndex]; targetVolLeft *= defaultPanVolume; targetVolRight *= defaultPanVolume; diff --git a/src/code/audio/code_8019AF00.c b/src/code/audio/code_8019AF00.c index 9df12e7fe..5fd58a487 100644 --- a/src/code/audio/code_8019AF00.c +++ b/src/code/audio/code_8019AF00.c @@ -3311,7 +3311,7 @@ s32 AudioOcarina_MemoryGameNextNote(void) { #undef OCARINA_SONG_MEMORY_GAME void AudioOcarina_Update(void) { - sOcarinaUpdateTaskStart = gAudioContext.totalTaskCount; + sOcarinaUpdateTaskStart = gAudioCtx.totalTaskCount; if (sOcarinaInstrumentId != OCARINA_INSTRUMENT_OFF) { if (sIsOcarinaInputEnabled == true) { AudioOcarina_ReadControllerInput(); @@ -3399,9 +3399,9 @@ u8 sRequestCustomSequence = false; void AudioOcarina_SetCustomSequence(void) { // Never passes true as sRequestCustomSequence is never set true - if (sRequestCustomSequence && gAudioContext.seqPlayers[SEQ_PLAYER_FANFARE].enabled && - ((u8)gAudioContext.seqPlayers[SEQ_PLAYER_FANFARE].soundScriptIO[0] == (u8)SEQ_IO_VAL_NONE)) { - gAudioContext.seqPlayers[SEQ_PLAYER_FANFARE].seqData = sCustomSequenceScript; + if (sRequestCustomSequence && gAudioCtx.seqPlayers[SEQ_PLAYER_FANFARE].enabled && + ((u8)gAudioCtx.seqPlayers[SEQ_PLAYER_FANFARE].soundScriptIO[0] == (u8)SEQ_IO_VAL_NONE)) { + gAudioCtx.seqPlayers[SEQ_PLAYER_FANFARE].seqData = sCustomSequenceScript; sRequestCustomSequence = false; } } @@ -3753,9 +3753,9 @@ s8 AudioSfx_ComputeReverb(u8 bankId, u8 entryIndex, u8 channelIndex) { } } - if (IS_SEQUENCE_CHANNEL_VALID(gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[channelIndex])) { - scriptAdd = gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[channelIndex]->soundScriptIO[1]; - if (gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[channelIndex]->soundScriptIO[1] <= SEQ_IO_VAL_NONE) { + if (IS_SEQUENCE_CHANNEL_VALID(gAudioCtx.seqPlayers[SEQ_PLAYER_SFX].channels[channelIndex])) { + scriptAdd = gAudioCtx.seqPlayers[SEQ_PLAYER_SFX].channels[channelIndex]->soundScriptIO[1]; + if (gAudioCtx.seqPlayers[SEQ_PLAYER_SFX].channels[channelIndex]->soundScriptIO[1] <= SEQ_IO_VAL_NONE) { scriptAdd = 0; } } @@ -3815,7 +3815,7 @@ f32 AudioSfx_ComputeFreqScale(u8 bankId, u8 entryIndex) { f32 freq = 1.0f; if (entry->sfxParams & SFX_PARAM_RAND_FREQ_LOWER) { - freq = 1.0f - ((gAudioContext.audioRandom & 0xF) / 192.0f); + freq = 1.0f - ((gAudioCtx.audioRandom & 0xF) / 192.0f); } switch (bankId) { @@ -3850,7 +3850,7 @@ f32 AudioSfx_ComputeFreqScale(u8 bankId, u8 entryIndex) { } if ((applyRandScaling == true) && !(entry->sfxParams & SFX_PARAM_RAND_FREQ_SCALE)) { - freq *= 1.0293 - ((gAudioContext.audioRandom & 0xF) / 144.0f); + freq *= 1.0293 - ((gAudioCtx.audioRandom & 0xF) / 144.0f); } dist = entry->dist; @@ -4356,18 +4356,16 @@ s32 Audio_SetGanonsTowerBgmVolume(u8 targetVolume) { (u8)(lowPassFilterCutoff)); // Sets the reverb - for (channelIndex = 0; channelIndex < ARRAY_COUNT(gAudioContext.seqPlayers[SEQ_PLAYER_BGM_MAIN].channels); + for (channelIndex = 0; channelIndex < ARRAY_COUNT(gAudioCtx.seqPlayers[SEQ_PLAYER_BGM_MAIN].channels); channelIndex++) { - if (&gAudioContext.sequenceChannelNone != - gAudioContext.seqPlayers[SEQ_PLAYER_BGM_MAIN].channels[channelIndex]) { + if (&gAudioCtx.sequenceChannelNone != gAudioCtx.seqPlayers[SEQ_PLAYER_BGM_MAIN].channels[channelIndex]) { // soundScriptIO[5] was set to 0x40 in channels 0, 1, and 4 (BGM no longer in OoT) - if ((u8)gAudioContext.seqPlayers[SEQ_PLAYER_BGM_MAIN].channels[channelIndex]->soundScriptIO[5] != + if ((u8)gAudioCtx.seqPlayers[SEQ_PLAYER_BGM_MAIN].channels[channelIndex]->soundScriptIO[5] != (u8)SEQ_IO_VAL_NONE) { // Higher volume leads to lower reverb - reverb = - (((u16)gAudioContext.seqPlayers[SEQ_PLAYER_BGM_MAIN].channels[channelIndex]->soundScriptIO[5] - - targetVolume) + - 0x7F); + reverb = (((u16)gAudioCtx.seqPlayers[SEQ_PLAYER_BGM_MAIN].channels[channelIndex]->soundScriptIO[5] - + targetVolume) + + 0x7F); if (reverb > 0x7F) { reverb = 0x7F; @@ -4556,7 +4554,7 @@ void Audio_SplitBgmChannels(s8 volumeSplit) { channelBits = 0; for (channelIndex = 0; channelIndex < SEQ_NUM_CHANNELS; channelIndex++) { - if (gAudioContext.seqPlayers[sBgmPlayers[i]].channels[channelIndex]->notePriority < notePriority) { + if (gAudioCtx.seqPlayers[sBgmPlayers[i]].channels[channelIndex]->notePriority < notePriority) { // If the note currently playing in the channel is a high enough priority, // then keep the channel on by setting a channelBit // If this condition fails, then the channel will be shut off @@ -4723,7 +4721,7 @@ void Audio_UpdateSceneSequenceResumePoint(void) { if ((seqId != NA_BGM_DISABLED) && (sSeqFlags[seqId & 0xFF & 0xFF] & SEQ_FLAG_RESUME)) { if (sSeqResumePoint != SEQ_RESUME_POINT_NONE) { // Get the current point to resume from - sSeqResumePoint = gAudioContext.seqPlayers[SEQ_PLAYER_BGM_MAIN].soundScriptIO[3]; + sSeqResumePoint = gAudioCtx.seqPlayers[SEQ_PLAYER_BGM_MAIN].soundScriptIO[3]; } else { // Initialize the point to resume from to the start of the sequence sSeqResumePoint = 0; @@ -5139,13 +5137,13 @@ void Audio_PlayAmbience(u8 ambienceId) { u32 Audio_SetAmbienceRandomBend(u8 seqScriptValIn, SequenceChannel* channel) { u32 seqScriptValOut = seqScriptValIn; - gAudioContext.seqPlayers[SEQ_PLAYER_AMBIENCE].applyBend = true; + gAudioCtx.seqPlayers[SEQ_PLAYER_AMBIENCE].applyBend = true; if ((seqScriptValIn == 0) || (seqScriptValIn == 0xFF)) { - gAudioContext.seqPlayers[SEQ_PLAYER_AMBIENCE].bend = 1.0f; + gAudioCtx.seqPlayers[SEQ_PLAYER_AMBIENCE].bend = 1.0f; } else { seqScriptValOut = AudioThread_NextRandom(); - gAudioContext.seqPlayers[SEQ_PLAYER_AMBIENCE].bend = 1.0293 - ((gAudioContext.audioRandom & 0xF) / 144.0f); + gAudioCtx.seqPlayers[SEQ_PLAYER_AMBIENCE].bend = 1.0293 - ((gAudioCtx.audioRandom & 0xF) / 144.0f); return seqScriptValOut; } diff --git a/src/code/audio/code_801A5BD0.c b/src/code/audio/code_801A5BD0.c index d76970829..0e509670b 100644 --- a/src/code/audio/code_801A5BD0.c +++ b/src/code/audio/code_801A5BD0.c @@ -599,7 +599,7 @@ void AudioSfx_PlayActiveSfx(u8 bankId) { // If entry is not empty if (entryIndex != 0xFF) { entry = &gSfxBanks[bankId][entryIndex]; - channel = gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[sCurSfxPlayerChannelIndex]; + channel = gAudioCtx.seqPlayers[SEQ_PLAYER_SFX].channels[sCurSfxPlayerChannelIndex]; if (entry->state == SFX_STATE_READY) { // Initialize a sfx (new sfx request) @@ -847,7 +847,7 @@ void AudioSfx_StopById(u32 sfxId) { } void AudioSfx_ProcessRequests(void) { - if (gAudioContext.seqPlayers[SEQ_PLAYER_SFX].enabled) { + if (gAudioCtx.seqPlayers[SEQ_PLAYER_SFX].enabled) { while (sSfxRequestWriteIndex != sSfxRequestReadIndex) { AudioSfx_ProcessRequest(); sSfxRequestReadIndex++; @@ -886,7 +886,7 @@ void AudioSfx_StepBankLerp(u8 bankId) { void AudioSfx_ProcessActiveSfx(void) { u8 bankId; - if (gAudioContext.seqPlayers[SEQ_PLAYER_SFX].enabled) { + if (gAudioCtx.seqPlayers[SEQ_PLAYER_SFX].enabled) { sCurSfxPlayerChannelIndex = 0; for (bankId = 0; bankId < ARRAY_COUNT(gSfxBanks); bankId++) { diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 4a5017ad5..0fbd78e38 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -2249,7 +2249,7 @@ 0x801D5FD4:("D_801D5FD4","UNK_TYPE1","",0x1), 0x801D5FE0:("D_801D5FE0","UNK_PTR","",0x4), 0x801D5FE4:("D_801D5FE4","UNK_TYPE1","",0x1), - 0x801D5FE8:("gAudioContextInitalized","UNK_TYPE4","",0x4), + 0x801D5FE8:("gAudioCtxInitalized","UNK_TYPE4","",0x4), 0x801D5FEC:("D_801D5FEC","UNK_TYPE4","",0x4), 0x801D5FF0:("D_801D5FF0","UNK_TYPE4","",0x4), 0x801D5FF4:("D_801D5FF4","UNK_TYPE4","",0x4), @@ -4353,7 +4353,7 @@ 0x80200BCC:("D_80200BCC","UNK_TYPE1","",0x1), 0x80200BCE:("D_80200BCE","UNK_TYPE1","",0x1), 0x80200BD0:("D_80200BD0","UNK_TYPE1","",0x1), - 0x80200C70:("gAudioContext","AudioContext","",0x81F8), + 0x80200C70:("gAudioCtx","AudioContext","",0x81F8), 0x80208E68:("gCustomAudioUpdateFunction","UNK_TYPE4","",0x4), 0x80208E6C:("gCustomAudioSeqFunction","UNK_TYPE4","",0x4), 0x80208E70:("gCustomAudioReverbFunction","UNK_TYPE4","",0x4), From 7dfbca5ace6459b7d8fd1cbe8ac011c8b257580b Mon Sep 17 00:00:00 2001 From: Parker Burnett Date: Thu, 13 Oct 2022 14:29:19 -0700 Subject: [PATCH 04/12] Update README.md (#1116) Fixing game link to redirect to the correct place --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d746db2a..d94b47950 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ please be aware that the codebase could drastically change at any time. Also not parts of the ROM may not be 'shiftable' yet, so modifying them could currently be difficult. ``` -This is a WIP **decompilation** of ***The Legend of Zelda: Majora's Mask***. The purpose of the project is to recreate a source code base for the game from scratch, using information found inside the game along with static and/or dynamic analysis. **It is not, and will not, produce a PC port.** For frequently asked questions, you can visit [our website](https://zelda64.dev/mm), and for more information you can get in touch with the team on our [Discord server](https://discord.zelda64.dev). +This is a WIP **decompilation** of ***The Legend of Zelda: Majora's Mask***. The purpose of the project is to recreate a source code base for the game from scratch, using information found inside the game along with static and/or dynamic analysis. **It is not, and will not, produce a PC port.** For frequently asked questions, you can visit [our website](https://zelda64.dev/games/mm), and for more information you can get in touch with the team on our [Discord server](https://discord.zelda64.dev). The only version currently supported is N64 US, but we intend to eventually support every retail version of the original game (i.e. not versions of MM3D, which is a totally different game). From b35accc95592479499cd3536988d3b7a632c351f Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Fri, 14 Oct 2022 04:59:13 -0700 Subject: [PATCH 05/12] ObjY2Shutter OK and documented (#1119) * ovl_Obj_Y2shutter decompiled * cleanups * more review fixes * format * document shutter assets and add ShutterType enum * rename xml assets, remove unnecessary parenthesis * move ShutterType enum to header file * forgot enum in comparison * Respond to review * Finish docs * Raise/Lower -> Open/Close Co-authored-by: Chloe Co-authored-by: Chloe <> --- assets/xml/objects/object_kaizoku_obj.xml | 8 +- spec | 3 +- .../ovl_Obj_Y2shutter/z_obj_y2shutter.c | 147 ++++++++++++++++-- .../ovl_Obj_Y2shutter/z_obj_y2shutter.h | 14 +- tools/disasm/functions.txt | 2 +- tools/disasm/variables.txt | 6 +- 6 files changed, 155 insertions(+), 25 deletions(-) diff --git a/assets/xml/objects/object_kaizoku_obj.xml b/assets/xml/objects/object_kaizoku_obj.xml index 6a7457e1c..9ae61accf 100644 --- a/assets/xml/objects/object_kaizoku_obj.xml +++ b/assets/xml/objects/object_kaizoku_obj.xml @@ -7,13 +7,13 @@ - - + + - - + + diff --git a/spec b/spec index 52dfd5ba8..a960b8f6d 100644 --- a/spec +++ b/spec @@ -4135,8 +4135,7 @@ beginseg name "ovl_Obj_Y2shutter" compress include "build/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.o" - include "build/data/ovl_Obj_Y2shutter/ovl_Obj_Y2shutter.data.o" - include "build/data/ovl_Obj_Y2shutter/ovl_Obj_Y2shutter.reloc.o" + include "build/src/overlays/actors/ovl_Obj_Y2shutter/ovl_Obj_Y2shutter_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c index 6b67bc068..b8110ce6a 100644 --- a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c +++ b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c @@ -1,10 +1,11 @@ /* * File: z_obj_y2shutter.c * Overlay: ovl_Obj_Y2shutter - * Description: Pirates' Fortress sliding grate + * Description: Pirates' Fortress sliding grated/barred shutters */ #include "z_obj_y2shutter.h" +#include "objects/object_kaizoku_obj/object_kaizoku_obj.h" #define FLAGS (ACTOR_FLAG_10) @@ -15,7 +16,19 @@ void ObjY2shutter_Destroy(Actor* thisx, PlayState* play); void ObjY2shutter_Update(Actor* thisx, PlayState* play); void ObjY2shutter_Draw(Actor* thisx, PlayState* play); -#if 0 +typedef struct ShutterInfo { + /* 0x00 */ Gfx* dList; + /* 0x04 */ CollisionHeader* colHeader; + /* 0x08 */ f32 openedOffsetY; + /* 0x0C */ f32 openVelocity; + /* 0x10 */ f32 openAccel; + /* 0x14 */ f32 closeVelocity; + /* 0x18 */ f32 closeAccel; + /* 0x1C */ u8 openStartSettleTimer; + /* 0x1D */ u8 openEndAndCloseSettleTimer; + /* 0x1E */ u8 openTimer; +} ShutterInfo; // size = 0x20 + const ActorInit Obj_Y2shutter_InitVars = { ACTOR_OBJ_Y2SHUTTER, ACTORCAT_BG, @@ -28,24 +41,136 @@ const ActorInit Obj_Y2shutter_InitVars = { (ActorFunc)ObjY2shutter_Draw, }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80B9AEB0[] = { +ShutterInfo sShutterInfo[] = { + { gPirateBarredShutterDL, &gPirateBarredShutterCol, 120.0f, 20.0f, 3.0f, -20.0f, 3.0f, 4, 8, 160 }, + { gPirateGratedShutterDL, &gPirateGratedShutterCol, 150.0f, 1.0f, 0.04f, -1.0f, 0.04f, 6, 12, 160 }, +}; + +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 800, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 800, ICHAIN_STOP), }; -#endif +void ObjY2shutter_Init(Actor* thisx, PlayState* play) { + s32 pad[2]; + ShutterInfo* info = &sShutterInfo[OBJY2SHUTTER_GET_TYPE(thisx)]; + ObjY2shutter* this = THIS; -extern InitChainEntry D_80B9AEB0[]; + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); + DynaPolyActor_Init(&this->dyna, 0); + DynaPolyActor_LoadMesh(play, &this->dyna, info->colHeader); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Y2shutter/ObjY2shutter_Init.s") +void ObjY2shutter_Destroy(Actor* thisx, PlayState* play) { + ObjY2shutter* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Y2shutter/ObjY2shutter_Destroy.s") + DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Y2shutter/func_80B9AA20.s") +void ObjY2shutter_SetupOpen(ObjY2shutter* this, ShutterInfo* info, ShutterType shutterType) { + this->openTimer = info->openTimer; + this->settleTimer = info->openStartSettleTimer; + if (shutterType == SHUTTER_BARRED) { + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Y2shutter/ObjY2shutter_Update.s") +void ObjY2shutter_Update(Actor* thisx, PlayState* play) { + s32 pad; + ObjY2shutter* this = THIS; + ShutterType shutterType = OBJY2SHUTTER_GET_TYPE(&this->dyna.actor); + ShutterInfo* info = &sShutterInfo[shutterType]; + f32 targetPosY = this->dyna.actor.world.pos.y; + f32 targetVelocityY = 0.0f; + f32 accelY = 0.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Y2shutter/ObjY2shutter_Draw.s") + sShutterInfo[0].openTimer = DREG(84) + 160; + sShutterInfo[1].openTimer = DREG(85) + 160; + + if (((shutterType == SHUTTER_BARRED) && (DREG(86) != 0)) || ((shutterType != SHUTTER_BARRED) && (DREG(87) != 0))) { + if (shutterType == SHUTTER_BARRED) { + DREG(86) = 0; + } else { + DREG(87) = 0; + } + + if (Flags_GetSwitch(play, OBJY2SHUTTER_GET_SWITCHFLAG(&this->dyna.actor))) { + Flags_UnsetSwitch(play, OBJY2SHUTTER_GET_SWITCHFLAG(&this->dyna.actor)); + } else { + Flags_SetSwitch(play, OBJY2SHUTTER_GET_SWITCHFLAG(&this->dyna.actor)); + } + } + + if (this->settleTimer == 0) { + if (Flags_GetSwitch(play, OBJY2SHUTTER_GET_SWITCHFLAG(&this->dyna.actor))) { + s16 cutscene = this->dyna.actor.cutscene; + + if (this->openTimer == 0) { + if ((cutscene >= 0) && !ActorCutscene_GetCanPlayNext(cutscene)) { + ActorCutscene_SetIntentToPlay(cutscene); + } else if (cutscene >= 0) { + ActorCutscene_StartAndSetUnkLinkFields(cutscene, &this->dyna.actor); + this->openTimer = -1; + } else { + ObjY2shutter_SetupOpen(this, info, shutterType); + } + } else if (this->openTimer < 0) { + if (func_800F22C4(cutscene, &this->dyna.actor)) { + ObjY2shutter_SetupOpen(this, info, shutterType); + } + } else { + targetPosY = this->dyna.actor.home.pos.y + info->openedOffsetY; + targetVelocityY = info->openVelocity; + accelY = info->openAccel; + if (this->openTimer < 2) { + Flags_UnsetSwitch(play, OBJY2SHUTTER_GET_SWITCHFLAG(&this->dyna.actor)); + } else { + this->openTimer--; + } + } + } else if (this->openTimer != 0) { + this->openTimer = 0; + this->settleTimer = info->openStartSettleTimer; + if (shutterType == SHUTTER_BARRED) { + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_METALDOOR_CLOSE); + } + } else { + targetPosY = this->dyna.actor.home.pos.y; + targetVelocityY = info->closeVelocity; + accelY = info->closeAccel; + } + } + + Math_StepToF(&this->dyna.actor.velocity.y, targetVelocityY, accelY); + this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; + + if (((this->dyna.actor.world.pos.y - targetPosY) * targetVelocityY) >= 0.0f) { + this->dyna.actor.world.pos.y = targetPosY; + this->dyna.actor.velocity.y = 0.0f; + if (!this->isStationary) { + this->isStationary = true; + this->settleTimer = info->openEndAndCloseSettleTimer; + if (shutterType != SHUTTER_BARRED) { + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); + } + } + } else { + this->isStationary = false; + if (shutterType != SHUTTER_BARRED) { + func_800B9010(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); + } + } + + if (DECR(this->settleTimer)) { + this->dyna.actor.shape.yOffset = 2.0f * (this->settleTimer & 1) * this->settleTimer; + } +} + +void ObjY2shutter_Draw(Actor* thisx, PlayState* play) { + ObjY2shutter* this = THIS; + ShutterInfo* info = &sShutterInfo[(OBJY2SHUTTER_GET_TYPE(&this->dyna.actor))]; + + Gfx_DrawDListOpa(play, info->dList); +} diff --git a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.h b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.h index 217bcee6c..dcc95b1b1 100644 --- a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.h +++ b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.h @@ -6,10 +6,20 @@ struct ObjY2shutter; typedef struct ObjY2shutter { - /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x1C]; + /* 0x000 */ DynaPolyActor dyna; + /* 0x15C */ s16 openTimer; + /* 0x15E */ u8 isStationary; // true if the door is neither opening nor closing + /* 0x15F */ u8 settleTimer; } ObjY2shutter; // size = 0x160 extern const ActorInit Obj_Y2shutter_InitVars; +typedef enum { + /* 0x0 */ SHUTTER_BARRED, + /* 0x1 */ SHUTTER_GRATED, +} ShutterType; + +#define OBJY2SHUTTER_GET_TYPE(thisx) (((thisx)->params >> 7) & 1) +#define OBJY2SHUTTER_GET_SWITCHFLAG(thisx) ((thisx)->params & 0x7F) + #endif // Z_OBJ_Y2SHUTTER_H diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 77810cc22..b77506370 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -14954,7 +14954,7 @@ 0x80B9A8E8:("ObjY2lift_Draw",), 0x80B9A980:("ObjY2shutter_Init",), 0x80B9A9EC:("ObjY2shutter_Destroy",), - 0x80B9AA20:("func_80B9AA20",), + 0x80B9AA20:("ObjY2shutter_SetupOpen",), 0x80B9AA54:("ObjY2shutter_Update",), 0x80B9AE00:("ObjY2shutter_Draw",), 0x80B9AF50:("func_80B9AF50",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 0fbd78e38..3ac247a29 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -15316,11 +15316,7 @@ 0x80B9A920:("Obj_Y2lift_InitVars","UNK_TYPE1","",0x1), 0x80B9A940:("D_80B9A940","UNK_TYPE1","",0x1), 0x80B9AE50:("Obj_Y2shutter_InitVars","UNK_TYPE1","",0x1), - 0x80B9AE70:("D_80B9AE70","UNK_TYPE1","",0x1), - 0x80B9AE8C:("D_80B9AE8C","UNK_TYPE1","",0x1), - 0x80B9AE8D:("D_80B9AE8D","UNK_TYPE1","",0x1), - 0x80B9AE8E:("D_80B9AE8E","UNK_TYPE1","",0x1), - 0x80B9AEAE:("D_80B9AEAE","UNK_TYPE1","",0x1), + 0x80B9AE70:("D_80B9AE70","UNK_TYPE1","",0x40), 0x80B9AEB0:("D_80B9AEB0","UNK_TYPE1","",0x1), 0x80B9B660:("Obj_Boat_InitVars","UNK_TYPE1","",0x1), 0x80B9B680:("D_80B9B680","UNK_TYPE1","",0x1), From a4f0d8ea88843041aad8697230300315cfa159cd Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Fri, 14 Oct 2022 21:05:20 -0400 Subject: [PATCH 06/12] Match 3 Functions (z_actor OK, z_mir_ray OK, z_mir_ray3 OK) (#1122) * match MirRay_ReflectedBeam * match Actor_DrawLensActors * match func_80B9E8D4 * void --- include/z64.h | 2 +- spec | 8 - src/code/z_actor.c | 226 ++++++------------ src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c | 137 ++++++----- src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c | 42 ++-- 5 files changed, 165 insertions(+), 250 deletions(-) diff --git a/include/z64.h b/include/z64.h index da1f88323..4b2682b1b 100644 --- a/include/z64.h +++ b/include/z64.h @@ -1089,7 +1089,7 @@ struct PlayState { /* 0x18B9C */ char unk_18B9C[0x2B8]; /* 0x18E54 */ SceneTableEntry* loadedScene; /* 0x18E58 */ char unk_18E58[0x10]; - /* 0x18E68 */ s32 unk_18E68; + /* 0x18E68 */ void* unk_18E68; /* 0x18E6C */ char unk_18E6C[0x3EC]; }; // size = 0x19258 diff --git a/spec b/spec index a960b8f6d..a021c04f9 100644 --- a/spec +++ b/spec @@ -1196,11 +1196,7 @@ beginseg name "ovl_Mir_Ray" compress include "build/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_Mir_Ray/ovl_Mir_Ray_reloc.o" -#else - include "build/data/ovl_Mir_Ray/ovl_Mir_Ray.reloc.o" -#endif endseg beginseg @@ -4170,11 +4166,7 @@ beginseg name "ovl_Mir_Ray3" compress include "build/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_Mir_Ray3/ovl_Mir_Ray3_reloc.o" -#else - include "build/data/ovl_Mir_Ray3/ovl_Mir_Ray3.reloc.o" -#endif endseg beginseg diff --git a/src/code/z_actor.c b/src/code/z_actor.c index c5783f4d7..01894f269 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2614,200 +2614,128 @@ void Actor_DrawLensOverlay(Gfx** gfxP, s32 lensMaskSize) { ((LENS_MASK_ACTIVE_SIZE - lensMaskSize) * 0.003f) + 1.0f); } -#ifdef NON_EQUIVALENT -void Actor_DrawLensActors(PlayState* play, s32 numActors, Actor** actors) { +void Actor_DrawLensActors(PlayState* play, s32 numInvisibleActors, Actor** invisibleActors) { + s32 dbgVar1; + s32 dbgVar2; s32 spB4; + Actor** invisibleActor; Gfx* spAC; - void* spA8; // pad - s32 spA4; - // void* sp34; - // Gfx* temp_s1_11; - // Gfx** temp_a0_2; - // Gfx** temp_a1; - // GraphicsContext* temp_s2; - // void* temp_s1_10; - // void* temp_s1_7; - // void* temp_s1_8; - // void* temp_s1_9; - // Gfx* phi_s1; - Gfx* phi_s1_2; - // void* phi_s1_4; + void* spA8; + void* spA4; + GraphicsContext* gfxCtx = play->state.gfxCtx; + Gfx* tmp; + s32 pad[2]; - OPEN_DISPS(play->state.gfxCtx); - // temp_s2 = play->state.gfxCtx; + dbgVar1 = true; + dbgVar2 = true; - if (numActors > 0) { - spAC = POLY_XLU_DISP; - // sp34 = play + 0x18000; + if (dbgVar1) { + dbgVar1 = numInvisibleActors > 0; + } + + OPEN_DISPS(gfxCtx); + + if (dbgVar1) { + tmp = POLY_XLU_DISP; + spA8 = gfxCtx->zbuffer; spA4 = play->unk_18E68; - PreRender_SetValues(&play->pauseBgPreRender, D_801FBBCC, D_801FBBCE, __gfxCtx->curFrameBuffer, - __gfxCtx->zbuffer); + if (dbgVar2) { + PreRender_SetValues(&play->pauseBgPreRender, D_801FBBCC, D_801FBBCE, gfxCtx->curFrameBuffer, spA8); - func_80170200(&play->pauseBgPreRender, &spAC, __gfxCtx->zbuffer, (void*)spA4); + spAC = tmp; + func_80170200(&play->pauseBgPreRender, &spAC, spA8, spA4); + tmp = spAC; + } - // spAC->words.w0 = 0xE7000000; - // spAC->words.w1 = 0; - // temp_s1_2 = spAC + 8; - gDPPipeSync(spAC++); + gDPPipeSync(tmp++); + gDPSetPrimDepth(tmp++, 0, 0); - // temp_s1_2->words.w0 = 0xEE000000; - // temp_s1_2->words.w1 = 0; - // temp_s1_3 = temp_s1_2 + 8; - gDPSetPrimDepth(spAC++, 0, 0); - - // temp_s1_3->words.w0 = 0xEF002C30; - // temp_s1_3->words.w1 = 0xAF504365; - // temp_s1_4 = temp_s1_3 + 8; - gDPSetOtherMode(spAC++, + gDPSetOtherMode(tmp++, G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PRIM | Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA) | GBL_c2(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA)); - // temp_s1_4->words.w1 = 0xFF; - // temp_s1_4->words.w0 = 0xFA000000; - // temp_s1_5 = temp_s1_4 + 8; - gDPSetPrimColor(spAC++, 0, 0, 0, 0, 0, 255); - // temp_s1_5 = spAC; + gDPSetPrimColor(tmp++, 0, 0, 0, 0, 0, 255); if (play->roomCtx.curRoom.unk5 == 0) { - // temp_s1_5->words.w0 = 0xFC61E6C3; - // temp_s1_5->words.w1 = 0x11CF9FCF; - // phi_s1 = temp_s1_5 + 8; - gDPSetCombineLERP(spAC++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, + gDPSetCombineLERP(tmp++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0); } else { - // temp_s1_5->words.w0 = 0xFC119623; - // temp_s1_5->words.w1 = 0xFF2FFFFF; - // phi_s1 = temp_s1_5 + 8; - gDPSetCombineMode(spAC++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetCombineMode(tmp++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); } - // spAC = phi_s1; + spAC = tmp; Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize); - phi_s1_2 = func_801660B8(play, spAC); + tmp = func_801660B8(play, spAC); - for (spB4 = 0; spB4 < numActors; spB4++, actors++) { - Actor_Draw(play, *actors); + for (spB4 = 0, invisibleActor = invisibleActors; spB4 < numInvisibleActors; spB4++, invisibleActor++) { + POLY_XLU_DISP = tmp; + Actor_Draw(play, *invisibleActor); + tmp = POLY_XLU_DISP; } - // temp_s0_2 = &play->pauseBgPreRender; + if (dbgVar2) { + gDPPipeSync(tmp++); - // phi_s1_2->words.w0 = 0xE7000000; - // phi_s1_2->words.w1 = 0; - // temp_s1_7 = phi_s1_2 + 8; - gDPPipeSync(phi_s1_2++); + gDPSetOtherMode(tmp++, + G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_THRESHOLD | G_ZS_PRIM | AA_EN | IM_RD | CVG_DST_WRAP | ZMODE_OPA | CVG_X_ALPHA | + ALPHA_CVG_SEL | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1) | + GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1)); - // temp_s1_7->unk_0 = 0xEF002CF0; - // temp_s1_7->unk_4 = 0xF5A714D; - // temp_s1_8 = temp_s1_7 + 8; - gDPSetOtherMode(phi_s1_2++, - G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | - G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_THRESHOLD | G_ZS_PRIM | AA_EN | IM_RD | CVG_DST_WRAP | ZMODE_OPA | CVG_X_ALPHA | - ALPHA_CVG_SEL | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1) | - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1)); + gDPSetBlendColor(tmp++, 255, 255, 255, 0); + gDPSetPrimColor(tmp++, 0, 0xFF, 0, 0, 0, 32); - // temp_s1_8->unk_4 = -0x100; - // temp_s1_8->unk_0 = 0xF9000000; - // temp_s1_9 = temp_s1_8 + 8; - gDPSetBlendColor(phi_s1_2++, 255, 255, 255, 0); + if (play->roomCtx.curRoom.unk5 == 0) { + gDPSetCombineMode(tmp++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + } else { + gDPSetCombineLERP(tmp++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, + TEXEL0, PRIMITIVE, 0); + } - // temp_s1_9->unk_4 = 0x20; - // temp_s1_9->unk_0 = 0xFA0000FF; - // temp_s1_10 = temp_s1_9 + 8; - gDPSetPrimColor(phi_s1_2++, 0, 0xFF, 0, 0, 0, 32); + gDPSetColorImage(tmp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, play->pauseBgPreRender.width, spA4); - // temp_a0_2 = &spAC; - // if (sp34->unk_6E5 == 0) { - if (play->roomCtx.curRoom.unk5 == 0) { - // temp_s1_10->unk_0 = 0xFC119623; - // temp_s1_10->unk_4 = 0xFF2FFFFF; - // phi_s1_4 = temp_s1_10 + 8; - gDPSetCombineMode(phi_s1_2++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - //} else { - } else { - // temp_s1_10->unk_4 = 0x11CF9FCF; - // temp_s1_10->unk_0 = 0xFC61E6C3; - // phi_s1_4 = temp_s1_10 + 8; - gDPSetCombineLERP(phi_s1_2++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, - TEXEL0, PRIMITIVE, 0); + spAC = tmp; + Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize); + tmp = spAC; - //} + gDPPipeSync(tmp++); + gDPSetBlendColor(tmp++, 255, 255, 255, 8); + + gDPSetColorImage(tmp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, play->pauseBgPreRender.width, + play->pauseBgPreRender.fbuf); + + spAC = tmp; + func_8016FDB8(&play->pauseBgPreRender, &spAC, (void*)spA4, spA8, 1); + tmp = spAC; } - // phi_s1_4->unk_0 = (s32) (((sp34->unk_B4C - 1) & 0xFFF) | 0xFF100000); - // temp_s1_11 = phi_s1_4 + 8; - // phi_s1_4->unk_4 = spA4; - gDPSetColorImage(phi_s1_2++, G_IM_FMT_RGBA, G_IM_SIZ_16b, ((play->pauseBgPreRender.width - 1) & 0xFFF), spA4); - // temp_s1_11 = phi_s1_2; - spAC = phi_s1_2; - - // spAC = temp_s1_11; - Actor_DrawLensOverlay(&spAC, (s32)play->actorCtx.lensMaskSize); - // temp_s1_11->words.w0 = 0xE7000000; - // temp_s1_11->words.w1 = 0; - // temp_s1_12 = temp_s1_11 + 8; - gDPPipeSync(spAC++); - - // temp_s1_12->words.w1 = -0xF8; - // temp_s1_12->words.w0 = 0xF9000000; - // temp_s1_13 = temp_s1_12 + 8; - gDPSetBlendColor(spAC++, 255, 255, 255, 8); - - // temp_s1_14 = temp_s1_13 + 8; - // temp_s1_13->words.w0 = ((sp34->unk_B4C - 1) & 0xFFF) | 0xFF100000; - // temp_s1_13->words.w1 = sp34->unk_B5C; - gDPSetColorImage(spAC++, G_IM_FMT_RGBA, G_IM_SIZ_16b, ((play->pauseBgPreRender.width - 1) & 0xFFF), - play->pauseBgPreRender.fbuf); - - // temp_a1 = &spAC; - // spAC = temp_s1_14; - // func_8016FDB8(&play->pauseBgPreRender, temp_a1, (void* ) spA4, spA8, 1U); - func_8016FDB8(&play->pauseBgPreRender, &spAC, (void*)spA4, __gfxCtx->zbuffer, 1U); - // - // POLY_OPA_DISP = temp_s1_14; - POLY_OPA_DISP = spAC; + POLY_XLU_DISP = tmp; } - // temp_s1_15 = OVERLAY_DISP; - // temp_s1_15->words.w0 = 0xE7000000; - // temp_s1_15->words.w1 = 0; - // temp_s1_16 = temp_s1_15 + 8; - spAC = OVERLAY_DISP; - gDPPipeSync(spAC++); + tmp = OVERLAY_DISP; - // temp_s1_16->words.w0 = 0xEF002C30; - // temp_s1_16->words.w1 = 0x00504345; - // temp_s1_17 = temp_s1_16 + 8; - gDPSetOtherMode(spAC++, + gDPPipeSync(tmp++); + + gDPSetOtherMode(tmp++, G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2); - // temp_s1_17->words.w0 = 0xFC61E6C3; - // temp_s1_17->words.w1 = 0x11CF9FCF; - // temp_s1_18 = temp_s1_17 + 8; - gDPSetCombineLERP(spAC++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, + gDPSetCombineLERP(tmp++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0); + gDPSetPrimColor(tmp++, 0, 0, 74, 0, 0, 74); - // temp_s1_18->words.w0 = 0xFA000000; - // temp_s1_18->words.w1 = 0x4A00004A; - // spAC = temp_s1_18 + 8; - gDPSetPrimColor(spAC++, 0, 0, 74, 0, 0, 74); - - Actor_DrawLensOverlay(&spAC, (s32)play->actorCtx.lensMaskSize); - + spAC = tmp; + Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize); OVERLAY_DISP = spAC; - CLOSE_DISPS(play->state.gfxCtx); + CLOSE_DISPS(gfxCtx); } -#else -void Actor_DrawLensActors(PlayState* play, s32 numActors, Actor** actors); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_DrawLensActors.s") -#endif s32 func_800BA2D8(PlayState* play, Actor* actor) { return func_800BA2FC(play, actor, &actor->projectedPos, actor->projectedW); diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 5160dc074..dad2ccbc3 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -483,8 +483,6 @@ void MirRay_RemoveSimilarReflections(MirRayShieldReflection* reflection) { } // Creates the reflected beam's collider (to interact with objects) and places and orients the shield images -#ifdef NON_MATCHING -// Beginning block re-ordered void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* reflection) { Player* player = GET_PLAYER(play); s32 i; @@ -498,8 +496,6 @@ void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* f32 spE8[3]; f32 normalVec[3]; MtxF* shieldMtx = &player->shieldMf; - Vec3f vecA; - Vec3f vecC; spE8[0] = -(shieldMtx->xz * this->reflectRange) * this->reflectIntensity * 400.0f; spE8[1] = -(shieldMtx->yz * this->reflectRange) * this->reflectIntensity * 400.0f; @@ -513,85 +509,86 @@ void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* vecD.y = spE8[1] + vecB.y; vecD.z = spE8[2] + vecB.z; - vecA.x = vecB.x + (shieldMtx->xx * 300.0f); - vecA.y = vecB.y + (shieldMtx->yx * 300.0f); - vecA.z = vecB.z + (shieldMtx->zx * 300.0f); + { + Vec3f vecA; + Vec3f vecC; - vecC.x = vecD.x + (shieldMtx->xx * 300.0f); - vecC.y = vecD.y + (shieldMtx->yx * 300.0f); - vecC.z = vecD.z + (shieldMtx->zx * 300.0f); + vecA.x = vecB.x + (shieldMtx->xx * 300.0f); + vecA.y = vecB.y + (shieldMtx->yx * 300.0f); + vecA.z = vecB.z + (shieldMtx->zx * 300.0f); - Collider_SetQuadVertices(&this->collider2, &vecA, &vecB, &vecC, &vecD); + vecC.x = vecD.x + (shieldMtx->xx * 300.0f); + vecC.y = vecD.y + (shieldMtx->yx * 300.0f); + vecC.z = vecD.z + (shieldMtx->zx * 300.0f); - for (i = 0; i < 6; i++) { - if (reflection[i].reflectionPoly != NULL) { - normalVec[0] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.x); - normalVec[1] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.y); - normalVec[2] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.z); + Collider_SetQuadVertices(&this->collider2, &vecA, &vecB, &vecC, &vecD); - if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist, - &vecB, &vecD, &sp118, 1)) { + for (i = 0; i < 6; i++) { + if (reflection[i].reflectionPoly != NULL) { + normalVec[0] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.x); + normalVec[1] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.y); + normalVec[2] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.z); - reflection[i].pos.x = sp118.x; - reflection[i].pos.y = sp118.y; - reflection[i].pos.z = sp118.z; + if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist, + &vecB, &vecD, &sp118, 1)) { - temp_f0 = sqrtf(SQ(sp118.x - vecB.x) + SQ(sp118.y - vecB.y) + SQ(sp118.z - vecB.z)); + reflection[i].pos.x = sp118.x; + reflection[i].pos.y = sp118.y; + reflection[i].pos.z = sp118.z; - if (temp_f0 < (this->reflectIntensity * 600.0f)) { - reflection[i].opacity = 200; + temp_f0 = sqrtf(SQ(sp118.x - vecB.x) + SQ(sp118.y - vecB.y) + SQ(sp118.z - vecB.z)); + + if (temp_f0 < (this->reflectIntensity * 600.0f)) { + reflection[i].opacity = 200; + } else { + reflection[i].opacity = (s32)(800.0f - temp_f0); + } + + reflection[i].opacity = (s32)(reflection[i].opacity * 1.275f); + + sp10C.x = (shieldMtx->xx * 100.0f) + vecB.x; + sp10C.y = (shieldMtx->yx * 100.0f) + vecB.y; + sp10C.z = (shieldMtx->zx * 100.0f) + vecB.z; + + sp100.x = (spE8[0] * 4.0f) + sp10C.x; + sp100.y = (spE8[1] * 4.0f) + sp10C.y; + sp100.z = (spE8[2] * 4.0f) + sp10C.z; + + reflection[i].mtx.xx = reflection[i].mtx.yy = reflection[i].mtx.zz = reflection[i].mtx.ww = 1.0f; + + reflection[i].mtx.yx = reflection[i].mtx.zx = reflection[i].mtx.wx = reflection[i].mtx.xy = + reflection[i].mtx.zy = reflection[i].mtx.wy = reflection[i].mtx.xz = reflection[i].mtx.yz = + reflection[i].mtx.wz = reflection[i].mtx.xw = reflection[i].mtx.yw = reflection[i].mtx.zw = + 0.0f; + + if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], + reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) { + reflection[i].mtx.xx = intersection.x - sp118.x; + reflection[i].mtx.yx = intersection.y - sp118.y; + reflection[i].mtx.zx = intersection.z - sp118.z; + } + + sp10C.x = (shieldMtx->xy * 100.0f) + vecB.x; + sp10C.y = (shieldMtx->yy * 100.0f) + vecB.y; + sp10C.z = (shieldMtx->zy * 100.0f) + vecB.z; + + sp100.x = (spE8[0] * 4.0f) + sp10C.x; + sp100.y = (spE8[1] * 4.0f) + sp10C.y; + sp100.z = (spE8[2] * 4.0f) + sp10C.z; + + if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], + reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) { + reflection[i].mtx.xy = intersection.x - sp118.x; + reflection[i].mtx.yy = intersection.y - sp118.y; + reflection[i].mtx.zy = intersection.z - sp118.z; + } } else { - reflection[i].opacity = (s32)(800.0f - temp_f0); + reflection[i].reflectionPoly = NULL; } - - reflection[i].opacity = (s32)(reflection[i].opacity * 1.275f); - - sp10C.x = (shieldMtx->xx * 100.0f) + vecB.x; - sp10C.y = (shieldMtx->yx * 100.0f) + vecB.y; - sp10C.z = (shieldMtx->zx * 100.0f) + vecB.z; - - sp100.x = (spE8[0] * 4.0f) + sp10C.x; - sp100.y = (spE8[1] * 4.0f) + sp10C.y; - sp100.z = (spE8[2] * 4.0f) + sp10C.z; - - reflection[i].mtx.xx = reflection[i].mtx.yy = reflection[i].mtx.zz = reflection[i].mtx.ww = 1.0f; - - reflection[i].mtx.yx = reflection[i].mtx.zx = reflection[i].mtx.wx = reflection[i].mtx.xy = - reflection[i].mtx.zy = reflection[i].mtx.wy = reflection[i].mtx.xz = reflection[i].mtx.yz = - reflection[i].mtx.wz = reflection[i].mtx.xw = reflection[i].mtx.yw = reflection[i].mtx.zw = - 0.0f; - - if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist, - &sp10C, &sp100, &intersection, 1)) { - reflection[i].mtx.xx = intersection.x - sp118.x; - reflection[i].mtx.yx = intersection.y - sp118.y; - reflection[i].mtx.zx = intersection.z - sp118.z; - } - - sp10C.x = (shieldMtx->xy * 100.0f) + vecB.x; - sp10C.y = (shieldMtx->yy * 100.0f) + vecB.y; - sp10C.z = (shieldMtx->zy * 100.0f) + vecB.z; - - sp100.x = (spE8[0] * 4.0f) + sp10C.x; - sp100.y = (spE8[1] * 4.0f) + sp10C.y; - sp100.z = (spE8[2] * 4.0f) + sp10C.z; - - if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist, - &sp10C, &sp100, &intersection, 1)) { - reflection[i].mtx.xy = intersection.x - sp118.x; - reflection[i].mtx.yy = intersection.y - sp118.y; - reflection[i].mtx.zy = intersection.z - sp118.z; - } - } else { - reflection[i].reflectionPoly = NULL; } } } } -#else -void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* reflection); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/MirRay_ReflectedBeam.s") -#endif void MirRay_Draw(Actor* thisx, PlayState* play) { s32 pad; diff --git a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c index 66a14a2a6..e327123d1 100644 --- a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c +++ b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c @@ -213,7 +213,6 @@ void func_80B9E7D0(MirRay3Struct* ptr) { } } -#ifdef NON_MATCHING void func_80B9E8D4(MirRay3* this, PlayState* play, MirRay3Struct* ptr) { Player* player = GET_PLAYER(play); s32 i; @@ -231,7 +230,6 @@ void func_80B9E8D4(MirRay3* this, PlayState* play, MirRay3Struct* ptr) { f32 temp_f2; Vec3f spD4; Vec3f spC8; - CollisionPoly* spC4; spF8[0] = -(shieldMf->mf[2][0] * this->unk_260) * this->unk_214 * 400.0f; spF8[1] = -(shieldMf->mf[2][1] * this->unk_260) * this->unk_214 * 400.0f; @@ -321,28 +319,28 @@ void func_80B9E8D4(MirRay3* this, PlayState* play, MirRay3Struct* ptr) { sp134.y = (spF8[1] * temp_f2) + sp140.y; sp134.z = (spF8[2] * temp_f2) + sp140.z; - if (!BgCheck_AnyLineTest1(&play->colCtx, &sp140, &sp134, &sp128, &spC4, 1)) { - Math_Vec3f_Copy(&sp128, &sp134); + { + CollisionPoly* spC4; + + if (!BgCheck_AnyLineTest1(&play->colCtx, &sp140, &sp134, &sp128, &spC4, 1)) { + Math_Vec3f_Copy(&sp128, &sp134); + } + + sp128.x += spF8[0] * 5.0f; + sp128.y += spF8[1] * 5.0f; + sp128.z += spF8[2] * 5.0f; + + spD4.x = (shieldMf->mf[0][0] * 300.0f) + sp140.x; + spD4.y = (shieldMf->mf[0][1] * 300.0f) + sp140.y; + spD4.z = (shieldMf->mf[0][2] * 300.0f) + sp140.z; + + spC8.x = (shieldMf->mf[0][0] * 300.0f) + sp128.x; + spC8.y = (shieldMf->mf[0][1] * 300.0f) + sp128.y; + spC8.z = (shieldMf->mf[0][2] * 300.0f) + sp128.z; + + Collider_SetQuadVertices(&this->colliderQuad, &spD4, &sp140, &spC8, &sp128); } - - sp128.x += spF8[0] * 5.0f; - sp128.y += spF8[1] * 5.0f; - sp128.z += spF8[2] * 5.0f; - - spD4.x = (shieldMf->mf[0][0] * 300.0f) + sp140.x; - spD4.y = (shieldMf->mf[0][1] * 300.0f) + sp140.y; - spD4.z = (shieldMf->mf[0][2] * 300.0f) + sp140.z; - - spC8.x = (shieldMf->mf[0][0] * 300.0f) + sp128.x; - spC8.y = (shieldMf->mf[0][1] * 300.0f) + sp128.y; - spC8.z = (shieldMf->mf[0][2] * 300.0f) + sp128.z; - - Collider_SetQuadVertices(&this->colliderQuad, &spD4, &sp140, &spC8, &sp128); } -#else -void func_80B9E8D4(MirRay3* this, PlayState* play, MirRay3Struct* ptr); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray3/func_80B9E8D4.s") -#endif void MirRay3_Draw(Actor* thisx, PlayState* play) { s32 pad[2]; From a38f45b26884078f6ac7f30fade35f313f8dcf98 Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Fri, 14 Oct 2022 19:52:33 -0700 Subject: [PATCH 07/12] Document Elegy of Emptiness shell assets in gameplay_keep (#1121) * Document Elegy of Emptiness shell assets in gameplay_keep * Format --- assets/xml/objects/gameplay_keep.xml | 116 ++++++++++-------- assets/xml/objects/object_zog.xml | 2 +- .../actors/ovl_En_Torch2/z_en_torch2.c | 8 +- 3 files changed, 67 insertions(+), 59 deletions(-) diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml index ca0aaeb3c..b40994d0c 100644 --- a/assets/xml/objects/gameplay_keep.xml +++ b/assets/xml/objects/gameplay_keep.xml @@ -881,14 +881,17 @@ - - - - - - - - + + + + + + + + + + + @@ -1116,26 +1119,29 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1221,11 +1227,14 @@ - - - - - + + + + + + + + @@ -1442,25 +1451,28 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_zog.xml b/assets/xml/objects/object_zog.xml index 1ede14ad2..8d9e6ebdb 100644 --- a/assets/xml/objects/object_zog.xml +++ b/assets/xml/objects/object_zog.xml @@ -16,7 +16,7 @@ - + diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 0486f7c5c..479ceaad6 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -58,11 +58,7 @@ static InitChainEntry sInitChain[] = { // Shells for each of Link's different forms // (Playing elegy as Fierce Deity puts down a human shell) static Gfx* sShellDLists[] = { - gameplay_keep_DL_01C430, // Human - gameplay_keep_DL_048DF0, // Zora - gameplay_keep_DL_089070, // Deku - gameplay_keep_DL_057B10, // Goron - gameplay_keep_DL_01C430, // Human + gElegyShellHumanDL, gElegyShellGoronDL, gElegyShellZoraDL, gElegyShellDekuDL, gElegyShellHumanDL, }; void EnTorch2_Init(Actor* thisx, PlayState* play) { @@ -163,7 +159,7 @@ void EnTorch2_UpdateDeath(Actor* thisx, PlayState* play) { void EnTorch2_Draw(Actor* thisx, PlayState* play2) { PlayState* play = play2; EnTorch2* this = THIS; - Gfx* gfx = sShellDLists[thisx->params]; + Gfx* gfx = sShellDLists[this->actor.params]; OPEN_DISPS(play->state.gfxCtx); if (this->alpha == 0xFF) { From 638f5062cbf6e9289f624cbdeee918d35642fb3a Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Fri, 14 Oct 2022 21:35:55 -0700 Subject: [PATCH 08/12] Replace `Actor_MarkForDeath` with `Actor_Kill` (#1118) * Replace `Actor_MarkForDeath` with `Actor_Kill` * Replace if-else with early returns, as per hensldm's review * Respond to Elliptic's review * Redundant spelling --- docs/STYLE.md | 2 +- include/functions.h | 2 +- src/code/z_actor.c | 10 +-- src/code/z_en_item00.c | 12 ++-- .../actors/ovl_Arms_Hook/z_arms_hook.c | 2 +- .../actors/ovl_Arrow_Fire/z_arrow_fire.c | 10 +-- .../actors/ovl_Arrow_Ice/z_arrow_ice.c | 10 +-- .../actors/ovl_Arrow_Light/z_arrow_light.c | 10 +-- .../ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c | 4 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 4 +- .../ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c | 4 +- .../ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c | 2 +- .../ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c | 14 ++-- .../actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.c | 2 +- .../ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c | 4 +- .../z_bg_hakugin_bombwall.c | 4 +- .../ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c | 2 +- .../actors/ovl_Bg_Icefloe/z_bg_icefloe.c | 2 +- .../actors/ovl_Bg_Icicle/z_bg_icicle.c | 5 +- .../z_bg_ikana_bombwall.c | 8 +-- .../ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c | 13 ++-- .../actors/ovl_Bg_Ikninside/z_bg_ikninside.c | 2 +- .../ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c | 4 +- .../actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c | 2 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 2 +- .../ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c | 17 ++--- .../actors/ovl_Bg_Ladder/z_bg_ladder.c | 2 +- .../ovl_Bg_Last_Bwall/z_bg_last_bwall.c | 20 +++--- .../actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c | 2 +- .../ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c | 4 +- .../actors/ovl_Bg_Spdweb/z_bg_spdweb.c | 6 +- .../actors/ovl_Bg_Umajump/z_bg_umajump.c | 6 +- src/overlays/actors/ovl_Boss_02/z_boss_02.c | 4 +- src/overlays/actors/ovl_Boss_03/z_boss_03.c | 2 +- src/overlays/actors/ovl_Boss_04/z_boss_04.c | 6 +- src/overlays/actors/ovl_Boss_06/z_boss_06.c | 4 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 4 +- .../actors/ovl_Demo_Getitem/z_demo_getitem.c | 22 ++++--- .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 6 +- .../actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c | 2 +- .../actors/ovl_Dm_Char00/z_dm_char00.c | 4 +- .../actors/ovl_Dm_Char01/z_dm_char01.c | 2 +- .../actors/ovl_Dm_Char02/z_dm_char02.c | 4 +- .../actors/ovl_Dm_Char03/z_dm_char03.c | 2 +- .../actors/ovl_Dm_Char05/z_dm_char05.c | 6 +- .../actors/ovl_Dm_Ravine/z_dm_ravine.c | 4 +- src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c | 10 +-- src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c | 4 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 8 +-- .../actors/ovl_Door_Spiral/z_door_spiral.c | 4 +- .../actors/ovl_Eff_Change/z_eff_change.c | 57 ++++++++-------- src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c | 2 +- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 15 +++-- src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c | 14 ++-- src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c | 15 +++-- src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c | 22 ++++--- src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c | 6 +- src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c | 39 +++++------ src/overlays/actors/ovl_En_Ah/z_en_ah.c | 2 +- .../ovl_En_Akindonuts/z_en_akindonuts.c | 20 +++--- src/overlays/actors/ovl_En_Am/z_en_am.c | 2 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 14 ++-- .../ovl_En_Attack_Niw/z_en_attack_niw.c | 12 ++-- src/overlays/actors/ovl_En_Az/z_en_az.c | 4 +- src/overlays/actors/ovl_En_Baba/z_en_baba.c | 6 +- src/overlays/actors/ovl_En_Baguo/z_en_baguo.c | 2 +- .../actors/ovl_En_Baisen/z_en_baisen.c | 6 +- src/overlays/actors/ovl_En_Bat/z_en_bat.c | 6 +- .../actors/ovl_En_Bba_01/z_en_bba_01.c | 2 +- .../actors/ovl_En_Bbfall/z_en_bbfall.c | 13 ++-- src/overlays/actors/ovl_En_Bee/z_en_bee.c | 2 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 6 +- .../actors/ovl_En_Bigpamet/z_en_bigpamet.c | 2 +- src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 24 ++++--- .../actors/ovl_En_Bigslime/z_en_bigslime.c | 8 +-- .../actors/ovl_En_Bji_01/z_en_bji_01.c | 2 +- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 6 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 15 +++-- .../actors/ovl_En_Bom_Chu/z_en_bom_chu.c | 2 +- .../actors/ovl_En_Bombal/z_en_bombal.c | 7 +- .../actors/ovl_En_Bombers/z_en_bombers.c | 18 ++--- .../actors/ovl_En_Bombers2/z_en_bombers2.c | 2 +- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 9 ++- .../actors/ovl_En_Bomjima/z_en_bomjima.c | 2 +- .../actors/ovl_En_Bomjimb/z_en_bomjimb.c | 12 ++-- src/overlays/actors/ovl_En_Boom/z_en_boom.c | 2 +- .../actors/ovl_En_Bubble/z_en_bubble.c | 2 +- src/overlays/actors/ovl_En_Butte/z_en_butte.c | 2 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 2 +- .../actors/ovl_En_Cne_01/z_en_cne_01.c | 2 +- .../actors/ovl_En_Col_Man/z_en_col_man.c | 6 +- src/overlays/actors/ovl_En_Cow/z_en_cow.c | 2 +- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 2 +- src/overlays/actors/ovl_En_Dai/z_en_dai.c | 2 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 8 +-- .../actors/ovl_En_Daiku2/z_en_daiku2.c | 6 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 2 +- src/overlays/actors/ovl_En_Dg/z_en_dg.c | 4 +- .../actors/ovl_En_Dinofos/z_en_dinofos.c | 2 +- src/overlays/actors/ovl_En_Dnk/z_en_dnk.c | 2 +- src/overlays/actors/ovl_En_Dno/z_en_dno.c | 8 +-- src/overlays/actors/ovl_En_Dnp/z_en_dnp.c | 9 ++- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 2 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 4 +- src/overlays/actors/ovl_En_Door/z_en_door.c | 2 +- .../actors/ovl_En_Door_Etc/z_en_door_etc.c | 4 +- .../actors/ovl_En_Dragon/z_en_dragon.c | 2 +- .../actors/ovl_En_Dy_Extra/z_en_dy_extra.c | 2 +- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 14 ++-- .../actors/ovl_En_Elfbub/z_en_elfbub.c | 4 +- .../actors/ovl_En_Elforg/z_en_elforg.c | 29 +++++---- .../actors/ovl_En_Encount1/z_en_encount1.c | 4 +- .../actors/ovl_En_Encount2/z_en_encount2.c | 4 +- src/overlays/actors/ovl_En_Fall/z_en_fall.c | 10 +-- src/overlays/actors/ovl_En_Famos/z_en_famos.c | 2 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 2 +- src/overlays/actors/ovl_En_Fish/z_en_fish.c | 22 ++++--- src/overlays/actors/ovl_En_Fish2/z_en_fish2.c | 6 +- .../actors/ovl_En_Fishing/z_en_fishing.c | 2 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 10 +-- src/overlays/actors/ovl_En_Fr/z_en_fr.c | 14 ++-- src/overlays/actors/ovl_En_Fsn/z_en_fsn.c | 2 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 2 +- .../actors/ovl_En_Fu_Kago/z_en_fu_kago.c | 4 +- .../actors/ovl_En_Fu_Mato/z_en_fu_mato.c | 6 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 2 +- .../actors/ovl_En_Gamelupy/z_en_gamelupy.c | 2 +- src/overlays/actors/ovl_En_Gb2/z_en_gb2.c | 33 +++++----- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 2 +- src/overlays/actors/ovl_En_Geg/z_en_geg.c | 8 +-- src/overlays/actors/ovl_En_Gg/z_en_gg.c | 4 +- src/overlays/actors/ovl_En_Gg2/z_en_gg2.c | 10 +-- src/overlays/actors/ovl_En_Giant/z_en_giant.c | 4 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 6 +- src/overlays/actors/ovl_En_Gk/z_en_gk.c | 10 +-- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 6 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 6 +- .../ovl_En_Grasshopper/z_en_grasshopper.c | 6 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 4 +- .../actors/ovl_En_Guruguru/z_en_guruguru.c | 8 +-- .../actors/ovl_En_Hanabi/z_en_hanabi.c | 2 +- .../actors/ovl_En_Heishi/z_en_heishi.c | 35 +++++----- src/overlays/actors/ovl_En_Hg/z_en_hg.c | 4 +- .../ovl_En_Hidden_Nuts/z_en_hidden_nuts.c | 10 +-- .../actors/ovl_En_Hint_Skb/z_en_hint_skb.c | 2 +- .../actors/ovl_En_Hit_Tag/z_en_hit_tag.c | 4 +- src/overlays/actors/ovl_En_Holl/z_en_holl.c | 2 +- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 10 +-- .../z_en_horse_game_check.c | 4 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 2 +- src/overlays/actors/ovl_En_In/z_en_in.c | 6 +- .../actors/ovl_En_Insect/z_en_insect.c | 6 +- .../actors/ovl_En_Invadepoh/z_en_invadepoh.c | 56 ++++++++-------- .../z_en_invisible_ruppe.c | 4 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 14 ++-- .../actors/ovl_En_Jc_Mato/z_en_jc_mato.c | 2 +- src/overlays/actors/ovl_En_Jg/z_en_jg.c | 2 +- .../actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c | 6 +- src/overlays/actors/ovl_En_Js/z_en_js.c | 2 +- src/overlays/actors/ovl_En_Kame/z_en_kame.c | 2 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 8 +-- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 4 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 14 ++-- src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c | 33 +++++----- .../actors/ovl_En_Look_Nuts/z_en_look_nuts.c | 4 +- .../actors/ovl_En_M_Fire1/z_en_m_fire1.c | 9 +-- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 25 +++---- .../actors/ovl_En_Ma_Yto/z_en_ma_yto.c | 2 +- .../actors/ovl_En_Ma_Yts/z_en_ma_yts.c | 2 +- .../actors/ovl_En_Maruta/z_en_maruta.c | 6 +- .../actors/ovl_En_Minifrog/z_en_minifrog.c | 15 +++-- .../actors/ovl_En_Minislime/z_en_minislime.c | 2 +- src/overlays/actors/ovl_En_Mkk/z_en_mkk.c | 2 +- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 2 +- .../actors/ovl_En_Mt_tag/z_en_mt_tag.c | 25 +++---- .../actors/ovl_En_Mushi2/z_en_mushi2.c | 13 ++-- src/overlays/actors/ovl_En_Muto/z_en_muto.c | 6 +- .../actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c | 2 +- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 4 +- src/overlays/actors/ovl_En_Nwc/z_en_nwc.c | 4 +- .../z_en_okarina_effect.c | 4 +- src/overlays/actors/ovl_En_Osn/z_en_osn.c | 5 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 14 ++-- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 8 +-- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 16 ++--- .../actors/ovl_En_Pamera/z_en_pamera.c | 4 +- .../actors/ovl_En_Pametfrog/z_en_pametfrog.c | 13 ++-- src/overlays/actors/ovl_En_Paper/z_en_paper.c | 7 +- src/overlays/actors/ovl_En_Part/z_en_part.c | 4 +- .../actors/ovl_En_Peehat/z_en_peehat.c | 6 +- src/overlays/actors/ovl_En_Pm/z_en_pm.c | 2 +- .../actors/ovl_En_Po_Fusen/z_en_po_fusen.c | 4 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 17 ++--- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 4 +- src/overlays/actors/ovl_En_Pp/z_en_pp.c | 6 +- src/overlays/actors/ovl_En_Pr/z_en_pr.c | 2 +- src/overlays/actors/ovl_En_Pr2/z_en_pr2.c | 14 ++-- src/overlays/actors/ovl_En_Prz/z_en_prz.c | 2 +- .../actors/ovl_En_Racedog/z_en_racedog.c | 2 +- src/overlays/actors/ovl_En_Raf/z_en_raf.c | 2 +- .../actors/ovl_En_Rail_Skb/z_en_rail_skb.c | 8 +-- .../actors/ovl_En_Railgibud/z_en_railgibud.c | 8 +-- src/overlays/actors/ovl_En_Rat/z_en_rat.c | 2 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- src/overlays/actors/ovl_En_Rg/z_en_rg.c | 2 +- .../ovl_En_River_Sound/z_en_river_sound.c | 2 +- src/overlays/actors/ovl_En_Rr/z_en_rr.c | 7 +- .../actors/ovl_En_Ruppecrow/z_en_ruppecrow.c | 8 +-- .../actors/ovl_En_S_Goro/z_en_s_goro.c | 4 +- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 31 ++++----- .../actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c | 2 +- .../actors/ovl_En_Scopecoin/z_en_scopecoin.c | 8 +-- .../actors/ovl_En_Scopecrow/z_en_scopecrow.c | 12 ++-- .../actors/ovl_En_Scopenuts/z_en_scopenuts.c | 16 ++--- .../actors/ovl_En_Sekihi/z_en_sekihi.c | 35 +++++----- .../actors/ovl_En_Sellnuts/z_en_sellnuts.c | 8 +-- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 4 +- .../actors/ovl_En_Snowman/z_en_snowman.c | 65 ++++++++++--------- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 6 +- src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 2 +- src/overlays/actors/ovl_En_St/z_en_st.c | 9 +-- src/overlays/actors/ovl_En_Sth/z_en_sth.c | 10 +-- src/overlays/actors/ovl_En_Sth2/z_en_sth2.c | 2 +- .../actors/ovl_En_Suttari/z_en_suttari.c | 22 +++---- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 6 +- .../ovl_En_Syateki_Crow/z_en_syateki_crow.c | 2 +- .../z_en_syateki_dekunuts.c | 2 +- .../ovl_En_Syateki_Okuta/z_en_syateki_okuta.c | 2 +- .../ovl_En_Syateki_Wf/z_en_syateki_wf.c | 2 +- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 4 +- .../actors/ovl_En_Tanron2/z_en_tanron2.c | 6 +- .../actors/ovl_En_Tanron3/z_en_tanron3.c | 2 +- .../actors/ovl_En_Tanron5/z_en_tanron5.c | 14 ++-- src/overlays/actors/ovl_En_Test/z_en_test.c | 4 +- src/overlays/actors/ovl_En_Test2/z_en_test2.c | 2 +- src/overlays/actors/ovl_En_Test4/z_en_test4.c | 10 +-- src/overlays/actors/ovl_En_Test5/z_en_test5.c | 2 +- src/overlays/actors/ovl_En_Test6/z_en_test6.c | 6 +- src/overlays/actors/ovl_En_Test7/z_en_test7.c | 4 +- .../actors/ovl_En_Thiefbird/z_en_thiefbird.c | 18 +++-- .../actors/ovl_En_Time_Tag/z_en_time_tag.c | 2 +- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 13 ++-- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 21 +++--- src/overlays/actors/ovl_En_Torch/z_en_torch.c | 2 +- .../actors/ovl_En_Torch2/z_en_torch2.c | 9 +-- src/overlays/actors/ovl_En_Toto/z_en_toto.c | 8 +-- src/overlays/actors/ovl_En_Trt2/z_en_trt2.c | 16 ++--- src/overlays/actors/ovl_En_Tru/z_en_tru.c | 2 +- .../actors/ovl_En_Tru_Mt/z_en_tru_mt.c | 4 +- src/overlays/actors/ovl_En_Tsn/z_en_tsn.c | 10 +-- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 10 +-- src/overlays/actors/ovl_En_Twig/z_en_twig.c | 8 +-- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 6 +- .../actors/ovl_En_Warp_tag/z_en_warp_tag.c | 2 +- .../ovl_En_Water_Effect/z_en_water_effect.c | 2 +- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 8 +-- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 4 +- src/overlays/actors/ovl_En_Wiz/z_en_wiz.c | 4 +- .../actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c | 2 +- .../actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c | 8 +-- .../actors/ovl_En_Wood02/z_en_wood02.c | 6 +- src/overlays/actors/ovl_En_Yb/z_en_yb.c | 4 +- src/overlays/actors/ovl_En_Zob/z_en_zob.c | 4 +- src/overlays/actors/ovl_En_Zog/z_en_zog.c | 2 +- .../actors/ovl_En_Zoraegg/z_en_zoraegg.c | 16 ++--- src/overlays/actors/ovl_En_Zos/z_en_zos.c | 4 +- src/overlays/actors/ovl_En_Zot/z_en_zot.c | 6 +- src/overlays/actors/ovl_En_Zov/z_en_zov.c | 4 +- .../actors/ovl_Item_B_Heart/z_item_b_heart.c | 9 +-- .../ovl_Item_Etcetera/z_item_etcetera.c | 9 +-- .../actors/ovl_Item_Inbox/z_item_inbox.c | 2 +- src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c | 2 +- src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c | 8 +-- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 18 +++-- .../ovl_Obj_Bigicicle/z_obj_bigicicle.c | 4 +- .../ovl_Obj_Blockstop/z_obj_blockstop.c | 4 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 6 +- src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c | 8 +-- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 6 +- .../ovl_Obj_Danpeilift/z_obj_danpeilift.c | 33 +++++----- src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c | 6 +- .../actors/ovl_Obj_Dinner/z_obj_dinner.c | 2 +- .../actors/ovl_Obj_Dowsing/z_obj_dowsing.c | 2 +- .../ovl_Obj_Flowerpot/z_obj_flowerpot.c | 8 +-- .../actors/ovl_Obj_Ghaka/z_obj_ghaka.c | 2 +- .../ovl_Obj_Grass_Carry/z_obj_grass_carry.c | 2 +- .../actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c | 6 +- .../actors/ovl_Obj_Hamishi/z_obj_hamishi.c | 4 +- .../ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c | 6 +- .../actors/ovl_Obj_Hunsui/z_obj_hunsui.c | 12 ++-- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c | 15 +++-- .../actors/ovl_Obj_Iceblock/z_obj_iceblock.c | 2 +- .../actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c | 2 +- .../ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c | 2 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 10 +-- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 2 +- .../actors/ovl_Obj_Kinoko/z_obj_kinoko.c | 2 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 17 ++--- .../ovl_Obj_Lightblock/z_obj_lightblock.c | 28 ++++---- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 9 +-- .../ovl_Obj_Makekinsuta/z_obj_makekinsuta.c | 2 +- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 2 +- .../actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c | 2 +- .../ovl_Obj_Moon_Stone/z_obj_moon_stone.c | 4 +- .../actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c | 2 +- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 10 +-- .../actors/ovl_Obj_Mure3/z_obj_mure3.c | 4 +- .../actors/ovl_Obj_Nozoki/z_obj_nozoki.c | 6 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 6 +- .../actors/ovl_Obj_Purify/z_obj_purify.c | 6 +- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 9 +-- .../actors/ovl_Obj_Snowball/z_obj_snowball.c | 6 +- .../ovl_Obj_Snowball2/z_obj_snowball2.c | 6 +- .../ovl_Obj_Spidertent/z_obj_spidertent.c | 4 +- .../ovl_Obj_Spinyroll/z_obj_spinyroll.c | 2 +- src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c | 11 ++-- src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c | 4 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 43 ++++++------ src/overlays/actors/ovl_Obj_Um/z_obj_um.c | 20 +++--- .../actors/ovl_Obj_Usiyane/z_obj_usiyane.c | 6 +- .../actors/ovl_Obj_Wturn/z_obj_wturn.c | 9 ++- .../ovl_Object_Kankyo/z_object_kankyo.c | 2 +- .../actors/ovl_Oceff_Spot/z_oceff_spot.c | 2 +- .../actors/ovl_Oceff_Storm/z_oceff_storm.c | 2 +- .../actors/ovl_Oceff_Wipe/z_oceff_wipe.c | 2 +- .../actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c | 2 +- .../actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c | 2 +- .../actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c | 2 +- .../actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c | 2 +- .../actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c | 2 +- .../actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c | 2 +- src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 9 ++- src/overlays/actors/ovl_TG_Sw/z_tg_sw.c | 2 +- tools/disasm/functions.txt | 6 +- tools/namefixer.py | 1 + tools/sizes/code_functions.csv | 2 +- 338 files changed, 1301 insertions(+), 1190 deletions(-) diff --git a/docs/STYLE.md b/docs/STYLE.md index 4ac0525db..0cf1d051b 100644 --- a/docs/STYLE.md +++ b/docs/STYLE.md @@ -122,7 +122,7 @@ Floats usually need an `f` on the end to match, or IDO will use doubles. Our flo bar(); ``` -**Exception**: After `Actor_MarkForDeath` or sometimes setting the action function, if it makes sense to do so (this expresses the finality a bit better). +**Exception**: After `Actor_Kill` or sometimes setting the action function, if it makes sense to do so (this expresses the finality a bit better). ## Macros and enums diff --git a/include/functions.h b/include/functions.h index 1439401fc..0e7808642 100644 --- a/include/functions.h +++ b/include/functions.h @@ -619,7 +619,7 @@ f32 func_800B64FC(PlayState* play, f32 arg1, Vec3f* arg2, u32* arg3); void* func_800B6584(PlayState* play, s16 id, void* arg2, size_t size); void* func_800B6608(PlayState* play, s16 id); void* func_800B6680(PlayState* play, s16 id); -void Actor_MarkForDeath(Actor* actor); +void Actor_Kill(Actor* actor); void Actor_SetWorldToHome(Actor* actor); void Actor_SetFocus(Actor* actor, f32 height); void Actor_SetWorldRotToShape(Actor* actor); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 01894f269..52b113c76 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1026,7 +1026,7 @@ void* func_800B6680(PlayState* play, s16 id) { return NULL; } -void Actor_MarkForDeath(Actor* actor) { +void Actor_Kill(Actor* actor) { actor->draw = NULL; actor->update = NULL; actor->flags &= ~ACTOR_FLAG_1; @@ -2346,7 +2346,7 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) { } } else { if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { - Actor_MarkForDeath(actor); + Actor_Kill(actor); } else { s32 tmp = (params->unk_08 == 0); @@ -2872,7 +2872,7 @@ void func_800BA6FC(PlayState* play, ActorContext* actorCtx) { while (actor != NULL) { if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { - Actor_MarkForDeath(actor); + Actor_Kill(actor); } actor = actor->next; @@ -2896,7 +2896,7 @@ void func_800BA798(PlayState* play, ActorContext* actorCtx) { if (!actor->isDrawn) { actor = Actor_Delete(actorCtx, actor, play); } else { - Actor_MarkForDeath(actor); + Actor_Kill(actor); Actor_Destroy(actor, play); actor = actor->next; } @@ -2925,7 +2925,7 @@ void func_800BA8B8(PlayState* play, ActorContext* actorCtx) { if (!actor->isDrawn) { actor = Actor_Delete(actorCtx, actor, play); } else { - Actor_MarkForDeath(actor); + Actor_Kill(actor); Actor_Destroy(actor, play); actor = actor->next; } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index d6ab737c7..a07e31e2f 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -86,7 +86,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { this->collectibleFlag = 0; this->actor.params = ITEM00_RECOVERY_HEART; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -358,7 +358,7 @@ void func_800A640C(EnItem00* this, PlayState* play) { if (this->unk152 == 0) { if ((this->actor.params != ITEM00_SMALL_KEY) && (this->actor.params != ITEM00_HEART_PIECE) && (this->actor.params != ITEM00_HEART_CONTAINER)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -464,7 +464,7 @@ void func_800A6A40(EnItem00* this, PlayState* play) { } if (this->unk152 == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -510,7 +510,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 15.0f, 15.0f, 0x1D); if (this->actor.floorHeight <= BGCHECK_Y_MIN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -659,7 +659,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { case ITEM00_COMPASS: if (Actor_HasParent(&this->actor, play)) { Flags_SetCollectible(play, this->collectibleFlag); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; @@ -672,7 +672,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { } else if (getItemId != GI_NONE) { if (Actor_HasParent(&this->actor, play)) { Flags_SetCollectible(play, this->collectibleFlag); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } else { diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 3be9ff149..8325427ad 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -130,7 +130,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { if ((this->actor.parent == NULL) || (!Player_IsHoldingHookshot(player))) { ArmsHook_DetachHookFromActor(this); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 9cf65349f..cef5b0465 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -90,7 +90,7 @@ void FireArrow_ChargeAndWait(ArrowFire* this, PlayState* play) { EnArrow* arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->radius < 10) { @@ -156,7 +156,7 @@ void FireArrow_Hit(ArrowFire* this, PlayState* play) { } if (this->timer == 0) { this->timer = 255; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->timer >= 13) { @@ -171,7 +171,7 @@ void FireArrow_Fly(ArrowFire* this, PlayState* play) { s32 pad2; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -194,7 +194,7 @@ void FireArrow_Fly(ArrowFire* this, PlayState* play) { } if (arrow->unk_260 < 34) { if (this->alpha < 35) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->alpha -= 25; @@ -205,7 +205,7 @@ void ArrowFire_Update(Actor* thisx, PlayState* play) { ArrowFire* this = (ArrowFire*)thisx; if ((play->msgCtx.msgMode == 0xE) || (play->msgCtx.msgMode == 0x12)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 88eddb39e..7db4c35d3 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -65,7 +65,7 @@ void ArrowIce_Charge(ArrowIce* this, PlayState* play) { EnArrow* arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -136,7 +136,7 @@ void ArrowIce_Hit(ArrowIce* this, PlayState* play) { if (this->timer == 0) { this->timer = 255; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -146,7 +146,7 @@ void ArrowIce_Fly(ArrowIce* this, PlayState* play) { s32 pad; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } // copy position and rotation from arrow @@ -166,7 +166,7 @@ void ArrowIce_Fly(ArrowIce* this, PlayState* play) { this->alpha = 255; } else if (arrow->unk_260 < 34) { if (this->alpha < 35) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->alpha -= 25; } @@ -177,7 +177,7 @@ void ArrowIce_Update(Actor* thisx, PlayState* play) { ArrowIce* this = THIS; if ((play->msgCtx.msgMode == 0xE) || (play->msgCtx.msgMode == 0x12)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } else { this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index 9f974472f..7ff828b2d 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -64,7 +64,7 @@ void ArrowLight_Charge(ArrowLight* this, PlayState* play) { EnArrow* arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -129,7 +129,7 @@ void ArrowLight_Hit(ArrowLight* this, PlayState* play) { } if (this->timer == 0) { this->timer = 255; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -139,7 +139,7 @@ void ArrowLight_Fly(ArrowLight* this, PlayState* play) { s32 pad[2]; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -162,7 +162,7 @@ void ArrowLight_Fly(ArrowLight* this, PlayState* play) { } if (arrow->unk_260 < 34) { if (this->alpha < 35) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->alpha -= 25; @@ -173,7 +173,7 @@ void ArrowLight_Update(Actor* thisx, PlayState* play) { ArrowLight* this = THIS; if ((play->msgCtx.msgMode == 0xE) || (play->msgCtx.msgMode == 0x12)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c index ab7ac8a52..29692839e 100644 --- a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c @@ -104,12 +104,12 @@ void BgAstrBombwall_Init(Actor* thisx, PlayState* play) { DynaPolyActor_LoadMesh(play, &this->dyna, &object_astr_obj_Colheader_002498); Collider_InitTris(play, &this->collider); if (Flags_GetSwitch(play, BGASTRBOMBWALL_GET_SWITCHFLAG(thisx))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } this->dyna.actor.flags |= ACTOR_FLAG_10000000; if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderElements)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } BgAstrBombwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, &this->collider); diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 9a272e6aa..ec9daab78 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -216,7 +216,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { this->unk_15C = Object_GetIndex(&play->objectCtx, sp24->unk_00); if ((this->unk_15C < 0) || !sp24->unk_14(this, play)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -286,7 +286,7 @@ void func_808B782C(BgBreakwall* this, PlayState* play) { void func_808B78A4(BgBreakwall* this, PlayState* play) { if (gSaveContext.save.weekEventReg[55] & 0x80) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c index 9a4f0849a..b3ebc982e 100644 --- a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c +++ b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c @@ -92,7 +92,7 @@ void BgCraceMovebg_Init(Actor* thisx, PlayState* play) { for (j = 0; j < sLoadedDoorCount; j++) { if (sIsLoaded[j] == this->index) { this->stateFlags |= BG_CRACE_MOVEBG_FLAG_ALREADY_LOADED; - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } @@ -125,7 +125,7 @@ void BgCraceMovebg_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } } diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c index 056af77bb..4922b4a6e 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c @@ -174,7 +174,7 @@ void BgCtowerGear_UpdateOrgan(Actor* thisx, PlayState* play) { func_800C6314(play, &play->colCtx.dyna, this->dyna.bgId); break; case 3: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } } diff --git a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c index 44e38f0da..6026e139b 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c @@ -167,7 +167,7 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) { if ((this->unk_160 == 9) || (this->unk_160 == 8)) { if (D_80A2BBF4.unk_00 != 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } this->unk_170 = this->dyna.actor.room; @@ -178,7 +178,7 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) { this->dyna.actor.shape.rot.z = 0; } else if (this->unk_160 == 6) { if (D_80A2BBF4.unk_01 != 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } this->unk_171 = this->dyna.actor.world.rot.z; @@ -238,7 +238,7 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) { this->dyna.actor.world.rot.z = 0; this->dyna.actor.shape.rot.z = 0; if (Flags_GetSwitch(play, this->unk_1C0)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } this->unk_18C = 0; @@ -350,7 +350,7 @@ void func_80A2A1E0(BgDblueMovebg* this, PlayState* play) { if (play->roomCtx.curRoom.num != this->unk_171) { if ((play->roomCtx.prevRoom.num != this->unk_170) && (play->roomCtx.prevRoom.num != this->unk_171)) { D_80A2BBF4.unk_01 = 0; - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } } @@ -452,7 +452,7 @@ void func_80A2A688(BgDblueMovebg* this, PlayState* play) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 60.0f, 2.0f) && (this->unk_180 <= 0)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } @@ -632,7 +632,7 @@ void func_80A2AED0(BgDblueMovebg* this, PlayState* play) { if (play->roomCtx.curRoom.num != this->unk_171) { if ((play->roomCtx.prevRoom.num != this->unk_170) && (play->roomCtx.prevRoom.num != this->unk_171)) { D_80A2BBF4.unk_00 = 0; - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } @@ -733,7 +733,7 @@ void func_80A2B274(Actor* thisx, PlayState* play) { s16 temp_v1; if (this != D_80A2BBF0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.c b/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.c index 1ad295e68..0d47e0d5a 100644 --- a/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.c +++ b/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.c @@ -166,7 +166,7 @@ void func_809AC7F8(BgFireWall* this, PlayState* play) { void func_809AC970(BgFireWall* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.y, 0.005f, this->unk_158)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c b/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c index f494131d9..79dd09935 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c @@ -154,7 +154,7 @@ void BgHakaBombwall_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, BGHAKABOMBWALL_GET_7F(thisx))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else { DynaPolyActor_LoadMesh(play, &this->dyna, &object_haka_obj_Colheader_000148); Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); @@ -211,7 +211,7 @@ void BgHakaBombwall_EndCutscene(BgHakaBombwall* this, PlayState* play) { this->csTimer--; if (this->csTimer <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c b/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c index 37a232bc5..3a603868f 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c @@ -317,7 +317,7 @@ void BgHakuginBombwall_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, BGHAKUGIN_BOMBWALL_SWITCHFLAG(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -414,7 +414,7 @@ void func_80ABCE60(BgHakuginBombwall* this, PlayState* play) { this->unk_1AC--; if (this->unk_1AC <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else if (this->unk_1AC == ptr->unk_2C) { ptr->unk_28(this, play); } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c index ec2fd9e9c..309e24355 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c @@ -709,7 +709,7 @@ void BgHakuginPost_Init(Actor* thisx, PlayState* play) { func_80A9CA94(this); } else { func_80A9AFB4(this, play, &D_80A9E028); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c index e64cbef70..ecdd861aa 100644 --- a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c +++ b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c @@ -158,7 +158,7 @@ void func_80AC4D2C(BgIcefloe* this, PlayState* play) { } this->dyna.actor.scale.y -= 0.0026f; if (this->dyna.actor.scale.y <= 0.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c index aec62ce15..6c9fa12de 100644 --- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c +++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c @@ -178,8 +178,7 @@ void BgIcicle_Fall(BgIcicle* this, PlayState* play) { func_800C6314(play, &play->colCtx.dyna, this->dyna.bgId); this->actionFunc = BgIcicle_Regrow; } else { - Actor_MarkForDeath(&this->dyna.actor); - return; + Actor_Kill(&this->dyna.actor); } } else { Actor_MoveWithGravity(&this->dyna.actor); @@ -225,7 +224,7 @@ void BgIcicle_UpdateAttacked(BgIcicle* this, PlayState* play) { BgIcicle_Break(this, play, 40.0f); } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c index 43627317e..3144b599c 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c @@ -239,7 +239,7 @@ void BgIkanaBombwall_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, BGIKANABOMBWALL_GET_SWITCHFLAG(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -349,14 +349,14 @@ void func_80BD5134(BgIkanaBombwall* this, PlayState* play) { this->unk_1AC--; if (this->unk_1AC <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } else if (this->dyna.actor.cutscene >= 0) { if (ActorCutscene_GetCurrentIndex() != this->dyna.actor.cutscene) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c index 6c5e85e73..35727c0c1 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c @@ -204,13 +204,14 @@ void BgIkanaDharma_WaitForCutsceneToEnd(BgIkanaDharma* this, PlayState* play) { } } - if (Math_StepToF(&this->dyna.actor.scale.y, 0.0f, 1.0f / 300.0f) != 0) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - this->dyna.actor.scale.x = this->dyna.actor.scale.y * 3.0f; - this->dyna.actor.scale.z = this->dyna.actor.scale.y * 3.0f; - BgIkanaDharma_SpawnEffects(this, play); + if (Math_StepToF(&this->dyna.actor.scale.y, 0.0f, 1.0f / 300.0f)) { + Actor_Kill(&this->dyna.actor); + return; } + + this->dyna.actor.scale.x = this->dyna.actor.scale.y * 3.0f; + this->dyna.actor.scale.z = this->dyna.actor.scale.y * 3.0f; + BgIkanaDharma_SpawnEffects(this, play); } void BgIkanaDharma_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c b/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c index 07de845c0..c911eeea9 100644 --- a/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c +++ b/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c @@ -65,7 +65,7 @@ void BgIkninside_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); Collider_UpdateCylinder(&this->dyna.actor, &this->collider); if (Flags_GetSwitch(play, DMIKNINSIDE_GET_SWITCH(thisx))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c index 06091b12b..e5a5dbc91 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c @@ -70,7 +70,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) { CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_012788, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if (!(gSaveContext.save.weekEventReg[14] & 4)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } break; @@ -90,7 +90,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c index c0e9bdc42..59fd2f340 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c @@ -88,7 +88,7 @@ void BgIknvObj_Init(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->dyna.actor, IREG(88)); break; default: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 95ca8936e..43b7f27aa 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -364,7 +364,7 @@ void BgIngate_Init(Actor* thisx, PlayState* play2) { } this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_FF(&this->dyna.actor), 0); } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c index 86854cbe8..2da4ddcee 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c @@ -146,14 +146,15 @@ void BgKin2Bombwall_Init(Actor* thisx, PlayState* play) { bombwallCollider = &this->collider; Collider_InitCylinder(play, bombwallCollider); if (Flags_GetSwitch(play, BG_KIN2_BOMBWALL_SWITCH_FLAG(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - DynaPolyActor_LoadMesh(play, &this->dyna, &gOceanSpiderHouseBombableWallCol); - Collider_SetCylinder(play, bombwallCollider, &this->dyna.actor, &sCylinderInit); - Collider_UpdateCylinder(&this->dyna.actor, bombwallCollider); - Actor_SetFocus(&this->dyna.actor, 60.0f); - BgKin2Bombwall_SetupWait(this); + Actor_Kill(&this->dyna.actor); + return; } + + DynaPolyActor_LoadMesh(play, &this->dyna, &gOceanSpiderHouseBombableWallCol); + Collider_SetCylinder(play, bombwallCollider, &this->dyna.actor, &sCylinderInit); + Collider_UpdateCylinder(&this->dyna.actor, bombwallCollider); + Actor_SetFocus(&this->dyna.actor, 60.0f); + BgKin2Bombwall_SetupWait(this); } void BgKin2Bombwall_Destroy(Actor* thisx, PlayState* play) { @@ -205,7 +206,7 @@ void BgKin2Bombwall_EndCutscene(BgKin2Bombwall* this, PlayState* play) { this->timer--; if (this->timer <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c index 36226212e..12a603046 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c @@ -63,7 +63,7 @@ void BgLadder_Init(Actor* thisx, PlayState* play) { } else if (size == LADDER_SIZE_24RUNG) { DynaPolyActor_LoadMesh(play, &this->dyna, &object_ladder_Colheader_000868); } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c index 85272fa51..65157403d 100644 --- a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c +++ b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c @@ -153,15 +153,19 @@ void BgLastBwall_Init(Actor* thisx, PlayState* play) { DynaPolyActor_LoadMesh(play, &this->dyna, D_80C18A48[this->type].colHeader); Collider_InitTris(play, &this->colliderTris); if (Flags_GetSwitch(play, BGLASTBWALL_GET_SWITCHFLAGS(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); - } else if (!Collider_SetTris(play, &this->colliderTris, &this->dyna.actor, &sTrisInit, this->colliderTrisElement)) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - BgLastBwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, - &this->colliderTris, D_80C18AC0[this->type]); - SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); - func_80C187E4(this); + Actor_Kill(&this->dyna.actor); + return; } + + if (!Collider_SetTris(play, &this->colliderTris, &this->dyna.actor, &sTrisInit, this->colliderTrisElement)) { + Actor_Kill(&this->dyna.actor); + return; + } + + BgLastBwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, &this->colliderTris, + D_80C18AC0[this->type]); + SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + func_80C187E4(this); } void BgLastBwall_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c index 8554e2b5a..1605d6bc0 100644 --- a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c +++ b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c @@ -157,7 +157,7 @@ void BgNumaHana_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->torchCollider, &this->dyna.actor, &sCylinderInit); this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; if (!BgNumaHana_SpawnOpenFlowerCollisionChild(this, play)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c index fb8f04d78..77490aef1 100644 --- a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c +++ b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c @@ -103,7 +103,7 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) { this->dyna.actor.unk20, NULL); } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } this->actionFunc = BgSinkaiKabe_WaitForPlayer; @@ -140,7 +140,7 @@ void BgSinkaiKabe_WaitForPlayer(BgSinkaiKabe* this, PlayState* play) { } if (this->deepPython == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c index 296f56268..1fca8ea9c 100644 --- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c +++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c @@ -170,7 +170,7 @@ void BgSpdweb_Init(Actor* thisx, PlayState* play) { this->unk_162 = 0; if (Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } @@ -230,7 +230,7 @@ void func_809CE234(BgSpdweb* this, PlayState* play) { if (this->unk_162 == 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -373,7 +373,7 @@ void func_809CE830(BgSpdweb* this, PlayState* play) { if (ActorCutscene_GetLength(this->dyna.actor.cutscene) == -1) { ActorCutscene_Stop(this->dyna.actor.cutscene); } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index 2a584bb31..614738b9f 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -107,13 +107,13 @@ void BgUmajump_Init(Actor* thisx, PlayState* play) { this->objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_UMAJUMP); if (this->objectIndex < 0) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } if ((thisx->params == BG_UMAJUMP_TYPE_3) && CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, thisx->shape.rot.x, thisx->shape.rot.y, thisx->shape.rot.z, 0x3E); - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } } } @@ -187,7 +187,7 @@ void func_8091A5A0(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 0x3E); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } if (this->dyna.actor.params == BG_UMAJUMP_TYPE_5) { diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index 0d0e55e62..28008a674 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -1097,7 +1097,7 @@ void func_809DBFB4(Boss02* this, PlayState* play) { } while (0); if ((s8)this->actor.colChkInfo.health <= 0) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); this->actor.child = NULL; Enemy_StartFinishingBlow(play, &this->actor); this->skelAnime.playSpeed = 2.0f; @@ -1924,7 +1924,7 @@ void func_809DD934(Boss02* this, PlayState* play) { temp_a0_5 = play->actorCtx.actorLists[ACTORCAT_BG].first; while (temp_a0_5 != NULL) { if (temp_a0_5->id == ACTOR_BG_INIBS_MOVEBG) { - Actor_MarkForDeath(temp_a0_5); + Actor_Kill(temp_a0_5); break; } temp_a0_5 = temp_a0_5->next; diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c index a0f3a208b..e4d397f22 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -457,7 +457,7 @@ void Boss03_Init(Actor* thisx, PlayState* play2) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, PLATFORM_HEIGHT, 200.0f, 0, 0, 0, ENDOORWARP1_FF_1); Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 0.0f, PLATFORM_HEIGHT, 0.0f, 0, 0, 0, 0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c index 9a7371c97..1179d8eca 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -157,7 +157,7 @@ void Boss04_Init(Actor* thisx, PlayState* play2) { s32 pad; if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -277,7 +277,7 @@ void func_809EC568(Boss04* this, PlayState* play) { boss = play->actorCtx.actorLists[ACTORCAT_BOSS].first; while (boss != NULL) { if (boss->id == ACTOR_EN_WATER_EFFECT) { - Actor_MarkForDeath(boss); + Actor_Kill(boss); } boss = boss->next; } @@ -559,7 +559,7 @@ void func_809ED2A0(Boss04* this, PlayState* play) { } if (this->unk_1FA == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/src/overlays/actors/ovl_Boss_06/z_boss_06.c index 1b8b6fef6..f693ffdea 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c @@ -213,7 +213,7 @@ void func_809F24C8(Boss06* this, PlayState* play) { temp_s0 = play->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; while (temp_s0 != NULL) { if (temp_s0->id == ACTOR_EN_ARROW) { - Actor_MarkForDeath(temp_s0); + Actor_Kill(temp_s0); } temp_s0 = temp_s0->next; } @@ -382,7 +382,7 @@ void func_809F2C44(Boss06* this, PlayState* play) { } if (D_809F4970->unk_153 == 2) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); this->actor.child = NULL; func_809F2E14(this, play); } diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 8b5deef59..c9bd00e3f 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -213,7 +213,7 @@ void func_808CDBDC(DemoEffect* this, PlayState* play) { func_800B8FE8(&this->actor, NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); } else { func_808CDAD0(1.0f); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -232,7 +232,7 @@ void func_808CDD70(DemoEffect* this, PlayState* play) { this->timer++; if (this->actor.scale.x < 0.02f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c index d39c8aa17..188ca5b87 100644 --- a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c +++ b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c @@ -52,10 +52,11 @@ void DemoGetitem_Init(Actor* thisx, PlayState* play) { this->csAction = sCsActionIndices[itemIndex]; objectIndex = Object_GetIndex(&play->objectCtx, sObjectBankIndices[itemIndex]); if (objectIndex < 0) { - Actor_MarkForDeath(&this->actor); - } else { - this->objectIndex = objectIndex; + Actor_Kill(&this->actor); + return; } + + this->objectIndex = objectIndex; } void DemoGetitem_Destroy(Actor* thisx, PlayState* play) { @@ -82,17 +83,22 @@ void func_80A4FB68(DemoGetitem* this, PlayState* play2) { this->actor.draw = DemoGetitem_Draw; Cutscene_ActorTranslate(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction)); this->actor.shape.rot.y += 0x3E8; - return; + break; + case 3: - Actor_MarkForDeath(&this->actor); - return; + Actor_Kill(&this->actor); + break; + case 4: this->actor.draw = DemoGetitem_Draw; Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction)); this->actor.shape.yOffset = Math_SinS(sp22) * 15.0f; - return; + break; + + default: + this->actor.draw = NULL; + break; } - this->actor.draw = NULL; } else { this->actor.draw = NULL; } diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 10b72634a..be3a0ee47 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -59,7 +59,7 @@ void DemoKakyo_LostWoodsSparkleActionFunc(DemoKankyo* this, PlayState* play) { if (play->envCtx.unk_F2[3] != 0) { play->envCtx.unk_F2[3]--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (play->envCtx.unk_F2[3] < DEMOKANKYO_EFFECT_COUNT) { play->envCtx.unk_F2[3] += 16; @@ -454,7 +454,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) { DemoKankyo_SetupAction(this, DemoKakyo_LostWoodsSparkleActionFunc); sLostWoodsSparklesMutex = true; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; @@ -484,7 +484,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) { void DemoKankyo_Destroy(Actor* thisx, PlayState* play) { DemoKankyo* this = THIS; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void DemoKankyo_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index ca833fe0e..646e437c3 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -131,7 +131,7 @@ void DemoTreLgt_Animate(DemoTreLgt* this, PlayState* play) { } } if (SkelCurve_Update(play, &this->skelCurve)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c index a40bd1bc3..7e61b13de 100644 --- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c +++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c @@ -528,7 +528,7 @@ void DmChar00_Init(Actor* thisx, PlayState* play) { DmChar00* this = THIS; if ((play->sceneId == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(play)) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } this->unk_240 = D_80AA77A8[DMCHAR00_GET(thisx)]; @@ -648,7 +648,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) { break; case 0x16: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case 0x17: diff --git a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c index 6d3b18c2d..9f4c7cf1c 100644 --- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c +++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c @@ -124,7 +124,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) { this->dyna.actor.world.rot.y += 0x8000; this->dyna.actor.shape.rot.y += 0x8000; if (!(gSaveContext.save.weekEventReg[20] & 1)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c index da67e6f1c..1031a3bb6 100644 --- a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c +++ b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c @@ -92,7 +92,7 @@ void DmChar02_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); this->actionFunc = DmChar02_PerformCutsceneActions; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -151,7 +151,7 @@ void DmChar02_Update(Actor* thisx, PlayState* play) { Actor_PickUp(&this->actor, play, GI_OCARINA, 30.0f, 80.0f); } else { gSaveContext.save.playerForm = PLAYER_FORM_HUMAN; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } DmChar02_PlaySfxForCutscenes(this, play); diff --git a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c index 397fbfa3c..d755cc7ff 100644 --- a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c +++ b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c @@ -106,7 +106,7 @@ void func_80AAB710(DmChar03* this, PlayState* play) { case 3: this->unk_18E = false; shouldChangeAnim = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case 4: Item_Give(play, ITEM_MASK_DEKU); diff --git a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c index 5b6613813..5a7caebc8 100644 --- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c +++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c @@ -338,7 +338,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { case 5: sp2F = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; default: @@ -382,7 +382,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { case 5: sp2F = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; default: @@ -425,7 +425,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { case 5: sp2F = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; default: diff --git a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c index afcd2b55d..be25e9ccc 100644 --- a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c +++ b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c @@ -33,7 +33,7 @@ void DmRavine_Init(Actor* thisx, PlayState* play) { DmRavine* this = THIS; if (((((void)0, gSaveContext.save.weekEventReg[0]) & 0x10) | cREG(0)) != 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -71,7 +71,7 @@ void DmRavine_Update(Actor* thisx, PlayState* play) { } break; case DM_RAVINE_STATE_PENDING_DEATH: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } } diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index 90ccb1382..24b9ae857 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -1017,7 +1017,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->objectStk2ObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_STK2); this->objectStk3ObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_STK3); if (this->objectStkObjectIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->tatlMessageTimer = 0; @@ -1090,7 +1090,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { } else if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 0)) { if (!(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->maskType = SK_MASK_TYPE_GLOWING_EYES; @@ -1102,7 +1102,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->actionFunc = DmStk_WaitForTelescope; } else { if ((play->sceneId == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->maskType = SK_MASK_TYPE_GLOWING_EYES; @@ -1420,7 +1420,7 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { break; case 25: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case 26: @@ -1632,7 +1632,7 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { this->fadeOutState = SK_FADE_OUT_STATE_NONE; gSaveContext.save.weekEventReg[12] |= 4; if (!(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->shouldDraw = false; } diff --git a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c index 2c8bf046f..b00eea3f7 100644 --- a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c +++ b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c @@ -231,7 +231,7 @@ void DmTag_Init(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); if (gSaveContext.save.weekEventReg[85] & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -243,7 +243,7 @@ void DmTag_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; this->actionFunc = func_80C229EC; } else if (this->actor.room == 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.targetMode = 1; this->unk_18E = 1; diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index d7913b775..6812db67a 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -200,7 +200,6 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { DoorShutter* this = THIS; s32 sp24; s32 i; - s8 objId; Actor_ProcessInitChain(&this->actor, sInitChain); this->doorType = DOORSHUTTER_GET_380(&this->actor); @@ -233,9 +232,10 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { this->actor.room = -1; } - // clang-format off - objId = Object_GetIndex(&play->objectCtx, D_808A2180[sp24].objectId); this->requiredObjBankIndex = objId; if (objId < 0) { Actor_MarkForDeath(&this->actor); return; } - // clang-format on + if ((this->requiredObjBankIndex = Object_GetIndex(&play->objectCtx, D_808A2180[sp24].objectId)) < 0) { + Actor_Kill(&this->actor); + return; + } DoorShutter_SetupAction(this, DoorShutter_SetupType); this->unk_163 = sp24; diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c index be9b5c093..0d13c89c6 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c @@ -179,7 +179,7 @@ void DoorSpiral_Init(Actor* thisx, PlayState* play) { s8 objBankId; if (this->actor.room != play->doorCtx.transitionActorList[transition].sides[0].room) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -191,7 +191,7 @@ void DoorSpiral_Init(Actor* thisx, PlayState* play) { this->bankIndex = objBankId; if (objBankId < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Eff_Change/z_eff_change.c b/src/overlays/actors/ovl_Eff_Change/z_eff_change.c index 0f5245617..71aab6f0b 100644 --- a/src/overlays/actors/ovl_Eff_Change/z_eff_change.c +++ b/src/overlays/actors/ovl_Eff_Change/z_eff_change.c @@ -79,40 +79,41 @@ void func_80A4C5CC(EffChange* this, PlayState* play) { f32 phi_fv0; if (func_80183DE0(&this->skeletonInfo)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); ActorCutscene_Stop(0x7B); func_800FD2B4(play, 0.0f, 850.0f, 0.2f, 0.0f); - } else { - this->step++; - if (this->skeletonInfo.frameCtrl.unk_10 < 20.0f) { - if ((this->primColors[3]) < 242) { - this->primColors[3] += 13; - } else { - this->primColors[3] = 255; - } - } else if (this->skeletonInfo.frameCtrl.unk_10 > 70.0f) { - if ((this->primColors[3]) >= 14) { - this->primColors[3] -= 13; - } else { - this->primColors[3] = 0; - } + return; + } + + this->step++; + if (this->skeletonInfo.frameCtrl.unk_10 < 20.0f) { + if ((this->primColors[3]) < 242) { + this->primColors[3] += 13; } else { this->primColors[3] = 255; } - - phi_fv0 = this->primColors[3] * (1.0f / 255.0f); - if (phi_fv0 > 1.0f) { - phi_fv0 = 1.0f; - } else if (phi_fv0 < 0.0f) { - phi_fv0 = 0.0f; + } else if (this->skeletonInfo.frameCtrl.unk_10 > 70.0f) { + if ((this->primColors[3]) >= 14) { + this->primColors[3] -= 13; + } else { + this->primColors[3] = 0; } - func_800FD2B4(play, phi_fv0, 850.0f, 0.2f, 0.0f); - if (ActorCutscene_GetCurrentIndex() != 0x7B) { - if (ActorCutscene_GetCanPlayNext(0x7B)) { - ActorCutscene_Start(0x7B, &this->actor); - } else { - ActorCutscene_SetIntentToPlay(0x7B); - } + } else { + this->primColors[3] = 255; + } + + phi_fv0 = this->primColors[3] * (1.0f / 255.0f); + if (phi_fv0 > 1.0f) { + phi_fv0 = 1.0f; + } else if (phi_fv0 < 0.0f) { + phi_fv0 = 0.0f; + } + func_800FD2B4(play, phi_fv0, 850.0f, 0.2f, 0.0f); + if (ActorCutscene_GetCurrentIndex() != 0x7B) { + if (ActorCutscene_GetCanPlayNext(0x7B)) { + ActorCutscene_Start(0x7B, &this->actor); + } else { + ActorCutscene_SetIntentToPlay(0x7B); } } } diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index e23ed1204..3bf039360 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -175,7 +175,7 @@ void func_80919230(EffDust* this, PlayState* play) { if (this->life != 0) { this->life--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } for (i = 0; i < ARRAY_COUNT(this->distanceTraveled); i++) { diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 5d3905914..46ef861b9 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -46,7 +46,7 @@ s32 func_8092DF9C(ElfMsg* this, PlayState* play) { if (ELFMSG_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 0x81) { @@ -54,7 +54,7 @@ s32 func_8092DF9C(ElfMsg* this, PlayState* play) { if (ELFMSG_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -63,7 +63,7 @@ s32 func_8092DF9C(ElfMsg* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG_GET_SWITCHFLAG(&this->actor))) { (void)"共倒れ"; // "Collapse together" - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -139,9 +139,12 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) { if (ELFMSG_GET_SWITCHFLAG(thisx) != 0x7F) { Flags_SetSwitch(play, ELFMSG_GET_SWITCHFLAG(thisx)); } - Actor_MarkForDeath(&this->actor); - } else if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { + Actor_Kill(&this->actor); + return; + } + + if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || + (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 6e78ef085..35b83bd6f 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -46,7 +46,7 @@ s32 func_8096EC4C(ElfMsg2* this, PlayState* play) { if (ELFMSG2_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG2_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 129) { @@ -56,7 +56,7 @@ s32 func_8096EC4C(ElfMsg2* this, PlayState* play) { if (ELFMSG2_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG2_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -65,7 +65,7 @@ s32 func_8096EC4C(ElfMsg2* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG2_GET_SWITCHFLAG(&this->actor))) { (void)"共倒れ"; // "Collapse together" - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -105,14 +105,16 @@ void func_8096EE64(ElfMsg2* this, PlayState* play) { ActorCutscene_Stop(this->actor.cutscene); } } + if (this->actor.home.rot.z != 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (ELFMSG2_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG2_GET_SWITCHFLAG(&this->actor)); } - } else { - ElfMsg2_SetupAction(this, func_8096EF98); + return; } + + ElfMsg2_SetupAction(this, func_8096EF98); } else if ((this->actor.cutscene != -1) && (ActorCutscene_GetCurrentIndex() != this->actor.cutscene)) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); diff --git a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c index a62a22ad0..2e0f27d69 100644 --- a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c +++ b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c @@ -45,7 +45,7 @@ s32 func_80A2CD1C(ElfMsg3* this, PlayState* play) { if (ELFMSG3_GET_SWITCH(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG3_GET_SWITCH(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 0x81) { @@ -53,7 +53,7 @@ s32 func_80A2CD1C(ElfMsg3* this, PlayState* play) { if (ELFMSG3_GET_SWITCH(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG3_GET_SWITCH(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -62,7 +62,7 @@ s32 func_80A2CD1C(ElfMsg3* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG3_GET_SWITCH(&this->actor))) { (void)"共倒れ"; // "Collapse together" - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -137,9 +137,12 @@ void ElfMsg3_Update(Actor* thisx, PlayState* play) { if (ELFMSG3_GET_SWITCH(thisx) != 0x7F) { Flags_SetSwitch(play, ELFMSG3_GET_SWITCH(thisx)); } - Actor_MarkForDeath(&this->actor); - } else if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { + Actor_Kill(&this->actor); + return; + } + + if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || + (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c index 4c6f143ff..f44265d55 100644 --- a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c +++ b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c @@ -46,7 +46,7 @@ s32 func_80AFD380(ElfMsg4* this, PlayState* play) { if (ELFMSG4_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG4_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 0x81) { @@ -54,7 +54,7 @@ s32 func_80AFD380(ElfMsg4* this, PlayState* play) { if (ELFMSG4_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG4_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -63,7 +63,7 @@ s32 func_80AFD380(ElfMsg4* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG4_GET_SWITCHFLAG(&this->actor))) { (void)"共倒れ"; // "Collapse together" - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -156,14 +156,20 @@ void ElfMsg4_Update(Actor* thisx, PlayState* play) { if (!func_80AFD380(this, play)) { bgActor = this->elfMsg5; if ((bgActor != NULL) && (bgActor->update == NULL)) { - Actor_MarkForDeath(&this->actor); - } else if ((bgActor != NULL) && (Actor_ProcessTalkRequest(bgActor, &play->state))) { + Actor_Kill(&this->actor); + return; + } + + if ((bgActor != NULL) && (Actor_ProcessTalkRequest(bgActor, &play->state))) { if (ELFMSG4_GET_SWITCHFLAG(thisx) != 0x7F) { Flags_SetSwitch(play, ELFMSG4_GET_SWITCHFLAG(thisx)); } - Actor_MarkForDeath(&this->actor); - } else if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { + Actor_Kill(&this->actor); + return; + } + + if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || + (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c index bcc88ad5d..5bf668766 100644 --- a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c +++ b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c @@ -41,7 +41,7 @@ s32 func_80AFD990(ElfMsg5* this, PlayState* play) { if (ELFMSG5_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG5_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 0x81) { @@ -50,7 +50,7 @@ s32 func_80AFD990(ElfMsg5* this, PlayState* play) { if (ELFMSG5_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG5_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -59,7 +59,7 @@ s32 func_80AFD990(ElfMsg5* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG5_GET_SWITCHFLAG(&this->actor))) { (void)"共倒れ"; // Collapse together - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; diff --git a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c index c21da42b0..4bb598a0e 100644 --- a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c +++ b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c @@ -147,7 +147,7 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { case 0: this->actionFunc = func_80BA1E30; if (func_80BA16F4(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -156,21 +156,21 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BA1F80; if ((this->actor.cutscene == -1) || ((ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) && Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } switch (ELFMSG6_GET_F0(&this->actor)) { case 0: if (gSaveContext.save.inventory.items[ITEM_HOOKSHOT] != ITEM_HOOKSHOT) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case 1: if (gSaveContext.save.weekEventReg[83] & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -179,19 +179,19 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { case 2: if (INV_CONTENT(ITEM_OCARINA) == ITEM_OCARINA) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (gSaveContext.save.weekEventReg[8] & 0x40) { if (gSaveContext.save.weekEventReg[88] & 0x20) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.textId = 0x25B; } else { if (!(gSaveContext.save.weekEventReg[74] & 0x20) || (gSaveContext.save.weekEventReg[79] & 0x10)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.textId = 0x224; @@ -204,7 +204,7 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor))) || (gSaveContext.save.weekEventReg[88] & 0x10) || (gSaveContext.save.weekEventReg[91] & 1) || (INV_CONTENT(ITEM_MASK_ZORA) == ITEM_MASK_ZORA)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = func_80BA2048; @@ -272,7 +272,7 @@ void func_80BA1CF8(ElfMsg6* this, PlayState* play) { gSaveContext.save.weekEventReg[88] |= 0x20; break; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -315,7 +315,7 @@ void func_80BA1E30(ElfMsg6* this, PlayState* play) { break; } func_80BA165C(); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -331,7 +331,7 @@ void func_80BA1E30(ElfMsg6* this, PlayState* play) { void func_80BA1F80(ElfMsg6* this, PlayState* play) { if (((ELFMSG6_GET_F0(&this->actor)) == 1) && (gSaveContext.save.weekEventReg[83] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -339,10 +339,11 @@ void func_80BA1F80(ElfMsg6* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, NULL); Flags_SetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)); - Actor_MarkForDeath(&this->actor); - } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + Actor_Kill(&this->actor); + return; } + + ActorCutscene_SetIntentToPlay(this->actor.cutscene); } } @@ -357,14 +358,14 @@ void func_80BA2048(ElfMsg6* this, PlayState* play) { if (ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (((ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) && Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor))) || (gSaveContext.save.weekEventReg[88] & 0x10) || (gSaveContext.save.weekEventReg[91] & 1) || (INV_CONTENT(ITEM_MASK_ZORA) == ITEM_MASK_ZORA)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -375,7 +376,7 @@ void func_80BA2048(ElfMsg6* this, PlayState* play) { void func_80BA215C(ElfMsg6* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -392,13 +393,13 @@ void func_80BA21C4(ElfMsg6* this, PlayState* play) { if (ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (((ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) && Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor))) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c index 7c0dfa71c..72bdb7a7c 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c @@ -512,7 +512,7 @@ void EnAh_Init(Actor* thisx, PlayState* play) { EnAh* this = THIS; if (func_80BD2A30(this, play, ACTORCAT_NPC, ACTOR_EN_AH)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c index 4e7a51c97..14db58193 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -1099,10 +1099,10 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) { if (ENAKINDONUTS_GET_4(&this->actor)) { this->unk_2DC = func_80BED680; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENAKINDONUTS_GET_4(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_2DC = func_80BED3BC; } @@ -1113,10 +1113,10 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) { if (ENAKINDONUTS_GET_4(&this->actor)) { this->unk_2DC = func_80BEDB88; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENAKINDONUTS_GET_4(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_2DC = func_80BED8A4; } @@ -1127,10 +1127,10 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) { if (ENAKINDONUTS_GET_4(&this->actor)) { this->unk_2DC = func_80BEE070; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENAKINDONUTS_GET_4(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_2DC = func_80BEDDAC; } @@ -1141,10 +1141,10 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) { if (ENAKINDONUTS_GET_4(&this->actor)) { this->unk_2DC = func_80BEE530; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENAKINDONUTS_GET_4(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_2DC = func_80BEE274; } @@ -1586,7 +1586,7 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) { } void func_80BEFD74(EnAkindonuts* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnAkindonuts_Init(Actor* thisx, PlayState* play) { @@ -1608,7 +1608,7 @@ void EnAkindonuts_Init(Actor* thisx, PlayState* play) { if (!ENAKINDONUTS_GET_4(&this->actor)) { this->path = SubS_GetPathByIndex(play, ENAKINDONUTS_GET_FC00(&this->actor), 0x3F); if (this->path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 858d125c0..bc30c333e 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -437,7 +437,7 @@ void func_808B0894(EnAm* this, PlayState* play) { func_800B0EB0(play, &dustPos, &gZeroVec3f, &gZeroVec3f, &D_808B1120, &D_808B1124, 200, 45, 12); } } else if (this->explodeTimer == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } else if (!(this->explodeTimer & 3)) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 4); diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 8fd78fb51..5f627e2d4 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -170,7 +170,7 @@ void func_8088A594(EnArrow* this, PlayState* play) { if (this->actor.params == ENARROW_7) { Magic_Reset(play); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -298,7 +298,7 @@ void func_8088AA98(EnArrow* this, PlayState* play) { if ((this->actor.params == ENARROW_4) || (this->actor.params == ENARROW_3)) { if ((this->actor.params == ENARROW_4) && (func_8088B6B0 != this->actionFunc)) { Actor_Spawn(&play->actorCtx, play, ACTOR_BG_ICEFLOE, sp44.x, sp44.y, sp44.z, 0, 0, 0, 300); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -306,7 +306,7 @@ void func_8088AA98(EnArrow* this, PlayState* play) { this->collider.info.toucher.dmgFlags = 0x20; if (this->actor.child != NULL) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); return; } @@ -357,7 +357,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { EffectSs_Spawn(play, EFFECT_SS_SBN, 128, &sp84); } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -382,7 +382,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { } EffectSsStone1_Spawn(play, &this->actor.world.pos, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, sp82); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { EffectSsHitmark_SpawnCustomScale(play, 0, 150, &this->actor.world.pos); @@ -516,7 +516,7 @@ void func_8088B630(EnArrow* this, PlayState* play) { } if (DECR(this->unk_260) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -526,7 +526,7 @@ void func_8088B6B0(EnArrow* this, PlayState* play) { func_8088AA98(this, play); if (DECR(this->unk_260) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index 72ca1ba8e..532eebd34 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -282,7 +282,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) { void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) { if (!EnAttackNiw_IsOnScreen(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -334,7 +334,7 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) { void EnAttackNiw_FlyAway(EnAttackNiw* this, PlayState* play) { if (!EnAttackNiw_IsOnScreen(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -376,10 +376,12 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { } if (this->actor.floorHeight <= BGCHECK_Y_MIN) { // under the world - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); + return; + } - } else if ((this->actor.bgCheckFlags & 0x20) && // on or below water - (this->actionFunc != EnAttackNiw_FlyAway)) { + if ((this->actor.bgCheckFlags & 0x20) && // on or below water + (this->actionFunc != EnAttackNiw_FlyAway)) { Math_Vec3f_Copy(&splashPos, &this->actor.world.pos); splashPos.y += this->actor.depthInWater; EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, 400); diff --git a/src/overlays/actors/ovl_En_Az/z_en_az.c b/src/overlays/actors/ovl_En_Az/z_en_az.c index 08333482e..2bb0a6afc 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -162,7 +162,7 @@ void func_80A94B20(PlayState* play) { ring = SubS_FindActor(play, ring, ACTORCAT_MISC, ACTOR_EN_TWIG); if (ring != NULL) { if (RACERING_GET_PARAM_F(ring) == 1) { - Actor_MarkForDeath(ring); + Actor_Kill(ring); } ring = ring->next; } @@ -240,7 +240,7 @@ void EnAz_Init(Actor* thisx, PlayState* play2) { break; } if (phi_v1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Baba/z_en_baba.c b/src/overlays/actors/ovl_En_Baba/z_en_baba.c index dcbbee65d..abd69adc8 100644 --- a/src/overlays/actors/ovl_En_Baba/z_en_baba.c +++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.c @@ -514,7 +514,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { (BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != 0x3F)) { if ((gSaveContext.save.weekEventReg[58] & 0x40) || (gSaveContext.save.time >= CLOCK_TIME(0, 20) && (gSaveContext.save.time < CLOCK_TIME(6, 0)))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -525,7 +525,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { } else if ((BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_IDLE) && (gSaveContext.save.entrance == ENTRANCE(NORTH_CLOCK_TOWN, 7))) { if (gSaveContext.save.weekEventReg[81] & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -540,7 +540,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { this->stateFlags |= BOMB_SHOP_LADY_STATE_AUTOTALK; this->actionFunc = EnBaba_Idle; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else { diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c index e2496e18e..a4bf9c565 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c @@ -299,7 +299,7 @@ void EnBaguo_RetreatUnderground(EnBaguo* this, PlayState* play) { void EnBaguo_PostDetonation(EnBaguo* this, PlayState* play) { if (this->timer == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (this->timer >= 26) { diff --git a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c index 3555f0998..db30813ea 100644 --- a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c +++ b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c @@ -73,7 +73,7 @@ void EnBaisen_Init(Actor* thisx, PlayState* play) { this->unk290 = true; if (!(gSaveContext.save.weekEventReg[63] & 0x80) && ((gSaveContext.save.day != 3) || !gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->collider.dim.radius = 30; @@ -81,7 +81,7 @@ void EnBaisen_Init(Actor* thisx, PlayState* play) { this->collider.dim.yShift = 0; if ((gSaveContext.save.weekEventReg[63] & 0x80) || ((gSaveContext.save.day == 3) && (gSaveContext.save.isNight))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } this->actor.targetMode = 6; @@ -249,7 +249,7 @@ void EnBaisen_Update(Actor* thisx, PlayState* play) { } this->actor.shape.rot.y = this->actor.world.rot.y; if ((this->paramCopy != 0) && (gSaveContext.save.day == 3) && gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Bat/z_en_bat.c b/src/overlays/actors/ovl_En_Bat/z_en_bat.c index 5bec14e3e..96e780dcc 100644 --- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c +++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c @@ -142,10 +142,10 @@ void EnBat_Init(Actor* thisx, PlayState* play) { Actor_SetFocus(thisx, 20.0f); if (sAlreadySpawned) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else if (EnBat_IsGraveyardOnSecondDay(play)) { if (Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else { this->actor.room = -1; } @@ -369,7 +369,7 @@ void EnBat_Die(EnBat* this, PlayState* play) { func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 100, 0, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (this->actor.room == -1) { Actor* enemy = NULL; diff --git a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c index 8398a69ed..2e5efb11e 100644 --- a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c +++ b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c @@ -220,7 +220,7 @@ void EnBba01_Init(Actor* thisx, PlayState* play) { if ((this->enHy.animObjIndex < 0) || (this->enHy.headObjIndex < 0) || (this->enHy.skelUpperObjIndex < 0) || (this->enHy.skelLowerObjIndex < 0)) { - Actor_MarkForDeath(&this->enHy.actor); + Actor_Kill(&this->enHy.actor); } this->enHy.actor.draw = NULL; Collider_InitCylinder(play, &this->enHy.collider); diff --git a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c index 875a5a079..24300222d 100644 --- a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c +++ b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c @@ -466,12 +466,13 @@ void EnBbfall_Dead(EnBbfall* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->bodyPartsPos[i], 11, NA_SE_EN_EXTINCT); } - Actor_MarkForDeath(&this->actor); - } else { - for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) { - Math_Vec3f_Sum(&this->bodyPartsPos[i], &this->bodyPartsVelocity[i], &this->bodyPartsPos[i]); - this->bodyPartsVelocity[i].y += this->actor.gravity; - } + Actor_Kill(&this->actor); + return; + } + + for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) { + Math_Vec3f_Sum(&this->bodyPartsPos[i], &this->bodyPartsVelocity[i], &this->bodyPartsPos[i]); + this->bodyPartsVelocity[i].y += this->actor.gravity; } } diff --git a/src/overlays/actors/ovl_En_Bee/z_en_bee.c b/src/overlays/actors/ovl_En_Bee/z_en_bee.c index 7d40e9931..0745c55ea 100644 --- a/src/overlays/actors/ovl_En_Bee/z_en_bee.c +++ b/src/overlays/actors/ovl_En_Bee/z_en_bee.c @@ -243,7 +243,7 @@ void EnBee_UpdateDamage(EnBee* this, PlayState* play) { this->actor.colChkInfo.health = 0; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_EXTINCT); func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 100, 0, 2); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index ba7273f59..f2fe54dae 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -106,7 +106,7 @@ void EnBigokuta_Init(Actor* thisx, PlayState* play) { if (gSaveContext.save.weekEventReg[20] & 2 || ((this->picto.actor.params != 0xFF) && Flags_GetSwitch(play, this->picto.actor.params))) { - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); } else { this->picto.actor.world.pos.y -= 99.0f; EnBigokuta_SetupIdle(this); @@ -451,7 +451,7 @@ void EnBigokuta_PlayDeathEffects(EnBigokuta* this, PlayState* play) { } ActorCutscene_Stop(this->cutscene); - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); if (!(gSaveContext.eventInf[4] & 2) && !(gSaveContext.eventInf[3] & 0x20)) { func_800B724C(play, &this->picto.actor, 6); @@ -517,7 +517,7 @@ void EnBigokuta_Update(Actor* thisx, PlayState* play) { EnBigokuta* this = THIS; if (!EnBigokuta_IsInWater(this, play)) { - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); return; } diff --git a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c index bf6e46e36..c3cdf829f 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c @@ -710,7 +710,7 @@ void func_80A28EE8(EnBigpamet* this, PlayState* play) { func_800B0DE0(play, &pos, &gZeroVec3f, &gZeroVec3f, &D_80A29788, &D_80A2978C, 800, 50); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_NPC_FADEAWAY); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.scale.y = this->actor.scale.x; diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index 57dae0368..8c22c064f 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -185,11 +185,12 @@ void EnBigpo_Init(Actor* thisx, PlayState* play2) { thisx->params &= 0xFF; if (thisx->params == ENBIGPO_POSSIBLEFIRE) { if (Flags_GetSwitch(play, this->switchFlags)) { - Actor_MarkForDeath(&this->actor); - } else { - thisx->update = Actor_Noop; - EnBigpo_InitHiddenFire(this); + Actor_Kill(&this->actor); + return; } + + thisx->update = Actor_Noop; + EnBigpo_InitHiddenFire(this); return; } @@ -215,7 +216,7 @@ void EnBigpo_Init(Actor* thisx, PlayState* play2) { this->mainColor.a = 0; // fully invisible if ((this->switchFlags != 0xFF) && (Flags_GetSwitch(play, this->switchFlags))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (thisx->params == ENBIGPO_REGULAR) { // the well poe, starts immediately @@ -819,8 +820,11 @@ void EnBigpo_SetupScoopSoulIdle(EnBigpo* this) { void EnBigpo_ScoopSoulIdle(EnBigpo* this, PlayState* play) { DECR(this->idleTimer); if (Actor_HasParent(&this->actor, play)) { - Actor_MarkForDeath(&this->actor); - } else if (this->idleTimer == 0) { + Actor_Kill(&this->actor); + return; + } + + if (this->idleTimer == 0) { // took too long, soul is leaving Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); EnBigpo_SetupScoopSoulLeaving(this); @@ -838,7 +842,7 @@ void EnBigpo_SetupScoopSoulLeaving(EnBigpo* this) { void EnBigpo_ScoopSoulFadingAway(EnBigpo* this, PlayState* play) { EnBigpo_AdjustPoAlpha(this, -13); if (this->mainColor.a == 0) { // fully invisible - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -981,7 +985,7 @@ void EnBigpo_WaitingForDampe(EnBigpo* this, PlayState* play) { } void EnBigpo_Die(EnBigpo* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnBigpo_SetupFireRevealed(EnBigpo* this) { @@ -1045,7 +1049,7 @@ void EnBigpo_FlameCircleCutscene(EnBigpo* this, PlayState* play) { EnBigpo* parentPoh = (EnBigpo*)this->actor.parent; Flags_SetSwitch(play, this->switchFlags); Math_Vec3f_Copy(&parentPoh->fires[this->unk20C].pos, &this->actor.world.pos); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (this->unk20C == 0) { parentPoh->actor.draw = EnBigpo_DrawCircleFlames; Actor_SetScale(&parentPoh->actor, 0.01f); diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c index f65172093..1cac3caff 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -341,7 +341,7 @@ void EnBigslime_Init(Actor* thisx, PlayState* play2) { this->actor.params = CLAMP(this->actor.params, 1, 4); if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (!(gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] & (u8)isFrogReturnedFlags[this->actor.params - 1])) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_MINIFROG, this->actor.world.pos.x, this->actor.world.pos.y, @@ -360,10 +360,10 @@ void EnBigslime_Init(Actor* thisx, PlayState* play2) { ACTOR_EN_MINISLIME, 0.0f, 0.0f, 0.0f, 0, 0, 0, i); if (this->minislime[i] == NULL) { for (i = i - 1; i >= 0; i--) { - Actor_MarkForDeath(&this->minislime[i]->actor); + Actor_Kill(&this->minislime[i]->actor); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -2509,7 +2509,7 @@ void EnBigslime_Despawn(EnBigslime* this, PlayState* play) { this->minislime[i]->actor.params = MINISLIME_DESPAWN; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c index e49b743b8..962bb2231 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c @@ -357,7 +357,7 @@ void EnBji01_Init(Actor* thisx, PlayState* play) { func_809CCE98(this, play); break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } } diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index d4fe409cd..ea02e9fe7 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -377,7 +377,7 @@ void func_808715B8(EnBom* this, PlayState* play) { if (this->timer == 0) { func_80123590(play, &this->actor); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if ((this->timer & 1) == 0) { @@ -438,7 +438,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) { } if (Player_GetMask(play) == PLAYER_MASK_GIANT) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } @@ -451,7 +451,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) { if (this->isPowderKeg) { gSaveContext.powderKegTimer = 0; } - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } } else { thisx->gravity = -1.2f; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 21fc9901f..795bc422d 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -101,11 +101,11 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play) { !CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { this->unk_2D6 = this->actor.cutscene; if (this->unk_2D6 == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_809C52B4(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -158,7 +158,7 @@ void func_809C4B50(EnBomBowlMan* this) { void func_809C4B6C(EnBomBowlMan* this) { if ((this->unk_29A != ENBOMBOWLMAN_FF00_MINUS1) && (this->path != NULL)) { if (!SubS_CopyPointFromPath(this->path, this->unk_298, &this->unk_2A0)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -369,7 +369,7 @@ void func_809C5310(EnBomBowlMan* this, PlayState* play) { func_809C53A4(this); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -486,10 +486,11 @@ void func_809C5738(EnBomBowlMan* this, PlayState* play) { gSaveContext.save.weekEventReg[84] |= 0x80; gSaveContext.save.weekEventReg[83] &= (u8)~4; ActorCutscene_Stop(this->unk_2D6); - Actor_MarkForDeath(&this->actor); - } else { - func_809C4B6C(this); + Actor_Kill(&this->actor); + return; } + + func_809C4B6C(this); } } } diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index b1b9f8d14..717c582a6 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -350,7 +350,7 @@ void EnBomChu_Explode(EnBomChu* this, PlayState* play) { void EnBomChu_WaitForDeath(EnBomChu* this, PlayState* play) { if (this->timer == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c index a4fc5d484..49e1f22e6 100644 --- a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c +++ b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c @@ -149,8 +149,11 @@ void func_80C05DE8(EnBombal* this, PlayState* play) { !(gSaveContext.save.weekEventReg[85] & 2)) { ActorCutscene_Stop(this->cutscene); } - Actor_MarkForDeath(&this->actor); - } else if (this->timer < 10) { + Actor_Kill(&this->actor); + return; + } + + if (this->timer < 10) { this->actor.colChkInfo.health = 0; } } diff --git a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c index 7d4fbbafb..1fb8c0cf5 100644 --- a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c +++ b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c @@ -105,11 +105,12 @@ void EnBombers_Init(Actor* thisx, PlayState* play) { if (this->unk_2BC == ENBOMBERS_F0_0) { if ((gSaveContext.save.weekEventReg[73] & 0x10) || (gSaveContext.save.weekEventReg[85] & 2)) { - Actor_MarkForDeath(&this->actor); - } else { - this->unk_2BE++; - func_80C03ACC(this); + Actor_Kill(&this->actor); + return; } + + this->unk_2BE++; + func_80C03ACC(this); } else if (((gSaveContext.save.weekEventReg[73] & 0x10) || (gSaveContext.save.weekEventReg[85] & 2)) && (((this->unk_2BE == ENBOMBERS_F_0) && (gSaveContext.save.weekEventReg[76] & 1)) || ((this->unk_2BE == ENBOMBERS_F_1) && (gSaveContext.save.weekEventReg[76] & 2)) || @@ -137,12 +138,13 @@ void EnBombers_Init(Actor* thisx, PlayState* play) { gSaveContext.save.weekEventReg[76] &= (u8)~0x10; } } - Actor_MarkForDeath(&this->actor); - } else { - func_80C042F8(this); + Actor_Kill(&this->actor); + return; } + + func_80C042F8(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c index 9f70629e6..a381509e0 100644 --- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c +++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c @@ -102,7 +102,7 @@ void EnBombers2_Init(Actor* thisx, PlayState* play) { } this->cutscene = this->actor.cutscene; if (this->cutscene == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_80C04B40(this); } diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 4eb0ea456..c9c7e623b 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -305,7 +305,7 @@ void func_808AEFD4(EnBombf* this, PlayState* play) { player->interactRangeActor = NULL; player->stateFlags1 &= ~0x800; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -439,8 +439,11 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { if ((this->actor.scale.x >= 0.01f) && (ENBOMBF_GET(&this->actor) != ENBOMBF_1)) { if (this->actor.depthInWater >= 20.0f) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_IT_BOMB_UNEXPLOSION); - Actor_MarkForDeath(&this->actor); - } else if (this->actor.bgCheckFlags & 0x40) { + Actor_Kill(&this->actor); + return; + } + + if (this->actor.bgCheckFlags & 0x40) { this->actor.bgCheckFlags &= ~0x40; Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMB_DROP_WATER); } diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c index 48b953ffe..b55762e7d 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c @@ -152,7 +152,7 @@ void EnBomjima_Init(Actor* thisx, PlayState* play) { if ((gSaveContext.save.weekEventReg[75] & 0x40) || (gSaveContext.save.weekEventReg[73] & 0x10) || (gSaveContext.save.weekEventReg[85] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index 300d83958..f1f85077b 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -119,35 +119,35 @@ void EnBomjimb_Init(Actor* thisx, PlayState* play) { switch (this->unk_2C8) { case ENBOMJIMB_F_0: if (gSaveContext.save.weekEventReg[11] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENBOMJIMB_F_1: if (gSaveContext.save.weekEventReg[11] & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENBOMJIMB_F_2: if (gSaveContext.save.weekEventReg[11] & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENBOMJIMB_F_3: if (gSaveContext.save.weekEventReg[11] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENBOMJIMB_F_4: if (gSaveContext.save.weekEventReg[11] & 0x10) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -156,7 +156,7 @@ void EnBomjimb_Init(Actor* thisx, PlayState* play) { if ((!(gSaveContext.save.weekEventReg[73] & 0x10) && !(gSaveContext.save.weekEventReg[85] & 2)) || (gSaveContext.save.weekEventReg[75] & 0x40)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 2c68e20f8..b760c4435 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -267,7 +267,7 @@ void func_808A2918(EnBoom* this, PlayState* play) { sp7C->flags &= ~ACTOR_FLAG_2000; } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 06c5c33b1..799a1fb26 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -366,7 +366,7 @@ void EnBubble_Wait(EnBubble* this, PlayState* play) { void EnBubble_Pop(EnBubble* this, PlayState* play) { if (EnBubble_Explosion(this, play) > -1) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 60, NA_SE_EN_AWA_BREAK); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index 93bc67792..0a636be0d 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -396,7 +396,7 @@ void func_8091D070(EnButte* this) { void func_8091D090(EnButte* this, PlayState* play) { if (this->unk_24C <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index c457a623e..e7ee1afb6 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -615,7 +615,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play) { } else if (this->activeTimer != 0) { EnClearTag_UpdateEffects(this, play); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c index 993076ba8..4a8684340 100644 --- a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c +++ b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c @@ -210,7 +210,7 @@ void EnCne01_Init(Actor* thisx, PlayState* play) { if ((this->enHy.animObjIndex < 0) || (this->enHy.headObjIndex < 0) || (this->enHy.skelUpperObjIndex < 0) || (this->enHy.skelLowerObjIndex < 0)) { - Actor_MarkForDeath(&this->enHy.actor); + Actor_Kill(&this->enHy.actor); } this->enHy.actor.draw = NULL; Collider_InitCylinder(play, &this->enHy.collider); diff --git a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c index 0b909d61f..26540f16e 100644 --- a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c +++ b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c @@ -140,7 +140,7 @@ void func_80AFDE00(EnColMan* this, PlayState* play) { void EnColMan_SetHeartPieceCollectedAndKill(EnColMan* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { gSaveContext.save.weekEventReg[56] |= 2; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -183,7 +183,7 @@ void func_80AFDFB4(EnColMan* this, PlayState* play) { Rand_ZeroFloat(50.0f) + 60.0f, 30, Rand_ZeroFloat(5.0f) + 20.0f); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -211,7 +211,7 @@ void func_80AFE25C(EnColMan* this, PlayState* play) { } Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index df6093690..18758bcc9 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -118,7 +118,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { if (!(gSaveContext.save.weekEventReg[22] & 1) && (CURRENT_DAY != 1) && (EN_COW_TYPE(thisx) == EN_COW_TYPE_ABDUCTED)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index c04462c44..2cf35e7a4 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -349,7 +349,7 @@ void EnCrow_Damaged(EnCrow* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT); if (this->actor.parent != NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } EnCrow_SetupDie(this); diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/src/overlays/actors/ovl_En_Dai/z_en_dai.c index 6abf4da13..0404f4ecb 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -531,7 +531,7 @@ void EnDai_Init(Actor* thisx, PlayState* play) { } if (gSaveContext.save.weekEventReg[30] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 45777c681..70bde8754 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -90,10 +90,10 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { this->actor.flags |= ACTOR_FLAG_8000000; if ((gSaveContext.save.weekEventReg[63] & 0x80) || ((gSaveContext.save.day == 3) && gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if ((gSaveContext.save.day == 3) && gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Math_Vec3f_Copy(&this->unk_26C, &this->actor.world.pos); @@ -137,7 +137,7 @@ void func_8094373C(EnDaiku* this, s32 arg1) { void func_809437C8(EnDaiku* this) { if ((this->unk_288 != -1) && (this->unk_258 != 0)) { if (!SubS_CopyPointFromPath(this->unk_258, this->unk_25C, &this->unk_26C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -259,7 +259,7 @@ void EnDaiku_Update(Actor* thisx, PlayState* play) { } if ((this->unk_278 == ENDAIKU_PARAMS_FF_0) && (gSaveContext.save.day == 3) && (gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c index b7b46b5af..53474f514 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c @@ -71,7 +71,7 @@ static ColliderCylinderInit sCylinderInit = { void func_80BE61D0(EnDaiku2* this) { if ((this->unk_27A != -1) && (this->unk_258 != 0)) { if (!SubS_CopyPointFromPath(this->unk_258, this->unk_25C, &this->unk_268)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -93,7 +93,7 @@ void EnDaiku2_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); if (!this->unk_280) { if (day == 3) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -105,7 +105,7 @@ void EnDaiku2_Init(Actor* thisx, PlayState* play) { Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_268); } } else if (day != 3) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 0f37266e2..990a7328e 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -544,7 +544,7 @@ void func_808BE4D4(EnDekunuts* this, PlayState* play) { DEKU_FLOWER_PARAMS(DEKU_FLOWER_TYPE_PINK_WITH_INITIAL_BOUNCE)); EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 6.0f, 0, 6, 2, 15, OBJECT_DEKUNUTS, 10, gDekuScrubFlowerFragmentDL); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c index de2c586e9..7e540c83a 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -347,7 +347,7 @@ void EnDg_MoveAlongPath(EnDg* this, PlayState* play) { Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -430,7 +430,7 @@ void EnDg_UpdateTextId(EnDg* this) { 0x3538 + (gSaveContext.save.weekEventReg[42 + (this->index / 2)] & 0x0F); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } // As a sanity check, this makes sure the text ID is something in the expected range of 0x3538 to 0x3546. diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c index 506e5eb47..94d0204f2 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -1145,7 +1145,7 @@ void func_8089D018(EnDinofos* this, PlayState* play) { } if (temp_v0 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); this->unk_288 = 0; } else { this->unk_288 = temp_v0; diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c index 346246f86..75537bf86 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -242,7 +242,7 @@ void EnDnk_Init(Actor* thisx, PlayState* play) { if (this->unk_28E >= 0) { this->actionFunc = func_80A51648; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk_2A2 = D_80A521A0; diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.c b/src/overlays/actors/ovl_En_Dno/z_en_dno.c index 685c3a511..0c2aa8369 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -222,7 +222,7 @@ void EnDno_Init(Actor* thisx, PlayState* play) { actor = SubS_FindActor(play, actor, ACTORCAT_NPC, ACTOR_EN_DNO); if (actor != NULL) { if (actor != thisx) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); break; } actor = actor->next; @@ -250,7 +250,7 @@ void EnDno_Init(Actor* thisx, PlayState* play) { case EN_DNO_GET_C000_0: func_80A71788(this, play); if (!(gSaveContext.save.weekEventReg[23] & 0x20) || (gSaveContext.save.weekEventReg[93] & 2)) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, EN_DNO_ANIM_IDLE_WITH_CANDLE, &this->animIndex); @@ -265,13 +265,13 @@ void EnDno_Init(Actor* thisx, PlayState* play) { case EN_DNO_GET_C000_1: if (gSaveContext.save.weekEventReg[23] & 0x20) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, EN_DNO_ANIM_IDLE, &this->animIndex); this->unk_460 = SubS_FindActor(play, NULL, ACTORCAT_NPC, ACTOR_EN_DNQ); if (this->unk_460 == NULL) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else { this->actionFunc = func_80A71B68; } diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c index 63371ee2f..dea49a276 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -300,8 +300,11 @@ void func_80B3D338(EnDnp* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((this->unk_32E != 0) && (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING)) { - Actor_MarkForDeath(&this->actor); - } else if (this->unk_32E == 0) { + Actor_Kill(&this->actor); + return; + } + + if (this->unk_32E == 0) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->unk_32E = 1; } else { @@ -379,7 +382,7 @@ void EnDnp_Init(Actor* thisx, PlayState* play) { } this->actionFunc = func_80B3D2D4; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index f8588614f..3e4cf3154 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -502,7 +502,7 @@ void EnDns_Init(Actor* thisx, PlayState* play) { EnDns* this = THIS; if (!func_8092D068(this)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index cd3710a3b..95ce32645 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -729,7 +729,7 @@ void func_80877E60(EnDodongo* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 28.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_EAT); if (this->actor.child != NULL) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); this->actor.child = NULL; } this->actor.flags &= ~ACTOR_FLAG_10; @@ -931,7 +931,7 @@ void func_808787B0(EnDodongo* this, PlayState* play) { } else { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_PURPLE); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 5d2822d78..ca64711ad 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -420,7 +420,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { objectInfo = &sObjInfo[15]; objectBankIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId); if (objectBankIndex != 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } diff --git a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c index a17ce6193..61dd4921d 100644 --- a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c +++ b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c @@ -106,7 +106,7 @@ void EnDoorEtc_Init(Actor* thisx, PlayState* play2) { } objectIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId); if (objectIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->objectIndex = objectIndex; this->dListIndex = objectInfo->dListIndex; @@ -214,7 +214,7 @@ void func_80AC2354(EnDoorEtc* this, PlayState* play) { this->actor.world.pos.z = door->world.pos.z; this->actor.shape.rot.y = door->shape.rot.y; this->actor.world.rot.y = door->world.rot.y; - Actor_MarkForDeath(door); + Actor_Kill(door); this->actionFunc = func_80AC21A0; this->actor.textId = 0x239B; Actor_SetFocus(&this->actor, 70.0f); diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c index c8b1c9823..870bed49f 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c @@ -720,7 +720,7 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnDragon_UpdateDamage(EnDragon* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 7770cc3ec..343112f49 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -65,7 +65,7 @@ void func_80A613C8(EnDyExtra* this, PlayState* play) { Math_ApproachF(&this->actor.gravity, 0.0f, 0.1f, 0.005f); if (this->unk14C == 0 || this->unk150 < 0.02f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index aa4768a76..aaa552b45 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -297,7 +297,7 @@ void func_8088CC48(EnElf* this, PlayState* play) { this->unk_25C = 0; this->disappearTimer = 240; if ((this->fairyFlags & 0x400) && Flags_GetCollectible(play, this->unk_260)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -420,7 +420,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) { break; case 8: - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; case 3: @@ -627,7 +627,7 @@ s32 func_8088DCA4(EnElf* this) { if (this->disappearTimer > -10) { Actor_SetScale(&this->actor, (this->disappearTimer + 10) * 0.008f * 0.1f); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -658,7 +658,7 @@ void func_8088DD34(EnElf* this, PlayState* play) { if (this->fairyFlags & 0x400) { Flags_SetCollectible(play, this->unk_260); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -717,7 +717,7 @@ void func_8088E018(EnElf* this, PlayState* play) { parentPos.y += (1500.0f * this->actor.scale.y) + 40.0f; func_8088D660(this, &parentPos, 0.2f); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk_258 = Math_FAtan2F(this->actor.velocity.z, this->actor.velocity.x); } @@ -762,7 +762,7 @@ void func_8088E0F0(EnElf* this, PlayState* play) { } if (this->unk_224.y < -10.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -776,7 +776,7 @@ void func_8088E304(EnElf* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->unk_224.y > 200.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c index 42a4a06d8..07dafa54f 100644 --- a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c +++ b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c @@ -57,7 +57,7 @@ void EnElfbub_Init(Actor* thisx, PlayState* play) { Actor* childActor; if (Flags_GetSwitch(play, ENELFBUB_GET_SWITCHFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -117,7 +117,7 @@ void EnElfbub_Pop(EnElfbub* this, PlayState* play) { } SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 60, NA_SE_EN_AWA_BREAK); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c index 12d804fba..11a4b1136 100644 --- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c +++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c @@ -81,21 +81,21 @@ void EnElforg_Init(Actor* thisx, PlayState* play) { switch (STRAY_FAIRY_TYPE(thisx)) { case STRAY_FAIRY_TYPE_CLOCK_TOWN: if (gSaveContext.save.weekEventReg[8] & 0x80) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } break; case STRAY_FAIRY_TYPE_COLLECTIBLE: if (Flags_GetCollectible(play, STRAY_FAIRY_FLAG(thisx))) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } break; default: if (Flags_GetSwitch(play, STRAY_FAIRY_FLAG(thisx))) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } break; @@ -374,7 +374,7 @@ void EnElforg_FreeFloatingFairyFountain(EnElforg* this, PlayState* play) { Actor_SetScale(&this->actor, this->actor.scale.x * 0.9f); if (this->actor.scale.x < 0.001f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -400,7 +400,7 @@ void EnElforg_CirclePlayer(EnElforg* this, PlayState* play) { void EnElforg_FairyCollected(EnElforg* this, PlayState* play) { EnElforg_CirclePlayer(this, play); if (this->timer > 80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -429,17 +429,18 @@ void EnElforg_ClockTownFairyCollected(EnElforg* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { player->actor.freezeTimer = 0; player->stateFlags1 &= ~0x20000000; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); gSaveContext.save.weekEventReg[8] |= 0x80; ActorCutscene_Stop(0x7C); - } else { - func_800B9010(&this->actor, NA_SE_PL_CHIBI_FAIRY_HEAL - SFX_FLAG); - if (ActorCutscene_GetCurrentIndex() != 0x7C) { - if (ActorCutscene_GetCanPlayNext(0x7C)) { - ActorCutscene_Start(0x7C, &this->actor); - } else { - ActorCutscene_SetIntentToPlay(0x7C); - } + return; + } + + func_800B9010(&this->actor, NA_SE_PL_CHIBI_FAIRY_HEAL - SFX_FLAG); + if (ActorCutscene_GetCurrentIndex() != 0x7C) { + if (ActorCutscene_GetCanPlayNext(0x7C)) { + ActorCutscene_Start(0x7C, &this->actor); + } else { + ActorCutscene_SetIntentToPlay(0x7C); } } } diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 0305af8ef..3198f1402 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -40,7 +40,7 @@ void EnEncount1_Init(Actor* thisx, PlayState* play) { EnEncount1* this = THIS; if (this->actor.params <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -128,7 +128,7 @@ void func_808E0954(EnEncount1* this, PlayState* play) { case EN_ENCOUNT1_SKULLFISH_2: if ((this->path != NULL) && (!SubS_CopyPointFromPath(this->path, 0, &spawnPos))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index 506f14790..cded227d1 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -121,7 +121,7 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) { } if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -181,7 +181,7 @@ void EnEncount2_Die(EnEncount2* this, PlayState* play) { if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c index 508090fd5..82f6838bc 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -178,7 +178,7 @@ void EnFall_Init(Actor* thisx, PlayState* play) { } if (objectIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->objIndex = objectIndex; @@ -221,7 +221,7 @@ void EnFall_Setup(EnFall* this, PlayState* play) { this->actionFunc = EnFall_StoppedClosedMouthMoon_PerformCutsceneActions; Actor_SetScale(&this->actor, this->scale * 3.0f); if (!(gSaveContext.save.weekEventReg[25] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; @@ -230,7 +230,7 @@ void EnFall_Setup(EnFall* this, PlayState* play) { Actor_SetScale(&this->actor, this->scale * 3.0f); this->actor.draw = EnFall_Moon_Draw; if (gSaveContext.save.weekEventReg[25] & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; @@ -280,12 +280,12 @@ void EnFall_Setup(EnFall* this, PlayState* play) { this->actionFunc = EnFall_MoonsTear_Fall; Actor_SetScale(&this->actor, 0.02f); if (!(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } moon = EnFall_MoonsTear_GetTerminaFieldMoon(play); this->actor.child = moon; if (moon == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; diff --git a/src/overlays/actors/ovl_En_Famos/z_en_famos.c b/src/overlays/actors/ovl_En_Famos/z_en_famos.c index b6b93aded..4f8f1928f 100644 --- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c +++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c @@ -723,7 +723,7 @@ void EnFamos_DeathFade(EnFamos* this, PlayState* play) { if (enBom != NULL) { enBom->parent = NULL; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index ba43ec2a4..8a9c2ac55 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -411,7 +411,7 @@ void EnFirefly_Die(EnFirefly* this, PlayState* play) { if (this->timer == 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xA0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 0479ba261..dc0b52731 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -520,7 +520,7 @@ void func_8091E880(Actor* thisx, PlayState* play) { } } else if ((this->unk_240 <= 0) && (this->actor.params == ENFISH_0) && (this->actor.floorHeight < BGCHECK_Y_MIN + 10)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -582,8 +582,11 @@ void func_8091EAF0(Actor* thisx, PlayState* play) { } if (this->unk_240 <= 0) { - Actor_MarkForDeath(&this->actor); - } else if (this->unk_240 <= 60) { + Actor_Kill(&this->actor); + return; + } + + if (this->unk_240 <= 60) { if (sp40 & 4) { this->actor.draw = EnFish_Draw; } else { @@ -655,7 +658,7 @@ void func_8091ED70(Actor* thisx, PlayState* play) { } if (this->unk_240 <= 0) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } } @@ -688,7 +691,7 @@ void func_8091EFE8(Actor* thisx, PlayState* play) { s16 sp2E; if (sp3C == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -878,10 +881,11 @@ void func_8091F5A4(Actor* thisx, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; if (this->actor.params == ENFISH_0) { - Actor_MarkForDeath(&this->actor); - } else { - func_8091D904(this); + Actor_Kill(&this->actor); + return; } + + func_8091D904(this); } else if (func_8091DDF4(this, play)) { Actor_PickUp(&this->actor, play, GI_MAX, 80.0f, 25.0f); } @@ -892,7 +896,7 @@ void func_8091F830(Actor* thisx, PlayState* play) { EnFish* this = THIS; if (this->actor.params == ENFISH_1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c index a0575eb9a..97ce12127 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -527,7 +527,7 @@ void func_80B2951C(EnFish2* this) { this->unk_2B4 = 10; this->actor.speedXZ = 3.0f; - Actor_MarkForDeath(this->unk_350); + Actor_Kill(this->unk_350); this->unk_350 = NULL; D_80B2B2F4 = &this->actor; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_M_EAT); @@ -806,7 +806,7 @@ void func_80B2A094(EnFish2* this, PlayState* play) { if (D_80B2B2EC != 0) { D_80B2B2EC++; if (D_80B2B2EC > 200) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); ActorCutscene_Stop(this->unk_2BA[0]); return; } @@ -863,7 +863,7 @@ void func_80B2A23C(EnFish2* this, PlayState* play) { D_80B2B2E0 = D_80B2B2EC = D_80B2B2E4 = 0; D_80B2B2F4 = NULL; ActorCutscene_Stop(this->unk_2BA[0]); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index d940a0959..0af2c8f61 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -3865,7 +3865,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { D_8090CCF0 = this->unk_1A4; D_809171D0 = this->unk_148; D_809171D2 = D_80917206; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if ((this->unk_148 == 0) && (D_809171D0 == 0) && ((s16)this->unk_1A4 < (s16)D_8090CCF0)) { this->unk_1CD = 1; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 92330d25a..48f694e8a 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -178,7 +178,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { &play->actorCtx, play, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, params + 0x10, -1, this->actor.unk20, NULL); if (this->actor.parent == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -186,8 +186,8 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, params + 0x10, -1, this->actor.unk20, NULL); if (this->actor.child == NULL) { - Actor_MarkForDeath(this->actor.parent); - Actor_MarkForDeath(&this->actor); + Actor_Kill(this->actor.parent); + Actor_Kill(&this->actor); return; } @@ -898,7 +898,7 @@ void func_808D2A20(EnFloormas* this) { if ((parent->actionFunc == func_808D2AA8) && (child->actionFunc == func_808D2AA8)) { func_808D2AB8(parent); func_808D2AB8(child); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.draw = NULL; this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_10); @@ -917,7 +917,7 @@ void func_808D2AB8(EnFloormas* this) { } void func_808D2AF4(EnFloormas* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_808D2B18(EnFloormas* this) { diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index a8276e649..5ca2e8c22 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -30,10 +30,11 @@ void EnFr_Init(Actor* thisx, PlayState* play) { EnFr* this = THIS; if (Flags_GetSwitch(play, ENFR_GET_SWITCHFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); - } else { - this->actor.targetMode = ENFR_GET_TARGETMODE(&this->actor); + Actor_Kill(&this->actor); + return; } + + this->actor.targetMode = ENFR_GET_TARGETMODE(&this->actor); } void EnFr_Destroy(Actor* thisx, PlayState* play) { @@ -43,8 +44,11 @@ void EnFr_Update(Actor* thisx, PlayState* play) { EnFr* this = THIS; if (Flags_GetSwitch(play, ENFR_GET_SWITCHFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); - } else if (this->actor.xyzDistToPlayerSq < SQ(IREG(29))) { + Actor_Kill(&this->actor); + return; + } + + if (this->actor.xyzDistToPlayerSq < SQ(IREG(29))) { this->actor.flags &= ~ACTOR_FLAG_40000000; } else { this->actor.flags |= ACTOR_FLAG_40000000; diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index 45206159e..0cc5fb026 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -1417,7 +1417,7 @@ void EnFsn_Init(Actor* thisx, PlayState* play) { EnFsn_InitShop(this, play); } else { if ((gSaveContext.save.weekEventReg[33] & 8) || (gSaveContext.save.weekEventReg[79] & 0x40)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Collider_InitCylinder(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index c0be81361..7d1166ef2 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -274,7 +274,7 @@ void func_80961E88(PlayState* play) { Actor* explosive = play->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; while (explosive != NULL) { - Actor_MarkForDeath(explosive); + Actor_Kill(explosive); explosive = explosive->next; } } diff --git a/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c b/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c index a2fc00b22..1a51d0ec7 100644 --- a/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c +++ b/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c @@ -100,7 +100,7 @@ void EnFuKago_Init(Actor* thisx, PlayState* play) { } if (npc == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -342,7 +342,7 @@ void func_80AD0288(EnFuKago* this, PlayState* play) { scale->z = scale->x; scale->y = scale->x; if (scale->x == 0.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c index 19aa9dd2a..f4055c113 100644 --- a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c +++ b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c @@ -92,7 +92,7 @@ void EnFuMato_Init(Actor* thisx, PlayState* play) { } if (actor == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -192,7 +192,7 @@ void func_80ACE718(EnFuMato* this, PlayState* play) { Vec3f sp30 = { 0.0f, 2.0f, 0.0f }; func_800B3030(play, &this->dyna.actor.world.pos, &sp3C, &sp30, 20, 40, 2); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } @@ -352,7 +352,7 @@ void func_80ACEFD8(EnFuMato* this, PlayState* play) { Math_SmoothStepToF(&scale->x, 0.0f, 0.1f, 0.005f, 0.005f); scale->y = scale->z = scale->x; if (scale->x == 0.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 58d5a6f5f..9f2281b60 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -663,7 +663,7 @@ void func_809336C0(EnFz* this, PlayState* play) { void func_80933760(EnFz* this, PlayState* play) { if (this->unk_BCA == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c index e01193378..c8b2c7ee3 100644 --- a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c +++ b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c @@ -149,7 +149,7 @@ void func_80AF6A78(EnGamelupy* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unk_19C > 30) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_19C++; this->actor.world.pos = player->actor.world.pos; diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c index 45d6661eb..0c7a74793 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c @@ -652,25 +652,26 @@ void func_80B10A48(EnGb2* this, PlayState* play) { switch (ENGB2_GET_7(&this->actor)) { case ENGB2_7_0: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case ENGB2_7_1: ActorCutscene_Stop(this->unk_282[this->unk_290]); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case ENGB2_7_2: ActorCutscene_Stop(this->unk_282[this->unk_290]); if (this->unk_26E == 0x14FB) { Flags_SetSwitch(play, ENGB2_GET_7F8(&this->actor)); - Actor_MarkForDeath(&this->actor); - } else { - this->actor.draw = NULL; - this->unk_26C |= 0x100; - this->actor.flags &= ~ACTOR_FLAG_1; - this->actionFunc = func_80B111AC; + Actor_Kill(&this->actor); + return; } + + this->actor.draw = NULL; + this->unk_26C |= 0x100; + this->actor.flags &= ~ACTOR_FLAG_1; + this->actionFunc = func_80B111AC; break; } } @@ -869,7 +870,7 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { EnGb2* this = THIS; if (func_80B0F660(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -885,9 +886,9 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { switch (ENGB2_GET_7(&this->actor)) { case ENGB2_7_0: if (gSaveContext.save.weekEventReg[54] & 0x80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (gSaveContext.save.weekEventReg[52] & 0x20) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (gSaveContext.save.entrance == ENTRANCE(GHOST_HUT, 1)) { @@ -910,12 +911,12 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { case ENGB2_7_1: if ((play->curSpawn == 1) || (gSaveContext.save.weekEventReg[80] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (Flags_GetSwitch(play, ENGB2_GET_7F8(thisx))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -929,13 +930,13 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { this->unk_290 = 0; this->unk_282[0] = this->actor.cutscene; if (Flags_GetSwitch(play, ENGB2_GET_7F8(thisx))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (Flags_GetClear(play, 2) && Flags_GetClear(play, 3) && Flags_GetClear(play, 4) && Flags_GetClear(play, 5)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -952,7 +953,7 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index c8e85a3ac..b5aaf2cde 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -308,7 +308,7 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { break; case 7: - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); break; // Twister cutscene diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c index 1766b8e32..de6d5e70e 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -658,7 +658,7 @@ void func_80BB2B1C(EnGeg* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->unk_498)) { gSaveContext.save.weekEventReg[37] |= 8; if (this->actor.child != NULL) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); } this->unk_230 |= 0x10; ActorCutscene_StartAndSetFlag(this->unk_498, &this->actor); @@ -839,7 +839,7 @@ void func_80BB3318(EnGeg* this, PlayState* play) { if (ActorCutscene_GetCurrentIndex() != this->unk_49C[7]) { func_800AEF44(Effect_GetByIndex(this->unk_4DC)); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.2f, 1.0f); Actor_MoveWithGravity(&this->actor); @@ -862,7 +862,7 @@ void EnGeg_Init(Actor* thisx, PlayState* play) { s32 sp34[] = { 0x3E, 0xF64 }; if (gSaveContext.save.weekEventReg[61] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -879,7 +879,7 @@ void EnGeg_Init(Actor* thisx, PlayState* play) { if (this->actor.update != NULL) { this->unk_248 = Object_GetIndex(&play->objectCtx, OBJECT_OF1D_MAP); if (this->unk_248 < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c index e2ebab0d5..a4bfc759a 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -319,7 +319,7 @@ void func_80B35634(EnGg* this, PlayState* play) { break; case 8: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; default: @@ -647,7 +647,7 @@ void EnGg_Init(Actor* thisx, PlayState* play) { EnGg* this = THIS; if (INV_CONTENT(ITEM_MASK_GORON) == ITEM_MASK_GORON) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c index 47eac3051..623e28836 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c @@ -356,12 +356,12 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) { EnGg2* this = THIS; if (INV_CONTENT(ITEM_MASK_GORON) == ITEM_MASK_GORON) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (gSaveContext.save.weekEventReg[91] & 0x10) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -395,7 +395,7 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) { Actor_ChangeAnimationByInfo(&this->skelAnime, D_80B3BF00, 0); this->actionFunc = func_80B3B05C; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (play->sceneId == SCENE_10YUKIYAMANOMURA) { if (!(gSaveContext.save.weekEventReg[20] & 4) && (gSaveContext.save.weekEventReg[20] & 8) && @@ -405,13 +405,13 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) { Actor_ChangeAnimationByInfo(&this->skelAnime, D_80B3BF00, 0); this->actionFunc = func_80B3B05C; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { gSaveContext.save.weekEventReg[20] &= (u8)~4; gSaveContext.save.weekEventReg[20] &= (u8)~8; gSaveContext.save.weekEventReg[20] &= (u8)~0x10; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.c b/src/overlays/actors/ovl_En_Giant/z_en_giant.c index 10951f76d..50aadad37 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.c +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.c @@ -184,7 +184,7 @@ void EnGiant_Init(Actor* thisx, PlayState* play) { if (GIANT_TYPE_IS_CLOCK_TOWER_SUCCESS(type)) { if (!(gSaveContext.save.weekEventReg[25] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -210,7 +210,7 @@ void EnGiant_Init(Actor* thisx, PlayState* play) { this->actor.terminalVelocity = 0.0f; this->actor.gravity = 0.0f; if (EnGiant_IsImprisoned(this)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 74486b30c..477809c4d 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -160,14 +160,14 @@ void EnGirlA_InitObjIndex(EnGirlA* this, PlayState* play) { s16 params = this->actor.params; //! @bug: Condition is impossible, && should be an || - if (params >= SI_MAX && params < SI_POTION_RED_1) { - Actor_MarkForDeath(&this->actor); + if ((params >= SI_MAX) && (params < SI_POTION_RED_1)) { + Actor_Kill(&this->actor); return; } this->objIndex = Object_GetIndex(&play->objectCtx, sShopItemEntries[params].objectId); if (this->objIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c index 601faff4b..61ae3e91a 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -810,7 +810,7 @@ void func_80B51EA4(EnGk* this, PlayState* play) { if (func_80B50C78(this, this->path, this->unk_1EC)) { if (this->unk_1EC >= (this->path->count - 1)) { ActorCutscene_Stop(this->unk_318); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_1EC++; } @@ -1020,7 +1020,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); if (play->sceneId == SCENE_17SETUGEN2) { if (Flags_GetSwitch(play, ENGK_GET_3F00(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_318 = this->actor.cutscene; this->path = SubS_GetPathByIndex(play, ENGK_GET_F0(&this->actor), 0xF); @@ -1036,10 +1036,10 @@ void EnGk_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80B51760; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENGK_GET_F(&this->actor) == ENGK_F_2) { if (!(gSaveContext.save.weekEventReg[22] & 4)) { @@ -1048,7 +1048,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) { this->actor.flags |= ACTOR_FLAG_10; this->actor.flags &= ~ACTOR_FLAG_1; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (!(gSaveContext.save.weekEventReg[22] & 4)) { this->unk_2E4 = 0; diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index c85815ee7..23406fe7a 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -1665,7 +1665,7 @@ void EnGm_Init(Actor* thisx, PlayState* play) { EnGm* this = THIS; if (func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_GM)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 8692fbba1..e1659259f 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -1380,7 +1380,7 @@ void func_80A14430(EnGo* this, PlayState* play) { func_80A14018(this, play); this->actionFunc = func_80A149B0; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1390,7 +1390,7 @@ void func_80A1449C(EnGo* this, PlayState* play) { func_80A14104(this, play); this->actionFunc = func_80A149B0; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1505,7 +1505,7 @@ void func_80A14798(EnGo* this, PlayState* play) { break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } } diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 1f173114d..c6ef6a97c 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -965,12 +965,12 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { func_8093E9B0(this, play); if (sp28 == 0x7F8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (sp2C->count < 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -1418,7 +1418,7 @@ void func_80942604(EnGoroiwa* this, PlayState* play) { if (this->unk_1C8 > 0) { this->unk_1C8--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c index aa2ce4915..364429139 100644 --- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c +++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c @@ -782,8 +782,8 @@ void EnGrasshopper_Fall(EnGrasshopper* this, PlayState* play) { s32 isUnderWater = false; this->actor.shape.rot.y += 0x1388; - if ((this->actor.floorHeight <= -32000.0f) || (this->actor.floorHeight >= 32000.0f)) { - Actor_MarkForDeath(&this->actor); + if ((this->actor.floorHeight <= BGCHECK_Y_MIN) || (this->actor.floorHeight >= BGCHECK_Y_MAX)) { + Actor_Kill(&this->actor); return; } @@ -840,7 +840,7 @@ void EnGrasshopper_Fall(EnGrasshopper* this, PlayState* play) { SoundSource_PlaySfxEachFrameAtFixedWorldPos(play, &this->actor.world.pos, 10, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x60); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 3927305ad..fb9ed510c 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -871,7 +871,7 @@ s32 func_809995A4(EnGs* this, PlayState* play) { if (this->actor.playerHeightRel < -12000.0f) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.world.rot.y, 0, 0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); sp7C = 0; } } @@ -881,7 +881,7 @@ s32 func_809995A4(EnGs* this, PlayState* play) { void func_80999A8C(EnGs* this, PlayState* play) { if (this->unk_1D4-- <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c index a57effdcc..238634780 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c @@ -88,12 +88,12 @@ void EnGuruguru_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; this->actionFunc = EnGuruguru_DoNothing; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->actor.params == 1) { func_80BC6E10(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -321,11 +321,11 @@ void EnGuruguru_Update(Actor* thisx, PlayState* play) { if (!gSaveContext.save.isNight) { if (this->actor.params == 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (this->actor.params == 0 || this->actor.params == 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c index 6b354dd94..200f7cba8 100644 --- a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c +++ b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c @@ -305,7 +305,7 @@ void func_80B236C8(EnHanabi* this, PlayState* play) { void func_80B23894(EnHanabi* this, PlayState* play) { func_80B236C8(this, play); if (func_80B22F34(this->unk_148) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c index b69429d1a..2831e5317 100644 --- a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c +++ b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c @@ -74,7 +74,7 @@ void EnHeishi_Init(Actor* thisx, PlayState* play) { this->shouldSetHeadRotation = 1; if (!(gSaveContext.save.weekEventReg[63] & 0x80) && !((gSaveContext.save.day == 3) && gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->colliderCylinder.dim.radius = 30; @@ -82,7 +82,7 @@ void EnHeishi_Init(Actor* thisx, PlayState* play) { this->colliderCylinder.dim.yShift = 0; if ((gSaveContext.save.weekEventReg[63] & 0x80) || ((gSaveContext.save.day == 3) && gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -152,22 +152,23 @@ void EnHeishi_Update(Actor* thisx, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; if ((this->paramsCopy != 0) && (gSaveContext.save.day == 3) && gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); - } else { - this->actionFunc(this, play); - Actor_MoveWithGravity(&this->actor); - Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, 29); - Actor_SetScale(&this->actor, 0.01f); - if (this->shouldSetHeadRotation) { - EnHeishi_SetHeadRotation(this); - } - - Actor_SetFocus(&this->actor, 60.0f); - Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 3000, 0); - Math_SmoothStepToS(&this->headRotY, this->headRotYTarget, 1, 1000, 0); - Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base); + Actor_Kill(&this->actor); + return; } + + this->actionFunc(this, play); + Actor_MoveWithGravity(&this->actor); + Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, 29); + Actor_SetScale(&this->actor, 0.01f); + if (this->shouldSetHeadRotation) { + EnHeishi_SetHeadRotation(this); + } + + Actor_SetFocus(&this->actor, 60.0f); + Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 3000, 0); + Math_SmoothStepToS(&this->headRotY, this->headRotYTarget, 1, 1000, 0); + Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base); } s32 EnHeishi_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c index 07b256487..3e089d185 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -126,7 +126,7 @@ void EnHg_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); if ((gSaveContext.save.weekEventReg[75] & 0x20) || (gSaveContext.save.weekEventReg[52] & 0x20)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.targetMode = 1; this->actor.colChkInfo.health = 0; @@ -304,7 +304,7 @@ void func_80BCF95C(EnHg* this, PlayState* play) { break; case 6: gSaveContext.save.weekEventReg[75] |= 0x20; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } } else { diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c index 81cb9850c..04434510b 100644 --- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c +++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c @@ -95,12 +95,12 @@ void EnHiddenNuts_Init(Actor* thisx, PlayState* play) { } if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->unk_21E == 0x1F) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -313,7 +313,7 @@ void func_80BDBA28(EnHiddenNuts* this, PlayState* play) { this->unk_208 = 1; if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_208, &this->unk_20C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.speedXZ = 2.0f; @@ -377,7 +377,7 @@ void func_80BDBB48(EnHiddenNuts* this, PlayState* play) { if (this->unk_208 >= this->path->count) { func_80BDBE70(this, play); } else if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_208, &this->unk_20C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -402,7 +402,7 @@ void func_80BDBED4(EnHiddenNuts* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); EffectSsHahen_SpawnBurst(play, &sp38, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c index 46a52a9fa..6d02b6c33 100644 --- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c +++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c @@ -330,7 +330,7 @@ void func_80C204F0(EnHintSkb* this, PlayState* play) { } Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x10); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80C20540(EnHintSkb* this) { diff --git a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c index 17dfeb34e..cf9421c57 100644 --- a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c +++ b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c @@ -57,7 +57,7 @@ void EnHitTag_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); Collider_UpdateCylinder(&this->actor, &this->collider); if (Flags_GetSwitch(play, ENHITTAG_GET_SWITCHFLAG(thisx))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -73,7 +73,7 @@ void EnHitTag_WaitForHit(EnHitTag* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { play_sound(NA_SE_SY_GET_RUPY); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); dropLocation.x = this->actor.world.pos.x; dropLocation.y = this->actor.world.pos.y; dropLocation.z = this->actor.world.pos.z; diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index 0e58e2b85..8f634369b 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -155,7 +155,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) { u32 zActorBitmask = D_801AED48[EN_HOLL_GET_Z_ACTOR_BITMASK_INDEX(&this->actor)]; if (!(actorCtxBitmask & zActorBitmask)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this == sInstancePlayingSound) { diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index d822ba674..018ed4971 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -721,7 +721,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { this->unk_528 = 80.0f; this->boostSpeed = 12; if ((this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HA)) < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk_1EC |= 1; @@ -743,7 +743,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { this->type = HORSE_TYPE_BANDIT; this->boostSpeed = 12; if ((this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HA)) < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk_1EC |= 1; @@ -751,7 +751,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { } else { this->type = HORSE_TYPE_EPONA; this->boostSpeed = 15; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.params &= ~(ENHORSE_PARAM_DONKEY | ENHORSE_PARAM_4000 | ENHORSE_PARAM_BANDIT); @@ -879,7 +879,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { } else if (thisx->params == ENHORSE_14) { func_808846F0(this, play); if ((play->sceneId == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (thisx->params == ENHORSE_16) { func_8087C9F8(this); @@ -3271,7 +3271,7 @@ void func_80884604(EnHorse* this, PlayState* play, CsCmdActorAction* action) { } void func_808846B4(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_808846DC(EnHorse* this, PlayState* play, CsCmdActorAction* action) { diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 99d4eca14..3cfa65ddb 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -60,7 +60,7 @@ s32 func_808F8AA0(EnHorseGameCheck* this, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); if (GET_RACE_FLAGS != RACE_FLAG_START) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return false; } @@ -117,7 +117,7 @@ s32 func_808F8CCC(EnHorseGameCheck* this, PlayState* play2) { this->unk_174 = 0; if (GET_RACE_FLAGS != RACE_FLAG_START) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return false; } diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 92f73dac5..9fc9e088d 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -694,7 +694,7 @@ void EnIk_Die(EnIk* this, PlayState* play) { if (this->timer == 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); ActorCutscene_Stop(this->actor.cutscene); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } else if (Animation_OnFrame(&this->skelAnime, 23.0f)) { diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index e5f56d857..5d5cf5439 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -1421,7 +1421,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 0xF); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_0); this->actionFunc = func_808F5A94; @@ -1429,14 +1429,14 @@ void EnIn_Init(Actor* thisx, PlayState* play) { } } else { if (gSaveContext.save.weekEventReg[52] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_7); this->actionFunc = func_808F5B58; } } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } else { diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index e985f6b5c..78aa53464 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -310,7 +310,7 @@ void func_8091B2D8(EnInsect* this, PlayState* play) { this->actor.draw = EnInsect_Draw; } else if (this->unk_312 == 0) { if (this->unk_30C & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -355,7 +355,7 @@ void func_8091B440(EnInsect* this, PlayState* play) { } if (this->unk_312 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -436,7 +436,7 @@ void func_8091B984(EnInsect* this, PlayState* play) { } if (this->unk_312 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c index a0dbf7ca2..f40475f27 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -1688,7 +1688,7 @@ void EnInvadepoh_InitAlien(EnInvadepoh* this, PlayState* play) { } this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_UCH); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1698,7 +1698,7 @@ void EnInvadepoh_InitParentCow(EnInvadepoh* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_INVADEPOH, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0x30); this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_COW); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1707,7 +1707,7 @@ void EnInvadepoh_InitChildCow(EnInvadepoh* this, PlayState* play) { this->actor.update = func_80B481C4; this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_COW); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1743,27 +1743,27 @@ void EnInvadepoh_InitRomani(EnInvadepoh* this, PlayState* play) { this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_MA1); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (temp == 5) { if (gSaveContext.save.weekEventReg[22] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (temp == 7) { if (gSaveContext.save.time < CLOCK_TIME(6, 0) && gSaveContext.save.time >= CLOCK_TIME(2, 15)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (temp != 8) { if (temp == 9) { if (gSaveContext.save.entrance != ENTRANCE(ROMANI_RANCH, 6)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (temp == 0xC) { if (!(gSaveContext.save.weekEventReg[22] & 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } D_80B503F4 = this; } @@ -1784,7 +1784,7 @@ void func_80B468B4(EnInvadepoh* this, PlayState* play) { this->actor.world.pos.y += 1500.0f; func_80B49628(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1799,7 +1799,7 @@ void EnInvadepoh_InitDog(EnInvadepoh* this, PlayState* play) { ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f); this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_DOG); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1815,10 +1815,10 @@ void EnInvadepoh_InitCremia(EnInvadepoh* this, PlayState* play) { ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 18.0f); this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_MA2); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (!(gSaveContext.save.weekEventReg[22] & 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } D_80B503F8 = this; } @@ -2297,7 +2297,7 @@ void func_80B47BAC(Actor* thisx, PlayState* play) { func_80B47568(this); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -2313,7 +2313,7 @@ void func_80B47D30(Actor* thisx, PlayState* play) { thisx->gravity = 0.0f; func_80B47830(this); } else if ((this->actionFunc == func_80B474DC) || (this->actionFunc == func_80B473E4)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (this->collider.base.acFlags & AC_HIT) { @@ -2376,7 +2376,7 @@ void func_80B48060(Actor* thisx, PlayState* play) { MtxF unkMtx; if (D_80B503F0 == NULL || this->actor.parent == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -2416,7 +2416,7 @@ void func_80B4827C(Actor* thisx, PlayState* play) { EnInvadepoh* this = THIS; if (D_80B503F0 == NULL || this->actor.parent == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -2534,7 +2534,7 @@ void func_80B4873C(Actor* thisx, PlayState* play) { AlienBehaviorInfo* substruct = &this->behaviorInfo; if (this->actor.parent == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); @@ -2940,7 +2940,7 @@ void func_80B4994C(EnInvadepoh* this, PlayState* play) { if (this->actionTimer > 0) { this->actionTimer--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -3030,7 +3030,7 @@ void func_80B49C38(EnInvadepoh* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->clockTime >= 0.9999f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -3103,7 +3103,7 @@ void func_80B49F88(Actor* thisx, PlayState* play) { this->actor.draw = func_80B4E324; func_80B49BD0(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -3654,7 +3654,7 @@ void func_80B4B8BC(Actor* thisx, PlayState* play) { } else if (D_80B4E940 == 1) { this->actor.update = func_80B4BA30; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (!this) {} } } @@ -3788,7 +3788,7 @@ void func_80B4BC4C(EnInvadepoh* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } if (gSaveContext.save.time > CLOCK_TIME(20, 15)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if ((temp_t6 != NULL) && (temp_t6->actionFunc == func_80B4CB0C)) { func_80B4C1BC(this); } @@ -3892,7 +3892,7 @@ void func_80B4C3A0(Actor* thisx, PlayState* play) { this->actor.draw = func_80B4E7BC; func_80B4BBE0(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -4003,7 +4003,7 @@ void func_80B4C730(EnInvadepoh* this, PlayState* play) { } if (this->clockTime >= 0.9999f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -4101,7 +4101,7 @@ void func_80B4CE54(Actor* thisx, PlayState* play) { this->actor.draw = func_80B4E324; func_80B4C6C8(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -4168,7 +4168,7 @@ void func_80B4D290(EnInvadepoh* this, PlayState* play) { f32 sp28; if (D_80B503F0 == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -4190,7 +4190,7 @@ void func_80B4D290(EnInvadepoh* this, PlayState* play) { } if (sp28 < 5.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -4257,7 +4257,7 @@ void func_80B4D480(EnInvadepoh* this, PlayState* play) { } if ((this->actionTimer <= 0) || sp2C) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c index d7bda5180..581d4d9b1 100644 --- a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c +++ b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c @@ -86,7 +86,7 @@ void func_80C2590C(EnInvisibleRuppe* this, PlayState* play) { } void func_80C259E8(EnInvisibleRuppe* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnInvisibleRuppe_Init(Actor* thisx, PlayState* play) { @@ -100,7 +100,7 @@ void EnInvisibleRuppe_Init(Actor* thisx, PlayState* play) { } if ((this->unk_190 >= 0) && Flags_GetSwitch(play, this->unk_190)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 5ebc15a02..3bc8a860a 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -398,7 +398,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { func_8095D6E0(&this->actor, play); if ((sp34 == 1) && Flags_GetSwitch(play, ENISHI_GET_FE00(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -415,7 +415,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { this->actor.shape.yOffset = D_8095F6C0[sp34]; if ((sp30 == 0) && !func_8095D758(this, play, 0)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -425,7 +425,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { this->unk_196 = Object_GetIndex(&play->objectCtx, D_8095F6E8[ENISHI_GET_8(&this->actor)]); if (this->unk_196 < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -490,7 +490,7 @@ void func_8095E660(EnIshi* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, D_8095F6D4[sp38], D_8095F6D0[sp38]); D_8095F6D8[sp38](&this->actor, play); D_8095F6E0[sp38](this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -604,7 +604,7 @@ void func_8095EBDC(EnIshi* this, PlayState* play) { Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -682,9 +682,9 @@ void func_8095F180(EnIshi* this) { void func_8095F194(EnIshi* this, PlayState* play) { if (this->actor.cutscene < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c index ced184e68..fcb5f465b 100644 --- a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c +++ b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c @@ -111,7 +111,7 @@ void EnJcMato_SetupIdle(EnJcMato* this) { void EnJcMato_Idle(EnJcMato* this, PlayState* play) { if (this->hitFlag) { if (DECR(this->despawnTimer) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.c b/src/overlays/actors/ovl_En_Jg/z_en_jg.c index 60ebb2474..3b3ce1684 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -632,7 +632,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) { case 1: this->cutsceneAnimIndex = EN_JG_ANIM_CUTSCENE_IDLE; if (this->drum != NULL) { - Actor_MarkForDeath(this->drum); + Actor_Kill(this->drum); this->drum = NULL; } break; diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c index f88e7c074..d44ed193c 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c @@ -112,7 +112,7 @@ void func_80C13A2C(EnJgameTsn* this, PlayState* play) { s32 i; if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } for (i = 0; i < ARRAY_COUNT(this->unk_1D8); i++) { @@ -121,7 +121,7 @@ void func_80C13A2C(EnJgameTsn* this, PlayState* play) { path = &play->setupPathList[path->unk1]; if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -130,7 +130,7 @@ void func_80C13A2C(EnJgameTsn* this, PlayState* play) { path = &play->setupPathList[path->unk1]; if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk_200.points = Lib_SegmentedToVirtual(path->points); diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index 457f62d77..a8a6b5e0b 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -126,7 +126,7 @@ void EnJs_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80969B5C; func_80968A5C(this); if (func_809692A8(ENJS_GET_TYPE(&this->actor) + 4)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; diff --git a/src/overlays/actors/ovl_En_Kame/z_en_kame.c b/src/overlays/actors/ovl_En_Kame/z_en_kame.c index c1ea3ae46..4f1f9ea2e 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c @@ -600,7 +600,7 @@ void func_80AD8388(EnKame* this, PlayState* play) { this->actor.scale.x -= 0.001f; if (this->actor.scale.x <= 0.0f) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.scale.y = this->actor.scale.x; this->actor.scale.z = this->actor.scale.x; diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 5113c1291..b87b3243e 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -277,7 +277,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { piece->partFlags = sCutFlags[this->cutType] & this->partFlags; if (piece->partFlags == 0) { - Actor_MarkForDeath(&piece->actor); + Actor_Kill(&piece->actor); return; } @@ -673,7 +673,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { signpost = (EnKanban*)this->actor.parent; if (signpost->partFlags == 0xFFFF) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } phi_f0 = 0.0f; @@ -852,7 +852,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { signpost->invincibilityTimer = 5; if (signpost->partFlags == 0xFFFF) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Matrix_RotateYS(signpost->actor.shape.rot.y, MTXMODE_NEW); @@ -876,7 +876,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { (this->floorRot.z == 0.0f)) { signpost->partFlags |= this->partFlags; signpost->actor.flags |= ACTOR_FLAG_1; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index d90bdf93d..08ec15b14 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -117,12 +117,12 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z - 10.0f, this->actor.home.rot.x, this->actor.home.rot.y, this->actor.home.rot.z, 0x10); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); } } else if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 2ab13422a..fdeab7aeb 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -385,7 +385,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; } if (!EnKusa_SnapToFloor(this, play, 0.0f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (EnKusa_GetWaterBox(this, play)) { @@ -394,7 +394,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { this->objIndex = Object_GetIndex(&play->objectCtx, objectIds[(KUSA_GET_TYPE(&this->actor))]); if (this->objIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -470,12 +470,12 @@ void EnKusa_WaitForInteract(EnKusa* this, PlayState* play) { } } if (KUSA_GET_TYPE(&this->actor) == ENKUSA_TYPE_BUSH) { - Actor_MarkForDeath(&this->actor); - } else { - EnKusa_SetupCut(this); - this->isCut = true; + Actor_Kill(&this->actor); + return; } + EnKusa_SetupCut(this); + this->isCut = true; } else { if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToPlayer > 12.0f)) { this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER; @@ -560,7 +560,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { switch (KUSA_GET_TYPE(&this->actor)) { case ENKUSA_TYPE_BUSH: case ENKUSA_TYPE_GRASS: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case ENKUSA_TYPE_REGROWING_GRASS: diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c index fdf3cc9ac..064677b3b 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -136,7 +136,7 @@ void func_80A5B334(EnKusa2* this, PlayState* play) { if (*ptr != NULL) { if (!Actor_HasParent(&(*ptr)->actor, play)) { - Actor_MarkForDeath(&(*ptr)->actor); + Actor_Kill(&(*ptr)->actor); } *ptr = NULL; } @@ -379,7 +379,7 @@ s32 func_80A5BFD8(EnKusa2* this, PlayState* play) { func_80A5BD14(this, play, (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1000000) ? 1 : 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); func_80A5BD94(this); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -878,18 +878,19 @@ void EnKusa2_Init(Actor* thisx, PlayState* play) { } else { Collider_InitCylinder(play, &this->collider); if (!func_80A5BA58(this, play)) { - Actor_MarkForDeath(&this->actor); - } else { - Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - Collider_UpdateCylinder(&this->actor, &this->collider); - this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->unk_1CE = D_80A5EAF0 & 7; - D_80A5EAF0++; - this->actor.shape.shadowAlpha = 0; - this->unk_1CF = 255; - this->actor.shape.shadowScale = 1.0f; - func_80A5D7A4(this); + Actor_Kill(&this->actor); + return; } + + Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); + Collider_UpdateCylinder(&this->actor, &this->collider); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + this->unk_1CE = D_80A5EAF0 & 7; + D_80A5EAF0++; + this->actor.shape.shadowAlpha = 0; + this->unk_1CF = 255; + this->actor.shape.shadowScale = 1.0f; + func_80A5D7A4(this); } } @@ -1096,7 +1097,7 @@ void func_80A5DC98(EnKusa2* this, PlayState* play) { } else if (this->unk_1CA > 0) { this->unk_1CA--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -1241,7 +1242,7 @@ void func_80A5E210(EnKusa2* this, PlayState* play) { if (this->unk_1B8 != NULL) { this->unk_1B8->unk_28 = func_80A5C718; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1273,7 +1274,7 @@ void func_80A5E4BC(EnKusa2* this, PlayState* play) { this->unk_1CF -= 15; if (this->unk_1CF <= 15) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c index 6fd949feb..cac761db7 100644 --- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c +++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c @@ -120,11 +120,11 @@ void EnLookNuts_Init(Actor* thisx, PlayState* play) { this->switchFlag = -1; } if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->pathLocation == 0x1F) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c index e42e70ca3..a7c54a7db 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c @@ -68,9 +68,10 @@ void EnMFire1_Update(Actor* thisx, PlayState* play) { s32 pad; if (Math_StepToF(&this->timer, 1.0f, 0.2f)) { - Actor_MarkForDeath(&this->actor); - } else { - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); + Actor_Kill(&this->actor); + return; } + + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 1fa4589b5..585f56088 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -136,7 +136,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); AudioSfx_PlaySfx(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -216,9 +216,12 @@ void EnMThunder_Spin_AttackNoMagic(EnMThunder* this, PlayState* play) { AudioSfx_PlaySfx(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - Actor_MarkForDeath(&this->actor); - } else if (!(player->stateFlags1 & PLAYER_STATE1_1000)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); + return; + } + + if (!(player->stateFlags1 & PLAYER_STATE1_1000)) { + Actor_Kill(&this->actor); } } @@ -260,7 +263,7 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) { AudioSfx_PlaySfx(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -313,7 +316,7 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) { if (this->actor.child != NULL) { this->actor.child->parent = NULL; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -341,7 +344,7 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) { } if (Play_InCsMode(play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -367,7 +370,7 @@ void EnMThunder_Spin_Attack(EnMThunder* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Math_StepToF(&this->lightColorFrac, 0.0f, 0.0625f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Math_SmoothStepToF(&this->actor.scale.x, (s32)this->scaleTarget, 0.6f, 0.8f, 0.0f); Actor_SetScale(&this->actor, this->actor.scale.x); @@ -391,7 +394,7 @@ void EnMThunder_Spin_Attack(EnMThunder* this, PlayState* play) { func_808B5EEC(this, play); if (Play_InCsMode(play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -406,7 +409,7 @@ void EnMThunder_SwordBeam_Attack(EnMThunder* this, PlayState* play) { } if (Math_StepToF(&this->lightColorFrac, 0.0f, 0.05f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { sp2C = -80.0f * Math_CosS(this->actor.world.rot.x); @@ -441,7 +444,7 @@ void EnMThunder_SwordBeam_Attack(EnMThunder* this, PlayState* play) { void EnMThunder_UnkType_Attack(EnMThunder* this, PlayState* play) { if (Math_StepToF(&this->lightColorFrac, 0.0f, 0.0625f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Math_SmoothStepToF(&this->actor.scale.x, (s32)this->scaleTarget, 0.6f, 0.8f, 0.0f); Actor_SetScale(&this->actor, this->actor.scale.x); diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index 49d7a06fb..3c4e52df8 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -163,7 +163,7 @@ void EnMaYto_Init(Actor* thisx, PlayState* play) { this->blinkTimer = 100; this->type = EN_MA_YTO_GET_TYPE(&this->actor); if (!EnMaYto_CheckValidSpawn(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c index 5fcf1c7f0..be771eafe 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c @@ -220,7 +220,7 @@ void EnMaYts_Init(Actor* thisx, PlayState* play) { this->type = EN_MA_YTS_GET_TYPE(thisx); if (!EnMaYts_CheckValidSpawn(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c index 4c7a1ddf8..9bd19d193 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c @@ -317,7 +317,7 @@ void func_80B37428(EnMaruta* this, PlayState* play) { kendoJs->unk_28C--; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -332,7 +332,7 @@ void func_80B374B8(EnMaruta* this) { void func_80B374FC(EnMaruta* this, PlayState* play) { if (this->unk_21E == 40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -476,7 +476,7 @@ void func_80B37A8C(EnMaruta* this) { void func_80B37AA0(EnMaruta* this, PlayState* play) { if (this->actor.scale.y == 0.0f) { if (this->actor.scale.x == 0.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Math_SmoothStepToF(&this->actor.scale.x, 0.0f, 0.2f, 0.01f, 0.001f); diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c index 399a8f659..c162fc465 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -116,13 +116,14 @@ void EnMinifrog_Init(Actor* thisx, PlayState* play) { if ((this->frogIndex == MINIFROG_YELLOW) || ((gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] & (u8)isFrogReturnedFlags[this->frogIndex]))) { - Actor_MarkForDeath(&this->actor); - } else { - this->timer = 30; - this->actionFunc = EnMinifrog_SpawnGrowAndShrink; - this->actor.textId = 0xD81; // "Ah! Don Gero! It has been so long." - this->actor.colChkInfo.mass = 30; + Actor_Kill(&this->actor); + return; } + + this->timer = 30; + this->actionFunc = EnMinifrog_SpawnGrowAndShrink; + this->actor.textId = 0xD81; // "Ah! Don Gero! It has been so long." + this->actor.colChkInfo.mass = 30; } else { // Frogs in mountain village if (this->frogIndex == MINIFROG_YELLOW) { this->actor.textId = 0; @@ -293,7 +294,7 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c index cdf3ad957..68bb60782 100644 --- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c +++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c @@ -621,7 +621,7 @@ void EnMinislime_SetupDespawn(EnMinislime* this) { } void EnMinislime_Despawn(EnMinislime* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnMinislime_SetupMoveToGekko(EnMinislime* this) { diff --git a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c index c8cc1abb1..c209b7684 100644 --- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c +++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c @@ -487,7 +487,7 @@ void func_80A4EF74(EnMkk* this, PlayState* play) { this->actor.velocity.y = 0.0f; func_80A4EDF0(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->alpha = newAlpha; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 8e2c5260b..54b58686e 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -76,7 +76,7 @@ void EnMm_Init(Actor* thisx, PlayState* play) { if ((this->actor.params >= 0) && ((!(gSaveContext.save.weekEventReg[37] & 0x10)) || (gSaveContext.save.weekEventReg[37] & 8) || (gSaveContext.unk_1014 != 0))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Actor_ProcessInitChain(&this->actor, sInitChain); diff --git a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c index ed67013d8..e13d26051 100644 --- a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c +++ b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c @@ -404,7 +404,7 @@ void EnMttag_RaceFinish(EnMttag* this, PlayState* play) { EnMttag_ExitRace(play, TRANS_TYPE_02, TRANS_TYPE_02); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -443,7 +443,7 @@ void EnMttag_PotentiallyRestartRace(EnMttag* this, PlayState* play) { } else { EnMttag_ExitRace(play, TRANS_TYPE_02, TRANS_TYPE_02); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -460,16 +460,17 @@ void EnMttag_HandleCantWinChoice(EnMttag* this, PlayState* play) { EnMttag_ExitRace(play, TRANS_TYPE_02, TRANS_TYPE_02); gSaveContext.eventInf[1] &= (u8)~8; gSaveContext.eventInf[1] |= 4; - Actor_MarkForDeath(&this->actor); - } else { - // Keep racing - func_8019F208(); - func_801477B4(play); - func_800B7298(play, &this->actor, 6); - gSaveContext.eventInf[1] &= (u8)~8; - this->timer = 100; - this->actionFunc = EnMttag_Race; + Actor_Kill(&this->actor); + return; } + + // Keep racing + func_8019F208(); + func_801477B4(play); + func_800B7298(play, &this->actor, 6); + gSaveContext.eventInf[1] &= (u8)~8; + this->timer = 100; + this->actionFunc = EnMttag_Race; } } @@ -496,7 +497,7 @@ void EnMttag_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnMttag_RaceStart; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c index 4e6c471af..02fe166e2 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -816,8 +816,11 @@ void func_80A6A36C(EnMushi2* this, PlayState* play) { } if (sp20 && (this->unk_36A <= 0)) { - Actor_MarkForDeath(&this->actor); - } else if (this->actor.bgCheckFlags & 0x20) { + Actor_Kill(&this->actor); + return; + } + + if (this->actor.bgCheckFlags & 0x20) { func_80A6AAA4(this); } else if (this->actor.bgCheckFlags & 1) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_WALK); @@ -1038,7 +1041,7 @@ void func_80A6AE7C(EnMushi2* this, PlayState* play) { } if (this->unk_368 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1105,7 +1108,7 @@ void func_80A6B0D8(EnMushi2* this, PlayState* play) { func_80A6A094(this); func_80A6A0D8(this); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1123,7 +1126,7 @@ void EnMushi2_Update(Actor* thisx, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { func_80A6A094(this); func_80A6A0D8(this); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Muto/z_en_muto.c b/src/overlays/actors/ovl_En_Muto/z_en_muto.c index 8a657ad2a..631913a2f 100644 --- a/src/overlays/actors/ovl_En_Muto/z_en_muto.c +++ b/src/overlays/actors/ovl_En_Muto/z_en_muto.c @@ -75,7 +75,7 @@ void EnMuto_Init(Actor* thisx, PlayState* play) { } if (gSaveContext.save.day != 3 || !gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->collider.dim.radius = 30; @@ -83,7 +83,7 @@ void EnMuto_Init(Actor* thisx, PlayState* play) { this->collider.dim.yShift = 0; if (gSaveContext.save.weekEventReg[63] & 0x80 || (gSaveContext.save.day == 3 && gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -255,7 +255,7 @@ void EnMuto_Update(Actor* thisx, PlayState* play2) { } if (this->isInMayorsRoom && gSaveContext.save.day == 3 && gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c index bf91c7516..c9d71ca54 100644 --- a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c +++ b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c @@ -466,7 +466,7 @@ void EnNeoReeba_PlayDeathEffects(EnNeoReeba* this, PlayState* play) { if (this->actor.scale.x < 0.01f) { func_800B3030(play, &this->actor.world.pos, &sDeadDbAccel, &sDeadDbVel, 120, 0, 0); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { if (this->actionTimer <= 10) { diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index c93e531be..a890cb0e5 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -125,11 +125,11 @@ void EnNutsball_Update(Actor* thisx, PlayState* play2) { } else { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { if (this->timer == -300) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index 3f66f7f70..de2469c5a 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -64,7 +64,7 @@ void EnNwc_Init(Actor* thisx, PlayState* play) { niwObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_NIW); if (niwObjectIndex < 0) { // niw object does not exist, we need it for tranformation, despawn - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -72,7 +72,7 @@ void EnNwc_Init(Actor* thisx, PlayState* play) { // if breman mask was already used, replace with adult EnNiw Actor_Spawn(&play->actorCtx, play, ACTOR_EN_NIW, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.world.rot.y, 0, NIW_TYPE_REGULAR); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index ae3b3f04c..d21ac4a1a 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -42,7 +42,7 @@ void EnOkarinaEffect_Init(Actor* thisx, PlayState* play) { EnOkarinaEffect* this = THIS; if (play->envCtx.unk_F2[1]) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnOkarinaEffect_SetupAction(this, func_8096B104); } @@ -73,7 +73,7 @@ void func_8096B1FC(EnOkarinaEffect* this, PlayState* play) { } } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.c b/src/overlays/actors/ovl_En_Osn/z_en_osn.c index 1f9cb3da8..7a17448da 100644 --- a/src/overlays/actors/ovl_En_Osn/z_en_osn.c +++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.c @@ -205,7 +205,7 @@ void func_80AD0AB0(EnOsn* this) { this->unk_1FA -= 8; if (this->unk_1FA < 8) { this->unk_1FA = 0; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -830,7 +830,8 @@ void EnOsn_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); + break; } } diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 618a30986..167c01a31 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -212,19 +212,19 @@ void EnOssan_CheckValidSpawn(EnOssan* this) { case 2: if (gSaveContext.save.time <= CLOCK_TIME(21, 30) && gSaveContext.save.time > CLOCK_TIME(6, 00)) { if (this->actor.params != ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; case 3: if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (!(gSaveContext.save.time <= CLOCK_TIME(22, 00) && gSaveContext.save.time >= CLOCK_TIME(6, 00))) { if (this->actor.params != ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } break; @@ -266,14 +266,14 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { s16 id; //! @bug Condition is impossible, params cannot be both greater then 1 AND less then 0. - if (this->actor.params > ENOSSAN_PART_TIME_WORKER && this->actor.params < ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + if ((this->actor.params > ENOSSAN_PART_TIME_WORKER) && (this->actor.params < ENOSSAN_CURIOSITY_SHOP_MAN)) { + Actor_Kill(&this->actor); return; } id = sObjectIds[this->actor.params]; this->objIndex = Object_GetIndex(&play->objectCtx, id); if (this->objIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } EnOssan_CheckValidSpawn(this); diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c index bf93b729f..e86d0c62f 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -201,7 +201,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) { func_80B5C684(this, play); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if ((D_80B5E888 != NULL) && (D_80B5E888->unk_32C & 1)) { this->unk_360 = D_80B5E888; @@ -219,7 +219,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) { break; case 1: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } break; @@ -274,7 +274,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) { this->actor.update = func_80B5DAEC; func_80B5C634(this, play); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; } @@ -483,7 +483,7 @@ void func_80B5C634(EnOt* this, PlayState* play) { void func_80B5C64C(EnOt* this, PlayState* play) { if (gSaveContext.save.weekEventReg[26] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 8b636787d..f4baec9e6 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -151,21 +151,21 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { switch (owlType) { case ENOWL_GET_TYPE_1: if ((switchFlag < 0x7F) && Flags_GetSwitch(play, switchFlag)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENOWL_GET_TYPE_2: if (gSaveContext.save.inventory.items[ITEM_LENS] == ITEM_LENS) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENOWL_GET_TYPE_3: if (CHECK_QUEST_ITEM(QUEST_SONG_SOARING)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -429,7 +429,7 @@ void func_8095B1E4(EnOwl* this, PlayState* play) { } if (this->actor.xzDistToPlayer > 6000.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -740,7 +740,7 @@ void func_8095BF58(EnOwl* this, PlayState* play) { void func_8095BF78(EnOwl* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_20; if (this->actor.xzDistToPlayer > 6000.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_3EC, 2, 0x80, 0x40); @@ -1067,12 +1067,12 @@ void func_8095CCF4(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); if (player->stateFlags3 & 0x10000000) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->actor.world.pos.y < (this->unk_3F0 - 1000.0f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -1083,7 +1083,7 @@ void func_8095CCF4(Actor* thisx, PlayState* play) { if (this->unk_3DC > 0) { this->unk_3DC--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c index 075ced540..1a60e9d08 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c @@ -156,7 +156,7 @@ void EnPamera_Init(Actor* thisx, PlayState* play) { if (1) {} if (!(gSaveContext.save.weekEventReg[14] & 4) || (gSaveContext.save.weekEventReg[52] & 0x20) || (gSaveContext.save.weekEventReg[75] & 0x20) || (gSaveContext.save.entrance == ENTRANCE(IKANA_CANYON, 9))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (gSaveContext.save.weekEventReg[61] & 4) { if (!(gSaveContext.save.weekEventReg[59] & 1) || @@ -199,7 +199,7 @@ void func_80BD8588(EnPamera* this, PlayState* play) { Vec3f sp28; if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (gSaveContext.save.weekEventReg[61] & 4) { path = &play->setupPathList[path->unk1]; diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c index 0582b7ca8..805baed5a 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -192,7 +192,7 @@ void EnPametfrog_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colElement); this->params = CLAMP(this->actor.params, 1, 4); if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (!(gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] & (u8)isFrogReturnedFlags[this->actor.params - 1])) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_MINIFROG, this->actor.world.pos.x, this->actor.world.pos.y, @@ -205,11 +205,12 @@ void EnPametfrog_Init(Actor* thisx, PlayState* play) { if (Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_BIGPAMET, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0) == NULL) { - Actor_MarkForDeath(&this->actor); - } else { - this->actor.params = GEKKO_PRE_SNAPPER; - EnPametfrog_SetupLookAround(this); + Actor_Kill(&this->actor); + return; } + + this->actor.params = GEKKO_PRE_SNAPPER; + EnPametfrog_SetupLookAround(this); } } @@ -986,7 +987,7 @@ void EnPametfrog_SpawnFrog(EnPametfrog* this, PlayState* play) { EnPametfrog_ShakeCamera(this, play, 75.0f * magShake, 10.0f * magShake); if (this->timer == 0) { EnPametfrog_StopCutscene(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Paper/z_en_paper.c b/src/overlays/actors/ovl_En_Paper/z_en_paper.c index fd6ac6778..09ec4ea10 100644 --- a/src/overlays/actors/ovl_En_Paper/z_en_paper.c +++ b/src/overlays/actors/ovl_En_Paper/z_en_paper.c @@ -154,10 +154,11 @@ void EnPaper_Update(Actor* thisx, PlayState* play) { func_80C1F87C(this); if (this->timer == 0) { - Actor_MarkForDeath(&this->actor); - } else { - this->timer--; + Actor_Kill(&this->actor); + return; } + + this->timer--; } void EnPaper_Draw(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c index ef348f4cc..f995e7c68 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -79,7 +79,7 @@ void func_808654C4(EnPart* this, PlayState* play) { pos.y = this->actor.floorHeight; func_800B3030(play, &pos, &gZeroVec3f, &gZeroVec3f, this->actor.scale.y * 1400.0f, 7, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 10, NA_SE_EN_EXTINCT); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->unk146 <= 0) { switch (this->actor.params) { @@ -101,7 +101,7 @@ void func_808654C4(EnPart* this, PlayState* play) { } break; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk146--; this->zRot += this->unk14C; diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index cf3cd935f..0e197a833 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -438,7 +438,7 @@ void func_80897A94(EnPeehat* this, PlayState* play) { if (!(this->actor.bgCheckFlags & 1)) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_PIHAT_SM_DEAD); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (this->colliderTris.base.atFlags & AT_HIT) { this->colliderTris.base.atFlags &= ~AT_HIT; if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.world.rot.y) > 0) { @@ -588,7 +588,7 @@ void func_80898338(EnPeehat* this, PlayState* play) { func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 40, 7, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EN_EXTINCT); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_PIHAT_SM_DEAD); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { func_80897864(this); } @@ -672,7 +672,7 @@ void func_808986A4(EnPeehat* this, PlayState* play) { if (this->unk_2B0 == 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xE0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index 1f5aebe64..7c17627a0 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -1481,7 +1481,7 @@ s32 func_80AF98A0(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { if (Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_MM3, 116.0f, 26.0f, -219.0f, 0, -0x3F46, 0, 0) != NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); ret = true; } return ret; diff --git a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c index a2c537606..ebd745b1e 100644 --- a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c +++ b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c @@ -111,7 +111,7 @@ void EnPoFusen_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 0x4); if (!EnPoFusen_CheckParent(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } heightTemp = this->actor.floorHeight + 90.0f; @@ -238,7 +238,7 @@ void EnPoFusen_Pop(EnPoFusen* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y + 20.0f, this->actor.world.pos.z, 255, 255, 200, CLEAR_TAG_POP); Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnPoFusen_InitFuse(EnPoFusen* this) { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 57e32a554..307e160f9 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -714,10 +714,11 @@ void EnPoSisters_DeathStage2(EnPoSisters* this, PlayState* play) { this->deathTimer++; if (this->deathTimer == 32) { - Actor_MarkForDeath(&this->actor); - } else { - EnPoSisters_UpdateDeathFlameSwirl(this, this->deathTimer, &this->actor.world.pos); + Actor_Kill(&this->actor); + return; } + + EnPoSisters_UpdateDeathFlameSwirl(this, this->deathTimer, &this->actor.world.pos); } void EnPoSisters_SpawnMegClones(EnPoSisters* this, PlayState* play) { @@ -734,15 +735,15 @@ void EnPoSisters_SpawnMegClones(EnPoSisters* this, PlayState* play) { // if we cannot spawn all clones: abort if ((clone1 == NULL) || (clone2 == NULL) || (clone3 == NULL)) { if (clone1 != NULL) { - Actor_MarkForDeath(clone1); + Actor_Kill(clone1); } if (clone2 != NULL) { - Actor_MarkForDeath(clone2); + Actor_Kill(clone2); } if (clone3 != NULL) { - Actor_MarkForDeath(clone3); + Actor_Kill(clone3); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -793,7 +794,7 @@ void EnPoSisters_MegCloneWaitForSpinBack(EnPoSisters* this, PlayState* play) { EnPoSisters_SetupSpinBackToVisible(this, play); } else if (parent->actionFunc == EnPoSisters_DeathStage1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index a3718497c..0d6c1542d 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -653,7 +653,7 @@ void func_80B2E1D8(EnPoh* this) { void func_80B2E230(EnPoh* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -687,7 +687,7 @@ void func_80B2E3B0(EnPoh* this) { void func_80B2E3F8(EnPoh* this, PlayState* play) { func_80B2DDF8(this, -13); if (this->unk_197 == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Pp/z_en_pp.c b/src/overlays/actors/ovl_En_Pp/z_en_pp.c index 5d04b7567..2a9d321b4 100644 --- a/src/overlays/actors/ovl_En_Pp/z_en_pp.c +++ b/src/overlays/actors/ovl_En_Pp/z_en_pp.c @@ -1072,7 +1072,7 @@ void EnPp_Dead(EnPp* this, PlayState* play) { Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0xE0); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1150,7 +1150,7 @@ void EnPp_Mask_Detach(EnPp* this, PlayState* play) { &sMaskFireVelocityAndAccel[i], 70, 0, 2); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } break; @@ -1225,7 +1225,7 @@ void EnPp_BodyPart_Move(EnPp* this, PlayState* play) { } if ((this->timer == 0) || (this->actor.bgCheckFlags & 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.c b/src/overlays/actors/ovl_En_Pr/z_en_pr.c index ec8ab91de..a40c16073 100644 --- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c +++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c @@ -445,7 +445,7 @@ void func_80A32F48(EnPr* this, PlayState* play) { if (this->unk_2D2 != 0) { Math_SmoothStepToS(&this->unk_2D0, 0, 1, 15, 50); if (this->unk_2D0 < 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c index 4564c679f..ed04ae0f6 100644 --- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c +++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c @@ -160,7 +160,7 @@ void EnPr2_Init(Actor* thisx, PlayState* play) { } func_80A745C4(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else { @@ -174,7 +174,7 @@ void EnPr2_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 20.0f, 20.0f, 0x1D); if (!(this->actor.bgCheckFlags & 0x60)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -277,7 +277,7 @@ void func_80A745FC(EnPr2* this, PlayState* play) { } if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_1D0, &this->unk_21C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Math_ApproachF(&this->actor.world.pos.y, this->unk_21C.y, 0.3f, 5.0f); @@ -337,7 +337,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { this->actor.speedXZ = 0.0f; Math_SmoothStepToS(&this->unk_1F4, 0, 1, 30, 100); if (this->unk_1F4 < 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { switch (this->unk_1E0) { @@ -455,7 +455,7 @@ void func_80A74E90(EnPr2* this, PlayState* play) { this->actor.speedXZ = 0.0f; Math_SmoothStepToS(&this->unk_1F4, 0, 1, 30, 100); if (this->unk_1F4 < 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { SkelAnime_Update(&this->skelAnime); @@ -558,7 +558,7 @@ void func_80A75310(EnPr2* this, PlayState* play) { this->actor.world.rot.z, i + 10); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else { @@ -601,7 +601,7 @@ void func_80A75310(EnPr2* this, PlayState* play) { EffectSsBubble_Spawn(play, &sp64, 0.0f, 5.0f, 5.0f, frame); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Prz/z_en_prz.c b/src/overlays/actors/ovl_En_Prz/z_en_prz.c index e5c611578..fd1dee986 100644 --- a/src/overlays/actors/ovl_En_Prz/z_en_prz.c +++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.c @@ -415,7 +415,7 @@ void func_80A76B14(EnPrz* this, PlayState* play) { EffectSsBubble_Spawn(play, &sp6C, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c index 3190e3e36..e75096c8f 100644 --- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c +++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c @@ -318,7 +318,7 @@ void EnRacedog_Init(Actor* thisx, PlayState* play) { if (ENRACEDOG_GET_INDEX(&this->actor) < 14) { this->index = ENRACEDOG_GET_INDEX(&this->actor); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->selectionArrowGreenPrimColor = 255; diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.c b/src/overlays/actors/ovl_En_Raf/z_en_raf.c index a3d91bba9..5d7a59e90 100644 --- a/src/overlays/actors/ovl_En_Raf/z_en_raf.c +++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.c @@ -343,7 +343,7 @@ void EnRaf_Idle(EnRaf* this, PlayState* play) { zDiff = explosive->world.pos.z - this->dyna.actor.world.pos.z; if ((fabsf(xDiff) < 80.0f) && (fabsf(yDiff) < 30.0f) && (fabsf(zDiff) < 80.0f) && (explosive->update != NULL) && (explosive->velocity.y != 0.0f)) { - Actor_MarkForDeath(explosive); + Actor_Kill(explosive); this->grabTarget = EN_RAF_GRAB_TARGET_EXPLOSIVE; this->collider.dim.radius = 30; this->collider.dim.height = 90; diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c index bfb701484..6cf596ba9 100644 --- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c +++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c @@ -248,7 +248,7 @@ void func_80B70D24(EnRailSkb* this, PlayState* play) { while (actor != NULL) { if ((actor->id == ACTOR_OBJ_HAKAISI) && func_80B70B04(this, actor->world.pos)) { if (Flags_GetSwitch(play, (actor->params & 0xFF00) >> 8)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk_22C = (ObjHakaisi*)actor; @@ -256,7 +256,7 @@ void func_80B70D24(EnRailSkb* this, PlayState* play) { } actor = actor->next; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } static InitChainEntry sInitChain[] = { @@ -277,7 +277,7 @@ void EnRailSkb_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (Flags_GetSwitch(play, ENRAILSKB_GET_FF(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_ProcessInitChain(&this->actor, sInitChain); @@ -635,7 +635,7 @@ void func_80B71BB8(EnRailSkb* this, PlayState* play) { } if (this->actor.bgCheckFlags & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c index 50df4d01c..443d92d59 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -273,7 +273,7 @@ void EnRailgibud_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (gSaveContext.save.weekEventReg[14] & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnRailgibud_SetupWalkInCircles(this); @@ -630,7 +630,7 @@ void EnRailgibud_Dead(EnRailgibud* this, PlayState* play) { if (this->deathTimer > 300) { if (this->actor.shape.shadowAlpha == 0) { if (this->actor.parent != NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { // Don't delete the "main" Gibdo, since that will break the surviving // Gibdos' ability to start and stop walking forward. Instead, just @@ -1115,7 +1115,7 @@ void EnRailgibud_InitCutsceneGibdo(EnRailgibud* this, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (gSaveContext.save.entrance != ENTRANCE(IKANA_CANYON, 9)) { // NOT Cutscene: Music Box House Opens - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnRailgibud_SetupDoNothing(this); @@ -1166,7 +1166,7 @@ void EnRailgibud_SinkIntoGround(EnRailgibud* this, PlayState* play) { if (this->sinkTimer != 0) { this->sinkTimer--; } else if (Math_SmoothStepToF(&this->actor.shape.yOffset, -9500.0f, 0.5f, 200.0f, 10.0f) < 10.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { EnRailgibud_SpawnEffectsForSinkingIntoTheGround(this, play, 0); } diff --git a/src/overlays/actors/ovl_En_Rat/z_en_rat.c b/src/overlays/actors/ovl_En_Rat/z_en_rat.c index 9057fdb4c..6759af183 100644 --- a/src/overlays/actors/ovl_En_Rat/z_en_rat.c +++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.c @@ -762,7 +762,7 @@ void EnRat_PostDetonation(EnRat* this, PlayState* play) { if (EN_RAT_GET_TYPE(&this->actor) == EN_RAT_TYPE_OVERWORLD) { EnRat_SetupRevive(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 0092189c5..2fdfc650d 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -1068,7 +1068,7 @@ void EnRd_Dead(EnRd* this, PlayState* play) { this->actor.scale.y -= (75.0f / 1000000.0f); this->alpha -= 5; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->deathTimer--; diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c index 2d976bdd5..a2f2f044c 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -758,7 +758,7 @@ void EnRg_Init(Actor* thisx, PlayState* play) { this->unk_31E = 0; this->actionFunc = func_80BF4EBC; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index b164e6aab..d7dba74e9 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -36,7 +36,7 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play) { pathIndex = RS_GET_PATH_INDEX(&this->actor); this->actor.params = RS_GET_TYPE(&this->actor); if (pathIndex == 0xFF) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index daf11baa6..9d9f14973 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -714,8 +714,11 @@ void func_808FB42C(EnRr* this, PlayState* play) { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_SHIELD_HERO); } Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); - Actor_MarkForDeath(&this->actor); - } else if (this->unk_1E4 == 88) { + Actor_Kill(&this->actor); + return; + } + + if (this->unk_1E4 == 88) { Vec3f sp74; sp74.x = this->actor.world.pos.x; diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c index 98f7b0a11..63d5aed38 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -257,7 +257,7 @@ void EnRuppecrow_UpdateRupees(EnRuppecrow* this) { for (rupeeIndex = 0; rupeeIndex < ENRUPPECROW_RUPEE_COUNT; rupeeIndex++) { rupee = this->rupees[rupeeIndex]; if (rupee != NULL && rupee->unk152 == 0) { - Actor_MarkForDeath(&rupee->actor); + Actor_Kill(&rupee->actor); } } } @@ -577,7 +577,7 @@ void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, PlayState* play) { Math_ApproachF(&this->actor.velocity.y, 3.0f, 0.2f, 0.5f); if (this->actor.world.pos.y > 1000.0f || this->actor.xzDistToPlayer > 2000.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->yOffset += 0x800; this->actor.shape.yOffset = Math_SinS(this->yOffset) * 500.0f; @@ -614,7 +614,7 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, PlayState* play) { 0x0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 0xB, NA_SE_EN_EXTINCT); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -643,7 +643,7 @@ void EnRuppecrow_Init(Actor* thisx, PlayState* play2) { if (this->path != NULL) { this->actionFunc = EnRuppecrow_HandleSong; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c index fbfe32252..44848ac1d 100644 --- a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c +++ b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c @@ -1096,7 +1096,7 @@ void EnSGoro_SetupAction(EnSGoro* this, PlayState* play) { this->actor.shape.yOffset = EN_S_GORO_ROLLEDUP_YOFFSET; break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } } @@ -1311,7 +1311,7 @@ void EnSGoro_Init(Actor* thisx, PlayState* play) { this->loadedObjIndex = objIndex; if (objIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } this->actor.draw = EnSGoro_Draw; diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index adcb78115..5391d650b 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -368,22 +368,23 @@ void EnSb_Update(Actor* thisx, PlayState* play) { this->actor.params = 1; } Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x80); - Actor_MarkForDeath(&this->actor); - } else { - Actor_SetFocus(&this->actor, 20.0f); - Actor_MoveWithGravity(&this->actor); - this->actionFunc(this, play); - Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 25.0f, 20.0f, 5); - EnSb_UpdateDamage(this, play); - if (player->stateFlags1 & 0x8000000) { - Collider_UpdateCylinder(&this->actor, &this->collider); - if (this->vulnerableTimer == 0) { - CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - } - CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); - } - SkelAnime_Update(&this->skelAnime); + Actor_Kill(&this->actor); + return; } + + Actor_SetFocus(&this->actor, 20.0f); + Actor_MoveWithGravity(&this->actor); + this->actionFunc(this, play); + Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 25.0f, 20.0f, 5); + EnSb_UpdateDamage(this, play); + if (player->stateFlags1 & 0x8000000) { + Collider_UpdateCylinder(&this->actor, &this->collider); + if (this->vulnerableTimer == 0) { + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); + } + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + } + SkelAnime_Update(&this->skelAnime); } void EnSb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { diff --git a/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c b/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c index 3eb978314..7433c501d 100644 --- a/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c +++ b/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c @@ -129,7 +129,7 @@ void func_80BD6B18(EnScRuppe* this, PlayState* play) { if (this->ruppeDisplayTime > 30) { if (func_80BD697C(this->ruppeIndex)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { f32 scale; diff --git a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c index 4bccdb846..6d95fc917 100644 --- a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c +++ b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c @@ -35,7 +35,7 @@ void EnScopecoin_Spin(EnScopecoin* this, PlayState* play) { void EnScopecoin_CheckCollectible(EnScopecoin* this, PlayState* play) { if (Flags_GetCollectible(play, OBJMUPICT_GET_RUPEE_FLAG(&this->actor))) { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_RED); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -53,7 +53,7 @@ void EnScopecoin_Init(Actor* thisx, PlayState* play) { if (play->actorCtx.flags & ACTORCTX_FLAG_1) { if ((this->rupeeIndex == 2) || (this->rupeeIndex == 6)) { if (Flags_GetCollectible(play, OBJMUPICT_GET_RUPEE_FLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -62,13 +62,13 @@ void EnScopecoin_Init(Actor* thisx, PlayState* play) { } else { if ((this->rupeeIndex == 2) || (this->rupeeIndex == 6)) { if (Flags_GetCollectible(play, OBJMUPICT_GET_RUPEE_FLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.draw = NULL; this->actionFunc = EnScopecoin_CheckCollectible; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c index a4fcb6cb3..563f37540 100644 --- a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c +++ b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c @@ -244,7 +244,7 @@ void func_80BCD640(EnScopecrow* this, PlayState* play) { } if (this->unk_1FC >= (this->path->count - 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_1FC++; } @@ -288,15 +288,15 @@ void EnScopecrow_Init(Actor* thisx, PlayState* play) { this->actor.world.pos = sp3C; this->actor.world.pos.y = BgCheck_EntityRaycastFloor1(&play->colCtx, &sp4C, &sp3C); if (this->actor.world.pos.y == BGCHECK_Y_MIN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_80BCD2BC(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -323,11 +323,11 @@ void EnScopecrow_Init(Actor* thisx, PlayState* play) { return; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnScopecrow_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c index fd0ced593..456983fac 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -240,7 +240,7 @@ void func_80BCB1C8(EnScopenuts* this, PlayState* play) { Actor_SetScale(&this->actor, this->unk_350); if (this->actor.bgCheckFlags & 1) { gSaveContext.save.weekEventReg[52] |= 0x40; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -626,7 +626,7 @@ void func_80BCBFFC(EnScopenuts* this, PlayState* play) { } void func_80BCC288(EnScopenuts* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } s32 func_80BCC2AC(EnScopenuts* this, Path* path, s32 arg2_) { @@ -686,7 +686,7 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { if (!(gSaveContext.save.weekEventReg[74] & 0x40) && (gSaveContext.save.inventory.items[ITEM_OCARINA] == ITEM_NONE)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -706,20 +706,20 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_0) { if (gSaveContext.save.weekEventReg[52] & 0x40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (play->actorCtx.flags & ACTORCTX_FLAG_1) { this->path = SubS_GetPathByIndex(play, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F); this->actor.draw = NULL; this->actionFunc = func_80BCAFA8; this->actor.gravity = 0.0f; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_1) { if (gSaveContext.save.weekEventReg[52] & 0x40) { this->path = SubS_GetPathByIndex(play, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F); if (this->path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.gravity = -1.0f; this->actor.draw = EnScopenuts_Draw; @@ -732,10 +732,10 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BCB230; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c index 8e0ad276c..89d27e4ec 100644 --- a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c +++ b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c @@ -54,23 +54,24 @@ void EnSekihi_Init(Actor* thisx, PlayState* play) { s32 objectIndex; s32 pad; - if ((params < SEKIHI_TYPE_0 || params >= SEKIHI_TYPE_MAX) || sOpaDLists[params] == NULL) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - if ((params == SEKIHI_TYPE_4) && (((gSaveContext.save.skullTokenCount & 0xFFFF)) >= 30)) { - gSaveContext.save.weekEventReg[13] |= 0x20; - } - objectIndex = Object_GetIndex(&play->objectCtx, sObjectIds[params]); - if (objectIndex >= 0) { - this->objectIndex = objectIndex; - } - this->actionFunc = func_80A44DE8; - this->opaDList = sOpaDLists[params]; - this->xluDList = sXluDLists[params]; - this->dyna.actor.textId = sTextIds[params]; - this->dyna.actor.focus.pos.y = this->dyna.actor.world.pos.y + 60.0f; - Actor_SetScale(&this->dyna.actor, 0.1f); + if (((params < SEKIHI_TYPE_0) || (params >= SEKIHI_TYPE_MAX)) || sOpaDLists[params] == NULL) { + Actor_Kill(&this->dyna.actor); + return; } + + if ((params == SEKIHI_TYPE_4) && ((gSaveContext.save.skullTokenCount & 0xFFFF) >= 30)) { + gSaveContext.save.weekEventReg[13] |= 0x20; + } + objectIndex = Object_GetIndex(&play->objectCtx, sObjectIds[params]); + if (objectIndex >= 0) { + this->objectIndex = objectIndex; + } + this->actionFunc = func_80A44DE8; + this->opaDList = sOpaDLists[params]; + this->xluDList = sXluDLists[params]; + this->dyna.actor.textId = sTextIds[params]; + this->dyna.actor.focus.pos.y = this->dyna.actor.world.pos.y + 60.0f; + Actor_SetScale(&this->dyna.actor, 0.1f); } void EnSekihi_Destroy(Actor* thisx, PlayState* play) { @@ -104,7 +105,7 @@ void func_80A44DE8(EnSekihi* this, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if ((params == SEKIHI_TYPE_4) && (INV_CONTENT(ITEM_MASK_ZORA) != ITEM_MASK_ZORA)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } } diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c index d4a726887..4d3c4d637 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -690,7 +690,7 @@ void func_80ADC37C(EnSellnuts* this, PlayState* play) { } void func_80ADC580(EnSellnuts* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80ADC5A4(EnSellnuts* this, PlayState* play) { @@ -836,7 +836,7 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { } else if (this->unk_34C == 17) { ActorCutscene_Stop(this->cutscene); gSaveContext.save.weekEventReg[73] |= 4; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -948,7 +948,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { s32 pad2; if ((gSaveContext.save.weekEventReg[17] & 0x80) || (gSaveContext.save.weekEventReg[61] & 0x10)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_ProcessInitChain(&this->actor, sInitChain); @@ -971,7 +971,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { this->actor.velocity.y = 0.0f; if (gSaveContext.save.weekEventReg[73] & 4) { if (ENSELLNUTS_GET_1(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk_338 |= 2; diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index d0c02e4fa..de6175674 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -555,7 +555,7 @@ void func_8099599C(EnSkb* this, PlayState* play) { Math_ApproachF(&this->actor.shape.shadowScale, 0.0f, 1.0f, 2.5f); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -800,7 +800,7 @@ void func_80996474(EnSkb* this) { void func_809964A0(EnSkb* this, PlayState* play) { if (this->unk_3D0++ >= 19) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c index e2dd8b54b..30352048b 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c @@ -34,8 +34,8 @@ void EnSnowman_SetupDead(EnSnowman* this); void EnSnowman_Dead(EnSnowman* this, PlayState* play); void EnSnowman_SetupSplitDoNothing(EnSnowman* this); void EnSnowman_SplitDoNothing(EnSnowman* this, PlayState* play); -void EnSnowman_SetupMarkForDeath(EnSnowman* this); -void EnSnowman_MarkForDeath(EnSnowman* this, PlayState* play); +void EnSnowman_SetupKill(EnSnowman* this); +void EnSnowman_Kill(EnSnowman* this, PlayState* play); void EnSnowman_CreateSplitEeno(EnSnowman* this, Vec3f* basePos, s32 yRot); void EnSnowman_SetupCombine(EnSnowman* this, PlayState* play, Vec3f* combinePos); void EnSnowman_Combine(EnSnowman* this, PlayState* play); @@ -211,14 +211,14 @@ void EnSnowman_Init(Actor* thisx, PlayState* play) { EN_SNOWMAN_TYPE_SPLIT, -1, thisx->unk20, NULL); if ((thisx->child == NULL) || (thisx->parent == NULL)) { if (thisx->child != NULL) { - Actor_MarkForDeath(thisx->child); + Actor_Kill(thisx->child); } if (thisx->parent != NULL) { - Actor_MarkForDeath(thisx->parent); + Actor_Kill(thisx->parent); } - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } @@ -634,11 +634,11 @@ void EnSnowman_Melt(EnSnowman* this, PlayState* play) { if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_SPLIT) { EnSnowman_SetupSplitDoNothing(this); } else if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) { - Actor_MarkForDeath(this->actor.parent); - Actor_MarkForDeath(this->actor.child); - Actor_MarkForDeath(&this->actor); + Actor_Kill(this->actor.parent); + Actor_Kill(this->actor.child); + Actor_Kill(&this->actor); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -765,7 +765,7 @@ void EnSnowman_Dead(EnSnowman* this, PlayState* play) { if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_SPLIT) { EnSnowman_SetupSplitDoNothing(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -788,9 +788,9 @@ void EnSnowman_SetupSplitDoNothing(EnSnowman* this) { this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_10); if ((this->actor.parent != NULL) && (((EnSnowman*)this->actor.parent)->actionFunc == EnSnowman_SplitDoNothing)) { if ((this->actor.child != NULL) && (((EnSnowman*)this->actor.child)->actionFunc == EnSnowman_SplitDoNothing)) { - EnSnowman_SetupMarkForDeath((EnSnowman*)this->actor.parent); - EnSnowman_SetupMarkForDeath((EnSnowman*)this->actor.child); - Actor_MarkForDeath(&this->actor); + EnSnowman_SetupKill((EnSnowman*)this->actor.parent); + EnSnowman_SetupKill((EnSnowman*)this->actor.child); + Actor_Kill(&this->actor); } } @@ -801,19 +801,19 @@ void EnSnowman_SplitDoNothing(EnSnowman* this, PlayState* play) { } /** - * Turns off collision on the Eeno before calling Actor_MarkForDeath on it. + * Turns off collision on the Eeno before calling Actor_Kill on it. */ -void EnSnowman_SetupMarkForDeath(EnSnowman* this) { +void EnSnowman_SetupKill(EnSnowman* this) { this->collider.base.acFlags &= ~(AC_ON | AC_HIT); this->collider.base.ocFlags1 &= ~(OC1_ON | OC1_HIT); - this->actionFunc = EnSnowman_MarkForDeath; + this->actionFunc = EnSnowman_Kill; } /** - * Simply calls Actor_MarkForDeath on the Eeno. + * Simply calls Actor_Kill on the Eeno. */ -void EnSnowman_MarkForDeath(EnSnowman* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); +void EnSnowman_Kill(EnSnowman* this, PlayState* play) { + Actor_Kill(&this->actor); } /** @@ -1025,7 +1025,7 @@ void EnSnowman_Update(Actor* thisx, PlayState* play) { EnSnowman_UpdateDamage(this, play); this->actionFunc(this, play); - if (this->actionFunc != EnSnowman_MarkForDeath) { + if (this->actionFunc != EnSnowman_Kill) { Actor_MoveWithGravity(&this->actor); if ((EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) && (this->actionFunc == EnSnowman_ReadySnowball)) { @@ -1095,25 +1095,26 @@ void EnSnowman_UpdateSnowball(Actor* thisx, PlayState* play) { 30); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_SMALL_SNOWBALL_BROKEN); } else { - // EnSnowman_SpawnBigSnowballFragmentEffects only fworks with snowballPos, so we need - // to copy the snowball actor's current position into snowballPos to make this fwork. + // EnSnowman_SpawnBigSnowballFragmentEffects only works with snowballPos, so we need + // to copy the snowball actor's current position into snowballPos to make this work. Math_Vec3f_Copy(&this->snowballPos, &this->actor.world.pos); EnSnowman_SpawnBigSnowballFragmentEffects(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_SNOWBALL_BROKEN); } SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_IT_REFLECTION_WOOD); - Actor_MarkForDeath(&this->actor); - } else { - this->actor.shape.rot.x += 0xF00; - Actor_MoveWithGravity(&this->actor); - Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, this->collider.dim.radius * 0.6f, - this->collider.dim.height - this->collider.dim.yShift, 0x1F); - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); + Actor_Kill(&this->actor); + return; } + + this->actor.shape.rot.x += 0xF00; + Actor_MoveWithGravity(&this->actor); + Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, this->collider.dim.radius * 0.6f, + this->collider.dim.height - this->collider.dim.yShift, 0x1F); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } /** diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index ebbdcf542..b7ea5d194 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -396,18 +396,18 @@ void EnSob1_Init(Actor* thisx, PlayState* play) { this->shopType = BOMB_SHOP; break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } objIds = sObjectIds[this->shopType]; this->mainObjIndex = Object_GetIndex(&play->objectCtx, objIds[0]); if (this->mainObjIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (!EnSob1_GetObjIndices(this, play, objIds)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Actor_ProcessInitChain(&this->actor, sInitChain); diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 408ca1b2f..3f21fcec6 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -655,7 +655,7 @@ void EnSsh_Init(Actor* thisx, PlayState* play) { this->initialYaw = this->actor.world.rot.y; EnSsh_SetupAction(this, EnSsh_Start); if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index ecc2b85b2..4a496c91e 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -822,7 +822,7 @@ void func_808A701C(EnSt* this, PlayState* play) { if (count == ARRAY_COUNT(this->unk_31C)) { Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (DECR(this->unk_318) == 0) { this->unk_18C |= 0x40; @@ -839,10 +839,11 @@ void EnSt_Init(Actor* thisx, PlayState* play) { this->unk_2C0 = Object_GetIndex(&play->objectCtx, GAMEPLAY_KEEP); if (((ENST_GET_3F(&this->actor) != ENST_3F_63) && Flags_GetSwitch(play, ENST_GET_3F(&this->actor))) || (this->unk_2C0 < 0)) { - Actor_MarkForDeath(&this->actor); - } else { - this->actionFunc = func_808A6A78; + Actor_Kill(&this->actor); + return; } + + this->actionFunc = func_808A6A78; } void EnSt_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 1d9ddf4e9..7bc9b818a 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -107,7 +107,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); this->actionFunc = func_80B67958; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -116,7 +116,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { this->actionFunc = func_80B67DA0; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.textId = 0; if (!(gSaveContext.save.weekEventReg[34] & 0x40) || !(gSaveContext.save.weekEventReg[34] & 8)) { @@ -126,7 +126,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { case ENSTH_F_3: if ((gSaveContext.save.skullTokenCount & 0xFFFF) >= 30) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = func_80B678A8; @@ -137,7 +137,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { case ENSTH_F_4: if (gSaveContext.save.weekEventReg[13] & 0x20) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.textId = 0; @@ -149,7 +149,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { case ENSTH_F_5: if (!(gSaveContext.save.weekEventReg[13] & 0x20) || (Inventory_GetSkullTokenCount(play->sceneId) < 30)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = func_80B67208; diff --git a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c index 1bf91af6b..27613eca9 100644 --- a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c +++ b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c @@ -43,7 +43,7 @@ void EnSth2_Init(Actor* thisx, PlayState* play) { if (play->actorCtx.flags & ACTORCTX_FLAG_1) { this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = EnSth2_UpdateSkelAnime; diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index 4f3882aa7..9f24c2735 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -904,7 +904,7 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { func_80BABFD4(this, play); break; case 1: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case 2: if (!(gSaveContext.save.weekEventReg[81] & 4)) { @@ -963,11 +963,11 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { } } else if (play->sceneId == SCENE_BACKTOWN) { if (gSaveContext.save.time >= CLOCK_TIME(0, 20) && gSaveContext.save.time < CLOCK_TIME(6, 00)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if ((gSaveContext.save.entrance == ENTRANCE(NORTH_CLOCK_TOWN, 7)) || (gSaveContext.save.weekEventReg[58] & 0x40)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->cutscenes[0] = this->actor.cutscene; this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); @@ -979,7 +979,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { return; } else if (play->sceneId == SCENE_ICHIBA) { if (gSaveContext.save.weekEventReg[33] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->animIndex = 0; @@ -989,7 +989,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { return; } else if (play->sceneId == SCENE_AYASHIISHOP) { if (gSaveContext.save.weekEventReg[33] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->animIndex = 0; @@ -1005,7 +1005,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { this->actionFunc = func_80BACA14; return; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80BACA14(EnSuttari* this, PlayState* play) { @@ -1226,7 +1226,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_SMALL_EXPLOSION); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_IT_BOMB_EXPLOSION); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->unk1F4[1] == -0x63) { @@ -1266,7 +1266,7 @@ void func_80BAD5F8(EnSuttari* this, PlayState* play) { this->unk428 = scheduleOutput.result; func_80BAC2FC(this, play); if ((this->unk430 == 1) && (this->timePath->unk1 == 0xFF)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } func_80BAB434(this); @@ -1304,7 +1304,7 @@ void func_80BAD7F8(EnSuttari* this, PlayState* play) { this->unk428 = scheduleOutput.result; func_80BAC2FC(this, play); if ((this->unk430 == 1) && (this->timePath->unk1 == 0xFF)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if ((this->flags1 & 0x20) && (scheduleOutput.result != 9)) { @@ -1434,7 +1434,7 @@ void func_80BADE8C(EnSuttari* this, PlayState* play) { void func_80BADF3C(EnSuttari* this, PlayState* play) { func_80BABB90(this, 0); if (this->unk1F4[0] == -0x63) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk3F2 = this->headRot.y; if (DECR(this->unk3F6) == 0) { @@ -1448,7 +1448,7 @@ void EnSuttari_Init(Actor* thisx, PlayState* play) { s32 pad; if (gSaveContext.save.weekEventReg[79] & 0x40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Collider_InitCylinder(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index fc3aff029..24326e7e8 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -1023,7 +1023,7 @@ void func_808DAEB4(EnSw* this, PlayState* play) { } if (count == ARRAY_COUNT(this->unk_464)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { Math_ApproachF(&this->actor.scale.x, 0.0f, 0.08f, 1.0f); @@ -1038,7 +1038,7 @@ void func_808DAEB4(EnSw* this, PlayState* play) { 0, this->actor.params) != NULL) { play_sound(NA_SE_SY_KINSTA_MARK_APPEAR); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_808D94D0(this, play, 0, 0, 0x1554); } @@ -1210,7 +1210,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { break; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c index 0b76c7715..3233321c2 100644 --- a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c +++ b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c @@ -96,7 +96,7 @@ void EnSyatekiCrow_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawCircle, 20.0f); if ((path == NULL) || (EN_SYATEKI_CROW_GET_INDEX(&this->actor) >= 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c index b7e79fdfd..c1af4524a 100644 --- a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c +++ b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c @@ -142,7 +142,7 @@ void EnSyatekiDekunuts_Init(Actor* thisx, PlayState* play2) { DEKU_SCRUB_LIMB_MAX); if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c index d9059577c..4e8731c1c 100644 --- a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c +++ b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c @@ -105,7 +105,7 @@ void EnSyatekiOkuta_Init(Actor* thisx, PlayState* play) { if (!(WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface, &waterbox)) || (ySurface <= this->actor.floorHeight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.world.pos.y = this->actor.home.pos.y = ySurface; } diff --git a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c index ad9aa824f..4456a1f21 100644 --- a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c +++ b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c @@ -156,7 +156,7 @@ void EnSyatekiWf_Init(Actor* thisx, PlayState* play) { } if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c index 393caa1d9..e1f80e24e 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c @@ -269,7 +269,7 @@ void EnTalkGibud_Init(Actor* thisx, PlayState* play) { } if (this->switchFlag != -1 && Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnTalkGibud_SetupIdle(this); @@ -876,7 +876,7 @@ void EnTalkGibud_Disappear(EnTalkGibud* this, PlayState* play) { } player->stateFlags1 &= ~0x20; player->stateFlags1 &= ~0x20000000; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c index 9737c9f81..adb221fbf 100644 --- a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c +++ b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c @@ -394,7 +394,7 @@ void func_80BB7408(EnTanron2* this, PlayState* play) { if (this->actor.world.pos.y <= this->actor.floorHeight) { this->actor.world.pos.y = this->actor.floorHeight; if ((s8)this->actor.colChkInfo.health <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); func_80BB71C8(this, play); D_80BB8450->unk_6F6--; D_80BB8450->unk_2E2 += 4; @@ -470,7 +470,7 @@ void func_80BB7578(EnTanron2* this, PlayState* play) { Matrix_MultVecZ(10.0f, &this->actor.velocity); this->unk_152 = Rand_ZeroFloat(100.0f) + 200.0f; } else if (D_80BB8450->unk_1F6 == 10) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); func_80BB71C8(this, play); } } @@ -579,7 +579,7 @@ void func_80BB7B90(Actor* thisx, PlayState* play) { D_80BB8454 = (Math_SinS(play->gameplayFrames * 0x3000) * 0.1f) + 1.0f; if (D_80BB8450->unk_1F6 == 11) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c index d683cde8c..2b7f7ff35 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -354,7 +354,7 @@ void EnTanron3_Die(EnTanron3* this, PlayState* play) { Actor_MoveWithoutGravityReverse(&this->actor); if (this->workTimer[WORK_TIMER_DIE] == 0) { EnTanron3_SpawnBubbles(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (Rand_ZeroOne() < 0.3f) { Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x60); } diff --git a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c index f45afbb01..b40cc101f 100644 --- a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c +++ b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c @@ -150,7 +150,7 @@ void EnTanron5_Init(Actor* thisx, PlayState* play) { if (ENTANRON5_GET(&this->actor) >= ENTANRON5_100) { D_80BE5D80++; if (D_80BE5D80 > 60) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -201,7 +201,7 @@ void EnTanron5_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &child->collider, &child->actor, &sCylinderInit); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 150.0f, 100.0f, 4); this->actor.world.pos.y = this->actor.floorHeight + -20.0f; @@ -230,7 +230,7 @@ void EnTanron5_Update(Actor* thisx, PlayState* play2) { this->unk_1A0++; Actor_SetScale(&this->actor, 0.0f); if (this->unk_1A0 >= 40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } else { @@ -406,13 +406,13 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { this->unk_1A0++; this->actor.world.pos.y -= 2.0f * D_80BE5DD0; if (this->unk_1A0 == 40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } if (DECR(this->unk_144) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (this->actor.speedXZ > 0.02f) { @@ -435,7 +435,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { } this->unk_1A0++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } else { @@ -464,7 +464,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { } else { Item_Give(play, ITEM_MAGIC_LARGE); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); play_sound(NA_SE_SY_GET_ITEM); } else { this->unk_1A1 = 20; diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 348290ccf..3d3ac276e 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -175,7 +175,7 @@ void EnTest_Init(Actor* thisx, PlayState* play2) { thisx->floorHeight = BgCheck_EntityRaycastFloor3(&play->colCtx, &thisx->floorPoly, &sp34, &thisx->world.pos); if ((thisx->floorPoly == NULL) || (thisx->floorHeight == BGCHECK_Y_MIN)) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } @@ -208,7 +208,7 @@ void EnTest_Update(Actor* thisx, PlayState* play) { if (func_80183DE0(&this->skeletonInfo) && (this->actor.parent == NULL) && (this->actor.params != -1)) { this->unk_209++; if (this->unk_209 > 20) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Test2/z_en_test2.c b/src/overlays/actors/ovl_En_Test2/z_en_test2.c index c9151d621..8303f1493 100644 --- a/src/overlays/actors/ovl_En_Test2/z_en_test2.c +++ b/src/overlays/actors/ovl_En_Test2/z_en_test2.c @@ -85,7 +85,7 @@ void EnTest2_Update(Actor* thisx, PlayState* play) { objectIndex = Object_GetIndex(&play->objectCtx, sObjectIds[this->actor.params]); if (objectIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (Object_IsLoaded(&play->objectCtx, objectIndex)) { diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c index 805a6f8bf..c9c849b30 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c @@ -305,7 +305,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { } if (sIsLoaded || (gSaveContext.eventInf[2] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { sIsLoaded = true; this->actor.room = -1; @@ -319,7 +319,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { SET_NEXT_GAMESTATE(&play->state, DayTelop_Init, sizeof(DayTelopState)); this->unk_144 = 1; gSaveContext.save.time = CLOCK_TIME(6, 0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { gSaveContext.save.day = 1; dayTemp = gSaveContext.save.day; @@ -389,7 +389,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { } else if (temp_a0 == CLOCK_TIME(6, 0)) { if (CURRENT_DAY == 3) { Interface_StartMoonCrash(play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); gSaveContext.eventInf[1] |= 0x80; } else if (((sCutscenes[this->unk_144] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) && (CURRENT_DAY != 3)) { @@ -413,7 +413,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { gSaveContext.respawnFlag = -4; gSaveContext.eventInf[2] |= 0x80; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -457,7 +457,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_02; player->stateFlags1 |= 0x200; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_80A42198(this); } else { diff --git a/src/overlays/actors/ovl_En_Test5/z_en_test5.c b/src/overlays/actors/ovl_En_Test5/z_en_test5.c index 13cb04b02..760474b1b 100644 --- a/src/overlays/actors/ovl_En_Test5/z_en_test5.c +++ b/src/overlays/actors/ovl_En_Test5/z_en_test5.c @@ -41,7 +41,7 @@ void EnTest5_Init(Actor* thisx, PlayState* play2) { // If not spawned above a water source, immediately despawn if (!WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface, &water)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Test6/z_en_test6.c b/src/overlays/actors/ovl_En_Test6/z_en_test6.c index ea50336d9..bc47e3e52 100644 --- a/src/overlays/actors/ovl_En_Test6/z_en_test6.c +++ b/src/overlays/actors/ovl_En_Test6/z_en_test6.c @@ -302,7 +302,7 @@ void EnTest6_Init(Actor* thisx, PlayState* play2) { if (((ENTEST6_GET(&this->actor) == ENTEST6_24) || (ENTEST6_GET(&this->actor) == ENTEST6_25) || (ENTEST6_GET(&this->actor) == ENTEST6_26)) && (play->playerActorCsIds[8] == -1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -398,7 +398,7 @@ void func_80A916F0(EnTest6* this, PlayState* play) { func_800B7298(play, NULL, 6); func_80A90C34(); Distortion_ClearType(DISTORTION_TYPE_5); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80A91760(EnTest6* this, PlayState* play) { @@ -619,7 +619,7 @@ void func_80A92118(EnTest6* this, PlayState* play) { func_800B7298(play, NULL, 6); func_80A90C34(); Distortion_ClearType(DISTORTION_TYPE_5); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80A92188(EnTest6* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/src/overlays/actors/ovl_En_Test7/z_en_test7.c index 5f153e5a9..272d4dbdd 100644 --- a/src/overlays/actors/ovl_En_Test7/z_en_test7.c +++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.c @@ -413,7 +413,7 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) { } if (play->playerActorCsIds[8] == -1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -921,7 +921,7 @@ void func_80AF30F4(EnTest7* this, PlayState* play) { if (this->unk_1E54 > 90) { player->stateFlags1 &= ~0x20; player->stateFlags1 &= ~0x20000000; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c index fc82ed262..ae3e6a7aa 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -166,12 +166,16 @@ void EnThiefbird_Init(Actor* thisx, PlayState* play) { if (this->actor.params == 1) { D_80C1392C = 1; Math_Vec3f_Copy(&D_80C13920, &this->actor.world.pos); - Actor_MarkForDeath(&this->actor); - } else if (STOLEN_ITEM_1 != STOLEN_ITEM_NONE) { - Actor_MarkForDeath(&this->actor); - } else { - func_80C11538(this); + Actor_Kill(&this->actor); + return; } + + if (STOLEN_ITEM_1 != STOLEN_ITEM_NONE) { + Actor_Kill(&this->actor); + return; + } + + func_80C11538(this); } void EnThiefbird_Destroy(Actor* thisx, PlayState* play) { @@ -657,7 +661,7 @@ void func_80C11DF0(EnThiefbird* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -830,7 +834,7 @@ void func_80C126D8(EnThiefbird* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_ApproachS(&this->actor.shape.rot.x, 0x3000, 6, 0x1000); if (this->actor.playerHeightRel > 100.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c index a8e74ff6e..cb13954ed 100644 --- a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c +++ b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c @@ -50,7 +50,7 @@ void EnTimeTag_Init(Actor* thisx, PlayState* play) { switch (ENTIMETAG_GET_E000(&this->actor)) { case 4: if ((gSaveContext.save.weekEventReg[8] & 0x40) || (CURRENT_DAY != 3)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.home.rot.x = 0; diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index b912f6f38..dcf841968 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -668,12 +668,13 @@ void func_808951B8(EnTite* this, PlayState* play) { func_800B3030(play, &this->limbPos[i], &gZeroVec3f, &gZeroVec3f, 40, 7, 1); SoundSource_PlaySfxAtFixedWorldPos(play, &this->limbPos[i], 11, NA_SE_EN_EXTINCT); } - Actor_MarkForDeath(&this->actor); - } else { - for (i = 0; i < ARRAY_COUNT(this->unk_33C); i++) { - Math_Vec3f_Sum(&this->limbPos[i], &this->unk_33C[i], &this->limbPos[i]); - this->unk_33C[i].y += this->actor.gravity; - } + Actor_Kill(&this->actor); + return; + } + + for (i = 0; i < ARRAY_COUNT(this->unk_33C); i++) { + Math_Vec3f_Sum(&this->limbPos[i], &this->unk_33C[i], &this->limbPos[i]); + this->unk_33C[i].y += this->actor.gravity; } } diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 60c4b4dd0..9197b9dc7 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -209,11 +209,11 @@ void EnTk_Init(Actor* thisx, PlayState* play) { if (Flags_GetSwitch(play, this->unk_2B1)) { if (this->unk_2B0 == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (this->unk_2B0 == 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -252,7 +252,7 @@ void EnTk_Init(Actor* thisx, PlayState* play) { switch (this->unk_2B0) { case 4: if (D_80AF0050 != 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } D_80AF0050 = 1; @@ -271,7 +271,7 @@ void EnTk_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -679,7 +679,7 @@ void func_80AED940(EnTk* this, PlayState* play) { if (ENTK_GET_F(actor) == 1) { Math_Vec3f_Copy(&this->unk_2EC, &actor->world.pos); Math_Vec3s_Copy(&this->unk_2F8, &actor->world.rot); - Actor_MarkForDeath(actor); + Actor_Kill(actor); this->unk_2CA |= 0x40; break; } @@ -735,7 +735,7 @@ void func_80AEDD4C(EnTk* this, PlayState* play) { if (this->unk_2E8 <= 0) { ActorCutscene_Stop(this->cutscenes[1]); func_801477B4(play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -928,11 +928,12 @@ void func_80AEE374(EnTk* this, PlayState* play) { SubS_FindActorCustom(play, &this->actor, NULL, ACTORCAT_NPC, ACTOR_EN_TK, &sp30, func_80AEE300); if (sp30.unk_00 == 0) { - Actor_MarkForDeath(&this->actor); - } else { - this->unk_2CC = Actor_YawToPoint(&this->actor, &sp30.unk_00->world.pos); - this->actionFunc = func_80AEE414; + Actor_Kill(&this->actor); + return; } + + this->unk_2CC = Actor_YawToPoint(&this->actor, &sp30.unk_00->world.pos); + this->actionFunc = func_80AEE414; } void func_80AEE414(EnTk* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.c b/src/overlays/actors/ovl_En_Torch/z_en_torch.c index 9a09e27eb..0dd8222ce 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.c +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.c @@ -29,5 +29,5 @@ void EnTorch_Init(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOX, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, ENBOX_PARAMS(ENBOX_TYPE_SMALL, sChestContents[(returnData >> 0x5) & 0x7], returnData)); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 479ceaad6..4d02d749a 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -149,11 +149,12 @@ void EnTorch2_UpdateDeath(Actor* thisx, PlayState* play) { // Fall down and become transparent, then delete once invisible if (Math_StepToS(&this->alpha, 0, 8)) { - Actor_MarkForDeath(&this->actor); - } else { - this->actor.gravity = -1.0f; - Actor_MoveWithGravity(&this->actor); + Actor_Kill(&this->actor); + return; } + + this->actor.gravity = -1.0f; + Actor_MoveWithGravity(&this->actor); } void EnTorch2_Draw(Actor* thisx, PlayState* play2) { diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c index a55c899ef..3c1f35af3 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -186,7 +186,7 @@ void EnToto_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); if ((play->sceneId == SCENE_MILK_BAR) && (gSaveContext.save.time >= CLOCK_TIME(6, 0)) && (gSaveContext.save.time < CLOCK_TIME(21, 30))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); @@ -510,7 +510,7 @@ s32 func_80BA4530(EnToto* this, PlayState* play) { func_80BA3C88(this); if (player->actor.world.pos.z > -270.0f) { if (this->spotlights != NULL) { - Actor_MarkForDeath(this->spotlights); + Actor_Kill(this->spotlights); } this->unk2B6 = 1; return this->text->unk1; @@ -612,11 +612,11 @@ s32 func_80BA4A00(EnToto* this, PlayState* play) { actor = &GET_PLAYER(play)->actor; actor = actor->next; while (actor != NULL) { - Actor_MarkForDeath(actor); + Actor_Kill(actor); actor = actor->next; } if (this->spotlights != NULL) { - Actor_MarkForDeath(this->spotlights); + Actor_Kill(this->spotlights); } func_800B7298(play, NULL, 0x45); if (this->unk2B3 == 0xF) { diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c index ac6a4f476..9e4375ae6 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -243,7 +243,7 @@ void func_80AD381C(EnTrt2* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_10; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -251,7 +251,7 @@ void func_80AD38B8(EnTrt2* this, PlayState* play) { Vec3s sp30; if (this->unk_3D9 == 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (this->path != NULL) { @@ -482,7 +482,7 @@ void func_80AD431C(EnTrt2* this, PlayState* play) { Player* player = GET_PLAYER(play); player->stateFlags1 &= ~0x20; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80AD434C(EnTrt2* this, PlayState* play) { @@ -743,12 +743,12 @@ void func_80AD4DB4(EnTrt2* this, PlayState* play) { this->unk_3BC = func_80AD4608; if (gSaveContext.save.weekEventReg[12] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (gSaveContext.save.weekEventReg[84] & 0x40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -758,18 +758,18 @@ void func_80AD4DB4(EnTrt2* this, PlayState* play) { gSaveContext.save.weekEventReg[15] |= 0x80; this->unk_3B2 = 3; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (gSaveContext.save.day == 2) { if (gSaveContext.save.weekEventReg[15] & 0x80) { this->unk_3B2 = 4; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (gSaveContext.save.day == 3) { diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c index c54d924df..3e619cac3 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -1128,7 +1128,7 @@ void EnTru_Init(Actor* thisx, PlayState* play) { EnTru* this = THIS; if ((gSaveContext.save.entrance != 0xC200) || (gSaveContext.save.weekEventReg[12] & 8)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c index 69725414a..3982e0420 100644 --- a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c +++ b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c @@ -414,12 +414,12 @@ void EnTruMt_Init(Actor* thisx, PlayState* play) { EnTruMt* this = THIS; if (!(gSaveContext.eventInf[3] & 0x20)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (func_80B763C4(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c index 15d4cf3e5..d671f85ff 100644 --- a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c +++ b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c @@ -88,7 +88,7 @@ void func_80ADFCEC(EnTsn* this, PlayState* play) { switch (ENTSN_GET_F(&this->actor)) { case ENTSN_F_0: if (gSaveContext.save.weekEventReg[26] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.textId = 0x106E; @@ -107,7 +107,7 @@ void func_80ADFCEC(EnTsn* this, PlayState* play) { if ((ENTSN_GET_F(&this->actor)) == ENTSN_F_0) { this->actionFunc = func_80AE0D78; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } @@ -116,7 +116,7 @@ void func_80ADFCEC(EnTsn* this, PlayState* play) { this->unk_220 = 0; if (this->unk_1D8 == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if ((ENTSN_GET_F(&this->actor)) == ENTSN_F_1) { func_800BC154(play, &play->actorCtx, &this->actor, 6); } @@ -145,7 +145,7 @@ void EnTsn_Init(Actor* thisx, PlayState* play) { this->actor.gravity = -1.0f; if (gSaveContext.save.weekEventReg[55] & 0x80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -291,7 +291,7 @@ void func_80AE0304(EnTsn* this, PlayState* play) { void func_80AE0418(EnTsn* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { Message_StartTextbox(play, 0x107D, NULL); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index bf1e44e98..c466995a5 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -177,7 +177,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { EnTuboTrap_SpawnEffectsInWater(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -187,7 +187,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -197,7 +197,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_EXPLOSION); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -209,7 +209,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); SoundSource_PlaySfxAtFixedWorldPos(play, &player2->actor.world.pos, 40, NA_SE_PL_BODY_HIT); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -218,7 +218,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { EnTuboTrap_SpawnEffectsOnLand(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Twig/z_en_twig.c b/src/overlays/actors/ovl_En_Twig/z_en_twig.c index 1f26288c4..0331dc24e 100644 --- a/src/overlays/actors/ovl_En_Twig/z_en_twig.c +++ b/src/overlays/actors/ovl_En_Twig/z_en_twig.c @@ -70,7 +70,7 @@ void EnTwig_Init(Actor* thisx, PlayState* play2) { this->dyna.actor.bgCheckFlags |= 0x400; switch (this->unk_160) { case 0: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; case 1: if (!sRingsHaveSpawned) { @@ -82,11 +82,11 @@ void EnTwig_Init(Actor* thisx, PlayState* play2) { } if (RACERING_GET_PARAM_1F0(&this->dyna.actor) != 0) { if (!(gSaveContext.save.weekEventReg[24] & 4)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } else if (gSaveContext.save.weekEventReg[24] & 4) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } Actor_SetScale(&this->dyna.actor, 4.2f); @@ -213,7 +213,7 @@ void func_80AC0D2C(EnTwig* this, PlayState* play) { sCurrentRing = -1; } } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } this->unk_170 += 180.0f / 0x10000; diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index 2dedc7c2a..d0062df49 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -398,7 +398,7 @@ void func_808CCCF0(EnVm* this, PlayState* play) { } } else if (this->unk_214 == 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 9dca3642f..13f3efff8 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -171,7 +171,7 @@ void EnWallmas_Init(Actor* thisx, PlayState* play) { if (WALLMASTER_GET_TYPE(&this->actor) == WALLMASTER_TYPE_FLAG) { if (Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -376,7 +376,7 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, PlayState* play) { if (this->actor.playerHeightRel < -900.0f) { if (WALLMASTER_GET_TYPE(&this->actor) == WALLMASTER_TYPE_FLAG) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -444,7 +444,7 @@ void EnWallmas_Die(EnWallmas* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0015f)) { Actor_SetScale(&this->actor, 0.01f); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.scale.z = this->actor.scale.x; diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c index 1ba5e6ebc..2b4feee16 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c @@ -59,7 +59,7 @@ void EnWarptag_Init(Actor* thisx, PlayState* play) { } else { if ((this->dangeonKeepObject = Object_GetIndex(&play->objectCtx, GAMEPLAY_DANGEON_KEEP)) < 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } this->actionFunc = EnWarpTag_CheckDungeonKeepObject; diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c index aa36b6947..af8df0f2c 100644 --- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c +++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c @@ -580,7 +580,7 @@ void func_80A5A534(Actor* thisx, PlayState* play) { s32 i; if (this->unk_E38 < 1.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk_DC4++; diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index ec6f12aeb..5f71969b2 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -78,7 +78,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { break; case WEATHERTAG_TYPE_UNK1: if (gSaveContext.save.weekEventReg[52] & 0x20) { // if cleared STT - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnWeatherTag_SetupAction(this, func_80966B08); break; @@ -214,15 +214,15 @@ void func_80966A68(EnWeatherTag* this, PlayState* play) { } if ((s16)this->unk154 < 0) { // cast req this->unk154 = 0; - // @BUG redudant code - Actor_MarkForDeath(&this->actor); + // redundant code + Actor_Kill(&this->actor); EnWeatherTag_SetupAction(this, EnWeatherTag_Die); } func_8096689C(this, play); } void EnWeatherTag_Die(EnWeatherTag* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } // WEATHERTAG_TYPE_UNK1 diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 811f828a8..f3bfabf4b 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -309,7 +309,7 @@ void EnWf_Init(Actor* thisx, PlayState* play) { } if (Flags_GetClear(play, this->actor.room)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -1181,7 +1181,7 @@ void func_80992E0C(EnWf* this, PlayState* play) { } else { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { s32 i; Vec3f sp60; diff --git a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c index 0abf1fe56..375e298dc 100644 --- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c +++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c @@ -352,7 +352,7 @@ void EnWiz_Init(Actor* thisx, PlayState* play) { } if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -1183,7 +1183,7 @@ void EnWiz_Dead(EnWiz* this, PlayState* play) { if (this->alpha < 30) { EnWiz_SelectPlatform(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_EXTINCT); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); } diff --git a/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c b/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c index ce13687a7..634e83efb 100644 --- a/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c +++ b/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c @@ -80,7 +80,7 @@ void EnWizBrock_UpdateStatus(EnWizBrock* this, PlayState* play) { (BREG(56) / 1000.0f) + 0.002f); this->dyna.actor.scale.z = this->dyna.actor.scale.x; if (this->dyna.actor.scale.y < 0.001f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } } diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c index ca3fde745..543865e0b 100644 --- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c +++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c @@ -330,7 +330,7 @@ void EnWiz_SmallFlame(EnWizFire* this, PlayState* play) { Math_ApproachF(&this->scale, 2.0f * this->targetScale, 0.2f, 0.002f); Math_ApproachZeroF(&this->alpha, 1.0f, 35.0f); if ((this->timer == 0) && (this->alpha < 2.0f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } @@ -444,7 +444,7 @@ void EnWiz_Pool(EnWizFire* this, PlayState* play) { if ((this->poolScale < 0.001f) && (this->blendScaleFrac < 0.001f)) { sPoolHitByIceArrow = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; @@ -463,7 +463,7 @@ void EnWiz_Pool(EnWizFire* this, PlayState* play) { wiz->hasActiveProjectile = false; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -483,7 +483,7 @@ void EnWiz_KillMagicProjectile(EnWizFire* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 08295ad1e..59fc37ad3 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -312,7 +312,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play) { if (floorY > BGCHECK_Y_MIN) { this->actor.world.pos.y = floorY; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -374,7 +374,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { ((EnWood02*)thisx->parent)->unk_14A[index] = phi_v0; - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } this->unk_151 = 0; @@ -449,7 +449,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { thisx->shape.rot.z = Math_SinS(this->unk_146 * 0xBB8) * 16384.0f; this->unk_14A[0]--; if (this->unk_14A[0] == 0) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } } diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c index 11474f01e..486790dfd 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -122,7 +122,7 @@ void EnYb_Init(Actor* thisx, PlayState* play) { // check if already healed if (gSaveContext.save.weekEventReg[82] & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -250,7 +250,7 @@ void EnYb_Disappear(EnYb* this, PlayState* play) { if (this->alpha > 10) { this->alpha -= 10; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.c b/src/overlays/actors/ovl_En_Zob/z_en_zob.c index 1970e53df..710b82e4d 100644 --- a/src/overlays/actors/ovl_En_Zob/z_en_zob.c +++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.c @@ -121,7 +121,7 @@ void EnZob_Init(Actor* thisx, PlayState* play) { } if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -136,7 +136,7 @@ void EnZob_Init(Actor* thisx, PlayState* play) { default: if (gSaveContext.save.weekEventReg[55] & 0x80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.flags |= ACTOR_FLAG_10; break; diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c index 0ea1d448f..f572e8257 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -207,7 +207,7 @@ void EnZog_Init(Actor* thisx, PlayState* play) { if ((ENZOG_GET_F(&this->actor) != ENZOG_F_2) && (INV_CONTENT(ITEM_MASK_ZORA) == ITEM_MASK_ZORA) && ((play->csCtx.currentCsIndex != 2) || (gSaveContext.sceneLayer != 0) || (play->sceneId != SCENE_30GYOSON))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c index fba4baf7a..463f2117e 100644 --- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c +++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c @@ -98,14 +98,14 @@ void EnZoraegg_Init(Actor* thisx, PlayState* play) { switch (ENZORAEGG_GET_1F(&this->actor)) { case ENZORAEGG_1F_00: if (Flags_GetSwitch(play, ENZORAEGG_GET_FE00(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENZORAEGG_1F_11: if (func_80B319A8(play) >= 7) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); this->actor.home.rot.z = 1; return; } @@ -119,7 +119,7 @@ void EnZoraegg_Init(Actor* thisx, PlayState* play) { case ENZORAEGG_1F_08: case ENZORAEGG_1F_09: if (gSaveContext.save.weekEventReg[19] & 0x40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -132,7 +132,7 @@ void EnZoraegg_Init(Actor* thisx, PlayState* play) { case ENZORAEGG_1F_0F: case ENZORAEGG_1F_10: if (!(gSaveContext.save.weekEventReg[19] & 0x40)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -335,7 +335,7 @@ void func_80B32094(EnZoraegg* this, PlayState* play) { void func_80B320E0(EnZoraegg* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { Flags_SetSwitch(play, ENZORAEGG_GET_FE00(&this->actor)); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80B32094; Message_StartTextbox(play, 0x24B, &this->actor); @@ -406,7 +406,7 @@ void func_80B32390(EnZoraegg* this, PlayState* play) { if (temp_v0 != NULL) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, temp_v0); gSaveContext.eventInf[3] |= 8; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if ((func_80B319A8(play) >= 7) && (fabsf(player->actor.world.pos.x - this->actor.world.pos.x) < (100.0f * this->actor.scale.x)) && @@ -571,7 +571,7 @@ void func_80B32B3C(EnZoraegg* this, PlayState* play) { void func_80B32B70(EnZoraegg* this, PlayState* play) { func_80B31C40(this, play); if (Cutscene_CheckActorAction(play, 0x1C9)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -584,7 +584,7 @@ void func_80B32BB8(EnZoraegg* this, PlayState* play) { } if (Cutscene_CheckActorAction(play, 0x1C9)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.c b/src/overlays/actors/ovl_En_Zos/z_en_zos.c index 11fcc2595..2a2f23bb0 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.c +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.c @@ -101,7 +101,7 @@ void EnZos_Init(Actor* thisx, PlayState* play) { switch (ENZOS_GET_F(&this->actor)) { case ENZOS_F_1: if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (gSaveContext.save.weekEventReg[78] & 1) { @@ -121,7 +121,7 @@ void EnZos_Init(Actor* thisx, PlayState* play) { default: if (gSaveContext.save.weekEventReg[55] & 0x80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.flags |= ACTOR_FLAG_10; break; diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c index 1519a3774..db054d1f8 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -186,14 +186,14 @@ void EnZot_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.cylRadius = 0; this->actor.shape.yOffset = -1400.0f; if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; case 18: this->actionFunc = func_80B99384; if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; @@ -221,7 +221,7 @@ void EnZot_Init(Actor* thisx, PlayState* play2) { } if ((ENZOT_GET_1F(thisx) >= 2) && (ENZOT_GET_1F(thisx) < 11) && (gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Zov/z_en_zov.c b/src/overlays/actors/ovl_En_Zov/z_en_zov.c index 05726ddce..ee7f4cf05 100644 --- a/src/overlays/actors/ovl_En_Zov/z_en_zov.c +++ b/src/overlays/actors/ovl_En_Zov/z_en_zov.c @@ -108,7 +108,7 @@ void EnZov_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BD1F1C; func_80BD1570(this, 9, ANIMMODE_LOOP); if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); return; } break; @@ -121,7 +121,7 @@ void EnZov_Init(Actor* thisx, PlayState* play) { default: this->unk_320 |= 2; if ((gSaveContext.save.weekEventReg[55] & 0x80) || (gSaveContext.save.weekEventReg[53] & 0x20)) { - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); } break; } diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index ac8592615..afaec4463 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -41,7 +41,7 @@ void ItemBHeart_Init(Actor* thisx, PlayState* play) { ItemBHeart* this = THIS; if (Flags_GetCollectible(play, 0x1F)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -68,10 +68,11 @@ void ItemBHeart_Update(Actor* thisx, PlayState* play) { if (!(this->unk_168 < 0.5f)) { if (Actor_HasParent(&this->actor, play)) { Flags_SetCollectible(play, 0x1F); - Actor_MarkForDeath(&this->actor); - } else { - Actor_PickUp(&this->actor, play, GI_HEART_CONTAINER, 30.0f, 80.0f); + Actor_Kill(&this->actor); + return; } + + Actor_PickUp(&this->actor, play, GI_HEART_CONTAINER, 30.0f, 80.0f); } } diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 0bd1fd30c..140599f61 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -102,15 +102,16 @@ void ItemEtcetera_WaitForObject(ItemEtcetera* this, PlayState* play) { void func_8092009C(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - Actor_MarkForDeath(&this->actor); - } else { - Actor_PickUp(&this->actor, play, this->getItemId, 30.0f, 50.0f); + Actor_Kill(&this->actor); + return; } + + Actor_PickUp(&this->actor, play, this->getItemId, 30.0f, 50.0f); } void func_809200F8(ItemEtcetera* this, PlayState* play) { if (Flags_GetTreasure(play, ITEMETCETERA_GET_TREASUREFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index 1f3fae3ac..d6e976416 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -41,7 +41,7 @@ void ItemInbox_Destroy(Actor* thisx, PlayState* play) { void ItemInbox_Idle(ItemInbox* this, PlayState* play) { if (Flags_GetTreasure(play, (this->actor.params >> 8) & 0x1F)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index dad2ccbc3..92a54e6b0 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -296,7 +296,7 @@ void MirRay_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); if (MIRRAY_LOCATION(&this->actor) >= MIRRAY_MAX) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->sourcePt.x = dataEntry->sourcePoint.x; diff --git a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c index f0049800d..5ae0b4ae2 100644 --- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c +++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c @@ -184,10 +184,10 @@ void func_80ACBC8C(ObjAqua* this, PlayState* play) { } else { func_80ACB6A0(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 0x28, NA_SE_EV_BOMB_DROP_WATER); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->counter <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -207,7 +207,7 @@ void func_80ACBD48(ObjAqua* this, PlayState* play) { if (this->actor.shape.shadowAlpha > 2) { this->actor.shape.shadowAlpha -= 2; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -232,7 +232,7 @@ void func_80ACBDFC(ObjAqua* this, PlayState* play) { (Rand_ZeroOne() * 0.1f) + 0.03f); } if (this->counter <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index c13fde9b0..9904c6bee 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -378,11 +378,12 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { this->dyna.actor.flags |= ACTOR_FLAG_10; func_80937C10(this); if (!func_80936D58(this, play)) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - func_800BC154(play, &play->actorCtx, &this->dyna.actor, 7); - func_80937DD8(this); + Actor_Kill(&this->dyna.actor); + return; } + + func_800BC154(play, &play->actorCtx, &this->dyna.actor, 7); + func_80937DD8(this); } else { s32 params2 = OBJBEAN_GET_3F00(&this->dyna.actor); Path* path = &play->setupPathList[params2]; @@ -509,7 +510,7 @@ void func_80937DEC(ObjBean* this, PlayState* play) { } if (this->unk_1FF && Flags_GetSwitch(play, OBJBEAN_GET_3F80(&this->dyna.actor, 1))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -714,8 +715,11 @@ void func_80938670(ObjBean* this) { void func_8093868C(ObjBean* this, PlayState* play) { if (this->unk_1B2 <= 0) { - Actor_MarkForDeath(&this->dyna.actor); - } else if (this->unk_1B2 <= 20) { + Actor_Kill(&this->dyna.actor); + return; + } + + if (this->unk_1B2 <= 20) { this->dyna.actor.scale.x *= 0.89f; this->dyna.actor.scale.y *= 0.89f; this->dyna.actor.scale.z *= 0.89f; diff --git a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c index 7f59fe579..e44a4ffde 100644 --- a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c +++ b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c @@ -126,7 +126,7 @@ void ObjBigicicle_Init(Actor* thisx, PlayState* play) { this->collider2.dim.yShift = this->collider2.dim.yShift * sp30; if (Flags_GetSwitch(play, this->actor.params)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -285,7 +285,7 @@ void func_80AE939C(ObjBigicicle* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_GLASSBROKEN_IMPACT); ActorCutscene_Stop(this->actor.cutscene); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void ObjBigicicle_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index 9c35b0298..98604578a 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -33,7 +33,7 @@ void ObjBlockstop_Init(Actor* thisx, PlayState* play) { ObjBlockstop* this = THIS; if (Flags_GetSwitch(play, this->actor.params)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actionFunc = ObjBlockstop_CheckForBlock; } @@ -62,7 +62,7 @@ void ObjBlockstop_TryPlayCutscene(ObjBlockstop* this, PlayState* play) { if (ActorCutscene_GetLength(this->actor.cutscene) != -1) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } ActorCutscene_SetIntentToPlay(this->actor.cutscene); diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 27f3e13aa..99200987c 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -183,7 +183,7 @@ void ObjBombiwa_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, OBJBOMBIWA_GET_7F(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -350,7 +350,7 @@ void func_80939EF4(ObjBombiwa* this, PlayState* play) { if (params == OBJBOMBIWA_100_0) { func_80939794(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { func_80939994(play, &this->actor.world.pos); this->actor.flags |= ACTOR_FLAG_10; @@ -439,7 +439,7 @@ void func_8093A1F0(ObjBombiwa* this, PlayState* play) { this->unk_201--; if ((this->unk_200 >= 4) || (this->unk_201 <= 0)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c index d387436be..6f909e770 100644 --- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c +++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c @@ -83,7 +83,7 @@ void ObjChan_Init(Actor* thisx, PlayState* play) { if (OBJCHAN_SUBTYPE(&this->actor) == OBJCHAN_SUBTYPE_CHANDELIER) { if (sObjChanLoaded) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.room = -1; @@ -169,7 +169,7 @@ void ObjChan_InitChandelier(ObjChan* this2, PlayState* play) { true, &sp90)) { this->unk1CC = this->actor.world.pos.y - this->unk1C0.y; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -184,7 +184,7 @@ void ObjChan_InitChandelier(ObjChan* this2, PlayState* play) { temp_v0->myPotIndex = i; temp_v0->actor.cutscene = this->actor.cutscene; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -317,7 +317,7 @@ void ObjChan_PotAction(ObjChan* this, PlayState* play) { this->actor.cutscene, this->actor.unk20, NULL); } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index ef1feb1a9..e290a108c 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -335,7 +335,7 @@ void ObjComb_Init(Actor* thisx, PlayState* play) { Collider_InitJntSph(play, &this->collider); if ((sp2C == 1) && OBJCOMB_GET_10(&this->actor) && (gSaveContext.save.weekEventReg[83] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -383,7 +383,7 @@ void func_8098DC60(ObjComb* this, PlayState* play) { if (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x0182C29C) { func_8098CEAC(this, play); func_8098DA74(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { s32 dmgFlags = this->collider.elements->info.acHitInfo->toucher.dmgFlags; @@ -489,7 +489,7 @@ void func_8098E098(ObjComb* this) { void func_8098E0B8(ObjComb* this, PlayState* play) { this->unk_1B4--; if (this->unk_1B4 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c index be3f365e3..27440cf62 100644 --- a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c +++ b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c @@ -57,23 +57,24 @@ void ObjDanpeilift_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 1); DynaPolyActor_LoadMesh(play, &this->dyna, &object_obj_danpeilift_Colheader_000BA0); if (this->dyna.bgId == BG_ACTOR_MAX) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); + return; + } + + this->speed = OBJDANPEILIFT_GET_SPEED(thisx); + if (this->speed < 0.0f) { + this->speed = -this->speed; + } + if (this->speed < 0.01f) { + this->actionFunc = ObjDanpeilift_DoNothing; } else { - this->speed = OBJDANPEILIFT_GET_SPEED(thisx); - if (this->speed < 0.0f) { - this->speed = -this->speed; - } - if (this->speed < 0.01f) { - this->actionFunc = ObjDanpeilift_DoNothing; - } else { - path = &play->setupPathList[OBJDANPEILIFT_GET_PATH(thisx)]; - this->curPoint = OBJDANPEILIFT_GET_STARTING_POINT(thisx); - this->endPoint = path->count - 1; - this->direction = 1; - this->points = Lib_SegmentedToVirtual(path->points); - ObjDanpeilift_UpdatePosition(this, this->curPoint); - this->actionFunc = ObjDanpeilift_Move; - } + path = &play->setupPathList[OBJDANPEILIFT_GET_PATH(thisx)]; + this->curPoint = OBJDANPEILIFT_GET_STARTING_POINT(thisx); + this->endPoint = path->count - 1; + this->direction = 1; + this->points = Lib_SegmentedToVirtual(path->points); + ObjDanpeilift_UpdatePosition(this, this->curPoint); + this->actionFunc = ObjDanpeilift_Move; } } diff --git a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c index 6cc8e2d04..4a648b7f8 100644 --- a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c +++ b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c @@ -34,7 +34,7 @@ void ObjDemo_Init(Actor* thisx, PlayState* play) { thisx->params = OBJDEMO_GET_FF(thisx); if ((thisx->params != OBJDEMO_FF_FF) && (Flags_GetSwitch(play, thisx->params))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (thisx->shape.rot.x < 0) { @@ -96,7 +96,7 @@ void func_80983704(ObjDemo* this, PlayState* play) { if (this->actor.params != 0xFF) { Flags_SetSwitch(play, this->actor.params); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { ActorCutscene_SetIntentToPlay(this->actor.cutscene); @@ -109,7 +109,7 @@ void ObjDemo_Update(Actor* thisx, PlayState* play) { ObjDemo* this = THIS; if ((this->actor.params != 0xFF) && Flags_GetSwitch(play, this->actor.params)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c index 4c8f38350..f14dd615a 100644 --- a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c +++ b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c @@ -32,7 +32,7 @@ void ObjDinner_Init(Actor* thisx, PlayState* play) { ObjDinner* this = THIS; if (gSaveContext.save.isNight != true || (CURRENT_DAY == 3 && gSaveContext.save.weekEventReg[22] & 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_SetScale(&this->actor, 0.1f); } diff --git a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c index 0c0177d2f..3ba7ea655 100644 --- a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c +++ b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c @@ -46,7 +46,7 @@ s32 ObjDowsing_GetFlag(ObjDowsing* this, PlayState* play) { s32 ObjDowsing_CheckValidSpawn(ObjDowsing* this, PlayState* play) { if (ObjDowsing_GetFlag(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c index c4ebe8063..e31c71ba0 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -464,7 +464,7 @@ void func_80A1C838(ObjFlowerpot* this, PlayState* play) { } func_80A1BD80(this, play); func_80A1B994(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) && (this->collider.elements[0].info.acHitInfo->toucher.dmgFlags & 0x058BFFBC)) { if (!(this->unk_1EA & 2)) { @@ -475,7 +475,7 @@ void func_80A1C838(ObjFlowerpot* this, PlayState* play) { } func_80A1BA44(this, play); func_80A1B994(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { if (this->collider.elements[1].info.bumperFlags & BUMP_HIT) { if (!(this->unk_1EA & 2)) { @@ -610,7 +610,7 @@ void func_80A1CEF4(ObjFlowerpot* this2, PlayState* play) { } func_80A1BA44(this, play); func_80A1B994(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -624,7 +624,7 @@ void func_80A1CEF4(ObjFlowerpot* this2, PlayState* play) { func_80A1BD80(this, play); func_80A1B994(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c index 343a8f61e..a9a10f755 100644 --- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c +++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c @@ -159,7 +159,7 @@ void ObjGhaka_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x4); if (this->dyna.actor.floorPoly == 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } if (gSaveContext.save.weekEventReg[20] & 0x20) { func_80B3C2C4(this, play); diff --git a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c index 11c8619ce..65008c74a 100644 --- a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c +++ b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c @@ -347,7 +347,7 @@ void ObjGrassCarry_Update(Actor* thisx, PlayState* play) { if (this->unk_190 == NULL) { if ((this->actionFunc != func_809AB610) && (this->actionFunc != func_809AB77C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c index 8e5a6d4a0..87c62c5d5 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c @@ -120,13 +120,13 @@ void ObjHakaisi_Init(Actor* thisx, PlayState* play) { } if ((this->switchFlag != -1) && Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); if (this->dyna.actor.floorPoly == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } func_800C0094(this->dyna.actor.floorPoly, this->dyna.actor.world.pos.x, this->dyna.actor.floorHeight, @@ -406,7 +406,7 @@ void func_80B15330(ObjHakaisi* this, PlayState* play) { if (this->dyna.actor.bgCheckFlags & 2) { func_80B14B6C(this, play, this->dyna.actor.world.pos, 40); func_80B14CF8(play, this->dyna.actor.world.pos, 100, 30, 10); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } Matrix_RotateAxisS(this->unk_19C, &this->unk_184, MTXMODE_NEW); diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 11baddb38..6c90d670c 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -181,7 +181,7 @@ void ObjHamishi_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 2.3f); if (Flags_GetSwitch(play, OBJHAMISHI_GET_SWITCHFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -233,7 +233,7 @@ void ObjHamishi_Update(Actor* thisx, PlayState* play) { func_809A10F4(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Flags_SetSwitch(play, OBJHAMISHI_GET_SWITCHFLAG(&this->actor)); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c index 3ad2cf5e8..dedea2353 100644 --- a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c +++ b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c @@ -341,7 +341,7 @@ void ObjHugebombiwa_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, ENHUGEBOMBIWA_GET_7F(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -524,7 +524,7 @@ void func_80A55064(ObjHugebombiwa* this, PlayState* play) { this->unk_4B2--; if ((this->unk_4B0 >= 20) || (this->unk_4B2 <= 0)) { ActorCutscene_Stop(this->actor.cutscene); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -620,7 +620,7 @@ void func_80A55564(ObjHugebombiwa* this, PlayState* play) { this->unk_4B2--; if ((this->unk_4B0 >= 20) || (this->unk_4B2 <= 0)) { ActorCutscene_Stop(this->actor.cutscene); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c index 384d1cbad..dc4ebb7ef 100644 --- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c +++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c @@ -239,7 +239,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) { this->dyna.actor.shape.rot.z = 0; this->dyna.actor.room = -1; } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } break; @@ -253,7 +253,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) { this->dyna.actor.shape.rot.z = 0; this->dyna.actor.room = -1; } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } break; @@ -269,7 +269,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) { this->dyna.actor.room = -1; this->actionFunc = func_80B9D714; // clang-format on } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } break; @@ -431,7 +431,7 @@ void func_80B9D120(ObjHunsui* this, PlayState* play) { D_80B9DED8.unk_02 = 0; break; } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -536,7 +536,7 @@ void func_80B9D508(ObjHunsui* this, PlayState* play) { D_80B9DED8.unk_02 = 0; break; } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -574,7 +574,7 @@ void func_80B9D714(ObjHunsui* this, PlayState* play) { if ((this->unk_16C != play->roomCtx.curRoom.num) && (this->unk_16C != play->roomCtx.prevRoom.num) && (this->unk_16D != play->roomCtx.curRoom.num) && (this->unk_16D != play->roomCtx.prevRoom.num)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else { if (Flags_GetSwitch(play, this->unk_168)) { this->unk_172 &= ~2; diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 2ba1e4352..69e542c6b 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -117,7 +117,7 @@ void ObjIcePoly_Init(Actor* thisx, PlayState* play) { if (((this->unk_149 != OBJICEPOLY_FF_FF) && Flags_GetSwitch(play, this->unk_149)) || ((play->sceneId == SCENE_KAJIYA) && (gSaveContext.save.weekEventReg[33] & 0x80))) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } @@ -269,12 +269,13 @@ void func_80931E58(ObjIcePoly* this, PlayState* play) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); if (this->unk_14A == 1) { func_80931828(this, play); - Actor_MarkForDeath(&this->actor); - } else { - this->unk_14A = 40; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT); - this->actionFunc = func_80931EEC; + Actor_Kill(&this->actor); + return; } + + this->unk_14A = 40; + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT); + this->actionFunc = func_80931EEC; } else { ActorCutscene_SetIntentToPlay(this->actor.cutscene); } @@ -330,7 +331,7 @@ void func_80931EEC(ObjIcePoly* this, PlayState* play) { if (this->unk_149 != OBJICEPOLY_FF_FF) { Flags_SetSwitch(play, this->unk_149); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c index b01f22ae6..9e351dc23 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -1410,7 +1410,7 @@ void func_80A266E0(ObjIceblock* this, PlayState* play) { func_80A2508C(this, play); if (sp20) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c index 57e0f4b2e..5d28d1790 100644 --- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c +++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c @@ -42,7 +42,7 @@ void ObjJgGakki_Init(Actor* thisx, PlayState* play2) { } else if ((play->sceneId == SCENE_17SETUGEN) || (play->sceneId == SCENE_10YUKIYAMANOMURA)) { Animation_Change(&this->skelAnime, &gGoronElderDrumTakeOutAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_SetScale(&this->actor, 0.01f); } diff --git a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c index 28c10781d..37221acca 100644 --- a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c +++ b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c @@ -41,7 +41,7 @@ void ObjKepnKoya_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); DynaPolyActor_LoadMesh(play, &this->dyna, &object_kepn_koya_Colheader_00805C); if (this->dyna.bgId == BG_ACTOR_MAX) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 9bd2e0442..b95130ff8 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -151,7 +151,7 @@ void ObjKibako_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->bankIndex = Object_GetIndex(&play->objectCtx, sObjectIdList[whichBankIndex]); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk199 = this->actor.room; @@ -284,12 +284,12 @@ void ObjKibako_Idle(ObjKibako* this, PlayState* play) { ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (this->collider.base.acFlags & AC_HIT) { ObjKibako_AirBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Actor_MoveWithGravity(&this->actor); func_809262BC(this); @@ -388,14 +388,14 @@ void ObjKibako_Thrown(ObjKibako* this, PlayState* play) { ObjKibako_AirBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { if (this->actor.bgCheckFlags & 0x40) { ObjKibako_WaterBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { if (this->actor.velocity.y < -0.05f) { this->actor.gravity = -2.3f; diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index d32e7a2cd..aff712f40 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -221,7 +221,7 @@ void ObjKibako2_Idle(ObjKibako2* this, PlayState* play) { void ObjKibako2_Kill(ObjKibako2* this, PlayState* play) { ObjKibako2_SpawnContents(this, play); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } void ObjKibako2_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c index 24597e4aa..6ff98b96e 100644 --- a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c +++ b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c @@ -49,7 +49,7 @@ void ObjKinoko_Update(Actor* thisx, PlayState* play) { thisx->flags |= ACTOR_FLAG_1; if (Actor_HasParent(thisx, play)) { Flags_SetCollectible(play, OBJ_KINOKO_GET_FLAG(thisx)); - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } Actor_PickUp(thisx, play, GI_MAX, 20.0f, 10.0f); diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 4668bfffd..efe79c7ad 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -102,14 +102,15 @@ void ObjLift_Init(Actor* thisx, PlayState* play) { this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z; DynaPolyActor_Init(&this->dyna, 1); if ((this->unk_178 <= 0) && (Flags_GetSwitch(play, OBJLIFT_GET_7F(&this->dyna.actor)))) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - DynaPolyActor_LoadMesh(play, &this->dyna, &gDampeGraveBrownElevatorCol); - this->unk_160 = Rand_Next() >> 0x10; - this->unk_162 = Rand_Next() >> 0x10; - this->unk_164 = Rand_Next() >> 0x10; - func_8093D760(this); + Actor_Kill(&this->dyna.actor); + return; } + + DynaPolyActor_LoadMesh(play, &this->dyna, &gDampeGraveBrownElevatorCol); + this->unk_160 = Rand_Next() >> 0x10; + this->unk_162 = Rand_Next() >> 0x10; + this->unk_164 = Rand_Next() >> 0x10; + func_8093D760(this); } void ObjLift_Destroy(Actor* thisx, PlayState* play) { @@ -196,7 +197,7 @@ void func_8093DA48(ObjLift* this, PlayState* play) { func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId); } else { Flags_SetSwitch(play, OBJLIFT_GET_7F(&this->dyna.actor)); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } } diff --git a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c index 6884526ee..6fe341dcc 100644 --- a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c +++ b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c @@ -93,17 +93,18 @@ void ObjLightblock_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, LIGHTBLOCK_DESTROYED(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - DynaPolyActor_LoadMesh(play, &this->dyna, &object_lightblock_Colheader_000B80); - Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); - Collider_UpdateCylinder(&this->dyna.actor, &this->collider); - this->collider.dim.radius = typeVars->radius; - this->collider.dim.height = typeVars->height; - this->collider.dim.yShift = typeVars->yShift; - this->alpha = 255; - func_80AF3AC8(this); + Actor_Kill(&this->dyna.actor); + return; } + + DynaPolyActor_LoadMesh(play, &this->dyna, &object_lightblock_Colheader_000B80); + Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + this->collider.dim.radius = typeVars->radius; + this->collider.dim.height = typeVars->height; + this->collider.dim.yShift = typeVars->yShift; + this->alpha = 255; + func_80AF3AC8(this); } void ObjLightblock_Destroy(Actor* thisx, PlayState* play) { @@ -167,8 +168,11 @@ void func_80AF3C34(ObjLightblock* this, PlayState* play) { if (this->timer <= 0) { temp_a0 = this->dyna.actor.cutscene; ActorCutscene_Stop(temp_a0); - Actor_MarkForDeath(&this->dyna.actor); - } else if (this->timer <= 60) { + Actor_Kill(&this->dyna.actor); + return; + } + + if (this->timer <= 60) { if (this->alpha > 40) { this->alpha -= 40; } else { diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index dafd9bc2c..7272f62c0 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -173,7 +173,7 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) { } if (isTriggered) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -315,10 +315,11 @@ void ObjLightSwitch_Fade(ObjLightswitch* this, PlayState* play) { this->colorAlpha -= 200; ObjLightswitch_SpawnEffects(this, play); // spawn burning fire effect if (this->colorAlpha < 0) { - Actor_MarkForDeath(&this->actor); - } else { - func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); // "burn into ashes" + Actor_Kill(&this->actor); + return; } + + func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); // "burn into ashes" } void ObjLightswitch_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index 90aa5fa40..5adfb7aa6 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -54,7 +54,7 @@ void ObjMakekinsuta_Init(Actor* thisx, PlayState* play) { this->unk144 = -1; } if (Flags_GetSwitch(play, OBJMAKEKINSUTA_GET_SWITCH_FLAGS(thisx))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index b5f9d67b2..05fa6b394 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -68,7 +68,7 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play) { childPoint = &this->pathPoints[childPointIndex]; if (Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_OBJ_OSHIHIKI, childPoint->x, childPoint->y, childPoint->z, 0, 0, 0, 0xFFF1) == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c index e1b1bc1b9..9e3ac57d6 100644 --- a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c +++ b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c @@ -76,7 +76,7 @@ void ObjMilkBin_Update(Actor* thisx, PlayState* play2) { if (this->type == OBJ_MILK_BIN_TYPE_1) { if (gSaveContext.save.weekEventReg[22] & 1) { if (((gSaveContext.save.day == 2) && (gSaveContext.save.isNight == 1)) || (gSaveContext.save.day >= 3)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c index 31ba1fa63..5d1931c1c 100644 --- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c +++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c @@ -57,7 +57,7 @@ void ObjMoonStone_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; func_80C0673C(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -129,7 +129,7 @@ void func_80C0685C(ObjMoonStone* this) { void func_80C06870(ObjMoonStone* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { gSaveContext.save.weekEventReg[74] |= 0x40; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c index 3b1b72f2f..52f3dd4e9 100644 --- a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c +++ b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c @@ -41,7 +41,7 @@ void ObjMuPict_Init(Actor* thisx, PlayState* play) { ObjMuPict* this = THIS; if (!(gSaveContext.save.weekEventReg[75] & 0x20) && !(gSaveContext.save.weekEventReg[52] & 0x20)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_80C06D90(this, play); diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 9a8072edd..0297b7da4 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -96,15 +96,15 @@ void ObjMure_Init(Actor* thisx, PlayState* play) { this->svNum = OBJ_MURE_GET_SVNUM(&this->actor); this->type = OBJ_MURE_GET_TYPE(&this->actor); if (this->ptn >= 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->type >= OBJMURE_TYPE_MAX) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (!func_808D7928(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = ObjMure_InitialAction; @@ -207,7 +207,7 @@ void ObjMure_KillActorsImpl(ObjMure* this, PlayState* play) { break; case OBJMURE_CHILD_STATE_2: if (this->children[i] != NULL) { - Actor_MarkForDeath(this->children[i]); + Actor_Kill(this->children[i]); this->children[i] = NULL; } break; @@ -216,7 +216,7 @@ void ObjMure_KillActorsImpl(ObjMure* this, PlayState* play) { if (Actor_HasParent(this->children[i], play)) { this->children[i] = NULL; } else { - Actor_MarkForDeath(this->children[i]); + Actor_Kill(this->children[i]); this->children[i] = NULL; } } diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index edefba93a..e0322f61a 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -118,7 +118,7 @@ void func_8098F364(ObjMure3* this, s32 play) { if (((*collectible)->unk1A4 != 0) || ((*collectible)->actor.update == NULL)) { this->unk164 |= (1 << i); } else { - Actor_MarkForDeath(&(*collectible)->actor); + Actor_Kill(&(*collectible)->actor); } } *collectible = NULL; @@ -148,7 +148,7 @@ void ObjMure3_Init(Actor* thisx, PlayState* play) { ObjMure3* this = THIS; if (Flags_GetSwitch(play, OBJMURE3_PARAMS_7F(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Actor_ProcessInitChain(&this->actor, sInitChain); diff --git a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c index 7cc7add22..fddc5a9a9 100644 --- a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c +++ b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c @@ -96,7 +96,7 @@ void func_80BA2514(ObjNozoki* this, PlayState* play) { s32 sp24 = Object_GetIndex(&play->objectCtx, D_80BA34B8[this->unk_15C]); if (sp24 < 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -328,7 +328,7 @@ void func_80BA2C94(ObjNozoki* this, PlayState* play) { if (play->actorCtx.flags & ACTORCTX_FLAG_6) { if (sp34 <= 5.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } else if (!(play->actorCtx.flags & ACTORCTX_FLAG_5) && (GET_PLAYER(play)->actor.id == ACTOR_PLAYER) && Flags_GetSwitch(play, OBJNOZOKI_GET_SWITCHFLAG2(&this->dyna.actor)) && (sp38 < 20.0f)) { @@ -347,7 +347,7 @@ void func_80BA2C94(ObjNozoki* this, PlayState* play) { sp38 = this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y; if (sp38 >= 100.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } this->dyna.actor.shape.rot.x = -0x1F40 - (s16)(sp38 * 400.0f); diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 4bfb5ba96..d4d716e90 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -205,7 +205,7 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play) { case OBJOSHIHIKI_F_0: case OBJOSHIHIKI_F_1: case OBJOSHIHIKI_F_2: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } else { @@ -213,7 +213,7 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play) { case OBJOSHIHIKI_F_3: case OBJOSHIHIKI_F_4: case OBJOSHIHIKI_F_5: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } @@ -293,7 +293,7 @@ s32 ObjOshihiki_CheckFloor(ObjOshihiki* this, PlayState* play) { s32 ObjOshihiki_CheckGround(ObjOshihiki* this, PlayState* play) { if (this->dyna.actor.world.pos.y <= BGCHECK_Y_MIN + 10.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return false; } diff --git a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c index 6255b2cbe..e1ec0470c 100644 --- a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c +++ b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c @@ -135,11 +135,11 @@ void ObjPurify_Init(Actor* thisx, PlayState* play) { } this->objIndex = Object_GetIndex(&play->objectCtx, info->objectId); if (this->objIndex < 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else if (sp20 == 0) { func_80A84EAC(this); } else if (ObjPurify_IsPurified(this)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else { func_80A84EAC(this); } @@ -183,7 +183,7 @@ void func_80A84FA0(ObjPurify* this) { void func_80A84FB4(ObjPurify* this, PlayState* play) { if (ObjPurify_IsPurified(this)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 0ce2f38a1..64db63a58 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -69,7 +69,7 @@ void func_80973D3C(ObjRoomtimer* this, PlayState* play) { } else if ((this->actor.params != 0x1FF) && (gSaveContext.timerStates[TIMER_ID_MINIGAME_2] == TIMER_STATE_OFF)) { play_sound(NA_SE_OC_ABYSS); func_80169EFC(&play->state); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -80,10 +80,11 @@ void func_80973DE0(ObjRoomtimer* this, PlayState* play) { if (ActorCutscene_GetLength(this->actor.cutscene) != -1) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); } - Actor_MarkForDeath(&this->actor); - } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + Actor_Kill(&this->actor); + return; } + + ActorCutscene_SetIntentToPlay(this->actor.cutscene); } void ObjRoomtimer_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c index 72f452682..bbfc25a64 100644 --- a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c +++ b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c @@ -510,7 +510,7 @@ void ObjSnowball_Init(Actor* thisx, PlayState* play) { func_80B04338(this, play); if ((sp40 == 5) && Flags_GetSwitch(play, OBJSNOWBALL_GET_3F(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -621,7 +621,7 @@ void func_80B04648(ObjSnowball* this, PlayState* play) { if (this->actor.home.rot.y == 1) { func_80B04B48(this, play); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->unk_208 == 0x2D) { func_80B03688(this, play); @@ -725,7 +725,7 @@ void func_80B047C0(ObjSnowball* this, PlayState* play) { if (this->actor.home.rot.y == 1) { func_80B04B48(this, play); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { for (i = 0; i < ARRAY_COUNT(this->unk_1A8); i++) { diff --git a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c index 74fa8fd57..ec6bd9eda 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c @@ -365,7 +365,7 @@ void func_80B39C9C(ObjSnowball2* this, PlayState* play) { func_80B38E88(this, play); func_80B39108(this, play); func_80B39B5C(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } else { if (sp38 && (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 2)) { @@ -464,7 +464,7 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play) { func_80B38E88(this, play); func_80B39108(this, play); func_80B39B5C(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -570,7 +570,7 @@ void func_80B3A500(ObjSnowball2* this, PlayState* play) { } if (this->unk_1AC <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c index 05fe851a9..2a0a722a5 100644 --- a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c +++ b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c @@ -565,7 +565,7 @@ void ObjSpidertent_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); if (Flags_GetSwitch(play, OBJSPIDERTENT_GET_7F00(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -792,7 +792,7 @@ void func_80B30AF8(ObjSpidertent* this, PlayState* play) { } } else if (this->unk_3C1 <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c index c57db1111..f2333712f 100644 --- a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c +++ b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c @@ -500,7 +500,7 @@ void ObjSpinyroll_Init(Actor* thisx, PlayState* play) { ((sp34->x == sp30->x) && (sp34->y == sp30->y) && (sp34->z != sp30->z))) { this->unk_49C = false; } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c index c7aa4549d..b1baf8469 100644 --- a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c +++ b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c @@ -204,7 +204,7 @@ void ObjTaru_Init(Actor* thisx, PlayState* play) { if (OBJ_TARU_GET_80(thisx)) { if (Flags_GetSwitch(play, OBJ_TARU_GET_7F(thisx))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else { DynaPolyActor_LoadMesh(play, &this->dyna, &object_taru_Colheader_001CB0); } @@ -292,17 +292,18 @@ void func_80B9C07C(ObjTaru* this, PlayState* play) { void func_80B9C174(ObjTaru* this, PlayState* play) { func_80B9BD84(this, play); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } void func_80B9C1A0(ObjTaru* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); Flags_SetSwitch(play, OBJ_TARU_GET_7F(&this->dyna.actor)); - Actor_MarkForDeath(&this->dyna.actor); - } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + Actor_Kill(&this->dyna.actor); + return; } + + ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); } void ObjTaru_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c index a37f64b84..146c46428 100644 --- a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c +++ b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c @@ -132,13 +132,13 @@ void ObjToge_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (OBJTOGE_GET_PATH(thisx) == 0xFF) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } path = &play->setupPathList[OBJTOGE_GET_PATH(thisx)]; if (path->count != 2) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index eccc9c2c3..1f1c9c4a3 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -190,20 +190,21 @@ void ObjTsubo_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->objBankIndex = Object_GetIndex(&play->objectCtx, sPotTypeData[type].objId); if (this->objBankIndex < 0) { - Actor_MarkForDeath(&this->actor); - } else { - this->actor.shape.shadowScale = 1.8f; - this->homeRoom = this->actor.room; - if ((type != OBJ_TSUBO_TYPE_3) && (sp2C != 2)) { - if (Item_CanDropBigFairy(play, OBJ_TSUBO_P003F(&this->actor), OBJ_TSUBO_PFE00(&this->actor))) { - this->unk_198 = true; - } - } - if ((type == OBJ_TSUBO_TYPE_3) || (sp2C != 2) || !func_809275C0(this, play)) { - this->unk_19A = -1; - } - func_80928914(this); + Actor_Kill(&this->actor); + return; } + + this->actor.shape.shadowScale = 1.8f; + this->homeRoom = this->actor.room; + if ((type != OBJ_TSUBO_TYPE_3) && (sp2C != 2)) { + if (Item_CanDropBigFairy(play, OBJ_TSUBO_P003F(&this->actor), OBJ_TSUBO_PFE00(&this->actor))) { + this->unk_198 = true; + } + } + if ((type == OBJ_TSUBO_TYPE_3) || (sp2C != 2) || !func_809275C0(this, play)) { + this->unk_19A = -1; + } + func_80928914(this); } void ObjTsubo_Destroy(Actor* thisx, PlayState* play2) { @@ -485,7 +486,7 @@ void func_809289E4(ObjTsubo* this, PlayState* play) { func_80927818(this, play, 1); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); if (ObjTsubo_IsSceneNotGohtOrTwinmold(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { func_809291DC(this); } @@ -576,10 +577,11 @@ void func_80928F18(ObjTsubo* this, PlayState* play) { } SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); if (ObjTsubo_IsSceneNotGohtOrTwinmold(this, play)) { - Actor_MarkForDeath(&this->actor); - } else { - func_809291DC(this); + Actor_Kill(&this->actor); + return; } + + func_809291DC(this); } else if (this->actor.bgCheckFlags & 0x40) { typeData->breakPot2(this, play); if (type == OBJ_TSUBO_TYPE_3) { @@ -590,10 +592,11 @@ void func_80928F18(ObjTsubo* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); if (ObjTsubo_IsSceneNotGohtOrTwinmold(this, play)) { - Actor_MarkForDeath(&this->actor); - } else { - func_809291DC(this); + Actor_Kill(&this->actor); + return; } + + func_809291DC(this); } else { Actor_MoveWithGravity(&this->actor); Math_StepToS(&D_80929504, D_80929500, 150); diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c index 63fe32501..ce2dd0aba 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -684,7 +684,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { // if (!AliensDefeated) if (!(gSaveContext.save.weekEventReg[22] & 1)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -705,7 +705,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { if ((gSaveContext.save.weekEventReg[34] & 0x80) || gSaveContext.save.time >= CLOCK_TIME(19, 0) || gSaveContext.save.time <= CLOCK_TIME(6, 0) || (gSaveContext.save.weekEventReg[52] & 1) || (gSaveContext.save.weekEventReg[52] & 2)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -715,7 +715,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { } } else if (this->type == OBJ_UM_TYPE_PRE_MILK_RUN) { if (!(gSaveContext.save.weekEventReg[31] & 0x80) || (gSaveContext.save.weekEventReg[52] & 1)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -729,7 +729,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { } } else if (this->type == OBJ_UM_TYPE_MILK_RUN_MINIGAME) { if (!(gSaveContext.save.weekEventReg[31] & 0x80)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -741,7 +741,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { ObjUm_RotatePlayer(this, play, 0); } else if (this->type == OBJ_UM_TYPE_POST_MILK_RUN) { if (!(gSaveContext.save.weekEventReg[52] & 1) || (gSaveContext.save.weekEventReg[59] & 2)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -768,7 +768,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { } if (this->dyna.bgId == BGCHECK_SCENE) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -780,7 +780,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { this->dyna.actor.shape.rot.y, 0, ENHORSE_PARAMS(ENHORSE_PARAM_DONKEY, ENHORSE_18)); if (this->donkey == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -802,11 +802,11 @@ void ObjUm_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->banditsCollisions[1]); } -// ObjUm_MarkMyDonkeyAndMyselfForDeath, ObjUm_TerminateMe, ObjUmn't, ObjUm_Asinucide +// ObjUm_KillMyDonkeyAndMyself, ObjUm_TerminateMe, ObjUmn't, ObjUm_Asinucide void func_80B79524(ObjUm* this) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); if (this->donkey != NULL) { - Actor_MarkForDeath(&this->donkey->actor); + Actor_Kill(&this->donkey->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c index 33ebf1e50..69a878aea 100644 --- a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c +++ b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c @@ -88,7 +88,7 @@ s32 func_80C07CD0(void) { void func_80C07DC4(ObjUsiyane* this, PlayState* play) { if (func_80C07CD0()) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } @@ -166,7 +166,7 @@ void func_80C081C8(ObjUsiyane* this, PlayState* play) { } } else if (this->unk_740 >= 70) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } this->unk_740++; } @@ -213,7 +213,7 @@ void ObjUsiyane_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } } diff --git a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c index aea3bc7f1..c418f65af 100644 --- a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c +++ b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c @@ -41,9 +41,12 @@ void func_808A7954(ObjWturn* this) { void func_808A7968(ObjWturn* this, PlayState* play) { if (play->msgCtx.ocarinaMode >= 28 && play->msgCtx.ocarinaMode < 39) { Flags_UnsetSwitch(play, this->actor.params); - Actor_MarkForDeath(&this->actor); - } else if ((Flags_GetSwitch(play, this->actor.params) && (play->sceneId == SCENE_F40)) || - (!Flags_GetSwitch(play, this->actor.params) && (play->sceneId == SCENE_F41))) { + Actor_Kill(&this->actor); + return; + } + + if ((Flags_GetSwitch(play, this->actor.params) && (play->sceneId == SCENE_F40)) || + (!Flags_GetSwitch(play, this->actor.params) && (play->sceneId == SCENE_F41))) { func_808A7A24(this); } } diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 264167db5..e4a6a8627 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -125,7 +125,7 @@ void ObjectKankyo_Init(Actor* thisx, PlayState* play) { void ObjectKankyo_Destroy(Actor* thisx, PlayState* play) { ObjectKankyo* this = THIS; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_808DC18C(ObjectKankyo* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index 7eaf78c20..fe56ce03a 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -79,7 +79,7 @@ void OceffSpot_End(OceffSpot* this, PlayState* play) { if (this->unk16C > 0.0f) { this->unk16C -= 0.05f; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if ((REG(15) != 0x190) && (play->msgCtx.unk12046 == 0)) { if ((play->msgCtx.ocarinaAction != 0x39) || (play->msgCtx.ocarinaMode != 0xA)) { gSaveContext.sunsSongState = SUNSSONG_START; diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 3a4faceea..eff8a7dcc 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -150,7 +150,7 @@ void OceffStorm_DefaultAction(OceffStorm* this, PlayState* play) { if (this->counter < 70) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index ef1fa1035..ba71cc267 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -51,7 +51,7 @@ void OceffWipe_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index 54672f173..0c93d51a8 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -53,7 +53,7 @@ void OceffWipe2_Update(Actor* thisx, PlayState* play) { if (this->timer < 100) { this->timer++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 4837f6949..c7c9249a7 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -54,7 +54,7 @@ void OceffWipe3_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 18fecfe71..9c7b8853b 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -53,7 +53,7 @@ void OceffWipe4_Update(Actor* thisx, PlayState* play) { if (this->counter < 50) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c index 951ba1c39..16053e92e 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c +++ b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c @@ -51,7 +51,7 @@ void OceffWipe5_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c b/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c index 97c688434..c5d536116 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c +++ b/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c @@ -49,7 +49,7 @@ void OceffWipe6_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c index abd01e1ff..c129fe168 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c +++ b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c @@ -53,7 +53,7 @@ void OceffWipe7_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index 1aa2e545e..fa0121fe6 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -98,7 +98,7 @@ void ShotSun_SpawnFairy(ShotSun* this, PlayState* play2) { } Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 0, 0, 0, fairyType); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -164,8 +164,11 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); - } else if (!(this->actor.xzDistToPlayer > 120.0f)) { + Actor_Kill(&this->actor); + return; + } + + if (!(this->actor.xzDistToPlayer > 120.0f)) { if ((gSaveContext.save.time >= CLOCK_TIME(6, 30)) && (gSaveContext.save.time < CLOCK_TIME(7, 30))) { cylinderPos.x = player->bodyPartsPos[7].x + (play->envCtx.unk_4 * (1.0f / 6.0f)); cylinderPos.y = (player->bodyPartsPos[7].y - 30.0f) + (play->envCtx.unk_8 * (1.0f / 6.0f)); diff --git a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c index c79697e97..f54fb4973 100644 --- a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c +++ b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c @@ -84,7 +84,7 @@ void TGSw_ActionExecuteOneShot(TGSw* this, PlayState* play) { actor = actor->next; } while (actor != NULL); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void TGSw_Init(Actor* thisx, PlayState* play) { diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index b77506370..b199ada05 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -703,7 +703,7 @@ 0x800B6584:("func_800B6584",), 0x800B6608:("func_800B6608",), 0x800B6680:("func_800B6680",), - 0x800B670C:("Actor_MarkForDeath",), + 0x800B670C:("Actor_Kill",), 0x800B672C:("Actor_SetWorldToHome",), 0x800B675C:("Actor_SetFocus",), 0x800B67A0:("Actor_SetWorldRotToShape",), @@ -13136,8 +13136,8 @@ 0x80B1861C:("EnSnowman_Dead",), 0x80B18908:("EnSnowman_SetupSplitDoNothing",), 0x80B189C4:("EnSnowman_SplitDoNothing",), - 0x80B189D4:("EnSnowman_SetupMarkForDeath",), - 0x80B18A04:("EnSnowman_MarkForDeath",), + 0x80B189D4:("EnSnowman_SetupKill",), + 0x80B18A04:("EnSnowman_Kill",), 0x80B18A28:("EnSnowman_CreateSplitEeno",), 0x80B18B30:("EnSnowman_AbsorbEeno",), 0x80B18BB4:("EnSnowman_SetupCombine",), diff --git a/tools/namefixer.py b/tools/namefixer.py index 1aed5ead3..aba4a5aa4 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -114,6 +114,7 @@ wordReplace = { "Actor_IsActorFacingActorAndWithinRange": "Actor_ActorAIsFacingAndNearActorB", "Actor_IsActorFacingActor": "Actor_ActorAIsFacingActorB", "Actor_IsActorFacedByActor": "Actor_ActorBIsFacingActorA", + "Actor_MarkForDeath": "Actor_Kill", "func_800B84D0": "Actor_ProcessTalkRequest", "func_8017D668": "Math3D_PointDistToLine2D", "func_800BDFC0": "Gfx_DrawDListOpa", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index f1d994d11..a2d2354ff 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -217,7 +217,7 @@ asm/non_matchings/code/z_actor/func_800B64FC.s,func_800B64FC,0x800B64FC,0x22 asm/non_matchings/code/z_actor/func_800B6584.s,func_800B6584,0x800B6584,0x21 asm/non_matchings/code/z_actor/func_800B6608.s,func_800B6608,0x800B6608,0x1E asm/non_matchings/code/z_actor/func_800B6680.s,func_800B6680,0x800B6680,0x23 -asm/non_matchings/code/z_actor/Actor_MarkForDeath.s,Actor_MarkForDeath,0x800B670C,0x8 +asm/non_matchings/code/z_actor/Actor_Kill.s,Actor_Kill,0x800B670C,0x8 asm/non_matchings/code/z_actor/Actor_SetWorldToHome.s,Actor_SetWorldToHome,0x800B672C,0xC asm/non_matchings/code/z_actor/Actor_SetFocus.s,Actor_SetFocus,0x800B675C,0x11 asm/non_matchings/code/z_actor/Actor_SetWorldRotToShape.s,Actor_SetWorldRotToShape,0x800B67A0,0x8 From bd373940ac7bb230b4a135a5c5675ca8f42cd700 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 15 Oct 2022 19:12:01 -0300 Subject: [PATCH 09/12] `z_player_lib`: Part 2 (#938) * preparations * import data * PLAYER_STATE1 * PLAYER_STATE2 * PLAYER_STATE3 * import bss * format stuff * bss cleanup * more cleaning and some naming * face * cleaning up link human object a bit * Remove PHYSICAL_TO_VIRTUAL2 * Update src/code/z_player_lib.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * review Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * format * /* CAT */ Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com> * naming some stuff on objects * format * invert flags endian * review Co-authored-by: EllipticEllipsis * format * drawmask Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com> * naming * another round of human object naming * enum renames * sActionModelGroups and use enum as types * PlayerAnimType * PLAYER_MODELTYPE_ * determined ranges of PlayerModelType * name PLAYER_MODELGROUP_DEFAULT * format * sheath * dlist groups placeholder namse * PLAYER_MODELGROUP_BOTTLE * Some fierce deity naming * Right hands * zora skel dlists * deku limb dlists * left hands * name most modelgroups * more hand naming * regs as dec * fix in horse * Use BUTTON_ITEM_EQUIP macro * review Co-authored-by: EllipticEllipsis * reformat D_801AED58 * Sword sheaths * swords and shields * Update src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c Co-authored-by: EllipticEllipsis * playerForm on Player_DrawImpl * fomat * Update src/code/z_player_lib.c Co-authored-by: Derek Hensley * Update assets/xml/objects/gameplay_keep.xml Co-authored-by: Derek Hensley * review Co-authored-by: Derek Hensley * VIRTUAL_TO_PHYSICAL(SEGMENTED_TO_VIRTUAL(gEffBubble1Tex)) Co-authored-by: Derek Hensley * singular limb enum names * fix bss * Update src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c Co-authored-by: EllipticEllipsis * review Co-authored-by: EllipticEllipsis * name goron shielding limbs * name limb * Update src/code/z_player_lib.c Co-authored-by: EllipticEllipsis * bss * bss * format * namefixer * bss * bss * bss * bss * format * bss * review Co-authored-by: EllipticEllipsis * fix bss Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com> Co-authored-by: EllipticEllipsis Co-authored-by: Derek Hensley --- assets/xml/objects/gameplay_keep.xml | 15 +- assets/xml/objects/object_link_boy.xml | 107 +- assets/xml/objects/object_link_child.xml | 207 +-- assets/xml/objects/object_link_goron.xml | 110 +- assets/xml/objects/object_link_nuts.xml | 82 +- assets/xml/objects/object_link_zora.xml | 108 +- include/functions.h | 24 +- include/variables.h | 159 +- include/z64.h | 6 +- include/z64message.h | 3 +- include/z64object.h | 4 +- include/z64player.h | 159 +- spec | 2 - src/boot_O2_g3/idle.c | 1 - src/code/z_actor.c | 81 +- src/code/z_collision_check.c | 1 + src/code/z_demo.c | 5 +- src/code/z_en_item00.c | 2 +- src/code/z_kaleido_setup.c | 2 +- src/code/z_player_lib.c | 1356 +++++++++++++++-- src/code/z_shrink_window.c | 2 +- .../actors/ovl_Arms_Hook/z_arms_hook.c | 64 +- .../actors/ovl_Arms_Hook/z_arms_hook.h | 2 +- .../ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c | 18 +- .../ovl_Bg_Ikana_Block/z_bg_ikana_block.c | 4 +- .../ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c | 5 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 4 +- .../ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c | 6 +- .../actors/ovl_Bg_Spdweb/z_bg_spdweb.c | 4 +- .../actors/ovl_Bg_Tobira01/z_bg_tobira01.c | 3 +- src/overlays/actors/ovl_Boss_02/z_boss_02.c | 4 +- src/overlays/actors/ovl_Boss_04/z_boss_04.c | 2 +- src/overlays/actors/ovl_Boss_06/z_boss_06.c | 13 +- .../actors/ovl_Dm_Char01/z_dm_char01.c | 2 +- src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c | 4 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 7 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 5 +- .../actors/ovl_Door_Spiral/z_door_spiral.c | 5 +- src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c | 2 +- .../z_eff_kamejima_wave.c | 1 + src/overlays/actors/ovl_En_Ah/z_en_ah.c | 2 +- src/overlays/actors/ovl_En_Al/z_en_al.c | 2 +- .../actors/ovl_En_Aob_01/z_en_aob_01.c | 4 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 4 +- .../actors/ovl_En_Bigslime/z_en_bigslime.c | 4 +- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 2 +- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 10 +- .../actors/ovl_En_Bomjima/z_en_bomjima.c | 6 +- .../actors/ovl_En_Bomjimb/z_en_bomjimb.c | 16 +- src/overlays/actors/ovl_En_Boom/z_en_boom.c | 6 +- src/overlays/actors/ovl_En_Dai/z_en_dai.c | 4 +- src/overlays/actors/ovl_En_Dg/z_en_dg.c | 8 +- src/overlays/actors/ovl_En_Dnq/z_en_dnq.c | 2 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 2 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 4 +- src/overlays/actors/ovl_En_Door/z_en_door.c | 2 +- .../actors/ovl_En_Dragon/z_en_dragon.c | 4 +- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 28 +- .../actors/ovl_En_Elfgrp/z_en_elfgrp.c | 10 +- .../actors/ovl_En_Elforg/z_en_elforg.c | 6 +- .../actors/ovl_En_Fishing/z_en_fishing.c | 2 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 2 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 24 +- src/overlays/actors/ovl_En_Gg/z_en_gg.c | 4 +- src/overlays/actors/ovl_En_Gk/z_en_gk.c | 4 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 4 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 6 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 11 +- .../actors/ovl_En_Hakurock/z_en_hakurock.c | 3 +- src/overlays/actors/ovl_En_Hg/z_en_hg.c | 4 +- .../ovl_En_Hidden_Nuts/z_en_hidden_nuts.c | 2 +- src/overlays/actors/ovl_En_Holl/z_en_holl.c | 2 +- .../z_en_horse_game_check.c | 2 +- src/overlays/actors/ovl_En_Ig/z_en_ig.c | 2 +- .../actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c | 12 +- .../actors/ovl_En_Kakasi/z_en_kakasi.c | 4 +- src/overlays/actors/ovl_En_Kame/z_en_kame.c | 6 +- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 46 +- src/overlays/actors/ovl_En_Kgy/z_en_kgy.c | 4 +- src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c | 26 +- .../actors/ovl_En_Look_Nuts/z_en_look_nuts.c | 2 +- src/overlays/actors/ovl_En_Ma4/z_en_ma4.c | 16 +- src/overlays/actors/ovl_En_Mm3/z_en_mm3.c | 6 +- .../actors/ovl_En_Mt_tag/z_en_mt_tag.c | 4 +- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 3 +- src/overlays/actors/ovl_En_Nwc/z_en_nwc.c | 5 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 12 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 4 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 4 +- src/overlays/actors/ovl_En_Pm/z_en_pm.c | 2 +- src/overlays/actors/ovl_En_Pr/z_en_pr.c | 10 +- src/overlays/actors/ovl_En_Pr2/z_en_pr2.c | 6 +- src/overlays/actors/ovl_En_Prz/z_en_prz.c | 6 +- src/overlays/actors/ovl_En_Raf/z_en_raf.c | 8 +- .../actors/ovl_En_Railgibud/z_en_railgibud.c | 15 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 11 +- src/overlays/actors/ovl_En_Rg/z_en_rg.c | 7 +- src/overlays/actors/ovl_En_Rr/z_en_rr.c | 7 +- .../actors/ovl_En_Ruppecrow/z_en_ruppecrow.c | 10 +- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 2 +- .../actors/ovl_En_Sellnuts/z_en_sellnuts.c | 4 +- src/overlays/actors/ovl_En_Shn/z_en_shn.c | 2 +- .../actors/ovl_En_Snowman/z_en_snowman.c | 6 +- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 12 +- .../actors/ovl_En_Stream/z_en_stream.c | 2 +- .../actors/ovl_En_Suttari/z_en_suttari.c | 14 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 2 +- .../ovl_En_Syateki_Man/z_en_syateki_man.c | 46 +- src/overlays/actors/ovl_En_Tab/z_en_tab.c | 2 +- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 21 +- .../actors/ovl_En_Tanron3/z_en_tanron3.c | 2 +- src/overlays/actors/ovl_En_Test4/z_en_test4.c | 12 +- src/overlays/actors/ovl_En_Test7/z_en_test7.c | 10 +- .../actors/ovl_En_Thiefbird/z_en_thiefbird.c | 11 +- src/overlays/actors/ovl_En_Toto/z_en_toto.c | 2 +- src/overlays/actors/ovl_En_Trt/z_en_trt.c | 18 +- src/overlays/actors/ovl_En_Trt2/z_en_trt2.c | 4 +- .../actors/ovl_En_Tru_Mt/z_en_tru_mt.c | 6 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 9 +- .../actors/ovl_En_Warp_tag/z_en_warp_tag.c | 2 +- .../actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c | 2 +- src/overlays/actors/ovl_En_Yb/z_en_yb.c | 4 +- src/overlays/actors/ovl_En_Zob/z_en_zob.c | 2 +- src/overlays/actors/ovl_En_Zog/z_en_zog.c | 4 +- src/overlays/actors/ovl_En_Zot/z_en_zot.c | 2 +- .../actors/ovl_Obj_Armos/z_obj_armos.c | 6 +- .../actors/ovl_Obj_Etcetera/z_obj_etcetera.c | 7 +- .../actors/ovl_Obj_Ghaka/z_obj_ghaka.c | 4 +- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c | 2 +- .../actors/ovl_Obj_Iceblock/z_obj_iceblock.c | 2 +- .../ovl_Obj_Moon_Stone/z_obj_moon_stone.c | 2 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 12 +- .../actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c | 6 +- .../ovl_Obj_Skateblock/z_obj_skateblock.c | 2 +- .../ovl_Effect_Ss_Stick/z_eff_ss_stick.c | 2 +- tools/disasm/functions.txt | 14 +- tools/disasm/variables.txt | 68 +- tools/namefixer.py | 15 +- tools/sizes/code_functions.csv | 14 +- 139 files changed, 2323 insertions(+), 1061 deletions(-) diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml index b40994d0c..b467c1034 100644 --- a/assets/xml/objects/gameplay_keep.xml +++ b/assets/xml/objects/gameplay_keep.xml @@ -12,7 +12,7 @@ - + @@ -20,8 +20,8 @@ - - + + @@ -30,7 +30,7 @@ - + @@ -38,7 +38,8 @@ - + + @@ -1220,7 +1221,7 @@ - + @@ -1491,7 +1492,7 @@ - + diff --git a/assets/xml/objects/object_link_boy.xml b/assets/xml/objects/object_link_boy.xml index 68ec00737..2fe50d9bc 100644 --- a/assets/xml/objects/object_link_boy.xml +++ b/assets/xml/objects/object_link_boy.xml @@ -2,42 +2,45 @@ - - + + - + - - - - - - - - - + + + + + + + + + + - + - - - - - - - + + + + + + + + - - - - + + + + + - + @@ -46,36 +49,38 @@ - + - - + + - + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_link_child.xml b/assets/xml/objects/object_link_child.xml index 5ad903048..23d3cf09c 100644 --- a/assets/xml/objects/object_link_child.xml +++ b/assets/xml/objects/object_link_child.xml @@ -1,25 +1,28 @@  - - - - - - - + + + + + + + - - - - - - + + + + + + + + + - - - + + + @@ -29,37 +32,44 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + @@ -67,49 +77,51 @@ - + + - + - + - + - - - - + + + + - + - + + - - - + + + - + - - - + + + @@ -122,35 +134,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_link_goron.xml b/assets/xml/objects/object_link_goron.xml index 39686b4f7..48eef4dd9 100644 --- a/assets/xml/objects/object_link_goron.xml +++ b/assets/xml/objects/object_link_goron.xml @@ -1,8 +1,13 @@  - + + + + + - + + @@ -17,26 +22,28 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -45,9 +52,9 @@ - + - + @@ -59,7 +66,7 @@ - + @@ -76,33 +83,36 @@ - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_link_nuts.xml b/assets/xml/objects/object_link_nuts.xml index eb072c940..a00c44db4 100644 --- a/assets/xml/objects/object_link_nuts.xml +++ b/assets/xml/objects/object_link_nuts.xml @@ -1,23 +1,24 @@  - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -53,27 +54,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_link_zora.xml b/assets/xml/objects/object_link_zora.xml index 9a973c56a..5833293b8 100644 --- a/assets/xml/objects/object_link_zora.xml +++ b/assets/xml/objects/object_link_zora.xml @@ -1,8 +1,22 @@  - + + + + + + + + + + + + + + - + + @@ -15,24 +29,26 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -48,13 +64,13 @@ - - + + - + @@ -68,29 +84,31 @@ + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/functions.h b/include/functions.h index 0e7808642..f0a96080a 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1800,15 +1800,15 @@ s32 func_80123448(PlayState* play); s32 Player_IsGoronOrDeku(Player* player); s32 func_801234D4(PlayState* play); s32 func_80123590(PlayState* play, Actor* actor); -s32 func_8012364C(PlayState* play, Player* player, s32 arg2); +ItemId func_8012364C(PlayState* play, Player* player, s32 arg2); s32 func_80123810(PlayState* play); -s32 Player_ActionToModelGroup(Player* player, s32 actionParam); -void func_801239AC(Player* player); -void Player_SetModels(Player* player, s32 modelGroup); -void Player_SetModelGroup(Player* player, s32 modelGroup); +PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerActionParam actionParam); +void Player_SetModelsForHoldingShield(Player* player); +void Player_SetModels(Player* player, PlayerModelGroup modelGroup); +void Player_SetModelGroup(Player* player, PlayerModelGroup modelGroup); void func_80123C58(Player* player); void Player_SetEquipmentData(PlayState* play, Player* player); -void func_80123D50(PlayState* play, Player* player, s32 itemId, s32 actionParam); +void func_80123D50(PlayState* play, Player* player, ItemId itemId, PlayerActionParam actionParam); void func_80123DA4(Player* player); void func_80123DC0(Player* player); void func_80123E90(PlayState* play, Actor* actor); @@ -1821,21 +1821,21 @@ s32 Player_HasMirrorShieldEquipped(PlayState* play); s32 Player_IsHoldingMirrorShield(PlayState* play); s32 Player_IsHoldingHookshot(Player* player); s32 func_801240DC(Player* player); -s32 func_80124110(Player* player, s32 actionParam); +s32 func_80124110(Player* player, PlayerActionParam actionParam); s32 func_80124148(Player* player); -s32 Player_ActionToMeleeWeapon(s32 actionParam); +s32 Player_ActionToMeleeWeapon(PlayerActionParam actionParam); s32 Player_GetMeleeWeaponHeld(Player* player); s32 Player_IsHoldingTwoHandedWeapon(Player* player); -s32 Player_ActionToBottle(Player* player, s32 actionParam); +s32 Player_ActionToBottle(Player* player, PlayerActionParam actionParam); s32 Player_GetBottleHeld(Player* Player); -s32 Player_ActionToExplosive(Player* player, s32 actionParam); +s32 Player_ActionToExplosive(Player* player, PlayerActionParam actionParam); s32 Player_GetExplosiveHeld(Player* player); -s32 func_80124278(Actor* actor, s32 actionParam); +s32 Player_ActionToSword(Actor* actor, PlayerActionParam actionParam); s32 func_801242B4(Player* player); s32 Player_GetEnvTimerType(PlayState* play); void func_80124420(Player* player); void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2); -void func_801246F4(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic, s32 boots, s32 face, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor); +void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, PlayerTransformation playerForm, s32 boots, s32 face, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor); void func_80125318(Vec3f* arg0, Vec3s* arg1); void Player_DrawZoraShield(PlayState* play, Player* player); void func_80125500(PlayState* play, Player* player, s32 limbIndex, Vec3f* pos, Vec3s* rot); diff --git a/include/variables.h b/include/variables.h index 5b40e1161..88758c50b 100644 --- a/include/variables.h +++ b/include/variables.h @@ -1,5 +1,5 @@ -#ifndef _VARIABLES_H_ -#define _VARIABLES_H_ +#ifndef VARIABLES_H +#define VARIABLES_H #include "z64.h" #include "segment_symbols.h" @@ -412,7 +412,6 @@ extern EffectSsOverlay gParticleOverlayTable[39]; extern f32 actorMovementScale; extern TargetRangeParams gTargetRanges[]; extern s16 D_801AED48[8]; -// extern UNK_TYPE4 D_801AED58; extern Color_RGBA8 actorDefaultHitColor; // extern UNK_TYPE1 D_801AED8C; // extern UNK_TYPE4 D_801AED98; @@ -773,141 +772,12 @@ extern UNK_PTR D_801BF5C0; // extern UNK_TYPE1 D_801BFD94; // extern UNK_TYPE2 D_801BFD98; -// extern UNK_TYPE1 D_801BFDD0; -// extern UNK_TYPE1 D_801BFE00; -// extern UNK_TYPE1 D_801BFE14; -// extern UNK_TYPE2 D_801BFF34; -// extern UNK_TYPE1 D_801BFF90; -extern u8 gPlayerModelTypes[][5]; -// extern UNK_TYPE1 D_801BFFFC; -// extern UNK_TYPE1 D_801C0024; -// extern UNK_TYPE1 D_801C0034; -// extern UNK_TYPE1 D_801C005C; -// extern UNK_TYPE1 D_801C0084; -// extern UNK_TYPE1 D_801C00AC; -// extern UNK_TYPE1 D_801C00BC; -// extern UNK_TYPE1 D_801C00D4; -// extern UNK_TYPE1 D_801C00EC; -// extern UNK_TYPE1 D_801C0114; -// extern UNK_TYPE1 D_801C013C; -// extern UNK_TYPE1 D_801C0164; -// extern UNK_TYPE1 D_801C018C; -// extern UNK_TYPE1 D_801C01A4; -// extern UNK_TYPE1 D_801C01CC; -// extern UNK_TYPE1 D_801C01F4; -// extern UNK_TYPE1 D_801C021C; -// extern UNK_TYPE1 D_801C0244; -// extern UNK_TYPE1 D_801C026C; -// extern UNK_TYPE1 D_801C0294; -// extern UNK_TYPE1 D_801C02A8; -// extern UNK_TYPE1 D_801C02BC; -// extern UNK_TYPE1 D_801C02D0; -// extern UNK_TYPE1 D_801C02E4; -// extern UNK_TYPE1 D_801C0340; -// extern UNK_TYPE1 D_801C0368; -// extern UNK_TYPE1 D_801C03A0; -// extern UNK_TYPE1 D_801C03C0; -// extern UNK_TYPE1 D_801C03E0; -// extern UNK_TYPE1 D_801C0410; -// extern UNK_TYPE1 D_801C0428; -// extern UNK_TYPE1 D_801C0460; -// extern UNK_TYPE1 D_801C0490; -// extern UNK_TYPE1 D_801C0510; -// extern UNK_TYPE1 D_801C0538; -// extern UNK_TYPE1 D_801C0560; -// extern UNK_TYPE1 D_801C0580; -// extern UNK_TYPE1 D_801C05A8; -// extern UNK_TYPE1 D_801C05C8; -// extern UNK_TYPE1 D_801C05D8; -// extern UNK_TYPE1 D_801C05F0; -// extern UNK_TYPE1 D_801C0608; -// extern UNK_TYPE1 D_801C0628; -// extern UNK_TYPE1 D_801C0678; -// extern UNK_TYPE1 D_801C0698; -// extern UNK_TYPE1 D_801C06B8; -// extern UNK_TYPE1 D_801C06E0; -// extern UNK_TYPE1 D_801C06F8; -// extern UNK_TYPE1 D_801C0718; -// extern UNK_TYPE1 D_801C0730; -// extern UNK_TYPE1 D_801C0740; -// extern UNK_TYPE1 D_801C0750; -// extern UNK_TYPE1 D_801C0778; -// extern UNK_TYPE1 D_801C0784; -// extern UNK_TYPE1 D_801C07AC; -// extern UNK_TYPE1 D_801C07C0; -// extern UNK_TYPE1 D_801C07F0; -// extern UNK_TYPE1 D_801C0820; -// extern UNK_TYPE1 D_801C0838; -extern Gfx D_801C0850[]; -// extern UNK_TYPE1 D_801C0860; -extern UNK_PTR D_801C0870; -// extern UNK_TYPE1 D_801C0890; -// extern UNK_TYPE1 D_801C08A0; -// extern UNK_TYPE1 D_801C08C0; -// extern UNK_TYPE1 D_801C08FC; -// extern UNK_TYPE1 D_801C0910; -// extern UNK_TYPE1 D_801C0924; -// extern UNK_TYPE1 D_801C0938; -// extern UNK_TYPE1 D_801C094C; -// extern UNK_TYPE4 D_801C0958; -extern UNK_PTR D_801C095C; -// extern UNK_TYPE1 D_801C0964; -// extern UNK_TYPE1 D_801C096C; -// extern UNK_TYPE1 D_801C0970; -// extern UNK_TYPE4 D_801C0994; -// extern UNK_TYPE1 D_801C09B8; -// extern UNK_TYPE1 D_801C09DC; -// extern UNK_TYPE1 D_801C0A00; -// extern UNK_TYPE1 D_801C0A24; -// extern UNK_TYPE1 D_801C0A48; -// extern UNK_TYPE1 D_801C0A6C; -// extern UNK_TYPE1 D_801C0A90; -// extern UNK_TYPE1 D_801C0AB4; -// extern UNK_TYPE1 D_801C0ABC; -// extern UNK_TYPE1 D_801C0AC4; -// extern UNK_TYPE1 D_801C0ADC; -extern UNK_PTR D_801C0AF4; -extern UNK_PTR D_801C0AFC; -extern UNK_PTR D_801C0B04; -extern UNK_PTR D_801C0B0C; -// extern UNK_TYPE1 D_801C0B14; -// extern UNK_TYPE1 D_801C0B1C; -// extern UNK_TYPE1 D_801C0B20; -// extern UNK_TYPE1 D_801C0B90; -// extern UNK_TYPE4 D_801C0BA8; -// extern UNK_TYPE1 D_801C0BB4; -// extern UNK_TYPE1 D_801C0BC0; -// extern UNK_TYPE1 D_801C0BD0; -// extern UNK_TYPE4 D_801C0BE0; -// extern UNK_TYPE4 D_801C0BEC; -// extern UNK_TYPE1 D_801C0BF8; -// extern UNK_TYPE1 D_801C0BFC; -// extern UNK_TYPE1 D_801C0C00; -// extern UNK_TYPE4 D_801C0C0C; -// extern UNK_TYPE1 D_801C0C30; -// extern UNK_TYPE1 D_801C0C54; -// extern UNK_TYPE1 D_801C0CA8; -// extern UNK_TYPE4 D_801C0CE8; -// extern UNK_TYPE1 D_801C0D24; -// extern UNK_TYPE1 D_801C0D60; -// extern UNK_TYPE1 D_801C0D6C; -// extern UNK_TYPE1 D_801C0D78; -// extern UNK_TYPE4 D_801C0D94; -// extern UNK_TYPE4 D_801C0D98; -// extern UNK_TYPE4 D_801C0D9C; -// extern UNK_TYPE4 D_801C0DA0; -// extern UNK_TYPE1 D_801C0DA8; -// extern UNK_TYPE1 D_801C0DD8; -// extern UNK_TYPE1 D_801C0DE4; -// extern UNK_TYPE4 D_801C0DF0; -// extern UNK_TYPE1 D_801C0E04; -// extern UNK_TYPE4 D_801C0E2C; -// extern UNK_TYPE4 D_801C0E40; -// extern UNK_TYPE1 D_801C0E7C; -// extern UNK_TYPE1 D_801C0E94; -// extern UNK_TYPE1 D_801C0EA0; -// extern UNK_TYPE1 D_801C0EAC; -// extern UNK_TYPE1 D_801C0EB8; +extern FlexSkeletonHeader* gPlayerSkeletons[PLAYER_FORM_MAX]; +extern PlayerModelIndices gPlayerModelTypes[]; +extern struct_80124618 D_801C03A0[]; +extern struct_80124618 D_801C0490[]; +extern Gfx gCullBackDList[]; +extern Gfx gCullFrontDList[]; extern Gfx sSetupDL[438]; extern Gfx sFillSetupDL[12]; @@ -2750,18 +2620,7 @@ extern s16 D_801F4E7A; // extern UNK_TYPE1 D_801F57B4; // extern UNK_TYPE1 D_801F5834; // extern NmiBuff* gNMIBuffer; -// extern UNK_TYPE1 sPostmanTimerInput; -// extern UNK_TYPE1 D_801F58B0; -// extern UNK_TYPE1 D_801F59AC; -// extern UNK_TYPE1 D_801F59B0; -// extern UNK_TYPE1 D_801F59C8; -// extern UNK_TYPE1 D_801F59D0; -// extern UNK_TYPE1 D_801F59DC; -// extern UNK_TYPE1 D_801F59E0; -// extern UNK_TYPE1 D_801F59E4; -// extern UNK_TYPE1 D_801F59E8; -// extern UNK_TYPE1 D_801F59F4; -// extern UNK_TYPE1 D_801F59F8; + // extern UNK_TYPE1 sSkyboxDrawMatrix; // extern UNK_TYPE1 D_801F6AF0; // extern UNK_TYPE1 D_801F6AF2; diff --git a/include/z64.h b/include/z64.h index 4b2682b1b..7552cbe66 100644 --- a/include/z64.h +++ b/include/z64.h @@ -724,7 +724,7 @@ typedef struct { #define TRANS_TRIGGER_START 20 // start transition (exiting an area) #define TRANS_TRIGGER_END -20 // transition is ending (arriving in a new area) -typedef enum { +typedef enum TransitionMode { /* 0 */ TRANS_MODE_OFF, /* 1 */ TRANS_MODE_01, /* 2 */ TRANS_MODE_02, @@ -745,7 +745,7 @@ typedef enum { /* 17 */ TRANS_MODE_17 } TransitionMode; -typedef enum { +typedef enum TransitionType { /* 0 */ TRANS_TYPE_00, /* 1 */ TRANS_TYPE_01, /* 2 */ TRANS_TYPE_02, @@ -1048,7 +1048,7 @@ struct PlayState { /* 0x18788 */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor); /* 0x1878C */ void (*unk_1878C)(struct PlayState* play); /* 0x18790 */ void (*unk_18790)(struct PlayState* play, s16 arg1, Actor* actor); - /* 0x18794 */ s32 (*unk_18794)(struct PlayState* play, Player* player, s32 arg2, s32 arg3); + /* 0x18794 */ s32 (*unk_18794)(struct PlayState* play, Player* player, s32 itemId, s32 arg3); /* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, void* talkAnim, s32 arg2); /* 0x1879C */ s16 playerActorCsIds[10]; /* 0x187B0 */ MtxF viewProjectionMtxF; diff --git a/include/z64message.h b/include/z64message.h index 590074339..7d4723e7b 100644 --- a/include/z64message.h +++ b/include/z64message.h @@ -160,7 +160,8 @@ typedef struct MessageContext { /* 0x120A4 */ s16 unk120A4[6]; /* 0x120B0 */ u8 unk120B0; /* 0x120B1 */ u8 unk120B1; - /* 0x120B2 */ u8 unk120B2[0xC]; + /* 0x120B2 */ u8 unk120B2[0xA]; + /* 0x120BC */ u16 unk_120BC; /* 0x120BE */ s16 unk120BE; /* 0x120C0 */ s16 unk120C0; /* 0x120C2 */ s16 unk120C2; diff --git a/include/z64object.h b/include/z64object.h index 306f84ebd..e800e9138 100644 --- a/include/z64object.h +++ b/include/z64object.h @@ -1,5 +1,5 @@ -#ifndef _Z64OBJECT_H_ -#define _Z64OBJECT_H_ +#ifndef Z64OBJECT_H +#define Z64OBJECT_H #define OBJECT_SPACE_SIZE_DEFAULT 1413120 #define OBJECT_SPACE_SIZE_CLOCK_TOWN 1566720 diff --git a/include/z64player.h b/include/z64player.h index 2f101b558..1d7261aa2 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -97,7 +97,8 @@ typedef enum PlayerActionParam { /* 0x0E */ PLAYER_AP_BOMB, /* 0x0F */ PLAYER_AP_POWDER_KEG, /* 0x10 */ PLAYER_AP_BOMBCHU, - /* 0x12 */ PLAYER_AP_NUT = 0x12, + /* 0x11 */ PLAYER_AP_11, + /* 0x12 */ PLAYER_AP_NUT, /* 0x13 */ PLAYER_AP_PICTO_BOX, /* 0x14 */ PLAYER_AP_OCARINA, /* 0x15 */ PLAYER_AP_BOTTLE, @@ -107,7 +108,8 @@ typedef enum PlayerActionParam { /* 0x19 */ PLAYER_AP_BOTTLE_ZORA_EGG, /* 0x1A */ PLAYER_AP_BOTTLE_DEKU_PRINCESS, /* 0x1B */ PLAYER_AP_BOTTLE_GOLD_DUST, - /* 0x1D */ PLAYER_AP_BOTTLE_SEAHORSE = 0x1D, + /* 0x1C */ PLAYER_AP_BOTTLE_1C, + /* 0x1D */ PLAYER_AP_BOTTLE_SEAHORSE, /* 0x1E */ PLAYER_AP_BOTTLE_MUSHROOM, /* 0x1F */ PLAYER_AP_BOTTLE_HYLIAN_LOACH, /* 0x20 */ PLAYER_AP_BOTTLE_BUG, @@ -128,9 +130,15 @@ typedef enum PlayerActionParam { /* 0x2F */ PLAYER_AP_DEED_SWAMP, /* 0x30 */ PLAYER_AP_DEED_MOUNTAIN, /* 0x31 */ PLAYER_AP_DEED_OCEAN, - /* 0x33 */ PLAYER_AP_LETTER_MAMA = 0x33, - /* 0x36 */ PLAYER_AP_PENDANT_OF_MEMORIES = 0x36, - /* 0x3A */ PLAYER_AP_MASK_TRUTH = 0x3A, + /* 0x32 */ PLAYER_AP_32, + /* 0x33 */ PLAYER_AP_LETTER_MAMA, + /* 0x34 */ PLAYER_AP_34, + /* 0x35 */ PLAYER_AP_35, + /* 0x36 */ PLAYER_AP_PENDANT_OF_MEMORIES, + /* 0x37 */ PLAYER_AP_37, + /* 0x38 */ PLAYER_AP_38, + /* 0x39 */ PLAYER_AP_39, + /* 0x3A */ PLAYER_AP_MASK_TRUTH, /* 0x3B */ PLAYER_AP_MASK_KAFEIS_MASK, /* 0x3C */ PLAYER_AP_MASK_ALL_NIGHT, /* 0x3D */ PLAYER_AP_MASK_BUNNY, @@ -155,7 +163,7 @@ typedef enum PlayerActionParam { /* 0x50 */ PLAYER_AP_MASK_ZORA, /* 0x51 */ PLAYER_AP_MASK_DEKU, /* 0x52 */ PLAYER_AP_LENS, - /* 0xFD */ PLAYER_AP_MAX = 0xFD + /* 0x53 */ PLAYER_AP_MAX } PlayerActionParam; typedef enum { @@ -196,6 +204,134 @@ typedef enum { /* 34 */ PLAYER_MWA_MAX } PlayerMeleeWeaponAnimation; +typedef enum PlayerAnimType { + /* 0 */ PLAYER_ANIMTYPE_0, + /* 1 */ PLAYER_ANIMTYPE_1, + /* 2 */ PLAYER_ANIMTYPE_2, + /* 3 */ PLAYER_ANIMTYPE_3, + /* 4 */ PLAYER_ANIMTYPE_4, + /* 5 */ PLAYER_ANIMTYPE_5, + /* 6 */ PLAYER_ANIMTYPE_MAX +} PlayerAnimType; + +typedef enum PlayerModelType { + // left hand + /* 0 */ PLAYER_MODELTYPE_LH_OPEN, + /* 1 */ PLAYER_MODELTYPE_LH_CLOSED, + /* 2 */ PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, + /* 3 */ PLAYER_MODELTYPE_LH_TWO_HAND_SWORD, + /* 4 */ PLAYER_MODELTYPE_LH_4, + /* 5 */ PLAYER_MODELTYPE_LH_BOTTLE, + // right hand + /* 6 */ PLAYER_MODELTYPE_RH_OPEN, + /* 7 */ PLAYER_MODELTYPE_RH_CLOSED, + /* 8 */ PLAYER_MODELTYPE_RH_SHIELD, + /* 9 */ PLAYER_MODELTYPE_RH_BOW, + /* 10 */ PLAYER_MODELTYPE_RH_INSTRUMENT, + /* 11 */ PLAYER_MODELTYPE_RH_HOOKSHOT, + // sheath + /* 12 */ PLAYER_MODELTYPE_SHEATH_12, + /* 13 */ PLAYER_MODELTYPE_SHEATH_13, + /* 14 */ PLAYER_MODELTYPE_SHEATH_14, + /* 15 */ PLAYER_MODELTYPE_SHEATH_15, + // waist + /* 16 */ PLAYER_MODELTYPE_WAIST, + /* 17 */ PLAYER_MODELTYPE_17, // NULL? + /* 18 */ PLAYER_MODELTYPE_MAX +} PlayerModelType; + +typedef struct PlayerModelIndices { + /* 0x0 */ u8 modelAnimType; // PlayerAnimType enum + /* 0x1 */ u8 leftHandType; // PlayerModelType enum + /* 0x2 */ u8 rightHandType; // PlayerModelType enum + /* 0x3 */ u8 sheathType; // PlayerModelType enum + /* 0x4 */ u8 waistType; // PlayerModelType enum +} PlayerModelIndices; // size = 0x5 + +typedef enum PlayerModelGroup { + /* 0 */ PLAYER_MODELGROUP_0, + /* 1 */ PLAYER_MODELGROUP_1, + /* 2 */ PLAYER_MODELGROUP_ONE_HAND_SWORD, + /* 3 */ PLAYER_MODELGROUP_DEFAULT, // non-specific models, for items that don't have particular link models + /* 4 */ PLAYER_MODELGROUP_4, + /* 5 */ PLAYER_MODELGROUP_TWO_HAND_SWORD, + /* 6 */ PLAYER_MODELGROUP_BOW, + /* 7 */ PLAYER_MODELGROUP_EXPLOSIVES, + /* 8 */ PLAYER_MODELGROUP_8, + /* 9 */ PLAYER_MODELGROUP_HOOKSHOT, + /* 10 */ PLAYER_MODELGROUP_STICK, + /* 11 */ PLAYER_MODELGROUP_INSTRUMENT, + /* 12 */ PLAYER_MODELGROUP_BOTTLE, + /* 13 */ PLAYER_MODELGROUP_13, + /* 14 */ PLAYER_MODELGROUP_ZORA_FINS, + /* 15 */ PLAYER_MODELGROUP_MAX +} PlayerModelGroup; + +typedef enum { + /* 0 */ PLAYER_EYES_OPEN, + /* 1 */ PLAYER_EYES_HALF, + /* 2 */ PLAYER_EYES_CLOSED, + /* 3 */ PLAYER_EYES_ROLL_RIGHT, + /* 4 */ PLAYER_EYES_ROLL_LEFT, + /* 5 */ PLAYER_EYES_ROLL_UP, + /* 6 */ PLAYER_EYES_ROLL_DOWN, + /* 7 */ PLAYER_EYES_7, + /* 8 */ PLAYER_EYES_MAX +} PlayerEyeIndex; + +typedef enum { + /* 0 */ PLAYER_MOUTH_CLOSED, + /* 1 */ PLAYER_MOUTH_TEETH, + /* 2 */ PLAYER_MOUTH_ANGRY, + /* 3 */ PLAYER_MOUTH_HAPPY, + /* 4 */ PLAYER_MOUTH_MAX +} PlayerMouthIndex; + +typedef enum { + /* 0 */ PLAYER_FACE_0, + /* 1 */ PLAYER_FACE_1, + /* 2 */ PLAYER_FACE_2, + /* 3 */ PLAYER_FACE_3, + /* 4 */ PLAYER_FACE_4, + /* 5 */ PLAYER_FACE_5, + /* 6 */ PLAYER_FACE_6, + /* 7 */ PLAYER_FACE_7, + /* 8 */ PLAYER_FACE_8, + /* 9 */ PLAYER_FACE_9, + /* 10 */ PLAYER_FACE_10, + /* 11 */ PLAYER_FACE_11, + /* 12 */ PLAYER_FACE_12, + /* 13 */ PLAYER_FACE_13, + /* 14 */ PLAYER_FACE_14, + /* 15 */ PLAYER_FACE_15 +} PlayerFacialExpression; + +typedef enum { + /* 0x00 */ PLAYER_LIMB_NONE, + /* 0x01 */ PLAYER_LIMB_ROOT, + /* 0x02 */ PLAYER_LIMB_WAIST, + /* 0x03 */ PLAYER_LIMB_LOWER_ROOT, + /* 0x04 */ PLAYER_LIMB_RIGHT_THIGH, + /* 0x05 */ PLAYER_LIMB_RIGHT_SHIN, + /* 0x06 */ PLAYER_LIMB_RIGHT_FOOT, + /* 0x07 */ PLAYER_LIMB_LEFT_THIGH, + /* 0x08 */ PLAYER_LIMB_LEFT_SHIN, + /* 0x09 */ PLAYER_LIMB_LEFT_FOOT, + /* 0x0A */ PLAYER_LIMB_UPPER_ROOT, + /* 0x0B */ PLAYER_LIMB_HEAD, + /* 0x0C */ PLAYER_LIMB_HAT, + /* 0x0D */ PLAYER_LIMB_COLLAR, + /* 0x0E */ PLAYER_LIMB_LEFT_SHOULDER, + /* 0x0F */ PLAYER_LIMB_LEFT_FOREARM, + /* 0x10 */ PLAYER_LIMB_LEFT_HAND, + /* 0x11 */ PLAYER_LIMB_RIGHT_SHOULDER, + /* 0x12 */ PLAYER_LIMB_RIGHT_FOREARM, + /* 0x13 */ PLAYER_LIMB_RIGHT_HAND, + /* 0x14 */ PLAYER_LIMB_SHEATH, + /* 0x15 */ PLAYER_LIMB_TORSO, + /* 0x16 */ PLAYER_LIMB_MAX +} PlayerLimb; + typedef struct { /* 0x00 */ f32 unk_00; /* 0x04 */ f32 unk_04; @@ -245,7 +381,6 @@ typedef void (*PlayerFuncD58)(struct PlayState*, struct Player*); typedef struct { /* 0x00 */ u8 unk_00; /* 0x01 */ u8 alpha; - /* 0x02 */ char unk_02[2]; // probably alignment padding /* 0x04 */ MtxF mf; } struct_80122D44_arg1_unk_04; // size = 0x44 @@ -420,7 +555,7 @@ typedef struct struct_80122744_arg1 { #define PLAYER_STATE3_400 (1 << 10) // #define PLAYER_STATE3_800 (1 << 11) -// +// being curled? #define PLAYER_STATE3_1000 (1 << 12) // #define PLAYER_STATE3_2000 (1 << 13) @@ -467,15 +602,15 @@ typedef struct Player { /* 0x144 */ s8 currentShield; /* 0x145 */ s8 currentBoots; /* 0x146 */ s8 heldItemButton; - /* 0x147 */ s8 itemActionParam; - /* 0x148 */ u8 heldItemId; + /* 0x147 */ s8 itemActionParam; // PlayerActionParam enum + /* 0x148 */ u8 heldItemId; // ItemId enum /* 0x149 */ s8 prevBoots; /* 0x14A */ s8 heldItemActionParam; /* 0x14B */ u8 transformation; - /* 0x14C */ u8 modelGroup; + /* 0x14C */ u8 modelGroup; // PlayerModelGroup enum /* 0x14D */ u8 nextModelGroup; /* 0x14E */ s8 unk_14E; - /* 0x14F */ u8 modelAnimType; + /* 0x14F */ u8 modelAnimType; // PlayerAnimType enum /* 0x150 */ u8 leftHandType; /* 0x151 */ u8 rightHandType; /* 0x152 */ u8 sheathType; diff --git a/spec b/spec index a021c04f9..3837f6b30 100644 --- a/spec +++ b/spec @@ -504,8 +504,6 @@ beginseg include "build/src/code/z_path.o" include "build/src/code/z_pause.o" include "build/src/code/z_player_lib.o" - include "build/data/code/z_player_lib.data.o" - include "build/data/code/z_player_lib.bss.o" include "build/src/code/z_prenmi.o" include "build/src/code/z_quake.o" include "build/src/code/z_rcp.o" diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c index da93f13fd..942435fa7 100644 --- a/src/boot_O2_g3/idle.c +++ b/src/boot_O2_g3/idle.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" u8 D_80096B20 = 1; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 52b113c76..1a2404c1a 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -172,7 +172,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, PlayState* play) { u8 shadowAlpha = actor->shape.shadowAlpha; f32 alphaRatio; - if ((actor->id == ACTOR_PLAYER) && (((Player*)actor)->stateFlags3 & 0x8000)) { + if ((actor->id == ACTOR_PLAYER) && (((Player*)actor)->stateFlags3 & PLAYER_STATE3_8000)) { f32 prevScaleZ = actor->scale.z; actor->scale.z += 0.03f * fabsf(Math_CosS(((Player*)actor)->unk_AAA)); @@ -469,7 +469,8 @@ void Actor_TargetContextInit(TargetContext* targetCtx, Actor* actor, PlayState* void Actor_DrawZTarget(TargetContext* targetCtx, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x300006C2)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | + PLAYER_STATE1_400 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000))) { Actor* actor = targetCtx->targetedActor; OPEN_DISPS(play->state.gfxCtx); @@ -519,7 +520,7 @@ void Actor_DrawZTarget(TargetContext* targetCtx, PlayState* play) { Target_SetPos(targetCtx, targetCtx->unk4C, projectedPos.x, projectedPos.y, projectedPos.z); - if ((!(player->stateFlags1 & 0x40)) || (actor != player->unk_730)) { + if ((!(player->stateFlags1 & PLAYER_STATE1_40)) || (actor != player->unk_730)) { OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 0x39); for (spB0 = 0, spAC = targetCtx->unk4C; spB0 < spB8; spB0++, spAC = (spAC + 1) % 3) { @@ -1291,7 +1292,7 @@ void func_800B6F20(PlayState* play, Input* input, f32 magnitude, s16 baseYaw) { f32 Player_GetHeight(Player* player) { f32 extraHeight; - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { extraHeight = 32.0f; } else { extraHeight = 0.0f; @@ -1302,8 +1303,7 @@ f32 Player_GetHeight(Player* player) { case PLAYER_FORM_FIERCE_DEITY: return extraHeight + 124.0f; case PLAYER_FORM_GORON: - // (player->stateFlags3 & 0x1000): being curled? - return extraHeight + ((player->stateFlags3 & 0x1000) ? 34.0f : 80.0f); + return extraHeight + ((player->stateFlags3 & PLAYER_STATE3_1000) ? 34.0f : 80.0f); case PLAYER_FORM_ZORA: return extraHeight + 68.0f; case PLAYER_FORM_DEKU: @@ -1314,9 +1314,9 @@ f32 Player_GetHeight(Player* player) { } f32 Player_GetRunSpeedLimit(Player* player) { - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { return 15.0f; - } else if (player->stateFlags1 & 0x8000000) { + } else if (player->stateFlags1 & PLAYER_STATE1_8000000) { return (R_RUN_SPEED_LIMIT / 100.0f) * 0.6f; } else { return R_RUN_SPEED_LIMIT / 100.0f; @@ -1324,7 +1324,7 @@ f32 Player_GetRunSpeedLimit(Player* player) { } s32 func_800B7118(Player* player) { - return player->stateFlags1 & 0x8; + return player->stateFlags1 & PLAYER_STATE1_8; } s32 func_800B7128(Player* player) { @@ -1334,7 +1334,7 @@ s32 func_800B7128(Player* player) { s32 func_800B715C(PlayState* play) { Player* player = GET_PLAYER(play); - return player->stateFlags2 & 0x8; + return player->stateFlags2 & PLAYER_STATE2_8; } void Actor_SetCameraHorseSetting(PlayState* play, Player* player) { @@ -1349,12 +1349,12 @@ void Actor_SetCameraHorseSetting(PlayState* play, Player* player) { void Actor_MountHorse(PlayState* play, Player* player, Actor* horse) { player->rideActor = horse; - player->stateFlags1 |= 0x800000; + player->stateFlags1 |= PLAYER_STATE1_800000; horse->child = &player->actor; } s32 func_800B7200(Player* player) { - return (player->stateFlags1 & 0x20000080) || (player->csMode != 0); + return (player->stateFlags1 & (PLAYER_STATE1_20000000 | PLAYER_STATE1_80)) || (player->csMode != 0); } void func_800B722C(GameState* gameState, Player* player) { @@ -1999,13 +1999,16 @@ s32 Actor_HasParent(Actor* actor, PlayState* play) { s32 Actor_PickUp(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) { + if (!(player->stateFlags1 & + (PLAYER_STATE1_80 | PLAYER_STATE1_1000 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000)) && + Player_GetExplosiveHeld(player) < 0) { if ((actor->xzDistToPlayer <= xzRange) && (fabsf(actor->playerHeightRel) <= fabsf(yRange))) { if ((getItemId == GI_MASK_CIRCUS_LEADER || getItemId == GI_PENDANT_OF_MEMORIES || getItemId == GI_DEED_LAND || ((player->heldActor != NULL || actor == player->targetActor) && (getItemId > GI_NONE && getItemId < GI_MAX))) || - !(player->stateFlags1 & 0x20000800)) { + !(player->stateFlags1 & (PLAYER_STATE1_800 | PLAYER_STATE1_20000000))) { s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; s32 absYawDiff = ABS_ALT(yawDiff); @@ -2081,7 +2084,9 @@ s32 Actor_HasRider(PlayState* play, Actor* horse) { s32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x003C7880)) { + if (!(player->stateFlags1 & + (PLAYER_STATE1_80 | PLAYER_STATE1_800 | PLAYER_STATE1_1000 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | + PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000))) { player->rideActor = horse; player->mountSide = mountSide; ActorCutscene_SetIntentToPlay(0x7C); @@ -2353,7 +2358,7 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) { if (((params->unk_08) && !(actor->flags & params->unk_08)) || ((tmp = (params->unk_08 == 0)) && (!(actor->flags & ACTOR_FLAG_100000) || - ((actor->category == ACTORCAT_EXPLOSIVES) && (params->player->stateFlags1 & 0x200))) && + ((actor->category == ACTORCAT_EXPLOSIVES) && (params->player->stateFlags1 & PLAYER_STATE1_200))) && (params->unkC != 0) && (actor != params->unk10) && ((actor != params->player->heldActor)) && (actor->parent != ¶ms->player->actor))) { CollisionCheck_ResetDamage(&actor->colChkInfo); @@ -2395,9 +2400,35 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) { return nextActor; } -u32 D_801AED58[] = { - 0x100002C2, 0x100002C2, 0x00000200, 0x100006C2, 0x00000282, 0x300002C2, - 0x10000282, 0x00000002, 0x300002C2, 0x100006C2, 0x00000002, 0x100002C2, +u32 D_801AED58[ACTORCAT_MAX] = { + /* ACTORCAT_SWITCH */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000, + /* ACTORCAT_BG */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000, + /* ACTORCAT_PLAYER */ + PLAYER_STATE1_200, + /* ACTORCAT_EXPLOSIVES */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_400 | + PLAYER_STATE1_10000000, + /* ACTORCAT_NPC */ + PLAYER_STATE1_2 | PLAYER_STATE1_80 | PLAYER_STATE1_200, + /* ACTORCAT_ENEMY */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000 | + PLAYER_STATE1_20000000, + /* ACTORCAT_PROP */ + PLAYER_STATE1_2 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000, + /* ACTORCAT_ITEMACTION */ + PLAYER_STATE1_2, + /* ACTORCAT_MISC */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000 | + PLAYER_STATE1_20000000, + /* ACTORCAT_BOSS */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_400 | + PLAYER_STATE1_10000000, + /* ACTORCAT_DOOR */ + PLAYER_STATE1_2, + /* ACTORCAT_CHEST */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000, }; void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { @@ -2427,13 +2458,13 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { tmp = D_801AED58; - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { params.unk_08 = 0x2000000; } else { params.unk_08 = 0; } - if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x1900)) { + if ((player->stateFlags1 & PLAYER_STATE1_40) && ((player->actor.textId & 0xFF00) != 0x1900)) { params.unk10 = player->targetActor; } else { params.unk10 = NULL; @@ -2486,7 +2517,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { } } - if (!(player->stateFlags1 & 2)) { + if (!(player->stateFlags1 & PLAYER_STATE1_2)) { func_800B5814(&actorCtx->targetContext, player, actor, &play->state); } @@ -2835,7 +2866,7 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) { if (play->actorCtx.lensActive) { Math_StepToC(&play->actorCtx.lensMaskSize, LENS_MASK_ACTIVE_SIZE, 20); - if (GET_PLAYER(play)->stateFlags2 & 0x8000000) { + if (GET_PLAYER(play)->stateFlags2 & PLAYER_STATE2_8000000) { Actor_DeactivateLens(play); } } else { @@ -3658,7 +3689,7 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16 s32 Actor_IsTargeted(PlayState* play, Actor* actor) { Player* player = GET_PLAYER(play); - if ((player->stateFlags3 & 0x80000000) && actor->isTargeted) { + if ((player->stateFlags3 & PLAYER_STATE3_80000000) && actor->isTargeted) { return true; } @@ -3671,7 +3702,7 @@ s32 Actor_IsTargeted(PlayState* play, Actor* actor) { s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor) { Player* player = GET_PLAYER(play); - if ((player->stateFlags3 & 0x80000000) && !actor->isTargeted) { + if ((player->stateFlags3 & PLAYER_STATE3_80000000) && !actor->isTargeted) { return true; } diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index edaa159c6..0e36f1c54 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" Vec3f D_801EDE00; diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 25b2b471a..646b91522 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "z64quake.h" #include "z64rumble.h" @@ -270,10 +271,10 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c gSaveContext.save.playerForm = PLAYER_FORM_DEKU; break; case 0x17: - player->stateFlags2 |= 0x4000000; + player->stateFlags2 |= PLAYER_STATE2_4000000; break; case 0x18: - player->stateFlags2 &= ~0x4000000; + player->stateFlags2 &= ~PLAYER_STATE2_4000000; break; case 0x19: sCutsceneStoredPlayerForm = gSaveContext.save.playerForm; diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index a07e31e2f..969368e26 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -487,7 +487,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { EnItem00* this = THIS; s32 pad; Player* player = GET_PLAYER(play); - s32 sp38 = player->stateFlags3 & 0x1000; + s32 sp38 = player->stateFlags3 & PLAYER_STATE3_1000; s32 getItemId = GI_NONE; s32 params; diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index a096aaabe..ce23b6506 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -79,7 +79,7 @@ void KaleidoSetup_Update(PlayState* play) { if (!Play_InCsMode(play) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) { if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) && (gSaveContext.magicState != MAGIC_STATE_FILL)) { - if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & 0x20)) { + if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & PLAYER_STATE1_20)) { if (!(play->actorCtx.flags & ACTORCTX_FLAG_1) && !(play->actorCtx.flags & ACTORCTX_FLAG_2)) { if ((play->actorCtx.unk268 == 0) && CHECK_BTN_ALL(input->press.button, BTN_START)) { diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 6f4198fc7..a6f45dccb 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1,9 +1,38 @@ +#include "prevent_bss_reordering.h" #include "global.h" +#include "objects/gameplay_keep/gameplay_keep.h" + +#include "objects/object_link_boy/object_link_boy.h" #include "objects/object_link_goron/object_link_goron.h" #include "objects/object_link_zora/object_link_zora.h" +#include "objects/object_link_nuts/object_link_nuts.h" +#include "objects/object_link_child/object_link_child.h" +#include "objects/object_mask_truth/object_mask_truth.h" +#include "objects/object_mask_kerfay/object_mask_kerfay.h" +#include "objects/object_mask_yofukasi/object_mask_yofukasi.h" +#include "objects/object_mask_rabit/object_mask_rabit.h" +#include "objects/object_mask_ki_tan/object_mask_ki_tan.h" +#include "objects/object_mask_json/object_mask_json.h" +#include "objects/object_mask_romerny/object_mask_romerny.h" +#include "objects/object_mask_zacho/object_mask_zacho.h" +#include "objects/object_mask_posthat/object_mask_posthat.h" #include "objects/object_mask_meoto/object_mask_meoto.h" +#include "objects/object_mask_bigelf/object_mask_bigelf.h" +#include "objects/object_mask_gibudo/object_mask_gibudo.h" +#include "objects/object_mask_gero/object_mask_gero.h" +#include "objects/object_mask_dancer/object_mask_dancer.h" +#include "objects/object_mask_skj/object_mask_skj.h" +#include "objects/object_mask_stone/object_mask_stone.h" +#include "objects/object_mask_bree/object_mask_bree.h" +#include "objects/object_mask_bakuretu/object_mask_bakuretu.h" +#include "objects/object_mask_bu_san/object_mask_bu_san.h" +#include "objects/object_mask_kyojin/object_mask_kyojin.h" +#include "objects/object_mask_boy/object_mask_boy.h" +#include "objects/object_mask_goron/object_mask_goron.h" +#include "objects/object_mask_zora/object_mask_zora.h" +#include "objects/object_mask_nuts/object_mask_nuts.h" void PlayerCall_Init(Actor* thisx, PlayState* play); void PlayerCall_Destroy(Actor* thisx, PlayState* play); @@ -17,15 +46,34 @@ typedef struct { /* 0x1A */ s16 unk_1A; } struct_801F58B0; // size = 0x1C -extern struct_801F58B0 D_801F58B0[3][3]; +struct_801F58B0 D_801F58B0[3][3]; -extern s32 D_801F59C8[2]; +Vec3f D_801F59B0[2]; -extern s32 D_801F59E0; +s32 D_801F59C8[2]; -extern Vec3f D_801F59E8; +typedef struct { + /* 0x0 */ s16 unk_0; + /* 0x2 */ s16 unk_2; + /* 0x4 */ s16 unk_4; + /* 0x6 */ s16 unk_6; + /* 0x8 */ s16 unk_8; +} struct_801F59D0; // size = 0xA -void func_80127B64(struct_801F58B0 arg0[], UNK_TYPE arg1, Vec3f* arg2); +struct_801F59D0 D_801F59D0; + +Vec3f* D_801F59DC; + +s32 D_801F59E0; + +s32 D_801F59E4; + +Vec3f D_801F59E8; + +s32 D_801F59F4; +s32 D_801F59F8; + +void func_80127B64(struct_801F58B0 arg0[], s32 count, Vec3f* arg2); s32 func_801226E0(PlayState* play, s32 arg1) { if (arg1 == 0) { @@ -103,8 +151,6 @@ void func_801229A0(PlayState* play, Player* player) { void func_801229EC(UNK_TYPE arg0, UNK_TYPE arg1) { } -extern s16 sMaskObjectIds[PLAYER_MASK_MAX - 1]; -#if 0 s16 sMaskObjectIds[PLAYER_MASK_MAX - 1] = { OBJECT_MASK_TRUTH, OBJECT_MASK_KERFAY, OBJECT_MASK_YOFUKASI, OBJECT_MASK_RABIT, OBJECT_MASK_KI_TAN, OBJECT_MASK_JSON, OBJECT_MASK_ROMERNY, OBJECT_MASK_ZACHO, OBJECT_MASK_POSTHAT, OBJECT_MASK_MEOTO, @@ -112,7 +158,6 @@ s16 sMaskObjectIds[PLAYER_MASK_MAX - 1] = { OBJECT_MASK_STONE, OBJECT_MASK_BREE, OBJECT_MASK_BAKURETU, OBJECT_MASK_BU_SAN, OBJECT_MASK_KYOJIN, OBJECT_MASK_BOY, OBJECT_MASK_GORON, OBJECT_MASK_ZORA, OBJECT_MASK_NUTS, }; -#endif // Load mask object? /** @@ -197,14 +242,11 @@ typedef struct { /* 0x4 */ Gfx* dList; } struct_801BFDD0; // size = 0x08 -extern struct_801BFDD0 D_801BFDD0[]; -#if 0 struct_801BFDD0 D_801BFDD0[] = { { { 180, 200, 255 }, gLinkGoronCurledDL }, { { 155, 0, 0 }, gLinkGoronRollingSpikesAndEffectDL }, { { 255, 0, 0 }, gLinkGoronGoronPunchEffectDL }, }; -#endif void func_80122D44(PlayState* play, struct_80122D44_arg1* arg1) { struct_801BFDD0* temp_s3; @@ -240,8 +282,6 @@ void func_80122D44(PlayState* play, struct_80122D44_arg1* arg1) { CLOSE_DISPS(play->state.gfxCtx); } -extern u8 sMaskItemIds[PLAYER_MASK_MAX - 1]; -#if 0 u8 sMaskItemIds[PLAYER_MASK_MAX - 1] = { ITEM_MASK_TRUTH, // PLAYER_MASK_TRUTH ITEM_MASK_KAFEIS_MASK, // PLAYER_MASK_KAFEIS_MASK @@ -268,7 +308,6 @@ u8 sMaskItemIds[PLAYER_MASK_MAX - 1] = { ITEM_MASK_ZORA, // PLAYER_MASK_ZORA ITEM_MASK_DEKU, // PLAYER_MASK_DEKU }; -#endif u8 Player_MaskIdToItemId(s32 maskIdMinusOne) { return sMaskItemIds[maskIdMinusOne]; @@ -286,8 +325,8 @@ s32 Player_GetCurMaskItemId(PlayState* play) { void func_80122F28(Player* player) { if ((player->actor.category == ACTORCAT_PLAYER) && - (!(player->stateFlags1 & (PLAYER_STATE1_20000000 | PLAYER_STATE1_800000 | PLAYER_STATE1_200000 | - PLAYER_STATE1_800 | PLAYER_STATE1_400))) && + (!(player->stateFlags1 & (PLAYER_STATE1_400 | PLAYER_STATE1_800 | PLAYER_STATE1_200000 | PLAYER_STATE1_800000 | + PLAYER_STATE1_20000000))) && (!(player->stateFlags2 & PLAYER_STATE2_1))) { if (player->doorType < 0) { ActorCutscene_SetIntentToPlay(0x7C); @@ -341,7 +380,20 @@ void func_8012301C(Player* player, PlayState* play2) { } } -extern s16 D_801BFE14[][18]; +FlexSkeletonHeader* gPlayerSkeletons[PLAYER_FORM_MAX] = { + &gLinkFierceDeitySkel, &gLinkGoronSkel, &gLinkZoraSkel, &gLinkDekuSkel, &gLinkHumanSkel, +}; + +s16 D_801BFE14[][18] = { + { 200, 666, 200, 700, 366, 200, 600, 175, 60, 800, 1000, -100, 600, 590, 800, 125, 300, 65 }, + { 200, 1000, 300, 800, 500, 400, 800, 400, 120, 800, 550, -100, 600, 540, 750, 125, 400, 200 }, + { 100, 1000, 300, 800, 250, 200, 800, 200, 90, 800, 350, -80, 600, 540, 750, 60, 200, 200 }, + { 200, 1000, 300, 700, 550, 270, 600, 1000, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, + { 200, 1000, 300, 700, 550, 270, 700, 300, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, + { 200, 1000, 300, 700, 550, 270, 700, 300, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, + { 200, 1000, 300, 700, 550, 270, 700, 200, 120, 800, 600, -140, 600, 590, 750, 125, 200, 130 }, + { 80, 800, 150, 700, 480, 270, 600, 50, 120, 800, 300, -40, 400, 540, 270, 25, 0, 80 }, +}; // OoT's Player_SetBootData void func_80123140(PlayState* play, Player* player) { @@ -403,7 +455,7 @@ void func_80123140(PlayState* play, Player* player) { } s32 Player_InBlockingCsMode(PlayState* play, Player* player) { - return (player->stateFlags1 & (PLAYER_STATE1_20000000 | PLAYER_STATE1_200 | PLAYER_STATE1_80)) || + return (player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_20000000)) || (player->csMode != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) || (play->transitionMode != TRANS_MODE_OFF) || (player->stateFlags1 & PLAYER_STATE1_1) || (player->stateFlags3 & PLAYER_STATE3_80) || (play->actorCtx.unk268 != 0); @@ -420,7 +472,7 @@ s32 func_80123420(Player* player) { } s32 func_80123434(Player* player) { - return player->stateFlags1 & (PLAYER_STATE1_40000000 | PLAYER_STATE1_20000 | PLAYER_STATE1_10000); + return player->stateFlags1 & (PLAYER_STATE1_10000 | PLAYER_STATE1_20000 | PLAYER_STATE1_40000000); } // Unused @@ -478,7 +530,7 @@ s32 func_801235DC(PlayState* play, f32 arg1, s16 arg2) { return false; } -s32 func_8012364C(PlayState* play, Player* player, s32 arg2) { +ItemId func_8012364C(PlayState* play, Player* player, s32 arg2) { if (arg2 >= 4) { return ITEM_NONE; } @@ -506,42 +558,161 @@ s32 func_8012364C(PlayState* play, Player* player, s32 arg2) { } if (arg2 == 1) { - return (gSaveContext.buttonStatus[1] != BTN_DISABLED) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_LEFT] - : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_LEFT] - : ITEM_NONE; + return (gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] != BTN_DISABLED) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_LEFT) + : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_LEFT) + : ITEM_NONE; } if (arg2 == 2) { - return (gSaveContext.buttonStatus[2] != BTN_DISABLED) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_DOWN] - : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_DOWN] - : ITEM_NONE; + return (gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] != BTN_DISABLED) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_DOWN) + : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_DOWN) + : ITEM_NONE; } - return (gSaveContext.buttonStatus[3] != BTN_DISABLED) ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT] - : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT] - : ITEM_NONE; + return (gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] != BTN_DISABLED) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_RIGHT) + : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_RIGHT) + : ITEM_NONE; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123810.s") +u16 sCItemButtons[] = { BTN_CLEFT, BTN_CDOWN, BTN_CRIGHT }; -extern u8 sActionModelGroups[]; +s32 func_80123810(PlayState* play) { + Player* player = GET_PLAYER(play); + s32 temp_v0; + ItemId itemId; + s32 i; -s32 Player_ActionToModelGroup(Player* player, s32 actionParam) { - s32 modelGroup = sActionModelGroups[actionParam]; + if (gSaveContext.save.unk_06 == 0) { + if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, BTN_A | BTN_B)) { + play->interfaceCtx.unk_222 = 0; + play->interfaceCtx.unk_224 = 0; + Interface_SetHudVisibility(play->msgCtx.unk_120BC); + return -1; + } + } else { + gSaveContext.save.unk_06--; + } - if ((modelGroup == 2) && Player_IsGoronOrDeku(player)) { - return 1; + for (i = 0; i < ARRAY_COUNT(sCItemButtons); i++) { + if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, sCItemButtons[i])) { + i++; + itemId = func_8012364C(play, player, i); + + play->interfaceCtx.unk_222 = 0; + play->interfaceCtx.unk_224 = 0; + Interface_SetHudVisibility(play->msgCtx.unk_120BC); + + if ((itemId >= ITEM_FD) || (temp_v0 = play->unk_18794(play, player, itemId, i), (temp_v0 < 0))) { + play_sound(NA_SE_SY_ERROR); + return -1; + } else { + s32 pad; + + player->heldItemButton = i; + return temp_v0; + } + } + } + + return 0; +} + +// Used to map action params to model groups +u8 sActionModelGroups[PLAYER_AP_MAX] = { + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_NONE + PLAYER_MODELGROUP_13, // PLAYER_AP_LAST_USED + PLAYER_MODELGROUP_STICK, // PLAYER_AP_FISHING_ROD + PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_AP_SWORD_KOKIRI + PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_AP_SWORD_RAZOR + PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_AP_SWORD_GILDED + PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_AP_SWORD_GREAT_FAIRY + PLAYER_MODELGROUP_STICK, // PLAYER_AP_STICK + PLAYER_MODELGROUP_ZORA_FINS, // PLAYER_AP_ZORA_FINS + PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW + PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW_FIRE + PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW_ICE + PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW_LIGHT + PLAYER_MODELGROUP_HOOKSHOT, // PLAYER_AP_HOOKSHOT + PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_AP_BOMB + PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_AP_POWDER_KEG + PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_AP_BOMBCHU + PLAYER_MODELGROUP_8, // PLAYER_AP_11 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_NUT + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_PICTO_BOX + PLAYER_MODELGROUP_INSTRUMENT, // PLAYER_AP_OCARINA + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_FISH + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_SPRING_WATER + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_HOT_SPRING_WATER + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_ZORA_EGG + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_DEKU_PRINCESS + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_GOLD_DUST + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_1C + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_SEAHORSE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_MUSHROOM + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_HYLIAN_LOACH + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_BUG + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_BIG_POE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POTION_RED + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POTION_BLUE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POTION_GREEN + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_MILK + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_MILK_HALF + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_CHATEAU + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_FAIRY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MOON_TEAR + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_LAND + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_ROOM_KEY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_LETTER_TO_KAFEI + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MAGIC_BEANS + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_SWAMP + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_MOUNTAIN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_OCEAN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_32 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_LETTER_MAMA + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_34 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_35 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_PENDANT_OF_MEMORIES + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_37 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_38 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_39 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_TRUTH + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_KAFEIS_MASK + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_ALL_NIGHT + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_BUNNY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_KEATON + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GARO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_ROMANI + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_CIRCUS_LEADER + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_POSTMAN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_COUPLE + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GREAT_FAIRY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GIBDO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_DON_GERO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_KAMARO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_CAPTAIN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_STONE + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_BREMEN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_BLAST + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_SCENTS + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GIANT + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_FIERCE_DEITY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GORON + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_ZORA + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_DEKU + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_LENS +}; + +PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerActionParam actionParam) { + PlayerModelGroup modelGroup = sActionModelGroups[actionParam]; + + if ((modelGroup == PLAYER_MODELGROUP_ONE_HAND_SWORD) && Player_IsGoronOrDeku(player)) { + return PLAYER_MODELGROUP_1; } return modelGroup; } -extern u8 D_801BFF90[PLAYER_FORM_MAX]; -#if 0 u8 D_801BFF90[PLAYER_FORM_MAX] = { PLAYER_BOOTS_FIERCE_DEITY, // PLAYER_FORM_FIERCE_DEITY PLAYER_BOOTS_GORON, // PLAYER_FORM_GORON @@ -549,10 +720,7 @@ u8 D_801BFF90[PLAYER_FORM_MAX] = { PLAYER_BOOTS_DEKU, // PLAYER_FORM_DEKU PLAYER_BOOTS_HYLIAN, // PLAYER_FORM_HUMAN }; -#endif -extern u8 sPlayerStrengths[PLAYER_FORM_MAX]; -#if 0 u8 sPlayerStrengths[PLAYER_FORM_MAX] = { PLAYER_STRENGTH_HUMAN, // PLAYER_FORM_FIERCE_DEITY PLAYER_STRENGTH_GORON, // PLAYER_FORM_GORON @@ -560,44 +728,470 @@ u8 sPlayerStrengths[PLAYER_FORM_MAX] = { PLAYER_STRENGTH_DEKU, // PLAYER_FORM_DEKU PLAYER_STRENGTH_HUMAN, // PLAYER_FORM_HUMAN }; -#endif typedef struct { /* 0x00 */ u8 flag; /* 0x02 */ u16 textId; } TextTriggerEntry; // size = 0x04 -extern TextTriggerEntry sEnvironmentTextTriggers[]; // These textIds are OoT remnants. The corresponding text entries are not present in this game, and so these don't point // to anything relevant. -#if 0 TextTriggerEntry sEnvironmentTextTriggers[] = { { 1, 0x26FC }, { 2, 0x26FD }, { 0, 0 }, { 2, 0x26FD }, }; -#endif -extern Gfx** sPlayerDListGroups[]; +PlayerModelIndices gPlayerModelTypes[PLAYER_MODELGROUP_MAX] = { + /* PLAYER_MODELGROUP_0 */ + { PLAYER_ANIMTYPE_2, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_SHIELD, PLAYER_MODELTYPE_SHEATH_12, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_1 */ + { PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_15, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_ONE_HAND_SWORD */ + { PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_SHIELD, PLAYER_MODELTYPE_SHEATH_13, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_DEFAULT */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_4 */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_TWO_HAND_SWORD */ + { PLAYER_ANIMTYPE_3, PLAYER_MODELTYPE_LH_TWO_HAND_SWORD, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_BOW */ + { PLAYER_ANIMTYPE_4, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_BOW, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_EXPLOSIVES */ + { PLAYER_ANIMTYPE_5, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_8 */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_4, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_HOOKSHOT */ + { PLAYER_ANIMTYPE_4, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_HOOKSHOT, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_STICK */ + { PLAYER_ANIMTYPE_3, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_INSTRUMENT */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_INSTRUMENT, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_BOTTLE */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_BOTTLE, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_13 */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_15, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_ZORA_FINS */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, +}; -void func_801239AC(Player* player) { +/* DLists groups start */ +// Note: Only the ones with size 2 * PLAYER_FORM_MAX + +Gfx* gPlayerWaistDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityWaistDL, gLinkFierceDeityWaistDL, gLinkGoronWaistDL, gLinkGoronWaistDL, gLinkZoraWaistDL, + gLinkZoraWaistDL, gLinkDekuWaistDL, gLinkDekuWaistDL, gLinkHumanWaistDL, gLinkHumanWaistDL, +}; + +Gfx* gPlayerHandHoldingShields[PLAYER_SHIELD_MAX - 1][2] = { + { gLinkHumanRightHandHoldingHylianShieldDL, gLinkHumanRightHandHoldingHylianShieldDL }, + { gLinkHumanRightHandHoldingMirrorShieldDL, gLinkHumanRightHandHoldingMirrorShieldDL }, +}; + +Gfx* gPlayerSheath12DLs[2 * PLAYER_FORM_MAX] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + gLinkDekuSheathDL, + gLinkDekuSheathDL, + gLinkHumanSheathEmptyDL, + gLinkHumanSheathEmptyDL, +}; + +Gfx* gPlayerSheath13DLs[2 * PLAYER_FORM_MAX] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + gLinkDekuSheathDL, + gLinkDekuSheathDL, + gLinkHumanSheathEmptyDL, + gLinkHumanSheathEmptyDL, +}; + +Gfx* gPlayerSheath14DLs[2 * PLAYER_FORM_MAX] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + gLinkDekuSheathDL, + gLinkDekuSheathDL, + gLinkHumanSheathEmptyDL, + gLinkHumanSheathEmptyDL, +}; + +Gfx* gPlayerShields[][2] = { + { gLinkHumanHylianShieldWithMtxDL, gLinkHumanHylianShieldWithMtxDL }, + { gLinkHumanMirrorShieldWithMtxDL, gLinkHumanMirrorShieldWithMtxDL }, +}; + +Gfx* gPlayerSheathedSwords[][2] = { + { gLinkHumanSheathedKokiriSwordDL, gLinkHumanSheathedKokiriSwordDL }, + { gLinkHumanSheathedRazorSwordDL, gLinkHumanSheathedRazorSwordDL }, + { gLinkHumanSheathedGildedSwordDL, gLinkHumanSheathedGildedSwordDL }, +}; + +Gfx* gPlayerSwordSheaths[][2] = { + { gLinkHumanKokiriSwordSheathDL, gLinkHumanKokiriSwordSheathDL }, + { gLinkHumanRazorSwordSheathDL, gLinkHumanRazorSwordSheathDL }, + { gLinkHumanGildedSwordSheathDL, gLinkHumanGildedSwordSheathDL }, +}; + +Gfx* gPlayerLeftHandTwoHandSwordDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandHoldingSwordDL, + gLinkFierceDeityLeftHandHoldingSwordDL, + gLinkGoronLeftHandOpenDL, + gLinkGoronLeftHandOpenDL, + gLinkZoraLeftHandOpenDL, + gLinkZoraLeftHandOpenDL, + gLinkDekuLeftHandDL, + gLinkDekuLeftHandDL, + gLinkHumanLeftHandHoldingGreatFairysSwordDL, + gLinkHumanLeftHandHoldingGreatFairysSwordDL, +}; + +Gfx* gPlayerLeftHandOpenDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, gLinkFierceDeityLeftHandDL, gLinkGoronLeftHandOpenDL, gLinkGoronLeftHandOpenDL, + gLinkZoraLeftHandOpenDL, gLinkZoraLeftHandOpenDL, gLinkDekuLeftHandDL, gLinkDekuLeftHandDL, + gLinkHumanLeftHandOpenDL, gLinkHumanLeftHandOpenDL, +}; + +Gfx* gPlayerLeftHandClosedDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, gLinkFierceDeityLeftHandDL, gLinkGoronLeftHandClosedDL, gLinkGoronLeftHandClosedDL, + gLinkZoraLeftHandClosedDL, gLinkZoraLeftHandClosedDL, gLinkDekuLeftHandDL, gLinkDekuLeftHandDL, + gLinkHumanLeftHandClosedDL, gLinkHumanLeftHandClosedDL, +}; + +Gfx* gPlayerLeftHandOneHandSwordDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, + gLinkFierceDeityLeftHandDL, + gLinkGoronLeftHandOpenDL, + gLinkGoronLeftHandOpenDL, + gLinkZoraLeftHandClosedDL, + gLinkZoraLeftHandClosedDL, + gLinkDekuLeftHandDL, + gLinkDekuLeftHandDL, + gLinkHumanLeftHandHoldingKokiriSwordDL, + gLinkHumanLeftHandHoldingKokiriSwordDL, +}; + +Gfx* D_801C018C[][2] = { + { gLinkHumanLeftHandHoldingKokiriSwordDL, gLinkHumanLeftHandHoldingKokiriSwordDL }, + { gLinkHumanLeftHandHoldingRazorSwordDL, gLinkHumanLeftHandHoldingRazorSwordDL }, + { gLinkHumanLeftHandHoldingGildedSwordDL, gLinkHumanLeftHandHoldingGildedSwordDL }, +}; + +Gfx* gPlayerRightHandOpenDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, gLinkFierceDeityRightHandDL, gLinkGoronRightHandOpenDL, gLinkGoronRightHandOpenDL, + gLinkZoraRightHandOpenDL, gLinkZoraRightHandOpenDL, gLinkDekuRightHandDL, gLinkDekuRightHandDL, + gLinkHumanRightHandOpenDL, gLinkHumanRightHandOpenDL, +}; + +Gfx* gPlayerRightHandClosedDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, gLinkFierceDeityRightHandDL, gLinkGoronRightHandClosedDL, gLinkGoronRightHandClosedDL, + gLinkZoraRightHandClosedDL, gLinkZoraRightHandClosedDL, gLinkDekuRightHandDL, gLinkDekuRightHandDL, + gLinkHumanRightHandClosedDL, gLinkHumanRightHandClosedDL, +}; + +Gfx* gPlayerRightHandBowDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + gLinkFierceDeityRightHandDL, + gLinkGoronRightHandOpenDL, + gLinkGoronRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + gLinkDekuRightHandDL, + gLinkHumanRightHandHoldingBowDL, + gLinkHumanRightHandHoldingBowDL, +}; + +Gfx* gPlayerRightHandInstrumentDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + gLinkFierceDeityRightHandDL, + gLinkGoronRightHandOpenDL, + gLinkGoronRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + gLinkDekuRightHandDL, + gLinkHumanRightHandHoldingOcarinaDL, + gLinkHumanRightHandHoldingOcarinaDL, +}; + +Gfx* gPlayerRightHandHookshotDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + gLinkFierceDeityRightHandDL, + gLinkGoronRightHandOpenDL, + gLinkGoronRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + gLinkDekuRightHandDL, + gLinkHumanRightHandHoldingHookshotDL, + gLinkHumanRightHandHoldingHookshotDL, +}; + +Gfx* gPlayerLeftHandBottleDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, + gLinkFierceDeityLeftHandDL, + gLinkGoronLeftHandHoldBottleDL, + gLinkGoronLeftHandHoldBottleDL, + gLinkZoraLeftHandHoldBottleDL, + gLinkZoraLeftHandHoldBottleDL, + gLinkDekuLeftHandDL, + gLinkDekuLeftHandDL, + gLinkHumanLeftHandHoldBottleDL, + gLinkHumanLeftHandHoldBottleDL, +}; + +/* DLists groups end */ + +Gfx* D_801C0294[PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftForearmDL, gLinkGoronLeftForearmDL, gLinkZoraLeftForearmDL, + gLinkDekuLeftForearmDL, gLinkHumanLeftForearmDL, +}; + +Gfx* D_801C02A8[PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, gLinkGoronLeftHandOpenDL, gLinkZoraLeftHandClosedDL, + gLinkDekuLeftHandDL, gLinkHumanLeftHandClosedDL, +}; + +Gfx* D_801C02BC[PLAYER_FORM_MAX] = { + gLinkFierceDeityRightShoulderDL, gLinkGoronRightShoulderDL, gLinkZoraRightShoulderDL, + gLinkDekuRightShoulderDL, gLinkHumanRightShoulderDL, +}; + +Gfx* D_801C02D0[PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + //! @bug This is in the middle of a texture in the link_goron object. It has the same offset as a link_nuts dlist + 0x060038C0, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + object_link_child_DL_018490, +}; + +Gfx* D_801C02E4[PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + //! @bug This is in the middle of a texture in the link_goron object. It has the same offset as a link_nuts dlist + 0x060038C0, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + object_link_child_DL_017B40, +}; + +// Indexed by model types (left hand, right hand, sheath or waist) +Gfx** sPlayerDListGroups[PLAYER_MODELTYPE_MAX] = { + gPlayerLeftHandOpenDLs, // PLAYER_MODELTYPE_LH_OPEN + gPlayerLeftHandClosedDLs, // PLAYER_MODELTYPE_LH_CLOSED + gPlayerLeftHandOneHandSwordDLs, // PLAYER_MODELTYPE_LH_ONE_HAND_SWORD + gPlayerLeftHandTwoHandSwordDLs, // PLAYER_MODELTYPE_LH_TWO_HAND_SWORD + gPlayerLeftHandOpenDLs, // PLAYER_MODELTYPE_LH_4 + gPlayerLeftHandBottleDLs, // PLAYER_MODELTYPE_LH_BOTTLE + gPlayerRightHandOpenDLs, // PLAYER_MODELTYPE_RH_OPEN + gPlayerRightHandClosedDLs, // PLAYER_MODELTYPE_RH_CLOSED + gPlayerRightHandClosedDLs, // PLAYER_MODELTYPE_RH_SHIELD + gPlayerRightHandBowDLs, // PLAYER_MODELTYPE_RH_BOW + gPlayerRightHandInstrumentDLs, // PLAYER_MODELTYPE_RH_INSTRUMENT + gPlayerRightHandHookshotDLs, // PLAYER_MODELTYPE_RH_HOOKSHOT + gPlayerSheath12DLs, // PLAYER_MODELTYPE_SHEATH_12 + gPlayerSheath13DLs, // PLAYER_MODELTYPE_SHEATH_13 + gPlayerSheath14DLs, // PLAYER_MODELTYPE_SHEATH_14 + gPlayerSheath14DLs, // PLAYER_MODELTYPE_SHEATH_15 + gPlayerWaistDLs, // PLAYER_MODELTYPE_WAIST + NULL, // PLAYER_MODELTYPE_17 +}; + +struct_80124618 D_801C0340[] = { + { 0, { 0, 0, 0 } }, { 5, { 0, 0, 0 } }, { 7, { 100, 100, 100 } }, + { 9, { 110, 110, 110 } }, { 11, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0368[] = { + { 0, { 0, 0, 0 } }, { 4, { 0, 0, 0 } }, { 6, { 120, 150, 60 } }, { 8, { 130, 80, 160 } }, + { 9, { 100, 100, 100 } }, { 10, { 90, 100, 90 } }, { 11, { 100, 100, 100 } }, +}; +struct_80124618 D_801C03A0[] = { + { 0, { 100, 100, 100 } }, + { 2, { 120, 120, 120 } }, + { 6, { 90, 90, 90 } }, + { 7, { 93, 93, 93 } }, +}; +struct_80124618 D_801C03C0[] = { + { 0, { 200, 100, 110 } }, + { 2, { 90, 100, 100 } }, + { 3, { 100, 100, 100 } }, + { 7, { 100, 100, 100 } }, +}; +struct_80124618 D_801C03E0[] = { + { 0, { 100, 100, 110 } }, { 2, { 60, 100, 80 } }, { 3, { 130, 105, 110 } }, + { 7, { 130, 105, 110 } }, { 10, { 100, 100, 100 } }, { 19, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0410[] = { + { 0, { 0, 0, 0 } }, + { 2, { 80, 110, 80 } }, + { 3, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0428[] = { + { 0, { 0, 0, 0 } }, { 6, { 0, 0, 0 } }, { 7, { 60, 60, 50 } }, { 8, { 120, 130, 100 } }, + { 9, { 100, 120, 80 } }, { 11, { 100, 100, 100 } }, { 13, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0460[] = { + { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 7, { 100, 74, 80 } }, + { 8, { 100, 180, 130 } }, { 10, { 100, 80, 80 } }, { 13, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0490[] = { + { 0, { 100, 100, 100 } }, { 1, { 100, 100, 100 } }, { 2, { 90, 100, 105 } }, { 4, { 110, 100, 100 } }, + { 5, { 90, 100, 105 } }, { 6, { 100, 100, 100 } }, { 7, { 90, 100, 105 } }, { 8, { 100, 100, 100 } }, + { 9, { 90, 100, 105 } }, { 10, { 100, 100, 100 } }, { 11, { 90, 100, 105 } }, { 12, { 110, 100, 100 } }, + { 13, { 100, 100, 100 } }, { 14, { 90, 100, 105 } }, { 15, { 90, 100, 105 } }, { 17, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0510[] = { + { 0, { 100, 100, 100 } }, { 4, { 100, 100, 100 } }, { 5, { 90, 110, 100 } }, + { 6, { 110, 105, 100 } }, { 8, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0538[] = { + { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 6, { 0, 0, 0 } }, + { 8, { 100, 100, 100 } }, { 14, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0560[] = { + { 0, { 100, 100, 100 } }, + { 2, { 95, 95, 100 } }, + { 3, { 105, 105, 100 } }, + { 5, { 102, 102, 102 } }, +}; +struct_80124618 D_801C0580[] = { + { 0, { 100, 100, 100 } }, { 9, { 100, 100, 100 } }, { 10, { 150, 150, 150 } }, + { 12, { 0, 0, 0 } }, { 14, { 0, 0, 0 } }, +}; +struct_80124618 D_801C05A8[] = { + { 0, { 100, 100, 100 } }, + { 6, { 100, 100, 100 } }, + { 7, { 0, 0, 0 } }, + { 17, { 0, 0, 0 } }, +}; +struct_80124618 D_801C05C8[] = { + { 0, { 0, 0, 0 } }, + { 17, { 50, 50, 50 } }, +}; +struct_80124618 D_801C05D8[] = { + { 0, { 0, 0, 0 } }, + { 5, { 0, 0, 0 } }, + { 9, { 100, 100, 100 } }, +}; +struct_80124618 D_801C05F0[] = { + { 0, { 100, 100, 100 } }, + { 5, { 100, 100, 100 } }, + { 9, { 0, 0, 0 } }, +}; +struct_80124618 D_801C0608[] = { + { 0, { 100, 100, 100 } }, + { 10, { 100, 100, 100 } }, + { 32, { 100, 115, 105 } }, + { 58, { 100, 101, 100 } }, +}; +struct_80124618 D_801C0628[] = { + { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 15, { 100, 100, 105 } }, { 25, { 100, 100, 105 } }, + { 34, { 100, 100, 100 } }, { 46, { 100, 100, 100 } }, { 57, { 100, 100, 105 } }, { 67, { 100, 100, 105 } }, + { 76, { 100, 100, 100 } }, { 78, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0678[] = { + { 0, { 0, 0, 0 } }, + { 6, { 0, 0, 0 } }, + { 8, { 100, 100, 100 } }, + { 11, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0698[] = { + { 0, { 0, 0, 0 } }, + { 7, { 1120, 112, 112 } }, + { 8, { 140, 168, 168 } }, + { 11, { 140, 140, 140 } }, +}; +struct_80124618 D_801C06B8[] = { + { 0, { 100, 100, 100 } }, { 7, { 100, 100, 100 } }, { 8, { 70, 30, 70 } }, { 10, { 0, 0, 0 } }, { 14, { 0, 0, 0 } }, +}; +struct_80124618 D_801C06E0[] = { + { 0, { 140, 140, 140 } }, + { 1, { 0, 0, 0 } }, + { 14, { 0, 0, 0 } }, +}; +struct_80124618 D_801C06F8[] = { + { 0, { 100, 100, 100 } }, + { 5, { 100, 100, 100 } }, + { 6, { 0, 0, 0 } }, + { 10, { 0, 0, 0 } }, +}; +struct_80124618 D_801C0718[] = { + { 0, { 140, 140, 140 } }, + { 1, { 0, 0, 0 } }, + { 10, { 0, 0, 0 } }, +}; +struct_80124618 D_801C0730[] = { + { 0, { 100, 100, 100 } }, + { 13, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0740[] = { + { 0, { 140, 140, 140 } }, + { 13, { 140, 140, 140 } }, +}; +struct_80124618 D_801C0750[] = { + { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 6, { 200, 200, 200 } }, + { 10, { 200, 200, 200 } }, { 11, { 100, 100, 100 } }, +}; + +// alpha values +u8 D_801C0778[] = { + 0, 0, 0, 0, 0, 100, 200, 255, 255, 255, 200, 100, +}; + +struct_80124618 D_801C0784[] = { + { 0, { 100, 100, 100 } }, { 14, { 100, 100, 100 } }, { 15, { 200, 200, 200 } }, + { 16, { 200, 200, 200 } }, { 18, { 100, 100, 100 } }, +}; + +u8 D_801C07AC[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 200, 255, 255, 255, 200, 100, 0, +}; + +void Player_SetModelsForHoldingShield(Player* player) { if (player->stateFlags1 & PLAYER_STATE1_400000) { if ((player->heldItemActionParam < 0) || (player->heldItemActionParam == player->itemActionParam)) { if (!Player_IsHoldingTwoHandedWeapon(player)) { if (!Player_IsGoronOrDeku(player)) { D_801F59E0 = player->transformation * 2; - player->rightHandType = 8; - player->rightHandDLists = &sPlayerDListGroups[8][D_801F59E0]; + player->rightHandType = PLAYER_MODELTYPE_RH_SHIELD; + player->rightHandDLists = &sPlayerDListGroups[PLAYER_MODELTYPE_RH_SHIELD][D_801F59E0]; - if (player->sheathType == 14) { - player->sheathType = 12; - } else if (player->sheathType == 15) { - player->sheathType = 13; + if (player->sheathType == PLAYER_MODELTYPE_SHEATH_14) { + player->sheathType = PLAYER_MODELTYPE_SHEATH_12; + } else if (player->sheathType == PLAYER_MODELTYPE_SHEATH_15) { + player->sheathType = PLAYER_MODELTYPE_SHEATH_13; } player->sheathDLists = &sPlayerDListGroups[player->sheathType][D_801F59E0]; - player->modelAnimType = 2; + player->modelAnimType = PLAYER_ANIMTYPE_2; player->heldItemActionParam = -1; } } @@ -605,43 +1199,43 @@ void func_801239AC(Player* player) { } } -void Player_SetModels(Player* player, s32 modelGroup) { - u8* playerModelTypes; +void Player_SetModels(Player* player, PlayerModelGroup modelGroup) { + PlayerModelIndices* playerModelTypes; D_801F59E0 = player->transformation * 2; - player->leftHandType = gPlayerModelTypes[modelGroup][1]; - player->rightHandType = gPlayerModelTypes[modelGroup][2]; - player->sheathType = gPlayerModelTypes[modelGroup][3]; + player->leftHandType = gPlayerModelTypes[modelGroup].leftHandType; + player->rightHandType = gPlayerModelTypes[modelGroup].rightHandType; + player->sheathType = gPlayerModelTypes[modelGroup].sheathType; - if (player->sheathType == 14) { + if (player->sheathType == PLAYER_MODELTYPE_SHEATH_14) { if (CUR_FORM_EQUIP(EQUIP_SLOT_B) == ITEM_NONE) { - player->sheathType = 15; + player->sheathType = PLAYER_MODELTYPE_SHEATH_15; } } - playerModelTypes = gPlayerModelTypes[modelGroup]; + playerModelTypes = &gPlayerModelTypes[modelGroup]; - player->leftHandDLists = &sPlayerDListGroups[playerModelTypes[1]][D_801F59E0]; - player->rightHandDLists = &sPlayerDListGroups[playerModelTypes[2]][D_801F59E0]; - player->sheathDLists = &sPlayerDListGroups[playerModelTypes[3]][D_801F59E0]; - player->waistDLists = &sPlayerDListGroups[playerModelTypes[4]][D_801F59E0]; + player->leftHandDLists = &sPlayerDListGroups[playerModelTypes->leftHandType][D_801F59E0]; + player->rightHandDLists = &sPlayerDListGroups[playerModelTypes->rightHandType][D_801F59E0]; + player->sheathDLists = &sPlayerDListGroups[playerModelTypes->sheathType][D_801F59E0]; + player->waistDLists = &sPlayerDListGroups[playerModelTypes->waistType][D_801F59E0]; - func_801239AC(player); + Player_SetModelsForHoldingShield(player); } -void Player_SetModelGroup(Player* player, s32 modelGroup) { +void Player_SetModelGroup(Player* player, PlayerModelGroup modelGroup) { player->modelGroup = modelGroup; - if (modelGroup == 1) { - player->modelAnimType = 0; + if (modelGroup == PLAYER_MODELGROUP_1) { + player->modelAnimType = PLAYER_ANIMTYPE_0; } else { - player->modelAnimType = gPlayerModelTypes[modelGroup][0]; + player->modelAnimType = gPlayerModelTypes[modelGroup].modelAnimType; } - if (player->modelAnimType < 3) { + if (player->modelAnimType < PLAYER_ANIMTYPE_3) { if (((player->transformation != PLAYER_FORM_FIERCE_DEITY) && (player->transformation != PLAYER_FORM_HUMAN)) || (player->currentShield == PLAYER_SHIELD_NONE)) { - player->modelAnimType = 0; + player->modelAnimType = PLAYER_ANIMTYPE_0; } } @@ -669,7 +1263,7 @@ void Player_SetEquipmentData(PlayState* play, Player* player) { } } -void func_80123D50(PlayState* play, Player* player, s32 itemId, s32 actionParam) { +void func_80123D50(PlayState* play, Player* player, ItemId itemId, PlayerActionParam actionParam) { Inventory_UpdateBottleItem(play, itemId, player->heldItemButton); if (itemId != ITEM_BOTTLE) { @@ -687,16 +1281,16 @@ void func_80123DA4(Player* player) { void func_80123DC0(Player* player) { if ((player->actor.bgCheckFlags & 1) || - (player->stateFlags1 & (PLAYER_STATE1_8000000 | PLAYER_STATE1_800000 | PLAYER_STATE1_200000)) || - (!(player->stateFlags1 & (PLAYER_STATE1_80000 | PLAYER_STATE1_40000)) && + (player->stateFlags1 & (PLAYER_STATE1_200000 | PLAYER_STATE1_800000 | PLAYER_STATE1_8000000)) || + (!(player->stateFlags1 & (PLAYER_STATE1_40000 | PLAYER_STATE1_80000)) && ((player->actor.world.pos.y - player->actor.floorHeight) < 100.0f))) { - player->stateFlags1 &= ~(PLAYER_STATE1_40000000 | PLAYER_STATE1_80000 | PLAYER_STATE1_40000 | - PLAYER_STATE1_20000 | PLAYER_STATE1_10000 | PLAYER_STATE1_8000); - } else if (!(player->stateFlags1 & (PLAYER_STATE1_200000 | PLAYER_STATE1_80000 | PLAYER_STATE1_40000))) { + player->stateFlags1 &= ~(PLAYER_STATE1_8000 | PLAYER_STATE1_10000 | PLAYER_STATE1_20000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_40000000); + } else if (!(player->stateFlags1 & (PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_200000))) { player->stateFlags1 |= PLAYER_STATE1_80000; } else if ((player->stateFlags1 & PLAYER_STATE1_40000) && (player->transformation == PLAYER_FORM_DEKU)) { player->stateFlags1 &= - ~(PLAYER_STATE1_40000000 | PLAYER_STATE1_20000 | PLAYER_STATE1_10000 | PLAYER_STATE1_8000); + ~(PLAYER_STATE1_8000 | PLAYER_STATE1_10000 | PLAYER_STATE1_20000 | PLAYER_STATE1_40000000); } func_80123DA4(player); @@ -764,7 +1358,7 @@ s32 Player_HasMirrorShieldEquipped(PlayState* play) { s32 Player_IsHoldingMirrorShield(PlayState* play) { Player* player = GET_PLAYER(play); - return (player->transformation == PLAYER_FORM_HUMAN) && (player->rightHandType == 8) && + return (player->transformation == PLAYER_FORM_HUMAN) && (player->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && (player->currentShield == PLAYER_SHIELD_MIRROR_SHIELD); } @@ -776,7 +1370,7 @@ s32 func_801240DC(Player* player) { return Player_IsHoldingHookshot(player) && (player->heldActor == NULL); } -s32 func_80124110(Player* player, s32 actionParam) { +s32 func_80124110(Player* player, PlayerActionParam actionParam) { s32 temp_v0 = actionParam - PLAYER_AP_FISHING_ROD; if (player->transformation != PLAYER_FORM_GORON) { @@ -793,7 +1387,7 @@ s32 func_80124148(Player* player) { return func_80124110(player, player->itemActionParam); } -s32 Player_ActionToMeleeWeapon(s32 actionParam) { +s32 Player_ActionToMeleeWeapon(PlayerActionParam actionParam) { s32 weapon = actionParam - (PLAYER_AP_SWORD_KOKIRI - 1); if ((weapon > 0) && (weapon <= (PLAYER_AP_ZORA_FINS - (PLAYER_AP_SWORD_KOKIRI - 1)))) { @@ -815,7 +1409,7 @@ s32 Player_IsHoldingTwoHandedWeapon(Player* player) { return false; } -s32 Player_ActionToBottle(Player* player, s32 actionParam) { +s32 Player_ActionToBottle(Player* player, PlayerActionParam actionParam) { s32 bottle = actionParam - PLAYER_AP_BOTTLE; // Relies on bottle-related action params to be contiguous @@ -830,7 +1424,7 @@ s32 Player_GetBottleHeld(Player* Player) { return Player_ActionToBottle(Player, Player->itemActionParam); } -s32 Player_ActionToExplosive(Player* player, s32 actionParam) { +s32 Player_ActionToExplosive(Player* player, PlayerActionParam actionParam) { s32 explosive = actionParam - PLAYER_AP_BOMB; // Relies on explosive-related action params to be contiguous @@ -845,8 +1439,7 @@ s32 Player_GetExplosiveHeld(Player* player) { return Player_ActionToExplosive(player, player->itemActionParam); } -// Convert actionParam to sword -s32 func_80124278(Actor* actor, s32 actionParam) { +s32 Player_ActionToSword(Actor* actor, PlayerActionParam actionParam) { s32 sword = 0; //! FAKE: @@ -896,6 +1489,7 @@ s32 Player_GetEnvTimerType(PlayState* play) { return envTimerType + 1; } +void func_80124420(Player* player); #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124420.s") void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2) { @@ -911,7 +1505,6 @@ void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2) { } while (temp_v1 < currentFrame); temp_f0 = arg0[-1].unk_0; - progress = (curFrame - temp_f0) / (temp_v1 - temp_f0); temp_f14 = arg0[-1].unk_2.x; @@ -924,16 +1517,185 @@ void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2) { arg2->z = LERPIMP(temp_f14, arg0->unk_2.z, progress) * 0.01f; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801246F4.s") +struct_80124618 D_801C07C0[] = { + { 0, { 100, 100, 100 } }, { 10, { 100, 100, 100 } }, { 11, { 100, 120, 120 } }, + { 12, { 100, 120, 120 } }, { 14, { 100, 100, 100 } }, { 19, { 100, 100, 100 } }, +}; + +struct_80124618 D_801C07F0[] = { + { 0, { 40, 60, 70 } }, { 3, { 40, 60, 70 } }, { 4, { 75, 90, 85 } }, + { 5, { 110, 120, 100 } }, { 7, { 100, 100, 100 } }, { 8, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0820[] = { + { 0, { 100, 100, 100 } }, + { 7, { 100, 100, 100 } }, + { 12, { 40, 60, 70 } }, +}; +struct_80124618 D_801C0838[] = { + { 0, { 40, 60, 70 } }, + { 7, { 40, 60, 70 } }, + { 12, { 100, 100, 100 } }, +}; + +Gfx gCullBackDList[] = { + gsSPSetGeometryMode(G_CULL_BACK), + gsSPEndDisplayList(), +}; +Gfx gCullFrontDList[] = { + gsSPSetGeometryMode(G_CULL_FRONT), + gsSPEndDisplayList(), +}; + +TexturePtr sPlayerEyesTextures[] = { + gLinkHumanEyesOpenTex, gLinkHumanEyesHalfTex, gLinkHumanEyesClosedTex, gLinkHumanEyesRollRightTex, + gLinkHumanEyesRollLeftTex, gLinkHumanEyesRollUpTex, gLinkHumanEyesRollDownTex, object_link_child_Tex_003800, +}; + +TexturePtr sPlayerMouthTextures[] = { + gLinkHumanMouthClosedTex, + gLinkHumanMouthTeethTex, + gLinkHumanMouthAngryTex, + gLinkHumanMouthHappyTex, +}; + +typedef struct PlayerFaceIndices { + /* 0x00 */ u8 eyeIndex; + /* 0x01 */ u8 mouthIndex; +} PlayerFaceIndices; // size = 0x02 + +PlayerFaceIndices sPlayerFaces[] = { + { PLAYER_EYES_OPEN, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_0 + { PLAYER_EYES_HALF, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_1 + { PLAYER_EYES_CLOSED, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_2 + { PLAYER_EYES_OPEN, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_3 + { PLAYER_EYES_HALF, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_4 + { PLAYER_EYES_CLOSED, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_5 + { PLAYER_EYES_ROLL_LEFT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_6 + { PLAYER_EYES_ROLL_UP, PLAYER_MOUTH_TEETH }, // PLAYER_FACE_7 + { PLAYER_EYES_7, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_8 + { PLAYER_EYES_OPEN, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_9 + { PLAYER_EYES_ROLL_RIGHT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_10 + { PLAYER_EYES_ROLL_LEFT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_11 + { PLAYER_EYES_CLOSED, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_12 + { PLAYER_EYES_HALF, PLAYER_MOUTH_TEETH }, // PLAYER_FACE_13 + { PLAYER_EYES_OPEN, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_14 + { PLAYER_EYES_OPEN, PLAYER_MOUTH_HAPPY }, // PLAYER_FACE_15 +}; + +// Note the correct pointer to pass as the jointTable is the jointTable pointer from the SkelAnime struct, not the +// buffer from the Player struct itself since that one may be misaligned. +void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, + PlayerTransformation playerForm, s32 boots, s32 face, OverrideLimbDrawFlex overrideLimbDraw, + PostLimbDrawFlex postLimbDraw, Actor* actor) { + s32 eyeIndex = (jointTable[22].x & 0xF) - 1; + s32 mouthIndex = ((jointTable[22].x >> 4) & 0xF) - 1; + Gfx* gfx; + + OPEN_DISPS(play->state.gfxCtx); + + gfx = POLY_OPA_DISP; + + if (eyeIndex < 0) { + eyeIndex = sPlayerFaces[face].eyeIndex; + } + + if (playerForm == PLAYER_FORM_GORON) { + if ((eyeIndex >= PLAYER_EYES_ROLL_RIGHT) && (eyeIndex <= PLAYER_EYES_ROLL_DOWN)) { + eyeIndex = PLAYER_EYES_OPEN; + } else if (eyeIndex == PLAYER_EYES_7) { + eyeIndex = PLAYER_EYES_ROLL_RIGHT; + } + } + + gSPSegment(&gfx[0], 0x08, Lib_SegmentedToVirtual(sPlayerEyesTextures[eyeIndex])); + + if (mouthIndex < 0) { + mouthIndex = sPlayerFaces[face].mouthIndex; + } + + gSPSegment(&gfx[1], 0x09, Lib_SegmentedToVirtual(sPlayerMouthTextures[mouthIndex])); + + POLY_OPA_DISP = &gfx[2]; + + D_801F59E0 = playerForm * 2; + D_801F59E4 = lod; + SkelAnime_DrawFlexLod(play, skeleton, jointTable, dListCount, overrideLimbDraw, postLimbDraw, actor, lod); + + CLOSE_DISPS(play->state.gfxCtx); +} + +Vec3f D_801C08C0[PLAYER_FORM_MAX] = { + { 1304.0f, 0.0f, 0.0f }, { 1156.0f, 0.0f, 0.0f }, { 1406.0f, 0.0f, 0.0f }, + { 408.0f, 0.0f, 0.0f }, { 695.0f, 0.0f, 0.0f }, +}; + +f32 D_801C08FC[PLAYER_FORM_MAX] = { + 1265.0f, 1056.0f, 1506.0f, 359.0f, 826.0f, +}; +f32 D_801C0910[PLAYER_FORM_MAX] = { + 170.0416f, 133.63359f, 197.68358f, 16.646399f, 48.302498f, +}; +f32 D_801C0924[PLAYER_FORM_MAX] = { + 10.019104f, 22.120003f, -29.12001f, 3.7582989f, -19.925102f, +}; +f32 D_801C0938[PLAYER_FORM_MAX] = { + 5.0f, 4.0f, 1.0f, 1.0f, 3.0f, +}; #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124870.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124CC4.s") +void func_80124CC4(PlayState* play, Player* player, f32 arg2) { + static Vec3f D_801C094C = { -500.0f, -100.0f, 0.0f }; + CollisionPoly* poly; + s32 bgId; + Vec3f sp7C; + Vec3f sp70; + Vec3f pos; + Vec3f sp58; + f32 sp54; + f32 scale; + + D_801C094C.z = 0.0f; + Matrix_MultVec3f(&D_801C094C, &sp7C); + D_801C094C.z = arg2; + Matrix_MultVec3f(&D_801C094C, &sp70); + + if (BgCheck_AnyLineTest3(&play->colCtx, &sp7C, &sp70, &pos, &poly, true, true, true, true, &bgId)) { + if (!func_800B90AC(play, &player->actor, poly, bgId, &pos) || + BgCheck_ProjectileLineTest(&play->colCtx, &sp7C, &sp70, &pos, &poly, true, true, true, true, &bgId)) { + OPEN_DISPS(play->state.gfxCtx); + + OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 7); + + SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &sp58, &sp54); + if (sp54 < 200.0f) { + scale = 0.08f; + } else { + scale = (sp54 / 200.0f) * 0.08f; + } + Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW); + Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); + + gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.status[player->actor.objBankIndex].segment); + gSPDisplayList(OVERLAY_DISP++, gameplay_keep_DL_04F250); + + CLOSE_DISPS(play->state.gfxCtx); + } + } +} -extern s32 D_801C0958; -#if 0 s32 D_801C0958 = false; -#endif + +Gfx** D_801C095C[] = { + gPlayerLeftHandClosedDLs, + gPlayerLeftHandOpenDLs, +}; +Gfx** D_801C0964[] = { + gPlayerRightHandClosedDLs, + gPlayerRightHandOpenDLs, +}; void func_80124F18(s16* arg0, f32* arg1, s16 arg2, f32 arg3, f32 arg4) { f32 phi_f12; @@ -1067,14 +1829,11 @@ s32 func_801263FC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80126440.s") -extern u8 D_801C096C[PLAYER_SHIELD_MAX]; -#if 0 u8 D_801C096C[PLAYER_SHIELD_MAX] = { COLTYPE_METAL, COLTYPE_METAL, COLTYPE_METAL, }; -#endif void func_801265C8(PlayState* play, Player* player, ColliderQuad* collider, Vec3f arg3[4]) { if (player->stateFlags1 & PLAYER_STATE1_400000) { @@ -1094,6 +1853,146 @@ void func_801265C8(PlayState* play, Player* player, ColliderQuad* collider, Vec3 } } +Vec3f D_801C0970[] = { + { 0.0f, 400.0f, 0.0f }, + { 0.0f, 1400.0f, -1000.0f }, + { 0.0f, -400.0f, 1000.0f }, +}; + +Vec3f D_801C0994[] = { + { 5000.0f, 400.0f, 0.0f }, + { 5000.0f, -400.0f, 1000.0f }, + { 5000.0f, 1400.0f, -1000.0f }, +}; + +Vec3f D_801C09B8[] = { + { 0.0f, 750.0f, 750.0f }, + { 1500.0f, 1500.0f, 1500.0f }, + { -2500.0f, -2000.0f, -3000.0f }, +}; + +Vec3f D_801C09DC[] = { + { 900.0f, 300.0f, 100.0f }, + { 1300.0f, 700.0f, -300.0f }, + { 500.0f, -100.0f, 500.0f }, +}; + +Vec3f D_801C0A00[] = { + { -2500.0f, 1400.0f, 1100.0f }, + { -2900.0f, 1000.0f, 1500.0f }, + { -2100.0f, 1800.0f, 700.0f }, +}; + +Vec3f D_801C0A24[] = { + { 0.0f, 0.0f, 0.0f }, + { -800.0f, 800.0f, 800.0f }, + { -800.0f, -800.0f, -800.0f }, +}; + +Vec3f D_801C0A48[] = { + { 2000.0f, 0.0f, 0.0f }, + { 2800.0f, -800.0f, -800.0f }, + { 2800.0f, 800.0f, 800.0f }, +}; + +Vec3f D_801C0A6C[] = { + { -400.0f, 800.0f, 0.0f }, + { -5000.0f, -500.0f, -4000.0f }, + { -5000.0f, 8000.0f, 4000.0f }, +}; + +Vec3f D_801C0A90[] = { + { -400.0f, 1800.0f, 0.0f }, + { 5000.0f, 8000.0f, 4000.0f }, + { 5000.0f, -500.0f, -4000.0f }, +}; + +Gfx* D_801C0AB4[] = { + object_link_zora_DL_00CC38, + object_link_zora_DL_00CDA0, +}; + +Gfx* D_801C0ABC[] = { + object_link_zora_DL_010868, + object_link_zora_DL_010978, +}; + +Vec3f D_801C0AC4[] = { + { 5400.0f, 1700.0f, 1800.0f }, + { 5400.0f, 1700.0f, -1800.0f }, +}; + +Vec3f D_801C0ADC[] = { + { 5250.0f, 570.0f, 2400.0f }, + { 5250.0f, 570.0f, -2400.0f }, +}; + +struct_80124618* D_801C0AF4[] = { + D_801C0678, + D_801C0698, +}; + +struct_80124618* D_801C0AFC[] = { + D_801C06B8, + D_801C06E0, +}; + +struct_80124618* D_801C0B04[] = { + D_801C06F8, + D_801C0718, +}; + +struct_80124618* D_801C0B0C[] = { + D_801C0730, + D_801C0740, +}; + +Gfx* D_801C0B14[] = { + object_link_nuts_DL_008760, + object_link_nuts_DL_008660, +}; + +u8 D_801C0B1C[] = { + 0x0C, + 0x0F, +}; + +Gfx* D_801C0B20[] = { + object_mask_truth_DL_0001A0, + object_mask_kerfay_DL_000D40, + object_mask_yofukasi_DL_000490, + object_mask_rabit_DL_000610, + object_mask_ki_tan_DL_0004A0, + object_mask_json_DL_0004C0, + object_mask_romerny_DL_0007A0, + object_mask_zacho_DL_000700, + object_mask_posthat_DL_000290, + object_mask_meoto_DL_0005A0, + object_mask_bigelf_DL_0016F0, + object_mask_gibudo_DL_000250, + gDonGeroMaskDL, + object_mask_dancer_DL_000EF0, + object_mask_skj_DL_0009F0, + object_mask_stone_DL_000820, + object_mask_bree_DL_0003C0, + object_mask_bakuretu_DL_0005C0, + object_mask_bu_san_DL_000710, + object_mask_kyojin_DL_000380, + gameplay_keep_DL_00B260, + gameplay_keep_DL_005A10, + gameplay_keep_DL_005360, + gameplay_keep_DL_0056C0, + object_mask_boy_DL_000900, + object_mask_goron_DL_0014A0, + object_mask_zora_DL_000DB0, + object_mask_nuts_DL_001D90, +}; + +Vec3f D_801C0B90[] = { + { 950.0f, -800.0f, 300.0f }, + { 950.0f, -800.0f, -300.0f }, +}; + #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8012669C.s") void Player_DrawGetItemImpl(PlayState* play, Player* player, Vec3f* refPos, s32 drawIdPlusOne) { @@ -1191,21 +2090,270 @@ void Player_DrawCouplesMask(PlayState* play, Player* player) { AnimatedMat_DrawOpa(play, Lib_SegmentedToVirtual(&object_mask_meoto_Matanimheader_001CD8)); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127594.s") +void Player_DrawCircusLeadersMask(PlayState* play, Actor* actor) { + static Vec3f bubbleVelocity = { 0.0f, 0.0f, 0.0f }; + static Vec3f bubbleAccel = { 0.0f, 0.0f, 0.0f }; + Gfx* gfx; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801278F8.s") + OPEN_DISPS(play->state.gfxCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127A60.s") + gfx = POLY_XLU_DISP; + + for (i = 0; i < ARRAY_COUNT(D_801C0B90); i++) { + f32 scaleY = (D_801F59C8[i] / 400.0f) * 0.1f; + + Matrix_MultVec3f(&D_801C0B90[i], &D_801F59B0[i]); + + //! FAKE + if (1) {} + + D_801F59B0[i].y += -10.0f * scaleY; + + if (D_801F59C8[i] < 0x190) { + f32 scaleXZ = CLAMP_MAX(scaleY, 0.05f); + + Matrix_Push(); + Matrix_Translate(D_801F59B0[i].x, D_801F59B0[i].y, D_801F59B0[i].z, MTXMODE_NEW); + Matrix_Scale(scaleXZ, scaleY, scaleXZ, MTXMODE_APPLY); + + gSPMatrix(&gfx[0], Matrix_NewMtx(play->state.gfxCtx), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPSegment(&gfx[1], 0x08, VIRTUAL_TO_PHYSICAL(SEGMENTED_TO_VIRTUAL(gEffBubble1Tex))); + gDPSetPrimColor(&gfx[2], 0, 0, 255, 255, 255, 255); + gDPSetEnvColor(&gfx[3], 150, 150, 150, 0); + gSPDisplayList(&gfx[4], gEffBubbleDL); + gSPPopMatrix(&gfx[5], G_MTX_MODELVIEW); + + Matrix_Pop(); + + gfx = &gfx[6]; + } else { + Player* player = (Player*)actor; + f32 temp_f0 = sqrtf(SQ(player->actor.velocity.x) + SQ(player->actor.velocity.z)); + s16 phi_s0 = temp_f0 * 2000.0f; + f32 temp_f20; + + bubbleVelocity.y = temp_f0 * 0.4f; + bubbleAccel.y = -0.3f; + + if (phi_s0 > 0x3E80) { + phi_s0 = 0x3E80; + } + + phi_s0 = player->actor.focus.rot.y + ((i != 0) ? phi_s0 : -phi_s0); + temp_f20 = temp_f0 * 0.2f; + + if (temp_f20 > 4.0f) { + temp_f20 = 4.0f; + } + + bubbleVelocity.x = -Math_SinS(phi_s0) * temp_f20; + bubbleVelocity.z = -Math_CosS(phi_s0) * temp_f20; + + EffectSsDtBubble_SpawnColorProfile(play, &D_801F59B0[i], &bubbleVelocity, &bubbleAccel, 20, 20, 3, 0); + D_801F59C8[i] -= 0x190; + } + } + + POLY_XLU_DISP = gfx; + + CLOSE_DISPS(play->state.gfxCtx); +} + +void Player_DrawBlastMask(PlayState* play, Player* player) { + static Gfx D_801C0BC0[] = { + gsDPSetEnvColor(0, 0, 0, 255), + gsSPEndDisplayList(), + }; + static Gfx D_801C0BD0[] = { + gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + G_RM_FOG_SHADE_A, + AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)), + gsSPEndDisplayList(), + }; + + OPEN_DISPS(play->state.gfxCtx); + + if (player->unk_B60 != 0) { + s32 alpha; + + gSegments[0xA] = VIRTUAL_TO_PHYSICAL(player->maskObjectSegment); + + AnimatedMat_DrawOpa(play, Lib_SegmentedToVirtual(&object_mask_bakuretu_Matanimheader_0011F8)); + + if (player->unk_B60 < 11) { + alpha = (player->unk_B60 / 10.0f) * 255; + } else { + alpha = 255; + } + + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, (u8)alpha); + gSPDisplayList(POLY_OPA_DISP++, object_mask_bakuretu_DL_000440); + gSPSegment(POLY_OPA_DISP++, 0x09, D_801C0BD0); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, (u8)(255 - alpha)); + } else { + gSPSegment(POLY_OPA_DISP++, 0x09, D_801C0BC0); + } + + CLOSE_DISPS(play->state.gfxCtx); +} + +Vec3f D_801C0BE0 = { 0.0f, 0.3f, 0.0f }; +Vec3f D_801C0BEC = { 0.0f, -0.025f, 0.0f }; +Color_RGBA8 D_801C0BF8 = { 250, 100, 100, 0 }; +Color_RGBA8 D_801C0BFC = { 0, 0, 100, 0 }; + +Vec3f D_801C0C00 = { 0.0f, 20.0f, 0.0f }; + +Vec3f D_801C0C0C[] = { + { 174.0f, -1269.0f, -1.0f }, + { 401.0f, -729.0f, -701.0f }, + { 401.0f, -729.0f, 699.0f }, +}; + +Vec3f D_801C0C30[] = { + { 74.0f, -1269.0f, -1.0f }, + { 301.0f, -729.0f, -701.0f }, + { 301.0f, -729.0f, 699.0f }, +}; + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ Vec3f unk_08; + /* 0x14 */ f32 unk_14; + /* 0x18 */ s16 unk_18; + /* 0x1A */ s16 unk_1A; +} struct_80128388_arg1; // size = 0x1C + +struct_80128388_arg1 D_801C0C54[] = { + { 0.0f, 0x0000, 0x8000, { 0.0f, 0.0f, 0.0f }, 0.0f, 0x0000, 0x0000 }, + { 16.8f, 0x0000, 0x0000, { 0.0f, 0.0f, 0.0f }, 20.0f, 0x1388, 0x1388 }, + { 30.0f, 0x0000, 0x0000, { 0.0f, 0.0f, 0.0f }, 20.0f, 0x1F40, 0x2EE0 }, +}; + +Color_RGB8 D_801C0CA8[] = { + { 255, 255, 255 }, { 80, 80, 255 }, { 136, 192, 255 }, { 136, 192, 255 }, { 184, 232, 232 }, { 248, 200, 0 }, + { 255, 180, 0 }, { 0, 128, 0 }, { 252, 238, 0 }, { 131, 0, 174 }, { 64, 64, 32 }, { 0, 0, 255 }, + { 255, 0, 255 }, { 255, 0, 255 }, { 255, 0, 0 }, { 0, 0, 255 }, { 0, 200, 0 }, { 255, 255, 255 }, + { 255, 255, 255 }, { 255, 255, 255 }, { 80, 80, 255 }, +}; + +Vec3f D_801C0CE8[PLAYER_FORM_MAX] = { + { 0.0f, 0.0f, 0.0f }, { 300.0f, 300.0f, -230.0f }, { 0.0f, 90.0f, -50.0f }, + { 0.0f, 20.0f, -60.0f }, { 0.0f, 0.0f, 0.0f }, +}; +Vec3f D_801C0D24[PLAYER_FORM_MAX] = { + { 200.0f, 300.0f, 0.0f }, { 200.0f, 200.0f, 0.0f }, { 200.0f, 300.0f, 0.0f }, + { 200.0f, 150.0f, 0.0f }, { 200.0f, 200.0f, 0.0f }, +}; +Vec3f D_801C0D60 = { 398.0f, 1419.0f, 244.0f }; +Vec3f D_801C0D6C = { 420.0f, 1210.0f, 380.0f }; + +f32 D_801C0D78[] = { + 0.0f, // Player is not holding a melee weapon + 3000.0f, // PLAYER_AP_SWORD_KOKIRI + 3000.0f, // PLAYER_AP_SWORD_RAZOR + 4000.0f, // PLAYER_AP_SWORD_GILDED + 5500.0f, // PLAYER_AP_SWORD_GREAT_FAIRY + -1.0f, // PLAYER_AP_STICK + 2500.0f, // PLAYER_AP_ZORA_FINS +}; + +Gfx* D_801C0D94 = object_link_child_DL_017818; + +f32 D_801C0D98 = -35.0f; + +f32 D_801C0D9C = -395.0f; +f32 D_801C0DA0 = 0.0f; + +f32 D_801C0DA4 = 0.0f; + +Vec3f D_801C0DA8[4] = { + { -4500.0f, -3000.0f, -600.0f }, + { 1500.0f, -3000.0f, -600.0f }, + { -4500.0f, 3000.0f, -600.0f }, + { 1500.0f, 3000.0f, -600.0f }, +}; + +Vec3f D_801C0DD8 = { 50.0f, 800.0f, 0.0f }; +Vec3f D_801C0DE4 = { 50.0f, 850.0f, 0.0f }; +Gfx* D_801C0DF0[] = { + object_link_goron_DL_010590, object_link_goron_DL_010368, object_link_goron_DL_010140, + object_link_goron_DL_00FF18, object_link_goron_DL_00FCF0, +}; + +Vec2f D_801C0E04[PLAYER_FORM_MAX] = { + { 140.0f, -130.0f }, { 0.0f, -200.0f }, { -160.0f, 0.0f }, { 220.0f, -200.0f }, { 0.0f, 0.0f }, +}; + +Gfx* D_801C0E2C[] = { + object_link_nuts_DL_007A28, object_link_nuts_DL_0077D0, object_link_nuts_DL_007548, + object_link_nuts_DL_007900, object_link_nuts_DL_0076A0, +}; +Vec3f D_801C0E40[PLAYER_FORM_MAX] = { + { 0.0f, 0.0f, 0.0f }, { -578.3f, -1100.9f, 0.0f }, { -189.5f, -594.87f, 0.0f }, + { -570.0f, -812.0f, 0.0f }, { -230.0f, -520.0f, 0.0f }, +}; +Vec3f D_801C0E7C = { 1100.0f, -700.0f, 0.0f }; + +// unused +Vec3f D_801C0E88 = { 1600.0f, -1700.0f, -70.0f }; + +Vec3f D_801C0E94 = { 1800.0f, -300.0f, 0.0f }; +Vec3f D_801C0EA0 = { 1300.0f, -400.0f, 0.0f }; +Vec3f D_801C0EAC = { 630.0f, 100.0f, -30.0f }; +Vec3s D_801C0EB8 = { 0, 0, 0x7FFF }; + +#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/Player_DrawBunnyHood.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127B64.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127BE8.s") +void func_80127DA4(PlayState* play, struct_801F58B0 arg1[], struct_80128388_arg1 arg2[], s32 arg3, Vec3f* arg4, + Vec3f* arg5, u32* arg6); #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127DA4.s") +void func_80128388(struct_801F58B0 arg0[], struct_80128388_arg1 arg1[], s32 arg2, Mtx** arg3); #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80128388.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801284A0.s") +void Player_DrawGreatFairysMask(PlayState* play, Player* player) { + s32 pad; + Mtx* sp90 = GRAPH_ALLOC(play->state.gfxCtx, 6 * sizeof(Mtx)); + Vec3f sp84; + Vec3f sp78; + Vec3f* iter = D_801C0C0C; + Vec3f* iter2 = D_801C0C30; + u32 sp6C = play->gameplayFrames; + s32 i; + + OPEN_DISPS(play->state.gfxCtx); + + gSPSegment(POLY_OPA_DISP++, 0x0B, sp90); + + Matrix_MultVec3f(&D_801C0C00, &D_801C0C54[1].unk_08); + Math_Vec3f_Lerp(&player->bodyPartsPos[7], &player->bodyPartsPos[0], 0.2f, &D_801C0C54[2].unk_08); + + for (i = 0; i < ARRAY_COUNT(D_801C0C0C); i++) { + Matrix_MultVec3f(iter, &sp84); + Matrix_MultVec3f(iter2, &sp78); + + func_80127DA4(play, D_801F58B0[i], D_801C0C54, 3, &sp84, &sp78, &sp6C); + sp6C += 11; + + Matrix_Push(); + Matrix_Translate(iter->x, iter->y, iter->z, MTXMODE_APPLY); + func_80128388(D_801F58B0[i], D_801C0C54, 3, &sp90); + Matrix_Pop(); + iter++; + iter2++; + } + + CLOSE_DISPS(play->state.gfxCtx); +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80128640.s") diff --git a/src/code/z_shrink_window.c b/src/code/z_shrink_window.c index acbdb5c5b..21d8bde40 100644 --- a/src/code/z_shrink_window.c +++ b/src/code/z_shrink_window.c @@ -2,7 +2,7 @@ * File: z_shrink_window.c * Description: Draws black top/bottom/side borders on the viewing window (e.g. Z-targeting, talking to NPC) */ -#include "prevent_bss_reordering.h" + #include "global.h" #include "z64shrink_window.h" diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 8325427ad..8d0b2e2d8 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -107,9 +107,10 @@ void ArmsHook_DetachHookFromActor(ArmsHook* this) { s32 ArmsHook_CheckForCancel(ArmsHook* this) { Player* player = (Player*)this->actor.parent; + if (Player_IsHoldingHookshot(player)) { - if ((player->heldItemActionParam != player->itemActionParam) || ((player->actor.flags & ACTOR_FLAG_100)) || - ((player->stateFlags1 & 0x4000080))) { + if ((player->heldItemActionParam != player->itemActionParam) || (player->actor.flags & ACTOR_FLAG_100) || + (player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_4000000))) { this->timer = 0; ArmsHook_DetachHookFromActor(this); Math_Vec3f_Copy(&this->actor.world.pos, &player->rightHandWorld.pos); @@ -143,7 +144,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { if ((touchedActor->update != NULL) && (touchedActor->flags & (ACTOR_FLAG_200 | ACTOR_FLAG_400))) { if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) { ArmsHook_AttachHookToActor(this, touchedActor); - if ((touchedActor->flags & ACTOR_FLAG_400) == ACTOR_FLAG_400) { + if (CHECK_FLAG_ALL(touchedActor->flags, ACTOR_FLAG_400)) { func_808C1154(this); } } @@ -155,28 +156,25 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { } if (DECR(this->timer) == 0) { - Actor* grabbed; + Actor* grabbed = this->grabbed; Vec3f bodyDistDiffVec; Vec3f newPos; f32 bodyDistDiff; f32 phi_f16; s32 pad; - grabbed = this->grabbed; if (grabbed != NULL) { if ((grabbed->update == NULL) || !CHECK_FLAG_ALL(grabbed->flags, ACTOR_FLAG_2000)) { grabbed = NULL; this->grabbed = NULL; - } else { - if (this->actor.child != NULL) { - f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed); - f32 sp90 = sqrtf(SQXYZ(this->unk1FC)); + } else if (this->actor.child != NULL) { + f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed); + f32 sp90 = sqrtf(SQXYZ(this->unk1FC)); - Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos); - if (50.0f < (sp94 - sp90)) { - ArmsHook_DetachHookFromActor(this); - grabbed = NULL; - } + Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos); + if (50.0f < (sp94 - sp90)) { + ArmsHook_DetachHookFromActor(this); + grabbed = NULL; } } } @@ -257,11 +255,10 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { this->actor.world.pos.z += 10.0f * nz; this->timer = 1; if (SurfaceType_IsHookshotSurface(&play->colCtx, poly, bgId)) { - { - DynaPolyActor* dynaPolyActor; - if (bgId != BGCHECK_SCENE && (dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId)) != NULL) { - ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor); - } + DynaPolyActor* dynaPolyActor; + + if ((bgId != BGCHECK_SCENE) && (dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId)) != NULL) { + ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor); } func_808C1154(this); Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_IT_HOOKSHOT_STICK_OBJ); @@ -269,12 +266,11 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { CollisionCheck_SpawnShieldParticlesMetal(play, &this->actor.world.pos); Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_IT_HOOKSHOT_REFLECT); } - } else { - if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, - BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { - s32 pad; - this->timer = 1; - } + } else if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, + BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { + s32 pad; + + this->timer = 1; } } } @@ -286,19 +282,19 @@ void ArmsHook_Update(Actor* thisx, PlayState* play) { this->unk1EC = this->unk1E0; } -static Vec3f D_808C1C10 = { 0.0f, 0.0f, 0.0f }; -static Vec3f D_808C1C1C = { 0.0f, 0.0f, 900.0f }; -static Vec3f D_808C1C28 = { 0.0f, 500.0f, -3000.0f }; -static Vec3f D_808C1C34 = { 0.0f, -500.0f, -3000.0f }; -static Vec3f D_808C1C40 = { 0.0f, 500.0f, 0.0f }; -static Vec3f D_808C1C4C = { 0.0f, -500.0f, 0.0f }; +Vec3f D_808C1C10 = { 0.0f, 0.0f, 0.0f }; +Vec3f D_808C1C1C = { 0.0f, 0.0f, 900.0f }; +Vec3f D_808C1C28 = { 0.0f, 500.0f, -3000.0f }; +Vec3f D_808C1C34 = { 0.0f, -500.0f, -3000.0f }; +Vec3f D_808C1C40 = { 0.0f, 500.0f, 0.0f }; +Vec3f D_808C1C4C = { 0.0f, -500.0f, 0.0f }; void ArmsHook_Draw(Actor* thisx, PlayState* play) { ArmsHook* this = THIS; f32 f0; Player* player = GET_PLAYER(play); - if (player->actor.draw != NULL && player->rightHandType == 0xB) { + if ((player->actor.draw != NULL) && (player->rightHandType == PLAYER_MODELTYPE_RH_HOOKSHOT)) { Vec3f sp68; Vec3f sp5C; Vec3f sp50; @@ -311,13 +307,13 @@ void ArmsHook_Draw(Actor* thisx, PlayState* play) { Matrix_MultVec3f(&D_808C1C10, &this->unk1E0); Matrix_MultVec3f(&D_808C1C28, &sp5C); Matrix_MultVec3f(&D_808C1C34, &sp50); - this->unk_1C4.active = false; + this->weaponInfo.active = false; } else { Matrix_MultVec3f(&D_808C1C1C, &this->unk1E0); Matrix_MultVec3f(&D_808C1C40, &sp5C); Matrix_MultVec3f(&D_808C1C4C, &sp50); } - func_80126440(play, &this->collider, &this->unk_1C4, &sp5C, &sp50); + func_80126440(play, &this->collider, &this->weaponInfo, &sp5C, &sp50); func_8012C28C(play->state.gfxCtx); func_80122868(play, player); diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h index 7afe3a2ce..95208ba4f 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h @@ -10,7 +10,7 @@ typedef void (*ArmsHookActionFunc)(struct ArmsHook*, PlayState*); typedef struct ArmsHook { /* 0x000 */ Actor actor; /* 0x144 */ ColliderQuad collider; - /* 0x1C4 */ WeaponInfo unk_1C4; + /* 0x1C4 */ WeaponInfo weaponInfo; /* 0x1E0 */ Vec3f unk1E0; /* 0x1EC */ Vec3f unk1EC; /* 0x1F8 */ Actor* grabbed; diff --git a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c index 6026e139b..203b404a8 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c @@ -390,7 +390,7 @@ void func_80A2A32C(BgDblueMovebg* this, PlayState* play) { this->unk_172 |= 8; this->actionFunc = func_80A2A444; } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -410,7 +410,7 @@ void func_80A2A444(BgDblueMovebg* this, PlayState* play) { this->dyna.actor.shape.rot.y = (s32)((this->unk_18C + temp_v0) * 0.1f * (0x10000 / 360.0f)) + this->dyna.actor.home.rot.y; - if ((player->stateFlags2 & 0x10) && (this->unk_184 > 0.0f)) { + if ((player->stateFlags2 & PLAYER_STATE2_10) && (this->unk_184 > 0.0f)) { player->actor.world.pos.x = (Math_SinS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.x; player->actor.world.pos.z = @@ -420,7 +420,7 @@ void func_80A2A444(BgDblueMovebg* this, PlayState* play) { } if (sp20) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; Flags_SetSwitch(play, this->unk_1C0); Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); @@ -498,7 +498,7 @@ void func_80A2A7F8(BgDblueMovebg* this, PlayState* play) { this->dyna.actor.shape.rot.y = (s32)((this->unk_18C + sp26) * 0.1f * (0x10000 / 360.0f)) + this->dyna.actor.home.rot.y; - if ((player->stateFlags2 & 0x10) && (this->unk_184 > 0.0f)) { + if ((player->stateFlags2 & PLAYER_STATE2_10) && (this->unk_184 > 0.0f)) { player->actor.world.pos.x = (Math_SinS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.x; player->actor.world.pos.z = @@ -516,8 +516,8 @@ void func_80A2A7F8(BgDblueMovebg* this, PlayState* play) { Flags_UnsetSwitch(play, this->unk_1C0); } - player->stateFlags1 |= 0x20; - player->stateFlags2 &= ~0x10; + player->stateFlags1 |= PLAYER_STATE1_20; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; this->unk_18C = (this->unk_18C + sp26 + 3600) % 3600; @@ -565,12 +565,12 @@ void func_80A2AAB8(BgDblueMovebg* this, PlayState* play) { if (this->unk_1D0 == 1) { this->dyna.pushForce = 0.0f; - player->stateFlags1 |= 0x20; - player->stateFlags2 &= ~0x10; + player->stateFlags1 |= PLAYER_STATE1_20; + player->stateFlags2 &= ~PLAYER_STATE2_10; } if (this->unk_1D0 <= 0) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actionFunc = func_80A2A714; } } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c index 0a4c31d12..689dcd76c 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c @@ -240,7 +240,7 @@ void func_80B7F0D0(BgIkanaBlock* this, PlayState* play) { if ((sp24 != 2) && (this->unk_17A & (0x8 | 0x4 | 0x2 | 0x1))) { Player* player = GET_PLAYER(play); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } @@ -297,7 +297,7 @@ void func_80B7F290(BgIkanaBlock* this, PlayState* play) { Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (func_80B7EDC4(this, play)) { diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c index 017f9ef04..61e022b62 100644 --- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c +++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c @@ -226,7 +226,8 @@ void BgIkninSusceil_Update(Actor* thisx, PlayState* play) { BgIkninSusceil* this = THIS; Player* player = GET_PLAYER(play); - if ((this->unk168 == 0) && (this->unk166 > 0) && (player->stateFlags3 & 0x100) && (player->unk_B48 > 1000.0f)) { + if ((this->unk168 == 0) && (this->unk166 > 0) && (player->stateFlags3 & PLAYER_STATE3_100) && + (player->unk_B48 > 1000.0f)) { this->unk168 = 2; if ((func_80C0A95C(this, play) != 0) && (this->actionFunc != func_80C0AE5C)) { func_800B8E58(player, NA_SE_PL_BODY_HIT); @@ -242,7 +243,7 @@ void BgIkninSusceil_Update(Actor* thisx, PlayState* play) { if ((this->dyna.actor.home.pos.y + 70.0f) < this->dyna.actor.world.pos.y) { this->unk166 = 0; - } else if (player->stateFlags3 & 0x100) { + } else if (player->stateFlags3 & PLAYER_STATE3_100) { this->unk166 = 3; } else { if (this->unk166 > 0) { diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 43b7f27aa..cdbd18e7f 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -215,11 +215,11 @@ void func_80953F9C(BgIngate* this, PlayState* play) { if (ActorCutscene_GetCurrentIndex() != this->unk16E) { if (ActorCutscene_GetCurrentIndex() != -1) { Camera_ChangeSetting(mainCam, CAM_SET_NORMAL0); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; play->actorCtx.flags &= ~ACTORCTX_FLAG_2; } else { Camera_ChangeSetting(mainCam, CAM_SET_BOAT_CRUISE); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } this->unk16E = ActorCutscene_GetCurrentIndex(); diff --git a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c index 8080c4444..dde66e620 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c @@ -260,7 +260,7 @@ void func_80B700C0(BgKin2Shelf* this, PlayState* play) { } else { Player* player = GET_PLAYER(play); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } else { @@ -292,7 +292,7 @@ void func_80B70230(BgKin2Shelf* this, PlayState* play) { Player* player = GET_PLAYER(play); this->unk_160 = 1.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (this->unk_164 & 8) { @@ -339,7 +339,7 @@ void func_80B704B4(BgKin2Shelf* this, PlayState* play) { Player* player = GET_PLAYER(play); this->unk_160 = 1.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (this->unk_164 & 4) { diff --git a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c index 1fca8ea9c..2a7096de9 100644 --- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c +++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c @@ -311,7 +311,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) { this->unk_164 = temp_f12; this->unk_162 = 12; if (sp3A > 50) { - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->unk_161 = 1; } } else if (player->actor.speedXZ != 0.0f) { @@ -332,7 +332,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) { player->actor.velocity.y = this->unk_164 * 0.7f; player->unk_B68 = (SQ(this->unk_164) * 0.15f) + this->dyna.actor.world.pos.y; this->unk_161 = 0; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } else if (this->unk_162 == 11) { if (this->unk_164 > 3.0f) { diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c index 55276b217..b2b180701 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c @@ -67,7 +67,8 @@ void BgTobira01_Open(BgTobira01* this, PlayState* play) { this->timer2 = 180; } - if (!(player->stateFlags1 & 0x40) && (gSaveContext.save.weekEventReg[88] & 0x40) && (DECR(this->timer2) == 0)) { + if (!(player->stateFlags1 & PLAYER_STATE1_40) && (gSaveContext.save.weekEventReg[88] & 0x40) && + (DECR(this->timer2) == 0)) { gSaveContext.save.weekEventReg[88] &= (u8)~0x40; } } diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index 28008a674..1e2db7a60 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -1632,7 +1632,7 @@ void func_809DD934(Boss02* this, PlayState* play) { switch (this->unk_1D18) { case 0: - if (player->stateFlags1 & 0x100) { + if (player->stateFlags1 & PLAYER_STATE1_100) { Cutscene_Start(play, &play->csCtx); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); @@ -1755,7 +1755,7 @@ void func_809DD934(Boss02* this, PlayState* play) { this->subCamId = SUB_CAM_ID_DONE; Cutscene_End(play, &play->csCtx); this->actor.flags |= ACTOR_FLAG_1; - player->stateFlags1 &= ~0x100; + player->stateFlags1 &= ~PLAYER_STATE1_100; this->unk_1D70 = 0.01f; func_80165690(); break; diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c index 1179d8eca..d5098b78b 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -252,7 +252,7 @@ void func_809EC568(Boss04* this, PlayState* play) { case 0: this->unk_2C8 = 50; this->unk_2D0 = 2000.0f; - if ((player->stateFlags1 & 0x100000) && (this->actor.projectedPos.z > 0.0f) && + if ((player->stateFlags1 & PLAYER_STATE1_100000) && (this->actor.projectedPos.z > 0.0f) && (fabsf(this->actor.projectedPos.x) < 300.0f) && (fabsf(this->actor.projectedPos.y) < 300.0f)) { if ((this->unk_704 >= 15) && (ActorCutscene_GetCurrentIndex() == -1)) { Actor* boss; diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/src/overlays/actors/ovl_Boss_06/z_boss_06.c index f693ffdea..cd3c57f9d 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c @@ -4,7 +4,6 @@ * Description: Igos du Ikana window - curtains and ray effects */ -#include "prevent_bss_reordering.h" #include "z_boss_06.h" #include "z64shrink_window.h" #include "overlays/actors/ovl_En_Knight/z_en_knight.h" @@ -29,11 +28,11 @@ void func_809F2E34(Boss06* this, PlayState* play); void func_809F2ED0(Boss06* this, PlayState* play); void func_809F2EE8(Boss06* this, PlayState* play); -static Vec3f D_809F4370[128]; -static EnKnight* D_809F4970; -static s32 D_809F4974; -static s32 D_809F4978; -static s32 D_809F497C; +Vec3f D_809F4370[128]; +EnKnight* D_809F4970; +s32 D_809F4974; +s32 D_809F4978; +s32 D_809F497C; static DamageTable sDamageTable = { /* Deku Nut */ DMG_ENTRY(0, 0xF), @@ -102,7 +101,7 @@ static ColliderCylinderInit sCylinderInit = { { 90, 140, 10, { 0, 0, 0 } }, }; -static Vec3f D_809F40EC[] = { +Vec3f D_809F40EC[] = { { 1081.0f, 235.0f, 3224.0f }, { 676.0f, 235.0f, 3224.0f }, }; diff --git a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c index 9f4c7cf1c..75dbacc54 100644 --- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c +++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c @@ -164,7 +164,7 @@ void func_80AA8698(DmChar01* this, PlayState* play) { return; } - if ((player->stateFlags2 & 0x8000000) && (player2->actor.world.pos.x > -40.0f) && + if ((player->stateFlags2 & PLAYER_STATE2_8000000) && (player2->actor.world.pos.x > -40.0f) && (player2->actor.world.pos.x < 40.0f) && (player2->actor.world.pos.z > 1000.0f) && (player2->actor.world.pos.z < 1078.0f)) { if (!D_80AAAAB4) { diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index 24b9ae857..4fa6acb23 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -1272,7 +1272,7 @@ void DmStk_ClockTower_DeflectHit(DmStk* this, PlayState* play) { this->deflectCount++; if (this->deflectCount >= 3) { this->deflectCount = 0; - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { // That won't do you any good Message_StartTextbox(play, 0x2013, &this->actor); } @@ -1720,7 +1720,7 @@ void DmStk_ClockTower_IdleWithOcarina(DmStk* this, PlayState* play) { this->tatlMessageTimer++; if (this->tatlMessageTimer > 800) { this->tatlMessageTimer = 0; - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { // Why are you just standing around? Message_StartTextbox(play, 0x2014, &this->actor); } diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 173c3ea52..92f99462c 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -131,7 +131,8 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { if ((this->actor.targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && - (play->transitionMode == TRANS_MODE_OFF) && (player->stateFlags1 & 0x80000000) && (player->unk_AE7 == 0)) { + (play->transitionMode == TRANS_MODE_OFF) && (player->stateFlags1 & PLAYER_STATE1_80000000) && + (player->unk_AE7 == 0)) { if (grottoType == DOORANA_TYPE_VISIBLE_SCENE_EXIT) { s32 exitIndex = DOORANA_GET_EXIT_INDEX(&this->actor); @@ -157,10 +158,10 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { DoorAna_SetupAction(this, DoorAna_GrabLink); - } else if (!Play_InCsMode(play) && !(player->stateFlags1 & 0x08800000) && + } else if (!Play_InCsMode(play) && !(player->stateFlags1 & (PLAYER_STATE1_8000000 | PLAYER_STATE1_800000)) && (this->actor.xzDistToPlayer <= 20.0f) && (this->actor.playerHeightRel >= -50.0f) && (this->actor.playerHeightRel <= 15.0f)) { - player->stateFlags1 |= 0x80000000; + player->stateFlags1 |= PLAYER_STATE1_80000000; this->actor.targetMode = 1; } else { diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 6812db67a..34247cd7f 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -566,7 +566,7 @@ void func_808A1884(DoorShutter* this, PlayState* play) { this->unk_15C = 0; this->actor.velocity.y = 0.0f; - if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & 0x800)) { + if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_800)) { DoorShutter_SetupAction(this, func_808A1C50); if (ActorCutscene_GetCurrentIndex() == 0x7D) { func_801226E0(play, ((void)0, gSaveContext.respawn[RESPAWN_MODE_DOWN].data)); @@ -633,7 +633,8 @@ void DoorShutter_Update(Actor* thisx, PlayState* play) { DoorShutter* this = THIS; Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x100004C0) || (this->actionFunc == DoorShutter_SetupType)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_400 | PLAYER_STATE1_10000000)) || + (this->actionFunc == DoorShutter_SetupType)) { this->actionFunc(this, play); if (this->unk_163 == 7) { diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c index 0d13c89c6..e80fc9908 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c @@ -290,7 +290,7 @@ void DoorSpiral_Wait(DoorSpiral* this, PlayState* play) { void DoorSpiral_PlayerClimb(DoorSpiral* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x20000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_20000000)) { DoorSpiral_SetupAction(this, DoorSpiral_WaitForObject); this->shouldClimb = 0; } @@ -301,7 +301,8 @@ void DoorSpiral_Update(Actor* thisx, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - if ((!(player->stateFlags1 & 0x100004C0)) || (this->actionFunc == DoorSpiral_WaitForObject)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_400 | PLAYER_STATE1_10000000)) || + (this->actionFunc == DoorSpiral_WaitForObject)) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index 3bf039360..3004930d7 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -171,7 +171,7 @@ void func_80919230(EffDust* this, PlayState* play) { s32 i; s32 j; - if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & 0x1000)) { + if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & PLAYER_STATE1_1000)) { if (this->life != 0) { this->life--; } else { diff --git a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c index 2de3d8604..9af256450 100644 --- a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c +++ b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c @@ -4,6 +4,7 @@ * Description: Wave Created by Turtle Awakening */ +#include "prevent_bss_reordering.h" #include "z_eff_kamejima_wave.h" #include "objects/object_kamejima/object_kamejima.h" diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c index 72bdb7a7c..7d992caa6 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c @@ -307,7 +307,7 @@ s32 func_80BD3198(EnAh* this, PlayState* play) { Player* player = GET_PLAYER(play); u16 temp = play->msgCtx.currentTextId; - if (player->stateFlags1 & 0x40) { + if (player->stateFlags1 & PLAYER_STATE1_40) { if (this->unk_2DA != temp) { if (temp == 0x2954) { this->unk_18C = func_80BD3118; diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.c b/src/overlays/actors/ovl_En_Al/z_en_al.c index 8792f8038..efad50317 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.c +++ b/src/overlays/actors/ovl_En_Al/z_en_al.c @@ -575,7 +575,7 @@ s32 func_80BDF064(EnAl* this, PlayState* play) { Actor* sp1C = func_80BDE1A0(this, play, 4, 0xA4); Actor* temp_v0 = func_80BDE1A0(this, play, 4, 0x234); - if (player->stateFlags1 & 0x40) { + if (player->stateFlags1 & PLAYER_STATE1_40) { this->unk_4C2 |= 0x400; if (this->unk_4C4 != sp22) { switch (sp22) { diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c index 575cf2d35..6024689c7 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c @@ -489,7 +489,7 @@ void func_809C1EC8(EnAob01* this, PlayState* play) { func_809C10B0(this, 3); SubS_FillLimbRotTables(play, this->unk_2F8, this->unk_318, ARRAY_COUNT(this->unk_2F8)); func_809C165C(this, play); - if (player->stateFlags1 & 0x20) { + if (player->stateFlags1 & PLAYER_STATE1_20) { func_809C1124(); } } @@ -876,7 +876,7 @@ void func_809C2F34(EnAob01* this, PlayState* play) { player->actor.world.pos.z = 1464.0f; player->actor.shape.rot.y = player->actor.world.rot.y; player->actor.draw = NULL; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actor.world.pos.x = -4308.0f; this->actor.world.pos.z = 1620.0f; this->actor.prevPos = this->actor.world.pos; diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index f2fe54dae..4232e19ae 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -381,7 +381,7 @@ void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, PlayState* play) { func_800B724C(play, &this->picto.actor, 7); } else { player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; } if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { @@ -458,7 +458,7 @@ void EnBigokuta_PlayDeathEffects(EnBigokuta* this, PlayState* play) { } else { Player* player = GET_PLAYER(play); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c index 1cac3caff..ef508ac48 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -728,7 +728,7 @@ void EnBigslime_SetMinislimeBreakLocation(EnBigslime* this) { void EnBigslime_SetPlayerParams(EnBigslime* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_80) { player->actor.parent = NULL; player->unk_AE8 = 100; func_800B8D98(play, &this->actor, 10.0f, this->actor.world.rot.y, 10.0f); @@ -1709,7 +1709,7 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, PlayState* play) { scale = 0.5f - cos_rad(-this->windupPunchTimer * (M_PI / 5)) * 0.5f; if (this->windupPunchTimer == -5) { - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_80) { player->actor.parent = NULL; player->unk_AE8 = 100; } diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index ea02e9fe7..9eba18afc 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -433,7 +433,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 2) { + if (player->stateFlags1 & PLAYER_STATE1_2) { return; } diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index c9c7e623b..4f17e74c8 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -163,7 +163,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_800; } } else if ((this->colliderCylinder.base.acFlags & AC_HIT) && ((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x13828) || @@ -200,7 +200,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_800; this->actor.world.pos = this->actor.home.pos; } } @@ -217,7 +217,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_800; this->actor.world.pos = this->actor.home.pos; } } @@ -299,11 +299,11 @@ void func_808AEFD4(EnBombf* this, PlayState* play) { if (this->timer == 0) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & 0x800) && (&this->actor == player->heldActor)) { + if ((player->stateFlags1 & PLAYER_STATE1_800) && (&this->actor == player->heldActor)) { player->actor.child = NULL; player->heldActor = NULL; player->interactRangeActor = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_800; } Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c index b55762e7d..b23c93cd0 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c @@ -471,7 +471,7 @@ void func_80BFF03C(EnBomjima* this, PlayState* play) { } else if (!ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { ActorCutscene_SetIntentToPlay(this->cutscenes[0]); } else { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; gSaveContext.save.weekEventReg[83] &= (u8)~4; this->actor.world.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); this->unk_2DC = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); @@ -935,8 +935,8 @@ void func_80C00284(EnBomjima* this, PlayState* play) { if ((this->action == EN_BOMJIMA_ACTION_4) || (this->unk_2CA == 1) || ((this->unk_2CA == 3) && (this->unk_2C8 >= 2))) { this->unk_28E = 0; - if (player->stateFlags1 & 0x20) { - player->stateFlags1 &= ~0x20; + if (player->stateFlags1 & PLAYER_STATE1_20) { + player->stateFlags1 &= ~PLAYER_STATE1_20; } if ((this->bombal == 0) || (this->bombal->actor.update == NULL) || diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index f1f85077b..4258b2397 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -333,7 +333,7 @@ void func_80C014E4(EnBomjimb* this, PlayState* play) { break; } - if (player->stateFlags3 != 0x1000000) { + if (player->stateFlags3 != PLAYER_STATE3_1000000) { phi_f0 = 200.0f; abs = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.world.rot.y)); @@ -538,7 +538,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) { return; } - if (player->stateFlags3 == 0x1000000) { + if (player->stateFlags3 == PLAYER_STATE3_1000000) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0); func_80C01494(this); return; @@ -631,7 +631,7 @@ void func_80C02570(EnBomjimb* this, PlayState* play) { this->unk_2D6 = BINANG_ROT180(this->actor.yawTowardsPlayer); func_80C0113C(this, 19, 2.0f); this->actionFunc = func_80C0217C; - } else if ((player->stateFlags3 == 0x1000000) || (this->actor.xzDistToPlayer > 410.0f)) { + } else if ((player->stateFlags3 == PLAYER_STATE3_1000000) || (this->actor.xzDistToPlayer > 410.0f)) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0); func_80C01494(this); } @@ -666,7 +666,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) { if ((player->transformation != PLAYER_FORM_DEKU) && (player->transformation != PLAYER_FORM_HUMAN)) { func_80C0113C(this, 17, 1.0f); Message_StartTextbox(play, 0x72E, &this->actor); - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; player->actor.freezeTimer = 3; func_80C012E0(this); this->unk_2CA = 9; @@ -678,7 +678,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) { ((player->transformation == PLAYER_FORM_HUMAN) && !(gSaveContext.save.weekEventReg[85] & 2))) { func_80C0113C(this, 17, 1.0f); Message_StartTextbox(play, 0x72E, &this->actor); - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; player->actor.freezeTimer = 3; func_80C012E0(this); this->unk_2CA = 9; @@ -726,7 +726,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) { if (!Play_InCsMode(play)) { Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; player->actor.freezeTimer = 3; } this->unk_2CA = 8; @@ -765,7 +765,7 @@ void func_80C02A14(EnBomjimb* this, PlayState* play) { func_80C02CA4(this, play); } else { if (this->unk_2CA == 8) { - player->stateFlags1 &= ~0x10000000; + player->stateFlags1 &= ~PLAYER_STATE1_10000000; } func_80C01FD4(this); } @@ -781,7 +781,7 @@ void func_80C02BCC(EnBomjimb* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { func_801477B4(play); this->unk_2C0 = 1; - player->stateFlags1 &= ~0x10000000; + player->stateFlags1 &= ~PLAYER_STATE1_10000000; } } else if (this->actor.xzDistToPlayer > 200.0f) { func_80C01494(this); diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index b760c4435..ee8ea02e0 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -155,10 +155,10 @@ void EnBoom_Destroy(Actor* thisx, PlayState* play) { temp->child = NULL; } else { player->boomerangActor = NULL; - player->stateFlags1 &= ~0x2000000; + player->stateFlags1 &= ~PLAYER_STATE1_2000000; } } - player->stateFlags3 |= 0x800000; + player->stateFlags3 |= PLAYER_STATE3_800000; } } @@ -286,7 +286,7 @@ void EnBoom_Update(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); Actor* actor; - if (!(player->stateFlags1 & 0x20000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_20000000)) { this->actionFunc(this, play); if (((actor = this->actor.child) != NULL) || ((actor = this->actor.parent) != NULL)) { diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/src/overlays/actors/ovl_En_Dai/z_en_dai.c index 0404f4ecb..5537d28c2 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -415,7 +415,7 @@ void func_80B3EEDC(EnDai* this, PlayState* play) { (play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY)) { func_80B3E5DC(this, 1); this->actionFunc = func_80B3EE8C; - } else if (!(player->stateFlags2 & 0x08000000)) { + } else if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { func_80B3E96C(this, play); this->unk_A6C = 0; } else if (this->unk_A6C == 0) { @@ -557,7 +557,7 @@ void EnDai_Update(Actor* thisx, PlayState* play) { func_80B3E460(this); } else { this->actionFunc(this, play); - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { SkelAnime_Update(&this->skelAnime); func_80B3E834(this); if (!(this->unk_1CE & 0x200)) { diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c index 7e540c83a..d8bb2b095 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -547,7 +547,7 @@ s32 EnDg_FindFollowerForBremenMask(PlayState* play) { void EnDg_CheckForBremenMaskMarch(EnDg* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags3 & 0x20000000) { // bremen mask march + if (player->stateFlags3 & PLAYER_STATE3_20000000) { if (sBremenMaskFollowerIndex == ENDG_INDEX_NO_BREMEN_MASK_FOLLOWER) { EnDg_FindFollowerForBremenMask(play); } @@ -865,7 +865,7 @@ void EnDg_SitNextToPlayer(EnDg* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00); this->actor.world.rot.y = this->actor.shape.rot.y; } else { - if (player->stateFlags3 & 0x20000000) { // bremen mask march + if (player->stateFlags3 & PLAYER_STATE3_20000000) { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK); } else { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); @@ -992,7 +992,7 @@ void EnDg_ApproachPlayer(EnDg* this, PlayState* play) { if (this->actor.xzDistToPlayer < 40.0f) { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SIT_DOWN); this->actionFunc = EnDg_SitNextToPlayer; - } else if (player->stateFlags3 & 0x20000000) { // bremen mask march + } else if (player->stateFlags3 & PLAYER_STATE3_20000000) { if ((this->actor.xzDistToPlayer > 40.0f) && (player->linearVelocity == 0.0f)) { Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f); } else { @@ -1340,7 +1340,7 @@ void EnDg_Update(Actor* thisx, PlayState* play) { Vec3f floorRot = { 0.0f, 0.0f, 0.0f }; this->selectedDogIndex = sSelectedRacetrackDogInfo.index; - if (!(player->stateFlags1 & 0x20) || (play->sceneId != SCENE_CLOCKTOWER)) { + if (!(player->stateFlags1 & PLAYER_STATE1_20) || (play->sceneId != SCENE_CLOCKTOWER)) { if (EnDg_ShouldReactToNonHumanPlayer(this, play)) { EnDg_ChooseActionForForm(this, play); } else if (this->behavior != DOG_BEHAVIOR_DEFAULT) { diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c index 3e252c034..90c651241 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -260,7 +260,7 @@ s32 func_80A52B68(EnDnq* this, PlayState* play) { Player* player = GET_PLAYER(play); u16 temp = play->msgCtx.currentTextId; - if ((player->stateFlags1 & 0x40) && (player->targetActor == &this->picto.actor)) { + if ((player->stateFlags1 & PLAYER_STATE1_40) && (player->targetActor == &this->picto.actor)) { switch (temp) { case 0x89B: func_80A5257C(this, 18); diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 3e4cf3154..38942387f 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -398,7 +398,7 @@ void func_8092D1B8(EnDns* this, PlayState* play) { if (!ENDNS_GET_4000(&this->actor) || (this->unk_2D2 != 0)) { if (!(gSaveContext.save.weekEventReg[23] & 0x20) && !(gSaveContext.eventInf[1] & 0x20) && func_8092CC68(play)) { - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->unk_2C6 |= 0x100; SubS_UpdateFlags(&this->unk_2C6, 4, 7); play_sound(NA_SE_SY_FOUND); diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 95ce32645..bba07ce4b 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -587,7 +587,7 @@ void func_80877500(EnDodongo* this, PlayState* play) { Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x1F4); if (this->actor.xzDistToPlayer < (100.0f * this->unk_334)) { if ((ABS_ALT(temp_v1) < 0x1388) && (this->actor.playerHeightRel < 60.0f) && - !(player->stateFlags1 & 0x800000)) { + !(player->stateFlags1 & PLAYER_STATE1_800000)) { func_808777A8(this); } } @@ -823,7 +823,7 @@ void func_80878424(EnDodongo* this, PlayState* play) { this->timer++; if (SkelAnime_Update(&this->skelAnime)) { - if (!(player->stateFlags1 & 0x800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) { + if (!(player->stateFlags1 & PLAYER_STATE1_800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) { this->collider1.base.atFlags &= ~AT_ON; func_808777A8(this); } else { diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index ca64711ad..34f0266f4 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -480,7 +480,7 @@ void func_80866B20(EnDoor* this, PlayState* play) { if (this->unk_1A1 != 0) { this->actionFunc = func_80867144; Animation_PlayOnceSetSpeed(&this->skelAnime, sAnimations[this->animIndex], - (player->stateFlags1 & 0x8000000) ? 0.75f : 1.5f); + (player->stateFlags1 & PLAYER_STATE1_8000000) ? 0.75f : 1.5f); if (this->unk_1A6 != 0) { gSaveContext.save.inventory.dungeonKeys[gSaveContext.mapIndex]--; Flags_SetSwitch(play, this->switchFlag); diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c index 870bed49f..2621ed1d8 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c @@ -612,13 +612,13 @@ void EnDragon_Attack(EnDragon* this, PlayState* play) { } if (((this->state != DEEP_PYTHON_ATTACK_STATE_START) && (this->endFrame <= currentFrame)) || - (!(player->stateFlags2 & 0x80)) || ((this->collider.elements[0].info.bumperFlags & BUMP_HIT)) || + (!(player->stateFlags2 & PLAYER_STATE2_80)) || ((this->collider.elements[0].info.bumperFlags & BUMP_HIT)) || (this->collider.elements[1].info.bumperFlags & BUMP_HIT) || (this->collider.elements[2].info.bumperFlags & BUMP_HIT)) { player->actor.parent = NULL; this->grabWaitTimer = 30; ActorCutscene_Stop(this->grabCutsceneIndex); - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_80) { player->unk_AE8 = 100; } diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index aaa552b45..f00963f12 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -844,13 +844,13 @@ void func_8088E60C(EnElf* this, PlayState* play) { s16 glowLightRadius; Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x400) { + if (player->stateFlags1 & PLAYER_STATE1_400) { glowLightRadius = 200; } else { glowLightRadius = 100; } - if ((this->unk_244 == 6) || (player->stateFlags1 & 2) || (this->fairyFlags & 0x8000)) { + if ((this->unk_244 == 6) || (player->stateFlags1 & PLAYER_STATE1_2) || (this->fairyFlags & 0x8000)) { glowLightRadius = 0; } @@ -967,7 +967,7 @@ void func_8088E850(EnElf* this, PlayState* play) { default: arrowPointedActor = play->actorCtx.targetContext.arrowPointedActor; - if ((player->stateFlags1 & 0x40) && (player->targetActor != NULL)) { + if ((player->stateFlags1 & PLAYER_STATE1_40) && (player->targetActor != NULL)) { Math_Vec3f_Copy(&nextPos, &player->targetActor->focus.pos); } else { Math_Vec3f_Copy(&nextPos, &play->actorCtx.targetContext.unk0); @@ -1133,13 +1133,13 @@ void func_8088F214(EnElf* this, PlayState* play) { func_800B9010(&this->actor, NA_SE_EV_BELL_ANGER - SFX_FLAG); } else { arrowPointedActor = play->actorCtx.targetContext.arrowPointedActor; - if (player->stateFlags1 & 0x400) { + if (player->stateFlags1 & PLAYER_STATE1_400) { sp34 = 10; this->unk_25C = 100; } else if ((arrowPointedActor == NULL) || (arrowPointedActor->category == 4)) { if (arrowPointedActor != NULL) { this->unk_25C = 100; - player->stateFlags2 |= 0x100000; + player->stateFlags2 |= PLAYER_STATE2_100000; sp34 = 0; } else { switch (this->unk_244) { @@ -1147,7 +1147,7 @@ void func_8088F214(EnElf* this, PlayState* play) { if (this->unk_25C != 0) { this->unk_25C--; sp34 = 0; - } else if (!(player->stateFlags1 & 0x40)) { + } else if (!(player->stateFlags1 & PLAYER_STATE1_40)) { if (this->unk_269 == 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); } @@ -1163,7 +1163,7 @@ void func_8088F214(EnElf* this, PlayState* play) { this->unk_24A--; sp34 = 5; } else { - player->stateFlags2 |= 0x100000; + player->stateFlags2 |= PLAYER_STATE2_100000; sp34 = 0; } } else { @@ -1195,7 +1195,7 @@ void func_8088F214(EnElf* this, PlayState* play) { switch (sp34) { case 0: - if (!(player->stateFlags2 & 0x100000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_100000)) { sp34 = 5; if (this->unk_269 == 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); @@ -1204,25 +1204,25 @@ void func_8088F214(EnElf* this, PlayState* play) { break; case 6: - if (player->stateFlags2 & 0x100000) { + if (player->stateFlags2 & PLAYER_STATE2_100000) { sp34 = 9; this->unk_25C = 0x2A; if (this->unk_269 == 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); } - } else if (player->stateFlags1 & 0x40) { - player->stateFlags2 |= 0x100000; + } else if (player->stateFlags1 & PLAYER_STATE1_40) { + player->stateFlags2 |= PLAYER_STATE2_100000; sp34 = 0; this->unk_25C = 0; } break; case 5: - player->stateFlags2 &= ~0x100000; + player->stateFlags2 &= ~PLAYER_STATE2_100000; break; default: - player->stateFlags2 |= 0x100000; + player->stateFlags2 |= PLAYER_STATE2_100000; break; } } @@ -1578,7 +1578,7 @@ void EnElf_Draw(Actor* thisx, PlayState* play) { if (!(this->fairyFlags & 8) && (!Cutscene_CheckActorAction(play, 201) || (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 201)]->action != 6)) && - (!(player->stateFlags1 & 0x100000) || (kREG(90) < this->actor.projectedPos.z))) { + (!(player->stateFlags1 & PLAYER_STATE1_100000) || (kREG(90) < this->actor.projectedPos.z))) { Gfx* dListHead = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Gfx) * 4); f32 alphaScale; s32 envAlpha; diff --git a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c index 897641a9e..1792f4de4 100644 --- a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c +++ b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c @@ -483,11 +483,11 @@ void func_80A3A610(EnElfgrp* this, PlayState* play) { if (this->unk_144 > 0) { player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_GROUP_HEAL - SFX_FLAG); } else { player->actor.freezeTimer = 0; - player->stateFlags1 &= ~0x20000000; + player->stateFlags1 &= ~PLAYER_STATE1_20000000; this->actionFunc = func_80A3A600; this->unk_14A |= 8; } @@ -499,7 +499,7 @@ void func_80A3A6F4(EnElfgrp* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; this->unk_144 = func_80A39FBC(play); this->actionFunc = func_80A3A610; this->unk_14A &= ~8; @@ -510,7 +510,7 @@ void func_80A3A77C(EnElfgrp* this, PlayState* play) { Player* player = GET_PLAYER(play); player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; if (Actor_TextboxIsClosing(&this->actor, play)) { this->unk_144 = func_80A39FBC(play); this->actionFunc = func_80A3A610; @@ -558,7 +558,7 @@ void func_80A3A8F8(EnElfgrp* this, PlayState* play) { if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) { this->actor.flags &= ~ACTOR_FLAG_10000; player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; Message_StartTextbox(play, this->actor.textId, &this->actor); this->actionFunc = func_80A3A77C; gSaveContext.save.weekEventReg[9] |= this->unk_146; diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c index 11a4b1136..c13709930 100644 --- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c +++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c @@ -425,10 +425,10 @@ void EnElforg_ClockTownFairyCollected(EnElforg* this, PlayState* play) { EnElforg_CirclePlayer(this, play); player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; if (Actor_TextboxIsClosing(&this->actor, play)) { player->actor.freezeTimer = 0; - player->stateFlags1 &= ~0x20000000; + player->stateFlags1 &= ~PLAYER_STATE1_20000000; Actor_Kill(&this->actor); gSaveContext.save.weekEventReg[8] |= 0x80; ActorCutscene_Stop(0x7C); @@ -481,7 +481,7 @@ void EnElforg_FreeFloating(EnElforg* this, PlayState* play) { if (STRAY_FAIRY_TYPE(&this->actor) == STRAY_FAIRY_TYPE_CLOCK_TOWN) { player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; // Bring me back to North Clock Town! Message_StartTextbox(play, 0x579, NULL); this->actionFunc = EnElforg_ClockTownFairyCollected; diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index 0af2c8f61..db1dadbda 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -2151,7 +2151,7 @@ void EnFishing_UpdateLure(EnFishing* this, PlayState* play) { Math_ApproachF(&D_809101C0, 195.0f, 1.0f, 1.0f); - if (player->stateFlags1 & 0x8000000) { + if (player->stateFlags1 & PLAYER_STATE1_8000000) { D_80917204 = 0; player->unk_B28 = 0; } diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 48f694e8a..b8a0d9699 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -745,7 +745,7 @@ void func_808D22C8(EnFloormas* this, PlayState* play) { Math_Vec3f_Sum(&player->actor.world.pos, &this->actor.home.pos, &this->actor.world.pos); - if (!(player->stateFlags2 & 0x80) || (player->invincibilityTimer < 0)) { + if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->invincibilityTimer < 0)) { EnFloormas* parent = (EnFloormas*)this->actor.parent; EnFloormas* child = (EnFloormas*)this->actor.child; diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 7d1166ef2..f02a04aee 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -410,7 +410,7 @@ void func_80962340(EnFu* this, PlayState* play) { this->unk_552 = 0x2889; } this->actor.flags &= ~ACTOR_FLAG_10000; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->unk_54A = 1; } else { Message_StartTextbox(play, 0x283C, &this->actor); @@ -535,7 +535,7 @@ void func_80962660(EnFu* this, PlayState* play) { gSaveContext.save.weekEventReg[63] |= 1; gSaveContext.save.weekEventReg[63] &= (u8)~2; func_801477B4(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->unk_53C = 0; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_801A2BB8(NA_BGM_TIMED_MINI_GAME); @@ -644,7 +644,7 @@ void func_80962A10(EnFu* this, PlayState* play) { } play_sound(NA_SE_SY_FOUND); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; Interface_StartTimer(TIMER_ID_MINIGAME_2, 60); if (this->unk_546 == 1) { func_809616E0(this, play); @@ -680,8 +680,8 @@ void func_80962BCC(EnFu* this, PlayState* play) { } play_sound(NA_SE_SY_FOUND); - player->stateFlags1 &= ~0x20; - player->stateFlags3 |= 0x400000; + player->stateFlags1 &= ~PLAYER_STATE1_20; + player->stateFlags3 |= PLAYER_STATE3_400000; Interface_StartTimer(TIMER_ID_MINIGAME_2, 60); if (this->unk_546 == 1) { @@ -711,8 +711,8 @@ void func_80962D60(EnFu* this, PlayState* play) { } play_sound(NA_SE_SY_FOUND); - player->stateFlags1 &= ~0x20; - player->stateFlags3 |= 0x400000; + player->stateFlags1 &= ~PLAYER_STATE1_20; + player->stateFlags3 |= PLAYER_STATE3_400000; Interface_StartTimer(TIMER_ID_MINIGAME_2, 60); if (this->unk_546 == 1) { @@ -748,7 +748,7 @@ void func_80962F4C(EnFu* this, PlayState* play) { switch (this->unk_542) { case 0: if (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) { - player->stateFlags3 |= 0x400; + player->stateFlags3 |= PLAYER_STATE3_400; } break; @@ -778,9 +778,9 @@ void func_80962F4C(EnFu* this, PlayState* play) { if ((!DynaPolyActor_IsInRidingRotatingState((DynaPolyActor*)this->actor.child) && (player->actor.bgCheckFlags & 1)) || (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] <= SECONDS_TO_TIMER(0)) || (this->unk_548 == this->unk_54C)) { - player->stateFlags3 &= ~0x400000; + player->stateFlags3 &= ~PLAYER_STATE3_400000; func_80961E88(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; if (this->unk_548 < this->unk_54C) { if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] == SECONDS_TO_TIMER(0)) { Message_StartTextbox(play, 0x2885, &this->actor); @@ -932,7 +932,7 @@ void func_80963630(EnFu* this, PlayState* play) { break; } } - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } else { this->actor.child->freezeTimer = 10; func_800B85E0(&this->actor, play, 500.0f, PLAYER_AP_MINUS1); @@ -1174,7 +1174,7 @@ void func_80963F88(EnFu* this, PlayState* play) { void func_80963FF8(EnFu* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x100000) { + if (player->stateFlags1 & PLAYER_STATE1_100000) { play->actorCtx.unk268 = 1; play->actorCtx.unk_26C.press.button = 0x8000; } else { diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c index a4bfc759a..8693e2fe5 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -390,11 +390,11 @@ void func_80B359DC(EnGg* this, PlayState* play) { if (this->actor.xzDistToPlayer < 200.0f) { if (this->unk_306 == 0) { - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { this->unk_306 = 1; play_sound(NA_SE_SY_TRE_BOX_APPEAR); } - } else if (!(player->stateFlags2 & 0x8000000)) { + } else if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { this->unk_306 = 0; } diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c index 61ae3e91a..242412a16 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -247,11 +247,11 @@ s32 func_80B50854(EnGk* this, PlayState* play) { Player* player = GET_PLAYER(play); if (!(this->unk_1E4 & 0x40)) { - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { this->unk_1E4 |= 0x40; play_sound(NA_SE_SY_TRE_BOX_APPEAR); } - } else if (!(player->stateFlags2 & 0x8000000)) { + } else if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { this->unk_1E4 &= ~0x40; } diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 23406fe7a..8b8456bde 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -892,7 +892,7 @@ s32 func_8094F53C(EnGm* this, PlayState* play) { Actor* al = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_AL); Actor* toto = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_TOTO); - if (player->stateFlags1 & 0x440) { + if (player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_400)) { this->unk_3A4 |= 0x400; if (this->unk_3A6 != sp32) { switch (sp32) { @@ -1412,7 +1412,7 @@ s32 func_80950690(EnGm* this, PlayState* play) { al = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_AL); toto = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_TOTO); if ((al != NULL) && (al->update != NULL) && (toto != NULL) && (toto->update != NULL) && - !(player->stateFlags1 & 0x40)) { + !(player->stateFlags1 & PLAYER_STATE1_40)) { if (DECR(this->unk_3B8) == 0) { if (al == this->unk_268) { this->unk_268 = toto; diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index e1659259f..80e927694 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -525,7 +525,7 @@ void func_80A1213C(EnGo* this, PlayState* play) { s32 func_80A121F4(PlayState* play) { Player* player = GET_PLAYER(play); - if ((player->transformation == PLAYER_FORM_GORON) && (player->stateFlags3 & 0x2000000)) { + if ((player->transformation == PLAYER_FORM_GORON) && (player->stateFlags3 & PLAYER_STATE3_2000000)) { return false; } return true; @@ -637,7 +637,7 @@ void func_80A12660(EnGo* this, PlayState* play) { void func_80A126BC(EnGo* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags2 & 0x4000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_4000)) { if (this->unk_3C6 != 0) { this->unk_3C6--; } @@ -830,7 +830,7 @@ s32 func_80A12E80(EnGo* this, PlayState* play) { return false; } - if (player->stateFlags1 & 0x40) { + if (player->stateFlags1 & PLAYER_STATE1_40) { if (this->unk_392 != temp) { switch (temp) { case 0xE1A: diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index c6ef6a97c..31103b11c 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -1134,7 +1134,7 @@ void func_80941A10(EnGoroiwa* this, PlayState* play) { s32 pad2; if (!func_8094156C(this, play)) { - if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) { + if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & PLAYER_STATE3_80000)) { s32 sp34 = this->actor.home.rot.z & 3; if (sp34 == 2) { @@ -1264,7 +1264,7 @@ void func_80941FA4(EnGoroiwa* this, PlayState* play) { Player* player = GET_PLAYER(play); if (func_8094156C(this, play) == 0) { - if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) { + if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & PLAYER_STATE3_80000)) { func_800B8D50(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); func_800B8E58(player, NA_SE_PL_BODY_HIT); if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) { @@ -1292,7 +1292,7 @@ void func_809420F0(EnGoroiwa* this, PlayState* play) { Player* player = GET_PLAYER(play); if (func_8094156C(this, play) == 0) { - if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) { + if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & PLAYER_STATE3_80000)) { func_800B8D50(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); func_800B8E58(player, NA_SE_PL_BODY_HIT); if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) { @@ -1434,7 +1434,8 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { u32 temp_v0_2; CollisionPoly* tmp; - if (!(player->stateFlags1 & (0x30000000 | 0x80 | 0x40))) { + if (!(player->stateFlags1 & + (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000))) { if (this->unk_1CC > 0) { this->unk_1CC--; } @@ -1515,7 +1516,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { func_8093E938(this); if ((this->unk_1E5 & 1) && (this->unk_1CC <= 0) && - (!(player->stateFlags3 & 0x2000000) || (player->transformation != PLAYER_FORM_GORON) || + (!(player->stateFlags3 & PLAYER_STATE3_2000000) || (player->transformation != PLAYER_FORM_GORON) || ((params != ENGOROIWA_C000_1) && (params != ENGOROIWA_C000_2)))) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); } else { diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c index 174c507d1..272ea909e 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c @@ -276,7 +276,8 @@ void func_80B22500(EnHakurock* this, PlayState* play) { (this->collider.base.oc->params == EN_HAKUROCK_TYPE_UNK_2))) { func_80B21EA4(this, 3); func_80B21FFC(this); - } else if ((&player->actor == this->collider.base.oc) && ((player->stateFlags3 & 0x81000) != 0) && + } else if ((&player->actor == this->collider.base.oc) && + (player->stateFlags3 & (PLAYER_STATE3_1000 | PLAYER_STATE3_80000)) && (player->linearVelocity > 8.0f)) { player->unk_B08[0] = player->linearVelocity = -5.0f; player->unk_B08[1] += (player->linearVelocity * 0.05f); diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c index 3e089d185..05311e64b 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -175,7 +175,7 @@ void func_80BCF4AC(EnHg* this, PlayState* play) { s32 pad; this->actor.speedXZ = 1.6f; - if (!(player->stateFlags2 & 0x08000000) && Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000) && Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { if (((this->skelAnime.curFrame > 9.0f) && (this->skelAnime.curFrame < 16.0f)) || ((this->skelAnime.curFrame > 44.0f) && (this->skelAnime.curFrame < 51.0f))) { Actor_MoveWithGravity(&this->actor); @@ -348,7 +348,7 @@ void func_80BCFC0C(EnHg* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->actor.colChkInfo.health == 1 && !(fabsf(this->actor.playerHeightRel) >= 80.0f)) { - if (player->stateFlags2 & 0x08000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { if (!D_80BD00C8) { play_sound(NA_SE_SY_TRE_BOX_APPEAR); } diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c index 04434510b..2a209b86b 100644 --- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c +++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c @@ -147,7 +147,7 @@ void func_80BDB2B8(EnHiddenNuts* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NEMURI_SLEEP - SFX_FLAG); - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { if (this->unk_20A == 0) { play_sound(NA_SE_SY_TRE_BOX_APPEAR); this->unk_20A = 1; diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index 8f634369b..a3a27f536 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -310,7 +310,7 @@ void EnHoll_Update(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) && - !(player->stateFlags1 & 0x200)) { + !(player->stateFlags1 & PLAYER_STATE1_200)) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 3cfa65ddb..8ea49f0c6 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -169,7 +169,7 @@ s32 func_808F8EB0(EnHorseGameCheck* this, PlayState* play) { } D_801BDA9C = 0; - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { D_801BDAA0 = 1; } play->nextEntrance = ENTRANCE(GORMAN_TRACK, 2); diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c index bc1ca559b..497f6d9e3 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -469,7 +469,7 @@ s32 func_80BF1B40(EnIg* this, PlayState* play) { u16 temp = play->msgCtx.currentTextId; s32 pad; - if (player->stateFlags1 & 0xC40) { + if (player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_400 | PLAYER_STATE1_800)) { this->unk_3D0 |= 0x400; if (this->unk_3D2 != temp) { if ((this->unk_3FC == 2) || (this->unk_3FC == 3)) { diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c index d44ed193c..376d79900 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c @@ -189,7 +189,7 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) { func_800B8614(&this->actor, play, 80.0f); } - if ((player->actor.bgCheckFlags & 1) && !(player->stateFlags1 & 0x2000) && (this->unk_2FE == 0) && + if ((player->actor.bgCheckFlags & 1) && !(player->stateFlags1 & PLAYER_STATE1_2000) && (this->unk_2FE == 0) && (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) && func_80C149B0(play, &this->unk_1F8)) { this->unk_2FE = 1; func_80C13E6C(this); @@ -282,7 +282,7 @@ void func_80C14044(EnJgameTsn* this, PlayState* play) { void func_80C1410C(EnJgameTsn* this, PlayState* play) { Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_801A2BB8(0x25); play->interfaceCtx.unk_280 = 1; func_80112AFC(play); @@ -296,7 +296,7 @@ void func_80C1418C(EnJgameTsn* this, PlayState* play) { if (play->interfaceCtx.unk_280 == 8) { func_80C141DC(this); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } @@ -338,7 +338,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x109F, &this->actor); this->unk_300 = 0x109F; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; *this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE; func_801A2C20(); func_80C14030(this); @@ -346,7 +346,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x10A0, &this->actor); this->unk_300 = 0x10A0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; *this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE; func_801A2C20(); func_80C14030(this); @@ -355,7 +355,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] == SECONDS_TO_TIMER(0)) { Message_StartTextbox(play, 0x10A1, &this->actor); this->unk_300 = 0x10A1; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; *this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE; func_801A2C20(); func_80C14030(this); diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 3acbece16..2a8323104 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -308,12 +308,12 @@ void EnKakasi_TimeSkipDialogue(EnKakasi* this, PlayState* play) { this->picto.actor.textId = 0x1653; gSaveContext.save.weekEventReg[83] &= (u8)~1; this->talkState = TEXT_STATE_5; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->picto.actor.flags |= ACTOR_FLAG_10000; } if (Actor_ProcessTalkRequest(&this->picto.actor, &play->state)) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->unkState196 = 2; this->picto.actor.flags &= ~ACTOR_FLAG_10000; this->actionFunc = EnKakasi_RegularDialogue; diff --git a/src/overlays/actors/ovl_En_Kame/z_en_kame.c b/src/overlays/actors/ovl_En_Kame/z_en_kame.c index 4f1f9ea2e..abc8f520d 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c @@ -197,7 +197,7 @@ void func_80AD70EC(EnKame* this, PlayState* play) { this->unk_2A0 = 40; } - if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & 0x800000) && + if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & PLAYER_STATE1_800000) && (this->actor.xzDistToPlayer < 240.0f)) { func_80AD73A8(this); } else if (SkelAnime_Update(&this->skelAnime1)) { @@ -218,7 +218,7 @@ void func_80AD71B4(EnKame* this) { void func_80AD7254(EnKame* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & 0x800000) && + if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & PLAYER_STATE1_800000) && (this->actor.xzDistToPlayer < 240.0f)) { func_80AD73A8(this); return; @@ -257,7 +257,7 @@ void func_80AD7424(EnKame* this, PlayState* play) { Player* player = GET_PLAYER(play); if (SkelAnime_Update(&this->skelAnime1)) { - if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & 0x800000) && + if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & PLAYER_STATE1_800000) && ((this->unk_29E == 0) || (this->actor.xzDistToPlayer < 120.0f))) { func_80AD76CC(this); } else { diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index 08ec15b14..ade18b707 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -281,7 +281,7 @@ void func_80B269A4(EnKendoJs* this, PlayState* play) { case 0x2719: func_801477B4(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_80B2701C(this); break; @@ -298,7 +298,7 @@ void func_80B269A4(EnKendoJs* this, PlayState* play) { case 0x273B: func_801477B4(play); func_80112AFC(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_80B273D0(this); break; @@ -337,7 +337,7 @@ void func_80B26AFC(EnKendoJs* this, PlayState* play) { gSaveContext.minigameState = 3; } - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; func_80B26538(this); } @@ -358,18 +358,18 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((player->meleeWeaponState != 0) || (player->stateFlags3 & 0x8000000) || - (player->stateFlags2 & 0x80000)) { + if ((player->meleeWeaponState != 0) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { return 1; } break; case 1: - if ((player->stateFlags3 & 0x8000000)) { + if ((player->stateFlags3 & PLAYER_STATE3_8000000)) { return 0; } - if ((player->meleeWeaponState != 0) || (player->stateFlags2 & 0x80000)) { + if ((player->meleeWeaponState != 0) || (player->stateFlags2 & PLAYER_STATE2_80000)) { return 1; } break; @@ -379,8 +379,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((player->meleeWeaponState != 0) || (player->stateFlags3 & 0x8000000) || - (player->stateFlags2 & 0x80000)) { + if ((player->meleeWeaponState != 0) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { return 1; } this->unk_28E = 0; @@ -393,7 +393,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) { + if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { this->unk_28E = 0; return 1; } @@ -406,7 +407,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) { + if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { this->unk_28E = 0; return 1; } @@ -418,7 +420,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) { + if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { this->unk_28E = 0; return 1; } @@ -431,7 +434,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) { + if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { this->unk_28E = 0; return 1; } @@ -488,7 +492,7 @@ void func_80B27030(EnKendoJs* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_10000; if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actor.flags &= ~ACTOR_FLAG_10000; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; func_80B279F0(this, play, 0); Message_StartTextbox(play, 0x271A, &this->actor); this->unk_288 = 0x271A; @@ -520,7 +524,7 @@ void func_80B27188(EnKendoJs* this, PlayState* play) { } this->unk_286 = 2; func_801477B4(play); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } else if (this->unk_286 == 2) { this->unk_286 = 1; @@ -531,14 +535,14 @@ void func_80B27188(EnKendoJs* this, PlayState* play) { case 0: this->unk_286 = 0; Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_80B26EB4(this, play); break; case 1: Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR); this->unk_286 = 0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; Message_StartTextbox(play, 0x2729, &this->actor); this->unk_288 = 0x2729; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); @@ -583,7 +587,7 @@ void func_80B2740C(EnKendoJs* this, PlayState* play) { if (func_80B278C4(play, sp18)) { this->unk_28C = 0; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actionFunc = func_80B274BC; } } @@ -600,7 +604,7 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) { Message_StartTextbox(play, 0x272E, &this->actor); this->unk_288 = 0x272E; } - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; gSaveContext.save.weekEventReg[82] &= (u8)~8; func_80B26AE8(this); return; @@ -623,7 +627,7 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) { (player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH)) { play->interfaceCtx.unk_25C = 3; if (gSaveContext.minigameScore >= 27) { - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; } } else if (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H) { play->interfaceCtx.unk_25C = 2; @@ -668,7 +672,7 @@ void func_80B27774(EnKendoJs* this, PlayState* play) { this->unk_288 = 0x2730; } func_80B26AE8(this); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } else { func_800B85E0(&this->actor, play, 1000.0f, -1); } diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c index c9349b2c5..67131febe 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -1149,10 +1149,10 @@ void func_80B43074(EnKgy* this, PlayState* play) { gSPMatrix(gfx, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (func_80B40D8C(play)) { - gSPDisplayList(&gfx[1], gameplay_keep_DL_001D00); + gSPDisplayList(&gfx[1], gRazorSwordHandleDL); gSPDisplayList(&gfx[2], object_kgy_DL_00F180); } else { - gSPDisplayList(&gfx[1], gameplay_keep_DL_0021A8); + gSPDisplayList(&gfx[1], gKokiriSwordHandleDL); gSPDisplayList(&gfx[2], object_kgy_DL_00E8F0); } POLY_OPA_DISP = &gfx[3]; diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c index 064677b3b..9d9d43078 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -44,14 +44,14 @@ void func_80A5E6F0(Actor* thisx, PlayState* play); void func_80A5E9B4(Actor* thisx, PlayState* play); void func_80A5EA48(Actor* thisx, PlayState* play); -static EnKusa2UnkBssStruct D_80A5F1C0; -static u32 D_80A60900; -static MtxF D_80A60908[8]; -static s16 D_80A60B08; -static s16 D_80A60B0A; -static s16 D_80A60B0C; -static s16 D_80A60B0E; -static s16 D_80A60B10; +EnKusa2UnkBssStruct D_80A5F1C0; +u32 D_80A60900; +MtxF D_80A60908[8]; +s16 D_80A60B08; +s16 D_80A60B0A; +s16 D_80A60B0C; +s16 D_80A60B0E; +s16 D_80A60B10; const ActorInit En_Kusa2_InitVars = { ACTOR_EN_KUSA2, @@ -85,11 +85,11 @@ static ColliderCylinderInit sCylinderInit = { { 6, 44, 0, { 0, 0, 0 } }, }; -static u8 D_80A5EAEC = 1; -static s16 D_80A5EAF0 = 0; -static Vec3s D_80A5EAF4 = { 0, 0, 0 }; -static Vec3s D_80A5EAFC = { 0, 0, 0 }; -static Vec3s D_80A5EB04 = { 0, 0, 0 }; +u8 D_80A5EAEC = 1; +s16 D_80A5EAF0 = 0; +Vec3s D_80A5EAF4 = { 0, 0, 0 }; +Vec3s D_80A5EAFC = { 0, 0, 0 }; +Vec3s D_80A5EB04 = { 0, 0, 0 }; void func_80A5B160(EnKusa2* this, PlayState* play) { s32 i; diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c index cac761db7..8f9d4232a 100644 --- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c +++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c @@ -355,7 +355,7 @@ void EnLookNuts_Update(Actor* thisx, PlayState* play) { if ((this->isPlayerDetected == true) || (this->actor.xzDistToPlayer < 20.0f)) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags3 & 0x100) && !Play_InCsMode(play)) { + if (!(player->stateFlags3 & PLAYER_STATE3_100) && !Play_InCsMode(play)) { Math_Vec3f_Copy(&this->headRotTarget, &gZeroVec3f); this->state = PALACE_GUARD_RUNNING_TO_PLAYER; play_sound(NA_SE_SY_FOUND); diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index 0860857c8..ae6a89b4d 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -347,7 +347,7 @@ void EnMa4_Wait(EnMa4* this, PlayState* play) { EnMa4_StartDialogue(this, play); EnMa4_SetupDialogueHandler(this); } else if (this->type != MA4_TYPE_ALIENS_WON || ABS_ALT(yaw) < 0x4000) { - if (!(player->stateFlags1 & 0x800000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_800000)) { func_800B8614(&this->actor, play, 100.0f); } } @@ -596,7 +596,7 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, PlayState* play) { this->textId = 0x334C; } else { func_801477B4(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; EnMa4_SetupBeginEponasSongCs(this); EnMa4_BeginEponasSongCs(this, play); } @@ -692,7 +692,7 @@ void EnMa4_InitHorsebackGame(EnMa4* this, PlayState* play) { Interface_StartTimer(TIMER_ID_MINIGAME_2, 0); gSaveContext.save.weekEventReg[8] |= 1; func_80112AFC(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actionFunc = EnMa4_SetupHorsebackGameWait; } @@ -701,7 +701,7 @@ void EnMa4_SetupHorsebackGameWait(EnMa4* this, PlayState* play) { if (play->interfaceCtx.unk_280 == 8) { this->actionFunc = EnMa4_HorsebackGameWait; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } @@ -709,7 +709,7 @@ void EnMa4_HorsebackGameWait(EnMa4* this, PlayState* play) { static s16 D_80AC0258 = 0; Player* player = GET_PLAYER(play); - player->stateFlags3 |= 0x400; + player->stateFlags3 |= PLAYER_STATE3_400; EnMa4_HorsebackGameCheckPlayerInteractions(this, play); if (this->poppedBalloonCounter != D_80AC0258) { @@ -736,7 +736,7 @@ void EnMa4_HorsebackGameEnd(EnMa4* this, PlayState* play) { static s32 sFrameCounter = 0; Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x100000) { + if (player->stateFlags1 & PLAYER_STATE1_100000) { play->actorCtx.unk268 = 1; play->actorCtx.unk_26C.press.button = BTN_A; } else { @@ -827,7 +827,7 @@ void EnMa4_EponasSongCs(EnMa4* this, PlayState* play) { } else { Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); D_80AC0260 = 99; this->hasBow = true; @@ -844,7 +844,7 @@ void EnMa4_EndEponasSongCs(EnMa4* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_10000; if (Actor_ProcessTalkRequest(&this->actor, &play->state) != 0) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; Message_StartTextbox(play, 0x334C, &this->actor); this->textId = 0x334C; this->actor.flags &= ~ACTOR_FLAG_10000; diff --git a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c index ac3c8322e..c747c625f 100644 --- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c +++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c @@ -341,7 +341,7 @@ void func_80A6F9DC(EnMm3* this, PlayState* play) { if (this->unk_2B4 == 0x2790) { Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; if (Player_GetMask(play) == PLAYER_MASK_BUNNY) { Interface_StartPostmanTimer(0, POSTMAN_MINIGAME_BUNNY_HOOD_ON); } else { @@ -383,7 +383,7 @@ void func_80A6FBFC(EnMm3* this, PlayState* play) { Player* player = GET_PLAYER(play); if (gSaveContext.timerStates[TIMER_ID_POSTMAN] == TIMER_STATE_POSTMAN_END) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actor.flags |= ACTOR_FLAG_10000; if (gSaveContext.timerCurTimes[TIMER_ID_POSTMAN] > SECONDS_TO_TIMER(15)) { gSaveContext.timerCurTimes[TIMER_ID_POSTMAN] = SECONDS_TO_TIMER(15); @@ -445,7 +445,7 @@ void func_80A6FEEC(EnMm3* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; Message_StartTextbox(play, 0x2794, &this->actor); this->unk_2B4 = 0x2794; func_80151BB4(play, 0xB); diff --git a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c index e13d26051..757a43ff2 100644 --- a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c +++ b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c @@ -318,7 +318,7 @@ void EnMttag_RaceStart(EnMttag* this, PlayState* play) { play->interfaceCtx.unk_280 = 1; Audio_QueueSeqCmd(NA_BGM_GORON_RACE | 0x8000); play->envCtx.unk_E4 = 0xFE; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } else if ((this->timer < 60) && (play->interfaceCtx.unk_280 == 8)) { this->timer = 0; gSaveContext.eventInf[1] |= 1; @@ -480,7 +480,7 @@ void EnMttag_Init(Actor* thisx, PlayState* play) { if (gSaveContext.save.entrance == ENTRANCE(GORON_RACETRACK, 1)) { player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->raceInitialized = false; this->timer = 100; diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index a890cb0e5..3fa3ac6ec 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -97,7 +97,8 @@ void EnNutsball_Update(Actor* thisx, PlayState* play2) { s32 bgId; CollisionPoly* poly; - if (!(player->stateFlags1 & 0x300000C0)) { + if (!(player->stateFlags1 & + (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000))) { this->timer--; if (this->timer < 0) { this->actor.velocity.y += this->actor.gravity; diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index de2469c5a..fc9d7606f 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -147,7 +147,7 @@ s32 EnNwc_PlayerReleasedBremanMarch(EnNwc* this, PlayState* play) { return false; } - if (player->stateFlags3 & 0x20000000) { // breman mask march + if (player->stateFlags3 & PLAYER_STATE3_20000000) { return false; } @@ -165,8 +165,7 @@ s32 EnNwc_IsFound(EnNwc* this, PlayState* play) { return false; } - if (player->stateFlags3 & 0x20000000 && // breman mask march - this->actor.xzDistToPlayer < 100.0f) { + if ((player->stateFlags3 & PLAYER_STATE3_20000000) && this->actor.xzDistToPlayer < 100.0f) { return true; } diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 167c01a31..80ae68e95 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -306,7 +306,7 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) { this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; play->interfaceCtx.unk_222 = 0; play->interfaceCtx.unk_224 = 0; if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) { @@ -366,7 +366,7 @@ void EnOssan_Idle(EnOssan* this, PlayState* play) { SubS_FillLimbRotTables(play, this->limbRotTableY, this->limbRotTableZ, ARRAY_COUNT(this->limbRotTableY)); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; EnOssan_SetupAction(this, EnOssan_BeginInteraction); if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { @@ -984,7 +984,7 @@ void EnOssan_SetupBuyItemWithFanfare(PlayState* play, EnOssan* this) { Actor_PickUp(&this->actor, play, this->items[this->cursorIndex]->getItemId, 300.0f, 300.0f); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; Interface_SetHudVisibility(HUD_VISIBILITY_ALL); this->drawCursor = 0; EnOssan_SetupAction(this, EnOssan_BuyItemWithFanfare); @@ -1129,7 +1129,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) { case 0: func_8019F208(); player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; Message_StartTextbox(play, this->textId, &this->actor); EnOssan_SetupStartShopping(play, this, true); func_800B85E0(&this->actor, play, 100.0f, PLAYER_AP_MINUS1); @@ -1147,7 +1147,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) { item = this->items[this->cursorIndex]; item->restockFunc(play, item); player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; Message_StartTextbox(play, this->textId, &this->actor); EnOssan_SetupStartShopping(play, this, true); func_800B85E0(&this->actor, play, 100.0f, PLAYER_AP_MINUS1); @@ -1160,7 +1160,7 @@ void EnOssan_ItemPurchased(EnOssan* this, PlayState* play) { if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; EnOssan_SetupAction(this, EnOssan_ContinueShopping); this->cutsceneState = ENOSSAN_CUTSCENESTATE_PLAYING; } else { diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c index e86d0c62f..ba2a283de 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -629,7 +629,7 @@ void func_80B5CCA0(EnOt* this, PlayState* play) { if (SubS_StartActorCutscene(&this->actor, this->cutscenes[0], 0x7C, SUBS_CUTSCENE_NORMAL)) { Player* player = GET_PLAYER(play); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; func_80B5CCF4(this, play); } } @@ -666,7 +666,7 @@ void func_80B5CD40(EnOt* this, PlayState* play) { if (Message_ShouldAdvance(play) && (play->msgCtx.currentTextId == 0x1069)) { this->unk_32C |= 4; ActorCutscene_Stop(this->cutscenes[0]); - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; func_80B5CE6C(this, play); } break; diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index f4baec9e6..528fd50c2 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -478,7 +478,7 @@ void func_8095B3DC(EnOwl* this, PlayState* play) { void func_8095B480(EnOwl* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags3 & 0x10000000) { + if (player->stateFlags3 & PLAYER_STATE3_10000000) { this->actor.textId = 0xBF1; EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &object_owl_Anim_00CDB0, 0.0f); this->eyeTexIndex = 0; @@ -1066,7 +1066,7 @@ void func_8095CCF4(Actor* thisx, PlayState* play) { EnOwl* this = THIS; Player* player = GET_PLAYER(play); - if (player->stateFlags3 & 0x10000000) { + if (player->stateFlags3 & PLAYER_STATE3_10000000) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index 7c17627a0..fd37fc39d 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -1170,7 +1170,7 @@ s32 func_80AF8DD4(EnPm* this, PlayState* play) { u16 textId = play->msgCtx.currentTextId; s32 pad; - if (player->stateFlags1 & (0x400 | 0x40)) { + if (player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_400)) { this->unk_356 |= 0x400; if (this->unk_358 != textId) { if ((this->unk_384 == 0) || (this->unk_384 == 1)) { diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.c b/src/overlays/actors/ovl_En_Pr/z_en_pr.c index a40c16073..322749f0d 100644 --- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c +++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c @@ -262,7 +262,7 @@ void func_80A32740(EnPr* this, PlayState* play) { if (this->unk_2C8 < sqrtf(SQ(this->actor.world.pos.x - this->actor.home.pos.x) + SQ(this->actor.world.pos.z - this->actor.home.pos.z))) { func_80A32854(this); - } else if ((this->unk_20E == 0) && (player->stateFlags1 & 0x8000000)) { + } else if ((this->unk_20E == 0) && (player->stateFlags1 & PLAYER_STATE1_8000000)) { if (sqrtf(SQ(player->actor.world.pos.x - this->actor.home.pos.x) + SQ(player->actor.world.pos.z - this->actor.home.pos.z)) < this->unk_2C8) { func_80A32AF8(this); @@ -298,7 +298,7 @@ void func_80A3295C(EnPr* this) { void func_80A32984(EnPr* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & 0x8000000) && (this->unk_20E == 0)) { + if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (this->unk_20E == 0)) { this->unk_22C = this->actor.world.rot.y; func_80A32AF8(this); } else if (!func_80A325E4(this)) { @@ -348,7 +348,7 @@ void func_80A32B20(EnPr* this, PlayState* play) { this->unk_2B8 = D_80A338C0[(void)0, gSaveContext.save.playerForm] + player->actor.world.pos.y; func_80A324E0(this, play); - if (!(player->stateFlags1 & 0x8000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) { this->skelAnime.playSpeed = 1.0f; this->actor.speedXZ = 1.0f; func_80A32854(this); @@ -375,7 +375,7 @@ void func_80A32CDC(EnPr* this) { void func_80A32D28(EnPr* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x8000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) { this->skelAnime.playSpeed = 1.0f; this->actor.speedXZ = 1.0f; func_80A32854(this); @@ -463,7 +463,7 @@ void func_80A33098(EnPr* this, PlayState* play) { this->actor.focus.pos.z, 0, 0, 0, CLEAR_TAG_LARGE_LIGHT_RAYS); } - if ((player->stateFlags1 & 0x8000000) && (this->actor.colChkInfo.damageEffect == 5)) { + if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (this->actor.colChkInfo.damageEffect == 5)) { this->drawDmgEffAlpha = 40; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_MEDIUM; } diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c index ed04ae0f6..c8faf718d 100644 --- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c +++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c @@ -206,7 +206,7 @@ s32 func_80A7429C(EnPr2* this, PlayState* play) { return false; } - if (!(player->stateFlags1 & 0x8000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) { return false; } else { return true; @@ -356,7 +356,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { temp_f12 = player->actor.world.pos.z - this->unk_228.z; sqrtXZ = sqrtf(SQ(temp_f2) + SQ(temp_f12)); - if (sp48 && (player->stateFlags1 & 0x8000000) && (sqrtXZ < this->unk_208)) { + if (sp48 && (player->stateFlags1 & PLAYER_STATE1_8000000) && (sqrtXZ < this->unk_208)) { sp4C = true; func_80A74DEC(this, play); } @@ -446,7 +446,7 @@ void func_80A74E90(EnPr2* this, PlayState* play) { WaterBox* sp40; Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f); - if ((this->unk_1D8 == 0) || !(player->stateFlags1 & 0x8000000) || (this->unk_1E0 == 0)) { + if ((this->unk_1D8 == 0) || !(player->stateFlags1 & PLAYER_STATE1_8000000) || (this->unk_1E0 == 0)) { func_80A74888(this); return; } diff --git a/src/overlays/actors/ovl_En_Prz/z_en_prz.c b/src/overlays/actors/ovl_En_Prz/z_en_prz.c index fd1dee986..5ca54fc8d 100644 --- a/src/overlays/actors/ovl_En_Prz/z_en_prz.c +++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.c @@ -234,7 +234,7 @@ void func_80A763E8(EnPrz* this, PlayState* play) { return; } - if ((player->stateFlags1 & 0x8000000) && (this->unk_1F2 == 0)) { + if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (this->unk_1F2 == 0)) { func_80A76748(this); return; } @@ -291,7 +291,7 @@ void func_80A76634(EnPrz* this, PlayState* play) { if (func_80A762C0(this, play) != 0) { this->unk_1E4 += 0x1500; this->unk_1E4 += (s16)Rand_ZeroFloat(5000.0f); - } else if ((player->stateFlags1 & 0x8000000) && (player->actor.floorHeight < 30.0f)) { + } else if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (player->actor.floorHeight < 30.0f)) { this->actionFunc = func_80A763E8; } else { this->unk_1EE = 10; @@ -325,7 +325,7 @@ void func_80A767A8(EnPrz* this, PlayState* play) { distXZ = sqrtf(SQ(player->actor.world.pos.x - this->actor.parent->home.pos.x) + SQ(player->actor.world.pos.z - this->actor.parent->home.pos.z)); - if (!(player->stateFlags1 & 0x8000000) || (pr->unk_2C8 < distXZ)) { + if (!(player->stateFlags1 & PLAYER_STATE1_8000000) || (pr->unk_2C8 < distXZ)) { this->unk_1F2 = 100; this->skelAnime.playSpeed = 1.0f; func_80A76388(this); diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.c b/src/overlays/actors/ovl_En_Raf/z_en_raf.c index 5d7a59e90..0e7b88718 100644 --- a/src/overlays/actors/ovl_En_Raf/z_en_raf.c +++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.c @@ -310,7 +310,7 @@ void EnRaf_Idle(EnRaf* this, PlayState* play) { if (this->timer == 0) { if ((player->transformation != PLAYER_FORM_DEKU) && (this->dyna.actor.xzDistToPlayer < (BREG(48) + 80.0f) && (player->invincibilityTimer == 0) && - DynaPolyActor_IsInRidingMovingState(&this->dyna) && !(player->stateFlags1 & 0x8000000) && + DynaPolyActor_IsInRidingMovingState(&this->dyna) && !(player->stateFlags1 & PLAYER_STATE1_8000000) && play->grabPlayer(play, player))) { player->actor.parent = &this->dyna.actor; this->grabTarget = EN_RAF_GRAB_TARGET_PLAYER; @@ -372,7 +372,7 @@ void EnRaf_Grab(EnRaf* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 curFrame = this->skelAnime.curFrame; - if ((this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && (player->stateFlags2 & 0x80) && + if ((this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && (player->stateFlags2 & PLAYER_STATE2_80) && (&this->dyna.actor == player->actor.parent)) { Math_ApproachF(&player->actor.world.pos.x, this->dyna.actor.world.pos.x, 0.3f, 10.0f); Math_ApproachF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.3f, 10.0f); @@ -414,7 +414,7 @@ void EnRaf_Chew(EnRaf* this, PlayState* play) { targetChewScale = (BREG(51) / 100.0f) + 0.2f; Math_ApproachF(&this->chewScale, targetChewScale, 0.2f, 0.03f); - if ((player->stateFlags2 & 0x80) && (this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && + if ((player->stateFlags2 & PLAYER_STATE2_80) && (this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && (&this->dyna.actor == player->actor.parent)) { Math_ApproachF(&player->actor.world.pos.x, this->dyna.actor.world.pos.x, 0.3f, 10.0f); Math_ApproachF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.3f, 10.0f); @@ -432,7 +432,7 @@ void EnRaf_Chew(EnRaf* this, PlayState* play) { play->damagePlayer(play, -2); func_800B8E58((Player*)this, player->ageProperties->unk_92 + NA_SE_VO_LI_DAMAGE_S); CollisionCheck_GreenBlood(play, NULL, &player->actor.world.pos); - if ((this->chewCount > (BREG(53) + 5)) || !(player->stateFlags2 & 0x80)) { + if ((this->chewCount > (BREG(53) + 5)) || !(player->stateFlags2 & PLAYER_STATE2_80)) { player->actor.freezeTimer = 10; EnRaf_SetupThrow(this, play); return; diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c index 443d92d59..d046d5192 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -438,7 +438,7 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (inPositionToAttack == true)) { this->grabState = EN_RAILGIBUD_GRAB_ATTACK; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_ATTACK); - } else if (!(player->stateFlags2 & 0x80)) { + } else if (!(player->stateFlags2 & PLAYER_STATE2_80)) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_END); this->actor.flags |= ACTOR_FLAG_1; this->grabState = EN_RAILGIBUD_GRAB_RELEASE; @@ -463,9 +463,9 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); } - if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) { - if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) { - player->stateFlags2 &= ~0x80; + if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { + if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) { + player->stateFlags2 &= ~PLAYER_STATE2_80; player->unk_AE8 = 100; } @@ -750,9 +750,10 @@ s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, PlayState* play return false; } - if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f) && - !(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) && - !(player->stateFlags2 & (0x4000 | 0x80))) { + if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f && + !(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) && + !(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) { return true; } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 2fdfc650d..e33405138 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -654,8 +654,9 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { } if ((ABS_ALT(yaw) < 0x1554) && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 150.0f)) { - if (!(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) && - !(player->stateFlags2 & (0x4000 | 0x80))) { + if (!(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) && + !(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) { if (this->playerStunWaitTimer == 0) { if (!(this->flags & EN_RD_FLAG_CANNOT_FREEZE_PLAYER)) { player->actor.freezeTimer = 40; @@ -838,9 +839,9 @@ void EnRd_Grab(EnRd* this, PlayState* play) { Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 1500, 0); case EN_RD_GRAB_ATTACK: - if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) { - if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) { - player->stateFlags2 &= ~0x80; + if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { + if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) { + player->stateFlags2 &= ~PLAYER_STATE2_80; player->unk_AE8 = 100; } Animation_Change(&this->skelAnime, &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c index a2f2f044c..18f23576f 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -564,8 +564,9 @@ void func_80BF4AB8(EnRg* this, PlayState* play) { } while (phi_s0 != NULL); } - if ((phi_s0 == NULL) && (D_80BF5C10 == 0) && (this->unk_326 == 0) && (player->stateFlags3 & 0x80000) && - (player->invincibilityTimer == 0) && func_80BF4220(this, play, &player->actor)) { + if ((phi_s0 == NULL) && (D_80BF5C10 == 0) && (this->unk_326 == 0) && + (player->stateFlags3 & PLAYER_STATE3_80000) && (player->invincibilityTimer == 0) && + func_80BF4220(this, play, &player->actor)) { this->unk_18C = &player->actor; this->unk_310 |= 0x800; D_80BF5C10 = 1; @@ -586,7 +587,7 @@ void func_80BF4AB8(EnRg* this, PlayState* play) { this->unk_320 = CLAMP_MAX(this->unk_320, 0x190); } else if (this->collider2.base.at->id == ACTOR_PLAYER) { this->unk_326 = 0x28; - if (player->stateFlags3 & 0x1000) { + if (player->stateFlags3 & PLAYER_STATE3_1000) { player->linearVelocity *= 0.5f; player->unk_B08[0] = player->linearVelocity; player->unk_B08[1] += player->linearVelocity * 0.05f; diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 9d9f14973..e67be51f6 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -296,7 +296,7 @@ void func_808FA4F4(EnRr* this, PlayState* play) { f32 sp30; f32 sp2C; - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_80) { player->actor.parent = NULL; player->unk_AE8 = 100; this->actor.flags |= ACTOR_FLAG_1; @@ -571,7 +571,8 @@ void func_808FAF94(EnRr* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 500, 0); this->actor.world.rot.y = this->actor.shape.rot.y; - if ((this->unk_1E6 == 0) && !(player->stateFlags2 & 0x80) && (Player_GetMask(play) != PLAYER_MASK_STONE) && + if ((this->unk_1E6 == 0) && !(player->stateFlags2 & PLAYER_STATE2_80) && + (Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actor.xzDistToPlayer < (8421.053f * this->actor.scale.x))) { func_808FA260(this); } else if ((this->actor.xzDistToPlayer < 400.0f) && (this->actor.speedXZ == 0.0f)) { @@ -812,7 +813,7 @@ void EnRr_Update(Actor* thisx, PlayState* play) { if (this->unk_1FC > 0) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags2 & 0x80)) { + if (!(player->stateFlags2 & PLAYER_STATE2_80)) { this->unk_1FC--; if (this->unk_1FC == 0) { this->collider1.base.ocFlags1 |= OC1_TYPE_PLAYER; diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c index 63d5aed38..bfeca23c5 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -240,7 +240,7 @@ s32 EnRuppecrow_CanSpawnBlueRupees(PlayState* play) { case PLAYER_FORM_ZORA: return false; case PLAYER_FORM_HUMAN: - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { return true; } else { return false; @@ -268,7 +268,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { EnItem00* rupee; s16 rupeeIndex = this->rupeeIndex; - if (!(player->stateFlags3 & 0x1000)) { + if (!(player->stateFlags3 & PLAYER_STATE3_1000)) { xOffset = (this->rupeeIndex & 1) ? 10.0f : -10.0f; } else { xOffset = 0.0f; @@ -407,7 +407,7 @@ void EnRuppecrow_UpdateSpeed(EnRuppecrow* this, PlayState* play) { this->speedModifier = 7.0f; break; case PLAYER_FORM_GORON: - if (player->stateFlags3 & 0x1000) { // Goron Link is curled + if (player->stateFlags3 & PLAYER_STATE3_1000) { // Goron Link is curled this->speedModifier = 19.0f; } else { this->speedModifier = 7.0f; @@ -417,7 +417,7 @@ void EnRuppecrow_UpdateSpeed(EnRuppecrow* this, PlayState* play) { this->speedModifier = 7.0f; break; case PLAYER_FORM_HUMAN: - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { this->speedModifier = 16.0f; } else { this->speedModifier = 7.0f; @@ -507,7 +507,7 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, PlayState* play) { this->actionFunc = EnRuppecrow_HandleSongCutscene; } - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f); } else { Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.1f, 0.1f); diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 5391d650b..e89600744 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -377,7 +377,7 @@ void EnSb_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 25.0f, 20.0f, 5); EnSb_UpdateDamage(this, play); - if (player->stateFlags1 & 0x8000000) { + if (player->stateFlags1 & PLAYER_STATE1_8000000) { Collider_UpdateCylinder(&this->actor, &this->collider); if (this->vulnerableTimer == 0) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c index 4d3c4d637..2de4c88fb 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -704,10 +704,10 @@ void func_80ADC5A4(EnSellnuts* this, PlayState* play) { this->unk_338 |= 1; this->actor.draw = EnSellnuts_Draw; D_80ADD940 = 0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actionFunc = func_80ADC7B4; } else { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actionFunc = func_80ADC6D0; } } else if (func_80ADB08C(play) < 80.0f) { diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.c b/src/overlays/actors/ovl_En_Shn/z_en_shn.c index 93b75e96b..844d65973 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.c +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.c @@ -201,7 +201,7 @@ s32 func_80AE65F4(EnShn* this, PlayState* play) { Player* player = GET_PLAYER(play); u16 temp = play->msgCtx.currentTextId; - if (player->stateFlags1 & 0x40) { + if (player->stateFlags1 & PLAYER_STATE1_40) { if (this->unk_1DA != temp) { if ((this->unk_1D8 & 0x80) || (this->unk_1D8 & 0x100)) { this->unk_1D8 |= 8; diff --git a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c index 30352048b..7476e0681 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c @@ -395,7 +395,7 @@ void EnSnowman_MoveSnowPile(EnSnowman* this, PlayState* play) { EnSnowman_SetupCombine(this, play, &combinePos); } else if ((this->work.timer == 0) && (fabsf(this->actor.playerHeightRel) < 60.0f) && (this->actor.xzDistToPlayer < this->attackRange) && (Player_GetMask(play) != PLAYER_MASK_STONE) && - !(player->stateFlags1 & 0x800000)) { + !(player->stateFlags1 & PLAYER_STATE1_800000)) { EnSnowman_SetupEmerge(this, play); } else if (this->snowPileTargetRotY != this->actor.shape.rot.y) { if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->snowPileTargetRotY, 0x100)) { @@ -439,7 +439,7 @@ void EnSnowman_Emerge(EnSnowman* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { if (this->combineState == EN_SNOWMAN_COMBINE_STATE_ACTIVE) { EnSnowman_SetupSubmerge(this, play); - } else if (!(player->stateFlags1 & 0x800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) { + } else if (!(player->stateFlags1 & PLAYER_STATE1_800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) { this->collider.base.acFlags |= AC_ON; this->work.snowballsToThrowBeforeIdling = 3; EnSnowman_SetupReadySnowball(this); @@ -529,7 +529,7 @@ void EnSnowman_ThrowSnowball(EnSnowman* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); if (SkelAnime_Update(&this->skelAnime)) { if ((this->work.snowballsToThrowBeforeIdling != 0) && (Player_GetMask(play) != PLAYER_MASK_STONE) && - !(player->stateFlags1 & 0x800000)) { + !(player->stateFlags1 & PLAYER_STATE1_800000)) { EnSnowman_SetupReadySnowball(this); } else { this->work.snowballsToThrowBeforeIdling = 0; diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index b7ea5d194..58465b8f0 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -446,7 +446,7 @@ void EnSob1_EndInteraction(PlayState* play, EnSob1* this) { this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; play->interfaceCtx.unk_222 = 0; play->interfaceCtx.unk_224 = 0; EnSob1_SetupAction(this, EnSob1_Idle); @@ -533,7 +533,7 @@ void EnSob1_Idle(EnSob1* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->welcomeTextId = EnSob1_GetWelcome(this, play); Message_StartTextbox(play, this->welcomeTextId, &this->actor); if (ENSOB1_GET_SHOPTYPE(&this->actor) == BOMB_SHOP) { @@ -790,7 +790,7 @@ void EnSob1_Walking(EnSob1* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->welcomeTextId = EnSob1_GetWelcome(this, play); Message_StartTextbox(play, this->welcomeTextId, &this->actor); this->wasTalkedToWhileWalking = true; @@ -810,7 +810,7 @@ void EnSob1_ItemPurchased(EnSob1* this, PlayState* play) { if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; EnSob1_SetupAction(this, EnSob1_ContinueShopping); this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING; } else { @@ -932,7 +932,7 @@ void EnSob1_SetupBuyItemWithFanfare(PlayState* play, EnSob1* this) { Actor_PickUp(&this->actor, play, this->items[this->cursorIndex]->getItemId, 300.0f, 300.0f); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; Interface_SetHudVisibility(HUD_VISIBILITY_ALL); this->drawCursor = 0; EnSob1_SetupAction(this, EnSob1_BuyItemWithFanfare); @@ -1093,7 +1093,7 @@ void EnSob1_ContinueShopping(EnSob1* this, PlayState* play) { item = this->items[this->cursorIndex]; item->restockFunc(play, item); player->actor.shape.rot.y += 0x8000; - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; Message_StartTextbox(play, this->welcomeTextId, &this->actor); EnSob1_SetupStartShopping(play, this, true); func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index 782f32c0d..76a98f9ac 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -104,7 +104,7 @@ void EnStream_SuckPlayer(EnStream* this, PlayState* play) { if (yDistWithOffset > 0.0f) { Math_SmoothStepToF(&player->actor.velocity.y, -3.0f, 0.7f, yDistWithOffset, 0.0f); if (posDifference.y < -70.0f) { - player->stateFlags2 |= 0x80000000; + player->stateFlags2 |= PLAYER_STATE2_80000000; } } } else { diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index 9f24c2735..51b3f0ef6 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -861,9 +861,9 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { if (!(gSaveContext.save.weekEventReg[83] & 4) && !(this->flags1 & 0x1000)) { if (ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { ActorCutscene_Start(this->cutscenes[0], &this->actor); - if (!(player->stateFlags1 & 0x10000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_10000000)) { this->flags2 |= 0x10; - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; } this->flags1 |= 0x1000; this->flags2 |= 2; @@ -926,9 +926,9 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { if (this->flags2 & 2) { this->flags2 &= ~2; } - if (!(player->stateFlags1 & 0x10000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_10000000)) { this->flags2 |= 0x10; - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; } this->textId = 0x2A30; Message_StartTextbox(play, this->textId, &this->actor); @@ -1201,7 +1201,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & 0x40) && (play->msgCtx.currentTextId != 0x2A31)) { + if ((player->stateFlags1 & PLAYER_STATE1_40) && (play->msgCtx.currentTextId != 0x2A31)) { this->flags1 |= 0x8000; this->actor.speedXZ = 0.0f; } else { @@ -1209,7 +1209,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { func_80BABA90(this, 1, 1); if ((this->flags1 & 0x4000) && (talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { this->flags2 &= ~0x10; - player->stateFlags1 &= ~0x10000000; + player->stateFlags1 &= ~PLAYER_STATE1_10000000; this->flags1 &= ~0x4000; ActorCutscene_Stop(this->cutscenes[1]); play->msgCtx.msgMode = 0x43; @@ -1476,7 +1476,7 @@ void EnSuttari_Update(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); this->actionFunc(this, play); - if ((this->flags1 & 8) && (this->flags2 & 0x10) && (player->stateFlags1 & 0x10000000)) { + if ((this->flags1 & 8) && (this->flags2 & 0x10) && (player->stateFlags1 & PLAYER_STATE1_10000000)) { player->actor.freezeTimer = 3; } if (!(this->flags1 & 0x8000)) { diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 24326e7e8..c96b485d4 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -738,7 +738,7 @@ s32 func_808DA08C(EnSw* this, PlayState* play) { void func_808DA350(EnSw* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & 0x200000) && (this->actor.xyzDistToPlayerSq < 8000.0f)) { + if ((player->stateFlags1 & PLAYER_STATE1_200000) && (this->actor.xyzDistToPlayerSq < 8000.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_LAUGH); Math_Vec3f_Copy(&this->unk_374, &player->actor.world.pos); this->unk_410 &= ~0x20; diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 838eaa2a5..c22f6d478 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -346,7 +346,7 @@ void EnSyatekiMan_Swamp_HandleChoice(EnSyatekiMan* this, PlayState* play) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->shootingGameState = SG_GAME_STATE_MOVING_PLAYER; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actionFunc = EnSyatekiMan_Swamp_MovePlayerAndExplainRules; } } else { @@ -410,7 +410,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) case 0xA32: // You have to try harder! if (gSaveContext.save.weekEventReg[63] & 2) { func_801477B4(play); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; gSaveContext.save.weekEventReg[63] &= (u8)~1; gSaveContext.save.weekEventReg[63] &= (u8)~2; this->actionFunc = EnSyatekiMan_Swamp_Idle; @@ -435,7 +435,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) play->msgCtx.stateTimer = 4; player->actor.freezeTimer = 0; gSaveContext.minigameState = 3; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actionFunc = EnSyatekiMan_Swamp_SetupGiveReward; EnSyatekiMan_Swamp_SetupGiveReward(this, play); break; @@ -446,8 +446,8 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) void EnSyatekiMan_Swamp_Talk(EnSyatekiMan* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x20) { - player->stateFlags1 |= 0x20; + if (player->stateFlags1 & PLAYER_STATE1_20) { + player->stateFlags1 |= PLAYER_STATE1_20; } switch (Message_GetState(&play->msgCtx)) { @@ -468,7 +468,7 @@ void EnSyatekiMan_Swamp_Talk(EnSyatekiMan* this, PlayState* play) { if (Message_ShouldAdvance(play)) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; gSaveContext.save.weekEventReg[63] &= (u8)~1; gSaveContext.save.weekEventReg[63] &= (u8)~2; this->actionFunc = EnSyatekiMan_Swamp_Idle; @@ -640,7 +640,7 @@ void EnSyatekiMan_Town_HandleChoice(EnSyatekiMan* this, PlayState* play) { } if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) { - player->stateFlags3 &= ~0x400; + player->stateFlags3 &= ~PLAYER_STATE3_400; gSaveContext.minigameState = 3; } @@ -676,7 +676,7 @@ void EnSyatekiMan_Town_HandleChoice(EnSyatekiMan* this, PlayState* play) { } if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) { - player->stateFlags3 &= ~0x400; + player->stateFlags3 &= ~PLAYER_STATE3_400; gSaveContext.minigameState = 3; } @@ -746,7 +746,7 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) play->msgCtx.stateTimer = 4; player->actor.freezeTimer = 0; this->shootingGameState = SG_GAME_STATE_MOVING_PLAYER; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; gSaveContext.save.weekEventReg[63] |= 1; gSaveContext.save.weekEventReg[63] &= (u8)~2; this->actionFunc = EnSyatekiMan_Town_MovePlayerAndSayHighScore; @@ -819,8 +819,8 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) void EnSyatekiMan_Town_Talk(EnSyatekiMan* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x20) { - player->stateFlags1 |= 0x20; + if (player->stateFlags1 & PLAYER_STATE1_20) { + player->stateFlags1 |= PLAYER_STATE1_20; } switch (Message_GetState(&play->msgCtx)) { @@ -841,7 +841,7 @@ void EnSyatekiMan_Town_Talk(EnSyatekiMan* this, PlayState* play) { if (Message_ShouldAdvance(play)) { gSaveContext.save.weekEventReg[63] &= (u8)~1; gSaveContext.save.weekEventReg[63] &= (u8)~2; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actionFunc = EnSyatekiMan_Town_Idle; this->shootingGameState = SG_GAME_STATE_NONE; } @@ -902,7 +902,7 @@ void EnSyatekiMan_Swamp_GiveReward(EnSyatekiMan* this, PlayState* play) { this->prevTextId = 0xA37; } - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actor.flags &= ~ACTOR_FLAG_10000; this->score = 0; this->shootingGameState = SG_GAME_STATE_NONE; @@ -955,7 +955,7 @@ void EnSyatekiMan_Town_GiveReward(EnSyatekiMan* this, PlayState* play) { if (CURRENT_DAY != 3) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->score = 0; this->shootingGameState = SG_GAME_STATE_NONE; gSaveContext.save.weekEventReg[63] &= (u8)~1; @@ -966,7 +966,7 @@ void EnSyatekiMan_Town_GiveReward(EnSyatekiMan* this, PlayState* play) { // This may be our last day in business... Message_StartTextbox(play, 0x408, &this->actor); this->prevTextId = 0x408; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actor.flags &= ~ACTOR_FLAG_10000; this->score = 0; this->shootingGameState = SG_GAME_STATE_NONE; @@ -980,7 +980,7 @@ void EnSyatekiMan_Swamp_MovePlayerAndExplainRules(EnSyatekiMan* this, PlayState* Player* player = GET_PLAYER(play); if (EnSyatekiMan_MovePlayerToPos(play, sSwampPlayerPos)) { - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->shootingGameState = SG_GAME_STATE_EXPLAINING_RULES; if (this->talkFlags != TALK_FLAG_SWAMP_HAS_EXPLAINED_THE_RULES) { this->talkFlags = TALK_FLAG_SWAMP_HAS_EXPLAINED_THE_RULES; @@ -1011,7 +1011,7 @@ void EnSyatekiMan_Swamp_StartGame(EnSyatekiMan* this, PlayState* play) { sGameStartTimer = 30; this->flagsIndex = 0; this->score = 0; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); this->dekuScrubFlags = (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | (1 << 0); this->guayFlags = 0; @@ -1076,7 +1076,7 @@ void EnSyatekiMan_Swamp_RunGame(EnSyatekiMan* this, PlayState* play) { this->actor.draw = EnSyatekiMan_Draw; this->flagsIndex = 0; this->currentWave = 0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; sHasSpawnedGuaysForThisWave = false; func_801A2C20(); this->actionFunc = EnSyatekiMan_Swamp_EndGame; @@ -1085,7 +1085,7 @@ void EnSyatekiMan_Swamp_RunGame(EnSyatekiMan* this, PlayState* play) { this->actor.draw = EnSyatekiMan_Draw; this->flagsIndex = 0; this->currentWave = 0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; sHasSpawnedGuaysForThisWave = false; func_801A2C20(); this->shootingGameState = SG_GAME_STATE_GIVING_BONUS; @@ -1155,7 +1155,7 @@ void EnSyatekiMan_Swamp_AddBonusPoints(EnSyatekiMan* this, PlayState* play) { static s32 sBonusTimer = 0; Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; if (play->interfaceCtx.unk_286 == 0) { if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] == SECONDS_TO_TIMER(0)) { gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] = SECONDS_TO_TIMER(0); @@ -1216,14 +1216,14 @@ void EnSyatekiMan_Town_StartGame(EnSyatekiMan* this, PlayState* play) { player->actor.shape.rot.y = -0x8000; player->actor.world.rot.y = player->actor.shape.rot.y; play->unk_18790(play, -0x8000, &this->actor); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; sGameStartTimer--; } else if (sGameStartTimer > 0) { player->actor.shape.rot.y = -0x8000; player->actor.world.rot.y = player->actor.shape.rot.y; sGameStartTimer--; } else if (sGameStartTimer == 0) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->score = 0; this->flagsIndex = 0; this->perGameVar1.octorokState = SG_OCTO_STATE_INITIAL; @@ -1352,7 +1352,7 @@ void EnSyatekiMan_Town_RunGame(EnSyatekiMan* this, PlayState* play) { this->perGameVar1.octorokState = SG_OCTO_STATE_HIDING; gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] = SECONDS_TO_TIMER(0); gSaveContext.timerStates[TIMER_ID_MINIGAME_1] = TIMER_STATE_STOP; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; sModFromLosingTime = 0; this->actor.draw = EnSyatekiMan_Draw; func_801A2C20(); diff --git a/src/overlays/actors/ovl_En_Tab/z_en_tab.c b/src/overlays/actors/ovl_En_Tab/z_en_tab.c index ffa557746..27b9a8db4 100644 --- a/src/overlays/actors/ovl_En_Tab/z_en_tab.c +++ b/src/overlays/actors/ovl_En_Tab/z_en_tab.c @@ -428,7 +428,7 @@ s32 func_80BE10BC(EnTab* this, PlayState* play) { switch (this->unk_1D8) { case 1: - if ((player->stateFlags1 & 0x40) && !(play->msgCtx.currentTextId <= 0x2B00) && + if ((player->stateFlags1 & PLAYER_STATE1_40) && !(play->msgCtx.currentTextId <= 0x2B00) && (play->msgCtx.currentTextId < 0x2B08)) { this->actor.child = &this->unk_1E4->actor; this->unk_2FC |= 8; diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c index e1f80e24e..77793d991 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c @@ -420,9 +420,9 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); } - if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) { - if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) { - player->stateFlags2 &= ~0x80; + if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { + if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) { + player->stateFlags2 &= ~PLAYER_STATE2_80; player->unk_AE8 = 100; } @@ -824,8 +824,8 @@ void EnTalkGibud_Talk(EnTalkGibud* this, PlayState* play) { } else { func_80123D50(play, player, ITEM_BOTTLE, PLAYER_AP_BOTTLE); } - player->stateFlags1 |= 0x20; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20; + player->stateFlags1 |= PLAYER_STATE1_20000000; this->actor.flags |= ACTOR_FLAG_100000; EnTalkGibud_SetupDisappear(this); } else { @@ -868,14 +868,14 @@ void EnTalkGibud_Disappear(EnTalkGibud* this, PlayState* play) { func_800B3030(play, &pos, &velocity, &accel, 100, 0, 1); } func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; this->disappearanceTimer--; } else { if (this->switchFlag != -1) { Flags_SetSwitch(play, this->switchFlag); } - player->stateFlags1 &= ~0x20; - player->stateFlags1 &= ~0x20000000; + player->stateFlags1 &= ~PLAYER_STATE1_20; + player->stateFlags1 &= ~PLAYER_STATE1_20000000; Actor_Kill(&this->actor); } } @@ -895,8 +895,9 @@ s32 EnTalkGibud_PlayerInRangeWithCorrectState(EnTalkGibud* this, PlayState* play Player* player = GET_PLAYER(play); if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f) && - !(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) && - !(player->stateFlags2 & (0x4000 | 0x80))) { + !(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) && + !(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) { return true; } diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c index 2b7f7ff35..a5f1b1e95 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -211,7 +211,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { // If the player gets eaten by Gyorg, or if the attack timer ran out, // stop chasing the player for a little bit. - if (this->workTimer[WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & 0x80)) { + if (this->workTimer[WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & PLAYER_STATE2_80)) { this->workTimer[WORK_TIMER_WAIT] = 150; this->isNonHostile = true; } diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c index c9c849b30..03295c989 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c @@ -333,7 +333,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { func_80A41D70(this, play); if ((gSaveContext.cutsceneTrigger == 0) && (sCutscenes[this->unk_144] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - player->stateFlags1 |= 0x200; + player->stateFlags1 |= PLAYER_STATE1_200; } } else { if ((gSaveContext.save.time > CLOCK_TIME(18, 0)) || (gSaveContext.save.time < CLOCK_TIME(6, 0))) { @@ -399,7 +399,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { Play_SetRespawnData(&play->state, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE, 0xBFF, &player->unk_3C0, player->unk_3CC); func_80169EFC(&play->state); - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { EnHorse* rideActor = (EnHorse*)player->rideActor; if ((rideActor->type == HORSE_TYPE_EPONA) || (rideActor->type == HORSE_TYPE_2)) { @@ -418,7 +418,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { } if ((sCutscenes[this->unk_144] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - player->stateFlags1 |= 0x200; + player->stateFlags1 |= PLAYER_STATE1_200; this->unk_146 = gSaveContext.save.time; } else { if (this->unk_144 == 0) { @@ -456,7 +456,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0xFFF1; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_02; - player->stateFlags1 |= 0x200; + player->stateFlags1 |= PLAYER_STATE1_200; Actor_Kill(&this->actor); } func_80A42198(this); @@ -494,7 +494,7 @@ void func_80A42F20(EnTest4* this, PlayState* play) { gSaveContext.save.time += CLOCK_TIME_MINUTE; this->unk_146 = gSaveContext.save.time; play->numSetupActors = -play->numSetupActors; - player->stateFlags1 &= ~0x200; + player->stateFlags1 &= ~PLAYER_STATE1_200; } } else { this->actionFunc = func_80A42AB8; @@ -563,7 +563,7 @@ void EnTest4_Update(Actor* thisx, PlayState* play) { EnTest4* this = THIS; Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 2)) { + if (!(player->stateFlags1 & PLAYER_STATE1_2)) { this->actionFunc(this, play); if (func_800FE4B8(play) != 0) { diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/src/overlays/actors/ovl_En_Test7/z_en_test7.c index 272d4dbdd..22e4c70b1 100644 --- a/src/overlays/actors/ovl_En_Test7/z_en_test7.c +++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.c @@ -418,7 +418,7 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) { } ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); - player2->stateFlags1 |= 0x20; + player2->stateFlags1 |= PLAYER_STATE1_20; Lights_PointNoGlowSetInfo(&this->lightInfo, (Math_SinS(this->unk_1E8E) * 90.0f) + player->actor.world.pos.x, player->actor.world.pos.y + 10.0f, (Math_CosS(this->unk_1E8E) * 90.0f) + player->actor.world.pos.z, 255, 255, 255, 255); @@ -759,7 +759,7 @@ void func_80AF2938(EnTest7* this, PlayState* play) { this->unk_1E98 = player->actor.draw; player->actor.draw = NULL; - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->unk_144 |= 2; this->unk_148.unk_04 = 30.0f; if (play->roomCtx.curRoom.unk3 != 1) { @@ -911,7 +911,7 @@ void func_80AF2F98(EnTest7* this, PlayState* play) { this->unk_148.unk_00 = this->unk_148.unk_04; this->unk_148.unk_08 = ((this->unk_148.unk_04 * -0.29999998f) / 11.0f) + 0.7f; this->unk_148.unk_0C = ((this->unk_148.unk_04 * -0.29999998f) / 11.0f) + 0.7f; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; } } @@ -919,8 +919,8 @@ void func_80AF30F4(EnTest7* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unk_1E54 > 90) { - player->stateFlags1 &= ~0x20; - player->stateFlags1 &= ~0x20000000; + player->stateFlags1 &= ~PLAYER_STATE1_20; + player->stateFlags1 &= ~PLAYER_STATE1_20000000; Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c index ae3e6a7aa..88e88c2df 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -521,8 +521,9 @@ void func_80C11590(EnThiefbird* this, PlayState* play) { this->unk_18E--; } - if ((this->unk_18E == 0) && (this->actor.xzDistToPlayer < 300.0f) && !(player->stateFlags1 & 0x800000) && - (Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actor.depthInWater < -40.0f)) { + if ((this->unk_18E == 0) && (this->actor.xzDistToPlayer < 300.0f) && + !(player->stateFlags1 & PLAYER_STATE1_800000) && (Player_GetMask(play) != PLAYER_MASK_STONE) && + (this->actor.depthInWater < -40.0f)) { func_80C118E4(this); } } @@ -565,9 +566,9 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, rot, 4, 0x1000, 0x100); } - if ((this->unk_18E == 0) || (player->stateFlags1 & 0x800000) || (Player_GetMask(play) == PLAYER_MASK_STONE) || - (this->collider.base.atFlags & AT_HIT) || (this->actor.bgCheckFlags & 1) || - (this->actor.depthInWater > -40.0f)) { + if ((this->unk_18E == 0) || (player->stateFlags1 & PLAYER_STATE1_800000) || + (Player_GetMask(play) == PLAYER_MASK_STONE) || (this->collider.base.atFlags & AT_HIT) || + (this->actor.bgCheckFlags & 1) || (this->actor.depthInWater > -40.0f)) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c index 3c1f35af3..51d58a1f5 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -333,7 +333,7 @@ void func_80BA3DBC(EnToto* this, PlayState* play) { } } else { player = GET_PLAYER(play); - if (player->stateFlags1 & 0x400 && player->unk_AE7 != 0) { + if ((player->stateFlags1 & PLAYER_STATE1_400) && player->unk_AE7 != 0) { func_80151BB4(play, 48); func_80151BB4(play, 9); func_80151BB4(play, 10); diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index 71abb140a..3795acdb7 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -223,7 +223,7 @@ void EnTrt_EndInteraction(PlayState* play, EnTrt* this) { this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; play->interfaceCtx.unk_222 = 0; play->interfaceCtx.unk_224 = 0; this->textId = 0x834; @@ -341,7 +341,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) { if (this->cutsceneState != ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { EnTrt_SetupGetMushroomCutscene(this); if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; } } else if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { switch (this->textId) { @@ -450,7 +450,7 @@ void EnTrt_GiveRedPotionForKoume(EnTrt* this, PlayState* play) { gSaveContext.save.weekEventReg[12] |= 0x10; } gSaveContext.save.weekEventReg[84] |= 0x40; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; this->actionFunc = EnTrt_GivenRedPotionForKoume; } else if (gSaveContext.save.weekEventReg[12] & 0x10) { Actor_PickUp(&this->actor, play, GI_POTION_RED, 300.0f, 300.0f); @@ -467,7 +467,7 @@ void EnTrt_GivenRedPotionForKoume(EnTrt* this, PlayState* play) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; //! @bug: EnTrt_ContinueShopping gets overwritten by EnTrt_ItemGiven this->actionFunc = EnTrt_ContinueShopping; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; @@ -652,7 +652,7 @@ void EnTrt_SetupBuyItemWithFanfare(PlayState* play, EnTrt* this) { Actor_PickUp(&this->actor, play, this->items[this->cursorIndex]->getItemId, 300.0f, 300.0f); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; Interface_SetHudVisibility(HUD_VISIBILITY_ALL); this->drawCursor = 0; this->actionFunc = EnTrt_BuyItemWithFanfare; @@ -797,7 +797,7 @@ void EnTrt_IdleSleeping(EnTrt* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->timer = 45; this->actionFunc = EnTrt_BeginInteraction; } else if (((player->actor.world.pos.x >= -50.0f) && (player->actor.world.pos.x <= -25.0f)) && @@ -838,7 +838,7 @@ void EnTrt_IdleAwake(EnTrt* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; if (player->transformation == PLAYER_FORM_HUMAN) { this->flags |= ENTRT_MET; } @@ -999,7 +999,7 @@ void EnTrt_ItemGiven(EnTrt* this, PlayState* play) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->actionFunc = EnTrt_ContinueShopping; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; } else { @@ -1124,7 +1124,7 @@ void EnTrt_ContinueShopping(EnTrt* this, PlayState* play) { case 0: func_8019F208(); player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; Message_StartTextbox(play, this->textId, &this->actor); EnTrt_SetupStartShopping(play, this, true); func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c index 9e4375ae6..f1835edcf 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -468,7 +468,7 @@ void func_80AD4298(EnTrt2* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->unk_3DA)) { ActorCutscene_StartAndSetUnkLinkFields(this->unk_3DA, &this->actor); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->unk_3B2 = 6; } else { if (ActorCutscene_GetCurrentIndex() == 0x7C) { @@ -481,7 +481,7 @@ void func_80AD4298(EnTrt2* this, PlayState* play) { void func_80AD431C(EnTrt2* this, PlayState* play) { Player* player = GET_PLAYER(play); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c index 3982e0420..75d279f9f 100644 --- a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c +++ b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c @@ -346,7 +346,7 @@ void func_80B76980(EnTruMt* this, PlayState* play) { Message_StartTextbox(play, 0x87F, &this->actor); gSaveContext.eventInf[3] |= 0x40; gSaveContext.eventInf[4] |= 1; - player->stateFlags3 &= ~0x400; + player->stateFlags3 &= ~PLAYER_STATE3_400; this->actor.speedXZ = 0.0f; this->actionFunc = func_80B76BB8; } else if (gSaveContext.eventInf[4] & 1) { @@ -366,7 +366,7 @@ void func_80B76A64(EnTruMt* this, PlayState* play) { func_80B76924(this); func_80B76980(this, play); - player->stateFlags3 |= 0x400; + player->stateFlags3 |= PLAYER_STATE3_400; if (this->path != NULL) { func_80B76540(this->path, this->unk_36C, &this->actor.world.pos, &sp34); @@ -406,7 +406,7 @@ void func_80B76C38(EnTruMt* this, PlayState* play) { func_80B76924(this); func_80B76980(this, play); - player->stateFlags3 |= 0x400; + player->stateFlags3 |= PLAYER_STATE3_400; } void EnTruMt_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 13f3efff8..e84d59ec5 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -243,8 +243,9 @@ void EnWallmas_WaitToDrop(EnWallmas* this, PlayState* play) { this->timer--; } - if ((player->stateFlags1 & 0x08100000) || (player->stateFlags2 & 0x80) || (player->unk_B5E > 0) || - (player->actor.freezeTimer > 0) || !(player->actor.bgCheckFlags & 1) || + if ((player->stateFlags1 & (PLAYER_STATE1_100000 | PLAYER_STATE1_8000000)) || + (player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B5E > 0) || (player->actor.freezeTimer > 0) || + !(player->actor.bgCheckFlags & 1) || ((WALLMASTER_GET_TYPE(&this->actor) == WALLMASTER_TYPE_PROXIMITY) && (Math_Vec3f_DistXZ(&this->actor.home.pos, playerPos) > (120.f + this->detectionRadius)))) { AudioSfx_StopById(NA_SE_EN_FALL_AIM); @@ -279,9 +280,9 @@ void EnWallmas_SetupDrop(EnWallmas* this, PlayState* play) { void EnWallmas_Drop(EnWallmas* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((player->stateFlags2 & 0x80) || (player->actor.freezeTimer > 0)) { + if ((player->stateFlags2 & PLAYER_STATE2_80) || (player->actor.freezeTimer > 0)) { EnWallmas_SetupReturnToCeiling(this); - } else if (!Play_InCsMode(play) && !(player->stateFlags2 & 0x10) && (player->invincibilityTimer >= 0) && + } else if (!Play_InCsMode(play) && !(player->stateFlags2 & PLAYER_STATE2_10) && (player->invincibilityTimer >= 0) && (this->actor.xzDistToPlayer < 30.0f) && (this->actor.playerHeightRel < -5.0f) && (-(f32)(player->cylinder.dim.height + 10) < this->actor.playerHeightRel)) { EnWallmas_SetupTakePlayer(this, play); diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c index 2b4feee16..69e9ca3c7 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c @@ -176,7 +176,7 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) { player->actor.world.pos.z = this->dyna.actor.world.pos.z + (diffZ * distance); if (Math_StepToS(&this->unkValue15E, 0x2710, 0xC8)) { - player->stateFlags3 |= 0x1; + player->stateFlags3 |= PLAYER_STATE3_1; player->actor.gravity = -0.5f; if (this->dyna.actor.playerHeightRel < -80.0f) { diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c index 543865e0b..bce9f6282 100644 --- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c +++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c @@ -636,7 +636,7 @@ void EnWizFire_Update(Actor* thisx, PlayState* play2) { } } - if ((player->stateFlags2 & 0x4000) && (player->unk_AE8 < 90)) { + if ((player->stateFlags2 & PLAYER_STATE2_4000) && (player->unk_AE8 < 90)) { player->unk_AE8 = 90; } diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c index 486790dfd..d96a8f94e 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -372,10 +372,10 @@ void EnYb_Idle(EnYb* this, PlayState* play) { } if (this->playerOcarinaOut & 1) { - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { this->playerOcarinaOut &= ~1; } - } else if ((player->stateFlags2 & 0x8000000) && this->actor.xzDistToPlayer < 180.0f && + } else if ((player->stateFlags2 & PLAYER_STATE2_8000000) && this->actor.xzDistToPlayer < 180.0f && fabsf(this->actor.playerHeightRel) < 50.0f) { this->playerOcarinaOut |= 1; Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.c b/src/overlays/actors/ovl_En_Zob/z_en_zob.c index 710b82e4d..d89e1b53a 100644 --- a/src/overlays/actors/ovl_En_Zob/z_en_zob.c +++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.c @@ -525,7 +525,7 @@ void func_80BA0374(EnZob* this, PlayState* play) { func_801477B4(play); this->actionFunc = func_80BA0318; player->unk_A90 = &this->actor; - player->stateFlags3 |= 0x20; + player->stateFlags3 |= PLAYER_STATE3_20; break; } } diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c index f572e8257..4f1c73473 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -601,10 +601,10 @@ void func_80B943EC(EnZog* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unk_30A & 0x10) { - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { this->unk_30A &= ~0x10; } - } else if ((player->stateFlags2 & 0x8000000) && (this->actor.xzDistToPlayer < 120.0f)) { + } else if ((player->stateFlags2 & PLAYER_STATE2_8000000) && (this->actor.xzDistToPlayer < 120.0f)) { this->unk_30A |= 0x10; Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); } diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c index db054d1f8..90e712a80 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -553,7 +553,7 @@ void func_80B97708(EnZot* this, PlayState* play) { return; } - if (!(player->stateFlags1 & 0x2000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_2000000)) { phi_v1 = func_80B96CE4(this); } else { phi_v1 = 0; diff --git a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c index b9310b27e..1325a9a16 100644 --- a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c +++ b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c @@ -252,7 +252,7 @@ void func_809A54E0(ObjArmos* this, PlayState* play) { func_809A518C(this, sp20); func_809A5610(this); } else { - GET_PLAYER(play)->stateFlags2 &= ~0x10; + GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -289,7 +289,7 @@ void func_809A562C(ObjArmos* this, PlayState* play) { sp20 = true; } - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (!sp20) { @@ -309,7 +309,7 @@ void func_809A57D8(ObjArmos* this) { void func_809A57F4(ObjArmos* this, PlayState* play) { if (fabsf(this->dyna.pushForce) > 0.1f) { - GET_PLAYER(play)->stateFlags2 &= ~0x10; + GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } diff --git a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c index f8a7d38d7..f3a9d7c38 100644 --- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c +++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c @@ -135,7 +135,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, PlayState* play) { s16 minOscillationTimer; Player* player = GET_PLAYER(play); - if ((player->stateFlags3 & 0x200) && (this->dyna.actor.xzDistToPlayer < 20.0f)) { + if ((player->stateFlags3 & PLAYER_STATE3_200) && (this->dyna.actor.xzDistToPlayer < 20.0f)) { // Player is launching out of the Deku Flower Animation_Change(&this->skelAnime, &gDekuFlowerBounceAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDekuFlowerBounceAnim), ANIMMODE_ONCE, 0.0f); @@ -146,7 +146,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, PlayState* play) { this->bounceOscillationScale = 0.003f; this->oscillationTimer = 30; this->burrowFlag &= ~1; - } else if ((player->stateFlags3 & 0x2000) && (this->dyna.actor.xzDistToPlayer < 30.0f) && + } else if ((player->stateFlags3 & PLAYER_STATE3_2000) && (this->dyna.actor.xzDistToPlayer < 30.0f) && (this->dyna.actor.playerHeightRel > 0.0f)) { // Player is hovering above the Deku Flower minOscillationTimer = 10 - (s32)(this->dyna.actor.playerHeightRel * 0.05f); @@ -159,7 +159,8 @@ void ObjEtcetera_Idle(ObjEtcetera* this, PlayState* play) { // Player is walking onto the Deku Flower, or falling on it from a height this->oscillationTimer = 10; ObjEtcetera_StartRustleAnimation(this); - } else if ((player->actor.speedXZ > 0.1f) || ((player->unk_ABC < 0.0f) && !(player->stateFlags3 & 0x100))) { + } else if ((player->actor.speedXZ > 0.1f) || + ((player->unk_ABC < 0.0f) && !(player->stateFlags3 & PLAYER_STATE3_100))) { // Player is walking on top of the Deku Flower, is at the very start of burrowing, or is at the very // start of launching this->oscillationTimer = 10; diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c index a9a10f755..15c564df2 100644 --- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c +++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c @@ -89,7 +89,7 @@ void func_80B3C39C(ObjGhaka* this, PlayState* play) { player->transformation == PLAYER_FORM_GORON) { func_80B3C2B0(this); } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -136,7 +136,7 @@ void func_80B3C624(ObjGhaka* this, PlayState* play) { this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + this->unk_168; if (stepTemp) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; func_80B3C2C4(this, play); gSaveContext.save.weekEventReg[20] |= 0x20; diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 69e542c6b..5d438239d 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -178,7 +178,7 @@ void func_80931A38(ObjIcePoly* this, PlayState* play) { s32 pad3; f32 sp58; - if (!(player->stateFlags2 & 0x4000) && (this->unk_14A != 0)) { + if (!(player->stateFlags2 & PLAYER_STATE2_4000) && (this->unk_14A != 0)) { this->unk_14A--; } diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c index 9e351dc23..b75db4261 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -849,7 +849,7 @@ void func_80A25404(ObjIceblock* this) { void func_80A2541C(ObjIceblock* this, PlayState* play) { Player* player = GET_PLAYER(play); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c index 5d1931c1c..c02092e9e 100644 --- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c +++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c @@ -137,7 +137,7 @@ void ObjMoonStone_Update(Actor* thisx, PlayState* play) { ObjMoonStone* this = THIS; Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x10000282)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_2 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000))) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index d4d716e90..c88d36797 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -406,11 +406,11 @@ void ObjOshihiki_OnScene(ObjOshihiki* this, PlayState* play) { return; } } - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } else if (fabsf(this->dyna.pushForce) > 0.001f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -466,7 +466,7 @@ void ObjOshihiki_OnActor(ObjOshihiki* this, PlayState* play) { } if (!sp20 && (fabsf(this->dyna.pushForce) > 0.001f)) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -494,7 +494,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { if (!ObjOshihiki_CheckFloor(this, play)) { this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; this->pushDist = 0.0f; this->pushSpeed = 0.0f; @@ -508,7 +508,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; this->pushDist = 0.0f; this->pushSpeed = 0.0f; @@ -542,7 +542,7 @@ void ObjOshihiki_Fall(ObjOshihiki* this, PlayState* play) { if (fabsf(this->dyna.pushForce) > 0.001f) { this->dyna.pushForce = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; } Actor_MoveWithGravity(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c index 9f024b0c0..f3e047020 100644 --- a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c +++ b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c @@ -268,7 +268,7 @@ void func_809A3A74(ObjPzlblock* this, PlayState* play) { } } - GET_PLAYER(play)->stateFlags2 &= ~0x10; + GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -299,7 +299,7 @@ void func_809A3BC0(ObjPzlblock* this, PlayState* play) { sp20 = 1; } - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (sp20 == 0) { func_809A3A48(this); @@ -318,7 +318,7 @@ void func_809A3D1C(ObjPzlblock* this) { void func_809A3D38(ObjPzlblock* this, PlayState* play) { if (fabsf(this->dyna.pushForce) > 0.1f) { - GET_PLAYER(play)->stateFlags2 &= ~0x10; + GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } diff --git a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c index 3eee8491a..e22c73cda 100644 --- a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c +++ b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c @@ -369,7 +369,7 @@ void func_80A21C88(ObjSkateblock* this, s32 arg1) { void func_80A21CB4(ObjSkateblock* this, PlayState* play) { Player* player = GET_PLAYER(play); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c index 5d546a78f..1c6d53e7f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c @@ -52,7 +52,7 @@ void EffectSsStick_Draw(PlayState* play, u32 index, EffectSs* this) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C28C(gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment); - gSPSegment(POLY_OPA_DISP++, 0x0C, D_801C0850); + gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList); gSPDisplayList(POLY_OPA_DISP++, gDekuStickDL); CLOSE_DISPS(gfxCtx); diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index b199ada05..8e074c509 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2202,7 +2202,7 @@ 0x8012364C:("func_8012364C",), 0x80123810:("func_80123810",), 0x80123960:("Player_ActionToModelGroup",), - 0x801239AC:("func_801239AC",), + 0x801239AC:("Player_SetModelsForHoldingShield",), 0x80123AA4:("Player_SetModels",), 0x80123BD4:("Player_SetModelGroup",), 0x80123C58:("func_80123C58",), @@ -2230,12 +2230,12 @@ 0x8012420C:("Player_GetBottleHeld",), 0x8012422C:("Player_ActionToExplosive",), 0x80124258:("Player_GetExplosiveHeld",), - 0x80124278:("func_80124278",), + 0x80124278:("Player_ActionToSword",), 0x801242B4:("func_801242B4",), 0x801242DC:("Player_GetEnvTimerType",), 0x80124420:("func_80124420",), 0x80124618:("func_80124618",), - 0x801246F4:("func_801246F4",), + 0x801246F4:("Player_DrawImpl",), 0x80124870:("func_80124870",), 0x80124CC4:("func_80124CC4",), 0x80124F18:("func_80124F18",), @@ -2263,14 +2263,14 @@ 0x80127438:("func_80127438",), 0x80127488:("func_80127488",), 0x8012754C:("Player_DrawCouplesMask",), - 0x80127594:("func_80127594",), - 0x801278F8:("func_801278F8",), - 0x80127A60:("func_80127A60",), + 0x80127594:("Player_DrawCircusLeadersMask",), + 0x801278F8:("Player_DrawBlastMask",), + 0x80127A60:("Player_DrawBunnyHood",), 0x80127B64:("func_80127B64",), 0x80127BE8:("func_80127BE8",), 0x80127DA4:("func_80127DA4",), 0x80128388:("func_80128388",), - 0x801284A0:("func_801284A0",), + 0x801284A0:("Player_DrawGreatFairysMask",), 0x80128640:("func_80128640",), 0x80128B74:("func_80128B74",), 0x80128BD0:("func_80128BD0",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 3ac247a29..ee037b02a 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -1192,33 +1192,33 @@ 0x801BFDA0:("sMaskObjectIds","s16","[24]",0x30), 0x801BFDD0:("D_801BFDD0","UNK_TYPE1","",0x1), 0x801BFDE8:("sMaskItemIds","UNK_TYPE1","",0x1), - 0x801BFE00:("D_801BFE00","UNK_TYPE1","",0x1), + 0x801BFE00:("gPlayerSkeletons","FlexSkeletonHeader*","[5]",0x14), 0x801BFE14:("D_801BFE14","UNK_TYPE1","",0x1), - 0x801BFF34:("D_801BFF34","UNK_TYPE2","",0x2), + 0x801BFF34:("sCItemButtons","UNK_TYPE2","",0x2), 0x801BFF3C:("sActionModelGroups","UNK_TYPE1","",0x1), 0x801BFF90:("D_801BFF90","UNK_TYPE1","",0x1), 0x801BFF98:("sPlayerStrengths","UNK_TYPE1","",0x1), 0x801BFFA0:("sEnvironmentTextTriggers","UNK_TYPE1","",0x1), 0x801BFFB0:("gPlayerModelTypes","UNK_TYPE1","",0x1), - 0x801BFFFC:("D_801BFFFC","UNK_TYPE1","",0x1), - 0x801C0024:("D_801C0024","UNK_TYPE1","",0x1), - 0x801C0034:("D_801C0034","UNK_TYPE1","",0x1), - 0x801C005C:("D_801C005C","UNK_TYPE1","",0x1), - 0x801C0084:("D_801C0084","UNK_TYPE1","",0x1), - 0x801C00AC:("D_801C00AC","UNK_TYPE1","",0x1), - 0x801C00BC:("D_801C00BC","UNK_TYPE1","",0x1), - 0x801C00D4:("D_801C00D4","UNK_TYPE1","",0x1), - 0x801C00EC:("D_801C00EC","UNK_TYPE1","",0x1), - 0x801C0114:("D_801C0114","UNK_TYPE1","",0x1), - 0x801C013C:("D_801C013C","UNK_TYPE1","",0x1), - 0x801C0164:("D_801C0164","UNK_TYPE1","",0x1), + 0x801BFFFC:("gPlayerWaistDLs","UNK_TYPE1","",0x1), + 0x801C0024:("gPlayerHandHoldingShields","UNK_TYPE1","",0x1), + 0x801C0034:("gPlayerSheath12DLs","UNK_TYPE1","",0x1), + 0x801C005C:("gPlayerSheath13DLs","UNK_TYPE1","",0x1), + 0x801C0084:("gPlayerSheath14DLs","UNK_TYPE1","",0x1), + 0x801C00AC:("gPlayerShields","UNK_TYPE1","",0x1), + 0x801C00BC:("gPlayerSheathedSwords","UNK_TYPE1","",0x1), + 0x801C00D4:("gPlayerSwordSheaths","UNK_TYPE1","",0x1), + 0x801C00EC:("gPlayerLeftHandTwoHandSwordDLs","UNK_TYPE1","",0x1), + 0x801C0114:("gPlayerLeftHandOpenDLs","UNK_TYPE1","",0x1), + 0x801C013C:("gPlayerLeftHandClosedDLs","UNK_TYPE1","",0x1), + 0x801C0164:("gPlayerLeftHandOneHandSwordDLs","UNK_TYPE1","",0x1), 0x801C018C:("D_801C018C","UNK_TYPE1","",0x1), - 0x801C01A4:("D_801C01A4","UNK_TYPE1","",0x1), - 0x801C01CC:("D_801C01CC","UNK_TYPE1","",0x1), - 0x801C01F4:("D_801C01F4","UNK_TYPE1","",0x1), - 0x801C021C:("D_801C021C","UNK_TYPE1","",0x1), - 0x801C0244:("D_801C0244","UNK_TYPE1","",0x1), - 0x801C026C:("D_801C026C","UNK_TYPE1","",0x1), + 0x801C01A4:("gPlayerRightHandOpenDLs","UNK_TYPE1","",0x1), + 0x801C01CC:("gPlayerRightHandClosedDLs","UNK_TYPE1","",0x1), + 0x801C01F4:("gPlayerRightHandBowDLs","UNK_TYPE1","",0x1), + 0x801C021C:("gPlayerRightHandInstrumentDLs","UNK_TYPE1","",0x1), + 0x801C0244:("gPlayerRightHandHookshotDLs","UNK_TYPE1","",0x1), + 0x801C026C:("gPlayerLeftHandBottleDLs","UNK_TYPE1","",0x1), 0x801C0294:("D_801C0294","UNK_TYPE1","",0x1), 0x801C02A8:("D_801C02A8","UNK_TYPE1","",0x1), 0x801C02BC:("D_801C02BC","UNK_TYPE1","",0x1), @@ -1260,11 +1260,11 @@ 0x801C07F0:("D_801C07F0","UNK_TYPE1","",0x1), 0x801C0820:("D_801C0820","UNK_TYPE1","",0x1), 0x801C0838:("D_801C0838","UNK_TYPE1","",0x1), - 0x801C0850:("D_801C0850","UNK_TYPE1","",0x1), - 0x801C0860:("D_801C0860","UNK_TYPE1","",0x1), - 0x801C0870:("D_801C0870","UNK_PTR","",0x4), - 0x801C0890:("D_801C0890","UNK_TYPE1","",0x1), - 0x801C08A0:("D_801C08A0","UNK_TYPE1","",0x20), + 0x801C0850:("gCullBackDList","UNK_TYPE1","",0x1), + 0x801C0860:("gCullFrontDList","UNK_TYPE1","",0x1), + 0x801C0870:("sPlayerEyesTextures","UNK_PTR","",0x4), + 0x801C0890:("sPlayerMouthTextures","UNK_TYPE1","",0x1), + 0x801C08A0:("sPlayerFaces","UNK_TYPE1","",0x20), 0x801C08C0:("D_801C08C0","UNK_TYPE1","",0x1), 0x801C08FC:("D_801C08FC","UNK_TYPE1","",0x1), 0x801C0910:("D_801C0910","UNK_TYPE1","",0x1), @@ -4003,17 +4003,17 @@ 0x801F5834:("D_801F5834","UNK_TYPE1","",0x1), 0x801F5840:("gNMIBuffer","s32*","",0x4), 0x801F5850:("sPostmanTimerInput","UNK_TYPE1","",0x1), - 0x801F58B0:("D_801F58B0","UNK_TYPE1","",0x1), + 0x801F58B0:("D_801F58B0","struct_801F58B0","[3][3]",0xFC), 0x801F59AC:("D_801F59AC","UNK_TYPE1","",0x1), - 0x801F59B0:("D_801F59B0","UNK_TYPE1","",0x1), - 0x801F59C8:("D_801F59C8","UNK_TYPE1","",0x1), - 0x801F59D0:("D_801F59D0","UNK_TYPE1","",0x1), - 0x801F59DC:("D_801F59DC","UNK_TYPE1","",0x1), - 0x801F59E0:("D_801F59E0","UNK_TYPE1","",0x1), - 0x801F59E4:("D_801F59E4","UNK_TYPE1","",0x1), + 0x801F59B0:("D_801F59B0","Vec3f","[2]",0x18), + 0x801F59C8:("D_801F59C8","s32","[2]",0x8), + 0x801F59D0:("D_801F59D0","struct_801F59D0","",0x0A), + 0x801F59DC:("D_801F59DC","Vec3f*","",0x4), + 0x801F59E0:("D_801F59E0","s32","",0x4), + 0x801F59E4:("D_801F59E4","s32","",0x4), 0x801F59E8:("D_801F59E8","Vec3f","",0xC), - 0x801F59F4:("D_801F59F4","UNK_TYPE1","",0x1), - 0x801F59F8:("D_801F59F8","UNK_TYPE1","",0x1), + 0x801F59F4:("D_801F59F4","s32","",0x4), + 0x801F59F8:("D_801F59F8","s32","",0x4), 0x801F5A00:("sQuakeRequest","QuakeRequest","[4]",0x90), 0x801F5A90:("sDistortionRequest","DistortionRequest","",0xc), 0x801F5AA0:("sMatAnimStep","s32","",0x4), diff --git a/tools/namefixer.py b/tools/namefixer.py index aba4a5aa4..eae3efd94 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -297,6 +297,7 @@ wordReplace = { "func_800B86C8": "Actor_ChangeFocus", "func_800B90F4": "Actor_DeactivateLens", "func_800BC770": "Actor_AddQuake", + "func_800DF840": "Camera_ChangeMode", "zelda_malloc": "ZeldaArena_Malloc", "zelda_mallocR": "ZeldaArena_MallocR", "zelda_realloc": "ZeldaArena_Realloc", @@ -606,6 +607,7 @@ wordReplace = { "EffectSsKiraKira_SpawnSmall": "EffectSsKirakira_SpawnSmall", "EffectSsKiraKira_SpawnDispersed": "EffectSsKirakira_SpawnDispersed", "EffectSsKiraKira_SpawnFocused": "EffectSsKirakira_SpawnFocused", + "Effect_Getplay": "Effect_GetPlayState", "Effect_GetGlobalCtx": "Effect_GetPlayState", "EffectSsHitMark_Spawn": "EffectSsHitmark_Spawn", "EffectSsHitMark_SpawnFixedScale": "EffectSsHitmark_SpawnFixedScale", @@ -699,6 +701,7 @@ wordReplace = { "gSaveContext.equips": "gSaveContext.save.equips", "gSaveContext.unk_1016": "gSaveContext.jinxTimer", "gSaveContext.unk_3F58": "gSaveContext.sunsSongState", + "gSaveContext.equips.buttonItems": "gSaveContext.save.equips.buttonItems", "gSaveContext.unk_48C8": "gSaveContext.dungeonIndex", "gSaveContext.save.playerData.magicAcquired": "gSaveContext.save.playerData.isMagicAcquired", "gSaveContext.save.playerDatadoubleMagic": "gSaveContext.save.playerData.isDoubleMagicAcquired", @@ -723,6 +726,7 @@ wordReplace = { "player->swordAnimation": "player->meleeWeaponAnimation", "player->swordState": "player->meleeWeaponState", "player->swordInfo": "player->meleeWeaponInfo", + "csCtx.npcActions": "csCtx.actorActions", "csCtx->npcActions": "csCtx->actorActions", "csCtx.unk_12": "csCtx.currentCsIndex", @@ -768,13 +772,10 @@ wordReplace = { "gSaveContext.fadeDuration": "gSaveContext.transFadeDuration", "gSaveContext.fadeSpeed": "gSaveContext.transWipeSpeed", - "D_801D15B0" : "gZeroVec3f", - "D_801D15BC" : "gZeroVec3s", - "D_801D1DE0" : "gIdentityMtx", - "D_801D1E20" : "gIdentityMtxF", - "D_04020658" : "gameplay_keep_Anim_020658", - "D_04022B28" : "gDoorSkel", - "D_04023100" : "gDoorCol", + "D_801D15B0": "gZeroVec3f", + "D_801D15BC": "gZeroVec3s", + "D_801D1DE0": "gIdentityMtx", + "D_801D1E20": "gIdentityMtxF", # Macros "CUR_EQUIP_VALUE_VOID": "GET_CUR_EQUIP_VALUE", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index a2d2354ff..1678b9186 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1716,7 +1716,7 @@ asm/non_matchings/code/z_player_lib/func_801235DC.s,func_801235DC,0x801235DC,0x1 asm/non_matchings/code/z_player_lib/func_8012364C.s,func_8012364C,0x8012364C,0x71 asm/non_matchings/code/z_player_lib/func_80123810.s,func_80123810,0x80123810,0x54 asm/non_matchings/code/z_player_lib/Player_ActionToModelGroup.s,Player_ActionToModelGroup,0x80123960,0x13 -asm/non_matchings/code/z_player_lib/func_801239AC.s,func_801239AC,0x801239AC,0x3E +asm/non_matchings/code/z_player_lib/Player_SetModelsForHoldingShield.s,Player_SetModelsForHoldingShield,0x801239AC,0x3E asm/non_matchings/code/z_player_lib/Player_SetModels.s,Player_SetModels,0x80123AA4,0x4C asm/non_matchings/code/z_player_lib/Player_SetModelGroup.s,Player_SetModelGroup,0x80123BD4,0x21 asm/non_matchings/code/z_player_lib/func_80123C58.s,func_80123C58,0x80123C58,0xE @@ -1744,12 +1744,12 @@ asm/non_matchings/code/z_player_lib/Player_ActionToBottle.s,Player_ActionToBottl asm/non_matchings/code/z_player_lib/Player_GetBottleHeld.s,Player_GetBottleHeld,0x8012420C,0x8 asm/non_matchings/code/z_player_lib/Player_ActionToExplosive.s,Player_ActionToExplosive,0x8012422C,0xB asm/non_matchings/code/z_player_lib/Player_GetExplosiveHeld.s,Player_GetExplosiveHeld,0x80124258,0x8 -asm/non_matchings/code/z_player_lib/func_80124278.s,func_80124278,0x80124278,0xF +asm/non_matchings/code/z_player_lib/Player_ActionToSword.s,Player_ActionToSword,0x80124278,0xF asm/non_matchings/code/z_player_lib/func_801242B4.s,func_801242B4,0x801242B4,0xA asm/non_matchings/code/z_player_lib/Player_GetEnvTimerType.s,Player_GetEnvTimerType,0x801242DC,0x51 asm/non_matchings/code/z_player_lib/func_80124420.s,func_80124420,0x80124420,0x7E asm/non_matchings/code/z_player_lib/func_80124618.s,func_80124618,0x80124618,0x37 -asm/non_matchings/code/z_player_lib/func_801246F4.s,func_801246F4,0x801246F4,0x5F +asm/non_matchings/code/z_player_lib/Player_DrawImpl.s,Player_DrawImpl,0x801246F4,0x5F asm/non_matchings/code/z_player_lib/func_80124870.s,func_80124870,0x80124870,0x115 asm/non_matchings/code/z_player_lib/func_80124CC4.s,func_80124CC4,0x80124CC4,0x95 asm/non_matchings/code/z_player_lib/func_80124F18.s,func_80124F18,0x80124F18,0x36 @@ -1777,14 +1777,14 @@ asm/non_matchings/code/z_player_lib/func_801271B0.s,func_801271B0,0x801271B0,0xA asm/non_matchings/code/z_player_lib/func_80127438.s,func_80127438,0x80127438,0x14 asm/non_matchings/code/z_player_lib/func_80127488.s,func_80127488,0x80127488,0x31 asm/non_matchings/code/z_player_lib/Player_DrawCouplesMask.s,Player_DrawCouplesMask,0x8012754C,0x12 -asm/non_matchings/code/z_player_lib/func_80127594.s,func_80127594,0x80127594,0xD9 -asm/non_matchings/code/z_player_lib/func_801278F8.s,func_801278F8,0x801278F8,0x5A -asm/non_matchings/code/z_player_lib/func_80127A60.s,func_80127A60,0x80127A60,0x41 +asm/non_matchings/code/z_player_lib/Player_DrawCircusLeadersMask.s,Player_DrawCircusLeadersMask,0x80127594,0xD9 +asm/non_matchings/code/z_player_lib/Player_DrawBlastMask.s,Player_DrawBlastMask,0x801278F8,0x5A +asm/non_matchings/code/z_player_lib/Player_DrawBunnyHood.s,Player_DrawBunnyHood,0x80127A60,0x41 asm/non_matchings/code/z_player_lib/func_80127B64.s,func_80127B64,0x80127B64,0x21 asm/non_matchings/code/z_player_lib/func_80127BE8.s,func_80127BE8,0x80127BE8,0x6F asm/non_matchings/code/z_player_lib/func_80127DA4.s,func_80127DA4,0x80127DA4,0x179 asm/non_matchings/code/z_player_lib/func_80128388.s,func_80128388,0x80128388,0x46 -asm/non_matchings/code/z_player_lib/func_801284A0.s,func_801284A0,0x801284A0,0x68 +asm/non_matchings/code/z_player_lib/Player_DrawGreatFairysMask.s,Player_DrawGreatFairysMask,0x801284A0,0x68 asm/non_matchings/code/z_player_lib/func_80128640.s,func_80128640,0x80128640,0x14D asm/non_matchings/code/z_player_lib/func_80128B74.s,func_80128B74,0x80128B74,0x17 asm/non_matchings/code/z_player_lib/func_80128BD0.s,func_80128BD0,0x80128BD0,0x4C8 From 29a7a6714a691a65f80768633cecf4ce7d6918b1 Mon Sep 17 00:00:00 2001 From: fig02 Date: Sat, 15 Oct 2022 22:04:14 -0400 Subject: [PATCH 10/12] Rename elf_message to QuestHint (sync with oot) (#1124) * rename elf_message to QuestHint * port more things and review * command arg name * Update include/z64scene.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_scene.c Co-authored-by: EllipticEllipsis Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: EllipticEllipsis --- include/functions.h | 2 +- include/z64.h | 2 +- include/z64scene.h | 14 +++++++--- src/code/z_elf_message.c | 33 ++++++++++++++++++++++- src/code/z_scene.c | 8 +++--- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 8 +++--- tools/disasm/functions.txt | 2 +- 7 files changed, 55 insertions(+), 14 deletions(-) diff --git a/include/functions.h b/include/functions.h index f0a96080a..dbe7d1de1 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1263,7 +1263,7 @@ void SoundSource_InitAll(PlayState* play); void SoundSource_UpdateAll(PlayState* play); void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, u32 duration, u16 sfxId); void SoundSource_PlaySfxEachFrameAtFixedWorldPos(PlayState* play, Vec3f* worldPos, u32 duration, u16 sfxId); -u16 ElfMessage_GetFirstCycleHint(PlayState* play); +u16 QuestHint_GetTatlTextId(PlayState* play); u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet); void EnvFlags_UnsetAll(PlayState* play); diff --git a/include/z64.h b/include/z64.h index 7552cbe66..2daea1d77 100644 --- a/include/z64.h +++ b/include/z64.h @@ -1067,7 +1067,7 @@ struct PlayState { /* 0x1885C */ EntranceEntry* setupEntranceList; /* 0x18860 */ u16* setupExitList; /* 0x18864 */ Path* setupPathList; - /* 0x18868 */ void* unk_18868; + /* 0x18868 */ void* naviQuestHints; // leftover from OoT, system which processes this is removed /* 0x1886C */ AnimatedMaterial* sceneMaterialAnims; /* 0x18870 */ void* specialEffects; /* 0x18874 */ u8 skyboxId; diff --git a/include/z64scene.h b/include/z64scene.h index 3af90e02c..088565c0c 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -67,7 +67,7 @@ typedef struct { typedef struct { /* 0x0 */ u8 code; - /* 0x1 */ u8 cUpElfMsgNum; + /* 0x1 */ u8 naviQuestHintFileId; /* 0x4 */ u32 subKeepIndex; } SCmdSpecialFiles; // size = 0x8 @@ -825,6 +825,14 @@ typedef enum { /* 7 */ SCENE_DRAW_CFG_MAT_ANIM_MANUAL_STEP } SceneDrawConfigIds; +// TODO: make ZAPD use this enum for `SCENE_CMD_SPECIAL_FILES` +// Leftover from OoT +typedef enum { + /* 0 */ NAVI_QUEST_HINTS_NONE, + /* 1 */ NAVI_QUEST_HINTS_OVERWORLD, + /* 2 */ NAVI_QUEST_HINTS_DUNGEON +} NaviQuestHintFileId; + // SceneTableEntry commands typedef enum { /* 0x00 */ SCENE_CMD_ID_SPAWN_LIST, @@ -882,8 +890,8 @@ typedef enum { #define SCENE_CMD_ENTRANCE_LIST(entranceList) \ { SCENE_CMD_ID_ENTRANCE_LIST, 0, CMD_PTR(entranceList) } -#define SCENE_CMD_SPECIAL_FILES(elfMessageFile, keepObjectId) \ - { SCENE_CMD_ID_SPECIAL_FILES, elfMessageFile, CMD_W(keepObjectId) } +#define SCENE_CMD_SPECIAL_FILES(naviQuestHintFileId, keepObjectId) \ + { SCENE_CMD_ID_SPECIAL_FILES, naviQuestHintFileId, CMD_W(keepObjectId) } #define SCENE_CMD_ROOM_BEHAVIOR(curRoomUnk3, curRoomUnk2, curRoomUnk5, msgCtxunk12044, enablePosLights, \ kankyoContextUnkE2) \ diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index 11e4a2743..a5a4890a7 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -1,62 +1,93 @@ +/** + * @file z_elf_message.c + * + * This file provides quest hints through Tatl. + * + * In Ocarina of Time, this was a more elaborate system that determined + * which hint to give based on a script. + * That system has been replaced with a single function that hardcodes the checks. + */ #include "global.h" -u16 ElfMessage_GetFirstCycleHint(PlayState* play) { +/** + * Gets the relevant text ID for Tatl hints in first cycle. + */ +u16 QuestHint_GetTatlTextId(PlayState* play) { if (INV_CONTENT(ITEM_OCARINA) == ITEM_OCARINA) { return 0; } + if (CURRENT_DAY <= 0) { return 0; } + if (gSaveContext.save.weekEventReg[88] & 0x20) { return 0; } + if (gSaveContext.save.weekEventReg[79] & 0x10) { if (gSaveContext.save.weekEventReg[8] & 0x40) { return 0; } + return 0x224; } + if (!(gSaveContext.save.weekEventReg[8] & 0x80)) { if (gSaveContext.save.weekEventReg[9] & 1) { return 0x21E; } + if (play->sceneId == SCENE_YOUSEI_IZUMI) { return 0; } + return 0x21D; } + if (gSaveContext.save.playerData.isMagicAcquired != true) { return 0x21F; } + if (INV_CONTENT(ITEM_DEED_LAND) == ITEM_DEED_LAND) { if (play->sceneId != SCENE_OKUJOU) { return 0x244; } + return 0; } + if (INV_CONTENT(ITEM_MOON_TEAR) == ITEM_MOON_TEAR) { if (gSaveContext.save.weekEventReg[86] & 4) { return 0x242; } + return 0x243; } + if (gSaveContext.save.weekEventReg[74] & 0x20) { return 0x223; } + if (gSaveContext.save.weekEventReg[73] & 0x80) { return 0x222; } + if (gSaveContext.save.weekEventReg[73] & 0x20) { return 0x221; } + if (gSaveContext.save.weekEventReg[77] & 2) { if (gSaveContext.save.weekEventReg[73] & 0x10) { return 0x240; } + return 0x241; } + if ((gSaveContext.save.weekEventReg[86] & 2) || (gSaveContext.save.weekEventReg[73] & 0x40)) { return 0x23F; } + return 0x220; } diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 1167f14ab..7cb180b80 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -216,7 +216,9 @@ void Scene_HeaderCmdEntranceList(PlayState* play, SceneCmd* cmd) { // SceneTableEntry Header Command 0x07: Special Files void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) { - static RomFile tatlMessageFiles[2] = { + // @note These quest hint files are identical to OoT's. + // They are not relevant in this game and the system to process these scripts has been removed. + static RomFile naviQuestHintFiles[2] = { { SEGMENT_ROM_START(elf_message_field), SEGMENT_ROM_END(elf_message_field) }, { SEGMENT_ROM_START(elf_message_ydan), SEGMENT_ROM_END(elf_message_ydan) }, }; @@ -227,8 +229,8 @@ void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) { gSegments[0x05] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment); } - if (cmd->specialFiles.cUpElfMsgNum != 0) { - play->unk_18868 = Play_LoadScene(play, &tatlMessageFiles[cmd->specialFiles.cUpElfMsgNum - 1]); + if (cmd->specialFiles.naviQuestHintFileId != NAVI_QUEST_HINTS_NONE) { + play->naviQuestHints = Play_LoadScene(play, &naviQuestHintFiles[cmd->specialFiles.naviQuestHintFileId - 1]); } } diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index f00963f12..27f619816 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -358,7 +358,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) { if ((gSaveContext.save.playerData.tatlTimer >= 25800) || (gSaveContext.save.playerData.tatlTimer < 3000)) { gSaveContext.save.playerData.tatlTimer = 0; } - this->unk_266 = ElfMessage_GetFirstCycleHint(play); + this->unk_266 = QuestHint_GetTatlTextId(play); break; case 1: @@ -1449,7 +1449,7 @@ void func_8089010C(Actor* thisx, PlayState* play) { s32 pad; EnElf* this = THIS; Player* player = GET_PLAYER(play); - u16 temp_v0 = ElfMessage_GetFirstCycleHint(play); + u16 temp_v0 = QuestHint_GetTatlTextId(play); if (temp_v0 != this->unk_266) { this->unk_266 = temp_v0; @@ -1458,7 +1458,7 @@ void func_8089010C(Actor* thisx, PlayState* play) { if ((player->tatlTextId == 0) && (player->unk_730 == NULL)) { if ((gSaveContext.save.playerData.tatlTimer >= 600) && (gSaveContext.save.playerData.tatlTimer <= 3000)) { - player->tatlTextId = ElfMessage_GetFirstCycleHint(play); + player->tatlTextId = QuestHint_GetTatlTextId(play); } } @@ -1470,7 +1470,7 @@ void func_8089010C(Actor* thisx, PlayState* play) { func_8019FDC8(&gSfxDefaultPos, NA_SE_VO_NA_LISTEN, 0x20); thisx->focus.pos = thisx->world.pos; - if (thisx->textId == ElfMessage_GetFirstCycleHint(play)) { + if (thisx->textId == QuestHint_GetTatlTextId(play)) { this->fairyFlags |= 0x80; gSaveContext.save.playerData.tatlTimer = 3001; } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 8e074c509..276694be7 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -1615,7 +1615,7 @@ 0x800F048C:("SoundSource_Add",), 0x800F0568:("SoundSource_PlaySfxAtFixedWorldPos",), 0x800F0590:("SoundSource_PlaySfxEachFrameAtFixedWorldPos",), - 0x800F05C0:("ElfMessage_GetFirstCycleHint",), + 0x800F05C0:("QuestHint_GetTatlTextId",), 0x800F07C0:("EnHy_ChangeAnim",), 0x800F0888:("EnHy_FindNearestDoor",), 0x800F0944:("EnHy_ChangeObjectAndAnim",), From 62b465b3ea7d9019294ff2d973470189bdaff3f1 Mon Sep 17 00:00:00 2001 From: Alejandro Asenjo <96613413+sonicdcer@users.noreply.github.com> Date: Sun, 16 Oct 2022 00:36:25 -0300 Subject: [PATCH 11/12] ovl_Bg_Dkjail_Ivy OK (#1014) * ovl_Bg_Dkjail_Ivy OK * Co-authored-by: petrie911 petrie911@users.noreply.github.com * xml * pr review * pr review * pos / vel / accel * format * angle * Update src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c Co-authored-by: EllipticEllipsis * in-function static * BgDkjailIvy_SetIdle * _WaitForCut * setup * pr review * Actor_Kill Co-authored-by: Anghelo Carvajal Co-authored-by: EllipticEllipsis --- assets/xml/objects/object_dkjail_obj.xml | 2 +- spec | 3 +- .../ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c | 182 +++++++++++++++--- .../ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.h | 9 +- tools/disasm/functions.txt | 14 +- 5 files changed, 174 insertions(+), 36 deletions(-) diff --git a/assets/xml/objects/object_dkjail_obj.xml b/assets/xml/objects/object_dkjail_obj.xml index 219181c6d..ada181475 100644 --- a/assets/xml/objects/object_dkjail_obj.xml +++ b/assets/xml/objects/object_dkjail_obj.xml @@ -1,6 +1,6 @@  - + diff --git a/spec b/spec index 3837f6b30..48c0983a0 100644 --- a/spec +++ b/spec @@ -3388,8 +3388,7 @@ beginseg name "ovl_Bg_Dkjail_Ivy" compress include "build/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.o" - include "build/data/ovl_Bg_Dkjail_Ivy/ovl_Bg_Dkjail_Ivy.data.o" - include "build/data/ovl_Bg_Dkjail_Ivy/ovl_Bg_Dkjail_Ivy.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Dkjail_Ivy/ovl_Bg_Dkjail_Ivy_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c index adeba93c8..87adddbde 100644 --- a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c +++ b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c @@ -5,6 +5,8 @@ */ #include "z_bg_dkjail_ivy.h" +#include "assets/objects/gameplay_keep/gameplay_keep.h" +#include "assets/objects/object_dkjail_obj/object_dkjail_obj.h" #define FLAGS 0x00000000 @@ -15,7 +17,13 @@ void BgDkjailIvy_Destroy(Actor* thisx, PlayState* play); void BgDkjailIvy_Update(Actor* thisx, PlayState* play); void BgDkjailIvy_Draw(Actor* thisx, PlayState* play); -#if 0 +void BgDkjailIvy_SetupWaitForCut(BgDkjailIvy* this); +void BgDkjailIvy_WaitForCut(BgDkjailIvy* this, PlayState* play); +void BgDkjailIvy_SetupCutscene(BgDkjailIvy* this); +void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play); +void BgDkjailIvy_SetupFadeOut(BgDkjailIvy* this); +void BgDkjailIvy_FadeOut(BgDkjailIvy* this, PlayState* play); + const ActorInit Bg_Dkjail_Ivy_InitVars = { ACTOR_BG_DKJAIL_IVY, ACTORCAT_BG, @@ -28,47 +36,175 @@ const ActorInit Bg_Dkjail_Ivy_InitVars = { (ActorFunc)BgDkjailIvy_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80ADE950 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x01000200, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x01000200, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 20, 80, 0, { 0, 0, 0 } }, }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80ADE98C[] = { +void BgDkjailIvy_IvyCutEffects(BgDkjailIvy* this, PlayState* play) { + static Gfx* sLeafDlists[] = { gKakeraLeafMiddle, gKakeraLeafTip }; + static s16 sLeafScales[] = { 110, 80, 60, 40 }; + f32 phi_fs0; + s32 i; + Vec3f spD4; + Vec3f pos; + Vec3f vel; + Vec3f accel; + s16 angle; + + Matrix_RotateYS(this->dyna.actor.home.rot.y, MTXMODE_NEW); + + for (i = 0, angle = 0; i < 50; i++, angle += 0x4E20) { + spD4.y = (i * (90.0f / 49.0f)) + 2.0f; + if (spD4.y < 45.0f) { + phi_fs0 = ((1.0f / 180.0f) * spD4.y) + 0.75f; + } else if (spD4.y < 90.0f) { + phi_fs0 = ((-1.0f / 180.0f) * spD4.y) + 1.25f; + } else { + phi_fs0 = ((-1.0f / 30.0f) * spD4.y) + 3.75f; + } + + spD4.x = Math_SinS(angle) * 40.0f * phi_fs0; + spD4.z = (Rand_ZeroOne() * 6.0f) - 3.0f; + + Matrix_MultVec3f(&spD4, &pos); + + vel.x = (Rand_ZeroOne() - 0.5f) + (pos.x * 0.075f); + vel.y = 2.0f * Rand_ZeroOne(); + vel.z = (Rand_ZeroOne() - 0.5f) + (pos.z * 0.075f); + + pos.x += this->dyna.actor.world.pos.x; + pos.y += this->dyna.actor.world.pos.y; + pos.z += this->dyna.actor.world.pos.z; + + EffectSsKakera_Spawn(play, &pos, &vel, &pos, -0x82, 0x40, 0x28, 0, 0, sLeafScales[i & 3], 0, 0, 44, -1, + GAMEPLAY_KEEP, sLeafDlists[(s32)Rand_Next() > 0]); + + if ((i > 20) && ((i % 2) != 0)) { + accel.x = (Rand_ZeroOne() - 0.5f) * 0.2f; + accel.y = (Rand_ZeroOne() * 0.02f) - 0.1f; + accel.z = (Rand_ZeroOne() - 0.5f) * 0.2f; + + func_800B12F0(play, &pos, &gZeroVec3f, &accel, ((Rand_Next() >> 26) + 10), (Rand_Next() >> 28), 50); + } + } +} + +static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 200, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 200, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -#endif +void BgDkjailIvy_Init(Actor* thisx, PlayState* play) { + s32 pad; + BgDkjailIvy* this = THIS; -extern ColliderCylinderInit D_80ADE950; -extern InitChainEntry D_80ADE98C[]; + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); + DynaPolyActor_Init(&this->dyna, 0); + Collider_InitCylinder(play, &this->collider); -extern UNK_TYPE D_06000080; -extern UNK_TYPE D_060011A8; + if (Flags_GetSwitch(play, BG_DKJAIL_GET_SWITCH(thisx))) { + Actor_Kill(&this->dyna.actor); + } else { + DynaPolyActor_LoadMesh(play, &this->dyna, &object_dkjail_obj_Colheader_0011A8); + Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + this->alpha = 255; + BgDkjailIvy_SetupWaitForCut(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE230.s") +void BgDkjailIvy_Destroy(Actor* thisx, PlayState* play) { + BgDkjailIvy* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/BgDkjailIvy_Init.s") + DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); + Collider_DestroyCylinder(play, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/BgDkjailIvy_Destroy.s") +void BgDkjailIvy_SetupWaitForCut(BgDkjailIvy* this) { + this->actionFunc = BgDkjailIvy_WaitForCut; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE6AC.s") +void BgDkjailIvy_WaitForCut(BgDkjailIvy* this, PlayState* play) { + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + this->dyna.actor.flags |= ACTOR_FLAG_10; + ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + BgDkjailIvy_SetupCutscene(this); + } else { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE6C0.s") +void BgDkjailIvy_SetupCutscene(BgDkjailIvy* this) { + this->actionFunc = BgDkjailIvy_BeginCutscene; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE734.s") +void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play) { + if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { + ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + this->fadeOutTimer = 50; + func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId); + Flags_SetSwitch(play, BG_DKJAIL_GET_SWITCH(&this->dyna.actor)); + BgDkjailIvy_IvyCutEffects(this, play); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_GRASS_WALL_BROKEN); + BgDkjailIvy_SetupFadeOut(this); + } else { + ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE748.s") +void BgDkjailIvy_SetupFadeOut(BgDkjailIvy* this) { + this->actionFunc = BgDkjailIvy_FadeOut; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE7E0.s") +void BgDkjailIvy_FadeOut(BgDkjailIvy* this, PlayState* play) { + if (this->alpha > 8) { + this->alpha -= 8; + } else { + this->alpha = 0; + this->dyna.actor.draw = NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE7F4.s") + this->fadeOutTimer--; + if (this->fadeOutTimer <= 0) { + Actor_Kill(&this->dyna.actor); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/BgDkjailIvy_Update.s") +void BgDkjailIvy_Update(Actor* thisx, PlayState* play) { + BgDkjailIvy* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/BgDkjailIvy_Draw.s") + this->actionFunc(this, play); +} + +void BgDkjailIvy_Draw(Actor* thisx, PlayState* play) { + BgDkjailIvy* this = THIS; + + OPEN_DISPS(play->state.gfxCtx); + + func_8012C2DC(play->state.gfxCtx); + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0xFF, 255, 255, 255, this->alpha); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, &gDkjailIvyDL); + + CLOSE_DISPS(play->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.h b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.h index c4d824dc0..edf87d662 100644 --- a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.h +++ b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.h @@ -3,15 +3,18 @@ #include "global.h" +#define BG_DKJAIL_GET_SWITCH(thisx) ((thisx)->params & 0x7F) + struct BgDkjailIvy; typedef void (*BgDkjailIvyActionFunc)(struct BgDkjailIvy*, PlayState*); typedef struct BgDkjailIvy { - /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x64]; + /* 0x000 */ DynaPolyActor dyna; + /* 0x15C */ ColliderCylinder collider; /* 0x1A8 */ BgDkjailIvyActionFunc actionFunc; - /* 0x1AC */ char unk_1AC[0x4]; + /* 0x1AC */ s8 fadeOutTimer; + /* 0x1AD */ u8 alpha; } BgDkjailIvy; // size = 0x1B0 extern const ActorInit Bg_Dkjail_Ivy_InitVars; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 276694be7..647cc3d79 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -12330,15 +12330,15 @@ 0x80ADD7B4:("func_80ADD7B4",), 0x80ADD7CC:("EnSellnuts_TransformLimbDraw",), 0x80ADD8A4:("EnSellnuts_Draw",), - 0x80ADE230:("func_80ADE230",), + 0x80ADE230:("BgDkjailIvy_IvyCutEffects",), 0x80ADE5A4:("BgDkjailIvy_Init",), 0x80ADE664:("BgDkjailIvy_Destroy",), - 0x80ADE6AC:("func_80ADE6AC",), - 0x80ADE6C0:("func_80ADE6C0",), - 0x80ADE734:("func_80ADE734",), - 0x80ADE748:("func_80ADE748",), - 0x80ADE7E0:("func_80ADE7E0",), - 0x80ADE7F4:("func_80ADE7F4",), + 0x80ADE6AC:("BgDkjailIvy_SetupWaitForCut",), + 0x80ADE6C0:("BgDkjailIvy_WaitForCut",), + 0x80ADE734:("BgDkjailIvy_SetupCutscene",), + 0x80ADE748:("BgDkjailIvy_BeginCutscene",), + 0x80ADE7E0:("BgDkjailIvy_SetupFadeOut",), + 0x80ADE7F4:("BgDkjailIvy_FadeOut",), 0x80ADE850:("BgDkjailIvy_Update",), 0x80ADE874:("BgDkjailIvy_Draw",), 0x80ADEA70:("ObjVisiblock_Init",), From 7b572e8c538a7b667b29e2a8422cefce7a5432d1 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 16 Oct 2022 17:20:16 +0900 Subject: [PATCH 12/12] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 29c3721b2..a627ead7c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -99,7 +99,7 @@ pipeline { branch 'master' } agent{ - label 'master' + label 'zeldaret_website' } steps { unstash 'reports'