diff --git a/include/global.h b/include/global.h index 4fa71cb3..9cdc82a2 100644 --- a/include/global.h +++ b/include/global.h @@ -41,6 +41,12 @@ typedef union unk_D_86002F58_004_000_010_02C { u32 raw; } unk_D_86002F58_004_000_010_02C; // size = 0x4 +typedef struct unk_D_86002F58_004_000_010_024 { + /* 0x00 */ u16 unk_00; + /* 0x02 */ char unk02[0x6]; + /* 0x08 */ struct unk_D_86002F58_004_000_004* unk_08; +} unk_D_86002F58_004_000_010_024; // size >= 0xC + typedef struct unk_D_86002F58_004_000_010 { /* 0x00 */ u8 unk_00; /* 0x01 */ u8 unk_01; @@ -50,7 +56,7 @@ typedef struct unk_D_86002F58_004_000_010 { /* 0x18 */ s32 unk_18; /* 0x1C */ s32 unk_1C; /* 0x20 */ s32 unk_20; - /* 0x24 */ u16* unk_24; + /* 0x24 */ unk_D_86002F58_004_000_010_024* unk_24; /* 0x28 */ s32 unk_28; /* 0x2C */ unk_D_86002F58_004_000_010_02C unk_2C; /* 0x30 */ OSMesgQueue unk_30; @@ -117,6 +123,7 @@ typedef struct unk_D_86002F58_004_000_054 { typedef struct unk_D_86002F58_004_000_0A8 { /* 0x00 */ u16 unk_00; + /* 0x02 */ u8 unk_02; /* 0x04 */ Vec3f unk_04; } unk_D_86002F58_004_000_0A8; // size = 0x10 @@ -160,16 +167,17 @@ typedef struct unk_D_86002F34_000_014 { /* 0x04 */ u8* unk_04; } unk_D_86002F34_000_014; // size >= 0x8 +typedef s32 (*func_D_86002F34_000_010)(s32, struct unk_D_86002F34_000*); + typedef struct unk_D_86002F34_000 { /* 0x00 */ u8 unk_00; /* 0x01 */ u8 unk_01; /* 0x02 */ u8 unk_02; /* 0x03 */ u8 unk_03; - /* 0x04 */ char pad04[0x2]; - /* 0x06 */ s16 unk_06; + /* 0x04 */ struct unk_D_86002F34_000* unk_04; /* 0x08 */ struct unk_D_86002F34_000* unk_08; /* 0x0C */ struct unk_D_86002F34_00C* unk_0C; - /* 0x10 */ s32 (*unk_10)(s32, struct unk_D_86002F34_000*); + /* 0x10 */ func_D_86002F34_000_010 unk_10; /* 0x14 */ unk_D_86002F34_000_014* unk_14; } unk_D_86002F34_000; // size = 0x18 @@ -235,7 +243,8 @@ typedef struct unk_D_86002F34_00C { /* 0x40 */ unk_D_86002F34_00C_040 unk_40; /* 0x60 */ unk_D_86002F34_00C_060 unk_60; /* 0xCC */ unk_D_86002F34_00C_0CC unk_CC; -} unk_D_86002F34_00C; // size >= 0xEC + /* 0xEC */ char unkEC[0x4]; +} unk_D_86002F34_00C; // size = 0xF0 typedef struct unk_D_86002F34_alt1 { /* 0x00 */ unk_D_86002F34_000 unk_00; @@ -249,7 +258,7 @@ typedef struct unk_D_86002F34_alt1 { typedef struct unk_D_86002F34_alt2 { /* 0x00 */ unk_D_86002F34_000 unk_00; - /* 0x18 */ u32 unk_18; + /* 0x18 */ unk_D_86002F34_000* unk_18; } unk_D_86002F34_alt2; // size >= 0x1C typedef struct unk_D_86002F34_alt3 { @@ -270,7 +279,7 @@ typedef struct unk_D_86002F34_alt5 { /* 0x00 */ unk_D_86002F34_000 unk_00; /* 0x18 */ Vec3f unk_18; /* 0x24 */ Vec3s unk_24; -} unk_D_86002F34_alt5; // size >= 0x2C +} unk_D_86002F34_alt5; // size = 0x2C typedef struct unk_D_86002F34_alt6 { /* 0x00 */ unk_D_86002F34_000 unk_00; @@ -280,26 +289,26 @@ typedef struct unk_D_86002F34_alt6 { /* 0x30 */ u8 unk_30; /* 0x31 */ u8 unk_31; /* 0x32 */ s16 unk_32; -} unk_D_86002F34_alt6; // size >= 0x58 +} unk_D_86002F34_alt6; // size = 0x34 typedef struct unk_D_86002F34_alt7 { /* 0x00 */ unk_D_86002F34_000 unk_00; /* 0x18 */ Gfx* unk_18; /* 0x1C */ s16 unk_1C; -} unk_D_86002F34_alt7; // size >= 0x20 +} unk_D_86002F34_alt7; // size = 0x20 typedef struct unk_D_86002F34_alt8 { /* 0x00 */ unk_D_86002F34_000 unk_00; /* 0x18 */ Gfx* unk_18; /* 0x1C */ MtxF unk_1C; -} unk_D_86002F34_alt8; // size >= 0x5C +} unk_D_86002F34_alt8; // size = 0x5C typedef struct unk_D_86002F34_alt9 { /* 0x00 */ unk_D_86002F34_000 unk_00; /* 0x18 */ Gfx* unk_18; /* 0x1C */ Vec3f unk_1C; /* 0x28 */ f32 unk_28; -} unk_D_86002F34_alt9; // size >= 0x2C +} unk_D_86002F34_alt9; // size = 0x2C typedef struct unk_D_86002F34_alt10 { /* 0x00 */ unk_D_86002F34_000 unk_00; @@ -331,7 +340,80 @@ typedef struct unk_D_86002F34_alt12 { /* 0x1A */ s16 unk_1A; /* 0x1C */ s16 unk_1C; /* 0x1E */ s16 unk_1E; -} unk_D_86002F34_alt12; // size >= 0x20 +} unk_D_86002F34_alt12; // size = 0x20 + +typedef struct unk_D_86002F34_alt13 { + /* 0x00 */ unk_D_86002F34_000 unk_00; + /* 0x18 */ s16 unk_18; +} unk_D_86002F34_alt13; // size = 0x1C + +typedef struct unk_D_86002F34_alt14 { + /* 0x00 */ unk_D_86002F34_000 unk_00; +} unk_D_86002F34_alt14; // size = 0x18 + +typedef struct unk_D_86002F34_alt15 { + /* 0x00 */ unk_D_86002F34_000 unk_00; +} unk_D_86002F34_alt15; // size = 0x18 + +typedef struct unk_D_86002F34_alt16 { + /* 0x00 */ unk_D_86002F34_000 unk_00; + /* 0x18 */ u32 unk_18; +} unk_D_86002F34_alt16; // size = 0x1C + +typedef struct unk_D_86002F34_alt17 { + /* 0x00 */ unk_D_86002F34_000 unk_00; +} unk_D_86002F34_alt17; // size = 0x18 + +typedef struct unk_D_86002F34_alt18 { + /* 0x00 */ unk_D_86002F34_000 unk_00; + /* 0x18 */ u8 r; + /* 0x19 */ u8 g; + /* 0x1A */ u8 b; + /* 0x1B */ u8 a; + /* 0x1C */ s16 unk_1C; + /* 0x1E */ s16 unk_1E; +} unk_D_86002F34_alt18; // size = 0x20 + +typedef struct unk_D_86002F34_alt19 { + /* 0x00 */ unk_D_86002F34_000 unk_00; + /* 0x18 */ u8 r; + /* 0x19 */ u8 g; + /* 0x1A */ u8 b; +} unk_D_86002F34_alt19; // size = 0x1C + +typedef struct unk_D_86002F34_alt20 { + /* 0x00 */ unk_D_86002F34_000 unk_00; + /* 0x18 */ s16 unk_18; + /* 0x1A */ s16 unk_1A; +} unk_D_86002F34_alt20; // size = 0x1C + +typedef struct unk_D_86002F34_alt21 { + /* 0x00 */ unk_D_86002F34_000 unk_00; + /* 0x18 */ s16 unk_18; + /* 0x1A */ s16 unk_1A; +} unk_D_86002F34_alt21; // size = 0x1C + +typedef struct unk_D_86002F34_alt22 { + /* 0x00 */ unk_D_86002F34_000 unk_00; + /* 0x18 */ Vec3f unk_18; +} unk_D_86002F34_alt22; // size = 0x24 + +typedef struct unk_D_86002F34_alt23 { + /* 0x00 */ unk_D_86002F34_000 unk_00; + /* 0x18 */ s16 unk_18; +} unk_D_86002F34_alt23; // size = 0x1C + +typedef struct unk_D_86002F34_alt24 { + /* 0x00 */ unk_D_86002F34_000 unk_00; + /* 0x18 */ s16 unk_18; + /* 0x1A */ s16 unk_1A; + /* 0x1C */ s16 unk_1C; + /* 0x1E */ s16 unk_1E; + /* 0x20 */ s16 unk_20; + /* 0x22 */ s16 unk_22; + /* 0x24 */ s32 unk_24; + /* 0x28 */ Color_RGBA8_u32 unk_28; +} unk_D_86002F34_alt24; // size = 0x2C typedef void* (*func_unk_D_800ABE10)(s32, s32); @@ -355,11 +437,12 @@ typedef struct unk_D_86002F34 { /* 0x00 */ unk_D_86002F34_000 unk_00; /* 0x18 */ unk_D_86002F34_018* unk_18; /* 0x1C */ unk_D_86002F34_01C* unk_1C; - /* 0x20 */ char unk20[0x4]; + /* 0x20 */ Vtx* unk_20; /* 0x24 */ u8 unk_24; /* 0x25 */ u8 unk_25; + /* 0x26 */ s16 unk_26; /* 0x28 */ func_unk_D_800ABE10 unk_28; -} unk_D_86002F34; // size >= 0x2C +} unk_D_86002F34; // size = 0x2C // Are unk_D_86002F30 and unk_D_800AC840 the same? typedef struct unk_D_86002F30 { diff --git a/include/sections.h b/include/sections.h index 30ebbf0b..68208f61 100644 --- a/include/sections.h +++ b/include/sections.h @@ -464,6 +464,8 @@ extern u8 common_menu1_ui_ROM_START[]; extern u8 common_menu1_ui_ROM_END[]; extern u8 common_menu2_ui_ROM_START[]; extern u8 common_menu2_ui_ROM_END[]; +extern u8 snap_mode_ui_ROM_START[]; +extern u8 snap_mode_ui_ROM_END[]; extern u8 area_select_ui_ROM_START[]; // 4D1330 extern u8 area_select_ui_ROM_END[]; // 4D1330 extern u8 menu_select_ui_ROM_START[]; // 4EB0C0 @@ -518,6 +520,10 @@ extern u8 badge_ui_ROM_START[]; extern u8 badge_ui_ROM_END[]; extern u8 gym_leader_castle_ui_ROM_START[]; extern u8 gym_leader_castle_ui_ROM_END[]; +extern u8 _70D3A0_ROM_START[]; +extern u8 _70D3A0_ROM_END[]; +extern u8 D_70110[]; +extern u8 D_70290[]; extern u8 D_124570[]; diff --git a/include/variables.h b/include/variables.h index 4afe63b5..e2067780 100644 --- a/include/variables.h +++ b/include/variables.h @@ -199,5 +199,10 @@ extern u32 D_304F120[]; extern s32 D_800FC820; extern u8* D_800FF9C0; +extern s32 D_80075BCC[]; + +typedef struct unk_70D3A0 { + /* 0x00 */ char unk00[0x10]; +} unk_70D3A0; // size = 0x10 #endif diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index 184d60f1..d3d0828c 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -332,3 +332,12 @@ D_04008000 = 0x04008000; D_04009000 = 0x04009000; D_0400A000 = 0x0400A000; D_0400B000 = 0x0400B000; +D_8790604A = 0x8790604A; // size:0x2 +D_87906050 = 0x87906050; +D_80075BCC = 0x80075BCC; +D_80075E40 = 0x80075E40; +D_80075950 = 0x80075950; // size:0x1C +D_8007596C = 0x8007596C; +D_8690B360 = 0x8690B360; // size:0x18 +D_8690B390 = 0x8690B390; // size:0x24 +D_8690B5D0 = 0x8690B5D0; // size:0x24 diff --git a/src/11BA0.c b/src/11BA0.c index ab46519d..57b0e28e 100644 --- a/src/11BA0.c +++ b/src/11BA0.c @@ -1,7 +1,9 @@ #include "global.h" #include "11BA0.h" +#include "F420.h" +#include "util.h" -void func_80010FA0(unk_D_86002F58_004_000_000* arg0, u8 arg1) { +void func_80010FA0(unk_D_86002F34_000* arg0, u8 arg1) { if (arg0 != NULL) { arg0->unk_00 = arg1; arg0->unk_01 = 0x11; @@ -10,16 +12,28 @@ void func_80010FA0(unk_D_86002F58_004_000_000* arg0, u8 arg1) { arg0->unk_04 = arg0; arg0->unk_08 = arg0; arg0->unk_0C = NULL; - arg0->unk_10 = 0; - arg0->unk_14 = 0; + arg0->unk_10 = NULL; + arg0->unk_14 = NULL; } } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80010FDC.s") +void func_80010FDC(unk_D_86002F34_000* arg0, func_D_86002F34_000_010 arg1, unk_D_86002F34_000_014* arg2) { + if (arg1 != NULL) { + arg1 = Util_ConvertAddrToVirtAddr(arg1); + } -unk_D_86002F58_004_000_000* func_8001103C(MainPoolState* arg0, void* arg1) { - if (arg0 != 0) { - arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F58_004_000_000), 4); + if (arg0 != NULL) { + arg0->unk_14 = arg2; + arg0->unk_10 = arg1; + if (arg1 != NULL) { + arg1(0, arg0); + } + } +} + +unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, void* arg1) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_000), 4); } if (arg1 != NULL) { @@ -29,43 +43,288 @@ unk_D_86002F58_004_000_000* func_8001103C(MainPoolState* arg0, void* arg1) { return arg1; } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011088.s") +unk_D_86002F34_alt2* func_80011088(MainPoolState* arg0, unk_D_86002F34_alt2* arg1, unk_D_86002F34_000* arg2) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt2), 4); + } + + if (arg1 != NULL) { + arg1->unk_18 = arg2; + func_80010FA0(arg1, 1); + } + + return arg1; +} + +unk_D_86002F34_00C* func_800110E0(MemoryBlock* arg0, unk_D_86002F34_00C* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_00C), 4); + } + + if (arg1 != NULL) { + func_80011DAC(arg1, arg2, arg3, arg4, arg5); + func_80011E68(arg1, 30.0f, 100.0f, 12800.0f); + func_80011EB4(arg1, 0.0f, 512.0f, 4096.0f, 0.0f, 0.0f, 0.0f, 0); + func_80011FC8(arg1, 2, 0, 0, 0, 0); + func_80010FA0(arg1, 2); + } + return arg1; +} + +unk_D_86002F34_alt13* func_800111A4(MemoryBlock* arg0, unk_D_86002F34_alt13* arg1, s16 arg2) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt13), 4); + } + + if (arg1 != NULL) { + arg1->unk_18 = arg2; + func_80010FA0(arg1, 3); + } + + return arg1; +} + +unk_D_86002F34_alt1* func_800111FC(MemoryBlock* arg0, unk_D_86002F34_alt1* arg1, s16 arg2) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt1), 4); + } + + if (arg1 != NULL) { + arg1->unk_18 = arg2; + arg1->unk_1A = 0; + func_80010FA0(arg1, 4); + } + + return arg1; +} + +unk_D_86002F34_alt14* func_80011258(MainPoolState* arg0, unk_D_86002F34_alt14* arg1, s16 arg2) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt14), 4); + } + + if (arg1 != NULL) { + func_80010FA0(arg1, 5); + arg1->unk_00.unk_02 |= arg2 & 3; + } + + return arg1; +} + +unk_D_86002F34_alt15* func_800112BC(MainPoolState* arg0, unk_D_86002F34_alt15* arg1, s16 arg2) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt15), 4); + } + + if (arg1 != NULL) { + func_80010FA0(arg1, 6); + arg1->unk_00.unk_02 |= arg2 & 3; + } + + return arg1; +} + +unk_D_86002F34_alt16* func_80011320(MainPoolState* arg0, unk_D_86002F34_alt16* arg1, u8 arg2, u8 arg3, u8 arg4) { + u32 temp_v0; + + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt16), 4); + } + + if (arg1 != NULL) { + temp_v0 = ((arg2 >> 3) << 0xB) | ((arg3 >> 3) << 6) | ((arg4 >> 3) << 1) | 1; + arg1->unk_18 = (temp_v0 << 0x10) | temp_v0; + func_80010FA0(arg1, 7); + } + return arg1; +} + +unk_D_86002F34_alt17* func_800113AC(MainPoolState* arg0, unk_D_86002F34_alt17* arg1) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt17), 4); + } + + if (arg1 != NULL) { + func_80010FA0(arg1, 8); + } + + return arg1; +} + +unk_D_8690A610* func_800113F8(s32 arg0, unk_D_8690A610* arg1, s16 arg2, s16 arg3, u8 r, u8 g, u8 b, u8 a) { + if (arg0 != 0) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_8690A610), 4); + } + + if (arg1 != NULL) { + arg1->unk_18.unk_00 = arg2; + arg1->unk_18.unk_02 = arg3; + arg1->unk_18.unk_04.rgba = (r << 0x18) | (g << 0x10) | (b << 8) | a; + func_80010FA0(arg1, 0xA); + } + + return arg1; +} + +unk_D_86002F34_alt18* func_80011484(MainPoolState* arg0, unk_D_86002F34_alt18* arg1, s16 arg2, s16 arg3, u8 r, u8 g, + u8 b, u8 a) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt18), 4); + } + + if (arg1 != NULL) { + arg1->r = r; + arg1->g = g; + arg1->b = b; + arg1->a = a; + arg1->unk_1C = arg2; + arg1->unk_1E = arg3; + func_80010FA0(arg1, 0xB); + } + + return arg1; +} + +unk_D_86002F34_alt19* func_80011504(MainPoolState* arg0, unk_D_86002F34_alt19* arg1, u8 r, u8 g, u8 b) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt19), 4); + } + + if (arg1 != NULL) { + arg1->r = r; + arg1->g = g; + arg1->b = b; + func_80010FA0(arg1, 0xD); + } + + return arg1; +} + +unk_D_86002F34* func_8001156C(MainPoolState* arg0, unk_D_86002F34* arg1, s32 arg2, unk_D_86002F34_018* arg3, s32 arg4, + unk_D_86002F34_01C* arg5, s32 arg6, Vtx* arg7) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34), 4); + } + + if (arg1 != NULL) { + arg1->unk_18 = arg3; + arg1->unk_1C = arg5; + arg1->unk_20 = arg7; + arg1->unk_24 = arg2; + arg1->unk_25 = arg4; + arg1->unk_26 = arg6; + arg1->unk_28 = NULL; + func_80010FA0(arg1, 0xE); + } + + return arg1; +} + +unk_D_86002F34_alt12* func_800115F0(MainPoolState* arg0, unk_D_86002F34_alt12* arg1, s16 arg2, s16 arg3, s16 arg4, + s16 arg5) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt12), 4); + } + + if (arg1 != NULL) { + arg1->unk_18 = arg2; + arg1->unk_1A = arg3; + arg1->unk_1C = arg4; + arg1->unk_1E = arg5; + func_80010FA0(arg1, 0xF); + } + + return arg1; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800110E0.s") +unk_D_86002F34_alt20* func_80011660(MainPoolState* arg0, unk_D_86002F34_alt20* arg1, s16 arg2, s16 arg3) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt20), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800111A4.s") + if (arg1 != NULL) { + arg1->unk_18 = arg2; + arg1->unk_1A = arg3; + func_80010FA0(arg1, 0x10); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800111FC.s") + return arg1; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011258.s") +unk_D_86002F34_alt21* func_800116C0(MainPoolState* arg0, unk_D_86002F34_alt21* arg1, s16 arg2, s16 arg3) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt21), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800112BC.s") + if (arg1 != NULL) { + arg1->unk_18 = arg2; + arg1->unk_1A = arg3; + func_80010FA0(arg1, 0x11); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011320.s") + return arg1; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800113AC.s") +unk_D_86002F34_alt5* func_80011720(MainPoolState* arg0, unk_D_86002F34_alt5* arg1, Vec3f* arg2, Vec3s* arg3) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt5), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800113F8.s") + if (arg1 != NULL) { + arg1->unk_18 = *arg2; + arg1->unk_24 = *arg3; + func_80010FA0(arg1, 0x12); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011484.s") + return arg1; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011504.s") +unk_D_86002F34_alt22* func_800117A8(MainPoolState* arg0, unk_D_86002F34_alt22* arg1, Vec3f* arg2) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt22), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_8001156C.s") + if (arg1 != NULL) { + arg1->unk_18 = *arg2; + func_80010FA0(arg1, 0x13); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800115F0.s") + return arg1; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011660.s") +unk_D_86002F34_alt6* func_80011814(MainPoolState* arg0, unk_D_86002F34_alt6* arg1, s16 arg2, s16 arg3, s16 arg4, + Vec3s* arg5, Vec3s* arg6, Vec3f* arg7) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt6), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800116C0.s") + if (arg1 != NULL) { + arg1->unk_18 = *arg5; + arg1->unk_1E = *arg6; + arg1->unk_24 = *arg7; + arg1->unk_30 = arg2; + arg1->unk_31 = arg3; + arg1->unk_32 = arg4; + func_80010FA0(arg1, 0x14); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011720.s") + return arg1; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800117A8.s") +unk_D_86002F34_alt7* func_800118D0(MainPoolState* arg0, unk_D_86002F34_alt7* arg1, s32 arg2, Gfx* arg3, s16 arg4) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt7), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011814.s") + if (arg1 != NULL) { + arg1->unk_18 = arg3; + arg1->unk_1C = arg4; + func_80010FA0(arg1, 0x15); + arg1->unk_00.unk_03 = arg2; + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800118D0.s") + return arg1; +} unk_D_86002F58_004_000* func_80011938(MainPoolState* arg0, unk_D_86002F58_004_000* arg1, s16 arg2, Vec3f* arg3, Vec3s* arg4, Vec3f* arg5) { @@ -100,11 +359,49 @@ unk_D_86002F58_004_000* func_80011938(MainPoolState* arg0, unk_D_86002F58_004_00 return arg1; } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011A3C.s") +unk_D_86002F34_alt8* func_80011A3C(MainPoolState* arg0, unk_D_86002F34_alt8* arg1, s32 arg2, Gfx* arg3, MtxF* arg4) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt8), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011ABC.s") + if (arg1 != NULL) { + arg1->unk_18 = arg3; + if (arg4 == NULL) { + func_8000ED98(&arg1->unk_1C); + } else { + func_8000ED4C(&arg1->unk_1C, arg4); + } + func_80010FA0(arg1, 0x17); + arg1->unk_00.unk_03 = arg2; + } + + return arg1; +} + +unk_D_86002F34_alt8* func_80011ABC(MainPoolState* arg0, unk_D_86002F34_alt8* arg1, s32 arg2, Gfx* arg3, Vec3f* arg4, + Vec3s* arg5) { + MtxF sp20; + + func_8000F2C4(&sp20, arg4, arg5); + return func_80011A3C(arg0, arg1, arg2, arg3, &sp20); +} + +unk_D_86002F34_alt9* func_80011B10(MainPoolState* arg0, unk_D_86002F34_alt9* arg1, s32 arg2, Gfx* arg3, Vec3f* arg4, + f32 arg5) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt9), 4); + } + + if (arg1 != NULL) { + arg1->unk_1C = *arg4; + arg1->unk_28 = arg5; + arg1->unk_18 = arg3; + func_80010FA0(arg1, 0x18); + arg1->unk_00.unk_03 = arg2; + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011B10.s") + return arg1; +} unk_func_80011B94* func_80011B94(MainPoolState* arg0, unk_func_80011B94* arg1, s32 arg2, Gfx* arg3) { if (arg0 != NULL) { @@ -120,25 +417,121 @@ unk_func_80011B94* func_80011B94(MainPoolState* arg0, unk_func_80011B94* arg1, s return arg1; } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011BF4.s") +unk_D_86002F34_alt10* func_80011BF4(MainPoolState* arg0, unk_D_86002F34_alt10* arg1, s16 arg2, s16 arg3, s32 arg4, + s16 arg5, s16 arg6, u8 r, u8 g, u8 b, u8 a) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt10), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011C98.s") + if (arg1 != NULL) { + arg1->unk_22 = arg2; + arg1->unk_20 = arg3; + arg1->unk_18 = arg4; + arg1->unk_1C = arg5; + arg1->unk_1E = arg6; + arg1->unk_24.rgba = (r << 0x18) | (g << 0x10) | (b << 8) | a; + func_80010FA0(arg1, 0x1A); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011CF0.s") + return arg1; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011DAC.s") +unk_D_86002F34_alt23* func_80011C98(MainPoolState* arg0, unk_D_86002F34_alt23* arg1, s16 arg2) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt23), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011E68.s") + if (arg1 != NULL) { + arg1->unk_18 = arg2; + func_80010FA0(arg1, 0x1B); + } + + return arg1; +} + +unk_D_86002F34_alt24* func_80011CF0(MainPoolState* arg0, unk_D_86002F34_alt24* arg1, s32 arg2, s16 arg3, s16 arg4, + s16 arg5, s16 arg6, s16 arg7, s16 arg8, s32 arg9, u8 r, u8 g, u8 b, u8 a) { + if (arg0 != NULL) { + arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_alt24), 4); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011EB4.s") + if (arg1 != NULL) { + arg1->unk_1C = arg3; + arg1->unk_1E = arg4; + arg1->unk_20 = arg5; + arg1->unk_22 = arg6; + arg1->unk_18 = arg7; + arg1->unk_1A = arg8; + arg1->unk_24 = arg9; + arg1->unk_28.rgba = (r << 0x18) | (g << 0x10) | (b << 8) | a; + func_80010FA0(arg1, 0x1C); + arg1->unk_00.unk_03 = arg2; + } + + return arg1; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011FC8.s") +void func_80011DAC(unk_D_86002F34_00C* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { + arg0->unk_18.x = arg1; + arg0->unk_18.y = arg2; + arg0->unk_18.width = arg3; + arg0->unk_18.height = arg4; + + arg0->unk_40.l = -arg3 * 0.5f; + arg0->unk_40.r = arg3 * 0.5f; + arg0->unk_40.t = arg4 * 0.5f; + arg0->unk_40.b = -arg4 * 0.5f; + arg0->unk_40.n = -2.0f; + arg0->unk_40.f = 2.0f; + arg0->unk_40.scale = 1.0f; +} + +void func_80011E68(unk_D_86002F34_00C* arg0, f32 arg1, f32 arg2, f32 arg3) { + arg0->unk_24.aspect = (f32)arg0->unk_18.width / arg0->unk_18.height; + arg0->unk_24.fovy = arg1; + arg0->unk_24.near = arg2; + arg0->unk_24.far = arg3; + arg0->unk_24.scale = 1.0f; +} + +void func_80011EB4(unk_D_86002F34_00C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, s32 arg7) { + unk_D_86002F34_00C_060* sp1C = &arg0->unk_60; + f32 sp28 = arg4 - arg1; + f32 sp24 = arg6 - arg3; + f32 temp_fv1_2 = -1.0 / sqrtf(SQ(sp28) + SQ(sp24)); + + sp28 *= temp_fv1_2; + sp24 *= temp_fv1_2; + + func_8000E88C(&sp1C->eye, arg1, arg2, arg3); + func_8000E88C(&sp1C->at, arg4, arg5, arg6); + func_8000E88C(&sp1C->up, SINS(arg7) * sp24, COSS(arg7), -SINS(arg7) * sp28); +} + +void func_80011FC8(unk_D_86002F34_00C* arg0, s16 arg1, s16 arg2, u8 arg3, u8 arg4, u8 arg5) { + unk_D_86002F34_00C_0CC* ptr = &arg0->unk_CC; + + if (arg2 < 2) { + if ((arg1 == 2) || (arg1 == 4)) { + ptr->unk_00 = 0; + } else { + ptr->unk_00 = 1; + } + } else { + ptr->unk_00 = arg1; + ptr->unk_08 = arg2; + ptr->unk_0A = 1; + ptr->color.r = arg3; + ptr->color.g = arg4; + ptr->color.b = arg5; + } +} #pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80012044.s") -void func_80012094(unk_D_86002F58_004_000_000* arg0, unk_D_86002F58_004_000_000* arg1) { - unk_D_86002F58_004_000_000* temp_v0; - unk_D_86002F58_004_000_000* temp_v1; +void func_80012094(unk_D_86002F34_000* arg0, unk_D_86002F34_000* arg1) { + unk_D_86002F34_000* temp_v0; + unk_D_86002F34_000* temp_v1; if ((arg0 != NULL) && (arg1 != NULL)) { temp_v0 = arg0->unk_0C; diff --git a/src/11BA0.h b/src/11BA0.h index 624c9faa..67783669 100644 --- a/src/11BA0.h +++ b/src/11BA0.h @@ -9,11 +9,54 @@ typedef struct unk_func_80011B94 { /* 0x18 */ Gfx* unk_18; } unk_func_80011B94; // size = 0x1C -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*, unk_func_80011B94*, s32, Gfx*); -unk_D_86002F34_alt9* func_80011B10(MainPoolState*, s32, s32, s32, Vec3f*, f32); -void func_80012094(unk_D_86002F58_004_000_000*, unk_D_86002F58_004_000_000*); +typedef struct unk_D_8690A610_018 { + /* 0x00 */ s16 unk_00; + /* 0x02 */ s16 unk_02; + /* 0x04 */ Color_RGBA8_u32 unk_04; +} unk_D_8690A610_018; // size = 0x8 +typedef struct unk_D_8690A610 { + /* 0x00 */ unk_D_86002F58_004_000_000 unk_00; + /* 0x18 */ unk_D_8690A610_018 unk_18; +} unk_D_8690A610; // size = 0x20 +void func_80010FA0(unk_D_86002F34_000* arg0, u8 arg1); +void func_80010FDC(unk_D_86002F34_000* arg0, func_D_86002F34_000_010 arg1, unk_D_86002F34_000_014* arg2); +unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, void* arg1); +unk_D_86002F34_alt2* func_80011088(MainPoolState* arg0, unk_D_86002F34_alt2* arg1, unk_D_86002F34_000* arg2); +unk_D_86002F34_00C* func_800110E0(MemoryBlock* arg0, unk_D_86002F34_00C* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5); +unk_D_86002F34_alt13* func_800111A4(MemoryBlock* arg0, unk_D_86002F34_alt13* arg1, s16 arg2); +unk_D_86002F34_alt1* func_800111FC(MemoryBlock* arg0, unk_D_86002F34_alt1* arg1, s16 arg2); +unk_D_86002F34_alt14* func_80011258(MainPoolState* arg0, unk_D_86002F34_alt14* arg1, s16 arg2); +unk_D_86002F34_alt15* func_800112BC(MainPoolState* arg0, unk_D_86002F34_alt15* arg1, s16 arg2); +unk_D_86002F34_alt16* func_80011320(MainPoolState* arg0, unk_D_86002F34_alt16* arg1, u8 arg2, u8 arg3, u8 arg4); +unk_D_86002F34_alt17* func_800113AC(MainPoolState* arg0, unk_D_86002F34_alt17* arg1); +unk_D_8690A610* func_800113F8(s32 arg0, unk_D_8690A610* arg1, s16 arg2, s16 arg3, u8 r, u8 g, u8 b, u8 a); +unk_D_86002F34_alt18* func_80011484(MainPoolState* arg0, unk_D_86002F34_alt18* arg1, s16 arg2, s16 arg3, u8 r, u8 g, u8 b, u8 a); +unk_D_86002F34_alt19* func_80011504(MainPoolState* arg0, unk_D_86002F34_alt19* arg1, u8 r, u8 g, u8 b); +unk_D_86002F34* func_8001156C(MainPoolState* arg0, unk_D_86002F34* arg1, s32 arg2, + unk_D_86002F34_018* arg3, s32 arg4, unk_D_86002F34_01C* arg5, + s32 arg6, Vtx* arg7); +unk_D_86002F34_alt12* func_800115F0(MainPoolState* arg0, unk_D_86002F34_alt12* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5); +unk_D_86002F34_alt20* func_80011660(MainPoolState* arg0, unk_D_86002F34_alt20* arg1, s16 arg2, s16 arg3); +unk_D_86002F34_alt21* func_800116C0(MainPoolState* arg0, unk_D_86002F34_alt21* arg1, s16 arg2, s16 arg3); +unk_D_86002F34_alt5* func_80011720(MainPoolState* arg0, unk_D_86002F34_alt5* arg1, Vec3f* arg2, Vec3s* arg3); +unk_D_86002F34_alt22* func_800117A8(MainPoolState* arg0, unk_D_86002F34_alt22* arg1, Vec3f* arg2); +unk_D_86002F34_alt6* func_80011814(MainPoolState* arg0, unk_D_86002F34_alt6* arg1, s16 arg2, s16 arg3, s16 arg4, Vec3s* arg5, Vec3s* arg6, Vec3f* arg7); +unk_D_86002F34_alt7* func_800118D0(MainPoolState* arg0, unk_D_86002F34_alt7* arg1, s32 arg2, Gfx* arg3, s16 arg4); +unk_D_86002F58_004_000* func_80011938(MainPoolState* arg0, unk_D_86002F58_004_000* arg1, s16 arg2, Vec3f* arg3, + Vec3s* arg4, Vec3f* arg5); +unk_D_86002F34_alt8* func_80011A3C(MainPoolState* arg0, unk_D_86002F34_alt8* arg1, s32 arg2, Gfx* arg3, MtxF* arg4); +unk_D_86002F34_alt8* func_80011ABC(MainPoolState* arg0, unk_D_86002F34_alt8* arg1, s32 arg2, Gfx* arg3, Vec3f* arg4, Vec3s* arg5); +unk_D_86002F34_alt9* func_80011B10(MainPoolState* arg0, unk_D_86002F34_alt9* arg1, s32 arg2, Gfx* arg3, Vec3f* arg4, f32 arg5); +unk_func_80011B94* func_80011B94(MainPoolState* arg0, unk_func_80011B94* arg1, s32 arg2, Gfx* arg3); +unk_D_86002F34_alt10* func_80011BF4(MainPoolState* arg0, unk_D_86002F34_alt10* arg1, s16 arg2, s16 arg3, s32 arg4, s16 arg5, s16 arg6, u8 r, u8 g, u8 b, u8 a); +unk_D_86002F34_alt23* func_80011C98(MainPoolState* arg0, unk_D_86002F34_alt23* arg1, s16 arg2); +unk_D_86002F34_alt24* func_80011CF0(MainPoolState* arg0, unk_D_86002F34_alt24* arg1, s32 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7, s16 arg8, s32 arg9, + u8 r, u8 g, u8 b, u8 a); +void func_80011DAC(unk_D_86002F34_00C* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4); +void func_80011E68(unk_D_86002F34_00C* arg0, f32 arg1, f32 arg2, f32 arg3); +void func_80011EB4(unk_D_86002F34_00C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, s32 arg7); +void func_80011FC8(unk_D_86002F34_00C* arg0, s16 arg1, s16 arg2, u8 arg3, u8 arg4, u8 arg5); +void func_80012094(unk_D_86002F34_000* arg0, unk_D_86002F34_000* arg1); #endif // _11BA0_H_ diff --git a/src/18480.c b/src/18480.c index 13f907b5..f70753ff 100644 --- a/src/18480.c +++ b/src/18480.c @@ -5,105 +5,669 @@ typedef void (*func_D_8006F2B0)(void); +typedef struct unk_D_800ABE00_cmd0 { + /* 0x00 */ u8 cmd; + /* 0x02 */ u16 unk_02; + /* 0x04 */ s32 unk_04; +} unk_D_800ABE00_cmd0; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd1 { + /* 0x00 */ u8 cmd; +} unk_D_800ABE00_cmd1; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd2 { + /* 0x00 */ u8 cmd; + /* 0x04 */ u32 unk_04; +} unk_D_800ABE00_cmd2; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd3 { + /* 0x00 */ u8 cmd; + /* 0x04 */ u32 unk_04; +} unk_D_800ABE00_cmd3; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd4 { + /* 0x00 */ u8 cmd; +} unk_D_800ABE00_cmd4; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd5 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd5; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd6 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd6; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd7 { + /* 0x00 */ u8 cmd; + /* 0x04 */ unk_D_8690A610* unk_04; +} unk_D_800ABE00_cmd7; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd8 { + /* 0x00 */ u8 cmd; + /* 0x04 */ func_D_86002F34_000_010 unk_04; + /* 0x08 */ unk_D_86002F34_000_014* unk_08; +} unk_D_800ABE00_cmd8; // size = 0xC + +typedef struct unk_D_800ABE00_cmd9 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd9; // size = 0x4 + +typedef struct unk_D_800ABE00_cmdA { + /* 0x00 */ u8 cmd; + /* 0x04 */ unk_D_86002F34_000* unk_04; +} unk_D_800ABE00_cmdA; // size = 0x8 + +typedef struct unk_D_800ABE00_cmdB { + /* 0x00 */ u8 cmd; + /* 0x02 */ u16 unk_02; + /* 0x04 */ u16 unk_04; + /* 0x06 */ u16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ Vec3s unk_0C; + /* 0x12 */ s16 unk_12; + /* 0x14 */ s16 unk_14; + /* 0x16 */ s16 unk_16; +} unk_D_800ABE00_cmdB; // size = 0x18 + +typedef struct unk_D_800ABE00_cmdC { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmdC; // size = 0x4 + +typedef struct unk_D_800ABE00_cmdD { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmdD; // size = 0x4 + +typedef struct unk_D_800ABE00_cmdE { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmdE; // size = 0x4 + +typedef struct unk_D_800ABE00_cmdF { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmdF; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd10 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ u8 unk_02; + /* 0x03 */ u8 unk_03; +} unk_D_800ABE00_cmd10; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd11 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd11; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd13 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 r; + /* 0x02 */ u8 g; + /* 0x03 */ u8 b; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; +} unk_D_800ABE00_cmd13; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd14 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0x3]; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ u8 r; + /* 0x09 */ u8 g; + /* 0x0A */ u8 b; + /* 0x0B */ u8 a; +} unk_D_800ABE00_cmd14; // size = 0xC + +typedef struct unk_D_800ABE00_cmd15 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0xB]; +} unk_D_800ABE00_cmd15; // size = 0xC + +typedef struct unk_D_800ABE00_cmd16 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 r; + /* 0x02 */ u8 g; + /* 0x03 */ u8 b; +} unk_D_800ABE00_cmd16; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd17 { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ unk_D_86002F34_018* unk_08; + /* 0x0C */ unk_D_86002F34_01C* unk_0C; + /* 0x10 */ Vtx* unk_10; +} unk_D_800ABE00_cmd17; // size = 0x14 + +typedef struct unk_D_800ABE00_cmd18 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; +} unk_D_800ABE00_cmd18; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd19 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0x3]; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; +} unk_D_800ABE00_cmd19; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd1A { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmd1A; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd1B { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0x3]; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ Vec3s unk_0A; +} unk_D_800ABE00_cmd1B; // size = 0x10 + +typedef struct unk_D_800ABE00_cmd1C { + /* 0x00 */ u8 cmd; + /* 0x01 */ char unk01[0x3]; + /* 0x04 */ u32 unk_04; + /* 0x08 */ u32 unk_08; + /* 0x0C */ u32 unk_0C; +} unk_D_800ABE00_cmd1C; // size = 0x10 + +typedef struct unk_D_800ABE00_cmd1D { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ u8 unk_02; + /* 0x03 */ u8 unk_03; + /* 0x04 */ Vec3s unk_04; + /* 0x0A */ Vec3s unk_0A; + /* 0x10 */ u32 unk_10; + /* 0x14 */ u32 unk_14; + /* 0x18 */ u32 unk_18; +} unk_D_800ABE00_cmd1D; // size = 0x1C + +typedef struct unk_D_800ABE00_cmd1E { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ s16 unk_02; + /* 0x04 */ Gfx* unk_04; +} unk_D_800ABE00_cmd1E; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd1F { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ Vec3s unk_0A; + /* 0x10 */ s16 unk_10; + /* 0x12 */ s16 unk_12; + /* 0x14 */ s16 unk_14; + /* 0x16 */ char pad[0x2]; +} unk_D_800ABE00_cmd1F; // size = 0x18 + +typedef struct unk_D_800ABE00_cmd20 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ char unk02[0x2]; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ Vec3s unk_0A; + /* 0x10 */ Gfx* unk_10; +} unk_D_800ABE00_cmd20; // size = 0x14 + +typedef struct unk_D_800ABE00_cmd21 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ Vec3s unk_02; + /* 0x08 */ u32 unk_08; + /* 0x0C */ Gfx* unk_0C; +} unk_D_800ABE00_cmd21; // size = 0x10 + +typedef struct unk_D_800ABE00_cmd22 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x04 */ Gfx* unk_04; +} unk_D_800ABE00_cmd22; // size = 0x8 + +typedef struct unk_D_800ABE00_cmd23 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s32 unk_04; + /* 0x07 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ u8 r; + /* 0x0D */ u8 g; + /* 0x0E */ u8 b; + /* 0x0F */ u8 a; +} unk_D_800ABE00_cmd23; // size = 0x10 + +typedef struct unk_D_800ABE00_cmd24 { + /* 0x00 */ u8 cmd; + /* 0x02 */ s16 unk_02; +} unk_D_800ABE00_cmd24; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd25 { + /* 0x00 */ u8 cmd; + /* 0x01 */ char pad[3]; +} unk_D_800ABE00_cmd25; // size = 0x4 + +typedef struct unk_D_800ABE00_cmd26 { + /* 0x00 */ u8 cmd; + /* 0x01 */ u8 unk_01; + /* 0x02 */ u8 unk_02; + /* 0x03 */ s8 unk_03; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ s32 unk_0C; + /* 0x10 */ u8 r; + /* 0x11 */ u8 g; + /* 0x12 */ u8 b; + /* 0x13 */ u8 a; +} unk_D_800ABE00_cmd26; // size = 0x14 + extern MemoryBlock* D_800ABD30; extern unk_D_86002F34* D_800ABD34; -extern s32 D_800ABD38[]; -extern s32 D_800ABD78; +extern u32 D_800ABD38[]; +extern unk_D_86002F34_000* D_800ABD78[32]; extern s16 D_800ABDF8; extern s16 D_800ABDFA; extern s16 D_800ABDFE; extern u8* D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017880.s") +void func_80017880(void) { + unk_D_800ABE00_cmd0* cmd = (unk_D_800ABE00_cmd0*)D_800ABE00; + u32 v = (u32)D_800ABE00; + + D_800ABD38[D_800ABDFA++] = v + sizeof(unk_D_800ABE00_cmd0); + D_800ABD38[D_800ABDFA++] = (D_800ABDF8 << 0x10) + D_800ABDFE; + D_800ABDFE = D_800ABDFA; + + D_800ABE00 = (u8*)Util_ConvertAddrToVirtAddr(cmd->unk_04); +} + +void func_80017914(void) { + D_800ABDFA = D_800ABDFE; + + D_800ABDFE = D_800ABD38[--D_800ABDFA] & 0xFFFF; + D_800ABDF8 = D_800ABD38[D_800ABDFA] >> 0x10; + D_800ABE00 = D_800ABD38[--D_800ABDFA]; +} + +void func_8001799C(void) { + unk_D_800ABE00_cmd2* cmd = (unk_D_800ABE00_cmd2*)D_800ABE00; + + D_800ABE00 = Util_ConvertAddrToVirtAddr(cmd->unk_04); +} + +void func_800179C8(void) { + unk_D_800ABE00_cmd3* cmd = (unk_D_800ABE00_cmd3*)D_800ABE00; + + cmd += 0; + + D_800ABD38[D_800ABDFA++] = D_800ABE00 + sizeof(unk_D_800ABE00_cmd3); + D_800ABE00 = (u8*)Util_ConvertAddrToVirtAddr(cmd->unk_04); +} + +void func_80017A1C(void) { + D_800ABE00 = D_800ABD38[--D_800ABDFA]; +} + +void func_80017A54(void) { + D_800ABD78[D_800ABDF8 + 1] = D_800ABD78[D_800ABDF8]; + D_800ABDF8++; + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd5); +} + +void func_80017A98(void) { + D_800ABDF8--; + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd6); +} + +void func_80017AC4(unk_D_86002F34_000* arg0) { + if (arg0 != NULL) { + D_800ABD78[D_800ABDF8] = arg0; + if (D_800ABDF8 == 0) { + if (D_800ABD34 == NULL) { + D_800ABD34 = arg0; + } + } else { + func_80012094(D_800ABD78[D_800ABDF8 - 1], arg0); + } + } +} + +void func_80017B28(void) { + unk_D_800ABE00_cmd7* cmd = (unk_D_800ABE00_cmd7*)D_800ABE00; + + func_80017AC4(&cmd->unk_04->unk_00); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd7); +} + +void func_80017B60(void) { + unk_D_800ABE00_cmd8* cmd = (unk_D_800ABE00_cmd8*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017914.s") + if (D_800ABD78[D_800ABDF8] != NULL) { + func_80010FDC(D_800ABD78[D_800ABDF8], cmd->unk_04, cmd->unk_08); + } + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd8); +} + +void func_80017BBC(void) { + func_80017AC4(func_8001103C(D_800ABD30, NULL)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd9); +} + +void func_80017BFC(void) { + unk_D_800ABE00_cmdA* cmd = (unk_D_800ABE00_cmdA*)D_800ABE00; + + func_80017AC4(func_80011088(D_800ABD30, NULL, cmd->unk_04)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmdA); +} + +void func_80017C48(void) { + unk_D_800ABE00_cmdB* cmd = (unk_D_800ABE00_cmdB*)D_800ABE00; + unk_D_86002F34_00C* temp_v0 = func_800110E0(D_800ABD30, NULL, cmd->unk_04, cmd->unk_06, cmd->unk_08, cmd->unk_0A); + + if (temp_v0 != NULL) { + temp_v0->unk_24.fovy = cmd->unk_02; + func_8000E990(&temp_v0->unk_60.at, &cmd->unk_0C); + func_80010354(&temp_v0->unk_60.at, &temp_v0->unk_60.eye, cmd->unk_16, (cmd->unk_12 << 0xF) / 180, + (cmd->unk_14 << 0xF) / 180); + } + + func_80017AC4(&temp_v0->unk_00); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmdB); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_8001799C.s") +void func_80017D94(void) { + unk_D_800ABE00_cmdC* cmd = (unk_D_800ABE00_cmdC*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_800179C8.s") + func_80017AC4(func_800111A4(D_800ABD30, NULL, cmd->unk_02)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017A1C.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmdC); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017A54.s") +void func_80017DE0(void) { + unk_D_800ABE00_cmdD* cmd = (unk_D_800ABE00_cmdD*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017A98.s") + func_80017AC4(func_800111FC(D_800ABD30, NULL, cmd->unk_02)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017AC4.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmdD); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017B28.s") +void func_80017E2C(void) { + unk_D_800ABE00_cmdE* cmd = (unk_D_800ABE00_cmdE*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017B60.s") + func_80017AC4(func_80011258(D_800ABD30, NULL, cmd->unk_02)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017BBC.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmdE); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017BFC.s") +void func_80017E78(void) { + unk_D_800ABE00_cmdF* cmd = (unk_D_800ABE00_cmdF*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017C48.s") + func_80017AC4(func_800112BC(D_800ABD30, NULL, cmd->unk_02)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017D94.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmdF); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017DE0.s") +void func_80017EC4(void) { + unk_D_800ABE00_cmd10* cmd = (unk_D_800ABE00_cmd10*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017E2C.s") + func_80017AC4(func_80011320(D_800ABD30, NULL, cmd->unk_01, cmd->unk_02, cmd->unk_03)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017E78.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmd10); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017EC4.s") +void func_80017F1C(void) { + func_80017AC4(func_800113AC(D_800ABD30, NULL)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017F1C.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmd11); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017F5C.s") +void func_80017F5C(void) { +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017F64.s") +void func_80017F64(void) { + unk_D_800ABE00_cmd13* cmd = (unk_D_800ABE00_cmd13*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80017FD4.s") + func_80017AC4(func_800113F8(D_800ABD30, NULL, cmd->unk_04, cmd->unk_06, cmd->r, cmd->g, cmd->b, 0xFF)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_800180BC.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmd13); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_800180D4.s") +void func_80017FD4(void) { + unk_D_800ABE00_cmd14* cmd = (unk_D_800ABE00_cmd14*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_8001812C.s") + func_80017AC4(func_80011484(D_800ABD30, NULL, (cmd->unk_04 << 0xF) / 180, (cmd->unk_06 << 0xF) / 180, cmd->r, + cmd->g, cmd->b, cmd->a)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_8001819C.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmd14); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_800181FC.s") +void func_800180BC(void) { + D_800ABE00 += sizeof(unk_D_800ABE00_cmd15); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_8001824C.s") +void func_800180D4(void) { + unk_D_800ABE00_cmd16* cmd = (unk_D_800ABE00_cmd16*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_8001829C.s") + func_80017AC4(func_80011504(D_800ABD30, NULL, cmd->r, cmd->g, cmd->b)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_800183C4.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmd16); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80018490.s") +void func_8001812C(void) { + unk_D_800ABE00_cmd17* cmd = (unk_D_800ABE00_cmd17*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_800185A8.s") + func_80017AC4( + func_8001156C(D_800ABD30, NULL, cmd->unk_02, cmd->unk_08, cmd->unk_04, cmd->unk_0C, cmd->unk_06, cmd->unk_10)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80018600.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmd17); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_8001878C.s") +void func_8001819C(void) { + unk_D_800ABE00_cmd18* cmd = (unk_D_800ABE00_cmd18*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_800188C8.s") + func_80017AC4(func_800115F0(D_800ABD30, NULL, cmd->unk_01, cmd->unk_04, cmd->unk_06, cmd->unk_02)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80018968.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmd18); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_800189B8.s") +void func_800181FC(void) { + unk_D_800ABE00_cmd19* cmd = (unk_D_800ABE00_cmd19*)D_800ABE00; -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80018A40.s") + func_80017AC4(func_80011660(D_800ABD30, NULL, cmd->unk_04, cmd->unk_06)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80018A8C.s") + D_800ABE00 += sizeof(unk_D_800ABE00_cmd19); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/18480/func_80018AD0.s") +void func_8001824C(void) { + unk_D_800ABE00_cmd1A* cmd = (unk_D_800ABE00_cmd1A*)D_800ABE00; + + func_80017AC4(func_800116C0(D_800ABD30, NULL, cmd->unk_01, cmd->unk_02)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd1A); +} + +void func_8001829C(void) { + Vec3s sp30; + Vec3f sp24; + UNUSED s32 pad; + unk_D_800ABE00_cmd1B* cmd = (unk_D_800ABE00_cmd1B*)D_800ABE00; + + func_8000E990(&sp24, &cmd->unk_0A); + func_8000EB70(&sp30, (cmd->unk_04 << 0xF) / 180, (cmd->unk_06 << 0xF) / 180, (cmd->unk_08 << 0xF) / 180); + func_80017AC4(func_80011720(D_800ABD30, NULL, &sp24, &sp30)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd1B); +} + +void func_800183C4(void) { + Vec3f sp24; + unk_D_800ABE00_cmd1C* cmd = (unk_D_800ABE00_cmd1C*)D_800ABE00; + + sp24.x = cmd->unk_04 / 65536.0f; + sp24.y = cmd->unk_08 / 65536.0f; + sp24.z = cmd->unk_0C / 65536.0f; + func_80017AC4(func_800117A8(D_800ABD30, NULL, &sp24)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd1C); +} + +void func_80018490(void) { + Vec3f sp3C; + s16 var_a3 = 1; + unk_D_800ABE00_cmd1D* cmd = (unk_D_800ABE00_cmd1D*)D_800ABE00; + + sp3C.x = cmd->unk_10 / 65536.0f; + sp3C.y = cmd->unk_14 / 65536.0f; + sp3C.z = cmd->unk_18 / 65536.0f; + + if (cmd->unk_02 & 1) { + var_a3 = 0; + } + + if (cmd->unk_02 & 2) { + var_a3 |= 2; + } + + func_80017AC4(func_80011814(D_800ABD30, NULL, cmd->unk_01, var_a3, cmd->unk_03, &cmd->unk_04, &cmd->unk_0A, &sp3C)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd1D); +} + +void func_800185A8(void) { + unk_D_800ABE00_cmd1E* cmd = (unk_D_800ABE00_cmd1E*)D_800ABE00; + + func_80017AC4(func_800118D0(D_800ABD30, NULL, cmd->unk_01, cmd->unk_04, cmd->unk_02)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd1E); +} + +void func_80018600(void) { + Vec3s sp40; + Vec3f sp34; + Vec3f sp28; + unk_D_86002F58_004_000* tmp; + unk_D_800ABE00_cmd1F* cmd = (unk_D_800ABE00_cmd1F*)D_800ABE00; + + func_8000E990(&sp34, &cmd->unk_0A); + + sp28.x = cmd->unk_10 / 100.0f; + sp28.y = cmd->unk_12 / 100.0f; + sp28.z = cmd->unk_14 / 100.0f; + + func_8000EB70(&sp40, (cmd->unk_04 << 0xF) / 180, (cmd->unk_06 << 0xF) / 180, (cmd->unk_08 << 0xF) / 180); + tmp = func_80011938(D_800ABD30, NULL, cmd->unk_02, &sp34, &sp40, &sp28); + func_80017AC4(tmp); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd1F); +} + +void func_8001878C(void) { + Vec3f sp34; + Vec3s sp2C; + unk_D_86002F34_alt8* tmp; + unk_D_800ABE00_cmd20* cmd = (unk_D_800ABE00_cmd20*)D_800ABE00; + + func_8000E990(&sp34, &cmd->unk_0A); + func_8000EB70(&sp2C, (cmd->unk_04 << 0xF) / 180, (cmd->unk_06 << 0xF) / 180, (cmd->unk_08 << 0xF) / 180); + tmp = func_80011ABC(D_800ABD30, NULL, cmd->unk_01, cmd->unk_10, &sp34, &sp2C); + func_80017AC4(tmp); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd20); +} + +void func_800188C8(void) { + Vec3f sp2C; + unk_D_86002F34_alt9* tmp; + unk_D_800ABE00_cmd21* cmd = (unk_D_800ABE00_cmd21*)D_800ABE00; + + func_8000E990(&sp2C, &cmd->unk_02); + tmp = func_80011B10(D_800ABD30, NULL, cmd->unk_01, cmd->unk_0C, &sp2C, cmd->unk_08 / 65536.0f); + func_80017AC4(tmp); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd21); +} + +void func_80018968(void) { + unk_D_800ABE00_cmd22* cmd = (unk_D_800ABE00_cmd22*)D_800ABE00; + + func_80017AC4(func_80011B94(D_800ABD30, NULL, cmd->unk_01, cmd->unk_04)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd22); +} + +void func_800189B8(void) { + unk_D_800ABE00_cmd23* cmd = (unk_D_800ABE00_cmd23*)D_800ABE00; + + func_80017AC4(func_80011BF4(D_800ABD30, NULL, cmd->unk_01, cmd->unk_02, cmd->unk_04, cmd->unk_08, cmd->unk_0A, + cmd->r, cmd->g, cmd->b, cmd->a)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd23); +} + +void func_80018A40(void) { + unk_D_800ABE00_cmd24* cmd = (unk_D_800ABE00_cmd24*)D_800ABE00; + + func_80017AC4(func_80011C98(D_800ABD30, NULL, cmd->unk_02)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd24); +} + +void func_80018A8C(void) { + unk_D_800ABE00_cmd25* cmd = (unk_D_800ABE00_cmd25*)D_800ABE00; + + if (D_800ABD78[D_800ABDF8] != NULL) { + D_800ABD78[D_800ABDF8]->unk_02 |= 4; + } + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd25); +} + +void func_80018AD0(void) { + unk_D_800ABE00_cmd26* cmd = (unk_D_800ABE00_cmd26*)D_800ABE00; + + func_80017AC4(func_80011CF0(D_800ABD30, NULL, cmd->unk_01, cmd->unk_04, cmd->unk_06, cmd->unk_08, cmd->unk_0A, + cmd->unk_02, cmd->unk_03, cmd->unk_0C, cmd->r, cmd->g, cmd->b, cmd->a)); + + D_800ABE00 += sizeof(unk_D_800ABE00_cmd26); +} -void* func_80018B70(MemoryBlock* arg0, void* arg1) { +unk_D_86002F34_000* func_80018B70(MemoryBlock* arg0, void* arg1) { extern func_D_8006F2B0 D_8006F2B0[]; D_800ABD34 = NULL; D_800ABDF8 = 0; D_800ABDFA = 2; D_800ABDFE = 2; - D_800ABE00 = Util_ConvertAddrToVirtAddr(arg1); + D_800ABE00 = Util_ConvertAddrToVirtAddr((uintptr_t)arg1); D_800ABD30 = arg0; - D_800ABD78 = 0; + D_800ABD78[0] = NULL; D_800ABD38[0] = 0; D_800ABD38[1] = 0; diff --git a/src/18480.h b/src/18480.h index 484f5422..826bfb01 100644 --- a/src/18480.h +++ b/src/18480.h @@ -4,7 +4,45 @@ #include "global.h" #include "src/memory.h" -void* func_80018B70(MemoryBlock*, void*); - +void func_80017880(void); // cmd 0 +void func_80017914(void); // cmd 1 +void func_8001799C(void); // cmd 2 +void func_800179C8(void); // cmd 3 +void func_80017A1C(void); // cmd 4 +void func_80017A54(void); // cmd 5 +void func_80017A98(void); // cmd 6 +void func_80017B28(void); // cmd 7 +void func_80017B60(void); // cmd 8 +void func_80017BBC(void); // cmd 9 +void func_80017BFC(void); // cmd 10 +void func_80017C48(void); // cmd 11 +void func_80017D94(void); // cmd 12 +void func_80017DE0(void); // cmd 13 +void func_80017E2C(void); // cmd 14 +void func_80017E78(void); // cmd 15 +void func_80017EC4(void); // cmd 16 +void func_80017F1C(void); // cmd 17 +void func_80017F5C(void); // cmd 18 +void func_80017F64(void); // cmd 19 +void func_80017FD4(void); // cmd 20 +void func_800180BC(void); // cmd 21 +void func_800180D4(void); // cmd 22 +void func_8001812C(void); // cmd 23 +void func_8001819C(void); // cmd 24 +void func_800181FC(void); // cmd 25 +void func_8001824C(void); // cmd 26 +void func_8001829C(void); // cmd 27 +void func_800183C4(void); // cmd 28 +void func_80018490(void); // cmd 29 +void func_800185A8(void); // cmd 30 +void func_80018600(void); // cmd 31 +void func_8001878C(void); // cmd 32 +void func_800188C8(void); // cmd 33 +void func_80018968(void); // cmd 34 +void func_800189B8(void); // cmd 35 +void func_80018A40(void); // cmd 36 +void func_80018A8C(void); // cmd 37 +void func_80018AD0(void); // cmd 38 +unk_D_86002F34_000* func_80018B70(MemoryBlock*, void*); #endif // _18480_H_ diff --git a/src/19840.c b/src/19840.c index 292ba5c4..6b116791 100644 --- a/src/19840.c +++ b/src/19840.c @@ -372,7 +372,7 @@ s32 func_800198E4(unk_D_86002F58_004_000_010* arg0, u16 arg1, unk_D_86002F58_004 sp18->unk_14 = 0x3C000; sp18->unk_18 = arg2; - if ((arg0->unk_24 != NULL) && (arg1 == *arg0->unk_24) && (arg0->unk_2C.raw == sp18->unk_18.raw)) { + if ((arg0->unk_24 != NULL) && (arg0->unk_24->unk_00 == arg1) && (arg0->unk_2C.raw == sp18->unk_18.raw)) { osSendMesg(sp18->unk_04, sp18, 1); } else { osSendMesg(&D_800ABE10.unk_9D0, sp18, 1); diff --git a/src/1C720.c b/src/1C720.c index a4746cc3..04ac43ff 100644 --- a/src/1C720.c +++ b/src/1C720.c @@ -120,20 +120,17 @@ unk_D_86002F58_004_000_00C_028* func_8001BE90(unk_D_86002F58_004_000* arg0, s32 } #ifdef NON_MATCHING -void func_8001BEE8(s32* arg0, unk_func_8001BEE8* arg1) { +unk_D_86002F58_004_000_010_02C* func_8001BEE8(unk_D_86002F58_004_000_010_02C* arg0, unk_func_8001BEE8* arg1) { char sp38[0xB]; - s32 sp34; + unk_D_86002F58_004_000_010_02C sp34; unk_D_8006FF00* sp30; UNUSED unk_func_8001BEE8* sp20; UNUSED s32 i; u8 var_a0; - char* var_v1; - s8 t; - s32* test; - test = arg0; + s8* var_v1; sp30 = &D_8006FF00[arg1->unk_00 - 1]; - sp34 = 0; + sp34.raw = 0; func_80021CA4(sp38, arg1->unk_00); @@ -141,24 +138,20 @@ void func_8001BEE8(s32* arg0, unk_func_8001BEE8* arg1) { var_a0 = (arg1->unk_0E >> 8) + arg1->unk_0E; var_v1 = arg1->unk_30; - while (*var_v1 != 0) { - t = *var_v1++; - var_a0 += t; + while (*var_v1) { + var_a0 += *var_v1++; } var_v1 = arg1->unk_3B; - while (*var_v1 != 0) { - t = *var_v1++; - var_a0 += t; - do { - var_a0 += t; - } while (0); + while (*var_v1) { + var_a0 += *var_v1++; } - *(s16*)&sp34 = ((((sp30->unk_12 - sp30->unk_10) << 6) * var_a0) / 255) + (sp30->unk_10 << 6); + sp34.unk_00 = ((((sp30->unk_12 - sp30->unk_10) << 6) * var_a0) / 255) + (sp30->unk_10 << 6); } - *test = sp34; + *arg0 = sp34; + return arg0; } #else #pragma GLOBAL_ASM("asm/us/nonmatchings/1C720/func_8001BEE8.s") diff --git a/src/1C720.h b/src/1C720.h index 012498be..af0509cf 100644 --- a/src/1C720.h +++ b/src/1C720.h @@ -52,7 +52,7 @@ void func_8001BE34(unk_D_86002F58_004_000* arg0, u8 arg1, u8 arg2, u8 arg3, u8 a 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); +unk_D_86002F58_004_000_010_02C* func_8001BEE8(unk_D_86002F58_004_000_010_02C* arg0, unk_func_8001BEE8* arg1); void func_8001C014(s32* arg0, unk_func_8001C014* arg1, u16 arg2); void func_8001C07C(unk_func_8001C07C_arg0* arg0); void func_8001C198(unk_func_8001C248* arg0); diff --git a/src/26820.h b/src/26820.h index 653e7724..5a6cbd7a 100644 --- a/src/26820.h +++ b/src/26820.h @@ -11,7 +11,9 @@ typedef struct unk_func_8002A728 { typedef struct unk_func_80027FA0 { /* 0x00 */ u16 unk_00; - /* 0x02 */ char unk02[0x5]; + /* 0x02 */ char unk02[0x2]; + /* 0x04 */ u8 unk_04; + /* 0x05 */ char unk05[0x2]; /* 0x07 */ u8 unk_07; } unk_func_80027FA0; // size = 0x8 diff --git a/src/29BA0.c b/src/29BA0.c index dc046865..42745f41 100644 --- a/src/29BA0.c +++ b/src/29BA0.c @@ -51,7 +51,7 @@ s32 Game_DoCopyProtection(s32 state) { s32 func_80029008(s32 arg0, u8* romStart, u8* romEnd, u32 arg3, u32 arg4) { s32 result; - s32 (*func)(s32, s32); + FragmentEntry func; func = func_80004454(arg0, romStart, romEnd); diff --git a/src/2E110.c b/src/2E110.c index 0976dd53..fd269dee 100644 --- a/src/2E110.c +++ b/src/2E110.c @@ -101,7 +101,7 @@ void func_8002D628(char* arg0, u32 arg1, s8* arg2) { *arg0++ = 0; } -char* func_8002D7C0(char* arg0, s32 arg1, char** arg2, s32 file_number) { +char* func_8002D7C0(char* arg0, s32 arg1, char** arg2, u32 file_number) { char* sp1C; char* sp18 = (u32)arg2 + (u32)arg2[file_number + 1]; diff --git a/src/2E110.h b/src/2E110.h index b8749404..6bf11478 100644 --- a/src/2E110.h +++ b/src/2E110.h @@ -6,7 +6,7 @@ void func_8002D510(void); char* func_8002D5AC(s32); void func_8002D600(u32, s32); -char* func_8002D7C0(char* arg0, s32 arg1, char** arg2, s32 arg3); +char* func_8002D7C0(char* arg0, s32 arg1, char** arg2, u32 arg3); s32 func_8002D80C(s8*); diff --git a/src/30640.h b/src/30640.h index a546fc8d..baa13b1f 100644 --- a/src/30640.h +++ b/src/30640.h @@ -2,8 +2,24 @@ #define _30640_H_ #include "global.h" +#include "1C720.h" + +typedef struct unk_D_83407AC8 { + /* 0x00 */ u16 unk_00; + /* 0x02 */ u8 unk_02; + /* 0x03 */ u8 unk_03[11]; + /* 0x0E */ u8 unk_0E; + /* 0x0F */ u8 unk_0F; + /* 0x10 */ u8 unk_10; +} unk_D_83407AC8; // size >= 0x12 + +typedef struct unk_D_83402EE0_070 { + /* 0x00 */ char unk00[0x1A]; +} unk_D_83402EE0_070; // size = 0x1A void func_8002FA40(void); +void func_8003107C(unk_D_83402EE0_070*, unk_func_8001BEE8*); +void func_80031140(unk_func_8001BEE8*, unk_D_83407AC8*); f32 func_80031A6C(f32); void func_80031EF4(MtxF*, MtxF*); void func_80032034(MtxF* arg0, Vec3f* arg1); diff --git a/src/fragments/10/fragment10.c b/src/fragments/10/fragment10.c index 5409e3ed..90ae4774 100644 --- a/src/fragments/10/fragment10.c +++ b/src/fragments/10/fragment10.c @@ -834,7 +834,7 @@ void func_8640203C(void) { 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); + D_864052C8->unk_190 = func_80011B10(temp_s5, NULL, 4, NULL, &D_8006F050, 0.0f); func_80012094(&D_800AC840, &D_864052C8->unk_190->unk_00); } diff --git a/src/fragments/11/fragment11_1.c b/src/fragments/11/fragment11_1.c index f9b0bf05..4e377b1a 100644 --- a/src/fragments/11/fragment11_1.c +++ b/src/fragments/11/fragment11_1.c @@ -1250,7 +1250,7 @@ void func_86502848(void) { for (i = 0; i < 4; i++) { D_8650AB28 = &D_8650A528[i]; - D_8650AB28->unk_17C = func_80011B10(temp_s5, 0, 4, 0, &D_8006F050, 1.0f); + D_8650AB28->unk_17C = func_80011B10(temp_s5, NULL, 4, NULL, &D_8006F050, 1.0f); func_80012094(&D_800AC840, &D_8650AB28->unk_17C->unk_00); } diff --git a/src/fragments/14/fragment14_14A030.c b/src/fragments/14/fragment14_14A030.c index 6a6aaf6d..bec88d56 100644 --- a/src/fragments/14/fragment14_14A030.c +++ b/src/fragments/14/fragment14_14A030.c @@ -507,7 +507,7 @@ void func_86806A50(void) { unk_D_868084D8* var_s0; unk_func_80011B94* temp_a1; unk_D_86808808* ptr; - Gfx* temp = D_86807338; + Gfx* gfx = D_86807338; D_868084D4 = 0.0f; D_86809A08 = 0; @@ -529,7 +529,7 @@ void func_86806A50(void) { } for (i = 0, var_s0 = D_868084D8; i < 12; i++, var_s0++) { - var_s0->unk_40 = func_80011B10(temp_s2, 0, 5, temp, &D_8006F050, var_s0->unk_2C); + var_s0->unk_40 = func_80011B10(temp_s2, NULL, 5, gfx, &D_8006F050, var_s0->unk_2C); func_868061E8(0, var_s0, i, NULL); func_80012094(&D_800AC840, var_s0->unk_40); } diff --git a/src/fragments/15/fragment15.h b/src/fragments/15/fragment15.h new file mode 100644 index 00000000..c5064dba --- /dev/null +++ b/src/fragments/15/fragment15.h @@ -0,0 +1,175 @@ +#ifndef _FRAGMENT15_H_ +#define _FRAGMENT15_H_ + +#include "global.h" +#include "src/controller.h" +#include "src/1C720.h" + +typedef struct unk_D_8690B2F8 { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; +} unk_D_8690B2F8; // size >= 0x10 + +typedef struct unk_D_8690A710 { + /* 0x000 */ char unk000[0x4]; + /* 0x004 */ f32 unk_004; + /* 0x008 */ f32 unk_008; + /* 0x00C */ s32 unk_00C; + /* 0x010 */ char unk010[0x4]; + /* 0x014 */ u8 unk_014; + /* 0x015 */ char unk015[0x16F]; +} unk_D_8690A710; // size = 0x184 + +typedef struct unk_D_8690B350 { + /* 0x00 */ s32 unk_00; + /* 0x04 */ s32 unk_04; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ s16 unk_0C; + /* 0x0E */ s16 unk_0E; +} unk_D_8690B350; // size = 0x10 + +typedef struct unk_D_8690B360 { + /* 0x00 */ s16 unk_00; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; +} unk_D_8690B360; // size = 0x18 + +typedef struct unk_D_8690B308 { + /* 0x00 */ s16 unk_00[8]; + /* 0x18 */ f32 unk_10; + /* 0x1C */ f32 unk_14; + /* 0x20 */ f32 unk_18; + /* 0x24 */ f32 unk_1C; + /* 0x28 */ f32 unk_20; + /* 0x2C */ f32 unk_24; + /* 0x30 */ f32 unk_28; + /* 0x34 */ f32 unk_2C; + /* 0x38 */ s16 unk_30; + /* 0x3A */ s16 unk_32; + /* 0x3C */ s16 unk_34; + /* 0x3E */ s16 unk_36; +} unk_D_8690B308; // size >= 0x38 + +typedef struct unk_D_8690B3C0 { + /* 0x00 */ s32 unk_00; + /* 0x04 */ s32 unk_04; + /* 0x08 */ s32 unk_08; + /* 0x0C */ s32 unk_0C; +} unk_D_8690B3C0; // size >= 0x10 + +extern Vec3f D_86908C20; +extern Vec3f D_86908C2C; +extern Vec3f D_86908C38; +extern Vec3f D_86908C44; +extern char* D_86908C58[]; +extern Color_RGB8 D_86908C98; +extern Color_RGB8 D_86908C9C; + +extern const char D_8690A520[]; +extern const char D_8690A52C[]; +extern const char D_8690A538[]; +extern const char D_8690A544[]; +extern const char D_8690A550[]; +extern const char D_8690A55C[]; +extern const char D_8690A568[]; +extern const char D_8690A574[]; +extern const char D_8690A584[]; +extern const char D_8690A594[]; +extern const char D_8690A5A0[]; +extern const char D_8690A5AC[]; +extern const char D_8690A5B8[]; +extern const char D_8690A5C8[]; +extern const char D_8690A5D8[]; +extern const char D_8690A5E8[]; + +extern char* D_8690A678; +extern f32 D_8690A708; +extern unk_D_8690A710* D_8690A710; +extern unk_D_8690B2F8 D_8690B2F8; +extern unk_D_8690B308 D_8690B308; +extern s32 D_8690B344; +extern s32 D_8690B348; +extern unk_D_8690B350 D_8690B350; +extern unk_D_8690B360 D_8690B360; + +extern s32 D_8690B384; +extern s32 D_8690B388; +extern s32 D_8690B380; +extern s32 D_8690B38C; +extern Controller D_8690B390; +extern unk_D_8690B3C0 D_8690B3C0; +extern s8 D_8690B3D0[255]; + +s32 func_86900020(s32 arg0, unk_D_86002F34_000* arg1); +s32 func_86900088(s32 arg0, unk_D_86002F34_000* arg1); +s32 func_869000F4(s32 arg0, unk_D_86002F34_000* arg1); +void func_86900110(u8 arg0, u8 arg1, u8 arg2); +void func_86900188(void); +unk_D_86002F58_004_000_010_024* func_86900244(unk_func_8001BEE8* arg0); +void func_869002AC(void); +void func_86900410(void); +void func_86900484(s32 arg0); +void func_8690060C(void); +void func_869006DC(f32* arg0, f32* arg1, s16* arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, s16 arg7); +void func_8690079C(void); +void func_869009E8(Controller* arg0, Controller* arg1); +void func_86900A14(void); +void func_86900B04(f32* arg0, f32* arg1, s16 arg2, s16 arg3); +void func_86900B6C(void); +void func_86900B9C(void); +void func_86900CF4(void); +void func_86900D78(void); +void func_86900DE0(void); +void func_86900FFC(u16 arg0); +s32 func_86901044(void); +void func_86901384(void); +s32 func_86901558(void); +s32 func_8690172C(void); +s32 func_869017D0(void); +s32 func_869018A0(void); +s32 func_8690193C(void); +s32 func_869019BC(void); +void func_86901A44(void); +void func_86901B28(void); +void func_86901ECC(void); +void func_86901FB4(void); +void func_86902004(s32 arg0); +s32 func_86902098(s32 arg0, UNUSED s32 arg1); + +f32 func_86902230(Vec3f arg0, Vec3f arg1); +f32 func_86902294(f32 arg0); +f32 func_869022D8(Vec3f arg0, Vec3f arg1); +void func_8690232C(void); +void func_86902334(void); +void func_869024B4(void); +void func_869025BC(void); +s32 func_8690274C(void); +void func_86902814(Vec3f* arg0, MtxF* arg1); +void func_86902890(s16 arg0); +void func_86902AE8(void); +void func_86902E6C(Vec3f* arg0, Vec3f* arg1, Vec3f arg2, f32 arg3, s32 arg4); +void func_8690325C(Vec3f* arg0, Vec3f* arg1, Vec3f arg2, f32 arg3); +void func_8690351C(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, s32 arg4); +void func_869035F4(Vec3f* arg0, Vec3f* arg1); +void func_86903888(Vec3f* arg0, Vec3f* arg1, s32 arg2); +void func_86903D80(void); + +void func_869073D8(char*); +void func_86907858(s32); +void func_86907B78(void); +void func_86907D94(void); +void func_86908418(void); +void func_86908668(void); +void func_869089AC(void); + + +#endif // _FRAGMENT15_H_ diff --git a/src/fragments/15/fragment15_14CA70.c b/src/fragments/15/fragment15_14CA70.c index 68dc7763..560b01eb 100644 --- a/src/fragments/15/fragment15_14CA70.c +++ b/src/fragments/15/fragment15_14CA70.c @@ -1,71 +1,1165 @@ -#include "global.h" +#include "fragment15.h" +#include "src/fragments/3/fragment3.h" +#include "src/fragments/34/fragment34.h" +#include "src/fragments/43/fragment43.h" +#include "src/11BA0.h" +#include "src/12D80.h" +#include "src/17300.h" +#include "src/18140.h" +#include "src/18480.h" +#include "src/19840.h" +#include "src/1CF30.h" +#include "src/20330.h" +#include "src/26820.h" +#include "src/2E110.h" +#include "src/3FB0.h" +#include "src/49790.h" +#include "src/6A40.h" +#include "src/6BC0.h" +#include "src/F420.h" +#include "src/dp_intro.h" +#include "src/math_util.h" +#include "src/memory.h" +#include "src/stage_loader.h" +#include "src/util.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900020.s") +typedef struct unk_D_8690A69C { + /* 0x000 */ unk_D_86002F58_004_000_010_024* unk_000; + /* 0x004 */ unk_D_86002F58_004_000 unk_004; + /* 0x16C */ s32 unk_16C; +} unk_D_8690A69C; // size = 0x170 -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900088.s") +typedef struct unk_D_8690A718 { + /* 0x00 */ u8 unk_00; + /* 0x01 */ u8 unk_01; + /* 0x02 */ char unk02[0xE]; +} unk_D_8690A718; // size = 0x10 -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_869000F4.s") +typedef struct unk_D_86908CA0 { + /* 0x00 */ u8 unk_00; + /* 0x01 */ u8 unk_01; + /* 0x04 */ f32 unk_04; +} unk_D_86908CA0; // size = 0x8 -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900110.s") +typedef struct unk_D_86909168 { + /* 0x0 */ s32 unk_00; + /* 0x4 */ s32 unk_04; +} unk_D_86909168; // size = 0x8 -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900188.s") +typedef struct unk_D_869091B8 { + /* 0x00 */ u16 unk_00; + /* 0x02 */ u16 unk_02; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ s32 unk_10; + /* 0x14 */ char unk14[0xC]; +} unk_D_869091B8; // size = 0x20 -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900244.s") +static u8 D_86908A80[] = { + 0x00, 0x01, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x11, +}; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_869002AC.s") +static s32 D_86908A90[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xB, 0xFF }; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900410.s") +static u32 D_86908ABC[] = { + 0x0C00FFFF, 0x05000000, 0x0B00001E, 0x00000000, 0x014000F0, 0x0000000F, 0x00000000, 0x00000000, 0x05000000, + 0x0D000000, 0x05000000, 0x07000000, 0x8690A610, 0x14000000, 0x002D0019, 0xFFFFFF28, 0x08000000, 0x86900020, + 0x00000000, 0x14000000, 0x002D0019, 0x80808028, 0x08000000, 0x86900088, 0x00000000, 0x16646464, 0x0F000002, + 0x05000000, 0x1F00FFFF, 0x00000000, 0x00000000, 0x00000000, 0x00640064, 0x00640000, 0x08000000, 0x869000F4, + 0x00000000, 0x05000000, 0x07000000, 0x8690A630, 0x06000000, 0x06000000, 0x0F000003, 0x05000000, 0x1F00FFFF, + 0x00000000, 0x00000000, 0x00000000, 0x00640064, 0x00640000, 0x08000000, 0x869000F4, 0x00000000, 0x05000000, + 0x07000000, 0x8690A648, 0x06000000, 0x06000000, 0x0F000002, 0x05000000, 0x1F00FFFF, 0x00000000, 0x00000000, + 0x00000000, 0x00640064, 0x00640000, 0x08000000, 0x869000F4, 0x00000000, 0x05000000, 0x07000000, 0x8690A660, + 0x06000000, 0x06000000, 0x0F000003, 0x05000000, 0x0A000000, 0x800AC840, 0x06000000, 0x0F000002, 0x05000000, + 0x0A000000, 0x800AC858, 0x06000000, 0x09000000, 0x06000000, 0x06000000, 0x06000000, 0x01000000, +}; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900484.s") +Vec3f D_86908C20 = { 0.0f, 0.0f, 0.0f }; +Vec3f D_86908C2C = { 0.0f, 0.0f, 0.0f }; +Vec3f D_86908C38 = { 0.0f, 0.0f, 0.0f }; +Vec3f D_86908C44 = { 0.0f, 0.0f, 0.0f }; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_8690060C.s") +Color_RGB8 D_86908C50 = { 0, 0, 150 }; +Color_RGB8 D_86908C54 = { 0, 0, 250 }; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_869006DC.s") +char* D_86908C58[] = { + D_8690A520, D_8690A52C, D_8690A538, D_8690A544, D_8690A550, D_8690A55C, D_8690A568, D_8690A574, + D_8690A584, D_8690A594, D_8690A5A0, D_8690A5AC, D_8690A5B8, D_8690A5C8, D_8690A5D8, D_8690A5E8, +}; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_8690079C.s") +Color_RGB8 D_86908C98 = { 0, 100, 255 }; +Color_RGB8 D_86908C9C = { 100, 255, 255 }; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_869009E8.s") +static unk_D_86908CA0 D_86908CA0[] = { + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 5.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 4.0f }, { 0xAB, 0xAC, 1.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, -10.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, -4.0f }, { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 15.0f }, { 0xAB, 0xAC, 35.0f }, { 0xAB, 0xAC, -5.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 1.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0x5A, -8.0f }, { 0xAB, 0xAC, 11.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, -8.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, -5.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, -12.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 10.0f }, + { 0xAB, 0xAC, 25.0f }, { 0xAB, 0xAC, 18.0f }, { 0xAB, 0xAC, -8.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 30.0f }, { 0xAB, 0xAC, -10.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 10.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, -10.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, -5.0f }, + { 0xAB, 0xAC, 20.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 13.0f }, { 0xAB, 0xAC, 5.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 10.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, -5.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 6, 0.0f }, { 0xAB, 6, 5.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 13.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 30.0f }, + { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 25.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, -5.0f }, + { 0xAB, 0xAC, 15.0f }, { 0xAB, 0xAC, 35.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 50.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, 10.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 15.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, -5.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 5.0f }, { 0x75, 0xAC, 0.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0x10, 7.0f }, + { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, -10.0f }, + { 0xAB, 0xAC, -20.0f }, { 0xAB, 0xAC, 15.0f }, { 0xAB, 0xAC, 5.0f }, { 0xAB, 0xAC, 0.0f }, + { 0xAB, 0xAC, 30.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, -10.0f }, + { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 20.0f }, { 0xAB, 0xAC, 0.0f }, { 0xAB, 0xAC, 20.0f }, + { 0xAB, 0xAC, 35.0f }, { 0xAB, 0xAC, 20.0f }, { 0xAB, 0xAC, 15.0f }, { 0xAB, 0xAC, 10.0f }, + { 0xAB, 0xAC, 10.0f }, { 0xAB, 0xAC, 20.0f }, { 0xAB, 0xAC, -1.0f }, { 0, 0, 0.0f }, + { 0xAB, 0xAC, -8.0f }, +}; +static unk_D_86909168 D_86909168[] = { + { 0x1A, 0x60 }, { 0x7F, 0x117 }, { 0x135, 0x230 }, { 0x24A, 0x361 }, { 0x387, 0x46C }, + { 0x48D, 0x543 }, { 0x564, 0x653 }, { 0x673, 0x6D0 }, { 0x76C, 0x858 }, { 0x87D, 0x1FCC }, +}; + +static unk_D_869091B8 D_869091B8[] = { + { 0xC4, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x8000, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xD, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x8000, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x10, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 6, 0x8000, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x7F, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x28, 0x200, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 9, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x10, 0x800, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 9, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x23, 0x100, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xB, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x13, 0x400, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xF, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xF, 0x200, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x7C, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xA, 2, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x15, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x14, 1, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x15, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xC, 2, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x15, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 8, 8, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x15, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xA, 4, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x15, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 8, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x7B, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 2.0f, 0.0f, 2.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 3.0f, 0.0f, 3.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 5.0f, 0.0f, 5.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 7.0f, 0.0f, 7.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 8.0f, 0.0f, 8.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 9.0f, 0.0f, 9.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 10.0f, 0.0f, 10.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 12.0f, 0.0f, 12.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 13.0f, 0.0f, 13.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xE, 0, 14.0f, 0.0f, 14.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 13.0f, 0.0f, 13.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 5.0f, 0.0f, 5.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x1E, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 2.0f, 0.0f, -2.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 3.0f, 0.0f, -3.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 4.472136f, 2.0f, -4.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 2, 0, 5.385165f, 2.0f, -5.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 6.708204f, 3.0f, -6.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 6, 0, 8.062257f, 4.0f, -7.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 8.602324f, 5.0f, -7.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 9.433981f, 5.0f, -8.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 2, 0, 10.816653f, 6.0f, -9.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 11.661903f, 6.0f, -10.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 3, 0, 12.206555f, 7.0f, -10.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x12, 0, 13.038404f, 7.0f, -11.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 10.816653f, 6.0f, -9.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x14, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 2.0f, 0.0f, 2.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 4.0f, 0.0f, 4.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 5.0f, 0.0f, 5.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 6.0f, 0.0f, 6.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 7.0f, 0.0f, 7.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 9.0f, 0.0f, 9.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 10.0f, 0.0f, 10.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 2, 0, 11.0f, 0.0f, 11.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 3, 0, 12.0f, 0.0f, 12.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x12, 0, 13.0f, 0.0f, 13.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 5.0f, 0.0f, 5.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x71, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 3.0f, 0.0f, 3.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 5.0f, 0.0f, 5.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 7.0f, 0.0f, 7.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 9.0f, 0.0f, 9.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 12.0f, 0.0f, 12.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 14.0f, 0.0f, 14.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 19.0f, 0.0f, 19.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 27.0f, 0.0f, 27.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 40.0f, 0.0f, 40.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 8, 0, 64.0f, 0.0f, 63.999996f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 64.0f, 0.0f, 63.999992f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 46.0f, 0.0f, 46.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 10.0f, 0.0f, 10.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 8, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 3.0f, 0.0f, -3.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 6, 0, 5.385165f, 2.0f, -5.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 3.0f, 0.0f, -3.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 8, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 55.0f, 0.0f, 55.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 64.0f, -2.52435f, 63.950195f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 64.0f, -5.869891f, 63.730244f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 64.0f, -8.349089f, 63.453075f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 64.0f, -9.981604f, 63.216824f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0, 64.0f, -11.743815f, 62.9133f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 64.0f, -7.83112f, 63.51908f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 46.09772f, -3.0f, 46.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 14.0f, 0.0f, 14.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 6, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 2.0f, 0.0f, -2.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 6.0f, 0.0f, -6.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 9.486833f, 3.0f, -9.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 3, 0, 11.7047f, 4.0f, -11.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 13.0f, 5.0f, -12.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0, 13.928388f, 5.0f, -13.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 10.29563f, 5.0f, -9.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 3.0f, 0.0f, -3.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 7, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 34.0f, 0.0f, 34.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xA, 0, 64.0f, 0.0f, 63.999996f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 64.0f, 0.0f, 63.999992f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 60.0f, 0.0f, 60.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0, 29.0f, 0.0f, 29.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x8D, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x10, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x28, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x10, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x1A, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x10, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x22, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x10, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xB9, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x20, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xF, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 5, 0x400, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xF, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 5, 0x400, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xF, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 5, 0x400, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xF, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x30, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 3, 0x20, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x73, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x2000, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x28, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x2000, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x28, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x2000, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0xB0, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x10, 0x100, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 2, 0x8100, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x12, 0x100, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 3, 0x8100, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x18, 0x100, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0x8100, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 3, 0x100, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 3, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 9, 0x100, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 4, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 3, 0x8000, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 0x34, 0, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + { 1, 0x1000, 0.0f, 0.0f, 0.0f, 0xFF, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, +}; + +static unk_D_8690A610 D_8690A610; +static unk_D_86002F58_004_000_000 D_8690A630; +static unk_D_86002F58_004_000_000 D_8690A648; +static unk_D_86002F58_004_000_000 D_8690A660; +char* D_8690A678; +static s32 D_8690A67C; +static s32 D_8690A680; +static s32 pad_D_8690A684; +static u32 D_8690A688; +static Color_RGBA8_u32 D_8690A68C; +static s32 pad_D_8690A690; +static s32 pad_D_8690A694; +static BinArchive* D_8690A698; +static unk_D_8690A69C* D_8690A69C; +static unk_func_8001BEE8 D_8690A6A0; +static s32 D_8690A6F4; +static s32 D_8690A6F8; +static s32 D_8690A6FC; +static s32 D_8690A700; +static s32 D_8690A704; +f32 D_8690A708; +static s32 D_8690A70C; +unk_D_8690A710* D_8690A710; +static unk_D_8690A718 D_8690A718[190]; +unk_D_8690B2F8 D_8690B2F8; +unk_D_8690B308 D_8690B308; +static s32 D_8690B340; +s32 D_8690B344; +s32 D_8690B348; +unk_D_8690B350 D_8690B350; +unk_D_8690B360 D_8690B360; +static unk_func_80027FA0 D_8690B378; +s32 D_8690B380; +s32 D_8690B384; +s32 D_8690B388; +s32 D_8690B38C; +Controller D_8690B390; +static u16 D_8690B3B4; +static s32 D_8690B3B8; +static u16 D_8690B3BC; +unk_D_8690B3C0 D_8690B3C0; +s8 D_8690B3D0[255]; +static s8 D_8690B4D0[0x100]; +static Controller D_8690B5D0; +static s32 D_8690B5F4; +static s32 D_8690B5F8; + +s32 func_86900020(s32 arg0, unk_D_86002F34_000* arg1) { + unk_D_86002F34_alt18* ptr = (unk_D_86002F34_alt18*)arg1; + f32 sp28; + s16 sp26; + s16 sp24; + + if (arg0 == 2) { + func_800102A4(&D_8006F088->unk_60.at, &D_8006F088->unk_60.eye, &sp28, &sp26, &sp24); + ptr->unk_1C = sp26 + 0x2000; + ptr->unk_1E = sp24 - 0x2000; + } + return 0; +} + +s32 func_86900088(s32 arg0, unk_D_86002F34_000* arg1) { + unk_D_86002F34_alt18* ptr = (unk_D_86002F34_alt18*)arg1; + f32 sp28; + s16 sp26; + s16 sp24; + + if (arg0 == 2) { + func_800102A4(&D_8006F088->unk_60.at, &D_8006F088->unk_60.eye, &sp28, &sp26, &sp24); + ptr->unk_1C = -0x2000 - sp26; + ptr->unk_1E = sp24 + 0x6000; + } + return 0; +} + +s32 func_869000F4(s32 arg0, unk_D_86002F34_000* arg1) { + unk_D_86002F58_004_000* ptr = (unk_D_86002F58_004_000*)arg1; + + if (arg0 == 2) { + ptr->unk_03C.rgba = D_8690A68C.rgba; + } + return 0; +} + +void func_86900110(u8 arg0, u8 arg1, u8 arg2) { + u8 v = arg0 & arg1 & arg2; + + D_8690A68C.r = arg0; + D_8690A68C.g = arg1; + D_8690A68C.b = arg2; + + if (v == 0xFF) { + if (D_8690A610.unk_00.unk_14 == 1) { + D_8690A610.unk_00.unk_01 |= 1; + } + } else { + D_8690A610.unk_00.unk_01 &= ~1; + } +} + +void func_86900188(void) { + UNUSED s32 pad[2]; + u8* temp_a1 = (u32)_70D3A0_ROM_START + (D_80075BCC[D_8690A69C->unk_16C] & 0xFFFFFF); + u8* sp20 = (u32)_70D3A0_ROM_START + + (((D_8690A69C->unk_16C * sizeof(unk_70D3A0)) - sizeof(unk_70D3A0) + (u32)D_70110) & 0xFFFFFF); + u8* sp1C = sp20 + sizeof(unk_70D3A0); + + if (D_8690A69C->unk_16C == 153) { + sp20 = (u32)_70D3A0_ROM_START + ((u32)D_70290 & 0xFFFFFF); + sp1C = sp20 + sizeof(unk_70D3A0); + } + + func_80003B30(&D_8690A718->unk_00, temp_a1, temp_a1 + 0xBC0, 0); + func_80003B30(&D_8690B2F8, sp20, sp1C, 0); +} + +unk_D_86002F58_004_000_010_024* func_86900244(unk_func_8001BEE8* arg0) { + unk_D_86002F58_004_000_010_02C sp1C; + unk_D_86002F58_004_000_010* sp18; + + arg0->unk_00 = 25; + sp18 = func_80019760(1); + func_8001BEE8(&sp1C, arg0); + func_800198E4(sp18, arg0->unk_00 = 153, sp1C); + func_80019CA8(sp18); + + return sp18->unk_24; +} + +void func_869002AC(void) { + func_80031140(&D_8690A6A0, &D_83407AC8); + D_8690A69C->unk_16C = D_83407ACA; + + D_8690A708 = D_86908CA0[D_8690A69C->unk_16C - 1].unk_04; + D_8690A700 = D_86908CA0[D_8690A69C->unk_16C - 1].unk_00 - 6; + D_8690A704 = D_86908CA0[D_8690A69C->unk_16C - 1].unk_01 - 6; + + func_8001BB58(&D_8690A69C->unk_004); + func_8001987C(); + + if (D_8690A69C->unk_16C == 153) { + D_8690A69C->unk_000 = func_86900244(&D_8690A6A0); + } else { + D_8690A69C->unk_000 = func_80019D90(&D_8690A6A0); + } + + func_8001BC34(&D_8690A69C->unk_004, 0, D_8690A69C->unk_16C, D_8690A69C->unk_000->unk_08->unk_00[0]); + func_86900188(); + func_8001BD04(&D_8690A69C->unk_004, D_8690A718[D_8690A700].unk_00); + + D_8690A69C->unk_004.unk_024.y += D_8690B2F8.unk_08; + D_8690A69C->unk_004.unk_0A6 = 0; +} + +void func_86900410(void) { + while (func_80001C90() == 0) {} + + func_8001103C(NULL, &D_8690A630); + func_8001103C(NULL, &D_8690A648); + func_8001103C(NULL, &D_8690A660); + + main_pool_pop_state('BACK'); +} + +void func_86900484(s32 arg0) { + MemoryBlock* sp1C; + FragmentEntry sp18; + unk_D_86002F58_004_000_000* temp_v0; + unk_D_8690A610_018* temp_v1; + + main_pool_push_state('BACK'); + + sp18 = func_8000484C(D_8690A698, D_86908A80[arg0]); + sp1C = func_80002D10(main_pool_get_available(), 0); + + temp_v0 = sp18(0, 0); + if (temp_v0 != NULL) { + func_80012094(&D_8690A630, func_80018B70(sp1C, temp_v0)); + } + + temp_v0 = sp18(1, 0); + if (temp_v0 != NULL) { + func_80012094(&D_8690A648, func_80018B70(sp1C, temp_v0)); + } + + temp_v0 = sp18(3, 0); + if (temp_v0 != NULL) { + func_80012094(&D_8690A660, func_80018B70(sp1C, temp_v0)); + } + + D_8690A688 = sp18(2, 0); + func_80002D60(sp1C); + + temp_v1 = sp18(4, 0); + if (temp_v1 == NULL) { + D_8690A610.unk_00.unk_14 = 0; + D_8690A610.unk_00.unk_01 &= ~1; + } else { + D_8690A610.unk_18.unk_00 = temp_v1->unk_00; + D_8690A610.unk_18.unk_02 = temp_v1->unk_02; + D_8690A610.unk_18.unk_04.rgba = temp_v1->unk_04.rgba; + D_8690A610.unk_00.unk_14 = 1; + } + + func_86900110(0xFF, 0xFF, 0xFF); +} + +void func_8690060C(void) { + MemoryBlock* sp2C; + + func_800113F8(0, &D_8690A610, 0x3C0, 0x3E8, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001103C(NULL, &D_8690A630); + func_8001103C(NULL, &D_8690A648); + func_8001103C(NULL, &D_8690A660); + func_86900110(0xFF, 0xFF, 0xFF); + sp2C = func_80002D10(main_pool_get_available(), 0); + D_87906050 = func_80018B70(sp2C, &D_86908ABC); + func_80002D60(sp2C); + func_8001BB20(); +} + +void func_869006DC(f32* arg0, f32* arg1, s16* arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, s16 arg7) { + *arg2 = MathUtil_Atan2s(arg4 - arg6, arg3 - arg5); + + *arg0 = COSS(*arg2 + arg7) * 60.0f + arg5; + *arg1 = SINS(*arg2 + arg7) * 60.0f + arg6; +} + +void func_8690079C(void) { + D_8690B340 = 0; + if (D_8690A70C == 1) { + D_8690B344 = 0; + } else { + D_8690B344 = D_83402E20; + } + + D_8690A710->unk_014 = 1; + D_8690B380 = 0; + D_8690B384 = 0; + D_8690B388 = 0; + D_8690A710->unk_00C = 0; + D_8690A6F4 = 0; + D_8690A6F8 = 0; + D_8690A6FC = 0; + D_8690B348 = 0; + + D_8690B360.unk_02 = 0; + D_8690B360.unk_06 = 0; + D_8690B360.unk_0A = 0; + + D_8690B308.unk_00[0] = 0xA0; + D_8690B308.unk_00[4] = -0x14; + D_8690B308.unk_00[1] = 0x14A; + D_8690B308.unk_00[5] = 0x78; + D_8690B308.unk_00[2] = 0xA0; + D_8690B308.unk_00[6] = 0x104; + D_8690B308.unk_00[3] = -0xA; + D_8690B308.unk_00[7] = 0x78; + + func_869006DC(&D_8690B308.unk_10, &D_8690B308.unk_20, &D_8690B308.unk_30, 0.0f, 0.0f, 12.5f, 15.5f, 0); + func_869006DC(&D_8690B308.unk_14, &D_8690B308.unk_24, &D_8690B308.unk_32, 320.0f, 0.0f, 307.5f, 15.5f, -0x8000); + func_869006DC(&D_8690B308.unk_18, &D_8690B308.unk_28, &D_8690B308.unk_34, 320.0f, 240.0f, 308.8f, 224.5f, 0); + func_869006DC(&D_8690B308.unk_1C, &D_8690B308.unk_2C, &D_8690B308.unk_36, 0.0f, 240.0f, 12.5f, 224.5f, -0x8000); + + D_8690B3C0.unk_00 = 0xFF; + D_8690B3B8 = 0; + D_8690B3BC = D_869091B8[0].unk_00; + D_8690B3B4 = 0; + D_8690B5F4 = 0; + D_8690B5F8 = 0; +} + +void func_869009E8(Controller* arg0, Controller* arg1) { + arg0->buttonPressed = arg1->buttonPressed; + arg0->buttonDown = arg1->buttonDown; + arg0->stickX = arg1->stickX; + arg0->stickY = arg1->stickY; + arg0->stickMag = arg1->stickMag; +} + +#ifdef NON_MATCHING +void func_86900A14(void) { + s32 temp_t9; + u16 temp_v0; + s32* tmp = &D_8690B3B8; + + D_8690B3B4 = D_869091B8[D_8690B3B8].unk_02; + if (D_8690B3BC == 0) { + D_8690B3B8++; + D_8690B3BC = D_869091B8[D_8690B3B8].unk_00; + if (D_869091B8) {} + } + + D_8690B5D0.stickMag = D_869091B8[D_8690B3B8].unk_04; + D_8690B5D0.stickY = D_869091B8[*tmp].unk_0C; + D_8690B5D0.buttonPressed = D_869091B8[*tmp].unk_02 & (D_869091B8[*tmp].unk_02 ^ D_8690B3B4); + D_8690B5D0.buttonDown = D_869091B8[*tmp].unk_02; + + if (D_8690B3BC > 0) { + D_8690B3BC--; + } + + func_869009E8(&D_8690B390, &D_8690B5D0); +} +#else #pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900A14.s") +#endif + +void func_86900B04(f32* arg0, f32* arg1, s16 arg2, s16 arg3) { + *arg0 += arg3 * COSS(arg2); + *arg1 += arg3 * SINS(arg2); +} + +void func_86900B6C(void) { + Cont_StartReadInputs(); + Cont_ReadInputs(); + func_8001F730(); +} + +void func_86900B9C(void) { + if (D_8690A6F4 <= 0x96) { + D_8690A6F4++; + } + + if ((D_8690A6F4 >= 0x96) && (func_800174E4(&D_8690A69C->unk_004) != 0) && (D_8690A6FC == 0)) { + func_8001BD04(&D_8690A69C->unk_004, D_8690A718[D_8690A704].unk_00); + func_80017464(&D_8690A69C->unk_004, 0); + func_80017804(&D_8690A69C->unk_004, 0); + func_8001BD9C(&D_8690A69C->unk_004, D_8690A718[D_8690A704].unk_01); + D_8690A6FC = 1; + } + + if ((func_800174E4(&D_8690A69C->unk_004) != 0) && (D_8690A6FC == 1)) { + func_8001BD04(&D_8690A69C->unk_004, D_8690A718[D_8690A700].unk_00); + func_80017464(&D_8690A69C->unk_004, 0); + D_8690A6F4 = 0; + D_8690A6FC = 0; + } +} + +void func_86900CF4(void) { + D_8690A6F8++; + if (D_8690A6F8 == 60) { + D_8690A6F8 = 0; + if (D_8690A6FC == 0) { + func_80017804(&D_8690A69C->unk_004, 0); + func_8001BD9C(&D_8690A69C->unk_004, D_8690A718[D_8690A700].unk_01); + } + } +} + +void func_86900D78(void) { + if ((D_8690A69C->unk_004.unk_054.unk_00 != -1) && (func_8001783C(&D_8690A69C->unk_004) == 1)) { + func_80017804(&D_8690A69C->unk_004, 0); + func_8001BD9C(&D_8690A69C->unk_004, -1); + } +} + +void func_86900DE0(void) { + if ((D_8690B390.buttonPressed & 0x8000) && (D_8690B344 < 0x18)) { + func_80048B90(0x2C); + D_8690B340 = 0xA; + if (D_8690A70C != 1) { + func_8000E88C(&D_83402EE0[D_8690B344].unk_50, D_87906054->unk_60.eye.x, D_87906054->unk_60.eye.y, + D_87906054->unk_60.eye.z); + func_8000E88C(&D_83402EE0[D_8690B344].unk_5C, D_87906054->unk_60.at.x, D_87906054->unk_60.at.y, + D_87906054->unk_60.at.z); + D_83402EE0[D_8690B344].unk_6C = 0; + + D_83402EE0[D_8690B344].unk_6C = D_8690A710->unk_014 * 4; + if (D_8690A710->unk_008 == 25.0f) { + D_83402EE0[D_8690B344].unk_6C |= 2; + } + + D_83402EE0[D_8690B344].unk_6C |= D_8690A710->unk_00C * 0x10; + D_83402EE0[D_8690B344].unk_68 = D_8140E6B8; + + D_83402EE0[D_8690B344].unk_00 = D_8690A69C->unk_004.unk_024.y; + D_83402EE0[D_8690B344].unk_04 = D_8690A69C->unk_16C; + D_83402EE0[D_8690B344].unk_06 = D_8690A69C->unk_004.unk_040.unk_08 >> 0x10; + D_83402EE0[D_8690B344].unk_05 = D_8690A69C->unk_004.unk_040.unk_00; + D_83402EE0[D_8690B344].unk_08 = D_8690A69C->unk_004.unk_054.unk_00; + D_83402EE0[D_8690B344].unk_09 = D_8690A69C->unk_004.unk_054.unk_08; + + func_81002174(D_83402EE0[D_8690B344].unk_0A); + func_8003107C(&D_83402EE0[D_8690B344].unk_70, &D_8690A6A0); + } + + D_8690B360.unk_00 = 0x14; + + D_8690B344++; + if (D_8690A70C != 1) { + D_83402E20 = D_8690B344; + } + + func_800077B4(1); + } +} + +void func_86900FFC(u16 arg0) { + if (arg0 & 0xC00) { + func_86900410(); + func_86900484(D_8690A710->unk_00C); + D_8690B340 = 5; + } +} + +s32 func_86901044(void) { + u16 sp1E; + + if ((D_8690B390.buttonPressed & 0x8020) && (D_8690B380 == 1)) { + D_8690B380 = ~D_8690B380 + 2; + func_80048B90(3); + return 1; + } + + if (D_8690B390.buttonPressed & 0x20) { + D_8690B380 = ~D_8690B380 + 2; + func_80048B90(2); + } + + if (D_8690B380 == 0) { + return 0; + } + + if (!(D_8690B390.buttonDown & 0xC00)) { + D_8690A680 = -1; + return 1; + } + + sp1E = D_8690B390.buttonDown; + D_8690A680++; + if ((D_8690A680 >= 8) || (D_8690A680 == 0)) { + func_80048B90(1); + if (D_8690A680 != 0) { + D_8690A680 = 6; + } + } else { + return 1; + } + + D_8690B38C = 0xF; + if (D_8690B378.unk_07 == 0) { + if (D_8690B378.unk_04 == 8) { + D_8690B38C--; + } else if (D_8690B378.unk_04 == 7) { + D_8690B38C -= 2; + } else { + D_8690B38C -= 2; + D_8690B38C += D_8690B378.unk_04 - 7; + } + } + + if ((sp1E & 0x800) && (D_8690B388 == 0) && (D_8690B384 == 0) && (D_8690A710->unk_00C == 0)) { + D_8690B384 = D_8690B38C - 4; + D_8690A710->unk_00C = D_8690B38C; + D_8690B388 = 4; + func_86900FFC(sp1E); + } else if ((sp1E & 0x400) && (D_8690B388 == 4) && (D_8690B384 == (D_8690B38C - 4)) && + (D_8690B38C == D_8690A710->unk_00C)) { + D_8690B384 = 0; + D_8690A710->unk_00C = 0; + D_8690B388 = 0; + func_86900FFC(sp1E); + } else { + if (sp1E & 0x800) { + if (D_8690A710->unk_00C > 0) { + D_8690A710->unk_00C--; + } + } + + if (sp1E & 0x400) { + if (D_8690A710->unk_00C < D_8690B38C) { + D_8690A710->unk_00C++; + } + } + + if ((sp1E & 0x800) && (D_8690B388 == 0) && (D_8690B384 > 0)) { + D_8690B384--; + } + + if ((sp1E & 0x400) && (D_8690B388 == 4) && (D_8690B384 < (D_8690B38C - 4))) { + D_8690B384++; + } + + if ((sp1E & 0x800) && (D_8690B388 > 0)) { + D_8690B388--; + } + + if ((sp1E & 0x400) && (D_8690B388 < 4)) { + D_8690B388++; + } + + func_86900FFC(sp1E); + } + + return 1; +} + +void func_86901384(void) { + s32 i; + + if ((D_8690A70C == 1) && (D_86908A90[D_8690B5F4] != 0xFF)) { + D_8690B5F8++; + if (D_8690B5F8 == D_86909168[D_8690B5F4].unk_00) { + D_8690B3C0.unk_00 = 0; + } + + if (D_8690B5F8 == D_86909168[D_8690B5F4].unk_04) { + D_8690B3C0.unk_00 = 0xFF; + D_8690B5F4++; + } + + switch (D_8690B3C0.unk_00) { + case 0x0: + D_8690B3C0.unk_04 = 0; + D_8690B3C0.unk_08 = 0xC8; + D_8690B3C0.unk_0C = 0x14; + + // clang-format off + for (i = 0; i < 255; i++) { D_8690B3D0[i] = 0; } + // clang-format on + + sprintf(D_8690B4D0, func_8002D7C0(NULL, 0, D_8690A678, D_86908A90[D_8690B5F4])); + D_8690B3C0.unk_00++; + break; + + case 0x1: + D_8690B3C0.unk_0C = func_8001046C(D_8690B3C0.unk_0C, 0x23, 0xA, 0xA); + if (D_8690B3C0.unk_0C == 0x23) { + D_8690B3C0.unk_00++; + } + break; + + case 0x2: + if (D_8690B4D0[D_8690B3C0.unk_04] != 0) { + D_8690B3D0[D_8690B3C0.unk_04] = D_8690B4D0[D_8690B3C0.unk_04]; + D_8690B3C0.unk_04++; + func_80048B90(0x3C); + } + break; + + case 0xFF: + break; + } + } +} + +s32 func_86901558(void) { + func_86901384(); + + if (D_8690B360.unk_00 != 0) { + D_8690B360.unk_02 -= 3; + } + + D_8690B360.unk_00 = func_8001046C(D_8690B360.unk_00, 0, 2, 2); + + if (D_8690B340) { + D_8690B340--; + return 0; + } + + if (D_8690B344 && D_8690B344 && D_8690B344) {} + + if (D_8690B344 == 0x18) { + D_8690B360.unk_00 = 0x14; + D_8690B350.unk_04 = 0; + D_8690B348 = 1; + D_8690B344--; + func_80048B90(0x2D); + return 0; + } + + if (func_86901044() != 0) { + return 0; + } + + if (func_8690274C() != 0) { + return 0; + } + + if (gPlayer1Controller->buttonPressed & 0x4000) { + func_80048B90(3); + D_8690A67C = 1; + return D_8690A67C; + } + + if (D_8690B390.buttonPressed & 0x1000) { + func_80048B90(0x2E); + D_8690A67C = 2; + return D_8690A67C; + } + + if (D_8690B390.buttonPressed & 0x2000) { + D_8690A710->unk_014++; + if (D_8690A710->unk_014 == 3) { + D_8690A710->unk_014 = 0; + } + + if (D_8690A710->unk_014 == 0) { + func_80048B90(3); + } else { + func_80048B90(2); + } + } + + func_86902AE8(); + func_86903D80(); + func_86900DE0(); + return 0; +} + +s32 func_8690172C(void) { + D_8690B360.unk_04 = 0; + D_8690B360.unk_02 += 4; + + if (D_8690B360.unk_00 == 0) { + if (D_8690B344 != 0) { + D_8690B344--; + D_8690B360.unk_00 = 0x14; + } else { + D_8690B348 = 2; + func_80048B90(0x2E); + D_8690B360.unk_08 = 0xE38; + } + } + + D_8690B360.unk_00 = func_8001046C(D_8690B360.unk_00, 0, 0xF, 0xF); + return 0; +} + +s32 func_869017D0(void) { + D_8690B360.unk_02 += 4; + D_8690B360.unk_04 = func_8001046C(D_8690B360.unk_04, 0x30, 0xA, 0xA); + + if (D_8690B360.unk_04 >= 0x30) { + D_8690B360.unk_08 = func_8001046C(D_8690B360.unk_08, 0, 0xC8, 0xC8); + D_8690B360.unk_0A -= 0x31C7; + D_8690B360.unk_06 = SINS(D_8690B360.unk_0A) * D_8690B360.unk_08; + if (D_8690B360.unk_08 == 0) { + D_8690B360.unk_06 = 0; + D_8690B348 = 3; + } + } + return 0; +} + +s32 func_869018A0(void) { + D_8690B350.unk_04 = func_8001046C(D_8690B350.unk_04, 0x50, 0xA, 0xA); + if (D_8690B350.unk_04 == 0x50) { + D_8690B350.unk_0C = 0xAA; + D_8690B350.unk_0E = 0xA; + D_8690B350.unk_08 = 0xA0 - (D_8690B350.unk_0C / 2); + D_8690B350.unk_0A = 0x78; + D_8690B350.unk_00 = 0; + D_8690B348 = 4; + func_80048B90(0x30); + } + return 0; +} + +s32 func_8690193C(void) { + D_8690B350.unk_0E = func_8001046C(D_8690B350.unk_0E, 0x32, 0xA, 0xA); + + if (D_8690B350.unk_0E == 0x32) { + D_8690B350.unk_00++; + } + + if (D_8690B350.unk_00 == 0x32) { + D_8690A67C = 2; + return D_8690A67C; + } + + return 0; +} + +s32 func_869019BC(void) { + switch (D_8690B348) { + case 0: + return func_86901558(); + + case 1: + return func_8690172C(); + + case 2: + return func_869017D0(); + + case 3: + return func_869018A0(); + + case 4: + return func_8690193C(); + } +} + +void func_86901A44(void) { + func_800079C4(); + + if ((D_8690A688 == -1) || (D_8690A688 == 0)) { + func_8000699C(&gDisplayListHead, 1); + } else if (D_8690A688 < 0x10000) { + func_8000699C(&gDisplayListHead, D_8690A688); + } else { + func_8000699C(&gDisplayListHead, 0xA6BF); + } + + func_80015348(); + func_80015094(D_87906050); + func_86908668(); + func_86907B78(); + func_86907D94(); + func_86908418(); + func_869089AC(); + func_869073D8(D_8690A6A0.unk_30); + func_86907858(D_8690A710->unk_00C); + func_80007778(); +} + +void func_86901B28(void) { + f32 temp_fv0; + f32 tmp1; + f32 tmp2; + f32 tmp3; + f32 tmp4; + s32 i; + s16 var_s3 = 0; + + func_80006C6C(0x14); + D_8690B360.unk_10 -= 0.8; + D_8690B360.unk_14 = 0.0f; + D_8690B360.unk_0C = 351.0f; + + for (i = 0; i < 15; i++) { + func_86900B6C(); + func_86901A44(); + } + + tmp2 = 5.7f; + tmp3 = 0.6f; + tmp1 = 19.0f; + func_80048B90(0x2F); + tmp4 = tmp2 * tmp3; + + while (true) { + func_86900B6C(); + var_s3 = func_8001046C(var_s3, 0x46, 0xA, 0xA); + D_8690B308.unk_00[0] = func_8001046C(D_8690B308.unk_00[0], 0xA0, 0xA, 0xA); + D_8690B308.unk_00[4] = func_8001046C(D_8690B308.unk_00[4], 0x24, 0xA, 0xA); + D_8690B308.unk_00[1] = func_8001046C(D_8690B308.unk_00[1], 0x120, 0xA, 0xA); + D_8690B308.unk_00[5] = func_8001046C(D_8690B308.unk_00[5], 0x78, 0xA, 0xA); + D_8690B308.unk_00[2] = func_8001046C(D_8690B308.unk_00[2], 0xA0, 0xA, 0xA); + D_8690B308.unk_00[6] = func_8001046C(D_8690B308.unk_00[6], 0xCC, 0xA, 0xA); + D_8690B308.unk_00[3] = func_8001046C(D_8690B308.unk_00[3], 0x20, 0xA, 0xA); + D_8690B308.unk_00[7] = func_8001046C(D_8690B308.unk_00[7], 0x78, 0xA, 0xA); + + if (var_s3 < 0x3D) { + func_86900B04(&D_8690B308.unk_10, &D_8690B308.unk_20, D_8690B308.unk_30 + 0x8000, 0xA); + func_86900B04(&D_8690B308.unk_14, &D_8690B308.unk_24, D_8690B308.unk_32, 0xA); + func_86900B04(&D_8690B308.unk_18, &D_8690B308.unk_28, D_8690B308.unk_34 + 0x8000, 0xA); + func_86900B04(&D_8690B308.unk_1C, &D_8690B308.unk_2C, D_8690B308.unk_36, 0xA); + } + + D_8690B360.unk_10 = -tmp1; + + temp_fv0 = -(D_8690B360.unk_0C - (tmp4 + 251.0f)); + if (temp_fv0 >= 0.0) { + D_8690B360.unk_10 -= tmp2 * (0.0 - temp_fv0); + } + + D_8690B360.unk_10 *= tmp3; + D_8690B360.unk_14 += D_8690B360.unk_10; + D_8690B360.unk_14 *= tmp3; + + D_8690B360.unk_0C += D_8690B360.unk_14; + + if ((D_8690B360.unk_14 >= 0.0f) && (D_8690B360.unk_14 <= 1.0f)) { + break; + } + + func_86901A44(); + } + + func_86900B6C(); + D_8690B360.unk_0C = 251.0f; + func_86901A44(); +} + +void func_86901ECC(void) { + s32 var_s0 = 1; + void (*temp_s1)(void) = Util_ConvertAddrToVirtAddr(func_8140C734); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900B04.s") + while (var_s0 != 0) { + func_86900B6C(); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900B6C.s") + if (D_8690A70C != 1) { + func_869009E8(&D_8690B390, gPlayer1Controller); + } else { + func_86900A14(); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900B9C.s") + if (func_869019BC() != 0) { + var_s0 = 0; + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900CF4.s") + func_86900B9C(); + func_86900CF4(); + func_86900D78(); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900D78.s") + temp_s1(); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900DE0.s") + func_86901A44(); + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86900FFC.s") +void func_86901FB4(void) { + s32 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86901044.s") + func_80006CB4(0x1E); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86901384.s") + for (i = 0; i < 30; i++) { + func_86900B6C(); + func_86901A44(); + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86901558.s") +void func_86902004(s32 arg0) { + D_8690A70C = arg0; + func_8690060C(); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_8690172C.s") + D_8690A69C = main_pool_alloc(sizeof(unk_D_8690A69C), 0); + bzero(D_8690A69C, sizeof(unk_D_8690A69C)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_869017D0.s") + D_8690A710 = main_pool_alloc(sizeof(unk_D_8690A710), 0); + bzero(D_8690A710, sizeof(unk_D_8690A710)); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_869018A0.s") + func_8690079C(); + func_869002AC(); + func_86902334(); + func_86900484(D_8690A710->unk_00C); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_8690193C.s") +s32 func_86902098(s32 arg0, UNUSED s32 arg1) { + unk_func_80007444* sp24; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_869019BC.s") + main_pool_push_state('SNAP'); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86901A44.s") + func_80005E40(0x10000, 0); + sp24 = func_80007444(0, 1, 3, 1, 2, 1); + func_8001E94C(0x16, 0); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86901B28.s") + ASSET_LOAD(D_1000000, common_menu1_ui, 0); + ASSET_LOAD(D_5000000, snap_mode_ui, 0); + ASSET_LOAD(D_2000000, common_menu2_ui, 0); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86901ECC.s") + func_80028AFC(2); + func_80027FA0(&D_8690B378, 0); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86901FB4.s") + D_8690A698 = ASSET_LOAD2(_5C7A70, stadium_models, 1, 1); + func_8002D510(); + D_8690A678 = func_8002D5AC(0x2B); + func_86902004(arg0); + func_80007678(sp24); + func_86901B28(); + func_86901ECC(); + func_86901FB4(); + func_800076C0(); + func_8001E9CC(); + func_80005EAC(); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86902004.s") + main_pool_pop_state('SNAP'); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14CA70/func_86902098.s") + return D_8690A67C; +} diff --git a/src/fragments/15/fragment15_14EC80.c b/src/fragments/15/fragment15_14EC80.c index e50bee27..e074ec28 100644 --- a/src/fragments/15/fragment15_14EC80.c +++ b/src/fragments/15/fragment15_14EC80.c @@ -1,33 +1,498 @@ -#include "global.h" +#include "fragment15.h" +#include "src/F420.h" +#include "src/stage_loader.h" +#include "src/fragments/3/fragment3.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_86902230.s") +static s16 D_8690B600; +static s16 D_8690B602; +static f32 D_8690B604; +static s16 D_8690B608; +static s16 D_8690B60A; +static f32 D_8690B60C; +static f32 D_8690B610; +static Vec3f D_8690B618; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_86902294.s") +f32 func_86902230(Vec3f arg0, Vec3f arg1) { + return sqrtf(SQ(arg1.x - arg0.x) + SQ(arg1.y - arg0.y) + SQ(arg1.z - arg0.z)); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_869022D8.s") +f32 func_86902294(f32 arg0) { + f32 temp_fv1 = (D_8690B2F8.unk_00 + D_8690A708) * arg0; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_86902334.s") + if (temp_fv1 > 400.0f) { + return 400.0f; + } + return temp_fv1; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_869024B4.s") +f32 func_869022D8(Vec3f arg0, Vec3f arg1) { + return sqrtf(SQ(arg1.x - arg0.x) + SQ(arg1.z - arg0.z)); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_869025BC.s") +void func_8690232C(void) { +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_8690274C.s") +void func_86902334(void) { + D_87906054 = D_87906050->unk_00.unk_0C; + D_8690B600 = 0; + D_8690B602 = 0; + D_8690B604 = func_86902294(4.0f); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_86902814.s") + if (D_8690B2F8.unk_08 != 0.0f) { + D_87906054->unk_60.at.y = D_8690B2F8.unk_08; + } else { + D_87906054->unk_60.at.y = D_8690B2F8.unk_04 + D_8690B2F8.unk_0C; + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_86902890.s") + func_80010354(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, D_8690B604, D_8690B600, D_8690B602); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_86902AE8.s") + if (D_87906054->unk_60.eye.y < 12.0f) { + D_87906054->unk_60.eye.y = 12.5f; + func_800102A4(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, &D_8690B604, &D_8690B600, &D_8690B602); + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_86902E6C.s") + D_87906054->unk_24.near = 20.0f; + D_87906054->unk_24.far = 10000.0f; + D_87906054->unk_24.fovy = 40.0f; + D_8690A710->unk_008 = 40.0f; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_8690325C.s") + D_8690B610 = 0.0f; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_8690351C.s") + func_8000E88C(&D_8690B618, D_87906054->unk_60.at.x, D_87906054->unk_60.at.y, D_87906054->unk_60.at.z); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_869035F4.s") +void func_869024B4(void) { + f32 temp_fv1; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_86903888.s") + if (gPlayer2Controller->stickMag != 0.0f) { + if (gPlayer2Controller->stickY >= 0.0f) { + D_8690A708 += gPlayer2Controller->stickMag / 400.0f; + } else { + D_8690A708 -= gPlayer2Controller->stickMag / 400.0f; + } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_14EC80/func_86903D80.s") + temp_fv1 = 10.0f - D_8690B2F8.unk_00; + if (D_8690A708 < temp_fv1) { + D_8690A708 = temp_fv1; + } + + if (D_8690A708 > 60.0f) { + D_8690A708 = 60.0f; + } + } + + HAL_Printf(0x14, 0x14, "OFFSET %6.2f", D_8690A708); +} + +void func_869025BC(void) { + D_8690B600 = 0; + D_8690B602 = 0; + D_8690B604 = func_86902294(4.0f); + D_87906054->unk_60.at.x = 0.0f; + D_87906054->unk_60.at.z = 0.0f; + + if (D_8690B2F8.unk_08 != 0) { + D_87906054->unk_60.at.y = D_8690B2F8.unk_08; + } else { + D_87906054->unk_60.at.y = D_8690B2F8.unk_04 + D_8690B2F8.unk_0C; + } + + func_80010354(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, D_8690B604, D_8690B600, D_8690B602); + + if (D_87906054->unk_60.eye.y < 12.0f) { + D_87906054->unk_60.eye.y = 12.5f; + func_800102A4(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, &D_8690B604, &D_8690B600, &D_8690B602); + } + + D_87906054->unk_24.near = 20.0f; + D_87906054->unk_24.far = 10000.0f; + D_87906054->unk_24.fovy = 40.0f; + D_8690A710->unk_008 = 40.0f; + D_8690B610 = 0.0f; + + func_8000E88C(&D_8690B618, D_87906054->unk_60.at.x, D_87906054->unk_60.at.y, D_87906054->unk_60.at.z); +} + +s32 func_8690274C(void) { + if (D_8690B390.buttonPressed & 0x10) { + if (D_8690A710->unk_008 == 25.0f) { + D_8690A710->unk_008 = 40.0f; + } else { + D_8690A710->unk_008 = 25.0f; + } + } + + D_87906054->unk_24.fovy = func_800104AC(D_87906054->unk_24.fovy, D_8690A710->unk_008, 1.5f, 1.5f); + + if (D_87906054->unk_24.fovy == D_8690A710->unk_008) { + return 0; + } + return 1; +} + +void func_86902814(Vec3f* arg0, MtxF* arg1) { + f32 x = (arg1->mf[0][0] * arg0->x) + (arg1->mf[0][1] * arg0->y) + (arg1->mf[0][2] * arg0->z); + f32 y = (arg1->mf[1][0] * arg0->x) + (arg1->mf[1][1] * arg0->y) + (arg1->mf[1][2] * arg0->z); + f32 z = (arg1->mf[2][0] * arg0->x) + (arg1->mf[2][1] * arg0->y) + (arg1->mf[2][2] * arg0->z); + + arg0->x = x; + arg0->y = y; + arg0->z = z; +} + +void func_86902890(s16 arg0) { + MtxF sp70; + Vec3s sp68; + Vec3f sp5C; + Vec3f sp50; + UNUSED s32 pad[3]; + Vec3f sp38; + UNUSED s32 pad2; + + func_8000E88C(&sp38, 0, 0.0f, 0.0f); + func_800102A4(&sp38, &D_87906054->unk_60.eye, &D_8690B60C, &D_8690B608, &D_8690B60A); + func_8000E88C(&sp50, D_87906054->unk_60.at.x, 0.0f, D_87906054->unk_60.at.z); + func_8000EB70(&sp68, 0, D_8690B60A + arg0, 0); + func_8000E88C(&sp5C, D_8690A710->unk_004 * 4.0f, 0.0f, 0.0f); + func_8000F3FC(&sp70, &D_87906054->unk_60.at, &sp68); + func_86902814(&sp5C, &sp70); + + sp50.x += sp5C.x; + sp50.z += sp5C.z; + + D_87906054->unk_60.at.x = sp50.x; + D_87906054->unk_60.at.z = sp50.z; + + func_800102A4(&sp38, &D_87906054->unk_60.at, &D_8690B60C, &D_8690B608, &D_8690B60A); + D_8690B60C = func_869022D8(sp38, D_87906054->unk_60.at); + if ((func_86902294(1.9f) - 1.0f) <= D_8690B60C) { + func_80010354(&sp38, &sp50, func_86902294(1.9f) - 1.0f, 0, D_8690B60A); + D_87906054->unk_60.at.x = sp50.x; + D_87906054->unk_60.at.z = sp50.z; + } + func_800102A4(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, &D_8690B604, &D_8690B600, &D_8690B602); +} + +void func_86902AE8(void) { + if (((D_8690B390.buttonDown & 8) | (D_8690B390.buttonDown & 4) | (D_8690B390.buttonDown & 2) | + (D_8690B390.buttonDown & 1)) != 0) { + D_8690A710->unk_004 = func_800104AC(D_8690A710->unk_004, 1.0f, 0.2f, 0.2f); + } else { + D_8690A710->unk_004 = func_800104AC(D_8690A710->unk_004, 0.0f, 0.2f, 0.2f); + } + + if ((D_8690B390.buttonDown & 8) && (D_87906054->unk_60.at.y < 300.0f)) { + D_87906054->unk_60.at.y += 4.0f * D_8690A710->unk_004; + func_800102A4(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, &D_8690B604, &D_8690B600, &D_8690B602); + if (D_8690B600 < -0x38E3) { + D_87906054->unk_60.at.y -= 4.0f * D_8690A710->unk_004; + } + func_800102A4(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, &D_8690B604, &D_8690B600, &D_8690B602); + } else if ((D_8690B390.buttonDown & 4) && (D_87906054->unk_60.at.y > 5.0f)) { + D_87906054->unk_60.at.y -= 4.0f * D_8690A710->unk_004; + func_800102A4(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, &D_8690B604, &D_8690B600, &D_8690B602); + if (D_8690B600 >= 0x38E4) { + D_87906054->unk_60.at.y += 4.0f * D_8690A710->unk_004; + } + func_800102A4(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, &D_8690B604, &D_8690B600, &D_8690B602); + } + + if (D_87906054->unk_60.at.y > 200.0f) { + D_87906054->unk_60.at.y = 200.0f; + func_800102A4(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, &D_8690B604, &D_8690B600, &D_8690B602); + } + + if (D_87906054->unk_60.at.y < 5.0f) { + D_87906054->unk_60.at.y = 5.0f; + func_800102A4(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, &D_8690B604, &D_8690B600, &D_8690B602); + } + + if (D_8690B390.buttonDown & 1) { + func_86902890(0); + } else if (D_8690B390.buttonDown & 2) { + func_86902890(-0x8000); + } +} + +void func_86902E6C(Vec3f* arg0, Vec3f* arg1, Vec3f arg2, f32 arg3, s32 arg4) { + Vec3f sp94; + Vec3f sp88; + Vec3f sp7C; + Vec3f sp70; + f32 sp6C; + f32 sp68; + f32 tmp; + f32 sp3C; + f32 sp38; + f32 sp34; + f32 sp54; + + sp70 = D_86908C20; + + if (arg0->x == arg1->x) { + sp7C.x = arg0->x; + if (arg0->z < 0.0) { + sp7C.z = -arg3; + } else { + sp7C.z = arg3; + } + } else { + sp6C = (arg1->z - arg0->z) / (arg1->x - arg0->x); + sp68 = arg1->z - (arg1->x * sp6C); + + sp54 = (((SQ(arg2.x) + SQ(sp68)) - ((2 * arg2.z) * sp68)) + SQ(arg2.z)) - SQ(arg3); + + sp38 = SQ(sp6C) + 1.0f; + sp3C = (((2 * sp6C) * sp68) - (2 * arg2.x)) - ((2 * arg2.z) * sp6C); + + if (SQ(sp3C) < ((4 * sp38) * sp54)) { + func_8000E88C(arg1, arg0->x, arg0->y, arg0->z); + return; + } + + sp34 = SQ(sp3C) - ((4 * sp38) * sp54); + + sp94.x = (-sp3C - sqrtf(sp34)) / (2 * sp38); + sp94.y = 0.0f; + sp94.z = (sp6C * sp94.x) + sp68; + + sp88.x = (sqrtf(sp34) + -sp3C) / (2 * sp38); + sp88.y = 0.0f; + sp88.z = (sp6C * sp88.x) + sp68; + + if (func_869022D8(*arg0, sp94) > func_869022D8(*arg0, sp88)) { + sp7C.x = sp88.x; + sp7C.z = sp88.z; + } else { + sp7C.x = sp94.x; + sp7C.z = sp94.z; + } + } + + sp6C = arg0->y - arg1->y; + if (sp6C == 0.0f) { + sp7C.y = arg1->y; + } else { + if (arg1->x == arg0->x) { + tmp = (sp7C.z - arg0->z) / (arg1->z - arg0->z); + } else { + tmp = (sp7C.x - arg0->x) / (arg1->x - arg0->x); + } + + if (arg4 == 1) { + sp7C.y = ((arg1->y - arg0->y) * tmp) + arg0->y; + } else { + sp7C.y = ((arg0->y - arg1->y) * tmp) + arg1->y; + } + } + + func_8000E88C(arg0, arg1->x, arg1->y, arg1->z); + func_8000E88C(arg1, sp7C.x, sp7C.y, sp7C.z); + func_800102A4(&D_87906054->unk_60.at, arg1, &D_8690B604, &D_8690B600, &D_8690B602); +} + +void func_8690325C(Vec3f* arg0, Vec3f* arg1, Vec3f arg2, f32 arg3) { + Vec3f sp84; + Vec3f sp78; + Vec3f tmp; + Vec3f sp60; + f32 sp5C; + f32 sp58; + f32 sp40; + f32 sp3C; + f32 sp38; + f32 sp2C; + f32 sp44; + + sp60 = D_86908C2C; + sp2C = arg1->x; + tmp.z = arg3; + if (D_87906054->unk_60.at.x == sp2C) { + tmp.x = D_87906054->unk_60.at.x; + } else { + sp5C = (arg1->z - D_87906054->unk_60.at.z) / (arg1->x - D_87906054->unk_60.at.x); + sp58 = arg1->z - (arg1->x * sp5C); + + sp44 = (((SQ(arg2.x) + SQ(sp58)) - ((2 * arg2.z) * sp58)) + SQ(arg2.z)) - SQ(arg3); + + sp3C = SQ(sp5C) + 1.0f; + sp38 = ((2 * sp5C * sp58) - (2 * arg2.x)) - ((2 * arg2.z) * sp5C); + + sp2C = SQ(sp38) - ((4 * sp3C) * sp44); + + sp84.x = (-sp38 - sqrtf(sp2C)) / (2 * sp3C); + sp84.y = 0.0f; + sp84.z = (sp5C * sp84.x) + sp58; + + sp78.x = (sqrtf(sp2C) + -sp38) / (2 * sp3C); + sp78.y = 0.0f; + sp78.z = (sp5C * sp78.x) + sp58; + + if (func_869022D8(*arg1, sp84) > func_869022D8(*arg1, sp78)) { + tmp.x = sp78.x; + tmp.z = sp78.z; + } else { + tmp.x = sp84.x; + tmp.z = sp84.z; + } + } + + tmp.y = arg0->y; + + func_8000E88C(arg1, tmp.x, tmp.y, tmp.z); + func_800102A4(&D_87906054->unk_60.at, arg1, &D_8690B604, &D_8690B600, &D_8690B602); +} + +void func_8690351C(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, s32 arg4) { + f32 temp_fa0; + + arg2 += arg3; + + if (arg4 == 1) { + temp_fa0 = (arg2 - arg0->y) / (arg1->y - arg0->y); + if (arg1->x == arg0->x) { + arg1->x = arg0->x; + } else { + arg1->x = ((arg1->x - arg0->x) * temp_fa0) + arg0->x; + } + + if (arg1->z == arg0->z) { + arg1->z = arg0->z; + } else { + arg1->z = ((arg1->z - arg0->z) * temp_fa0) + arg0->z; + } + } + + arg1->y = arg2; + func_800102A4(&D_87906054->unk_60.at, arg1, &D_8690B604, &D_8690B600, &D_8690B602); +} + +void func_869035F4(Vec3f* arg0, Vec3f* arg1) { + UNUSED s32 pad[2]; + Vec3f sp3C = D_86908C38; + f32 sp38; + + if (arg1->y < 12.0f) { + func_8690351C(arg0, arg1, 12.0f, 0.05f, 0); + } + + if (arg1->y > 350.0f) { + func_8690351C(arg0, arg1, 350.0f, 0.0f, 0); + } + + sp38 = func_86902294(1.9f); + if (func_869022D8(sp3C, *arg1) < sp38) { + func_86902E6C(arg0, arg1, sp3C, func_86902294(1.9f) + 0.05f, 1); + } + + if (func_869022D8(sp3C, *arg1) > 400.0f) { + func_86902E6C(arg0, arg1, sp3C, 399.0f, 1); + } + + if (func_869022D8(D_87906054->unk_60.at, *arg1) < 30.0f) { + func_86902E6C(arg0, arg1, D_87906054->unk_60.at, 30.1f, 1); + } +} + +void func_86903888(Vec3f* arg0, Vec3f* arg1, s32 arg2) { + UNUSED s32 pad[2]; + Vec3f sp3C = D_86908C44; + f32 sp38; + + if (arg2 == 0) { + if (arg1->y < 12.0f) { + func_8690351C(arg0, arg1, 12.0f, 0.05f, 1); + } + + if (arg1->y > 350.0f) { + func_8690351C(arg0, arg1, 350.0f, 0.0f, 1); + } + } else { + if (arg1->y < 12.0f) { + func_8690351C(arg0, arg1, 12.0f, 0.05f, 0); + } + + if (arg1->y > 350.0f) { + func_8690351C(arg0, arg1, 350.0f, 0.0f, 0); + } + } + + if (arg2 == 0) { + sp38 = func_86902294(1.9f); + if (func_869022D8(sp3C, *arg1) < sp38) { + func_86902E6C(arg0, arg1, sp3C, func_86902294(1.9f) + 0.05f, 0); + } + + if (func_869022D8(sp3C, *arg1) > 400.0f) { + func_86902E6C(arg0, arg1, sp3C, 399.0f, 0); + } + + if (func_869022D8(D_87906054->unk_60.at, *arg1) < 30.0f) { + func_86902E6C(arg0, arg1, D_87906054->unk_60.at, 30.1f, 0); + } + } else { + sp38 = func_86902294(1.9f); + if (func_869022D8(sp3C, *arg1) < sp38) { + func_8690325C(arg0, arg1, sp3C, func_86902294(1.9f) + 0.05f); + } + + if (func_869022D8(sp3C, *arg1) > 400.0f) { + func_8690325C(arg0, arg1, sp3C, 399.0f); + } + + if (func_869022D8(D_87906054->unk_60.at, *arg1) < 30.0f) { + func_8690325C(arg0, arg1, D_87906054->unk_60.at, 30.1f); + } + } +} + +void func_86903D80(void) { + Vec3f sp44; + Vec3f sp38; + UNUSED s32 pad; + f32 mag; + + if (D_8690B390.stickMag != 0.0f) { + func_8000E88C(&sp44, D_87906054->unk_60.eye.x, D_87906054->unk_60.eye.y, D_87906054->unk_60.eye.z); + if (D_8690B390.stickY >= 0.0f) { + mag = -(D_8690B390.stickMag / 6.0f); + func_80010354(&D_87906054->unk_60.eye, &sp38, mag, D_8690B600, D_8690B602); + } else { + mag = D_8690B390.stickMag / 6.0f; + func_80010354(&D_87906054->unk_60.eye, &sp38, mag, D_8690B600, D_8690B602); + } + D_8690B604 = func_86902230(D_87906054->unk_60.at, sp38); + func_869035F4(&sp44, &sp38); + func_8000E88C(&D_87906054->unk_60.eye, sp38.x, sp38.y, sp38.z); + } + + if (D_8690B390.buttonDown & 0x200) { + D_8690B602 -= 0x100; + } + + if (D_8690B390.buttonDown & 0x100) { + D_8690B602 += 0x100; + } + + if (D_8690B390.buttonDown & 0x300) { + func_8000E88C(&sp44, D_87906054->unk_60.eye.x, D_87906054->unk_60.eye.y, D_87906054->unk_60.eye.z); + func_80010354(&D_87906054->unk_60.at, &sp38, D_8690B604, D_8690B600, D_8690B602); + func_86903888(&sp44, &sp38, 1); + func_8000E88C(&D_87906054->unk_60.eye, sp38.x, sp38.y, sp38.z); + } + + if (D_8690B390.buttonDown & 0x800) { + D_8690B600 += 0x100; + } + + if (D_8690B390.buttonDown & 0x400) { + D_8690B600 -= 0x100; + } + + if (D_8690B390.buttonDown & 0xC00) { + func_8000E88C(&sp44, D_87906054->unk_60.eye.x, D_87906054->unk_60.eye.y, D_87906054->unk_60.eye.z); + func_80010354(&D_87906054->unk_60.at, &sp38, D_8690B604, D_8690B600, D_8690B602); + func_86903888(&sp44, &sp38, 0); + func_8000E88C(&D_87906054->unk_60.eye, sp38.x, sp38.y, sp38.z); + } +} diff --git a/src/fragments/15/fragment15_150AC0.c b/src/fragments/15/fragment15_150AC0.c index 9d0818fd..5531d839 100644 --- a/src/fragments/15/fragment15_150AC0.c +++ b/src/fragments/15/fragment15_150AC0.c @@ -1,43 +1,846 @@ -#include "global.h" +#include "fragment15.h" +#include "src/1CF30.h" +#include "src/20470.h" +#include "src/2E110.h" +#include "src/6A40.h" +#include "src/6BC0.h" +#include "src/F420.h" -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86904070.s") +const char D_8690A520[] = "FREE BATTLE"; +const char D_8690A52C[] = "POK\xE9 CUP"; +const char D_8690A538[] = "POK\xE9 CUP2"; +const char D_8690A544[] = "PETIT CUP"; +const char D_8690A550[] = "PIKA CUP"; +const char D_8690A55C[] = "PRIME CUP"; +const char D_8690A568[] = "PEWTER GYM"; +const char D_8690A574[] = "CERULEAN GYM"; +const char D_8690A584[] = "VERMILION GYM"; +const char D_8690A594[] = "CELADON GYM"; +const char D_8690A5A0[] = "FUCHSIA GYM"; +const char D_8690A5AC[] = "SAFFRON GYM"; +const char D_8690A5B8[] = "CINNABAR GYM"; +const char D_8690A5C8[] = "VIRIDIAN GYM"; +const char D_8690A5D8[] = "VS ELITE FOUR"; +const char D_8690A5E8[] = "VS MEWTWO"; + +extern u8 D_50002A0[]; +extern u8 D_50003F0[]; +extern u8 D_5000BA0[]; +extern u8 D_5000C90[]; +extern u8 D_50011D0[]; +extern u8 D_5001680[]; +extern u8 D_50017E8[]; +extern u8 D_5001950[]; +extern u8 D_5003AE8[]; + +void func_86904070(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { + unk_D_80068BB0* temp_s1 = func_8000648C(); + Vtx* temp_s2 = func_80005F5C(sizeof(Vtx) * 4); + Mtx* sp84 = func_80005F5C(sizeof(Mtx) * 1); + Vp* sp80 = func_80005F5C(sizeof(Vp) * 1); + + func_8001E6E8(sp80, temp_s1->width, temp_s1->height); + + gSPViewport(gDisplayListHead++, (u32)sp80 & 0x1FFFFFFF); + + guOrtho(sp84, 0.5f, temp_s1->width - 0.5f, temp_s1->height - 0.5f, 0.5f, -2.0f, 2.0f, 1.0f); + + func_8001E680(&temp_s2[0], arg0, arg1, -1, 0, 0, 0, 0, 0, arg4); + func_8001E680(&temp_s2[1], arg0 + arg2, arg1, -1, 0, 0, 0, 0, 0, arg4); + func_8001E680(&temp_s2[2], arg0, arg1 + arg3, -1, 0, 0, 0, 0, 0, arg4); + func_8001E680(&temp_s2[3], arg0 + arg2, arg1 + arg3, -1, 0, 0, 0, 0, 0, arg4); + + gDPPipeSync(gDisplayListHead++); + gDPSetCycleType(gDisplayListHead++, G_CYC_1CYCLE); + gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_FOG | G_LIGHTING); + gSPSetGeometryMode(gDisplayListHead++, G_SHADE); + gDPSetCombineMode(gDisplayListHead++, G_CC_SHADE, G_CC_SHADE); + gDPSetRenderMode(gDisplayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gSPPerspNormalize(gDisplayListHead++, 0xFFFF); + gSPMatrix(gDisplayListHead++, (u32)sp84 & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, (u32)&D_8006F010 & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPVertex(gDisplayListHead++, (u32)temp_s2 & 0x1FFFFFFF, 4, 0); + gSP2Triangles(gDisplayListHead++, 0, 2, 3, 0, 0, 3, 1, 0); +} void func_869043F4(void) { } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_869043FC.s") +void func_869043FC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, u8 arg6, u8 arg7) { + s16 var_s2; + s16 var_s3; + s16 sp4C; + s16 sp48; + + if (arg2 >= 0x10) { + var_s3 = 8; + } else { + var_s3 = arg2 / 2; + } + + if (arg3 >= 0x10) { + var_s2 = 8; + } else { + var_s2 = arg3 / 2; + } + + sp4C = arg2 - (var_s3 * 2); + sp48 = arg3 - (var_s2 * 2); + + gSPDisplayList(gDisplayListHead++, D_8006F518); + gDPSetEnvColor(gDisplayListHead++, arg4, arg5, arg6, arg7); + + gDPLoadTextureBlock_4b(gDisplayListHead++, D_2028A60, G_IM_FMT_I, 16, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + + func_8001C330(arg0, arg1, var_s3, var_s2, 0, 0, 0x2000 / var_s3, 0x2000 / var_s2, 0); + + gDPLoadTextureBlock_4b(gDisplayListHead++, D_2028AA0, G_IM_FMT_I, 16, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + + func_8001C330((arg0 + arg2) - var_s3, arg1, var_s3, var_s2, 0, 0, 0x2000 / var_s3, 0x2000 / var_s2, 0); + + gDPLoadTextureBlock_4b(gDisplayListHead++, D_20289E0, G_IM_FMT_I, 16, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + + func_8001C330(arg0, (arg1 + arg3) - var_s2, var_s3, var_s2, 0, 0, 0x2000 / var_s3, 0x2000 / var_s2, 0); + + gDPLoadTextureBlock_4b(gDisplayListHead++, D_2028A20, G_IM_FMT_I, 16, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + + func_8001C330((arg0 + arg2) - var_s3, (arg1 + arg3) - var_s2, var_s3, var_s2, 0, 0, 0x2000 / var_s3, + 0x2000 / var_s2, 0); + + gSPDisplayList(gDisplayListHead++, D_8006F498); + + if ((sp4C > 0) && (sp48 > 0)) { + func_8001C604(arg0 + var_s3, arg1, sp4C, var_s2, arg4, arg5, arg6, arg7); + func_8001C604(arg0, (arg1 + var_s3), arg2, sp48, arg4, arg5, arg6, arg7); + func_8001C604(arg0 + var_s3, (arg1 + var_s3) + sp48, sp4C, var_s2, arg4, arg5, arg6, arg7); + } else if (sp4C > 0) { + func_8001C604(arg0 + var_s3, arg1, sp4C, arg3, arg4, arg5, arg6, arg7); + } else if (sp48 > 0) { + func_8001C604(arg0, arg1 + var_s2, arg2, sp48, arg4, arg5, arg6, arg7); + } + + gSPDisplayList(gDisplayListHead++, D_8006F630); +} void func_86904BFC(void) { } -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86904C04.s") +void func_86904C04(s16 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7) { + unk_D_800A7440 sp30; + + func_80005FC0(&sp30, arg0, arg1, (arg0 + arg2) - 1, (arg1 + arg3) - 1); + + if (func_80006030(&sp30) != 0) { + if (arg6 != 0) { + arg4 += ((sp30.x1 - arg0) * arg6) >> 5; + } + + if (arg7 != 0) { + arg5 += ((sp30.y2 - arg1) * arg7) >> 5; + } + + sp30.y1 += 1; + sp30.x2 += 1; + + gSPTextureRectangle(gDisplayListHead++, sp30.x1 << 2, sp30.y2 << 2, sp30.y1 << 2, sp30.x2 << 2, G_TX_RENDERTILE, + arg4, arg5, arg6, arg7); + } +} + +void func_86904D98(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5) { + gDPLoadTextureTile(gDisplayListHead++, arg4, G_IM_FMT_IA, G_IM_SIZ_8b, arg2, 0, 0, 0, arg2 - 1, arg3 - 1, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + func_86904C04(arg0, arg1, arg2, arg3, D_8690B360.unk_02 << 5, 0, 0x400, 0x400); +} + +void func_86904F2C(u8* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { + gDPPipeSync(gDisplayListHead++); + + gDPSetCycleType(gDisplayListHead++, G_CYC_2CYCLE); + gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_FOG | G_LIGHTING); + gDPSetTexturePersp(gDisplayListHead++, G_TP_NONE); + gDPSetRenderMode(gDisplayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetCombineLERP(gDisplayListHead++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, + COMBINED, 0, 0, 0, COMBINED); + gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, 255); + gDPSetPrimColor(gDisplayListHead++, 0, 0, 95, 55, 0, 255); + gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP); + + func_86904D98(arg1, arg2, arg3, arg4, arg0, arg3); + + gSPDisplayList(gDisplayListHead++, D_8006F630); +} + +void func_869050C8(u8* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { + Vec3s spD8; + Vec3f spCC; + Vec3f spC0; + UNUSED s32 pad; + unk_D_80068BB0* spB8; + Vtx* spB4; + MtxF* spB0; + Mtx* spAC; + MtxF* spA8; + Vp* spA4; + + spB8 = func_8000648C(); + spB4 = func_80005F5C(sizeof(Vtx) * 4); + spB0 = func_80005F5C(sizeof(MtxF) * 1); + spAC = func_80005F5C(sizeof(Mtx) * 1); + spA8 = func_80005F5C(sizeof(MtxF) * 1); + spA4 = func_80005F5C(sizeof(Vp) * 1); + + func_8000EB70(&spD8, 0, 0, D_8690B360.unk_06); + + func_8000E88C(&spCC, (f32)arg1 + (arg3 / 2), (f32)arg2 + arg4, 0.0f); + func_8000E88C(&spC0, 1.0f, 1.0f, 1.0f); + func_8000F2C4(spA8, &spCC, &spD8); + func_8000FDE4(spA8, spA8, &spC0); + func_80010090(spB0, spA8); + func_8001E6E8(spA4, spB8->width, spB8->height); + + gSPViewport(gDisplayListHead++, (u32)spA4 & 0x1FFFFFFF); + + guOrtho(spAC, 0.5f, spB8->width - 0.5f, spB8->height - 0.5f, 0.5f, -2.0f, 2.0f, 1.0f); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86904D98.s") + func_8001E680(&spB4[0], -(arg3 / 2), -arg4, -1, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spB4[1], (arg3 / 2), -arg4, -1, arg3 << 5, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spB4[2], -(arg3 / 2), 0, -1, 0, arg4 << 5, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spB4[3], (arg3 / 2), 0, -1, arg3 << 5, arg4 << 5, 0xFF, 0xFF, 0xFF, 0xFF); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86904F2C.s") + gSPDisplayList(gDisplayListHead++, D_8006F518); + gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_LIGHTING); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_869050C8.s") + if (D_8690B360.unk_06 == 0) { + gDPSetTextureFilter(gDisplayListHead++, G_TF_POINT); + gDPSetRenderMode(gDisplayListHead++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2); + } else { + gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP); + gDPSetRenderMode(gDisplayListHead++, G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2); + } + gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); + + gDPLoadTextureTile(gDisplayListHead++, arg0, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg3, 0, 0, 0, arg3 - 1, arg4 - 1, 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); + + gSPPerspNormalize(gDisplayListHead++, 0xFFFF); + gSPMatrix(gDisplayListHead++, (u32)spAC & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, (u32)spB0 & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPVertex(gDisplayListHead++, (u32)spB4 & 0x1FFFFFFF, 4, 0); + gSP2Triangles(gDisplayListHead++, 0, 2, 3, 0, 0, 3, 1, 0); + gSPDisplayList(gDisplayListHead++, D_8006F630); + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF); +} + +#ifdef NON_MATCHING +void func_86905734(u8* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, u8 arg6) { + f32 a1; + f32 a2; + s16 spF8[4]; + s16 spF0[4]; + unk_D_80068BB0* spEC; + Vtx* spE8; + Mtx* spE4; + Vp* spE0; + f32 sp64; + f32 sp60; + f32 sp5C; + s32 tmp1; + + spEC = func_8000648C(); + spE8 = func_80005F5C(sizeof(Vtx) * 4); + spE4 = func_80005F5C(sizeof(Mtx) * 1); + spE0 = func_80005F5C(sizeof(Vp) * 1); + + sp64 = arg1; + sp5C = arg2; + + spF8[0] = ((-(arg3 / 2) * COSS(arg5)) - (SINS(arg5) * -arg4)) + sp64; + spF0[0] = (COSS(arg5) * -arg4) + (-(arg3 / 2) * SINS(arg5)) + sp5C; + + spF8[1] = (((arg3 / 2) * COSS(arg5)) - (SINS(arg5) * -arg4)) + sp64; + spF0[1] = (COSS(arg5) * -arg4) + ((arg3 / 2) * SINS(arg5)) + sp5C; + + spF8[2] = (-(arg3 / 2) * COSS(arg5)) + sp64; + spF0[2] = (-(arg3 / 2) * SINS(arg5)) + sp5C; + + spF8[3] = ((arg3 / 2) * COSS(arg5)) + sp64; + spF0[3] = ((arg3 / 2) * SINS(arg5)) + sp5C; + + func_8001E6E8(spE0, spEC->width, spEC->height); + + gSPViewport(gDisplayListHead++, (u32)spE0 & 0x1FFFFFFF); + + guOrtho(spE4, 0.5f, spEC->width - 0.5f, spEC->height - 0.5f, 0.5f, -2.0f, 2.0f, 1.0f); + func_8001E680(&spE8[0], spF8[0], spF0[0], -1, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spE8[1], spF8[1], spF0[1], -1, arg3 << 5, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spE8[2], spF8[2], spF0[2], -1, 0, arg4 << 5, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spE8[3], spF8[3], spF0[3], -1, arg3 << 5, arg4 << 5, 0xFF, 0xFF, 0xFF, 0xFF); + + if (arg6 == 0) { + gDPLoadTextureBlock(gDisplayListHead++, arg0, G_IM_FMT_IA, G_IM_SIZ_8b, arg3, arg4, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + } + + gSPDisplayList(gDisplayListHead++, D_8006F518); + + gDPPipeSync(gDisplayListHead++); + + gDPSetCycleType(gDisplayListHead++, G_CYC_2CYCLE); + gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_FOG | G_LIGHTING); + gDPSetTexturePersp(gDisplayListHead++, G_TP_NONE); + gDPSetRenderMode(gDisplayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetCombineLERP(gDisplayListHead++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, + COMBINED, 0, 0, 0, COMBINED); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); + gDPSetPrimColor(gDisplayListHead++, 0, 0, 255, 255, 255, 255); + gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP); + gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); + + gSPPerspNormalize(gDisplayListHead++, 0xFFFF); + gSPMatrix(gDisplayListHead++, (u32)spE4 & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, (u32)&D_8006F010 & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPVertex(gDisplayListHead++, (u32)spE8 & 0x1FFFFFFF, 4, 0); + gSP2Triangles(gDisplayListHead++, 0, 2, 3, 0, 0, 3, 1, 0); + + gSPDisplayList(gDisplayListHead++, D_8006F630); + + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF); +} +#else +void func_86905734(u8* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, u8 arg6); #pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86905734.s") +#endif + +void func_86905F24(u8* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, u8 arg6) { + f32 a1; + f32 a2; + s16 spE0[4]; + s16 spD8[4]; + unk_D_80068BB0* spD4; + Vtx* spD0; + Mtx* spCC; + Vp* spC8; + + spD4 = func_8000648C(); + spD0 = func_80005F5C(sizeof(Vtx) * 4); + spCC = func_80005F5C(sizeof(Mtx) * 1); + spC8 = func_80005F5C(sizeof(Vp) * 1); + + a1 = arg1; + a2 = arg2; + + spE0[0] = (COSS(arg5) * -12.0f) + a1; + spD8[0] = (SINS(arg5) * -12.0f) + a2; + + spE0[1] = (COSS(arg5) * 12.0f) + a1; + spD8[1] = (SINS(arg5) * 12.0f) + a2; + + spE0[2] = ((COSS(arg5) * -12.0f) - (SINS(arg5) * 56.0f)) + a1; + spD8[2] = (((SINS(arg5) * -12.0f) + COSS(arg5) * 56.0f)) + a2; + + spE0[3] = ((COSS(arg5) * 12.0f) - (SINS(arg5) * 56.0f)) + a1; + spD8[3] = (((SINS(arg5) * 12.0f) + COSS(arg5) * 56.0f)) + a2; + + func_8001E6E8(spC8, spD4->width, spD4->height); + + gSPViewport(gDisplayListHead++, (u32)spC8 & 0x1FFFFFFF); + + guOrtho(spCC, 0.5f, spD4->width - 0.5f, spD4->height - 0.5f, 0.5f, -2.0f, 2.0f, 1.0f); + + func_8001E680(&spD0[0], spE0[0], spD8[0], -1, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spD0[1], spE0[1], spD8[1], -1, arg3 << 5, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spD0[2], spE0[2], spD8[2], -1, 0, arg4 << 5, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spD0[3], spE0[3], spD8[3], -1, arg3 << 5, arg4 << 5, 0xFF, 0xFF, 0xFF, 0xFF); + + if (arg6 == 0) { + gDPLoadTextureBlock(gDisplayListHead++, arg0, G_IM_FMT_IA, G_IM_SIZ_8b, arg3, arg4, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + } + + gSPDisplayList(gDisplayListHead++, D_8006F518); + + gDPPipeSync(gDisplayListHead++); + + gDPSetCycleType(gDisplayListHead++, G_CYC_2CYCLE); + gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_FOG | G_LIGHTING); + gDPSetTexturePersp(gDisplayListHead++, G_TP_NONE); + gDPSetRenderMode(gDisplayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetCombineLERP(gDisplayListHead++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, + COMBINED, 0, 0, 0, COMBINED); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); + gDPSetPrimColor(gDisplayListHead++, 0, 0, 255, 255, 255, 255); + gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP); + gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); + gSPPerspNormalize(gDisplayListHead++, 0xFFFF); + + gSPMatrix(gDisplayListHead++, (u32)spCC & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, (u32)&D_8006F010 & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPVertex(gDisplayListHead++, (u32)spD0 & 0x1FFFFFFF, 4, 0); + gSP2Triangles(gDisplayListHead++, 0, 2, 3, 0, 0, 3, 1, 0); + + gSPDisplayList(gDisplayListHead++, D_8006F630); + + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF); +} + +void func_869066C4(u8* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, u8 arg6) { + f32 temp_fv0; + f32 temp_fv1; + s16 spE0[4]; + s16 spD8[4]; + unk_D_80068BB0* spD4; + Vtx* spD0; + Mtx* spCC; + Vp* spC8; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86905F24.s") + spD4 = func_8000648C(); + spD0 = func_80005F5C(sizeof(Vtx) * 4); + spCC = func_80005F5C(sizeof(Mtx) * 1); + spC8 = func_80005F5C(sizeof(Vp) * 1); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_869066C4.s") + temp_fv0 = arg1; + temp_fv1 = arg2; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86906E70.s") + spE0[0] = (COSS(arg5 + 0xC000) * -12.0f) + temp_fv0; + spD8[0] = (SINS(arg5 + 0xC000) * -12.0f) + temp_fv1; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_869073D8.s") + spE0[1] = (COSS(arg5 + 0xC000) * 12.0f) + temp_fv0; + spD8[1] = (SINS(arg5 + 0xC000) * 12.0f) + temp_fv1; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86907858.s") + spE0[2] = ((COSS(arg5 + 0xC000) * -12.0f) - (SINS(arg5 + 0xC000) * 56.0f)) + temp_fv0; + spD8[2] = ((SINS(arg5 + 0xC000) * -12.0f) + (COSS(arg5 + 0xC000) * 56.0f)) + temp_fv1; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86907B78.s") + spE0[3] = ((COSS(arg5 + 0xC000) * 12.0f) - (SINS(arg5 + 0xC000) * 56.0f)) + temp_fv0; + spD8[3] = ((SINS(arg5 + 0xC000) * 12.0f) + (COSS(arg5 + 0xC000) * 56.0f)) + temp_fv1; -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86907D38.s") + func_8001E6E8(spC8, spD4->width, spD4->height); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86907D94.s") + gSPViewport(gDisplayListHead++, (u32)spC8 & 0x1FFFFFFF); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86908418.s") + guOrtho(spCC, 0.5f, spD4->width - 0.5f, spD4->height - 0.5f, 0.5f, -2.0f, 2.0f, 1.0f); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_86908668.s") + func_8001E680(&spD0[0], spE0[0], spD8[0], -1, arg3 << 5, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spD0[1], spE0[1], spD8[1], -1, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spD0[2], spE0[2], spD8[2], -1, arg3 << 5, arg4 << 5, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&spD0[3], spE0[3], spD8[3], -1, 0, arg4 << 5, 0xFF, 0xFF, 0xFF, 0xFF); -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/15/fragment15_150AC0/func_869089AC.s") + if (arg6 == 0) { + gDPLoadTextureBlock(gDisplayListHead++, arg0, G_IM_FMT_IA, G_IM_SIZ_8b, arg3, arg4, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + } + + gSPDisplayList(gDisplayListHead++, D_8006F518); + + gDPPipeSync(gDisplayListHead++); + + gDPSetCycleType(gDisplayListHead++, G_CYC_2CYCLE); + gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_FOG | G_LIGHTING); + gDPSetTexturePersp(gDisplayListHead++, G_TP_NONE); + gDPSetRenderMode(gDisplayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetCombineLERP(gDisplayListHead++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, + COMBINED, 0, 0, 0, COMBINED); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); + gDPSetPrimColor(gDisplayListHead++, 0, 0, 255, 255, 255, 255); + gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP); + gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); + gSPPerspNormalize(gDisplayListHead++, 0xFFFF); + + gSPMatrix(gDisplayListHead++, (u32)spCC & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, (u32)&D_8006F010 & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPVertex(gDisplayListHead++, (u32)spD0 & 0x1FFFFFFF, 4, 0); + gSP2Triangles(gDisplayListHead++, 0, 2, 3, 0, 0, 3, 1, 0); + + gSPDisplayList(gDisplayListHead++, D_8006F630); + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF); +} + +void func_86906E70(u8* arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, u8 arg5, u8 arg6, u8 arg7, u8 arg8, u8 arg9, + u8 argA, u8 argB, u8 argC) { + unk_D_80068BB0* temp_s1 = func_8000648C(); + Vtx* temp_s2 = func_80005F5C(sizeof(Vtx) * 4); + Mtx* spAC = func_80005F5C(sizeof(Mtx) * 1); + Vp* spA8 = func_80005F5C(sizeof(Vp)); + + func_8001E6E8(spA8, temp_s1->width, temp_s1->height); + + gSPViewport(gDisplayListHead++, (u32)spA8 & 0x1FFFFFFF); + + guOrtho(spAC, 0.5f, temp_s1->width - 0.5f, temp_s1->height - 0.5f, 0.5f, -2.0f, 2.0f, 1.0f); + + func_8001E680(&temp_s2[0], arg1, arg2, -1, argC << 5, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&temp_s2[1], arg1 + arg3, arg2, -1, argB << 5, 0, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&temp_s2[2], arg1, arg2 + arg4, -1, argC << 5, arg6 << 5, 0xFF, 0xFF, 0xFF, 0xFF); + func_8001E680(&temp_s2[3], arg1 + arg3, arg2 + arg4, -1, argB << 5, arg6 << 5, 0xFF, 0xFF, 0xFF, 0xFF); + + gSPDisplayList(gDisplayListHead++, D_8006F518); + gDPSetRenderMode(gDisplayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetTextureFilter(gDisplayListHead++, G_TF_POINT); + gDPSetTexturePersp(gDisplayListHead++, G_TP_PERSP); + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); + + gDPLoadTextureTile(gDisplayListHead++, arg0, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg5, 0, arg7, arg8, arg9 - 1, argA - 1, + 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); + + gSPPerspNormalize(gDisplayListHead++, 0xFFFF); + gSPMatrix(gDisplayListHead++, (u32)spAC & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gDisplayListHead++, (u32)&D_8006F010 & 0x1FFFFFFF, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPVertex(gDisplayListHead++, (u32)temp_s2 & 0x1FFFFFFF, 4, 0); + gSP2Triangles(gDisplayListHead++, 0, 2, 3, 0, 0, 3, 1, 0); + gSPDisplayList(gDisplayListHead++, D_8006F630); + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF); +} + +void func_869073D8(char* arg0) { + Color_RGB8 sp4C; + Color_RGB8 sp48; + s32 sp44; + UNUSED s16 pad2; + s16 sp40; + + if (D_8690A710->unk_014 != 0) { + sp44 = func_8001F5B0(0x10, 0, arg0); + + if (D_8690A710->unk_014 == 1) { + func_86906E70(&D_5001950, 0x3C, 0xAE, 0x22, 0x2B, 0x64, 0x2B, 0, 0, 0x22, 0x2B, 0x21, 0); + func_86906E70(&D_5001950, 0x5E, 0xAE, 0x22, 0x2B, 0x64, 0x2B, 0x22, 0, 0x44, 0x2B, 0x43, 0x22); + func_86906E70(&D_5001950, 0x80, 0xAE, 0x20, 0x2B, 0x64, 0x2B, 0x44, 0, 0x64, 0x2B, 0x63, 0x44); + func_86906E70(&D_5001950, 0xE2, 0xAE, 0x22, 0x2B, 0x64, 0x2B, 0, 0, 0x22, 0x2B, 0, 0x21); + func_86906E70(&D_5001950, 0xC0, 0xAE, 0x22, 0x2B, 0x64, 0x2B, 0x22, 0, 0x44, 0x2B, 0x22, 0x43); + func_86906E70(&D_5001950, 0xA0, 0xAE, 0x20, 0x2B, 0x64, 0x2B, 0x44, 0, 0x64, 0x2B, 0x44, 0x63); + sp4C.r = 0xF0; + sp4C.g = 0x78; + sp4C.b = 0x6E; + sp48.r = 0xF0; + sp48.g = 0xF0; + sp48.b = 0x78; + sp40 = 5; + } else { + func_86906E70(&D_5003AE8, 0x4C, 0xAE, 0x20, 0x28, 0x20, 0x28, 0, 0, 0x20, 0x28, 0x1F, 0); + func_86906E70(&D_5003AE8, 0x6C, 0xAE, 0x68, 0x28, 0x20, 0x28, 0x1C, 0, 0x20, 0x2B, 0x87, 0x20); + func_86906E70(&D_5003AE8, 0xD4, 0xAE, 0x20, 0x28, 0x20, 0x28, 0, 0, 0x20, 0x28, 0, 0x20); + sp4C.r = 0xDC; + sp4C.g = 0xFF; + sp4C.b = 0xDC; + sp48.r = 0x78; + sp48.g = 0xB4; + sp48.b = 0xFF; + sp40 = 7; + } + + func_8001F3F4(); + func_8001F470(); + func_8001EBE0(0x10, 0); + func_8001F324(sp4C.r, sp4C.g, sp4C.b, 0xFF); + func_8001F36C(sp48.r, sp48.g, sp48.b, 0xFF); + func_8001F1E8(0xA0 - (sp44 / 2), sp40 + 0xAE, arg0); + func_8001F4C4(); + func_8001F444(); + func_86904070(0x50, 0xAC, 0xA0, 0x2D, 0); + } +} + +void func_86907858(UNUSED s32 arg0) { + s32 i; + s32 var_v1; + + if (D_8690B380 != 0) { + func_869043FC(0x55, 0x20, 0x96, 0x8C, 0, 0, 0x8C, 0x64); + + gSPDisplayList(gDisplayListHead++, D_8006F518); + + if (D_8690B384 != 0) { + var_v1 = 0xFF; + } else { + var_v1 = 0x37; + } + + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, var_v1); + + func_8001CADC(0x93, 0x20, 0x18, 0xF, &D_50017E8, 0x18, 0); + + if ((D_8690B38C - 4) != D_8690B384) { + var_v1 = 0xFF; + } else { + var_v1 = 0x37; + } + + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, var_v1); + + func_8001CADC(0x93, 0x9C, 0x18, 0xF, &D_5001680, 0x18, 0); + + gSPDisplayList(gDisplayListHead++, D_8006F630); + gSPDisplayList(gDisplayListHead++, D_8006F5A0); + + func_8001D560(0x59, (D_8690B388 * 0x14) + 0x35, 0x18, 0xE, D_5000000, &D_50002A0, 0x18, 0x100000); + + gSPDisplayList(gDisplayListHead++, D_8006F630); + + func_8001F3F4(); + func_8001EBE0(4, 0); + + for (i = D_8690B384; i < D_8690B384 + 5; i++) { + if (D_8690B388 == (i - D_8690B384)) { + func_8001F324(0xFF, 0xFF, 0, 0xFF); + } else { + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + } + func_8001F1E8(0xA0 - (func_8001F5B0(4, 0, D_86908C58[i]) / 2), ((i - D_8690B384) * 0x14) + 0x36, + D_86908C58[i]); + } + + func_8001F444(); + func_86904070(0x4D, 0x34, 0xA6, 0x88, 0); + } +} + +void func_86907B78(void) { + s32 sp3C; + s32 sp38; + Color_RGB8 sp34 = D_86908C98; + Color_RGB8 sp30 = D_86908C9C; + + if (D_8690B348 >= 3) { + func_86904070(0, 0, 0x140, 0xF0, D_8690B350.unk_04); + } + + if (D_8690B348 == 4) { + if (D_8690B350.unk_0E < 0x15) { + func_8002053C(D_8690B350.unk_08, D_8690B350.unk_0A - (D_8690B350.unk_0E / 2), D_8690B350.unk_0C, + D_8690B350.unk_0E, &sp34, &sp34); + } else { + func_8002053C(D_8690B350.unk_08, D_8690B350.unk_0A - (D_8690B350.unk_0E / 2), D_8690B350.unk_0C, + D_8690B350.unk_0E, &sp34, &sp30); + } + + if (D_8690B350.unk_0E >= 0x1F) { + func_8001F3F4(); + func_8001EBE0(4, 0); + sp3C = func_8001F5B0(4, 0, func_8002D7C0(NULL, 0, D_8690A678, 0)); + sp38 = func_8002D7C0(NULL, 0, D_8690A678, 0); + func_8001F1E8((D_8690B350.unk_08 - (sp3C / 2)) + (D_8690B350.unk_0C / 2), D_8690B350.unk_0A - 8, sp38); + func_8001F444(); + } + } +} + +s16 func_86907D38(s16 arg0) { + if ((arg0 - D_8690B360.unk_04) <= (D_8690B360.unk_0C + 15.0f)) { + return 1000; + } + return arg0 - D_8690B360.unk_04; +} + +void func_86907D94(void) { + s16 sp4E = D_8690B360.unk_0C; + char sp40[12]; + char sp34[12]; + s16 sp32; + s16 sp24 = sp4E + 0x17; + + if (D_8690B348 >= 2) { + return; + } + + func_86904F2C(D_5000BA0, func_86907D38(sp24 + 8), 0x18, 8, 0x1E); + func_86904F2C(D_5000BA0, func_86907D38(sp24 + 0x10), 0x18, 8, 0x1E); + + if (D_8690B348 == 0) { + if (D_8690B360.unk_00 == 0) { + sprintf(&sp40, "%d", 0x18 - D_8690B344); + + func_8001F3F4(); + func_8001EBE0(2, 0); + + if ((0x18 - D_8690B344) >= 0xB) { + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + } else { + func_8001F324(0xFF, 0, 0, 0xFF); + } + + sp32 = 0; + if ((0x18 - D_8690B344) < 0xA) { + sp32 = 3; + } + + func_8001F1E8(sp24 + sp32 + 9, 0x21, &sp40); + func_8001F444(); + } else { + sprintf(&sp40, "%d", 0x19 - D_8690B344); + sprintf(&sp34, "%d", 0x18 - D_8690B344); + + func_8001F3F4(); + func_8001EBE0(2, 0); + + if ((0x19 - D_8690B344) >= 0xB) { + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + } else { + func_8001F324(0xFF, 0, 0, 0xFF); + } + + sp32 = 0; + if ((0x18 - D_8690B344) < 0xA) { + sp32 = 3; + } + + func_8001F1E8((sp24 - D_8690B360.unk_00) + sp32 + 0x1D, 0x21, &sp40); + + if ((0x18 - D_8690B344) >= 0xB) { + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + } else { + func_8001F324(0xFF, 0, 0, 0xFF); + } + + sp32 = 0; + if ((0x18 - D_8690B344) < 0xA) { + sp32 = 3; + } + + func_8001F1E8((sp24 - D_8690B360.unk_00) + sp32 + 9, 0x21, &sp34); + func_8001F444(); + } + } else if (D_8690B360.unk_00 == 0) { + if (D_8690B344 != 0) { + sprintf(&sp40, "%d", 0x18 - D_8690B344); + + func_8001F3F4(); + func_8001EBE0(2, 0); + + if ((0x18 - D_8690B344) >= 0xB) { + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + } else { + func_8001F324(0xFF, 0, 0, 0xFF); + } + + sp32 = 0; + if ((0x18 - D_8690B344) < 0xA) { + sp32 = 3; + } + + func_8001F1E8(sp24 + sp32 + 9, 0x21, &sp40); + func_8001F444(); + } + } else { + sprintf(&sp40, "%d", 0x17 - D_8690B344); + sprintf(&sp34, "%d", 0x18 - D_8690B344); + + func_8001F3F4(); + func_8001EBE0(2, 0); + + if ((0x19 - D_8690B344) >= 0xB) { + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + } else { + func_8001F324(0xFF, 0, 0, 0xFF); + } + + sp32 = 0; + if ((0x18 - D_8690B344) < 0xA) { + sp32 = 3; + } + + func_8001F1E8((sp24 + D_8690B360.unk_00 + sp32) - 0xB, 0x21, &sp40); + + if ((0x18 - D_8690B344) >= 0xB) { + func_8001F324(0xFF, 0xFF, 0xFF, 0xFF); + } else { + func_8001F324(0xFF, 0, 0, 0xFF); + } + + sp32 = 0; + if ((0x18 - D_8690B344) < 0xA) { + sp32 = 3; + } + + func_8001F1E8(sp24 + D_8690B360.unk_00 + sp32 + 9, 0x21, &sp34); + func_8001F444(); + } + + func_869050C8(D_50003F0, sp4E, 0x13, 0x18, 0x29); + func_86904F2C(D_5000BA0, func_86907D38(sp24), 0x18, 8, 0x1E); + func_86904F2C(D_5000BA0, func_86907D38(sp24 + 0x18), 0x18, 8, 0x1E); + func_86904F2C(D_5000BA0, func_86907D38(sp24 + 0x20), 0x18, 8, 0x1E); + func_86904F2C(D_5000BA0, func_86907D38(sp24 + 0x28), 0x18, 8, 0x1E); +} + +void func_86908418(void) { + s16 sp30 = D_8690B360.unk_0C; + s16 sp2E; + + if (D_8690B348 < 2) { + return; + } + + sp2E = sp30 + 0x17; + + if (func_86907D38(sp2E + 0) != 0x3E8) { + func_86904F2C(D_5000BA0, func_86907D38(sp2E + 0), 0x18, 8, 0x1E); + } + + if (func_86907D38(sp2E + 8) != 0x3E8) { + func_86904F2C(D_5000BA0, func_86907D38(sp2E + 8), 0x18, 8, 0x1E); + } + + if (func_86907D38(sp2E + 0x10) != 0x3E8) { + func_86904F2C(D_5000BA0, func_86907D38(sp2E + 0x10), 0x18, 8, 0x1E); + } + + if (func_86907D38(sp2E + 0x18) != 0x3E8) { + func_86904F2C(D_5000BA0, func_86907D38(sp2E + 0x18), 0x18, 8, 0x1E); + } + + if (func_86907D38(sp2E + 0x20) != 0x3E8) { + func_86904F2C(D_5000BA0, func_86907D38(sp2E + 0x20), 0x18, 8, 0x1E); + } + + if (func_86907D38(sp2E + 0x28) != 0x3E8) { + func_86904F2C(D_5000BA0, func_86907D38(sp2E + 0x28), 0x18, 8, 0x1E); + } + + func_869050C8(D_50003F0, sp30, 0x13, 0x18, 0x29); +} + +void func_86908668(void) { + if (D_8690B348 == 0) { + func_86905734(&D_50011D0, D_8690B308.unk_00[0], D_8690B308.unk_00[4], 0x30, 0x19, 0, 0); + func_86905734(&D_50011D0, D_8690B308.unk_00[1], D_8690B308.unk_00[5], 0x30, 0x19, 0x4000, 1); + func_86905734(&D_50011D0, D_8690B308.unk_00[2], D_8690B308.unk_00[6], 0x30, 0x19, -0x8000, 1); + func_86905734(&D_50011D0, D_8690B308.unk_00[3], D_8690B308.unk_00[7], 0x30, 0x19, -0x4000, 1); + func_86905F24(&D_5000C90, D_8690B308.unk_10, D_8690B308.unk_20, 0x18, 0x38, 0, 0); + func_869066C4(&D_5000C90, D_8690B308.unk_10, D_8690B308.unk_20, 0x18, 0x38, 0, 1); + func_86905F24(&D_5000C90, D_8690B308.unk_14, D_8690B308.unk_24, 0x18, 0x38, 0x4000, 1); + func_869066C4(&D_5000C90, D_8690B308.unk_14, D_8690B308.unk_24, 0x18, 0x38, 0x4000, 1); + func_86905F24(&D_5000C90, D_8690B308.unk_18, D_8690B308.unk_28, 0x18, 0x38, -0x8000, 1); + func_869066C4(&D_5000C90, D_8690B308.unk_18, D_8690B308.unk_28, 0x18, 0x38, -0x8000, 1); + func_86905F24(&D_5000C90, D_8690B308.unk_1C, D_8690B308.unk_2C, 0x18, 0x38, -0x4000, 1); + func_869066C4(&D_5000C90, D_8690B308.unk_1C, D_8690B308.unk_2C, 0x18, 0x38, -0x4000, 1); + } +} + +void func_869089AC(void) { + if (D_8690B3C0.unk_00 != 0xFF) { + func_869043FC(0x3C, 0x9B - (D_8690B3C0.unk_0C / 2), D_8690B3C0.unk_08, D_8690B3C0.unk_0C, 0, 0, 0x9B, 0x7D); + func_8001F3F4(); + func_8001EBE0(2, 0); + func_8001F3B4(0xC); + func_8001F1E8(0x46, 0x9F - (D_8690B3C0.unk_0C / 2), D_8690B3D0); + func_8001F444(); + } +} diff --git a/src/fragments/3/fragment3.h b/src/fragments/3/fragment3.h index a045ba6f..3e37f701 100644 --- a/src/fragments/3/fragment3.h +++ b/src/fragments/3/fragment3.h @@ -150,7 +150,7 @@ extern s16 D_87906044; extern s16 D_87906046; extern s16 D_87906048; extern s16 D_8790604A; - +extern unk_D_86002F34_00C* D_87906050; extern unk_D_86002F34_00C* D_87906054; extern s16 D_87906060; extern s16 D_87906062; diff --git a/src/fragments/3/fragment3_1193E0.c b/src/fragments/3/fragment3_1193E0.c index 9c16f966..d647a14e 100644 --- a/src/fragments/3/fragment3_1193E0.c +++ b/src/fragments/3/fragment3_1193E0.c @@ -11,7 +11,7 @@ s16 D_87906046; s16 D_87906048; s16 D_8790604A; s32 pad_D_8790604C; -s32 D_87906050; +unk_D_86002F34_00C* D_87906050; unk_D_86002F34_00C* D_87906054; s32 pad_D_87906058[2]; s16 D_87906060; diff --git a/src/fragments/31/fragment31.h b/src/fragments/31/fragment31.h index 42bc2c7f..5149fb4a 100644 --- a/src/fragments/31/fragment31.h +++ b/src/fragments/31/fragment31.h @@ -3,6 +3,11 @@ #include "global.h" +typedef struct unk_D_83402EE0_00A { + /* 0x00 */ u8 unk_00[7]; +} unk_D_83402EE0_00A; // size = 0x7 + void func_810007A8(unk_D_86002F58_004_000*); +void func_81002174(unk_D_83402EE0_00A*); #endif // _FRAGMENT31_H_ diff --git a/src/fragments/34/fragment34.h b/src/fragments/34/fragment34.h index 59c6d53b..37617311 100644 --- a/src/fragments/34/fragment34.h +++ b/src/fragments/34/fragment34.h @@ -764,7 +764,7 @@ void func_8140C5BC(UNUSED unk_D_8140E720* arg0, UNUSED unk_D_86002F34_00C* arg1) void func_8140C5D0(void); - +void func_8140C734(void); void func_8140D5A0(unk_D_8140E720*, u16); diff --git a/src/fragments/37/fragment37.c b/src/fragments/37/fragment37.c index 6fc4ba19..f90b8d9b 100644 --- a/src/fragments/37/fragment37.c +++ b/src/fragments/37/fragment37.c @@ -430,57 +430,52 @@ void func_822018D4(s16 arg0, s16 arg1, s16 arg2) { func_8001C330(arg0 - (arg2 / 2), arg1 - (arg2 / 2), arg2, arg2, 0, 0, 0x10000 / arg2, 0x10000 / arg2, 0); } -#ifdef NON_MATCHING void func_82201AC8(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, u8 arg6, u8 arg7) { s16 sp54; - s16 sp4C; + s16 sp50; s16 var_s2; s16 var_s3; - s16 sp50; if (arg2 >= 0x10) { var_s3 = 8; } else { var_s3 = arg2 / 2; } - sp4C = 0x2000 / var_s3; if (arg3 >= 0x10) { var_s2 = 8; } else { var_s2 = arg3 / 2; } - sp50 = 0x2000 / var_s2; - sp54 = (arg0 + arg2) - var_s3; + sp50 = arg2 - (var_s3 * 2); + sp54 = arg3 - (var_s2 * 2); gSPDisplayList(gDisplayListHead++, D_8006F518); gDPSetEnvColor(gDisplayListHead++, arg4, arg5, arg6, arg7); gDPLoadTextureBlock_4b(gDisplayListHead++, D_2028A60, G_IM_FMT_I, 16, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - func_8001C330(arg0, arg1, var_s3, var_s2, 0, 0, sp4C, sp50, 0); + func_8001C330(arg0, arg1, var_s3, var_s2, 0, 0, 0x2000 / var_s3, 0x2000 / var_s2, 0); gDPLoadTextureBlock_4b(gDisplayListHead++, D_2028AA0, G_IM_FMT_I, 16, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - func_8001C330(sp54, arg1, var_s3, var_s2, 0, 0, sp4C, sp50, 0); + func_8001C330((arg0 + arg2) - var_s3, arg1, var_s3, var_s2, 0, 0, 0x2000 / var_s3, 0x2000 / var_s2, 0); gDPLoadTextureBlock_4b(gDisplayListHead++, D_20289E0, G_IM_FMT_I, 16, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - func_8001C330(arg0, (arg1 + arg3) - var_s2, var_s3, var_s2, 0, 0, sp4C, sp50, 0); + func_8001C330(arg0, (arg1 + arg3) - var_s2, var_s3, var_s2, 0, 0, 0x2000 / var_s3, 0x2000 / var_s2, 0); gDPLoadTextureBlock_4b(gDisplayListHead++, D_2028A20, G_IM_FMT_I, 16, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - func_8001C330(sp54, (arg1 + arg3) - var_s2, var_s3, var_s2, 0, 0, sp4C, sp50, 0); + func_8001C330((arg0 + arg2) - var_s3, (arg1 + arg3) - var_s2, var_s3, var_s2, 0, 0, 0x2000 / var_s3, + 0x2000 / var_s2, 0); gSPDisplayList(gDisplayListHead++, D_8006F498); - sp54 = arg3 - (var_s2 * 2); - sp50 = arg2 - (var_s3 * 2); - if ((sp50 > 0) && (sp54 > 0)) { func_8001C604(arg0 + var_s3, arg1, sp50, var_s2, arg4, arg5, arg6, arg7); func_8001C604(arg0, arg1 + var_s3, arg2, sp54, arg4, arg5, arg6, arg7); @@ -493,9 +488,6 @@ void func_82201AC8(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, u8 gSPDisplayList(gDisplayListHead++, D_8006F630); } -#else -#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/37/fragment37/func_82201AC8.s") -#endif void func_822022C8(s32 arg0) { func_82201AC8(0x38, 0x17C, 0x210, 0x3C, 0x1E, 0x1E, 0x82, 0x96); diff --git a/src/fragments/43/fragment43.h b/src/fragments/43/fragment43.h index ecad81bc..1d62bf68 100644 --- a/src/fragments/43/fragment43.h +++ b/src/fragments/43/fragment43.h @@ -2,6 +2,31 @@ #define _FRAGMENT43_H_ #include "global.h" +#include "30640.h" +#include "src/fragments/31/fragment31.h" + +typedef struct unk_D_83402EE0 { + /* 0x00 */ f32 unk_00; + /* 0x04 */ u8 unk_04; + /* 0x05 */ u8 unk_05; + /* 0x06 */ s16 unk_06; + /* 0x08 */ u8 unk_08; + /* 0x09 */ u8 unk_09; + /* 0x0A */ unk_D_83402EE0_00A unk_0A[10]; + /* 0x50 */ Vec3f unk_50; + /* 0x5C */ Vec3f unk_5C; + /* 0x68 */ u32 unk_68; + /* 0x6C */ u8 unk_6C; + /* 0x6D */ char unk6D[3]; + /* 0x70 */ unk_D_83402EE0_070 unk_70; +} unk_D_83402EE0; // size = 0x8C + +extern s32 D_83402E20; +extern s32 D_83402E24; +extern unk_D_83402EE0 D_83402EE0[]; + +extern unk_D_83407AC8 D_83407AC8; +extern u8 D_83407ACA; void func_8340051C(void); diff --git a/src/memmap.h b/src/memmap.h index bd965c74..26d29a49 100644 --- a/src/memmap.h +++ b/src/memmap.h @@ -28,6 +28,8 @@ struct RelocTable { /* 0x04 */ u32 relocations[RELOCATIONS_SIZE]; // variable size }; +typedef s32 (*FragmentEntry)(s32, s32); + typedef struct Fragment { /* 0x00 */ u32 inst[2]; // MIPS instructions to jump to the main function, typically something like "j 0x8xx00020; nop" /* 0x08 */ char magic[8]; // "FRAGMENT" diff --git a/yamls/us/rom.yaml b/yamls/us/rom.yaml index f6ab6a4b..e1daac96 100644 --- a/yamls/us/rom.yaml +++ b/yamls/us/rom.yaml @@ -928,12 +928,13 @@ - [0x14CA70, c, fragments/15/fragment15_14CA70] - [0x14EC80, c, fragments/15/fragment15_14EC80] - [0x150AC0, c, fragments/15/fragment15_150AC0] - - [0x1554D0, data, fragments/15/fragment15_data] - - [0x156EB0, rodata, fragments/15/fragment15_rodata_156EB0] - - [0x156F00, rodata, fragments/15/fragment15_rodata_156F00] - - [0x156F70, rodata, fragments/15/fragment15_rodata_156F70] + - [0x1554D0, .data, fragments/15/fragment15_14CA70] + - [0x156EB0, .rodata, fragments/15/fragment15_14CA70] + - [0x156F00, .rodata, fragments/15/fragment15_14EC80] + - [0x156F70, .rodata, fragments/15/fragment15_150AC0] - - {vram: 0x8690A610, type: bss, name: fragments/15/fragment15_bss} + - {vram: 0x8690A610, type: .bss, name: fragments/15/fragment15_14CA70} + - {vram: 0x8690B600, type: .bss, name: fragments/15/fragment15_14EC80} - name: fragment15_relocs type: code