From 35ff3f1f39666e33604e3e77879562a3d237bff4 Mon Sep 17 00:00:00 2001 From: Alejandro Asenjo Nitti <96613413+sonicdcer@users.noreply.github.com> Date: Fri, 27 Oct 2023 02:35:11 -0300 Subject: [PATCH] sf_hud functions (#12) * space * decompile func_80090CCC * unk_ format * Rand_ZeroOne * decompile func_80090E8C * decompile func_800910C0 * decompile func_80091298 * decompile func_80091368 * dec * false * decompile func_800914FC * decompile func_80091864 * decompile func_80091B90 * decompile func_80091CF8 * dec * decompile func_80091DF4 --- include/functions.h | 1 + include/variables.h | 1 + src/main/sf_hud.c | 36 ++++++++++++++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/include/functions.h b/include/functions.h index 5cb35ad2..54458929 100644 --- a/include/functions.h +++ b/include/functions.h @@ -55,6 +55,7 @@ OSMesgQueue* osPiGetCmdQueue(void); s32 func_8002DE78(void*, s32, s32); // Not real signature void func_80060FBC(u8*, f32*); +void func_8006EEFC(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); void func_80084688(s32, s32); void func_800857DC(f32, f32, f32, f32); diff --git a/include/variables.h b/include/variables.h index 8f045f9d..9e8fbd33 100644 --- a/include/variables.h +++ b/include/variables.h @@ -152,6 +152,7 @@ extern f32 D_801B9060; extern f32 D_801B9064; extern Matrix* D_8013B3C0; +extern s32 D_8013BBC8; extern f32 D_800C5D28[]; extern s32 D_801ADA44_EE6104[]; diff --git a/src/main/sf_hud.c b/src/main/sf_hud.c index 653c1f3d..730fec1b 100644 --- a/src/main/sf_hud.c +++ b/src/main/sf_hud.c @@ -1697,9 +1697,41 @@ s32 func_80091B90(UnkStruct_func_80090A00* arg0) { return false; } -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_80091CF8.s") +s32 func_80091CF8(UnkStruct_func_80090A00* arg0) { + if (arg0->unk_050[1] != 0) { + if (arg0->unk_114[10] < 0.1f) { + arg0->unk_114[10] = 20.0f; + func_80019218(0x09000002, arg0->unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + arg0->unk_114[29] = 5.0f; + } + arg0->unk_050[1] = 0; + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_80091DF4.s") + func_8009BC2C(&arg0->unk_114[10], 0.0f, 0.1f, 0.2f, 0.0f); + func_8009BC2C(&arg0->unk_114[9], arg0->unk_114[10], 0.1f, 2.0f, 0.0f); + + if (arg0->unk_114[10] < 0.1f) { + arg0->unk_050[11] = 1; + } + return false; +} + +s32 func_80091DF4(UnkStruct_func_80090A00* arg0) { + Vec3f sp44; + Vec3f sp38; + + if ((arg0->unk_050[0] != 0) && (D_80177848 > 70)) { + arg0->unk_050[0] = 0; + sp44.x = 0.0f; + sp44.y = 0.0f; + sp44.z = 100.0f; + func_80006A20(D_8013BBC8, &sp44, &sp38); + func_8006EEFC(arg0->unk_0E4, arg0->unk_000.pos.x + (sp38.x * 1.5), arg0->unk_000.pos.y + (sp38.y * 1.5), + arg0->unk_000.pos.z + (sp38.z * 1.5), sp38.x, sp38.y, sp38.z, arg0->unk_000.unk_10.x, + arg0->unk_000.unk_10.y, arg0->unk_000.unk_10.z); + } + return false; +} #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_80091F00.s")