From 538cecb195bf5dc111a22fff55ce9188c927a347 Mon Sep 17 00:00:00 2001 From: Donkey Kong Date: Sat, 21 Sep 2024 20:12:57 -0500 Subject: [PATCH] 38.9072% --- include/structs.h | 13 ++--- progress/progress.global_asm.csv | 14 +++--- progress/progress.total.csv | 14 +++--- progress/progress_global_asm.svg | 4 +- progress/progress_total.svg | 4 +- src/global_asm/code_17B90.c | 86 +++++++++++++++++++++++++++++--- 6 files changed, 104 insertions(+), 31 deletions(-) diff --git a/include/structs.h b/include/structs.h index d614c7d..55972b4 100644 --- a/include/structs.h +++ b/include/structs.h @@ -329,14 +329,15 @@ typedef struct actor_animation_state { AnimationStateUnk0 *unk4; AnimationStateUnk8 *unk8; s32 unkC; - s16 unk10; - s16 unk12; + f32 unk10; void *bone_arrays[2]; // at 0x14, camera, update bone positions // TODO: Proper type AnimationStateUnk1C *unk1C; AnimationStateUnk20 *unk20; // See boss func_dk64_boot_8002FB7C AnimationStateUnk24 *unk24; - s32 unk28; - s32 unk2C; + s16 unk28; + s16 unk2A; + s16 unk2C; + s16 unk2E; s32 unk30; union { struct { @@ -346,8 +347,8 @@ typedef struct actor_animation_state { }; f32 scale[3]; }; - s32 unk40; - s32 unk44; + f32 unk40; + f32 unk44; f32 unk48; f32 unk4C; f32 unk50; diff --git a/progress/progress.global_asm.csv b/progress/progress.global_asm.csv index 32e0ee1..f944be8 100644 --- a/progress/progress.global_asm.csv +++ b/progress/progress.global_asm.csv @@ -295,7 +295,7 @@ us,asm,func_global_asm_806FF32C,44,yes us,asm,func_global_asm_806E1334,424,yes us,asm,func_global_asm_806E7338,332,yes us,asm,func_global_asm_806D9184,32,yes -us,asm,func_global_asm_806155F4,56,no +us,asm,func_global_asm_806155F4,56,yes us,asm,func_global_asm_80614B34,260,no us,asm,func_global_asm_806A3B78,244,yes us,asm,func_global_asm_80618104,812,no @@ -678,7 +678,7 @@ us,asm,func_global_asm_806A5F44,96,yes us,asm,func_global_asm_806B1D78,92,yes us,asm,func_global_asm_80601D24,448,no us,asm,func_global_asm_80672E6C,32,yes -us,asm,func_global_asm_8061540C,272,no +us,asm,func_global_asm_8061540C,272,yes us,asm,func_global_asm_8065D994,1708,no us,asm,func_global_asm_80679010,84,yes us,asm,func_global_asm_806E8E78,140,yes @@ -1810,7 +1810,7 @@ us,asm,func_global_asm_80632E74,172,yes us,asm,func_global_asm_806175C4,428,no us,asm,func_global_asm_8060B140,752,no us,asm,func_global_asm_807131BC,96,yes -us,asm,func_global_asm_80615664,60,no +us,asm,func_global_asm_80615664,60,yes us,asm,func_global_asm_80684900,256,yes us,asm,deleteActor,40,yes us,asm,func_global_asm_8068B80C,16,yes @@ -1880,7 +1880,7 @@ us,asm,func_global_asm_806D79E4,68,yes us,asm,func_global_asm_806323C0,380,yes us,asm,func_global_asm_80636448,124,yes us,asm,func_global_asm_80669650,80,yes -us,asm,func_global_asm_8061562C,56,no +us,asm,func_global_asm_8061562C,56,yes us,asm,func_global_asm_806608FC,1084,no us,asm,func_global_asm_8072EF7C,288,yes us,asm,func_global_asm_80660520,784,no @@ -1888,7 +1888,7 @@ us,asm,func_global_asm_806F2FC0,464,yes us,asm,func_global_asm_8073B6B0,160,no us,asm,func_global_asm_8065EFF0,324,yes us,asm,func_global_asm_8069E018,40,yes -us,asm,func_global_asm_806156A0,60,no +us,asm,func_global_asm_806156A0,60,yes us,asm,func_global_asm_806D2A14,140,yes us,asm,func_global_asm_807023E8,124,yes us,asm,func_global_asm_8073749C,324,no @@ -3244,11 +3244,11 @@ us,asm,func_global_asm_806D9FD0,848,yes us,asm,func_global_asm_80685D84,244,yes us,asm,func_global_asm_8070C200,16,no us,asm,func_global_asm_8063254C,228,yes -us,asm,func_global_asm_80615558,156,no +us,asm,func_global_asm_80615558,156,yes us,asm,func_global_asm_806687E0,216,yes us,asm,func_global_asm_80613BA0,168,no us,asm,func_global_asm_80694948,984,no -us,asm,func_global_asm_8061551C,60,no +us,asm,func_global_asm_8061551C,60,yes us,asm,func_global_asm_8071A8B0,556,yes us,asm,func_global_asm_8062A348,168,yes us,asm,func_global_asm_806A734C,32,yes diff --git a/progress/progress.total.csv b/progress/progress.total.csv index fd4ecf7..e155be4 100644 --- a/progress/progress.total.csv +++ b/progress/progress.total.csv @@ -295,7 +295,7 @@ us,asm,func_global_asm_806FF32C,44,yes us,asm,func_global_asm_806E1334,424,yes us,asm,func_global_asm_806E7338,332,yes us,asm,func_global_asm_806D9184,32,yes -us,asm,func_global_asm_806155F4,56,no +us,asm,func_global_asm_806155F4,56,yes us,asm,func_global_asm_80614B34,260,no us,asm,func_global_asm_806A3B78,244,yes us,asm,func_global_asm_80618104,812,no @@ -678,7 +678,7 @@ us,asm,func_global_asm_806A5F44,96,yes us,asm,func_global_asm_806B1D78,92,yes us,asm,func_global_asm_80601D24,448,no us,asm,func_global_asm_80672E6C,32,yes -us,asm,func_global_asm_8061540C,272,no +us,asm,func_global_asm_8061540C,272,yes us,asm,func_global_asm_8065D994,1708,no us,asm,func_global_asm_80679010,84,yes us,asm,func_global_asm_806E8E78,140,yes @@ -1810,7 +1810,7 @@ us,asm,func_global_asm_80632E74,172,yes us,asm,func_global_asm_806175C4,428,no us,asm,func_global_asm_8060B140,752,no us,asm,func_global_asm_807131BC,96,yes -us,asm,func_global_asm_80615664,60,no +us,asm,func_global_asm_80615664,60,yes us,asm,func_global_asm_80684900,256,yes us,asm,deleteActor,40,yes us,asm,func_global_asm_8068B80C,16,yes @@ -1880,7 +1880,7 @@ us,asm,func_global_asm_806D79E4,68,yes us,asm,func_global_asm_806323C0,380,yes us,asm,func_global_asm_80636448,124,yes us,asm,func_global_asm_80669650,80,yes -us,asm,func_global_asm_8061562C,56,no +us,asm,func_global_asm_8061562C,56,yes us,asm,func_global_asm_806608FC,1084,no us,asm,func_global_asm_8072EF7C,288,yes us,asm,func_global_asm_80660520,784,no @@ -1888,7 +1888,7 @@ us,asm,func_global_asm_806F2FC0,464,yes us,asm,func_global_asm_8073B6B0,160,no us,asm,func_global_asm_8065EFF0,324,yes us,asm,func_global_asm_8069E018,40,yes -us,asm,func_global_asm_806156A0,60,no +us,asm,func_global_asm_806156A0,60,yes us,asm,func_global_asm_806D2A14,140,yes us,asm,func_global_asm_807023E8,124,yes us,asm,func_global_asm_8073749C,324,no @@ -3244,11 +3244,11 @@ us,asm,func_global_asm_806D9FD0,848,yes us,asm,func_global_asm_80685D84,244,yes us,asm,func_global_asm_8070C200,16,no us,asm,func_global_asm_8063254C,228,yes -us,asm,func_global_asm_80615558,156,no +us,asm,func_global_asm_80615558,156,yes us,asm,func_global_asm_806687E0,216,yes us,asm,func_global_asm_80613BA0,168,no us,asm,func_global_asm_80694948,984,no -us,asm,func_global_asm_8061551C,60,no +us,asm,func_global_asm_8061551C,60,yes us,asm,func_global_asm_8071A8B0,556,yes us,asm,func_global_asm_8062A348,168,yes us,asm,func_global_asm_806A734C,32,yes diff --git a/progress/progress_global_asm.svg b/progress/progress_global_asm.svg index d372158..290a65a 100644 --- a/progress/progress_global_asm.svg +++ b/progress/progress_global_asm.svg @@ -17,7 +17,7 @@ global_asm - 36.5912% - 36.5912% + 36.6496% + 36.6496% diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 98e36eb..8464427 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Donkey Kong 64 (US) - 38.8634% - 38.8634% + 38.9072% + 38.9072% diff --git a/src/global_asm/code_17B90.c b/src/global_asm/code_17B90.c index ef866ea..c073c7f 100644 --- a/src/global_asm/code_17B90.c +++ b/src/global_asm/code_17B90.c @@ -286,19 +286,91 @@ s32 func_global_asm_8061537C(Actor *arg0) { return 0; } -#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_17B90/func_global_asm_8061540C.s") +s32 func_global_asm_8061540C(Actor *arg0) { + f32 sp24; + AnimationStateUnk0 *var_v0; -#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_17B90/func_global_asm_8061551C.s") + if (arg0->animation_state->unk84 != 0) { + var_v0 = arg0->animation_state->unk4; + } else { + var_v0 = arg0->animation_state->unk0; + } + D_807F5AF0++; + func_global_asm_80614FD8(&sp24); + if (sp24 < 0.0f) { + sp24 = arg0->animation_state->unk88; + } + if ((arg0->animation_state->unk48 * var_v0->unk24) > 0.0f) { + if (sp24 <= var_v0->unk4) { + return 1; + } + goto block_10; + } + if (var_v0->unk4 <= sp24) { + return 1; + } +block_10: + arg0->animation_state->unk80 = sp24; + arg0->animation_state->unk78 |= 8; + return 0; +} -#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_17B90/func_global_asm_80615558.s") +s32 func_global_asm_8061551C(Actor *arg0) { + D_807F5AF0++; + if (arg0->animation_state->unk8->unk0 != 0) { + arg0->animation_state->unk78 |= 0x10; + } + return 0; +} -#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_17B90/func_global_asm_806155F4.s") +s32 func_global_asm_80615558(Actor *arg0) { + f32 sp1C; + ActorAnimationState *sp18; -#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_17B90/func_global_asm_8061562C.s") + sp18 = arg0->animation_state; + D_807F5AF0++; + func_global_asm_80614FD8(&sp1C); + if (sp18->unk8->unk0) { + if (sp1C < sp18->unk44) { + sp18->unk44 = sp1C; + sp18->unk40 = (sp18->unk44 - (sp18->unk10 * sp18->unk44)); + } + arg0->animation_state->unk78 |= 0x10; + } + return 0; +} -#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_17B90/func_global_asm_80615664.s") +s32 func_global_asm_806155F4(Actor *arg0) { + if (arg0->animation_state->unk88 != 0) { + D_807F5AF0++; + return 1; + } + return 0; +} -#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_17B90/func_global_asm_806156A0.s") +s32 func_global_asm_8061562C(Actor *arg0) { + if (arg0->animation_state->unk88 == 0) { + D_807F5AF0++; + return 1; + } + return 0; +} + +s32 func_global_asm_80615664(Actor *arg0) { + if (arg0->animation_state->unk4->unk0 == 0) { + D_807F5AF0++; + return 1; + } + return 0; +} + +s32 func_global_asm_806156A0(Actor *arg0) { + if (arg0->animation_state->unk28 == arg0->animation_state->unk2C) { + D_807F5AF0++; + return 1; + } + return 0; +} #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_17B90/func_global_asm_806156DC.s")