From e5f85e4cf3cbba2f85748c6ca157e7b290c21caf Mon Sep 17 00:00:00 2001 From: Kelebek1 Date: Thu, 22 Aug 2024 03:02:45 +0100 Subject: [PATCH] Fixes --- include/global.h | 81 +++++----- include/variables.h | 17 ++- src/11BA0.c | 79 +++++++++- src/11BA0.h | 7 +- src/12D80.h | 2 +- src/17300.h | 6 +- src/18140.h | 4 +- src/19840.h | 18 +-- src/1C720.c | 34 ++--- src/1C720.h | 22 +-- src/2E110.h | 2 +- src/32D10.h | 2 +- src/38BB0.c | 2 +- src/38BB0.h | 11 ++ src/49790.h | 2 +- src/4BA90.c | 114 +++++++++++++- src/fragments/2/fragment2.h | 4 +- src/fragments/6/fragment6.c | 290 ++++++++++++++++-------------------- src/fragments/7/fragment7.c | 115 +++++++------- src/fragments/8/fragment8.c | 92 ++++++------ src/fragments/8/fragment8.h | 4 +- src/memory.c | 2 +- src/memory.h | 6 +- yamls/us/rom.yaml | 4 +- 24 files changed, 543 insertions(+), 377 deletions(-) create mode 100644 src/38BB0.h diff --git a/include/global.h b/include/global.h index 572fd8f8..16bf8617 100644 --- a/include/global.h +++ b/include/global.h @@ -15,63 +15,63 @@ typedef unsigned int uintptr_t; #include "color.h" #include "math.h" -typedef struct unk_D_86002F58_004_00C_028 { +typedef struct unk_D_86002F58_004_000_00C_028 { /* 0x00 */ char pad0[4]; /* 0x04 */ u8 unk_04; /* 0x05 */ u8 unk_05; /* 0x06 */ char pad6[6]; /* 0x0C */ s32* unk_0C; /* 0x10 */ s32* unk_10; -} unk_D_86002F58_004_00C_028; // size >= 0x14 +} unk_D_86002F58_004_000_00C_028; // size >= 0x14 -typedef unk_D_86002F58_004_00C_028* (*unk_D_86002F58_004_00C_028_func)(s32, s32); +typedef unk_D_86002F58_004_000_00C_028* (*unk_D_86002F58_004_000_00C_028_func)(s32, s32); -typedef struct unk_D_86002F58_004_00C { +typedef struct unk_D_86002F58_004_000_00C { /* 0x00 */ char unk_00[0x28]; - /* 0x28 */ unk_D_86002F58_004_00C_028_func unk_28; -} unk_D_86002F58_004_00C; // size >= 0x2C + /* 0x28 */ unk_D_86002F58_004_000_00C_028_func unk_28; +} unk_D_86002F58_004_000_00C; // size >= 0x2C -typedef struct unk_D_86002F58_004_010 { - /* 0x00 */ u8 unk_00; - /* 0x01 */ char unk_01[0x23]; - /* 0x24 */ s32 unk_24; - /* 0x28 */ s32 unk_28; -} unk_D_86002F58_004_010; // size >= 0x2C - -typedef struct unk_func_8001BCF0 { +typedef struct unk_D_86002F58_004_000_010 { /* 0x00 */ u8 unk_00; - /* 0x01 */ u8 unk_01; - /* 0x04 */ unk_D_86002F58_004_00C* unk_04; - /* 0x08 */ unk_D_86002F58_004_010* unk_08; -} unk_func_8001BCF0; // size >= 0x0C - -typedef struct unk_D_86002F58_004 { + /* 0x01 */ char unk_01[0x23]; + /* 0x24 */ s32 unk_24; + /* 0x28 */ s32 unk_28; +} unk_D_86002F58_004_000_010; // size >= 0x2C + +typedef struct unk_D_86002F58_004_000_004 { + /* 0x00 */ struct unk_D_86002F58_004_000_004* unk_00; + /* 0x04 */ unk_D_86002F58_004_000_00C* unk_04; + /* 0x08 */ unk_D_86002F58_004_000_010* unk_08; +} unk_D_86002F58_004_000_004; // size >= 0x0C + +typedef struct unk_D_86002F58_004_000 { /* 0x000 */ u8 unk_000; /* 0x001 */ u8 unk_001; /* 0x002 */ u8 unk_002; - /* 0x004 */ unk_func_8001BCF0 unk_004; - /* 0x010 */ char unk010[0x8]; + /* 0x003 */ u8 unk_003; + /* 0x004 */ struct unk_D_86002F58_004_000* unk_004; + /* 0x008 */ struct unk_D_86002F58_004_000* unk_008; + /* 0x00C */ unk_D_86002F58_004_000_00C* unk_00C; + /* 0x010 */ s32 unk_010; + /* 0x014 */ s32 unk_014; /* 0x018 */ s16 unk_018; /* 0x01A */ s16 unk_01A; /* 0x01C */ u8 unk_01C; /* 0x01D */ u8 unk_01D; - /* 0x01E */ char unk01E[0x2]; - /* 0x020 */ s16 unk_020; - /* 0x024 */ f32 unk_024; - /* 0x028 */ f32 unk_028; - /* 0x02C */ f32 unk_02C; - /* 0x030 */ f32 unk_030; - /* 0x034 */ f32 unk_034; - /* 0x038 */ f32 unk_038; + /* 0x01E */ Vec3s unk_01E; + /* 0x024 */ Vec3f unk_024; + /* 0x030 */ Vec3f unk_030; /* 0x03C */ s32 unk_03C; /* 0x040 */ s16 unk_040; /* 0x044 */ s32 unk_044; /* 0x048 */ s32 unk_048; /* 0x04C */ u32 unk_04C; - /* 0x050 */ char pad50[4]; + /* 0x050 */ char pad50[2]; + /* 0x052 */ s16 unk_052; /* 0x054 */ s16 unk_054; /* 0x058 */ s32 unk_058; - /* 0x05C */ char pad5C[4]; + /* 0x05C */ s16 unk_05C; + /* 0x05E */ s16 unk_05E; /* 0x060 */ s32 unk_060; /* 0x064 */ char pad64[0x3C]; /* 0x0A0 */ s32 unk_0A0; @@ -81,9 +81,9 @@ typedef struct unk_D_86002F58_004 { /* 0x0AC */ f32 unk_0AC; /* 0x0B0 */ f32 unk_0B0; /* 0x0B4 */ char padB4[0xB4]; -} unk_D_86002F58_004; // size = 0x168 +} unk_D_86002F58_004_000; // size = 0x168 -// possibly unk_D_86002F58_004 +// possibly unk_D_86002F58_004_000 typedef struct unk_D_86002F34_00C { /* 0x00 */ char pad0[0x24]; /* 0x24 */ MtxF* unk_024; @@ -109,10 +109,17 @@ typedef struct unk_D_86002F34 { /* 0x0C */ unk_D_86002F34_00C* unk_0C; } unk_D_86002F34; // size >= 0x10 +// Are unk_D_86002F30 and unk_D_800AC840 the same? typedef struct unk_D_86002F30 { - /* 0x00 */ char unk_00[0x8]; - /* 0x08 */ unk_func_8001BCF0** unk_08; -} unk_D_86002F30; // size >= 0xC + /* 0x00 */ char unk00[0x8]; + /* 0x08 */ unk_D_86002F58_004_000_004* unk_08[4]; +} unk_D_86002F30; // size = 0x18 ?? + +typedef struct unk_D_800AC840 { + /* 0x00 */ char pad0[0xC]; + /* 0x0C */ unk_D_86002F58_004_000* unk_0C; + /* 0x10 */ char pad10[8]; +} unk_D_800AC840; // size = 0x18 struct UnkInputStruct8000D738 { s32 unk0; diff --git a/include/variables.h b/include/variables.h index fb2614d6..a0d6637c 100644 --- a/include/variables.h +++ b/include/variables.h @@ -95,9 +95,11 @@ typedef struct unk_D_800A7440 { } unk_D_800A7440; // size >= 0x8 extern unk_D_800A7440 D_800A7440; -extern struct unk_D_86002F58_004 D_800AC840; -extern struct unk_D_86002F58_004 D_800AC858; -extern struct unk_D_86002F58_004* D_8006F09C; + + +extern struct unk_D_800AC840 D_800AC840; +extern struct unk_D_800AC840 D_800AC858; +extern struct unk_D_86002F58_004_000* D_8006F09C; extern s32 D_8006F050[]; extern s16 D_8006F05C[]; @@ -136,4 +138,13 @@ extern unk_D_800AC870* D_800AC870; extern Gfx D_8006F498[]; +extern f32 D_80077DD4; +extern f32 D_80077DD8; +extern f32 D_80077DDC; +extern f32 D_80077DE0; +extern s8 D_80077DE4; +extern s32 D_80078E60; +extern s32 D_80078E64; +extern s32 D_80078E68; + #endif diff --git a/src/11BA0.c b/src/11BA0.c index 36accf59..14238b71 100644 --- a/src/11BA0.c +++ b/src/11BA0.c @@ -1,11 +1,33 @@ #include "global.h" #include "11BA0.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80010FA0.s") +void func_80010FA0(unk_D_86002F58_004_000* arg0, u8 arg1) { + if (arg0 != NULL) { + arg0->unk_000 = arg1; + arg0->unk_001 = 0x11; + arg0->unk_002 = 0; + arg0->unk_003 = 0; + arg0->unk_004 = arg0; + arg0->unk_008 = arg0; + arg0->unk_00C = NULL; + arg0->unk_010 = 0; + arg0->unk_014 = 0; + } +} #pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80010FDC.s") -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_8001103C.s") +unk_D_86002F58_004_000* func_8001103C(MainPoolState* arg0, void* arg1) { + if (arg0 != 0) { + arg1 = func_80002DCC(arg0, 0x18, 4); + } + + if (arg1 != NULL) { + func_80010FA0(arg1, 0); + } + + return arg1; +} #pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011088.s") @@ -45,7 +67,38 @@ #pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800118D0.s") -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011938.s") +unk_D_86002F58_004_000* func_80011938(s32 arg0, unk_D_86002F58_004_000* arg1, s16 arg2, Vec3f* arg3, Vec3s* arg4, + Vec3f* arg5) { + if (arg0 != 0) { + arg1 = func_80002DCC(arg0, 0x168, 4); + } + + if (arg1 != NULL) { + arg1->unk_018 = 0; + arg1->unk_01A = arg2; + arg1->unk_024 = *arg3; + arg1->unk_030 = *arg5; + arg1->unk_01E = *arg4; + arg1->unk_01D = 0xFF; + arg1->unk_01C = 0; + arg1->unk_0A6 = 0; + arg1->unk_0A0 = -0x100; + arg1->unk_03C = -0x100; + arg1->unk_040 = 0; + arg1->unk_044 = 0; + arg1->unk_048 = 0; + arg1->unk_04C = 0x10000; + arg1->unk_052 = 0; + arg1->unk_054 = 0; + arg1->unk_058 = 0; + arg1->unk_05C = 0; + arg1->unk_05E = 0; + func_80010FA0(arg1, 0x16); + arg1->unk_002 |= 0x60; + } + + return arg1; +} #pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011A3C.s") @@ -71,7 +124,25 @@ #pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80012044.s") -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80012094.s") +void func_80012094(unk_D_800AC840* arg0, unk_D_86002F58_004_000* arg1) { + unk_D_86002F58_004_000* temp_v0; + unk_D_86002F58_004_000_004* temp_v1; + + if ((arg0 != NULL) && (arg1 != NULL)) { + temp_v0 = arg0->unk_0C; + if (temp_v0 == NULL) { + arg0->unk_0C = arg1; + arg1->unk_004 = arg1; + arg1->unk_008 = arg1; + } else { + temp_v1 = temp_v0->unk_004; + arg1->unk_008 = temp_v0; + arg1->unk_004 = temp_v1; + temp_v0->unk_004 = arg1; + temp_v1->unk_08 = arg1; + } + } +} #pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800120DC.s") diff --git a/src/11BA0.h b/src/11BA0.h index ec505e97..1c693db4 100644 --- a/src/11BA0.h +++ b/src/11BA0.h @@ -2,10 +2,11 @@ #define _11BA0_H_ #include "global.h" +#include "src/memory.h" -void func_8001103C(s32, unk_D_86002F58_004*); -void func_80011938(s32, unk_D_86002F58_004*, s32, s32*, s16*, f32*); -void func_80012094(unk_D_86002F58_004*, unk_D_86002F58_004*); +unk_D_86002F58_004_000* func_8001103C(MainPoolState*, void*); +unk_D_86002F58_004_000* func_80011938(s32 arg0, unk_D_86002F58_004_000* arg1, s16 arg2, Vec3f* arg3, Vec3s* arg4, Vec3f* arg5); +void func_80012094(unk_D_800AC840*, unk_D_86002F58_004_000*); #endif // _11BA0_H_ diff --git a/src/12D80.h b/src/12D80.h index 48d63390..649177ca 100644 --- a/src/12D80.h +++ b/src/12D80.h @@ -5,7 +5,7 @@ void func_80015094(unk_D_86002F34*); void func_80015348(void); -s32 func_80015390(unk_D_86002F58_004*, s16, Vec3f*); +s32 func_80015390(unk_D_86002F58_004_000*, s16, Vec3f*); #endif // _12D80_H_ diff --git a/src/17300.h b/src/17300.h index 0600d0c8..4321e56b 100644 --- a/src/17300.h +++ b/src/17300.h @@ -3,8 +3,8 @@ #include "global.h" -void func_800173CC(unk_D_86002F58_004*); -void func_800173DC(unk_D_86002F58_004*, s16, s32, s32); -s32 func_80017514(unk_D_86002F58_004*); +void func_800173CC(unk_D_86002F58_004_000*); +void func_800173DC(unk_D_86002F58_004_000*, s16, s32, s32); +s32 func_80017514(unk_D_86002F58_004_000*); #endif // _17300_H_ diff --git a/src/18140.h b/src/18140.h index 7d5e1ceb..d8fb2a5f 100644 --- a/src/18140.h +++ b/src/18140.h @@ -3,7 +3,7 @@ #include "global.h" -void func_80017788(unk_D_86002F58_004*); -void func_80017798(unk_D_86002F58_004*, s16, s32, s32); +void func_80017788(unk_D_86002F58_004_000*); +void func_80017798(unk_D_86002F58_004_000*, s16, s32, s32); #endif // _18140_H_ diff --git a/src/19840.h b/src/19840.h index cf431a85..16d8d027 100644 --- a/src/19840.h +++ b/src/19840.h @@ -4,14 +4,14 @@ #include "global.h" #include "src/memory.h" -// seems like unk_D_86002F58_004, but unk_20 and unk_24 need to be s32 +// seems like unk_D_86002F58_004_000, but unk_20 and unk_24 need to be s32 typedef struct unk_func_8001C248 { /* 0x000 */ u8 unk_000; /* 0x001 */ u8 unk_001; /* 0x002 */ u8 unk_002; /* 0x003 */ char pad3[9]; - /* 0x00C */ unk_D_86002F58_004_00C* unk_00C; - /* 0x010 */ unk_D_86002F58_004_010* unk_010; + /* 0x00C */ unk_D_86002F58_004_000_00C* unk_00C; + /* 0x010 */ unk_D_86002F58_004_000_010* unk_010; /* 0x024 */ s32 unk_014; /* 0x018 */ s16 unk_018; /* 0x01A */ s16 unk_01A; @@ -23,13 +23,13 @@ typedef struct unk_func_8001C248 { } unk_func_8001C248; void func_8001987C(void); -void func_80019A7C(unk_D_86002F58_004_010*, s32, s32, unk_func_8001C248*); -s32 func_80019C08(unk_D_86002F58_004_010*, unk_func_8001C248*); -s32 func_80019C58(unk_D_86002F58_004_010*, unk_func_8001C248*); -s32 func_80019CA8(unk_D_86002F58_004_010*); -void func_80019CE0(unk_D_86002F58_004_010*); +void func_80019A7C(unk_D_86002F58_004_000_010*, s32, s32, unk_func_8001C248*); +s32 func_80019C08(unk_D_86002F58_004_000_010*, unk_func_8001C248*); +s32 func_80019C58(unk_D_86002F58_004_000_010*, unk_func_8001C248*); +s32 func_80019CA8(unk_D_86002F58_004_000_010*); +void func_80019CE0(unk_D_86002F58_004_000_010*); unk_D_86002F30* func_80019D18(s32); -void func_800198E4(unk_D_86002F58_004_010*, u16, s32); +void func_800198E4(unk_D_86002F58_004_000_010*, u16, s32); #endif // _19840_H_ diff --git a/src/1C720.c b/src/1C720.c index a48eaf7c..26f82a5c 100644 --- a/src/1C720.c +++ b/src/1C720.c @@ -14,20 +14,20 @@ void func_8001BB20(void) { func_8001103C(0, &D_800AC858); } -void func_8001BB58(unk_D_86002F58_004* arg0) { +void func_8001BB58(unk_D_86002F58_004_000* arg0) { func_80011938(0, arg0, 0, D_8006F050, D_8006F05C, D_8006F064); func_80012094(&D_800AC840, arg0); arg0->unk_0A6 = 0; arg0->unk_001 &= ~1; } -void func_8001BBC8(unk_D_86002F58_004* arg0) { +void func_8001BBC8(unk_D_86002F58_004_000* arg0) { func_80011938(0, arg0, 0, D_8006F050, D_8006F05C, D_8006F064); func_80012094(&D_800AC858, arg0); arg0->unk_001 &= ~1; } -void func_8001BC34(unk_D_86002F58_004* arg0, s16 arg1, s16 arg2, unk_func_8001BCF0* arg3) { +void func_8001BC34(unk_D_86002F58_004_000* arg0, s16 arg1, s16 arg2, unk_D_86002F58_004_000_004* arg3) { func_80012094(arg0, arg3); func_8000ED98(&arg0->unk_060); arg0->unk_018 = arg1; @@ -57,14 +57,14 @@ void func_8001BC34(unk_D_86002F58_004* arg0, s16 arg1, s16 arg2, unk_func_8001BC } } -void func_8001BCF0(unk_D_86002F58_004* arg0) { - arg0->unk_004.unk_08 = NULL; +void func_8001BCF0(unk_D_86002F58_004_000* arg0) { + arg0->unk_00C = NULL; arg0->unk_001 &= ~1; } -s32 func_8001BD04(unk_D_86002F58_004* arg0, s32 arg1) { - unk_D_86002F58_004_00C* tmp = arg0->unk_004.unk_08; - unk_D_86002F58_004_00C_028* temp_v0 = tmp->unk_28(0, 0); +s32 func_8001BD04(unk_D_86002F58_004_000* arg0, s32 arg1) { + unk_D_86002F58_004_000_00C* tmp = arg0->unk_00C; + unk_D_86002F58_004_000_00C_028* temp_v0 = tmp->unk_28(0, 0); if (arg1 == -1) { func_800173CC(arg0); @@ -76,9 +76,9 @@ s32 func_8001BD04(unk_D_86002F58_004* arg0, s32 arg1) { return 0; } -s32 func_8001BD9C(unk_D_86002F58_004* arg0, s32 arg1) { - unk_D_86002F58_004_00C* temp_v0 = arg0->unk_004.unk_08; - unk_D_86002F58_004_00C_028* temp_v1 = temp_v0->unk_28(0, 0); +s32 func_8001BD9C(unk_D_86002F58_004_000* arg0, s32 arg1) { + unk_D_86002F58_004_000_00C* temp_v0 = arg0->unk_00C; + unk_D_86002F58_004_000_00C_028* temp_v1 = temp_v0->unk_28(0, 0); if (arg1 == -1) { func_80017788(arg0); @@ -90,27 +90,27 @@ s32 func_8001BD9C(unk_D_86002F58_004* arg0, s32 arg1) { return 0; } -void func_8001BE34(unk_D_86002F58_004* arg0, u8 arg1, u8 arg2, u8 arg3, u8 arg4) { +void func_8001BE34(unk_D_86002F58_004_000* arg0, u8 arg1, u8 arg2, u8 arg3, u8 arg4) { func_8000E840(&arg0->unk_0A0, arg1, arg2, arg3, arg4); } -void func_8001BE78(unk_D_86002F58_004* arg0, u8 arg1) { +void func_8001BE78(unk_D_86002F58_004_000* arg0, u8 arg1) { arg0->unk_01D = arg1; } -void func_8001BE84(unk_D_86002F58_004* arg0, u8 arg1) { +void func_8001BE84(unk_D_86002F58_004_000* arg0, u8 arg1) { arg0->unk_01C = arg1; } -unk_D_86002F58_004_00C_028* func_8001BE90(unk_D_86002F58_004* arg0, s32 arg1) { - unk_D_86002F58_004_00C_028* var_v1 = NULL; +unk_D_86002F58_004_000_00C_028* func_8001BE90(unk_D_86002F58_004_000* arg0, s32 arg1) { + unk_D_86002F58_004_000_00C_028* var_v1 = NULL; if (arg0 == NULL) { arg0 = D_8006F09C; } if (arg0 != NULL) { - unk_D_86002F58_004_00C* tmp = arg0->unk_004.unk_08; + unk_D_86002F58_004_000_00C* tmp = arg0->unk_00C; var_v1 = tmp->unk_28(arg1, 0); } diff --git a/src/1C720.h b/src/1C720.h index db7a5b3c..e3975dba 100644 --- a/src/1C720.h +++ b/src/1C720.h @@ -27,21 +27,21 @@ typedef struct unk_func_8001C07C_arg0 { /* 0x02 */ s16 unk_02; /* 0x04 */ unk_func_8001BEE8* unk_04; /* 0x08 */ char unk_08[0x8]; - /* 0x10 */ unk_D_86002F58_004_010* unk_10; + /* 0x10 */ unk_D_86002F58_004_000_010* unk_10; /* 0x14 */ s32 unk_14; } unk_func_8001C07C_arg0; // size >= 0x18 void func_8001BB20(void); -void func_8001BB58(unk_D_86002F58_004* arg0); -void func_8001BBC8(unk_D_86002F58_004* arg0); -void func_8001BC34(unk_D_86002F58_004* arg0, s16 arg1, s16 arg2, unk_func_8001BCF0* arg3); -void func_8001BCF0(unk_D_86002F58_004* arg0); -s32 func_8001BD04(unk_D_86002F58_004* arg0, s32 arg1); -s32 func_8001BD9C(unk_D_86002F58_004* arg0, s32 arg1); -void func_8001BE34(unk_D_86002F58_004* arg0, u8 arg1, u8 arg2, u8 arg3, u8 arg4); -void func_8001BE78(unk_D_86002F58_004* arg0, u8 arg1); -void func_8001BE84(unk_D_86002F58_004* arg0, u8 arg1); -unk_D_86002F58_004_00C_028* func_8001BE90(unk_D_86002F58_004* arg0, s32 arg1); +void func_8001BB58(unk_D_86002F58_004_000* arg0); +void func_8001BBC8(unk_D_86002F58_004_000* arg0); +void func_8001BC34(unk_D_86002F58_004_000* arg0, s16 arg1, s16 arg2, unk_D_86002F58_004_000_004* arg3); +void func_8001BCF0(unk_D_86002F58_004_000* arg0); +s32 func_8001BD04(unk_D_86002F58_004_000* arg0, s32 arg1); +s32 func_8001BD9C(unk_D_86002F58_004_000* arg0, s32 arg1); +void func_8001BE34(unk_D_86002F58_004_000* arg0, u8 arg1, u8 arg2, u8 arg3, u8 arg4); +void func_8001BE78(unk_D_86002F58_004_000* arg0, u8 arg1); +void func_8001BE84(unk_D_86002F58_004_000* arg0, u8 arg1); +unk_D_86002F58_004_000_00C_028* func_8001BE90(unk_D_86002F58_004_000* arg0, s32 arg1); void func_8001BEE8(s32* arg0, unk_func_8001BEE8* arg1); void func_8001C014(s32* arg0, unk_func_8001C014* arg1, u16 arg2); void func_8001C07C(unk_func_8001C07C_arg0* arg0); diff --git a/src/2E110.h b/src/2E110.h index 93777f79..59c18751 100644 --- a/src/2E110.h +++ b/src/2E110.h @@ -3,7 +3,7 @@ #include "global.h" -s32 func_8002D7C0(s32, s32, s32, s32); +char* func_8002D7C0(char*, s32, s32, s32); #endif // _2E110_H_ diff --git a/src/32D10.h b/src/32D10.h index bbd6737c..2dd9d4ed 100644 --- a/src/32D10.h +++ b/src/32D10.h @@ -5,7 +5,7 @@ void func_80032110(u8, s32); void func_80032244(u8, s16); -void func_8003260C(unk_D_86002F58_004*); +void func_8003260C(unk_D_86002F58_004_000*); #endif // _32D10_H_ diff --git a/src/38BB0.c b/src/38BB0.c index a53a5c13..7979ca5e 100644 --- a/src/38BB0.c +++ b/src/38BB0.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "38BB0.h" #pragma GLOBAL_ASM("asm/us/nonmatchings/38BB0/func_80037FB0.s") diff --git a/src/38BB0.h b/src/38BB0.h new file mode 100644 index 00000000..0fef7548 --- /dev/null +++ b/src/38BB0.h @@ -0,0 +1,11 @@ +#ifndef _38BB0_H_ +#define _38BB0_H_ + +#include "global.h" + +void func_80038E98(s32, s32); +void func_800392A8(s32, s32); +void func_800393DC(s32, s32); +void func_8003986C(s32); + +#endif // _38BB0_H_ diff --git a/src/49790.h b/src/49790.h index f6c2cb1e..06181f3b 100644 --- a/src/49790.h +++ b/src/49790.h @@ -3,7 +3,7 @@ #include "global.h" -void func_80048B90(s32); +s32 func_80048B90(s32); #endif // _49790_H_ diff --git a/src/4BA90.c b/src/4BA90.c index 20a8d6a9..b81a3a10 100644 --- a/src/4BA90.c +++ b/src/4BA90.c @@ -1,11 +1,115 @@ #include "4BA90.h" +#include "src/49790.h" +#include "src/38BB0.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/4BA90/func_8004AE90.s") +void func_8004AE90(s32 arg0, u32 arg1) { + s32 var_a1; -#pragma GLOBAL_ASM("asm/us/nonmatchings/4BA90/func_8004AF24.s") + switch (arg1) { + case 0: + var_a1 = 0; + break; -#pragma GLOBAL_ASM("asm/us/nonmatchings/4BA90/func_8004AF44.s") + case 1: + var_a1 = 0x3FFF; + break; -#pragma GLOBAL_ASM("asm/us/nonmatchings/4BA90/func_8004B094.s") + case 2: + var_a1 = 0x4FFF; + break; -#pragma GLOBAL_ASM("asm/us/nonmatchings/4BA90/func_8004B154.s") + case 3: + var_a1 = 0x5FFF; + break; + + case 4: + var_a1 = 0x6FFF; + break; + + case 5: + var_a1 = 0x7FFF; + break; + + default: + var_a1 = 0x6FFF; + break; + } + + if (arg0 & 1) { + D_80078E64 = var_a1; + } + + if (arg0 & 2) { + D_80078E60 = var_a1; + } + + func_80038E98(arg0, var_a1); +} + +void func_8004AF24(s32 arg0) { + func_8003986C(arg0); +} + +void func_8004AF44(u32 arg0) { + switch (arg0) { + case 1: + func_800392A8(D_80078E68, 3); + func_80038E98(2, D_80078E60 >> 1); + func_80038E98(1, D_80078E64 / 3); + D_80078E68 = func_80048B90(0x23); + func_800393DC(D_80078E68, 0xFF); + break; + + case 0: + func_800392A8(D_80078E68, 3); + func_80038E98(2, D_80078E60); + func_80038E98(1, D_80078E64); + D_80078E68 = func_80048B90(0x24); + break; + + case 2: + func_800393DC(func_80048B90(1), 0xFF); + break; + + case 3: + func_800393DC(func_80048B90(0x21), 0xFF); + break; + + case 4: + func_800392A8(D_80078E68, 3); + func_80038E98(2, D_80078E60); + func_80038E98(1, D_80078E64); + break; + } +} + +void func_8004B094(u32 arg0) { + u32 temp_v0; + + if (arg0 == 0) { + arg0 = 1; + } + + temp_v0 = osSetIntMask(1); + + D_80077DD4 = D_80078E60; + D_80077DDC = D_80078E64; + D_80077DD8 = D_80077DD4 / arg0; + D_80077DE0 = D_80077DDC / arg0; + D_80077DE4 = 1; + + osSetIntMask(temp_v0); +} + +void func_8004B154(void) { + u32 temp_v0 = osSetIntMask(1); + + D_80077DE4 = 0; + D_80077DD4 = 0.0f; + D_80077DDC = 0.0f; + + osSetIntMask(temp_v0); + + func_80038E98(2, D_80078E60); + func_80038E98(1, D_80078E64); +} diff --git a/src/fragments/2/fragment2.h b/src/fragments/2/fragment2.h index b60fd76c..7f7f28d5 100644 --- a/src/fragments/2/fragment2.h +++ b/src/fragments/2/fragment2.h @@ -16,8 +16,8 @@ void func_8780005C(void); u32 func_878001E8(s32); void func_8780024C(s32, s32, s32, s32, s32); void func_878010C8(s32); -void func_87801290(s32*, s32*, s32, s32, s32); -s32 func_878013D4(s32, s32); +void func_87801290(s32*, s32*, char*, char*, s32); +s32 func_878013D4(unk_D_800AC870*, char*); void func_87801644(s32, s16, s16, f32); void func_87801684(s32, s32, u8*); void func_87801824(s32, s32, u8*); diff --git a/src/fragments/6/fragment6.c b/src/fragments/6/fragment6.c index 8e9f95cf..238d1190 100644 --- a/src/fragments/6/fragment6.c +++ b/src/fragments/6/fragment6.c @@ -360,51 +360,17 @@ extern s32 D_86002F48; extern s16 D_86002F4C; extern s32 D_86002F50; -typedef struct unk_D_86002F58_004_frag6 { - /* 0x000 */ u8 unk_000; - /* 0x001 */ u8 unk_001; - /* 0x002 */ u8 unk_002; - /* 0x004 */ unk_func_8001BCF0 unk_004; - /* 0x010 */ char unk010[0x8]; - /* 0x018 */ s16 unk_018; - /* 0x01A */ s16 unk_01A; - /* 0x01C */ u8 unk_01C; - /* 0x01D */ u8 unk_01D; - /* 0x01E */ char unk01E[0x2]; - /* 0x020 */ s16 unk_020; - /* 0x024 */ f32 unk_024; - /* 0x028 */ f32 unk_028; - /* 0x02C */ f32 unk_02C; - /* 0x030 */ f32 unk_030; - /* 0x034 */ f32 unk_034; - /* 0x038 */ f32 unk_038; - /* 0x03C */ s32 unk_03C; - /* 0x040 */ s16 unk_040; - /* 0x044 */ s32 unk_044; - /* 0x048 */ s32 unk_048; - /* 0x04C */ u32 unk_04C; - /* 0x050 */ char pad50[4]; - /* 0x054 */ s16 unk_054; - /* 0x058 */ s32 unk_058; - /* 0x05C */ char pad5C[4]; - /* 0x060 */ s32 unk_060; - /* 0x064 */ char pad64[0x3C]; - /* 0x0A0 */ s32 unk_0A0; - /* 0x0A4 */ char padA4[2]; - /* 0x0A6 */ s8 unk_0A6; - /* 0x0A7 */ char padA7[5]; - /* 0x0AC */ f32 unk_0AC; - /* 0x0B0 */ f32 unk_0B0; - /* 0x0B4 */ char padB4[0xB4]; +typedef struct unk_D_86002F58_004 { + /* 0x000 */ unk_D_86002F58_004_000 unk_000; /* 0x168 */ s16 unk_168; /* 0x16A */ u16 unk_16A; /* 0x16C */ s16 unk_16C; -} unk_D_86002F58_004_frag6; // size = 0x170 +} unk_D_86002F58_004; // size = 0x170 typedef struct unk_D_86002F58 { /* 0x000 */ s16 unk_000; /* 0x002 */ char pad2[2]; - /* 0x004 */ unk_D_86002F58_004_frag6 unk_004; + /* 0x004 */ unk_D_86002F58_004 unk_004; /* 0x174 */ u16 unk_174; /* 0x176 */ u16 unk_176[2]; /* 0x17A */ u16 unk_17A; @@ -420,16 +386,16 @@ typedef struct unk_D_86002F58 { } unk_D_86002F58; // size = 0x190 extern unk_D_86002F58 D_86002F58[4]; -extern unk_D_86002F58_004_frag6 D_86003598[4]; +extern unk_D_86002F58_004 D_86003598[4]; extern u32 D_86003B58; extern unk_D_86002F58* D_86003B5C; -extern unk_D_86002F58_004_frag6* D_86003B60; -extern unk_D_86002F58_004_frag6* D_86003B64; +extern unk_D_86002F58_004* D_86003B60; +extern unk_D_86002F58_004* D_86003B64; extern s16 D_86003B68; extern s16 D_86003B6A; extern s16 D_86003B70[4]; extern s16 D_86003B78; -extern s32 D_86003B7C; +extern unk_D_800AC870* D_86003B7C; extern s32 D_86003B80; #ifdef NON_MATCHING @@ -473,28 +439,28 @@ void func_86000020(void) { break; case 8: - if ((D_86003B5C->unk_004.unk_048 > 0x90000) && + if ((D_86003B5C->unk_004.unk_000.unk_048 > 0x90000) && (func_878001E8(0x64) < D_86002920[D_8780FA38].unk_08)) { D_86003B5C->unk_17A = 0x8000; } break; case 9: - if ((D_86003B5C->unk_004.unk_048 > 0xD0000) && + if ((D_86003B5C->unk_004.unk_000.unk_048 > 0xD0000) && (func_878001E8(0x64) < D_86002920[D_8780FA38].unk_08)) { D_86003B5C->unk_17A = 0x8000; } break; case 10: - if ((D_86003B5C->unk_004.unk_048 > 0xB0000) && + if ((D_86003B5C->unk_004.unk_000.unk_048 > 0xB0000) && (func_878001E8(0x64) < D_86002920[D_8780FA38].unk_08)) { D_86003B5C->unk_17A = 0x8000; } break; case 11: - if ((D_86003B5C->unk_004.unk_048 > 0xF0000) && + if ((D_86003B5C->unk_004.unk_000.unk_048 > 0xF0000) && (func_878001E8(0x64) < D_86002920[D_8780FA38].unk_08)) { D_86003B5C->unk_17A = 0x8000; } @@ -604,7 +570,7 @@ void func_860005B8(s32 arg0) { switch (arg0) { s32 sp50; s32 sp4C; - s32 temp_s0_2; + char* temp_s0_2; case 1: case 2: @@ -617,43 +583,43 @@ void func_860005B8(s32 arg0) { func_8001F3B4(0xC); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xF9, 0xF4, 0, 0xFF); - func_8001F1E8(0xA0 - (func_878013D4(D_86003B7C, func_8002D7C0(0, 0, D_87806330, 0x15)) / 2), 0x20, - func_8002D7C0(0, 0, D_87806330, 0x15)); + func_8001F1E8(0xA0 - (func_878013D4(D_86003B7C, func_8002D7C0(NULL, 0, D_87806330, 0x15)) / 2), 0x20, + func_8002D7C0(NULL, 0, D_87806330, 0x15)); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0x28, 0x34, func_8002D7C0(0, 0, D_87806330, 0x16)); - func_8001F1E8(0x28, 0x58, func_8002D7C0(0, 0, D_87806330, 0x17)); - func_8001F1E8(0x28, 0x7C, func_8002D7C0(0, 0, D_87806330, 0x18)); + func_8001F1E8(0x28, 0x34, func_8002D7C0(NULL, 0, D_87806330, 0x16)); + func_8001F1E8(0x28, 0x58, func_8002D7C0(NULL, 0, D_87806330, 0x17)); + func_8001F1E8(0x28, 0x7C, func_8002D7C0(NULL, 0, D_87806330, 0x18)); func_8001F324(0xC8, 0xC8, 0xFF, 0xFF); func_8001F36C(0x50, 0x50, 0xFF, 0xFF); - temp_s0_2 = func_8002D7C0(0, 0, D_87806330, 0x5F); + temp_s0_2 = func_8002D7C0(NULL, 0, D_87806330, 0x5F); - func_87801290(&sp50, &sp4C, func_8002D7C0(0, 0, D_87806330, 0x16), temp_s0_2, 0xC); + func_87801290(&sp50, &sp4C, func_8002D7C0(NULL, 0, D_87806330, 0x16), temp_s0_2, 0xC); if (sp50 >= 0) { func_8001F1E8(sp50 + 0x28, sp4C + 0x34, temp_s0_2); } - func_87801290(&sp50, &sp4C, func_8002D7C0(0, 0, D_87806330, 0x17), temp_s0_2, 0xC); + func_87801290(&sp50, &sp4C, func_8002D7C0(NULL, 0, D_87806330, 0x17), temp_s0_2, 0xC); if (sp50 >= 0) { func_8001F1E8(sp50 + 0x28, sp4C + 0x58, temp_s0_2); } - func_87801290(&sp50, &sp4C, func_8002D7C0(0, 0, D_87806330, 0x18), temp_s0_2, 0xC); + func_87801290(&sp50, &sp4C, func_8002D7C0(NULL, 0, D_87806330, 0x18), temp_s0_2, 0xC); if (sp50 >= 0) { func_8001F1E8(sp50 + 0x28, sp4C + 0x7C, temp_s0_2); } func_8001F324(0xC8, 0xC8, 0xFF, 0xFF); func_8001F36C(0x50, 0x50, 0xFF, 0xFF); - func_8001F1E8(0xA2, 0xB2, func_8002D7C0(0, 0, D_87806330, 0x19)); + func_8001F1E8(0xA2, 0xB2, func_8002D7C0(NULL, 0, D_87806330, 0x19)); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xFF, 0x80, 0x80, 0xFF); - func_8001F1E8(0xA2, 0xC8, func_8002D7C0(0, 0, D_87806330, 0x14)); + func_8001F1E8(0xA2, 0xC8, func_8002D7C0(NULL, 0, D_87806330, 0x14)); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0x8B, 0xB2, func_8002D7C0(0, 0, D_87806330, 0x5C)); - func_8001F1E8(0x8B, 0xC8, func_8002D7C0(0, 0, D_87806330, 0x5C)); + func_8001F1E8(0x8B, 0xB2, func_8002D7C0(NULL, 0, D_87806330, 0x5C)); + func_8001F1E8(0x8B, 0xC8, func_8002D7C0(NULL, 0, D_87806330, 0x5C)); func_8001F4C4(); break; @@ -662,8 +628,8 @@ void func_860005B8(s32 arg0) { func_8001EBE0(0x20, -2); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0x1E, 0x1E, 0xFF, 0xFF); - func_8001F1E8(0xA0 - (func_878013D4(D_86003B7C, func_8002D7C0(0, 0, D_87806330, 0x5A)) / 2), 0x64, - func_8002D7C0(0, 0, D_87806330, 0x5A)); + func_8001F1E8(0xA0 - (func_878013D4(D_86003B7C, func_8002D7C0(NULL, 0, D_87806330, 0x5A)) / 2), 0x64, + func_8002D7C0(NULL, 0, D_87806330, 0x5A)); func_8001F4C4(); break; } @@ -754,8 +720,8 @@ void func_86000C18(void) { for (i = 0; i < 4; i++) { D_86003B60 = &D_86002F58[i].unk_004; - temp_f20 = (410.0f - D_86003B60->unk_0B0) / 510.0f; - guTranslate(&sp100, D_86003B60->unk_0AC, 0.0f, 0.0f); + temp_f20 = (410.0f - D_86003B60->unk_000.unk_0B0) / 510.0f; + guTranslate(&sp100, D_86003B60->unk_000.unk_0AC, 0.0f, 0.0f); guScale(&spC0, temp_f20, temp_f20, temp_f20); guMtxCatL(&spC0, &sp100, var_s1); @@ -798,22 +764,22 @@ void func_86000E54(void) { for (i = 0; i < 4; i++) { D_86003B60 = D_86003B64 = &D_86003598[i]; - if (D_86003B60->unk_028 > 140.0f) { - D_86003B60->unk_028 -= 2.0f; + if (D_86003B60->unk_000.unk_024.y > 140.0f) { + D_86003B60->unk_000.unk_024.y -= 2.0f; } switch (D_86003B64->unk_16C) { case 0: - if (D_86003B60->unk_020 < 0x800) { - D_86003B60->unk_020 += 0x400; + if (D_86003B60->unk_000.unk_01E.y < 0x800) { + D_86003B60->unk_000.unk_01E.y += 0x400; } else { D_86003B64->unk_16C = 1; } break; case 1: - if (D_86003B60->unk_020 > 0) { - D_86003B60->unk_020 -= 0x200; + if (D_86003B60->unk_000.unk_01E.y > 0) { + D_86003B60->unk_000.unk_01E.y -= 0x200; } else { D_86003B64->unk_16C = 2; } @@ -821,7 +787,7 @@ void func_86000E54(void) { case 2: default: - D_86003B60->unk_020 = 0; + D_86003B60->unk_000.unk_01E.y = 0; break; } } @@ -837,9 +803,9 @@ s32 func_86000FD4(void) { for (i = 0; i < 4; i++) { D_86003B5C = &D_86002F58[i]; D_86003B60 = &D_86003B5C->unk_004; - func_8001BD04(D_86003B60, 0); - D_86003B60->unk_04C = 0x10000; - D_86003B60->unk_048 = (func_878001E8(0x14) << 0x10); + func_8001BD04(&D_86003B60->unk_000, 0); + D_86003B60->unk_000.unk_04C = 0x10000; + D_86003B60->unk_000.unk_048 = (func_878001E8(0x14) << 0x10); D_86003B70[i] = 0; } @@ -876,9 +842,9 @@ void func_86001204(void) { for (i = 0; i < 4; i++) { D_86003B5C = &D_86002F58[i]; D_86003B60 = &D_86003B5C->unk_004; - func_8001BD04(D_86003B60, 0); - D_86003B60->unk_04C = 0x10000; - D_86003B60->unk_048 = func_878001E8(0x14) << 0x10; + func_8001BD04(&D_86003B60->unk_000, 0); + D_86003B60->unk_000.unk_04C = 0x10000; + D_86003B60->unk_000.unk_048 = func_878001E8(0x14) << 0x10; D_86003B70[i] = 0; } @@ -925,52 +891,52 @@ void func_86001360(s16 arg0) { D_86003B5C->unk_004.unk_168 = 5; D_86003B5C->unk_004.unk_16A = arg0; - func_8001BD04(D_86003B60, 8); + func_8001BD04(&D_86003B60->unk_000, 8); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_86001464(void) { D_86003B5C->unk_004.unk_168 = 6; - func_8001BD04(D_86003B60, 9); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 9); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_860014B8(void) { D_86003B5C->unk_004.unk_168 = 7; - func_8001BD04(D_86003B60, 0xA); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 0xA); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_8600150C(void) { D_86003B5C->unk_004.unk_168 = 8; - func_8001BD04(D_86003B60, 0xB); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 0xB); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_86001560(void) { D_86003B5C->unk_004.unk_168 = 9; - func_8001BD04(D_86003B60, 0xC); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 0xC); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_860015B4(void) { D_86003B5C->unk_004.unk_168 = 0xA; - func_8001BD04(D_86003B60, 0xD); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 0xD); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_86001608(void) { D_86003B5C->unk_004.unk_168 = 0xB; - func_8001BD04(D_86003B60, 0xE); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 0xE); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_8600165C(s32 arg0) { @@ -986,25 +952,25 @@ void func_8600165C(s32 arg0) { } D_86003B5C->unk_004.unk_168 = 0xC; - func_8001BD04(D_86003B60, 5); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 5); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_860016FC(s32 arg0) { D_86003B70[arg0] = 0; D_86003B5C->unk_004.unk_168 = 0xD; - func_8001BD04(D_86003B60, 6); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 6); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_86001760(s32 arg0) { D_86003B70[arg0] = 0; D_86003B5C->unk_004.unk_168 = 0; - func_8001BD04(D_86003B60, 0); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 0); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } void func_860017C0(s32 arg0) { @@ -1017,7 +983,7 @@ void func_860017C0(s32 arg0) { case 12: if (D_86003B5C->unk_17C[1] & 0x8000) { func_86001360(2); - } else if (func_80017514(D_86003B60)) { + } else if (func_80017514(&D_86003B60->unk_000)) { func_860016FC(arg0); } break; @@ -1025,7 +991,7 @@ void func_860017C0(s32 arg0) { case 13: if (D_86003B5C->unk_17C[1] & 0x8000) { func_86001360(3); - } else if (func_80017514(D_86003B60)) { + } else if (func_80017514(&D_86003B60->unk_000)) { func_86001760(arg0); } break; @@ -1042,7 +1008,7 @@ void func_860017C0(s32 arg0) { break; case 5: - if (func_80017514(D_86003B60)) { + if (func_80017514(&D_86003B60->unk_000)) { if (D_86003B5C->unk_176[1] & 0x8000) { func_860014B8(); } else { @@ -1052,7 +1018,7 @@ void func_860017C0(s32 arg0) { break; case 7: - if (func_80017514(D_86003B60)) { + if (func_80017514(&D_86003B60->unk_000)) { if (D_86003B5C->unk_176[1] & 0x8000) { s16 tmp = D_86003B5C->unk_004.unk_16A; @@ -1074,38 +1040,38 @@ void func_860017C0(s32 arg0) { case 9: case 10: case 11: - if (func_80017514(D_86003B60)) { + if (func_80017514(&D_86003B60->unk_000)) { func_8600165C(arg0); } break; case 1: - if (func_80017514(D_86003B60)) { - func_8001BD04(D_86003B60, 7); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + if (func_80017514(&D_86003B60->unk_000)) { + func_8001BD04(&D_86003B60->unk_000, 7); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; } break; default: - if (func_80017514(D_86003B60)) { - func_8001BD04(D_86003B60, 0); - D_86003B60->unk_048 = 0; - D_86003B60->unk_04C = 0x10000; + if (func_80017514(&D_86003B60->unk_000)) { + func_8001BD04(&D_86003B60->unk_000, 0); + D_86003B60->unk_000.unk_048 = 0; + D_86003B60->unk_000.unk_04C = 0x10000; D_86003B70[arg0] = 0; } break; } - if (((D_86003B5C->unk_004.unk_168 == 9) && ((D_86003B60->unk_048 >> 0x10) == 2)) || - ((D_86003B5C->unk_004.unk_168 == 10) && ((D_86003B60->unk_048 >> 0x10) == 2)) || - ((D_86003B5C->unk_004.unk_168 == 11) && ((D_86003B60->unk_048 >> 0x10) == 2))) { + if (((D_86003B5C->unk_004.unk_168 == 9) && ((D_86003B60->unk_000.unk_048 >> 0x10) == 2)) || + ((D_86003B5C->unk_004.unk_168 == 10) && ((D_86003B60->unk_000.unk_048 >> 0x10) == 2)) || + ((D_86003B5C->unk_004.unk_168 == 11) && ((D_86003B60->unk_000.unk_048 >> 0x10) == 2))) { if (D_86003B70[arg0] == 0) { D_86003B64->unk_16A++; D_86003B70[arg0] = 1; - func_8001BD04(D_86003B64, 0); - D_86003B64->unk_04C = 0x10000; - D_86003B64->unk_048 = 0; + func_8001BD04(&D_86003B64->unk_000, 0); + D_86003B64->unk_000.unk_04C = 0x10000; + D_86003B64->unk_000.unk_048 = 0; func_87A010D4(0x20008, arg0, 4); } } @@ -1117,7 +1083,7 @@ void func_860017C0(s32 arg0) { if (D_86003B5C->unk_188 > 0) { D_86003B5C->unk_188--; if (D_86003B5C->unk_188 == 0) { - func_8001BE34(&D_86003B5C->unk_004, 0xFF, 0xFF, 0xFF, 0); + func_8001BE34(&D_86003B5C->unk_004.unk_000, 0xFF, 0xFF, 0xFF, 0); } } } @@ -1136,8 +1102,8 @@ void func_86001C90(void) { D_86003B5C = &D_86002F58[i]; D_86003B60 = &D_86003B5C->unk_004; D_86003B60->unk_16C = 0; - func_8001BD04(D_86003B60, 0); - D_86003B60->unk_04C = 0x10000; + func_8001BD04(&D_86003B60->unk_000, 0); + D_86003B60->unk_000.unk_04C = 0x10000; D_86003B70[i] = 0; D_86003B5C->unk_18C = 1; } @@ -1275,14 +1241,14 @@ void func_86001F64(void) { D_86003B60 = &D_86003B5C->unk_004; if ((D_86003B80 == D_86003598[i].unk_16A) && (D_86003B80 > 0)) { D_86003B5C->unk_004.unk_168 = 1; - func_8001BD04(D_86003B60, 7); - D_86003B60->unk_048 = 0; + func_8001BD04(&D_86003B60->unk_000, 7); + D_86003B60->unk_000.unk_048 = 0; } else { D_86003B5C->unk_004.unk_168 = 2; - func_8001BD04(D_86003B60, 0); - D_86003B60->unk_048 = func_878001E8(5) << 0x10; + func_8001BD04(&D_86003B60->unk_000, 0); + D_86003B60->unk_000.unk_048 = func_878001E8(5) << 0x10; } - D_86003B60->unk_04C = 0x10000; + D_86003B60->unk_000.unk_04C = 0x10000; } var_s3_4 = 30; @@ -1410,16 +1376,16 @@ void func_86002440(void) { D_86003B5C = &D_86002F58[i]; D_86003B60 = &D_86003B5C->unk_004; - func_8001BB58(D_86003B60); - func_8001BC34(D_86003B60, 0, 0xAD, D_86002F30->unk_08); + func_8001BB58(&D_86003B60->unk_000); + func_8001BC34(&D_86003B60->unk_000, 0, 0xAD, D_86002F30->unk_08[0]->unk_00); - D_86003B60->unk_024 = (i - 1.5f) * D_86002A94; + D_86003B60->unk_000.unk_024.x = (i - 1.5f) * D_86002A94; - D_86003B60->unk_028 = 0.0f; - D_86003B60->unk_02C = 0.0f; - D_86003B60->unk_030 = 0.8f; - D_86003B60->unk_034 = 0.8f; - D_86003B60->unk_038 = 0.8f; + D_86003B60->unk_000.unk_024.y = 0.0f; + D_86003B60->unk_000.unk_024.z = 0.0f; + D_86003B60->unk_000.unk_030.x = 0.8f; + D_86003B60->unk_000.unk_030.y = 0.8f; + D_86003B60->unk_000.unk_030.z = 0.8f; D_86003B5C->unk_182 = 0; D_86003B5C->unk_184 = 0; @@ -1433,10 +1399,10 @@ void func_86002440(void) { D_86003B5C->unk_000 = D_8780FA38 + 1; } - func_8001BD04(D_86003B60, 0); + func_8001BD04(&D_86003B60->unk_000, 0); - D_86003B60->unk_048 = func_878001E8(5) << 0x10; - D_86003B60->unk_020 = -0x2800; + D_86003B60->unk_000.unk_048 = func_878001E8(5) << 0x10; + D_86003B60->unk_000.unk_01E.y = -0x2800; } D_86002F30 = (unk_D_86002F30*)func_80019D18(0xAE); @@ -1445,25 +1411,25 @@ void func_86002440(void) { D_86003B60 = &D_86003598[i]; D_86003B64 = D_86003B60; - func_8001BB58(D_86003B64); - func_8001BC34(D_86003B60, 0, 0xAE, D_86002F30->unk_08); - D_86003B60->unk_024 = (i - 1.5f) * D_86002A94; - D_86003B60->unk_02C = 0.0f; - D_86003B60->unk_028 = 200.0f; - D_86003B60->unk_020 = -0x8000; - D_86003B60->unk_030 = 1.4f; - D_86003B60->unk_034 = 1.4f; - D_86003B60->unk_038 = 1.4f; + func_8001BB58(&D_86003B64->unk_000); + func_8001BC34(&D_86003B60->unk_000, 0, 0xAE, D_86002F30->unk_08[0]->unk_00); + D_86003B60->unk_000.unk_024.x = (i - 1.5f) * D_86002A94; + D_86003B60->unk_000.unk_024.z = 0.0f; + D_86003B60->unk_000.unk_024.y = 200.0f; + D_86003B60->unk_000.unk_01E.y = -0x8000; + D_86003B60->unk_000.unk_030.x = 1.4f; + D_86003B60->unk_000.unk_030.y = 1.4f; + D_86003B60->unk_000.unk_030.z = 1.4f; D_86003B64->unk_168 = 0; D_86003B64->unk_16A = 0; D_86003B64->unk_16C = 0; func_80032110(i, 0); - D_86003B64->unk_0A6 = i; - func_8001BD04(D_86003B60, 0); - func_800173CC(D_86003B60); + D_86003B64->unk_000.unk_0A6 = i; + func_8001BD04(&D_86003B60->unk_000, 0); + func_800173CC(&D_86003B60->unk_000); } - D_86002F50 = func_80004258(0, (u32)&D_124570, (u32)fragment7_ROM_START, 0); + D_86002F50 = func_80004258(0, (void*)&D_124570, (void*)fragment7_ROM_START, 0); func_86000478(); func_87802528(); } @@ -1479,10 +1445,10 @@ void func_86002778(UNUSED s32 arg0, UNUSED s32 arg1) { func_80005E40(0x20000, 0); sp24 = (unk_func_80007444*)func_80007444(0, 1, 3, 1, 2, 1); D_86003B7C = func_8001E94C(0x36, 0); - func_80004258(((u32)&D_1000000 & 0x0F000000) >> 0x18, (u32)_4BD6B0_ROM_START, (u32)_4BE810_ROM_START, 0); - func_80004454((((u32)fragment31_VRAM & 0x0FF00000) >> 0x14) - 0x10, (u32)fragment31_ROM_START, - (u32)fragment32_ROM_START); - func_80004454((((u32)&D_8D000000 & 0x0FF00000) >> 0x14) - 0x10, (u32)_5C7A70_ROM_START, (u32)_5C7AD0_ROM_START); + func_80004258(((u32)&D_1000000 & 0x0F000000) >> 0x18, (void*)_4BD6B0_ROM_START, (void*)_4BE810_ROM_START, 0); + func_80004454((((u32)fragment31_VRAM & 0x0FF00000) >> 0x14) - 0x10, (void*)fragment31_ROM_START, + (void*)fragment32_ROM_START); + func_80004454((((u32)&D_8D000000 & 0x0FF00000) >> 0x14) - 0x10, (void*)_5C7A70_ROM_START, (void*)_5C7AD0_ROM_START); func_86002440(); func_878029C0(); func_80007678(sp24); diff --git a/src/fragments/7/fragment7.c b/src/fragments/7/fragment7.c index a3027d95..f9ef13c1 100644 --- a/src/fragments/7/fragment7.c +++ b/src/fragments/7/fragment7.c @@ -264,12 +264,7 @@ u32 D_861052C8[] = { extern unk_D_86002F30* D_86105480; extern unk_D_86002F34* D_86105484; extern unk_D_86002F34_00C* D_86105488; - -typedef struct unk_D_8610548C { - /* 0x00 */ char unk00[0x8]; - /* 0x08 */ unk_func_8001BCF0* unk_08[1]; -} unk_D_8610548C; // size >= 0x4 -extern unk_D_8610548C* D_8610548C; +extern unk_D_86002F30* D_8610548C; extern s16 D_86105490; extern s16 D_86105492; extern s16 D_86105494; @@ -283,7 +278,7 @@ extern s16 D_861054A6; extern s16 D_861054A8; extern s32 D_861054AC; extern s32 D_861054B0; -extern s32 D_861054B4; +extern unk_D_800AC870* D_861054B4; extern s16 D_861054B8; extern s16 D_861054BA; extern s32 D_861054BC; @@ -292,7 +287,7 @@ typedef struct unk_D_861054C0 { /* 0x000 */ s16 unk_000; /* 0x002 */ s16 unk_002; /* 0x004 */ char pad4[4]; - /* 0x008 */ unk_D_86002F58_004 unk_008; + /* 0x008 */ unk_D_86002F58_004_000 unk_008; /* 0x170 */ s16 unk_170; /* 0x172 */ u16 unk_172; /* 0x174 */ s16 unk_174[0xC]; @@ -314,23 +309,23 @@ typedef struct unk_D_861054C0 { extern unk_D_861054C0 D_861054C0[4]; extern s32 D_86105BC0; extern unk_D_861054C0* D_86105BC4; -extern unk_D_86002F58_004* D_86105BC8; +extern unk_D_86002F58_004_000* D_86105BC8; extern s16 D_86105BCC; extern s16 D_86105BCE; -extern unk_D_86002F58_004 D_86105BD0; -extern unk_D_86002F58_004 D_86105D38; +extern unk_D_86002F58_004_000 D_86105BD0; +extern unk_D_86002F58_004_000 D_86105D38; typedef struct unk_D_86105EA0 { /* 0x000 */ char unk000[0x4]; - /* 0x004 */ unk_D_86002F58_004 unk_004; + /* 0x004 */ unk_D_86002F58_004_000 unk_004; } unk_D_86105EA0; // size = 0x16C extern unk_D_86105EA0 D_86105EA0[4]; typedef struct unk_D_86106450 { /* 0x000 */ s16 unk_000; /* 0x002 */ s16 unk_002; - /* 0x004 */ unk_D_86002F58_004 unk_004; - /* 0x16C */ unk_func_8001BCF0* unk_16C; + /* 0x004 */ unk_D_86002F58_004_000 unk_004; + /* 0x16C */ unk_D_86002F58_004_000_004* unk_16C; } unk_D_86106450; // size = 0x170 extern unk_D_86106450 D_86106450[12]; extern s16 D_86107590; @@ -601,54 +596,54 @@ void func_86100C30(s32 arg0) { func_8001F3B4(0xC); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xF9, 0xF4, 0, 0xFF); - func_8001F1E8(0xA0 - (func_878013D4(D_861054B4, func_8002D7C0(0, 0, D_87806330, 0x1A)) / 2), 0x20, - func_8002D7C0(0, 0, D_87806330, 0x1A)); + func_8001F1E8(0xA0 - (func_878013D4(D_861054B4, func_8002D7C0(NULL, 0, D_87806330, 0x1A)) / 2), 0x20, + func_8002D7C0(NULL, 0, D_87806330, 0x1A)); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0x28, 0x34, func_8002D7C0(0, 0, D_87806330, 0x1B)); - func_8001F1E8(0x28, 0x70, func_8002D7C0(0, 0, D_87806330, 0x1C)); + func_8001F1E8(0x28, 0x34, func_8002D7C0(NULL, 0, D_87806330, 0x1B)); + func_8001F1E8(0x28, 0x70, func_8002D7C0(NULL, 0, D_87806330, 0x1C)); func_8001F324(0xE6, 0xD2, 0xFF, 0xFF); func_8001F36C(0x82, 0x50, 0xD2, 0xFF); - func_87801290(&sp48, &sp44, func_8002D7C0(0, 0, D_87806330, 0x1B), func_8002D7C0(0, 0, D_87806330, 0x61), - 0xC); + func_87801290(&sp48, &sp44, func_8002D7C0(NULL, 0, D_87806330, 0x1B), + func_8002D7C0(NULL, 0, D_87806330, 0x61), 0xC); if (sp48 >= 0) { - func_8001F1E8(sp48 + 0x28, sp44 + 0x34, func_8002D7C0(0, 0, D_87806330, 0x61)); + func_8001F1E8(sp48 + 0x28, sp44 + 0x34, func_8002D7C0(NULL, 0, D_87806330, 0x61)); } func_8001F324(0xE6, 0xD2, 0xFF, 0xFF); func_8001F36C(0x82, 0x50, 0xD2, 0xFF); - func_8001F1E8(0x8C, 0xB0, func_8002D7C0(0, 0, D_87806330, 0x1D)); + func_8001F1E8(0x8C, 0xB0, func_8002D7C0(NULL, 0, D_87806330, 0x1D)); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xFF, 0x80, 0x80, 0xFF); - func_8001F1E8(0xA2, 0xC8, func_8002D7C0(0, 0, D_87806330, 0x14)); + func_8001F1E8(0xA2, 0xC8, func_8002D7C0(NULL, 0, D_87806330, 0x14)); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0x75, 0xB0, func_8002D7C0(0, 0, D_87806330, 0x5C)); - func_8001F1E8(0x8B, 0xC8, func_8002D7C0(0, 0, D_87806330, 0x5C)); + func_8001F1E8(0x75, 0xB0, func_8002D7C0(NULL, 0, D_87806330, 0x5C)); + func_8001F1E8(0x8B, 0xC8, func_8002D7C0(NULL, 0, D_87806330, 0x5C)); func_8001F4C4(); break; case 3: func_8001EBE0(4, 0); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(0, 0, D_87806330, 0x1E)) / 2), 0x40, - func_8002D7C0(0, 0, D_87806330, 0x1E)); + func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(NULL, 0, D_87806330, 0x1E)) / 2), 0x40, + func_8002D7C0(NULL, 0, D_87806330, 0x1E)); break; case 5: func_8001EBE0(4, 0); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(0, 0, D_87806330, 0x1F)) / 2), 0x40, - func_8002D7C0(0, 0, D_87806330, 0x1F)); + func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(NULL, 0, D_87806330, 0x1F)) / 2), 0x40, + func_8002D7C0(NULL, 0, D_87806330, 0x1F)); break; case 8: if (D_8610549C < 0x3C) { func_8001EBE0(4, 0); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(0, 0, D_87806330, 0x20)) / 2), 0x40, - func_8002D7C0(0, 0, D_87806330, 0x20)); + func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(NULL, 0, D_87806330, 0x20)) / 2), 0x40, + func_8002D7C0(NULL, 0, D_87806330, 0x20)); } break; @@ -657,8 +652,8 @@ void func_86100C30(s32 arg0) { if (D_8610549C < 0x3C) { func_8001EBE0(4, 0); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(0, 0, D_87806330, 0x21)) / 2), 0x40, - func_8002D7C0(0, 0, D_87806330, 0x21)); + func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(NULL, 0, D_87806330, 0x21)) / 2), 0x40, + func_8002D7C0(NULL, 0, D_87806330, 0x21)); } break; @@ -666,8 +661,8 @@ void func_86100C30(s32 arg0) { if ((D_8610549C >= 0x10) && (D_8610549C < 0x3C)) { func_8001EBE0(4, 0); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(0, 0, D_87806330, 0x22)) / 2), 0x40, - func_8002D7C0(0, 0, D_87806330, 0x22)); + func_8001F1E8(0xA4 - (func_878013D4(D_861054B4, func_8002D7C0(NULL, 0, D_87806330, 0x22)) / 2), 0x40, + func_8002D7C0(NULL, 0, D_87806330, 0x22)); } break; } @@ -926,7 +921,7 @@ void func_86101DEC(void) { void func_86101E70(void) { s32 i; - unk_D_86002F58_004* temp_s0; + unk_D_86002F58_004_000* temp_s0; D_86105498 = 4; D_8610549C = 0; @@ -966,7 +961,7 @@ s32 func_86101F88(void) { s32 func_86101FD0(void) { s32 i; - unk_D_86002F58_004* temp_s0; + unk_D_86002F58_004_000* temp_s0; for (i = 0; i < 4; i++) { temp_s0 = &D_861054C0[i].unk_008; @@ -1439,7 +1434,7 @@ void func_86103450(void) { s32 func_86103474(void) { s32 var_v1 = 0; - unk_D_86002F58_004* temp_s0; + unk_D_86002F58_004_000* temp_s0; s32 i; for (i = 0; i < 4; i++) { @@ -1773,14 +1768,14 @@ void func_86103E9C(void) { D_86105BC8 = &D_86105BC4->unk_008; func_8001BB58(D_86105BC8); - func_8001BC34(D_86105BC8, 0, 0xB1, *D_86105480->unk_08); + func_8001BC34(D_86105BC8, 0, 0xB1, D_86105480->unk_08[0]->unk_00); - D_86105BC8->unk_024 = (i - 1.5f) * 40.0f; - D_86105BC8->unk_028 = 0.0f; - D_86105BC8->unk_02C = 0.0f; - D_86105BC8->unk_030 = 1.0f; - D_86105BC8->unk_034 = 1.0f; - D_86105BC8->unk_038 = 1.0f; + D_86105BC8->unk_024.x = (i - 1.5f) * 40.0f; + D_86105BC8->unk_024.y = 0.0f; + D_86105BC8->unk_024.z = 0.0f; + D_86105BC8->unk_030.x = 1.0f; + D_86105BC8->unk_030.y = 1.0f; + D_86105BC8->unk_030.z = 1.0f; func_8001BD04(D_86105BC8, 0); func_80017788(D_86105BC8); @@ -1794,19 +1789,19 @@ void func_86103E9C(void) { D_86105480 = func_80019D18(0xB2); D_86105BC8 = &D_86105BD0; func_8001BB58(D_86105BC8); - func_8001BC34(D_86105BC8, 0, 0xB2, *D_86105480->unk_08); - D_86105BC8->unk_024 = 0.0f; - D_86105BC8->unk_028 = 10.0f; - D_86105BC8->unk_02C = -145.0f; - D_86105BC8->unk_030 = 1.0f; - D_86105BC8->unk_034 = 1.0f; - D_86105BC8->unk_038 = 1.0f; + func_8001BC34(D_86105BC8, 0, 0xB2, D_86105480->unk_08[0]->unk_00); + D_86105BC8->unk_024.x = 0.0f; + D_86105BC8->unk_024.y = 10.0f; + D_86105BC8->unk_024.z = -145.0f; + D_86105BC8->unk_030.x = 1.0f; + D_86105BC8->unk_030.y = 1.0f; + D_86105BC8->unk_030.z = 1.0f; func_8001BD04(D_86105BC8, 0); func_80017788(D_86105BC8); D_86105480 = func_80019D18(0xB3); D_86105BC8 = &D_86105D38; func_8001BB58(D_86105BC8); - func_8001BC34(D_86105BC8, 0, 0xB3, *D_86105480->unk_08); + func_8001BC34(D_86105BC8, 0, 0xB3, D_86105480->unk_08[0]->unk_00); D_8610548C = func_80019D18(0xB4); for (i = 0; i < 12; i++) { @@ -1820,10 +1815,10 @@ void func_86103E9C(void) { for (i = 0; i < 4; i++) { D_86105BC8 = &D_86105EA0[i].unk_004; func_8001BB58(D_86105BC8); - func_8001BC34(D_86105BC8, 0, 0xB5, *D_86105480->unk_08); - D_86105BC8->unk_024 = (i - 1.5f) * 40.0f; - D_86105BC8->unk_028 = 0.0f; - D_86105BC8->unk_02C = 0.0f; + func_8001BC34(D_86105BC8, 0, 0xB5, D_86105480->unk_08[0]->unk_00); + D_86105BC8->unk_024.x = (i - 1.5f) * 40.0f; + D_86105BC8->unk_024.y = 0.0f; + D_86105BC8->unk_024.z = 0.0f; func_8001BD04(D_86105BC8, 0); func_80017788(D_86105BC8); D_86105BC8->unk_048 = 0x320000; @@ -1844,9 +1839,9 @@ void func_8610426C(void) { for (i = 0; i < 12; i++) { if (func_80015390(&D_86105D38, i + 1, &sp48) != 0) { D_86105BC8 = &D_86106450[i].unk_004; - D_86105BC8->unk_024 = sp48.x / 10.0f; - D_86105BC8->unk_028 = sp48.y / 10.0f; - D_86105BC8->unk_02C = sp48.z / 10.0f; + D_86105BC8->unk_024.x = sp48.x / 10.0f; + D_86105BC8->unk_024.y = sp48.y / 10.0f; + D_86105BC8->unk_024.z = sp48.z / 10.0f; } } diff --git a/src/fragments/8/fragment8.c b/src/fragments/8/fragment8.c index 1bd8b735..d9fab33d 100644 --- a/src/fragments/8/fragment8.c +++ b/src/fragments/8/fragment8.c @@ -36,15 +36,15 @@ extern s16 D_86203E4C; extern unk_D_86203E50 D_86203E50[4]; extern unk_D_86203E50* D_86204590; -extern unk_D_86002F58_004* D_86204594; -extern unk_D_86002F58_004 D_86204598; +extern unk_D_86002F58_004_000* D_86204594; +extern unk_D_86002F58_004_000 D_86204598; extern s16 D_86204700; extern u32 D_86204704; extern s16 D_86204708; extern s16 D_8620470A; extern s16 D_8620470E; extern f32 D_86204710; -extern s32 D_86204714; +extern unk_D_800AC870* D_86204714; extern s16 D_86204718; extern s16 D_8620471A; extern s16 D_8620471C; @@ -130,8 +130,8 @@ static u32 D_86203D0C[] = { }; // Unused rodata strings -const char const D_86203DC0[] = " %dP"; -const char const D_86203DC8[] = "%s"; +const char D_86203DC0[] = " %dP"; +const char D_86203DC8[] = "%s"; // BSS, not yet supported extern unk_D_86002F30* D_86203E30; @@ -350,10 +350,10 @@ void func_86200940(s32 arg0) { UNUSED u8 sp4C[3] = { 0, 0, 150 }; s32 sp48; s32 sp44; - s32 sp40; + char* sp40; s32 sp3C; s32 sp38; - s32 sp34; + char* sp34; func_8001F3F4(); func_8001F444(); @@ -378,18 +378,18 @@ void func_86200940(s32 arg0) { func_8001F3B4(0xC); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xF9, 0xF4, 0, 0xFF); - func_8001F1E8(0xA0 - (func_878013D4(D_86204714, func_8002D7C0(0, 0, D_87806330, 0x23)) / 2), 0x20, - func_8002D7C0(0, 0, D_87806330, 0x23)); + func_8001F1E8(0xA0 - (func_878013D4(D_86204714, func_8002D7C0(NULL, 0, D_87806330, 0x23)) / 2), 0x20, + func_8002D7C0(NULL, 0, D_87806330, 0x23)); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0x28, 0x34, func_8002D7C0(0, 0, D_87806330, 0x24)); - func_8001F1E8(0x28, 0x4C, func_8002D7C0(0, 0, D_87806330, 0x25)); - func_8001F1E8(0x28, 0x70, func_8002D7C0(0, 0, D_87806330, 0x26)); + func_8001F1E8(0x28, 0x34, func_8002D7C0(NULL, 0, D_87806330, 0x24)); + func_8001F1E8(0x28, 0x4C, func_8002D7C0(NULL, 0, D_87806330, 0x25)); + func_8001F1E8(0x28, 0x70, func_8002D7C0(NULL, 0, D_87806330, 0x26)); func_8001F324(0xC8, 0xC8, 0xFF, 0xFF); func_8001F36C(0x50, 0x50, 0xFF, 0xFF); - sp40 = func_8002D7C0(0, 0, D_87806330, 0x5F); - func_87801290(&sp48, &sp44, func_8002D7C0(0, 0, D_87806330, 0x24), sp40, 0xC); + sp40 = func_8002D7C0(NULL, 0, D_87806330, 0x5F); + func_87801290(&sp48, &sp44, func_8002D7C0(NULL, 0, D_87806330, 0x24), sp40, 0xC); if (sp48 >= 0) { func_8001F1E8(sp48 + 0x28, sp44 + 0x34, sp40); } @@ -397,26 +397,26 @@ void func_86200940(s32 arg0) { func_8001F324(0xE6, 0xD2, 0xFF, 0xFF); func_8001F36C(0x82, 0x50, 0xD2, 0xFF); - sp34 = func_8002D7C0(0, 0, D_87806330, 0x61); - func_87801290(&sp3C, &sp38, func_8002D7C0(0, 0, D_87806330, 0x25), sp34, 0xC); + sp34 = func_8002D7C0(NULL, 0, D_87806330, 0x61); + func_87801290(&sp3C, &sp38, func_8002D7C0(NULL, 0, D_87806330, 0x25), sp34, 0xC); if (sp3C >= 0) { func_8001F1E8(sp3C + 0x28, sp38 + 0x4C, sp34); } func_8001F324(0xE6, 0xD2, 0xFF, 0xFF); func_8001F36C(0x82, 0x50, 0xD2, 0xFF); - func_8001F1E8(0x8C, 0xB0, func_8002D7C0(0, 0, D_87806330, 0x19)); + func_8001F1E8(0x8C, 0xB0, func_8002D7C0(NULL, 0, D_87806330, 0x19)); func_8001F324(0xC8, 0xC8, 0xFF, 0xFF); func_8001F36C(0x50, 0x50, 0xFF, 0xFF); - func_8001F1E8(0xFC, 0xB0, func_8002D7C0(0, 0, D_87806330, 0x27)); + func_8001F1E8(0xFC, 0xB0, func_8002D7C0(NULL, 0, D_87806330, 0x27)); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xFF, 0x80, 0x80, 0xFF); - func_8001F1E8(0xA2, 0xC8, func_8002D7C0(0, 0, D_87806330, 0x14)); + func_8001F1E8(0xA2, 0xC8, func_8002D7C0(NULL, 0, D_87806330, 0x14)); func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); func_8001F36C(0xFF, 0xFF, 0xFF, 0xFF); - func_8001F1E8(0x75, 0xB0, func_8002D7C0(0, 0, D_87806330, 0x5C)); - func_8001F1E8(0xE5, 0xB0, func_8002D7C0(0, 0, D_87806330, 0x5C)); - func_8001F1E8(0x8B, 0xC8, func_8002D7C0(0, 0, D_87806330, 0x5C)); + func_8001F1E8(0x75, 0xB0, func_8002D7C0(NULL, 0, D_87806330, 0x5C)); + func_8001F1E8(0xE5, 0xB0, func_8002D7C0(NULL, 0, D_87806330, 0x5C)); + func_8001F1E8(0x8B, 0xC8, func_8002D7C0(NULL, 0, D_87806330, 0x5C)); func_8001F4C4(); break; } @@ -577,7 +577,7 @@ void func_862013C0(void) { void func_862015A0(unk_D_86203E50* arg0) { f32 temp_fv0 = arg0->unk_178 - 30.0f; - arg0->unk_008.unk_02C = temp_fv0; + arg0->unk_008.unk_024.z = temp_fv0; arg0->unk_194 = temp_fv0 / 3.0f; } @@ -605,7 +605,7 @@ s32 func_86201640(unk_D_86203E50* arg0, unk_D_86204720* arg1) { } temp_fv0 = 30.0f - (arg1->unk_004.unk_048 / 111411.2f); - temp_fv1 = arg0->unk_008.unk_02C / 3.0f; + temp_fv1 = arg0->unk_008.unk_024.z / 3.0f; arg0->unk_1A8 = temp_fv1; arg0->unk_1A4 = temp_fv0; @@ -633,7 +633,7 @@ void func_86201770(unk_D_86203E50* arg0) { } void func_86201814(unk_D_86203E50* arg0, s32 arg1) { - unk_D_86002F58_004* temp_s0 = &arg0->unk_008; + unk_D_86002F58_004_000* temp_s0 = &arg0->unk_008; switch (arg1) { case 3: @@ -670,7 +670,7 @@ void func_86201900(unk_D_86203E50* arg0) { f32 sp64; f32 temp_fs1; u32 temp_v0; - unk_D_86002F58_004* temp_s1; + unk_D_86002F58_004_000* temp_s1; s32 arg0_unk000 = arg0->unk_000; for (i = 0; i < 10; i++) { @@ -948,7 +948,7 @@ void func_862023F8(void) { s32 j; s16 temp_s1_2; s16 var_s3; - unk_D_86002F58_004* var_s2; + unk_D_86002F58_004_000* var_s2; unk_D_86203E50* temp_s1; s16 var_v0_2; s16 sp8C; @@ -1250,7 +1250,7 @@ void func_862030D0(void) { s32 i; s32 j; MemoryBlock* temp_v0 = func_80002D10(main_pool_get_available(), 0); - unk_D_86002F58_004* temp_s0; + unk_D_86002F58_004_000* temp_s0; D_86203E38 = func_80018B70(temp_v0, &D_86203D0C); func_80002D60(temp_v0); @@ -1260,8 +1260,8 @@ void func_862030D0(void) { D_8620471A = 0; D_86203E30 = func_80019D18(0xB8); func_8001BB58(&D_86204598); - func_8001BC34(&D_86204598, 0, 0xB8, *D_86203E30->unk_08); - D_86204598.unk_028 = -26.0f; + func_8001BC34(&D_86204598, 0, 0xB8, D_86203E30->unk_08[0]->unk_00); + D_86204598.unk_024.y = -26.0f; D_86203E30 = func_80019D18(0xAF); for (i = 0; i < 4; i++) { @@ -1271,12 +1271,12 @@ void func_862030D0(void) { func_86200020(D_86204590); func_8001BB58(temp_s0); - func_8001BC34(temp_s0, 0, 0xAF, *D_86203E30->unk_08); - temp_s0->unk_024 = -(i - 1.5f) * 40.0f; - temp_s0->unk_028 = 0.0f; - temp_s0->unk_030 = 1.0f; - temp_s0->unk_034 = 1.0f; - temp_s0->unk_038 = 1.0f; + func_8001BC34(temp_s0, 0, 0xAF, D_86203E30->unk_08[0]->unk_00); + temp_s0->unk_024.x = -(i - 1.5f) * 40.0f; + temp_s0->unk_024.y = 0.0f; + temp_s0->unk_030.x = 1.0f; + temp_s0->unk_030.y = 1.0f; + temp_s0->unk_030.z = 1.0f; func_8001BD04(temp_s0, 0); func_80017788(temp_s0); func_862015C8(D_86204590); @@ -1294,8 +1294,8 @@ void func_862030D0(void) { D_86208280->unk_000 = 0; D_86208280->unk_002 = 0; - temp_s0->unk_024 = -(i - 1.5f) * 40.0f; - temp_s0->unk_028 = -25.0f; + temp_s0->unk_024.x = -(i - 1.5f) * 40.0f; + temp_s0->unk_024.y = -25.0f; temp_s0->unk_048 = 0x730000; temp_s0->unk_04C = 0; } @@ -1308,7 +1308,7 @@ void func_862030D0(void) { void func_86203380(void) { s32 i; s32 j; - unk_D_86002F58_004* temp_s0; + unk_D_86002F58_004_000* temp_s0; D_86208298 = 0; D_8620470A = 0; @@ -1329,11 +1329,11 @@ void func_86203380(void) { D_86204590->unk_1B4 = 0; D_86204590->unk_170 = 0; func_862015C8(D_86204590); - temp_s0->unk_024 = -(i - 1.5f) * 40.0f; - temp_s0->unk_028 = 0.0f; - temp_s0->unk_030 = 1.0f; - temp_s0->unk_034 = 1.0f; - temp_s0->unk_038 = 1.0f; + temp_s0->unk_024.x = -(i - 1.5f) * 40.0f; + temp_s0->unk_024.y = 0.0f; + temp_s0->unk_030.x = 1.0f; + temp_s0->unk_030.y = 1.0f; + temp_s0->unk_030.z = 1.0f; temp_s0->unk_04C = 0x20000; } @@ -1346,8 +1346,8 @@ void func_86203380(void) { D_86208280->unk_002 = 0; D_86208280->unk_178 = 0; D_86208280->unk_170 = 0; - temp_s0->unk_024 = -(i - 1.5f) * 40.0f; - temp_s0->unk_028 = -25.0f; + temp_s0->unk_024.x = -(i - 1.5f) * 40.0f; + temp_s0->unk_024.y = -25.0f; temp_s0->unk_048 = 0x730000; temp_s0->unk_04C = 0; } diff --git a/src/fragments/8/fragment8.h b/src/fragments/8/fragment8.h index 59eba4c2..d49803b7 100644 --- a/src/fragments/8/fragment8.h +++ b/src/fragments/8/fragment8.h @@ -6,7 +6,7 @@ typedef struct unk_D_86204720 { /* 0x000 */ s16 unk_000; /* 0x002 */ s16 unk_002; - /* 0x004 */ unk_D_86002F58_004 unk_004; + /* 0x004 */ unk_D_86002F58_004_000 unk_004; /* 0x16C */ s32 unk_16C; /* 0x170 */ s16 unk_170; /* 0x172 */ s8 unk_172[6]; @@ -18,7 +18,7 @@ typedef struct unk_D_86203E50 { /* 0x000 */ s16 unk_000; /* 0x002 */ s16 unk_002; /* 0x004 */ char pad4[4]; - /* 0x008 */ unk_D_86002F58_004 unk_008; + /* 0x008 */ unk_D_86002F58_004_000 unk_008; /* 0x170 */ u16 unk_170; /* 0x172 */ char pad172[2]; /* 0x174 */ f32 unk_174; diff --git a/src/memory.c b/src/memory.c index 83b123ba..fa537258 100644 --- a/src/memory.c +++ b/src/memory.c @@ -152,7 +152,7 @@ void* func_80002DA4(struct MainPoolState* block, s32 size) { return block; } -s32 func_80002DCC(struct MainPoolState* state, s32 arg1, s32 arg2) { +void* func_80002DCC(struct MainPoolState* state, s32 arg1, s32 arg2) { s32 temp_a2; s32 temp_a3; s32 var_v0; diff --git a/src/memory.h b/src/memory.h index 39ee01e8..3d09ca2b 100644 --- a/src/memory.h +++ b/src/memory.h @@ -8,12 +8,12 @@ #define MEMORY_POOL_RIGHT 1 // structs for the main pool. -struct MainPoolState { +typedef struct MainPoolState { /* 0x00 */ s32 freeSpace; /* 0x04 */ struct MainPoolBlock *listHeadL; /* 0x08 */ struct MainPoolBlock *listHeadR; /* 0x0C */ struct MainPoolState *prev; -}; +} MainPoolState; struct MainPoolBlock { /* 0x00 */ struct MainPoolBlock *prev; @@ -72,7 +72,7 @@ void mem_pool_free(struct MemoryPool* pool, void* addr); void *func_80002D10(u32 size, s32 side); void func_80002D60(struct MemoryBlock* block); void* func_80002DA4(struct MainPoolState* block, s32 size); -s32 func_80002DCC(struct MainPoolState* state, s32 arg1, s32 arg2); +void* func_80002DCC(struct MainPoolState* state, s32 arg1, s32 arg2); void func_80002E3C(struct MainPoolState* state, s32 size); void func_80002E64(struct MainPoolState* state); diff --git a/yamls/us/rom.yaml b/yamls/us/rom.yaml index 1aa4827e..e873dcb5 100644 --- a/yamls/us/rom.yaml +++ b/yamls/us/rom.yaml @@ -99,7 +99,7 @@ - [0x4A360, c] - [0x4A3E0, c] - [0x4B940, c] - - [0x4BA90, c] + - [0x4BA90, c, 4BA90] - [0x4BDC0, c] - [0x4CBC0, c] - [0x4F410, c] @@ -395,7 +395,7 @@ - [0x7DF80, rodata, rom_rodata_7DF80] - [0x7DFD0, rodata, rom_rodata_7DFD0] - [0x7E0D0, rodata, rom_rodata_7E0D0] - - [0x7E0E0, rodata, rom_rodata_7E0E0] + - [0x7E0E0, .rodata, 4BA90] - [0x7E110, rodata, rom_rodata_7E110] - [0x7E2F0, rodata, rom_rodata_7E2F0] - [0x7E560, rodata, rom_rodata_7E560]