From e0cc3dbc0eca3f2b21c948fad3581a4adade713e Mon Sep 17 00:00:00 2001 From: Lywx Date: Wed, 22 Nov 2023 08:57:54 -0600 Subject: [PATCH] Decomp 2F300.c (#26) * Decompiled func_8002EE34 * Fixed format * Matched func_8002F64C * Decompiled func_8002FE74 and fixed array size --- src/main/sf_2F300.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/main/sf_2F300.c b/src/main/sf_2F300.c index 110bb7e8..4914a0ad 100644 --- a/src/main/sf_2F300.c +++ b/src/main/sf_2F300.c @@ -1,10 +1,19 @@ -#include "common.h" +#include "global.h" + +extern s32 D_8015F904; +extern s32 D_80177CD0[4]; +extern s32 D_8017829C; +extern s32 D_800C9B4C; +extern s16 D_8016F5BE; +extern s16 D_8016F9F0; #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002E700.s") #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002ED60.s") -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002EE34.s") +void func_8002EE34(void) { + D_8015F904 = D_8017829C = D_80163FE0[1].unk_054 = D_80163FE0[2].unk_054 = D_80163FE0[3].unk_054 = 0; +} #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002EE64.s") @@ -14,7 +23,12 @@ #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002F5F4.s") -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002F64C.s") +void func_8002F64C(void) { + if ((D_80177CD0[0] + D_80177CD0[1] + D_80177CD0[2] + D_80177CD0[3]) == 0) { + D_8017829C = 0; + } + func_8002F5F4(); +} #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002F69C.s") @@ -22,7 +36,20 @@ #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002FC00.s") -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002FE74.s") +s32 func_8002FE74(void) { + switch (D_80178234) { + case 14: + return D_8015F928 == (D_800C9B4C + 0x960); + case 17: + return D_8016F9F0 == 4; + case 16: + return D_8016F5BE == 2; + default: + return 0; + } + + return 0; +} #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2F300/func_8002FEF0.s")