From 449c5e20a4422117c50229915a9aac00c6b5950f Mon Sep 17 00:00:00 2001 From: Maide Date: Wed, 4 Sep 2024 00:59:27 +0100 Subject: [PATCH] fragment10 --- include/global.h | 20 +- include/variables.h | 6 + linker_scripts/us/symbol_addrs.txt | 8 + src/11BA0.c | 2 +- src/11BA0.h | 8 + src/17300.h | 1 + src/18140.h | 1 + src/1C720.c | 2 +- src/E890.h | 2 +- src/fragments/10/fragment10.c | 978 ++++++++++++++++++++++++++++- src/fragments/10/fragment10.h | 67 ++ src/fragments/10/fragment10_1.c | 291 +++++++++ src/fragments/2/fragment2.c | 2 +- src/fragments/2/fragment2.h | 2 +- src/fragments/5/fragment5.h | 18 + src/fragments/6/fragment6.c | 12 +- src/fragments/7/fragment7.c | 14 +- src/fragments/8/fragment8.c | 8 +- src/fragments/9/fragment9.c | 7 +- yamls/us/rom.yaml | 7 +- 20 files changed, 1400 insertions(+), 56 deletions(-) create mode 100644 src/fragments/10/fragment10.h create mode 100644 src/fragments/10/fragment10_1.c create mode 100644 src/fragments/5/fragment5.h diff --git a/include/global.h b/include/global.h index 055aade6..60a793fc 100644 --- a/include/global.h +++ b/include/global.h @@ -56,6 +56,11 @@ typedef struct unk_D_86002F58_004_000_000 { /* 0x14 */ s32 unk_14; } unk_D_86002F58_004_000_000; // size = 0x18 +typedef struct unk_D_86002F58_004_000_044 { + /* 0x00 */ char unk00[0xA]; + /* 0x0A */ u16 unk_0A; +} unk_D_86002F58_004_000_044; // size >= 0xC + typedef struct unk_D_86002F58_004_000 { /* 0x000 */ unk_D_86002F58_004_000_000 unk_000; /* 0x018 */ s16 unk_018; @@ -67,7 +72,7 @@ typedef struct unk_D_86002F58_004_000 { /* 0x030 */ Vec3f unk_030; /* 0x03C */ s32 unk_03C; /* 0x040 */ s16 unk_040; - /* 0x044 */ s32 unk_044; + /* 0x044 */ unk_D_86002F58_004_000_044* unk_044; /* 0x048 */ s32 unk_048; /* 0x04C */ u32 unk_04C; /* 0x050 */ char pad50[2]; @@ -82,9 +87,8 @@ typedef struct unk_D_86002F58_004_000 { /* 0x0A4 */ char padA4[2]; /* 0x0A6 */ s8 unk_0A6; /* 0x0A7 */ char padA7[5]; - /* 0x0AC */ f32 unk_0AC; - /* 0x0B0 */ f32 unk_0B0; - /* 0x0B4 */ char padB4[0xB4]; + /* 0x0AC */ Vec3f unk_0AC; + /* 0x0B8 */ char padB8[0xB0]; } unk_D_86002F58_004_000; // size = 0x168 typedef struct unk_D_86002F34_00C { @@ -99,12 +103,8 @@ typedef struct unk_D_86002F34_00C { /* 0x60 */ MtxF* unk_060; /* 0x64 */ Vec3f unk_064; /* 0x70 */ char pad70[0x38]; - /* 0xA8 */ f32 unk_0A8; - /* 0xAC */ f32 unk_0AC; - /* 0xB0 */ f32 unk_0B0; - /* 0xB4 */ f32 unk_0B4; - /* 0xB8 */ f32 unk_0B8; - /* 0xBC */ f32 unk_0BC; + /* 0xA8 */ Vec3f unk_0A8; + /* 0xB4 */ Vec3f unk_0B4; } unk_D_86002F34_00C; // size >= 0xC0 typedef struct unk_D_86002F34 { diff --git a/include/variables.h b/include/variables.h index b50f376d..c2f8e9ab 100644 --- a/include/variables.h +++ b/include/variables.h @@ -212,5 +212,11 @@ extern u32 D_3008000; extern u32 D_300C000; extern u32 D_1003E78[]; extern u32 D_304F120[]; +extern u16 D_87B000C0; +extern u16 D_87B000C4; +extern u8 D_87B000C8; +extern u8 D_87B000CC; +extern u8 D_87B000D0; +extern u8 D_87B000D4; #endif diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index 618d72a5..fcc879e9 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -243,3 +243,11 @@ D_80079014 = 0x80079014; D_3004000 = 0x3004000; D_8780FCB8 = 0x8780FCB8; // size:0x20 D_8780FA68 = 0x8780FA68; // size:0x8 +D_87B000E0 = 0x87B000E0; +D_87B000E4 = 0x87B000E4; +D_87B000E8 = 0x87B000E8; +D_87B000EC = 0x87B000EC; +D_87B000F0 = 0x87B000F0; +D_87B000F2 = 0x87B000F2; +D_87B000F4 = 0x87B000F4; +D_86402848 = 0x86402848; diff --git a/src/11BA0.c b/src/11BA0.c index b9fd6528..9db56678 100644 --- a/src/11BA0.c +++ b/src/11BA0.c @@ -85,7 +85,7 @@ unk_D_86002F58_004_000* func_80011938(MainPoolState* arg0, unk_D_86002F58_004_00 arg1->unk_0A0 = -0x100; arg1->unk_03C = -0x100; arg1->unk_040 = 0; - arg1->unk_044 = 0; + arg1->unk_044 = NULL; arg1->unk_048 = 0; arg1->unk_04C = 0x10000; arg1->unk_052 = 0; diff --git a/src/11BA0.h b/src/11BA0.h index c2cb9df1..dae8c07b 100644 --- a/src/11BA0.h +++ b/src/11BA0.h @@ -9,9 +9,17 @@ typedef struct unk_func_80011B94 { /* 0x18 */ Gfx* unk_18; } unk_func_80011B94; // size = 0x1C +typedef struct unk_D_86404778_190 { + /* 0x00 */ unk_D_86002F58_004_000_000 unk_00; + /* 0x18 */ Gfx* unk_18; + /* 0x1C */ Vec3f unk_1C; + /* 0x28 */ f32 unk_28; +} unk_D_86404778_190; // size = 0x2C + unk_D_86002F58_004_000_000* func_8001103C(MainPoolState*, void*); unk_D_86002F58_004_000* func_80011938(MainPoolState* arg0, unk_D_86002F58_004_000* arg1, s16 arg2, Vec3f* arg3, Vec3s* arg4, Vec3f* arg5); unk_func_80011B94* func_80011B94(MainPoolState*, void*, s32, Gfx*); +unk_D_86404778_190* func_80011B10(MainPoolState*, s32, s32, s32, Vec3f*, f32); void func_80012094(unk_D_86002F58_004_000_000*, unk_D_86002F58_004_000_000*); diff --git a/src/17300.h b/src/17300.h index 4321e56b..e6a110a0 100644 --- a/src/17300.h +++ b/src/17300.h @@ -5,6 +5,7 @@ void func_800173CC(unk_D_86002F58_004_000*); void func_800173DC(unk_D_86002F58_004_000*, s16, s32, s32); +void func_80017464(unk_D_86002F58_004_000*, s16); s32 func_80017514(unk_D_86002F58_004_000*); #endif // _17300_H_ diff --git a/src/18140.h b/src/18140.h index d8fb2a5f..06441255 100644 --- a/src/18140.h +++ b/src/18140.h @@ -5,5 +5,6 @@ void func_80017788(unk_D_86002F58_004_000*); void func_80017798(unk_D_86002F58_004_000*, s16, s32, s32); +void func_80017804(unk_D_86002F58_004_000*, s32); #endif // _18140_H_ diff --git a/src/1C720.c b/src/1C720.c index 3e9066d6..8e339216 100644 --- a/src/1C720.c +++ b/src/1C720.c @@ -46,7 +46,7 @@ void func_8001BC34(unk_D_86002F58_004_000* arg0, s16 arg1, s16 arg2, unk_D_86002 arg0->unk_0A0 = -0x100; arg0->unk_03C = -0x100; arg0->unk_040 = -1; - arg0->unk_044 = 0; + arg0->unk_044 = NULL; arg0->unk_054 = -1; arg0->unk_058 = 0; diff --git a/src/E890.h b/src/E890.h index 749ef5f4..1d3f7f95 100644 --- a/src/E890.h +++ b/src/E890.h @@ -10,7 +10,7 @@ void func_8000ED98(s32*); void func_8000F2C4(MtxF*, MtxF*, Vec3s*); void func_8000FDE4(MtxF*, MtxF*, Vec3f*); void func_80010090(MtxF*, MtxF*); -void func_80010354(f32*, f32*, f32, s16, s32); +void func_80010354(Vec3f*, Vec3f*, f32, s16, s32); #endif // _E890_H_ diff --git a/src/fragments/10/fragment10.c b/src/fragments/10/fragment10.c index b8dc796b..4145217f 100644 --- a/src/fragments/10/fragment10.c +++ b/src/fragments/10/fragment10.c @@ -1,43 +1,977 @@ -#include "global.h" +#include "fragment10.h" +#include "src/12D80.h" +#include "src/17300.h" +#include "src/18140.h" +#include "src/18480.h" +#include "src/19840.h" +#include "src/1C720.h" +#include "src/1CF30.h" +#include "src/20470.h" +#include "src/2E110.h" +#include "src/3FB0.h" +#include "src/49790.h" +#include "src/4BDC0.h" +#include "src/4CBC0.h" +#include "src/50860.h" +#include "src/6A40.h" +#include "src/6BC0.h" +#include "src/E890.h" +#include "src/fragments/2/fragment2.h" +#include "src/memory.h" +#include "src/stage_loader.h" +#include "src/controller.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86400020.s") +typedef struct unk_D_864027C0 { + /* 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 unk_18; + /* 0x1A */ s16 unk_1A; + /* 0x1C */ s16 unk_1C; +} unk_D_864027C0; // size = 0x20 -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86400128.s") +static unk_D_864027C0 D_864027C0[] = { + { -68.0f, 0.0f, 68.0f, 1.0f, 1.0f, 1.0f, 0, 0x5E80, 0 }, + { -68.0f, 0.0f, -68.0f, 1.0f, 1.0f, 1.0f, 0, 0x1F80, 0 }, + { 68.0f, 0.0f, -68.0f, 1.0f, 1.0f, 1.0f, 0, -0x2380, 0 }, + { 68.0f, 0.0f, 68.0f, 1.0f, 1.0f, 1.0f, 0, 0x9D80, 0 }, +}; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86400184.s") +static u16 D_86402840 = 0; +static u16 D_86402844 = 0; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_864001A0.s") +u8 D_86402848 = 0; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86400220.s") +static u8 D_8640284C[][8] = { + { 0x12, 0x13, 0x14, 0x15, 0x3A, 0x3B, 0x3C, 0x3D }, { 0x10, 0x11, 0x12, 0x13, 0x34, 0x35, 0x36, 0x37 }, + { 0x0E, 0x0F, 0x10, 0x11, 0x2E, 0x2F, 0x30, 0x31 }, { 0x0D, 0x0E, 0x0F, 0x10, 0x2B, 0x2C, 0x2D, 0x2E }, + { 0x0C, 0x0D, 0x0E, 0x0F, 0x28, 0x29, 0x2A, 0x2B }, { 0x0B, 0x0C, 0x0D, 0x0E, 0x25, 0x26, 0x27, 0x28 }, + { 0x0A, 0x0B, 0x0C, 0x0D, 0x22, 0x23, 0x24, 0x25 }, { 0x09, 0x0A, 0x0B, 0x0C, 0x1F, 0x20, 0x21, 0x22 }, + { 0x08, 0x09, 0x0A, 0x0B, 0x1C, 0x1D, 0x1E, 0x1F }, { 0x07, 0x08, 0x09, 0x0A, 0x19, 0x1A, 0x1B, 0x1C }, + { 0x06, 0x07, 0x08, 0x09, 0x16, 0x17, 0x18, 0x19 }, { 0x05, 0x06, 0x07, 0x08, 0x13, 0x14, 0x15, 0x16 }, + { 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x12, 0x13 }, { 0x03, 0x04, 0x05, 0x06, 0x0D, 0x0E, 0x0F, 0x10 }, +}; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86400258.s") +static unk_func_87801684 D_864028BC[] = { + { 0x0303ED80, 14 }, { 0x0303F180, 2 }, { 0x0303F580, 6 }, { 0x0303F180, 2 }, { NULL, 0 }, +}; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_864002F8.s") +static unk_func_87801684 D_864028E4[] = { + { 0x03040580, 18 }, { 0x03040980, 2 }, { 0x03040D80, 8 }, { 0x03040980, 2 }, { NULL, 0 }, +}; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_864005EC.s") +static u32 D_8640290C[] = { + 0x0C00FFFF, 0x05000000, 0x0B00001E, 0x00000000, 0x014000F0, 0x0000000F, 0x00000000, 0x00000000, 0x05000000, + 0x0D000000, 0x05000000, 0x14000000, 0x002B0012, 0xFFFFFF32, 0x16FFFFFF, 0x0F000003, 0x05000000, 0x1F00FFFF, + 0x00000000, 0x00000000, 0x00000000, 0x00640064, 0x00640000, 0x06000000, 0x05000000, 0x0A000000, 0x800AC840, + 0x06000000, 0x06000000, 0x06000000, 0x03000000, 0x87806398, 0x06000000, 0x01000000, +}; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86400860.s") +static unk_D_86002F58_004_000 D_86404070; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86400BE8.s") +static unk_D_86002F58_004_000 D_864041D8[4]; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86400EB4.s") +static unk_D_86404778 D_86404778[4]; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86401544.s") +static unk_D_86405158 D_86405158; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86401A9C.s") +static unk_D_86404778* D_864052C8; +static unk_D_86405158* D_864052CC; +static unk_D_86002F58_004_000* D_864052D0; +static u8 D_864052D4; +static s16 D_864052D6; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86401B3C.s") +void func_86400020(void) { + u8 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86401D1C.s") + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86401EEC.s") + if (D_864052C8->unk_000 == 4) { + continue; + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86401F74.s") + D_864052C8->unk_008 = + D_8640284C[D_864052CC->unk_000][2] + func_864026D0(D_864052CC->unk_000, D_864052C8->unk_000); + D_864052C8->unk_00A = + D_8640284C[D_864052CC->unk_000][6] + func_864026D0(D_864052CC->unk_000, D_864052C8->unk_000); + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_8640203C.s") +u16 func_86400128(u8 arg0) { + if ((D_864052D6 == D_86404778[arg0].unk_008) || (D_864052D6 == D_86404778[arg0].unk_00A)) { + return 1; + } + return 0; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_86402130.s") +void func_86400184(unk_D_86404778* arg0, s32 arg1, u8 arg2, s32 arg3, u8 arg4) { + arg0->unk_018 = arg1; + arg0->unk_01C = arg2; + arg0->unk_020 = arg3; + arg0->unk_024 = arg4; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_864025A0.s") +void func_864001A0(void) { + s8 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/10/fragment10/func_864026D0.s") + for (i = 0; i < 4; i++) { + if (D_8780FA30[i] == 0) { + D_86404778[i].unk_000 = 4; + } else { + D_86404778[i].unk_000 = D_8780FA38; + } + } +} + +void func_86400220(void) { + if (func_80017514(&D_86404070) != 0) { + func_80017464(&D_86404070, 0); + } +} + +void func_86400258(unk_D_86405158* arg0) { + static u8 D_86402994 = 0; + static u8 D_86402998[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x08, 0x08, 0x09, + 0x09, 0x09, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, 0x0D, + }; + + if (func_80017514(&arg0->unk_004) != 0) { + arg0->unk_001 = arg0->unk_000; + + if (arg0->unk_000 != 0xD) { + D_86402994++; + arg0->unk_000 = D_86402998[D_86402994]; + } + + if (arg0->unk_001 != arg0->unk_000) { + func_8001BD04(&arg0->unk_004, arg0->unk_000); + } else { + func_80017464(&arg0->unk_004, 0); + } + + func_86400020(); + } +} + +void func_864002F8(void) { + u8 i; + f32 temp_fv0; + f32 var_fv1; + s8 temp_ft2; + s32 temp_s1; + + if (D_8780FC94 == 0) { + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + + if ((func_80017514(&D_864052C8->unk_028) != 0) || + ((D_864052C8->unk_010 == 0) && (D_864052C8->unk_012 > 0)) || + ((D_87B000C8 != 0) && (D_864052C8->unk_00C == 1) && (D_86402840 == 0x3C) && (D_87B000D4 == 1))) { + temp_s1 = D_864052C8->unk_004; + + if ((D_87B000C8 != 0) && (D_864052C8->unk_00C == 1) && + ((D_86402840 == 0x3C) || (D_864052C8->unk_004 == 6))) { + D_864052C8->unk_004 = 6; + } else { + temp_fv0 = (D_864052C8->unk_010 * 100.0f) / D_864052C8->unk_00E; + if (temp_fv0 > 0.0f) { + var_fv1 = 0.5f; + } else { + var_fv1 = -0.5f; + } + temp_ft2 = var_fv1 + temp_fv0; + + if (temp_ft2 >= 0x51) { + D_864052C8->unk_004 = 0; + } else if (temp_ft2 >= 0x3D) { + D_864052C8->unk_004 = 1; + } else if (temp_ft2 >= 0x29) { + D_864052C8->unk_004 = 2; + } else if (temp_ft2 >= 0x15) { + D_864052C8->unk_004 = 3; + } else if (D_864052C8->unk_010 != 0) { + D_864052C8->unk_004 = 4; + } else { + D_864052C8->unk_004 = 5; + } + } + + if (temp_s1 != D_864052C8->unk_004) { + func_8001BD04(&D_864052C8->unk_028, D_864052C8->unk_004); + if (D_864052C8->unk_004 != 0) { + func_8001BD9C(&D_864052C8->unk_028, D_864052C8->unk_004); + } + } else if (D_864052C8->unk_004 == 5) { + func_80017464(&D_864052C8->unk_028, 0x18); + func_80017804(&D_864052C8->unk_028, 0x18); + } else if (D_864052C8->unk_004 == 6) { + func_80017464(&D_864052C8->unk_028, 0x77); + func_80017804(&D_864052C8->unk_028, 0x77); + } else { + func_80017464(&D_864052C8->unk_028, 0); + if (D_864052C8->unk_004 != 0) { + func_80017804(&D_864052C8->unk_028, 0); + } + } + } + } + } +} + +void func_864005EC(u8 arg0) { + u8 i; + u8 sp40[] = { + 0, + 0, + 0, + 0, + }; + static s8 D_864029B4 = 4; + + sp40[arg0] = 1; + + for (i = 0; i < 4; i++) { + if (i != arg0) { + D_864052C8 = &D_86404778[i]; + + if ((D_864052C8->unk_010 <= 0) && (D_864052C8->unk_012 > 0)) { + D_864029B4--; + sp40[i] = 1; + } + } + } + + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + + if (sp40[i] != 0) { + D_864052C8->unk_00C = D_864029B4; + func_86400184(D_864052C8, 0, 0, 0, 0); + } + } + + D_864029B4--; + if (D_864029B4 < 2) { + D_864052CC->unk_004.unk_04C = 0; + D_87B000C8 = 1; + + func_8004B9C4(0xA); + + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + + if (D_864052C8->unk_00C == 0) { + D_864052C8->unk_00C = 1; + func_86400184(D_864052C8, 0, 0, 0, 0); + } + } + + D_87B000D4 = 0; + + for (i = 0; i < 4; i++) { + if (D_86404778[i].unk_00C == 1) { + D_87B000D4++; + } + } + + if (D_87B000D4 == 1) { + for (i = 0; i < 4; i++) { + if (D_86404778[i].unk_00C == 1) { + func_87802F00(i); + break; + } + } + } + } +} + +void func_86400860(UNUSED s32 arg0) { + u8 i; + f32 temp_fs0; + s16 temp_a3; + Gfx* temp_v0; + + temp_fs0 = 0.1f; + + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + + temp_v0 = func_80005F5C(0x80); + D_864052C8->unk_190->unk_18 = temp_v0; + + if ((D_864052C8->unk_010 == 0) || (D_864052C8->unk_00C == 1)) { + temp_a3 = D_864052C8->unk_028.unk_048 >> 0x10; + + gSPDisplayList(temp_v0++, D_86403F30); + gDPSetTileSize(temp_v0++, G_TX_RENDERTILE, 0x0000, (0x40 - (D_87B000C0 % 64)) << 2, 0x007C, + ((0x80 - (D_87B000C0 % 64)) & 0x3F) << 2); + gSPDisplayList(temp_v0++, D_86403FA0); + + if ((D_864052C8->unk_004 == 5) && (temp_a3 >= 0x18)) { + if (D_864052C8->unk_015 == 0) { + D_864052C8->unk_015 = 1; + if ((D_8780FC92 == 0) && (D_8780FC94 == 0)) { + func_8004D9B0(0x70005, i + 1, 0); + } + } + D_864052C8->unk_190->unk_28 = temp_fs0; + } else if ((D_864052C8->unk_00C == 1) && (D_864052C8->unk_004 == 6) && (temp_a3 >= 0x77)) { + if (D_864052C8->unk_015 == 0) { + D_864052C8->unk_015 = 1; + if ((D_8780FC92 == 0) && (D_8780FC94 == 0)) { + func_8004D9B0(0x70006, i + 1, 0); + } + } + D_864052C8->unk_190->unk_28 = temp_fs0; + } else { + D_864052C8->unk_190->unk_28 = 0.0f; + } + } else { + gSPDisplayList(temp_v0++, D_86403BB0); + + if (D_864052C8->unk_018 == 2) { + switch (D_864052C8->unk_01C) { + default: + D_864052C8->unk_190->unk_28 = 0.5f; + break; + + case 20: + D_864052C8->unk_190->unk_28 = temp_fs0; + if ((D_8780FC92 == 0) && (D_8780FC94 == 0)) { + func_8004D9B0(0x70004, i + 1, 0); + } + break; + + case 19: + D_864052C8->unk_190->unk_28 = 0.2f; + break; + + case 18: + D_864052C8->unk_190->unk_28 = 0.3f; + break; + } + } else { + D_864052C8->unk_190->unk_28 = 0.0f; + } + } + + gSPEndDisplayList(temp_v0++); + + D_864052C8->unk_190->unk_1C = D_864052C8->unk_028.unk_0AC; + } +} + +void func_86400BE8(s32 arg0) { + s32 temp; + s16 sp24[] = { + 0xFB1E, + 0xFED4, + 0x0120, + 0x04B0, + }; + u8 i; + + func_878025D0(); + + if (D_8780FC94 == 0) { + if (arg0 == 2) { + static u8 D_864029C0 = 0; + + D_864052D6 = D_864052CC->unk_004.unk_048 >> 0x10; + D_864052D4 = 0; + + for (i = 0; i < 8; i++) { + temp = D_864052D6; + if (temp == D_8640284C[D_864052CC->unk_000][i]) { + D_864052D4 = 1; + break; + } + } + + D_86402848 = 0; + + if (D_87B000C8 == 0) { + for (i = 0; i < 8; i++) { + temp = D_864052D6; + if ((temp + 1) == D_8640284C[D_864052CC->unk_000][i]) { + D_86402848 = 1; + break; + } + } + } + + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + + D_864052C8->unk_012 = D_864052C8->unk_010; + + if ((D_87B000C8 != 0) && (D_864052C8->unk_00C == 1) && (D_86402840 >= 0x3C) && (D_87B000D4 == 1) && + (D_864029C0 < 0x10)) { + D_864052C8->unk_028.unk_01E.y += sp24[i]; + } + } + + if (D_87B000C8 != 0) { + if (D_86402840 < 0x3C) { + D_86402840++; + } else { + if (D_86402840 < 0x6A) { + if (D_86402840 == 0x69) { + D_87B000CC = 1; + func_87802EB8(1); + } + D_86402840++; + } + + if (D_864029C0 < 0x10) { + D_864029C0++; + } + } + } + } + + if (D_87B000C8 != 0) { + static f32 D_864029C4 = 1.0f; + + D_864029C4 -= 0.06f; + if (D_864029C4 < 0.0f) { + D_864029C4 = 0.0f; + } + + D_86405158.unk_004.unk_030.x = D_86405158.unk_004.unk_030.y = D_86405158.unk_004.unk_030.z = D_864029C4; + } + } +} + +void func_86400EB4(void) { + static u8 D_864029C8 = 0; + + u8 i; + u8 j; + s32 var_a2; + UNUSED s32 pad; + + if ((D_8780FC92 == 0) && (D_8780FC94 == 0)) { + D_864052CC->unk_16D = D_864052CC->unk_16C; + if (D_864052D6 < (D_864052CC->unk_004.unk_044->unk_0A / 2)) { + D_864052CC->unk_16C = 0; + } else { + D_864052CC->unk_16C = 1; + } + + if (D_864052CC->unk_16C != D_864052CC->unk_16D) { + func_8004D9B0(0x70003, 1 - D_864052CC->unk_16C, 0); + + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + + if ((D_864052C8->unk_274 == 0) && (D_864052C8->unk_010 > 0)) { + if (D_864052CC->unk_16D != 0) { + D_864052C8->unk_194[D_864052CC->unk_001][7]++; + } else { + D_864052C8->unk_194[D_864052CC->unk_000][7]++; + } + } else { + D_864052C8->unk_274 = 0; + } + } + } + + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + + if (D_864052C8->unk_012 != 0) { + if (D_864052C8->unk_01C >= 2) { + D_864052C8->unk_01C--; + } else { + func_86400184(D_864052C8, D_864052C8->unk_020, D_864052C8->unk_024, 0, 0); + } + + if (D_864052C8->unk_000 == 4) { + D_86402844 = gControllers[i].buttonPressed & 0x8000; + } else { + D_86402844 = func_86400128(i); + } + + if (D_86402844 != 0) { + if (D_864052D4 != 0) { + if (D_864052C8->unk_014 == 0) { + if (D_864029C8 == 0) { + func_8004D9B0(0x70009, 0, 0); + D_864029C8 = 1; + } + + D_864052C8->unk_014 = 1; + func_80017464(&D_864041D8[i], 0); + + for (j = 0; j < 4; j++) { + if (i != j) { + D_86404778[j].unk_010 -= 2; + } + } + + if (D_864052C8->unk_018 == 0) { + func_86400184(D_864052C8, 1, 0x14, 0, 0); + } else { + func_86400184(D_864052C8, 0, 1, 1, 0x14); + } + } + } else { + D_864052C8->unk_010 -= 1; + if (D_864052C8->unk_018 == 0) { + func_86400184(D_864052C8, 2, 0x14, 0, 0); + } else { + func_86400184(D_864052C8, 0, 1, 2, 0x14); + } + } + + D_864052C8->unk_274 = 1; + if (D_864052CC->unk_16C == 0) { + var_a2 = 2; + } else { + var_a2 = 6; + } + + if ((D_8640284C[D_864052CC->unk_000][var_a2] - 3) >= D_864052D6) { + D_864052C8->unk_194[D_864052CC->unk_000][0]++; + } else if ((D_864052D6 + 2) == D_8640284C[D_864052CC->unk_000][var_a2]) { + D_864052C8->unk_194[D_864052CC->unk_000][1]++; + } else if ((D_864052D6 + 1) == D_8640284C[D_864052CC->unk_000][var_a2]) { + D_864052C8->unk_194[D_864052CC->unk_000][2]++; + } else if (D_864052D6 == D_8640284C[D_864052CC->unk_000][var_a2]) { + D_864052C8->unk_194[D_864052CC->unk_000][3]++; + } else if (D_864052D6 == (D_8640284C[D_864052CC->unk_000][var_a2] + 1)) { + D_864052C8->unk_194[D_864052CC->unk_000][4]++; + } else if (D_864052D6 == (D_8640284C[D_864052CC->unk_000][var_a2] + 2)) { + D_864052C8->unk_194[D_864052CC->unk_000][5]++; + } else if (D_864052D6 >= (D_8640284C[D_864052CC->unk_000][var_a2] + 3)) { + D_864052C8->unk_194[D_864052CC->unk_000][6]++; + } + } + + if ((D_864052D6 == D_8640284C[D_864052CC->unk_000][3]) || + (D_864052D6 == D_8640284C[D_864052CC->unk_000][7])) { + if (D_864052C8->unk_014 == 0) { + D_864052C8->unk_010--; + if (D_864052C8->unk_018 == 0) { + func_86400184(D_864052C8, 2, 0x14, 0, 0); + } else { + func_86400184(D_864052C8, 0, 1, 2, 0x14); + } + } else { + D_864052C8->unk_014 = 0; + } + } + } + } + + if ((D_864052D6 == D_8640284C[D_864052CC->unk_000][3]) || (D_864052D6 == D_8640284C[D_864052CC->unk_000][7])) { + D_864029C8 = 0; + } + + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + + if (D_864052C8->unk_010 <= 0) { + D_864052C8->unk_010 = 0; + if ((D_864052C8->unk_012 > 0) && (D_864052C8->unk_00C == 0)) { + func_864005EC(i); + } + } + } + } +} + +void func_86401544(s32 arg0) { + if ((arg0 == 0) || ((arg0 == 3) && (D_87B000D0 == 1))) { + func_80020460(0x18, 0x16, 0x110, 0x90, 0x15); + func_80020460(0x18, 0xA5, 0x110, 0x36, 0x14B); + + gSPDisplayList(gDisplayListHead++, D_8006F518); + + func_87801F48(2, 0x19, 0xA6); + func_87801684(0x74, 0xB0, D_864028BC); + func_87801824(0x74, 0xC6, D_864028E4); + + gSPDisplayList(gDisplayListHead++, D_8006F630); + + } else if ((arg0 == 1) || (arg0 == 2) || ((arg0 == 3) && (D_87B000D0 == 0))) { + u8 i; + s16 sp74[] = { + 0x0025, + 0x003D, + 0x00E5, + 0x00FD, + }; + s16 sp6C[] = { + 0x00BA, + 0x0034, + 0x0034, + 0x00BA, + }; + + gSPDisplayList(gDisplayListHead++, D_8006F518); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); + + for (i = 0; i < 4; i++) { + if (D_86404778[i].unk_000 == 4) { + func_87801644(i, sp74[i], sp6C[i], 0.75f); + } else { + func_87801644(-1 - i, sp74[i], sp6C[i], 0.75f); + } + } + + gSPDisplayList(gDisplayListHead++, D_8006F630); + } + + func_8001F3F4(); + func_8001F470(); + + if ((arg0 == 0) || ((arg0 == 3) && (D_87B000D0 == 1))) { + char* temp_s2 = func_8002D7C0(NULL, 0, D_87806330, 0x29); + s32 sp58; + s32 sp54; + s32 temp_s0; + + func_8001EBE0(2, 0); + func_8001F3B4(0xC); + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + func_8001F36C(0xF9, 0xF4, 0, 0xFF); + func_8001F1E8(0xA0 - (func_878013D4(D_87B000E0, func_8002D7C0(NULL, 0, D_87806330, 0x28)) / 2), 0x20, + func_8002D7C0(NULL, 0, D_87806330, 0x28)); + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + func_8001F36C(0xFF, 0xFF, 0xFF, 0xFF); + func_8001F1E8(0x28, 0x34, temp_s2); + + temp_s0 = ((func_8002D80C(temp_s2) * 0xC) + 0xC); + func_8001F1E8(0x28, temp_s0 + 0x34, func_8002D7C0(NULL, 0, D_87806330, 0x2A)); + func_8001F1E8(0x8B, 0xB2, func_8002D7C0(NULL, 0, D_87806330, 0x5C)); + func_8001F1E8(0x8B, 0xC8, func_8002D7C0(NULL, 0, D_87806330, 0x5C)); + func_8001F324(0xC8, 0xC8, 0xFF, 0xFF); + func_8001F36C(0x50, 0x50, 0xFF, 0xFF); + func_87801290(&sp58, &sp54, temp_s2, func_8002D7C0(NULL, 0, D_87806330, 0x5F), 0xC); + func_8001F1E8(sp58 + 0x28, sp54 + 0x34, func_8002D7C0(NULL, 0, D_87806330, 0x5F)); + func_8001F324(0xC8, 0xC8, 0xFF, 0xFF); + func_8001F36C(0x50, 0x50, 0xFF, 0xFF); + func_8001F1E8(0xA2, 0xB2, func_8002D7C0(NULL, 0, D_87806330, 0x2B)); + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + func_8001F36C(0xFF, 0x80, 0x80, 0xFF); + func_8001F1E8(0xA2, 0xC8, func_8002D7C0(NULL, 0, D_87806330, 0x14)); + } + + func_8001F4C4(); + func_8001F444(); +} + +void func_86401A9C(s32 arg0) { + func_800079C4(); + func_8000699C(&gDisplayListHead, 0xA6BF); + + if (D_8780FC94 == 0) { + func_80015348(); + } + + func_80015094(D_87B000E8); + + if (D_8780FC98 == 0) { + func_86401544(arg0); + } + + func_87804FD4(); + func_80007778(); + + if (D_8780FC94 == 0) { + D_87B000C0++; + } +} + +void func_86401B3C(void) { + u8 i; + u8 var_s1; + s32 var_s2; + + var_s1 = 0; + var_s2 = 1; + func_800077B4(5); + func_80006C6C(0x10); + + while (var_s2 != 0) { + if (var_s1 >= 0x11) { + if (D_80068BA0->unk_08 & 0x1000) { + var_s2 = 0; + } else if ((D_8780FA2A == 0) && (D_80068BA0->unk_08 & 0x4000)) { + func_80048B90(3); + func_87802EB8(2); + D_87B000D0 = 1; + return; + } + } + + func_87B00020(); + func_86400BE8(0); + func_86400860(0); + func_864002F8(); + func_86400220(); + func_86401A9C(0); + + if (var_s1 < 0x11) { + var_s1++; + } + } + + func_8004B9C4(0x3C); + if (D_8780FC92 == 0) { + while (true) { + if (D_87B000C4 <= 0) { + break; + } + + for (i = 3; i > 0; i--) { + if (D_87B000C4 == ((i * 0x3C) / 2)) { + if (i == 3) { + func_8780295C(1); + } + func_8004D9B0(0x70001, 0, 0); + } + } + + D_87B000C4--; + + func_87B00020(); + func_86400BE8(1); + func_86400860(1); + func_864002F8(); + func_86400220(); + func_86401A9C(1); + } + } +} + +void func_86401D1C(void) { + static u8 D_864029DC = 0; + static u8 D_864029E0 = 0; + + s32 var_s2 = 1; + + if (D_8780FC92 == 0) { + func_8004D9B0(0x70002, 0, 0); + func_87B00020(); + func_86400BE8(2); + func_86400860(2); + func_864002F8(); + func_86400220(); + func_86401A9C(2); + + while (var_s2 != 0) { + if (D_8780FC92 != 0) { + break; + } + + if ((D_864029DC == 0) && (func_87802974() == -2)) { + func_8004B1CC(0x18); + D_864029DC = 1; + } + + func_87B00020(); + func_86400BE8(2); + + if (D_87B000C8 == 0) { + if (D_864029E0 < 0x1E) { + if (D_8780FC94 == 0) { + D_864029E0++; + } + } else if (D_864029E0 == 0x1E) { + if (D_8780FC94 == 0) { + func_8004D9B0(0x70003, 1, 0); + D_864029E0++; + } + func_80017464(&D_864052CC->unk_004, 1); + } else { + func_86400EB4(); + func_86400258(D_864052CC); + } + } else if (D_8780FC96 != 0) { + var_s2 = 0; + } + + func_86400860(2); + func_864002F8(); + func_86400220(); + func_86401A9C(2); + } + } +} + +void func_86401EEC(void) { + u8 i; + + func_8004FC60(1, 0x1E); + func_8004FC60(2, 0x1E); + func_80006CB4(0x1E); + + for (i = 0; i < 30; i++) { + func_87B00020(); + func_86400BE8(3); + func_86400860(3); + func_864002F8(); + func_86400220(); + func_86401A9C(3); + } +} + +void func_86401F74(void) { + D_87B000EC = D_87B000E8->unk_0C; + + D_87B000F0 = 0x900; + D_87B000F2 = 0; + D_87B000F4 = 0x190; + + D_87B000EC->unk_034 = 50.0f; + D_87B000EC->unk_038 = 6400.0f; + D_87B000EC->unk_02C = 27.5f; + + D_87B000EC->unk_0B4.y = 25.0f; + + func_80010354(&D_87B000EC->unk_0B4, &D_87B000EC->unk_0A8, D_87B000F4, D_87B000F0, D_87B000F2); +} + +void func_8640203C(void) { + u8 i; + MemoryBlock* temp_s5 = func_80002D10(main_pool_get_available(), 0); + + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + D_864052C8->unk_190 = func_80011B10(temp_s5, 0, 4, 0, &D_8006F050, 0.0f); + func_80012094(&D_800AC840, &D_864052C8->unk_190->unk_00); + } + + func_80002D60(temp_s5); +} + +void func_86402130(void) { + u8 i; + u8 x; + u8 y; + MemoryBlock* temp_v0 = func_80002D10(main_pool_get_available(), 0); + + D_87B000E8 = func_80018B70(temp_v0, D_8640290C); + func_80002D60(temp_v0); + func_8001BB20(); + func_8001987C(); + D_87B000E4 = func_80019D18(0xC7); + D_864052D0 = &D_86404070; + func_8001BB58(D_864052D0); + func_8001BC34(D_864052D0, 0, 0xC7, D_87B000E4->unk_08[0]->unk_00); + func_8001BD04(D_864052D0, 0); + func_80017464(D_864052D0, 0); + D_87B000E4 = func_80019D18(0xC4); + + for (i = 0; i < 4; i++) { + D_864052C8 = &D_86404778[i]; + D_864052D0 = &D_864052C8->unk_028; + + func_8001BB58(D_864052D0); + func_8001BC34(D_864052D0, 0, 0xC4, D_87B000E4->unk_08[0]->unk_00); + D_864052C8->unk_004 = 0; + func_8001BD04(D_864052D0, D_864052C8->unk_004); + func_80017464(D_864052D0, func_87B00050(D_864052D0->unk_044->unk_0A)); + + D_864052D0->unk_024.x = D_864027C0[i].unk_00; + D_864052D0->unk_024.y = D_864027C0[i].unk_04; + D_864052D0->unk_024.z = D_864027C0[i].unk_08; + + D_864052D0->unk_030.x = D_864027C0[i].unk_0C; + D_864052D0->unk_030.y = D_864027C0[i].unk_10; + D_864052D0->unk_030.z = D_864027C0[i].unk_14; + + D_864052D0->unk_01E.x = D_864027C0[i].unk_18; + D_864052D0->unk_01E.y = D_864027C0[i].unk_1A; + D_864052D0->unk_01E.z = D_864027C0[i].unk_1C; + + D_864052C8->unk_00C = 0; + D_864052C8->unk_00E = 0x14A; + D_864052C8->unk_010 = D_864052C8->unk_00E; + D_864052C8->unk_014 = 0; + D_864052C8->unk_015 = 0; + + func_86400184(D_864052C8, 0, 0, 0, 0); + + for (x = 0; x < 14; x++) { + for (y = 0; y < 8; y++) { + D_864052C8->unk_194[x][y] = 0; + } + } + + D_864052C8->unk_274 = 0; + } + + D_87B000E4 = func_80019D18(0xC3); + D_864052CC = &D_86405158; + D_864052D0 = &D_864052CC->unk_004; + func_8001BB58(D_864052D0); + func_8001BC34(D_864052D0, 0, 0xC3, D_87B000E4->unk_08[0]->unk_00); + + D_864052CC->unk_001 = D_864052CC->unk_000 = 0; + + func_8001BD04(D_864052D0, D_864052CC->unk_000); + func_80017464(D_864052D0, D_864052D0->unk_044->unk_0A); + + D_864052D0->unk_024.y = 20.0f; + D_864052D0->unk_030.x = 1.0f; + D_864052D0->unk_030.y = 1.0f; + D_864052D0->unk_030.z = 1.0f; + D_864052D0->unk_01E.x = -0xB00; + + D_864052CC->unk_16C = 0; + D_864052CC->unk_16D = 0; + D_87B000E4 = func_80019D18(0xD2); + + for (i = 0; i < 4; i++) { + D_864052D0 = &D_864041D8[i]; + + func_8001BB58(D_864052D0); + func_8001BC34(D_864052D0, 0, 0xD2, D_87B000E4->unk_08[0]->unk_00); + func_8001BD04(D_864052D0, 0); + func_80017464(D_864052D0, D_864052D0->unk_044->unk_0A); + + D_864052D0->unk_024.x = D_864027C0[i].unk_00; + D_864052D0->unk_024.y = 25.0f; + D_864052D0->unk_024.z = D_864027C0[i].unk_08; + D_864052D0->unk_01E.x = D_864027C0[i].unk_18; + D_864052D0->unk_01E.y = D_864027C0[i].unk_1A; + D_864052D0->unk_01E.z = D_864027C0[i].unk_1C; + } + + func_8640203C(); + func_864001A0(); + func_86400020(); + func_86401F74(); + func_87802528(); + func_878029C0(); +} + +void func_864025A0(UNUSED s32 arg0, UNUSED s32 arg1) { + unk_func_80007444* sp24; + + main_pool_push_state(0x4D494E49); + func_80005E40(0x18000, 0); + sp24 = func_80007444(0, 1, 3, 1, 2, 1); + D_87B000E0 = func_8001E94C(0x16, 0); + func_80004258(((u32)&D_1000000 & 0x0F000000) >> 0x18, _4BD6B0_ROM_START, _4BE810_ROM_START, 0); + func_80004454((((u32)&D_81000000 & 0x0FF00000) >> 0x14) - 0x10, fragment31_ROM_START, fragment32_ROM_START); + func_86402130(); + func_80007678(sp24); + func_86401B3C(); + func_86401D1C(); + func_86401EEC(); + func_800076C0(); + func_8001E9CC(); + func_80005EAC(); + main_pool_pop_state(0x4D494E49); + func_87803118(); +} diff --git a/src/fragments/10/fragment10.h b/src/fragments/10/fragment10.h new file mode 100644 index 00000000..b6a0cdb1 --- /dev/null +++ b/src/fragments/10/fragment10.h @@ -0,0 +1,67 @@ +#ifndef _FRAGMENT10_H_ +#define _FRAGMENT10_H_ + +#include "global.h" +#include "src/11BA0.h" +#include "src/fragments/5/fragment5.h" + +typedef struct unk_D_86404778 { + /* 0x000 */ s32 unk_000; + /* 0x004 */ s32 unk_004; + /* 0x008 */ s16 unk_008; + /* 0x00A */ s16 unk_00A; + /* 0x00C */ u8 unk_00C; + /* 0x00E */ s16 unk_00E; + /* 0x010 */ s16 unk_010; + /* 0x012 */ s16 unk_012; + /* 0x014 */ u8 unk_014; + /* 0x015 */ u8 unk_015; + /* 0x016 */ char unk016[0x2]; + /* 0x018 */ s32 unk_018; + /* 0x01C */ u8 unk_01C; + /* 0x020 */ s32 unk_020; + /* 0x024 */ u8 unk_024; + /* 0x028 */ unk_D_86002F58_004_000 unk_028; + /* 0x190 */ unk_D_86404778_190* unk_190; + /* 0x194 */ u16 unk_194[14][8]; + /* 0x274 */ u8 unk_274; +} unk_D_86404778; // size = 0x278 + +typedef struct unk_D_86405158 { + /* 0x000 */ u8 unk_000; + /* 0x001 */ u8 unk_001; + /* 0x004 */ unk_D_86002F58_004_000 unk_004; + /* 0x16C */ u8 unk_16C; + /* 0x16D */ u8 unk_16D; +} unk_D_86405158; // size = 0x170 + +extern u8 D_86402848; +extern u16 D_864029F0[4][14][8]; +extern Gfx D_86403FA0[]; +extern Gfx D_86403BB0[]; +extern Gfx D_86403F30[]; + +void func_86400020(void); +u16 func_86400128(u8 arg0); +void func_86400184(unk_D_86404778* arg0, s32 arg1, u8 arg2, s32 arg3, u8 arg4); +void func_864001A0(void); +void func_86400220(void); +void func_86400258(unk_D_86405158* arg0); +void func_864002F8(void); +void func_864005EC(u8 arg0); +void func_86400860(UNUSED s32 arg0); +void func_86400BE8(s32 arg0); +void func_86400EB4(void); +void func_86401544(s32 arg0); +void func_86401A9C(s32 arg0); +void func_86401B3C(void); +void func_86401D1C(void); +void func_86401EEC(void); +void func_86401F74(void); +void func_8640203C(void); +void func_86402130(void); +void func_864025A0(UNUSED s32 arg0, UNUSED s32 arg1); + +s8 func_864026D0(u8 arg0, s32 arg1); + +#endif // _FRAGMENT10_H_ diff --git a/src/fragments/10/fragment10_1.c b/src/fragments/10/fragment10_1.c new file mode 100644 index 00000000..26c8d8bb --- /dev/null +++ b/src/fragments/10/fragment10_1.c @@ -0,0 +1,291 @@ +#include "fragment10.h" + +u16 D_864029F0[4][14][8] = { + { + { 0x0005, 0x0014, 0x0046, 0x0046, 0x0046, 0x000A, 0x0000, 0x0003 }, + { 0x0002, 0x000F, 0x0041, 0x0041, 0x0041, 0x000A, 0x0000, 0x0003 }, + { 0x0001, 0x000C, 0x003C, 0x003C, 0x003C, 0x000A, 0x0000, 0x0003 }, + { 0x0000, 0x000A, 0x0037, 0x0037, 0x0037, 0x000A, 0x0000, 0x0003 }, + { 0x0000, 0x000A, 0x0032, 0x0032, 0x0032, 0x000A, 0x0000, 0x0003 }, + { 0x0000, 0x000A, 0x002D, 0x002D, 0x002D, 0x000A, 0x0000, 0x0003 }, + { 0x0000, 0x000A, 0x0028, 0x0028, 0x0028, 0x000A, 0x0000, 0x0003 }, + { 0x0000, 0x000A, 0x0023, 0x0023, 0x0023, 0x000A, 0x0001, 0x0003 }, + { 0x0000, 0x000A, 0x001E, 0x001E, 0x001E, 0x000A, 0x0005, 0x0003 }, + { 0x0000, 0x000A, 0x0019, 0x0019, 0x0019, 0x000A, 0x0009, 0x0003 }, + { 0x0001, 0x000A, 0x0014, 0x0014, 0x0014, 0x000F, 0x000F, 0x0004 }, + { 0x0002, 0x000A, 0x000F, 0x000F, 0x0014, 0x001E, 0x001E, 0x0006 }, + { 0x0004, 0x000A, 0x000A, 0x000A, 0x000A, 0x0032, 0x003C, 0x0008 }, + { 0x0006, 0x000A, 0x000A, 0x000A, 0x000A, 0x005A, 0x00FA, 0x000A }, + }, + { + { 0x0002, 0x000F, 0x0046, 0x005D, 0x0046, 0x0005, 0x0000, 0x0002 }, + { 0x0001, 0x000C, 0x0041, 0x0056, 0x0041, 0x0005, 0x0000, 0x0002 }, + { 0x0000, 0x000A, 0x003C, 0x0050, 0x003C, 0x0005, 0x0000, 0x0002 }, + { 0x0000, 0x000A, 0x0037, 0x0049, 0x0037, 0x0005, 0x0000, 0x0002 }, + { 0x0000, 0x000A, 0x0032, 0x0043, 0x0032, 0x0005, 0x0000, 0x0002 }, + { 0x0000, 0x000A, 0x002D, 0x003C, 0x002D, 0x0005, 0x0000, 0x0002 }, + { 0x0000, 0x000A, 0x0028, 0x0035, 0x0028, 0x0005, 0x0000, 0x0002 }, + { 0x0000, 0x000A, 0x0023, 0x002F, 0x0023, 0x0005, 0x0000, 0x0002 }, + { 0x0000, 0x000A, 0x001E, 0x0028, 0x001E, 0x0005, 0x0000, 0x0002 }, + { 0x0000, 0x000A, 0x0019, 0x0021, 0x0019, 0x0005, 0x0001, 0x0002 }, + { 0x0000, 0x000A, 0x0014, 0x001B, 0x0014, 0x000A, 0x0004, 0x0002 }, + { 0x0001, 0x000A, 0x000F, 0x0014, 0x000F, 0x000F, 0x000A, 0x0002 }, + { 0x0002, 0x000A, 0x000A, 0x000C, 0x000F, 0x0014, 0x0014, 0x0003 }, + { 0x0004, 0x000A, 0x000A, 0x000A, 0x000F, 0x0028, 0x003C, 0x0004 }, + }, + { + { 0x0000, 0x000C, 0x0046, 0x0075, 0x0046, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x0041, 0x006D, 0x0041, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x003C, 0x0064, 0x003C, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x0037, 0x005C, 0x0037, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x0032, 0x0053, 0x0032, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x002D, 0x004B, 0x002D, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x0028, 0x0043, 0x0028, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x0023, 0x003A, 0x0023, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x001E, 0x0032, 0x001E, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x0019, 0x002A, 0x0019, 0x0002, 0x0000, 0x0001 }, + { 0x0000, 0x000A, 0x0014, 0x0021, 0x0014, 0x0002, 0x0001, 0x0001 }, + { 0x0000, 0x000A, 0x000F, 0x0019, 0x000F, 0x0003, 0x0002, 0x0001 }, + { 0x0001, 0x000A, 0x000A, 0x000F, 0x000F, 0x0007, 0x0004, 0x0001 }, + { 0x0002, 0x000A, 0x000A, 0x000A, 0x000F, 0x000F, 0x000A, 0x0003 }, + }, + { + { 0x0000, 0x000A, 0x0046, 0x008C, 0x0046, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x0041, 0x0082, 0x0041, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x003C, 0x0078, 0x003C, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x0037, 0x006E, 0x0037, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x0032, 0x0064, 0x0032, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x002D, 0x005A, 0x002D, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x0028, 0x0050, 0x0028, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x0023, 0x0046, 0x0023, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x001E, 0x003C, 0x001E, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x0019, 0x0032, 0x0019, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x0014, 0x0028, 0x0014, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x000F, 0x001E, 0x000F, 0x0001, 0x0000, 0x0000 }, + { 0x0000, 0x000A, 0x000A, 0x0014, 0x000A, 0x0001, 0x0000, 0x0001 }, + { 0x0001, 0x000A, 0x000A, 0x000A, 0x000A, 0x0002, 0x0001, 0x0002 }, + }, +}; + +static u32 D_86402D70[] = { + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5CE73, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xCE73D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73D6B5, 0xCE73D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73D6B5, + 0xD6B5CE73, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5CE73, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5DEF7, 0xD6B5DEF7, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5CE73, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73D6B5, 0xD6B5D6B5, + 0xDEF7D6B5, 0xDEF7DEF7, 0xDEF7DEF7, 0xDEF7DEF7, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5CE75, 0xCE73D6B5, 0xDEF5D6B7, 0xDEF7E737, 0xDEF9E739, + 0xE739E737, 0xDEF9E737, 0xDEF9DEF5, 0xD6B7DEF5, 0xD6B5CE75, 0xD6B5D6B5, 0xCE73D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xCE73CE73, 0xCE73BDF1, 0xB52DBDF1, 0xD675D6F7, 0xDEF7E739, 0xE739EF3B, 0xE779EF7B, 0xE739E739, + 0xE739E739, 0xDEF7DEF7, 0xD6B7DEF5, 0xCE75D6B3, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5CE73, 0xCE73D6B5, + 0xBDF18C27, 0x621F7365, 0x9429A4ED, 0xB52FB571, 0xC633D677, 0xDEF7E73B, 0xEF7BEF3B, 0xEF7BE739, 0xE739E737, + 0xDEF7D6B7, 0xD6B5D6B5, 0xCEB3D675, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73CE73, 0xCE73CE73, 0xBDF183A5, 0x499D51DD, + 0x621F6B23, 0x8367942B, 0x9C6BAD2F, 0xBD73C635, 0xDEF7EF3B, 0xEF7BE73B, 0xEF79E739, 0xDEF9DEF7, 0xD6F5D675, + 0xD6B3CEB5, 0xD6B5D6B5, 0xD6B5CE73, 0xCE73CE73, 0xCE73C631, 0xC631AD6D, 0x94298BE7, 0x8C299CAB, 0xA4EDACEF, + 0xACED946B, 0x9C6DACED, 0xB571C5F5, 0xD675CE77, 0xD635CEB7, 0xE6F7DEF7, 0xD6B7DEF5, 0xCE75D6B3, 0xCE75D6B5, + 0xD6B5CE73, 0xCE73CE73, 0xC631C631, 0xBDEFBDEF, 0xBDEFBE31, 0xCE31D6B5, 0xD6B5D6B7, 0xCE33BDB1, 0xB571A4ED, + 0xA4AD9CAD, 0xACEFB531, 0xAD2FAD31, 0xD675DEF9, 0xDEF7DEF5, 0xD6B5CE75, 0xD6B3D6B5, 0xCE73CE73, 0xCE73CE73, + 0xC631B5AD, 0xB5ADB5AD, 0xB5ADB5AD, 0xC631CE73, 0xCE73D6B7, 0xDEF5D6B7, 0xDEF5C5F3, 0xAD2F9C6B, 0x9CADA4AD, + 0xACEFA4EF, 0xCE35E739, 0xDEF7DEB5, 0xD6B5CEB5, 0xD6B5D6B5, 0xCE73D6B5, 0xCE73C631, 0xBDEFB5AD, 0xAD6BA529, + 0xA529B5AD, 0xB5ADBDEF, 0xCE73CE73, 0xD6B5D6B5, 0xCE75ACED, 0x7B656AE3, 0x8BA7A4EF, 0xBDB1CE37, 0xE737E73B, + 0xDEF7DEF7, 0xD6B5D6B3, 0xCE75D6B5, 0xCE73D6B5, 0xCE73C631, 0xB5ADAD6B, 0xA5299CE7, 0x9CE7A529, 0xAD6BB5AD, + 0xBDEFCE73, 0xC631C5F1, 0x94696261, 0x5A5F8367, 0xA52DD675, 0xE6F9E77B, 0xEF7BE739, 0xDEF7DEF7, 0xD6B5D6B5, + 0xD675CEB3, 0xCE73CE73, 0xCE73C631, 0xBDEFA529, 0xA52994A5, 0x94A594A5, 0xA529AD6B, 0xB5ADB5AD, 0xA4ED7B63, + 0x51DD4159, 0x7325B56F, 0xD6B5E6F9, 0xDF39EF39, 0xE739E739, 0xE739D6B5, 0xD6B5D6B5, 0xD6B5CE73, 0xCE73CE73, + 0xCE73C631, 0xB5ADAD6B, 0x9CE794A5, 0x8C6394A5, 0x94A59CE7, 0x9CA77BA5, 0x5A1D3919, 0x499B7325, 0xB56DCE73, + 0xD6B7DEF5, 0xDEF9E737, 0xE739DEF7, 0xDEF7DEF7, 0xD6B5CE75, 0xD6B3CEB5, 0xCE73D6B5, 0xCE73C631, 0xB5ADAD6B, + 0x9CE794A5, 0x8C638C63, 0x83E373A1, 0x5A1D3959, 0x3897521D, 0x8C25B56F, 0xC631C673, 0xD673D6B5, 0xD6F7DEF7, + 0xDEF7DEF7, 0xDEF7D6B5, 0xD6B5CE73, 0xD6B5D6B5, 0xCE73D6B5, 0xCE73C631, 0xBDEFAD6B, 0xA52994A5, 0x8423735F, + 0x5A5B4159, 0x39194159, 0x6ADF8C67, 0xAD2BB5AD, 0xBDEFC631, 0xCE73CE73, 0xD6B5D6B5, 0xD6B5DEF5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xCE73D6B5, 0xCE73D6B5, 0xCE73C631, 0xC631B5AD, 0xA4E98423, 0x6ADF4199, 0x30D738D7, 0x49D97321, + 0x8C639CE7, 0xA529A56B, 0xB56BB5EF, 0xBDEFCE31, 0xCE73CE75, 0xD6B3D6B5, 0xCEB5D6B5, 0xCE73D6B5, 0xD6B5D6B5, + 0xD6B5CE73, 0xCE73CE73, 0xC631BDEF, 0x946751DB, 0x30D72857, 0x311751DB, 0x6B1D83E1, 0x84238C63, 0x94A59CE7, + 0x9CE7AD6B, 0xAD6DBDAD, 0xBE31CE73, 0xCE73D673, 0xD6B5CE73, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5CE73, 0xCE73CE73, + 0xCE73BDEF, 0x83A530D7, 0x28573097, 0x30D53919, 0x4999521B, 0x525D5A5B, 0x629D6ADF, 0x6B1F7B63, 0x6B216ADF, + 0x7323B56F, 0xCE73CEB3, 0xCE73D675, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73CE73, 0xCE73C631, 0xAD2D629F, + 0x499B499B, 0x49993919, 0x30D73095, 0x28973097, 0x30D738D7, 0x31174119, 0x30972855, 0x20578BE5, 0xCE73CE73, + 0xCE75D6B3, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73CE73, 0xD6B5CE73, 0xBDEFB5AF, 0xA4E99CA9, 0x8C277BA1, + 0x62DF625D, 0x525D51DB, 0x49D9499B, 0x41994119, 0x419B5A1D, 0x7323B56D, 0xC633D6B3, 0xCE73D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5CE73, 0xCE73D6B5, 0xC633CE71, 0xBDF1BDEF, 0xB5ADAD6B, 0xA529A4E7, 0x94E79465, + 0x84258BE3, 0x7BE383E5, 0x8C25AD6B, 0xBDB1C671, 0xCE73CE73, 0xCE73D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xCE73CE73, 0xCE73CE73, 0xCE73C631, 0xC631B5AD, 0xBDEFAD6B, 0xAD6BAD6B, 0xA529AD6B, 0xAD6BAD6D, + 0xB5ADC62F, 0xC631CE73, 0xCE73CE75, 0xCE73D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5CE73, + 0xCE73D6B5, 0xCE73CE73, 0xC631C631, 0xC631BDEF, 0xBDEFB5AD, 0xBDEFBDEF, 0xB5ADBDEF, 0xC631C631, 0xCE73CE73, + 0xCE73D6B5, 0xCE73D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5CE73, 0xCE73D6B5, + 0xCE73C631, 0xCE73C631, 0xC631C631, 0xC631C631, 0xC631C631, 0xCE73CE73, 0xCE73CE73, 0xCE73D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73CE73, 0xD6B5CE73, 0xCE73CE73, + 0xCE73CE73, 0xCE73CE73, 0xCE73CE73, 0xCE73CE73, 0xCE73CE73, 0xD6B5CE73, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73CE73, 0xCE73CE73, 0xD6B5CE73, 0xCE73CE73, + 0xCE73CE73, 0xD6B5CE73, 0xCE73D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xCE73CE73, 0xCE73D6B5, 0xCE73CE73, 0xCE73CE73, 0xCE73D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, + 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, 0xD6B5D6B5, +}; + +static u32 D_86403570[] = { + 0x00000000, 0x00001111, 0x11110000, 0x00000000, 0x00000000, 0x012579AA, 0xAA975210, 0x00000000, 0x00000001, + 0x48BEEFFF, 0xFFFEEB84, 0x10000000, 0x00000038, 0xCEFFFFFF, 0xFFFFFFEC, 0x83000000, 0x000005AE, 0xFFFFFFFF, + 0xFFFFFFFF, 0xEA500000, 0x00005CFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFC50000, 0x0004BFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFC4000, 0x002AFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFA200, 0x017EFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE710, + 0x02BFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFB20, 0x05EFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE50, 0x18FFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF81, 0x19FFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF91, 0x1AFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFA1, 0x1AFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFA1, 0x19FFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFF91, 0x18FFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF81, 0x05EFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE50, + 0x02BFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFB30, 0x017EFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE710, 0x002AFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFA200, 0x0005CFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFC5000, 0x00016CFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFC61000, 0x000015BE, 0xFFFFFFFF, 0xFFFFFFFF, 0xEB510000, 0x00000038, 0xDEFFFFFF, 0xFFFFFFFD, + 0x83000000, 0x00000001, 0x48CEEFFF, 0xFFFFEC84, 0x10000000, 0x00000000, 0x012579DF, 0xFDA85210, 0x00000000, + 0x00000000, 0x0000127E, 0xE7210000, 0x00000000, 0x00000000, 0x0000004E, 0xD4000000, 0x00000000, 0x00000000, + 0x0000003C, 0xA2000000, 0x00000000, 0x00000000, 0x00000018, 0x71000000, 0x00000000, 0x00000000, 0x00000003, + 0x20000000, 0x00000000, +}; + +static u32 D_86403770[] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00444444, + 0x44444444, 0x44444444, 0x44444300, 0x00EFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFD00, 0x00EFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFD00, 0x00EFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFD00, 0x00FFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFD00, 0x00788888, 0x88888888, 0x8888EFFF, 0xFFFFF900, 0x00000000, 0x00000000, 0x0009FFFF, 0xFFFF9000, + 0x00000000, 0x00000000, 0x00AFFFFF, 0xFFF80000, 0x00000000, 0x00000000, 0x1BFFFFFF, 0xFF700000, 0x00000000, + 0x00000001, 0xCFFFFFFF, 0xF6000000, 0x00000000, 0x0000002C, 0xFFFFFFFF, 0x50000000, 0x00000000, 0x000002DF, + 0xFFFFFFF5, 0x00000000, 0x00000000, 0x00003EFF, 0xFFFFFE40, 0x00000000, 0x00000000, 0x0004EFFF, 0xFFFFE300, + 0x00000000, 0x00000000, 0x004EFFFF, 0xFFFD3000, 0x00000000, 0x00000000, 0x05FFFFFF, 0xFFD20000, 0x00000000, + 0x00000000, 0x6FFFFFFF, 0xFC100000, 0x00000000, 0x00000007, 0xFFFFFFFF, 0xB1000000, 0x00000000, 0x0000008F, + 0xFFFFFFFB, 0x10000000, 0x00000000, 0x000008FF, 0xFFFFFFA0, 0x00000000, 0x00000000, 0x00009FFF, 0xFFFFF900, + 0x00000000, 0x00000000, 0x000AFFFF, 0xFFFF8000, 0x00000000, 0x00000000, 0x01BFFFFF, 0xFFF80000, 0x00000000, + 0x00000000, 0x06FFFFFF, 0xFFFDDDDD, 0xDDDDDDDD, 0xDDDDDB00, 0x06FFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00, + 0x06FFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFD00, 0x06FFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFE00, 0x05DDDDDD, + 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDB00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static Vtx D_86403B70[] = { + VTX(-16, 32, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF), + VTX(16, 32, 0, 1024, 0, 0xFF, 0xFF, 0xFF, 0xFF), + VTX(-16, 0, 0, 0, 1024, 0xFF, 0xFF, 0xFF, 0xFF), + VTX(16, 0, 0, 1024, 1024, 0xFF, 0xFF, 0xFF, 0xFF), +}; + +Gfx D_86403BB0[] = { + gsDPPipeSync(), + gsSPClearGeometryMode(G_LIGHTING), + gsDPSetTextureLUT(G_TT_NONE), + gsDPSetTextureLOD(G_TL_TILE), + gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), + gsDPSetCombineLERP(0, 0, 0, TEXEL0, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), + gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_TEX_EDGE2), + gsDPLoadTextureTile(D_86402D70, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 0, 0, 0, 31, 31, 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), + gsDPLoadMultiTile_4b(D_86403570, 0x0100, 1, G_IM_FMT_I, 32, 0, 0, 0, 31, 31, 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), + gsSPVertex(D_86403B70, 4, 0), + gsSP2Triangles(0, 3, 1, 0, 0, 2, 3, 0), + gsSPEndDisplayList(), +}; + +static Vtx D_86403C70[] = { + VTX(-152, 676, 0, 0, -1146, 0xFF, 0x96, 0x96, 0x40), VTX(-158, 594, 0, 0, -655, 0xFF, 0x96, 0x96, 0x40), + VTX(12, 583, 0, 1024, -655, 0xFF, 0x96, 0x96, 0x40), VTX(62, 683, 0, 1024, -1146, 0xFF, 0x96, 0x96, 0x40), + VTX(-181, 553, 0, 0, -163, 0xFF, 0x96, 0x96, 0x53), VTX(-30, 527, 0, 1024, -163, 0xFF, 0x96, 0x96, 0x53), + VTX(-204, 520, 0, 0, 327, 0xFF, 0x96, 0x96, 0x53), VTX(-40, 498, 0, 1024, 327, 0xFF, 0x96, 0x96, 0x53), + VTX(-194, 470, 0, 0, 819, 0xFF, 0x96, 0xFF, 0x66), VTX(-72, 478, 0, 1024, 819, 0xFF, 0x96, 0xFF, 0x66), + VTX(-183, 404, 0, 0, 1310, 0xFF, 0x96, 0xFF, 0x66), VTX(-70, 432, 0, 1024, 1310, 0xFF, 0x96, 0xFF, 0x66), + VTX(-175, 377, 0, 0, 1802, 0xFF, 0x96, 0xFF, 0x79), VTX(-69, 393, 0, 1024, 1802, 0xFF, 0x96, 0xFF, 0x79), + VTX(-178, 342, 0, 0, 2293, 0xFF, 0x96, 0xFF, 0x79), VTX(-48, 375, 0, 1024, 2293, 0xFF, 0x96, 0xFF, 0x79), + VTX(-135, 324, 0, 0, 2785, 0x96, 0x96, 0xFF, 0x8C), VTX(-46, 349, 0, 1024, 2785, 0x96, 0x96, 0xFF, 0x8C), + VTX(-112, 312, 0, 0, 3276, 0x96, 0x96, 0xFF, 0x8C), VTX(-24, 329, 0, 1024, 3276, 0x96, 0x96, 0xFF, 0x8C), + VTX(-91, 275, 0, 0, 3768, 0x96, 0x96, 0xFF, 0x9F), VTX(-8, 298, 0, 1024, 3768, 0x96, 0x96, 0xFF, 0x9F), + VTX(-83, 245, 0, 0, 4259, 0x96, 0x96, 0xFF, 0x9F), VTX(-1, 256, 0, 1024, 4259, 0x96, 0x96, 0xFF, 0x9F), + VTX(-73, 221, 0, 0, 4751, 0x96, 0xFF, 0x96, 0xB2), VTX(-11, 218, 0, 1024, 4751, 0x96, 0xFF, 0x96, 0xB2), + VTX(-69, 177, 0, 0, 5242, 0x96, 0xFF, 0x96, 0xB2), VTX(4, 177, 0, 1024, 5242, 0x96, 0xFF, 0x96, 0xB2), + VTX(-51, 144, 0, 0, 5734, 0x96, 0xFF, 0x96, 0xC5), VTX(-5, 134, 0, 1024, 5734, 0x96, 0xFF, 0x96, 0xC5), + VTX(-64, 113, 0, 0, 6225, 0x96, 0xFF, 0x96, 0xC5), VTX(-21, 102, 0, 1024, 6225, 0x96, 0xFF, 0x96, 0xC5), +}; + +static Vtx D_86403E70[] = { + VTX(-64, 113, 0, 0, 6225, 0xFF, 0xFF, 0x96, 0xD8), VTX(-69, 94, 0, 0, 6717, 0xFF, 0xFF, 0x96, 0xD8), + VTX(-20, 86, 0, 1024, 6717, 0xFF, 0xFF, 0x96, 0xD8), VTX(-21, 102, 0, 1024, 6225, 0xFF, 0xFF, 0x96, 0xD8), + VTX(-65, 55, 0, 0, 7208, 0xFF, 0xFF, 0x96, 0xEB), VTX(-22, 53, 0, 1024, 7208, 0xFF, 0xFF, 0x96, 0xEB), + VTX(-46, 34, 0, 0, 7700, 0xFF, 0xFF, 0x96, 0xEB), VTX(-15, 34, 0, 1024, 7700, 0xFF, 0xFF, 0x96, 0xEB), + VTX(-32, 18, 0, 0, 8192, 0xFF, 0xFF, 0xFF, 0xFE), VTX(-3, 18, 0, 1024, 8192, 0xFF, 0xFF, 0xFF, 0xFE), + VTX(-2, 0, 0, 0, 8683, 0xFF, 0xFF, 0xFF, 0xFE), VTX(4, 0, 0, 1024, 8683, 0xFF, 0xFF, 0xFF, 0xFE), +}; + +Gfx D_86403F30[] = { + gsDPPipeSync(), + gsDPSetTextureLUT(G_TT_NONE), + gsSPClearGeometryMode(G_LIGHTING), + gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_PASS2), + gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_CLD_SURF2), + gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), + gsDPLoadTextureBlock_4b(D_86403770, G_IM_FMT_I, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, + 6, G_TX_NOLOD, G_TX_NOLOD), + gsSPEndDisplayList(), +}; + +Gfx D_86403FA0[] = { + gsDPPipeSync(), + gsSPVertex(D_86403C70, 32, 0), + gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), + gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0), + gsSP2Triangles(4, 6, 7, 0, 4, 7, 5, 0), + gsSP2Triangles(6, 8, 9, 0, 6, 9, 7, 0), + gsSP2Triangles(8, 10, 11, 0, 8, 11, 9, 0), + gsSP2Triangles(10, 12, 13, 0, 10, 13, 11, 0), + gsSP2Triangles(12, 14, 15, 0, 12, 15, 13, 0), + gsSP2Triangles(14, 16, 17, 0, 14, 17, 15, 0), + gsSP2Triangles(16, 18, 19, 0, 16, 19, 17, 0), + gsSP2Triangles(18, 20, 21, 0, 18, 21, 19, 0), + gsSP2Triangles(20, 22, 23, 0, 20, 23, 21, 0), + gsSP2Triangles(22, 24, 25, 0, 22, 25, 23, 0), + gsSP2Triangles(24, 26, 27, 0, 24, 27, 25, 0), + gsSP2Triangles(26, 28, 29, 0, 26, 29, 27, 0), + gsSP2Triangles(28, 30, 31, 0, 28, 31, 29, 0), + gsSPVertex(D_86403E70, 12, 0), + gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), + gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0), + gsSP2Triangles(4, 6, 7, 0, 4, 7, 5, 0), + gsSP2Triangles(6, 8, 9, 0, 6, 9, 7, 0), + gsSP2Triangles(8, 10, 11, 0, 8, 11, 9, 0), + gsSPEndDisplayList(), +}; + +s8 func_864026D0(u8 arg0, s32 arg1) { + u8 i; + u16 var_a0; + u16 var_a1; + u16 temp_a1; + + for (var_a0 = 0, i = 0; i < 8; i++) { + var_a0 += D_864029F0[arg1][arg0][i]; + } + + temp_a1 = func_87B00050(var_a0); + + for (var_a1 = 0, i = 0; i < 7; i++) { + if ((temp_a1 >= var_a1) && (temp_a1 < (D_864029F0[arg1][arg0][i] + var_a1))) { + return i - 3; + } + var_a1 += D_864029F0[arg1][arg0][i]; + } + + return 0x64; +} diff --git a/src/fragments/2/fragment2.c b/src/fragments/2/fragment2.c index 5020f7ac..6e0cb319 100644 --- a/src/fragments/2/fragment2.c +++ b/src/fragments/2/fragment2.c @@ -253,7 +253,7 @@ void func_8780118C(s16 arg0, s16 arg1, s16 arg2, s16 arg3) { gDPFillRectangle(gDisplayListHead++, arg0, arg1, arg0 + arg2, arg1 + arg3); } -void func_87801290(s32* arg0, s32* arg1, s8* arg2, s8* arg3, s32 arg4) { +void func_87801290(s32* arg0, s32* arg1, char* arg2, char* arg3, s32 arg4) { s32 var_a1; s32 var_t2; s8 sp38[0x100]; diff --git a/src/fragments/2/fragment2.h b/src/fragments/2/fragment2.h index a51e3838..76432ccc 100644 --- a/src/fragments/2/fragment2.h +++ b/src/fragments/2/fragment2.h @@ -35,7 +35,7 @@ void func_8780024C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); void func_878009BC(s32 arg0, s32 arg1, s32 arg2, s32 arg3); void func_878010C8(s16 arg0); void func_8780118C(s16 arg0, s16 arg1, s16 arg2, s16 arg3); -void func_87801290(s32* arg0, s32* arg1, s8* arg2, s8* arg3, s32 arg4); +void func_87801290(s32* arg0, s32* arg1, char* arg2, char* arg3, s32 arg4); s32 func_878013D4(UNUSED unk_D_800AC870* arg0, char* arg1); void func_87801400(s32 arg0, s16 arg1, s16 arg2, f32 arg3, f32 arg4); void func_87801644(s32 arg0, s16 arg1, s16 arg2, f32 arg3); diff --git a/src/fragments/5/fragment5.h b/src/fragments/5/fragment5.h new file mode 100644 index 00000000..c9c24e3d --- /dev/null +++ b/src/fragments/5/fragment5.h @@ -0,0 +1,18 @@ +#ifndef _FRAGMENT5_H_ +#define _FRAGMENT5_H_ + +#include "global.h" + +extern unk_D_800AC870* D_87B000E0; +extern unk_D_86002F30* D_87B000E4; +extern unk_D_86002F34* D_87B000E8; +extern unk_D_86002F34_00C* D_87B000EC; +extern s16 D_87B000F0; +extern s16 D_87B000F2; +extern s16 D_87B000F4; + +void func_87B00020(void); +s32 func_87B00050(u32); + + +#endif // _FRAGMENT5_H_ diff --git a/src/fragments/6/fragment6.c b/src/fragments/6/fragment6.c index 238d1190..d2dba4de 100644 --- a/src/fragments/6/fragment6.c +++ b/src/fragments/6/fragment6.c @@ -519,9 +519,11 @@ void func_86000478(void) { D_86002F38->unk_034 = 100.0f; D_86002F38->unk_038 = 12800.0f; D_86002F38->unk_02C = 10.0f; - D_86002F38->unk_0B4 = 0.0f; - D_86002F38->unk_0B8 = 70.0f; - D_86002F38->unk_0BC = 0.0f; + + D_86002F38->unk_0B4.x = 0.0f; + D_86002F38->unk_0B4.y = 70.0f; + D_86002F38->unk_0B4.z = 0.0f; + func_80010354(&D_86002F38->unk_0B4, &D_86002F38->unk_0A8, D_86002F40, D_86002F3C, D_86002F3E); } @@ -720,8 +722,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_000.unk_0B0) / 510.0f; - guTranslate(&sp100, D_86003B60->unk_000.unk_0AC, 0.0f, 0.0f); + temp_f20 = (410.0f - D_86003B60->unk_000.unk_0AC.y) / 510.0f; + guTranslate(&sp100, D_86003B60->unk_000.unk_0AC.x, 0.0f, 0.0f); guScale(&spC0, temp_f20, temp_f20, temp_f20); guMtxCatL(&spC0, &sp100, var_s1); diff --git a/src/fragments/7/fragment7.c b/src/fragments/7/fragment7.c index f9ef13c1..80ce208e 100644 --- a/src/fragments/7/fragment7.c +++ b/src/fragments/7/fragment7.c @@ -541,12 +541,14 @@ void func_86100B48(void) { D_86105488->unk_034 = 100.0f; D_86105488->unk_038 = 12800.0f; D_86105488->unk_02C = 30.0f; - D_86105488->unk_0B4 = 0.0f; - D_86105488->unk_0B8 = 371.2f; - D_86105488->unk_0BC = -732.6f; - D_86105488->unk_0A8 = 0.0f; - D_86105488->unk_0AC = 990.0f; - D_86105488->unk_0B0 = 2659.0f; + + D_86105488->unk_0B4.x = 0.0f; + D_86105488->unk_0B4.y = 371.2f; + D_86105488->unk_0B4.z = -732.6f; + + D_86105488->unk_0A8.x = 0.0f; + D_86105488->unk_0A8.y = 990.0f; + D_86105488->unk_0A8.z = 2659.0f; } void func_86100C28(void) { diff --git a/src/fragments/8/fragment8.c b/src/fragments/8/fragment8.c index d9fab33d..d3a1b343 100644 --- a/src/fragments/8/fragment8.c +++ b/src/fragments/8/fragment8.c @@ -250,9 +250,11 @@ void func_86200528(void) { D_86203E3C->unk_034 = 50.0f; D_86203E3C->unk_038 = 6400.0f; D_86203E3C->unk_02C = 30.0f; - D_86203E3C->unk_0B4 = 0.0f; - D_86203E3C->unk_0B8 = 0.0f; - D_86203E3C->unk_0BC = 5.0f; + + D_86203E3C->unk_0B4.x = 0.0f; + D_86203E3C->unk_0B4.y = 0.0f; + D_86203E3C->unk_0B4.z = 5.0f; + func_80010354(&D_86203E3C->unk_0B4, &D_86203E3C->unk_0A8, D_86203E44, D_86203E40, D_86203E42); } diff --git a/src/fragments/9/fragment9.c b/src/fragments/9/fragment9.c index cb427af6..498d7934 100644 --- a/src/fragments/9/fragment9.c +++ b/src/fragments/9/fragment9.c @@ -116,9 +116,10 @@ void func_86300154(void) { D_86301718->unk_034 = 100.0f; D_86301718->unk_038 = 12800.0f; D_86301718->unk_02C = 30.0f; - D_86301718->unk_0B4 = 0.0f; - D_86301718->unk_0B8 = 70.0f; - D_86301718->unk_0BC = 0.0f; + + D_86301718->unk_0B4.x = 0.0f; + D_86301718->unk_0B4.y = 70.0f; + D_86301718->unk_0B4.z = 0.0f; func_80010354(&D_86301718->unk_0B4, &D_86301718->unk_0A8, D_86301720, D_8630171C, D_8630171E); } diff --git a/yamls/us/rom.yaml b/yamls/us/rom.yaml index 8c3c1c36..10e3d335 100644 --- a/yamls/us/rom.yaml +++ b/yamls/us/rom.yaml @@ -722,9 +722,12 @@ subsegments: - [0x134680, textbin, fragments/10/fragment10_header] - [0x1346A0, c, fragments/10/fragment10] - - [0x136E40, data, fragments/10/fragment10_data] + - [0x136D50, c, fragments/10/fragment10_1] + - [0x136E40, .data, fragments/10/fragment10] + - [0x137070, .data, fragments/10/fragment10_1] + - [0x1386E0, .rodata, fragments/10/fragment10] - - {vram: 0x86404070, type: bss, name: unk_frag10_bss} + - {vram: 0x86404070, type: .bss, name: fragments/10/fragment10} - name: fragment10_relocs type: code