diff --git a/.vscode/settings.json b/.vscode/settings.json index d87cde38..2730b579 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -45,5 +45,7 @@ "typeinfo": "c", "sym_addrs_funcs": "c", "*.txt": "c" + "typeinfo": "c", + "fox_title.h": "c" }, } \ No newline at end of file diff --git a/include/fox_option.h b/include/fox_option.h index f7bfa9d8..972cc349 100644 --- a/include/fox_option.h +++ b/include/fox_option.h @@ -206,7 +206,7 @@ void func_EBFBE0_8018ACEC(void); void func_EBFBE0_8018B5C4(void); void func_EBFBE0_8018C644(void); void func_EBFBE0_80187CA8(void); -void func_EBFBE0_80188010(void); +s32 func_EBFBE0_80188010(void); void func_EBFBE0_80189208(void); void func_EBFBE0_8018A2F8(void); void func_EBFBE0_8018A990(void); diff --git a/include/functions.h b/include/functions.h index a9dd6a5a..0d5891e2 100644 --- a/include/functions.h +++ b/include/functions.h @@ -264,6 +264,7 @@ s16 func_8009ACDC(s16 *); f32 func_8009BC2C(f32*, f32, f32, f32, f32); f32 func_8009BD38(f32*, f32, f32, f32, f32); void func_8009C320(Gfx **, void *, void *, u32, u32, f32, f32, f32, f32); +void func_8009D0BC(Gfx**, void*, void*, u32, u32, f32, f32, f32, f32); void func_8009D418(Gfx**, void*, u32, u32, f32, f32, f32, f32); void func_8009D994(Gfx**, void*, u32, u32, f32, f32, f32, f32); void func_8009E4B0(Gfx**, void*, u32, u32, f32, f32, f32, f32); diff --git a/include/structs.h b/include/structs.h index 6d01f618..c5cfb01a 100644 --- a/include/structs.h +++ b/include/structs.h @@ -88,7 +88,7 @@ typedef struct { u8 raw[sizeof(SaveData)]; }; /* 0xFE */ u16 checksum; -} Save; +} Save; // size = 0x100 typedef struct { /* 0x000 */ Save save; @@ -130,13 +130,6 @@ typedef struct { /* 0x23550 */ Lightsn lights[0x100]; } GfxPool; // size = 0x2AD50, 0x8 aligned -typedef struct UnkStruct_D_801B8350 { - /* 0x00 */ Vec3f unk0; - /* 0x0C */ char pad0C[0x4C]; - /* 0x54 */ s32 unk_54; - /* 0x58 */ s32 unk_58; -} UnkStruct_D_801B8350; // size = 0x5C - typedef struct { /* 0x0 */ u16 unk_0; /* 0x2 */ s8 unk_2; diff --git a/include/variables.h b/include/variables.h index 922b5c8f..3d5def71 100644 --- a/include/variables.h +++ b/include/variables.h @@ -36,7 +36,7 @@ extern char D_800C7C80[]; extern OSContPad gCurrentInput[4]; extern OSContPad gChangedInput[4]; extern u8 gControllerStatus[4]; -extern s32 gStopInputTimer; +extern u32 gStopInputTimer; extern u8 gRumbleStatus[4]; extern u8 D_800DD8BC[4]; // Fake symbol. Only exists as loop terminator for gRumbleStatus // extern OSContPad sNextInput[4]; @@ -363,7 +363,8 @@ extern s32 D_80177AE0; extern s32 D_80177AF8; extern s32 D_80177B40; extern s32 D_80177B48; -extern s32 D_80177B8C[]; +extern u8 D_80177B8C; +extern s32 D_80177B90[]; extern s32 D_80177BB0[]; extern u16 D_80177C30[]; extern s32 D_80177C50; @@ -430,6 +431,8 @@ extern s32 D_80178380[]; extern s32 D_80178390[]; extern s32 D_801783A0[]; extern s32 D_801783B0[]; +extern f32 D_801783D0; +extern f32 D_801783D4; extern s32 D_801783D8; extern s32 D_801783DC; extern s32 D_80178410; @@ -453,6 +456,8 @@ extern s32 D_80178558; extern s32 D_8017855C; extern s32 D_80178580; extern s32 *D_80178710; +extern s32 D_80178720; +extern s32 D_80178724; extern s32 D_80178728; extern s32 D_8017872C; extern f32 D_80178730; @@ -671,6 +676,7 @@ extern u8 D_500A6E0[]; extern u8 D_500A7D0[]; extern Gfx D_500B600[]; +extern u16 D_6000000[]; extern f32 D_6006940[]; extern f32 D_600695C[]; extern f32 D_6006978[]; @@ -680,21 +686,39 @@ extern f32 D_60069CC[]; extern f32 D_60069E8[]; extern f32 D_6006A04[]; extern f32 D_6006A20[]; +extern u16 D_6006EA0[]; extern Gfx D_6007650[]; +extern u16 D_600BEA0[]; +extern u8 D_600E360[]; +extern u8 D_600E980[]; +extern u8 D_6014140[]; +extern u16 D_60147C0[]; +extern u8 D_60147E0[]; +extern Gfx D_60148D0[]; extern Gfx D_60148B0[]; extern Gfx D_601AE40[]; extern Gfx D_6023AC0[]; extern s16 D_6029528[]; +extern Gfx D_602A720[]; extern Gfx D_602DA20[]; +extern Gfx D_602E380[]; extern Gfx D_6032BC0[]; extern Gfx D_6034B90[]; extern Gfx D_6035DA0[]; extern Gfx D_60361F0[]; +extern Gfx D_6037CF0[]; +extern u8 D_6011890[]; extern Gfx D_60119A0[]; +extern u8 D_6012310[]; +extern u8 D_60123F0[]; extern Gfx D_6012C00[]; +extern Gfx D_601C7C0[]; extern Gfx D_6009F90[]; +extern u16 D_600D5C0[]; extern Gfx D_600D730[]; extern Gfx D_600DBC0[]; +extern u8 D_600DDC0[]; +extern u8 D_600F940[]; extern Gfx D_60363B0[]; extern Gfx D_6036840[]; extern Gfx D_6036CD0[]; @@ -702,14 +726,21 @@ extern Gfx D_6022920[]; extern Gfx D_6020B40[]; extern UNK_TYPE D_6029674; extern ObjectInit* D_6010088[]; +extern u8 D_6010090[]; +extern u8 D_60106B0[]; +extern u8 D_6010FA0[]; +extern u8 D_6013470[]; extern u16 D_601B4B0[]; extern Gfx D_601D1F0[]; +extern u8 D_601D750[]; +extern u16 D_601DB50[]; extern s16 D_6029528[]; extern ObjectInit* D_602B148[]; extern ObjectInit* D_602F18C[]; extern UNK_TYPE D_601E8C4; extern UNK_TYPE D_601E9D0; extern Gfx D_6018C00[]; +extern Gfx D_6018D40[]; extern Gfx D_6024B60[]; extern Gfx D_6025B50[]; extern Gfx D_6007CF0[]; diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index 664d003d..9439b64c 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -46,6 +46,7 @@ D_800D55E4_fake = 0x800D55E4; // force_migration:True D_800D8570 = 0x800D8570; // force_migration:True D_800D8594 = 0x800D8594; // force_migration:True D_800C93EC = 0x800C93EC; // force_migration:True +D_80177B90 = 0x80177B90; // force_migration:True D_DF4260_8019B1EC = 0x8019B1EC; // force_migration:True segment:ovl_DF4260 D_E16C50_801C171C = 0x801C171C; // force_migration:True segment:ovl_E16C50 diff --git a/src/main/joybus.c b/src/main/joybus.c index b38c32fa..ff95ead9 100644 --- a/src/main/joybus.c +++ b/src/main/joybus.c @@ -3,7 +3,7 @@ OSContPad gCurrentInput[4]; OSContPad gChangedInput[4]; u8 gControllerStatus[4]; -s32 gStopInputTimer; +u32 gStopInputTimer; u8 gRumbleStatus[4]; OSContPad sNextInput[4]; // OSContPad sPrevInput[4]; // diff --git a/src/overlays/ovl_EBFBE0/EBFCA0.c b/src/overlays/ovl_EBFBE0/EBFCA0.c deleted file mode 100644 index 32a8ee78..00000000 --- a/src/overlays/ovl_EBFBE0/EBFCA0.c +++ /dev/null @@ -1,444 +0,0 @@ -#include "global.h" - -void func_EBFBE0_801875E0(void) { - D_80137E78 = 2; - - D_80177DB0 = 0; - - D_80177AE0 = 2; - - D_80161A34 = 0; - D_800D2870 = 0; - - D_80177AF8 = func_EBFBE0_80187ABC(); - - D_80178348 = 0; - D_80178350 = 0; - D_80178354 = 0; - D_80178340 = 0; - - D_80178320 = 0; - D_80178328 = 0; - D_80178330 = 0; - - D_80161A36 = 0; - - D_EBFBE0_801B8284 = 0; - D_EBFBE0_801B82A8 = 0; - D_EBFBE0_801B82AC = 0; - - D_EBFBE0_801B833C = 0.0f; - - D_EBFBE0_801B82C0 = 0; - D_EBFBE0_801B8280 = 0; - - D_EBFBE0_801B7BCC = 255.0f; - D_EBFBE0_801B7BC8 = 255.0f; - - Memory_FreeAll(); - - func_800A5D6C(); - D_80178420 = 320.0f; - D_80178424 = 240.0f; - - func_EBFBE0_80188010(); - - if ((D_80177AF8 == -1) || (D_EBFBE0_801B827C != 0)) { - func_8001DC6C(0, 0x17); - D_EBFBE0_801B82C4 = 0; - D_EBFBE0_801B827C = 0; - } else { - func_8001DC6C(0, 0x16); - D_EBFBE0_801B82C4 = 1; - } - gStopInputTimer = 0x1E; -} - -void func_EBFBE0_80187754(void) { - switch (D_80177AE0) { - case 0: - if (D_8017783C == 0) { - D_80177898 = 0; - D_80177AE0 = 1; - } - break; - - case 1: - D_80177898 = 0; - func_EBFBE0_801875E0(); - break; - - case 2: - D_80177898 = 1; - func_EBFBE0_801877F0(); - break; - } - D_80177DB0++; -} - -void func_EBFBE0_801877F0(void) { - if (D_EBFBE0_801B82A8 > 0) { - D_EBFBE0_801B82A8 -= 1; - } - - if (D_EBFBE0_801B82AC > 0) { - D_EBFBE0_801B82AC -= 1; - } - - switch (D_EBFBE0_801B82C4) { - case 7: - func_EBFBE0_80187B00(); - break; - case 0: - func_EBFBE0_801888E8(); - func_EBFBE0_8019111C(); - break; - case 1: - func_EBFBE0_8018994C(); - break; - case 2: - func_EBFBE0_8018A644(); - break; - case 3: - func_EBFBE0_8018ACEC(); - break; - case 4: - func_EBFBE0_8018B5C4(); - break; - case 5: - func_EBFBE0_8018C644(); - break; - } - func_EBFBE0_80190E64(); -} - -void func_EBFBE0_801878D8(void) { - switch (D_EBFBE0_801B82C4) { - case 7: - func_EBFBE0_80187CA8(); - break; - - case 0: - func_EBFBE0_801918FC(); - func_EBFBE0_80189208(); - Matrix_Pop(&gGfxMatrix); - func_EBFBE0_8018F680(); - func_EBFBE0_8018F85C(); - func_EBFBE0_8018FC14(); - func_EBFBE0_8018F8E4(); - func_EBFBE0_801918FC(); - func_EBFBE0_8018F77C(); - Matrix_Pop(&gGfxMatrix); - break; - - case 1: - if (D_EBFBE0_801B8348 != 0) { - func_EBFBE0_801918FC(); - func_EBFBE0_8018A2F8(); - Matrix_Pop(&gGfxMatrix); - func_800BB5D0(); - func_EBFBE0_80190C9C(); - } - func_EBFBE0_8018FF74(); - func_EBFBE0_801906A0(); - break; - - case 2: - func_EBFBE0_801918FC(); - func_EBFBE0_8018A990(); - Matrix_Pop(&gGfxMatrix); - if (D_EBFBE0_801B8344 != 0) { - func_EBFBE0_8018FD08(); - } - break; - - case 3: - func_EBFBE0_801918FC(); - func_EBFBE0_8018B038(); - Matrix_Pop(&gGfxMatrix); - break; - - case 4: - func_EBFBE0_801918FC(); - func_EBFBE0_8018C114(); - Matrix_Pop(&gGfxMatrix); - func_EBFBE0_80190C9C(); - break; - - case 5: - func_EBFBE0_801918FC(); - func_EBFBE0_8018CB90(); - Matrix_Pop(&gGfxMatrix); - break; - } - - if (D_EBFBE0_801B8284 != 0) { - D_80178340 = 0; - D_80178348 = 0; - D_80178350 = 0; - D_80178354 = 0; - func_80084688(2, D_EBFBE0_801B8284); - } -} - -s32 func_EBFBE0_80187ABC(void) { - s32 ret = -1; - s32 i; - - for (i = 0; i < 4; i++) { - if (gControllerStatus[i] == 1) { - ret = i; - break; - } - } - - return ret; -} - -void func_EBFBE0_80187B00(void) { - switch (D_EBFBE0_801B82C0) { - case 0: - D_EBFBE0_801B8288 = 0; - D_80178410 = 800; - D_EBFBE0_801B82BC = 450; - D_EBFBE0_801B82C0++; - D_EBFBE0_801B82A8 = 20; - break; - - case 1: - if (D_EBFBE0_801B82BC != 0) { - func_800B6F50(D_80177978, D_80177980, D_80177988, D_801779A0, D_801779B8, D_801779C0); - D_8017842C -= 1.0f; - if (D_EBFBE0_801B82BC == 60) { - func_800182F4(0x103C00FF); - func_800182F4(0x113C00FF); - } - } else { - D_80178410 = 0; - D_8017829C = 0; - D_EBFBE0_801B82C0 = 0; - D_80177898 = 0; - func_8001DC6C(0, 0x16); - D_EBFBE0_801B82C4 = 1; - } - - if (D_EBFBE0_801B8288 == 0xA) { - D_EBFBE0_801B82BC -= 1; - } - break; - } - - if ((D_EBFBE0_801B82A8 == 0) && ((D_80177DB0 & 7) == 7) && (D_EBFBE0_801B8288 < 10)) { - D_EBFBE0_801B8288++; - } -} - -void func_EBFBE0_80187CA8(void) { - s32 temp = 20; - s32 temp2 = 36; - - func_800B8DD0(&gMasterDisp, 0x53); - - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); - - func_800A1200(temp2, temp, 1.0f, 1.0f, D_EBFBE0_801ADA44); - - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - - func_8009D994(&gMasterDisp, D_5000300, 16, 8, 148.0f, temp, 1.0f, 1.0f); - func_8009D994(&gMasterDisp, D_5000200, 16, 8, 164, temp, 1.0f, 1.0f); - - func_800B8DD0(&gMasterDisp, 0x53); - - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - - func_8009D994(&gMasterDisp, D_50077B0, 16, 2, 36, 32, 15.2f, 1.0f); - func_EBFBE0_80187E28(); -} - -void func_EBFBE0_80187E28(void) { - s32 temp; - s32 i; - - func_800B8DD0(&gMasterDisp, 0x53); - - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); - - func_800A1200(94, 38, 1.0f, 1.0f, "RANK"); - func_800A1200(146, 38, 1.0f, 1.0f, "NAME"); - func_800A1200(192, 38, 1.0f, 1.0f, "HITS"); - temp = 55; - - for (i = 0; i < D_EBFBE0_801B8288; i++) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - - func_8009FEA0(105 - ((func_8008BCBC(i + 1) - 1) * 8), temp, i + 1); - - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); - - func_800A1200(150, temp, 1.0f, 1.0f, &D_EBFBE0_801B8248[i][0]); - - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - - func_8009FEA0(211 - ((func_8008BCBC(D_EBFBE0_801B8220[i]) - 1) * 8), temp, D_EBFBE0_801B8220[i]); - temp += 17; - } -} - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80188010.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_801881FC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_801888E8.s") - -extern UnkStruct_D_801B8350 D_EBFBE0_801B8350[]; - -void func_EBFBE0_80189208(void) { - s32 i; - - D_80178548 = D_EBFBE0_801B82F8; - D_8017854C = D_EBFBE0_801B82FC; - D_80178550 = D_EBFBE0_801B8300; - D_80178554 = (s32) D_EBFBE0_801B8304; - D_80178558 = (s32) D_EBFBE0_801B8308; - D_8017855C = (s32) D_EBFBE0_801B830C; - - if ((D_EBFBE0_801B86A4 < 2) && (D_EBFBE0_801B9040 != 0)) { - D_EBFBE0_801B86D8 = Math_Atan2F(-D_EBFBE0_801B9060, sqrtf((-D_EBFBE0_801B905C * -D_EBFBE0_801B905C) + - (-D_EBFBE0_801B9064 * -D_EBFBE0_801B9064))) * - 180.0f / M_PI; - D_EBFBE0_801B86DC = (Math_Atan2F(D_EBFBE0_801B905C, D_EBFBE0_801B9064) * 180.0f) / M_PI; - - func_8009BC2C(&D_EBFBE0_801B86C8, D_EBFBE0_801B86D8, 0.1f, 100.0f, 0.0001f); - func_8009BC2C(&D_EBFBE0_801B86CC, D_EBFBE0_801B86DC, 0.1f, 100.0f, 0.0001f); - } - - func_EBFBE0_80191674(D_EBFBE0_801B86C8, D_EBFBE0_801B86CC, 100.0f, &D_EBFBE0_801B82E0, &D_EBFBE0_801B82E4, - &D_EBFBE0_801B82E8); - - for (i = 0; i < 4; i++) { - func_EBFBE0_8018EA78(D_EBFBE0_801ADA84[i]); - D_EBFBE0_801B8350[D_EBFBE0_801ADA84[i]].unk_54 += D_EBFBE0_801B8350[D_EBFBE0_801ADA84[i]].unk_58; - } - - D_80178548 = D_EBFBE0_801B8310; - D_8017854C = D_EBFBE0_801B8314; - D_80178550 = D_EBFBE0_801B8318; - - D_80178554 = D_EBFBE0_801B831C; - D_80178558 = D_EBFBE0_801B8320; - D_8017855C = D_EBFBE0_801B8324; - - func_EBFBE0_80191674(D_EBFBE0_801B86D0, D_EBFBE0_801B86D4, 100.0f, &D_EBFBE0_801B82E0, &D_EBFBE0_801B82E4, - &D_EBFBE0_801B82E8); - - func_EBFBE0_8018D2B8(0); -} - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_801894E8.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018994C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018A2F8.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018A338.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018A644.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018A990.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018ABC0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018ACEC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018B038.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018B058.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018B5C4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018C114.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018C1C0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018C644.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018CB90.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018CC30.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018CD9C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018D2B8.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018D510.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018D80C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018DDB8.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018DF0C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018E058.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018E200.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018E67C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018EA78.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018EDC8.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018F438.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018F680.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018F77C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018F85C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018F8E4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018FC14.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018FD08.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8018FF74.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80190144.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_801903B8.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_801906A0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80190950.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80190A98.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80190B30.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80190C9C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80190E64.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80190EA4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80190FD0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_8019111C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_801912A0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80191320.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_801914AC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80191674.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80191798.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_80191844.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_801918FC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/EBFCA0/func_EBFBE0_801919C4.s") diff --git a/src/overlays/ovl_EBFBE0/fox_option.c b/src/overlays/ovl_EBFBE0/fox_option.c index 838e9318..cf87c19f 100644 --- a/src/overlays/ovl_EBFBE0/fox_option.c +++ b/src/overlays/ovl_EBFBE0/fox_option.c @@ -119,7 +119,7 @@ void func_EBFBE0_80191B20(void) { if ((D_80161A34 == 5) || (D_80161A34 == 8)) { if (D_80161A34 == 8) { - D_80177B8C[D_80177B48 + 1] = 13; + D_80177B90[D_80177B48] = 13; if (D_800D3180[9] == 1) { gSaveFile.save.data.unk_00[14].unk_5 = 1; if (var_v0_2 != 0) { @@ -1618,7 +1618,76 @@ void func_EBFBE0_8019B8A0(s32 arg0) { #pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_option/func_EBFBE0_8019C5A0.s") -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_option/func_EBFBE0_8019C66C.s") +s32 func_EBFBE0_8019C66C(f32* arg0, f32 arg1, f32 arg2, UnkStruct_D_EBFBE0_801B9250* arg3) { + s32 x; + s32 y; + s32 var_a2; + f32 var_fv1; + f32 temp; + f32 temp2; + + var_a2 = 0; + temp = *arg0; + + x = gChangedInput[D_80177AF8].stick_x; + y = -gChangedInput[D_80177AF8].stick_y; + + if ((y > 10) || (y < -10)) { + return 0; + } + + if ((x < 10) && (x > -10)) { + x = 0; + } else if (x < 0) { + x += 10; + } else { + x -= 10; + } + + if (arg3->unk_4 == 0) { + if (x != 0) { + var_fv1 = (f32) x / 20.0f; + arg3->unk_4 = arg3->unk_0; + + if (arg3->unk_0 != 0) { + arg3->unk_0 -= 7; + } + + if (arg3->unk_4 != 0) { + if (x > 0) { + var_fv1 = 1.0f; + } else { + var_fv1 = -1.0f; + } + } + + *arg0 += var_fv1; + + if (arg2 < *arg0) { + *arg0 = arg2; + } + if (*arg0 < arg1) { + *arg0 = arg1; + } + } else { + arg3->unk_4 = 0; + arg3->unk_0 = 7; + } + } + + if (arg3->unk_4 > 0) { + arg3->unk_4--; + } + + temp2 = *arg0; + + if ((s32) temp2 != (s32) temp) { + func_80019218(0x49004007, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + var_a2 = 1; + } + + return var_a2; +} void func_EBFBE0_8019C824(f32* arg0) { if ((s32) func_8009BC2C(arg0, D_EBFBE0_801B91E4, 0.5f, 100.0f, 1.0f) == 0.0f) { diff --git a/src/overlays/ovl_EBFBE0/fox_title.c b/src/overlays/ovl_EBFBE0/fox_title.c new file mode 100644 index 00000000..5bb26abb --- /dev/null +++ b/src/overlays/ovl_EBFBE0/fox_title.c @@ -0,0 +1,1359 @@ +#include "global.h" +#include "fox_title.h" + +void func_EBFBE0_801875E0(void) { + D_80137E78 = 2; + + D_80177DB0 = 0; + + D_80177AE0 = 2; + + D_80161A34 = 0; + D_800D2870 = 0; + + D_80177AF8 = func_EBFBE0_80187ABC(); + + D_80178348 = 0; + D_80178350 = 0; + D_80178354 = 0; + D_80178340 = 0; + + D_80178320 = 0; + D_80178328 = 0; + D_80178330 = 0; + + D_80161A36 = 0; + + D_EBFBE0_801B8284 = 0; + D_EBFBE0_801B82A8 = 0; + D_EBFBE0_801B82AC = 0; + + D_EBFBE0_801B833C = 0.0f; + + D_EBFBE0_801B82C0 = 0; + D_EBFBE0_801B8280 = 0; + + D_EBFBE0_801B7BCC = 255.0f; + D_EBFBE0_801B7BC8 = 255.0f; + + Memory_FreeAll(); + + func_800A5D6C(); + D_80178420 = 320.0f; + D_80178424 = 240.0f; + + func_EBFBE0_80188010(); + + if ((D_80177AF8 == -1) || (D_EBFBE0_801B827C != 0)) { + func_8001DC6C(0, 0x17); + D_EBFBE0_801B82C4 = 0; + D_EBFBE0_801B827C = 0; + } else { + func_8001DC6C(0, 0x16); + D_EBFBE0_801B82C4 = 1; + } + gStopInputTimer = 0x1E; +} + +void func_EBFBE0_80187754(void) { + switch (D_80177AE0) { + case 0: + if (D_8017783C == 0) { + D_80177898 = 0; + D_80177AE0 = 1; + } + break; + + case 1: + D_80177898 = 0; + func_EBFBE0_801875E0(); + break; + + case 2: + D_80177898 = 1; + func_EBFBE0_801877F0(); + break; + } + D_80177DB0++; +} + +void func_EBFBE0_801877F0(void) { + if (D_EBFBE0_801B82A8 > 0) { + D_EBFBE0_801B82A8 -= 1; + } + + if (D_EBFBE0_801B82AC > 0) { + D_EBFBE0_801B82AC -= 1; + } + + switch (D_EBFBE0_801B82C4) { + case 7: + func_EBFBE0_80187B00(); + break; + case 0: + func_EBFBE0_801888E8(); + func_EBFBE0_8019111C(); + break; + case 1: + func_EBFBE0_8018994C(); + break; + case 2: + func_EBFBE0_8018A644(); + break; + case 3: + func_EBFBE0_8018ACEC(); + break; + case 4: + func_EBFBE0_8018B5C4(); + break; + case 5: + func_EBFBE0_8018C644(); + break; + } + func_EBFBE0_80190E64(); +} + +void func_EBFBE0_801878D8(void) { + switch (D_EBFBE0_801B82C4) { + case 7: + func_EBFBE0_80187CA8(); + break; + + case 0: + func_EBFBE0_801918FC(); + func_EBFBE0_80189208(); + Matrix_Pop(&gGfxMatrix); + func_EBFBE0_8018F680(); + func_EBFBE0_8018F85C(); + func_EBFBE0_8018FC14(); + func_EBFBE0_8018F8E4(); + func_EBFBE0_801918FC(); + func_EBFBE0_8018F77C(); + Matrix_Pop(&gGfxMatrix); + break; + + case 1: + if (D_EBFBE0_801B8348 != 0) { + func_EBFBE0_801918FC(); + func_EBFBE0_8018A2F8(); + Matrix_Pop(&gGfxMatrix); + func_800BB5D0(); + func_EBFBE0_80190C9C(); + } + func_EBFBE0_8018FF74(); + func_EBFBE0_801906A0(); + break; + + case 2: + func_EBFBE0_801918FC(); + func_EBFBE0_8018A990(); + Matrix_Pop(&gGfxMatrix); + if (D_EBFBE0_801B8344 != 0) { + func_EBFBE0_8018FD08(); + } + break; + + case 3: + func_EBFBE0_801918FC(); + func_EBFBE0_8018B038(); + Matrix_Pop(&gGfxMatrix); + break; + + case 4: + func_EBFBE0_801918FC(); + func_EBFBE0_8018C114(); + Matrix_Pop(&gGfxMatrix); + func_EBFBE0_80190C9C(); + break; + + case 5: + func_EBFBE0_801918FC(); + func_EBFBE0_8018CB90(); + Matrix_Pop(&gGfxMatrix); + break; + } + + if (D_EBFBE0_801B8284 != 0) { + D_80178340 = 0; + D_80178348 = 0; + D_80178350 = 0; + D_80178354 = 0; + func_80084688(2, D_EBFBE0_801B8284); + } +} + +s32 func_EBFBE0_80187ABC(void) { + s32 ret = -1; + s32 i; + + for (i = 0; i < 4; i++) { + if (gControllerStatus[i] == 1) { + ret = i; + break; + } + } + + return ret; +} + +void func_EBFBE0_80187B00(void) { + switch (D_EBFBE0_801B82C0) { + case 0: + D_EBFBE0_801B8288 = 0; + D_80178410 = 800; + D_EBFBE0_801B82BC = 450; + D_EBFBE0_801B82C0++; + D_EBFBE0_801B82A8 = 20; + break; + + case 1: + if (D_EBFBE0_801B82BC != 0) { + func_800B6F50(D_80177978, D_80177980, D_80177988, D_801779A0, D_801779B8, D_801779C0); + D_8017842C -= 1.0f; + if (D_EBFBE0_801B82BC == 60) { + func_800182F4(0x103C00FF); + func_800182F4(0x113C00FF); + } + } else { + D_80178410 = 0; + D_8017829C = 0; + D_EBFBE0_801B82C0 = 0; + D_80177898 = 0; + func_8001DC6C(0, 0x16); + D_EBFBE0_801B82C4 = 1; + } + + if (D_EBFBE0_801B8288 == 10) { + D_EBFBE0_801B82BC--; + } + break; + } + + if ((D_EBFBE0_801B82A8 == 0) && ((D_80177DB0 & 7) == 7) && (D_EBFBE0_801B8288 < 10)) { + D_EBFBE0_801B8288++; + } +} + +void func_EBFBE0_80187CA8(void) { + s32 temp = 20; + s32 temp2 = 36; + + func_800B8DD0(&gMasterDisp, 0x53); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); + + func_800A1200(temp2, temp, 1.0f, 1.0f, D_EBFBE0_801ADA44); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + + func_8009D994(&gMasterDisp, D_5000300, 16, 8, 148.0f, temp, 1.0f, 1.0f); + func_8009D994(&gMasterDisp, D_5000200, 16, 8, 164, temp, 1.0f, 1.0f); + + func_800B8DD0(&gMasterDisp, 0x53); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + + func_8009D994(&gMasterDisp, D_50077B0, 16, 2, 36, 32, 15.2f, 1.0f); + func_EBFBE0_80187E28(); +} + +void func_EBFBE0_80187E28(void) { + s32 temp; + s32 i; + + func_800B8DD0(&gMasterDisp, 0x53); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); + + func_800A1200(94, 38, 1.0f, 1.0f, "RANK"); + func_800A1200(146, 38, 1.0f, 1.0f, "NAME"); + func_800A1200(192, 38, 1.0f, 1.0f, "HITS"); + temp = 55; + + for (i = 0; i < D_EBFBE0_801B8288; i++) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + + func_8009FEA0(105 - ((func_8008BCBC(i + 1) - 1) * 8), temp, i + 1); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); + + func_800A1200(150, temp, 1.0f, 1.0f, &D_EBFBE0_801B8248[i][0]); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + + func_8009FEA0(211 - ((func_8008BCBC(D_EBFBE0_801B8220[i]) - 1) * 8), temp, D_EBFBE0_801B8220[i]); + temp += 17; + } +} + +s32 func_EBFBE0_80188010(void) { + s32 temp1; + s32 temp2; + s32 temp3; + s32 i; + s32 j; + + for (i = 0; i < 10; i++) { + D_EBFBE0_801B8220[i] = 0; + for (j = 0; j < 3; j++) { + D_EBFBE0_801B81A8[i][j] = 0; + } + } + + for (i = 0; i < 10; i++) { + D_EBFBE0_801B8248[i][0] = gSaveFile.save.data.unk_18[i][0] & 0xFF; + D_EBFBE0_801B8248[i][1] = gSaveFile.save.data.unk_18[i][1] & 0xFF; + D_EBFBE0_801B8248[i][2] = gSaveFile.save.data.unk_18[i][2] & 0xFF; + D_EBFBE0_801B8248[i][3] = 0; + + temp3 = gSaveFile.save.data.unk_36[i]; + + for (j = 0; j < temp3; j++) { + temp2 = gSaveFile.save.data.unk_5E[i][j].unk_0; + temp2 |= (gSaveFile.save.data.unk_5E[i][j].unk_C & 1) * 256; + + D_EBFBE0_801B8220[i] += temp2; + + D_EBFBE0_801B81A8[i][0] += gSaveFile.save.data.unk_5E[i][j].unk_D & 1; + D_EBFBE0_801B81A8[i][1] += gSaveFile.save.data.unk_5E[i][j].unk_F & 1; + D_EBFBE0_801B81A8[i][2] += gSaveFile.save.data.unk_5E[i][j].unk_E & 1; + } + } + + temp1 = D_EBFBE0_801B8220[0]; + + for (i = 1; i < 10; i++) { + if (temp1 < D_EBFBE0_801B8220[i]) { + temp1 = D_EBFBE0_801B8220[i]; + } + } + + return temp1; +} + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_801881FC.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_801888E8.s") + +void func_EBFBE0_80189208(void) { + s32 i; + + D_80178548 = D_EBFBE0_801B82F8; + D_8017854C = D_EBFBE0_801B82FC; + D_80178550 = D_EBFBE0_801B8300; + D_80178554 = D_EBFBE0_801B8304; + D_80178558 = D_EBFBE0_801B8308; + D_8017855C = D_EBFBE0_801B830C; + + if ((D_EBFBE0_801B86A4 < 2) && (D_EBFBE0_801B9040 != 0)) { + D_EBFBE0_801B86D8 = Math_Atan2F(-D_EBFBE0_801B9060, sqrtf((-D_EBFBE0_801B905C * -D_EBFBE0_801B905C) + + (-D_EBFBE0_801B9064 * -D_EBFBE0_801B9064))) * + 180.0f / M_PI; + D_EBFBE0_801B86DC = (Math_Atan2F(D_EBFBE0_801B905C, D_EBFBE0_801B9064) * 180.0f) / M_PI; + + func_8009BC2C(&D_EBFBE0_801B86C8, D_EBFBE0_801B86D8, 0.1f, 100.0f, 0.0001f); + func_8009BC2C(&D_EBFBE0_801B86CC, D_EBFBE0_801B86DC, 0.1f, 100.0f, 0.0001f); + } + + func_EBFBE0_80191674(D_EBFBE0_801B86C8, D_EBFBE0_801B86CC, 100.0f, &D_EBFBE0_801B82E0, &D_EBFBE0_801B82E4, + &D_EBFBE0_801B82E8); + + for (i = 0; i < 4; i++) { + func_EBFBE0_8018EA78(D_EBFBE0_801ADA84[i]); + D_EBFBE0_801B8350[D_EBFBE0_801ADA84[i]].unk_58 += D_EBFBE0_801B8350[D_EBFBE0_801ADA84[i]].unk_5C; + } + + D_80178548 = D_EBFBE0_801B8310; + D_8017854C = D_EBFBE0_801B8314; + D_80178550 = D_EBFBE0_801B8318; + + D_80178554 = D_EBFBE0_801B831C; + D_80178558 = D_EBFBE0_801B8320; + D_8017855C = D_EBFBE0_801B8324; + + func_EBFBE0_80191674(D_EBFBE0_801B86D0, D_EBFBE0_801B86D4, 100.0f, &D_EBFBE0_801B82E0, &D_EBFBE0_801B82E4, + &D_EBFBE0_801B82E8); + + func_EBFBE0_8018D2B8(0); +} + +void func_EBFBE0_801894E8(void) { + s32 i; + + D_80178410 = 800; + D_EBFBE0_801B7C98 = 10; + + for (i = 0; i < 10; i++) { + D_EBFBE0_801B7BF8[i] = 10.0f + (Rand_ZeroOne() * 10.0f); + D_EBFBE0_801B7C20[i] = -10.0f + (Rand_ZeroOne() * -60.0f); + D_EBFBE0_801B7C48[i] = 0.0f; + D_EBFBE0_801B7C70[i] = 0.1f + (Rand_ZeroOne() * 0.3f); + D_EBFBE0_801B7D18[i] = 5 + (s32) (Rand_ZeroOne() * 5.0f); + D_EBFBE0_801B7CC8[i] = 255; + D_EBFBE0_801B7CF0[i] = 128; + D_EBFBE0_801B7CA0[i] = 0; + } + + D_EBFBE0_801B869C = 255; + D_80178340 = 255; + D_80178348 = 0; + D_80178350 = 0; + D_80178354 = 0; + + D_EBFBE0_801B9070 = 110.0f; + D_EBFBE0_801B9074 = 70.0f; + D_EBFBE0_801B9078 = 1.0f; + D_EBFBE0_801B907C = 1.0f; + D_EBFBE0_801B7BDC = 0.0f; + D_EBFBE0_801B7BE0 = 0.0f; + D_EBFBE0_801B7BD4 = 0; + D_EBFBE0_801B7BD8 = 0; + D_EBFBE0_801B9080 = 0.0f; + D_EBFBE0_801B9084 = 60.0f; + D_EBFBE0_801B7BB0 = 1.0f; + D_EBFBE0_801B7BB4 = 1.0f; + D_EBFBE0_801B7BD0 = 0; + D_EBFBE0_801B7BB8 = -900.0f; + D_EBFBE0_801B7BBC = 205.0f; + D_EBFBE0_801B7BC0 = 10.0f; + D_EBFBE0_801B7BC4 = 10.0f; + D_EBFBE0_801B86C8 = 0.0f; + D_EBFBE0_801B86CC = 162.0f; + + D_80178548 = 101; + D_8017854C = 106; + D_80178550 = 92; + D_80178554 = 3; + D_80178558 = 4; + D_8017855C = 10; + + D_EBFBE0_801B8688.pos.y = 0.0f; + D_EBFBE0_801B8688.unk_0C = 0; + D_EBFBE0_801B8688.pos.x = -80.0f; + D_EBFBE0_801B8688.pos.z = 500.0f; + D_EBFBE0_801B8688.scale = 5.0f; + + D_EBFBE0_801B8348 = 0; + + D_EBFBE0_801B8658.pos.x = 20.0f; + D_EBFBE0_801B8658.pos.y = 0.0f; + D_EBFBE0_801B8658.pos.z = 30.0f; + D_EBFBE0_801B8658.angleX = 0.0f; + D_EBFBE0_801B8658.angleY = 0.0f; + D_EBFBE0_801B8658.angleZ = 0.0f; + D_EBFBE0_801B8658.scale = 0.1f; + + D_EBFBE0_801B86BC = 0.0f; + D_EBFBE0_801B86C0 = 0.0f; + D_EBFBE0_801B86C4 = 0.0f; + D_EBFBE0_801B86A8 = -10.0f; + D_EBFBE0_801B86AC = 0.0f; + + D_EBFBE0_801B86B4 = 1500.0f; + D_EBFBE0_801B86B8 = -100.0f; + D_EBFBE0_801B829C = 0.0f; + D_EBFBE0_801B82A0 = 1.0f; + D_EBFBE0_801B82A4 = 0.0f; + + func_EBFBE0_801914AC(D_EBFBE0_801B86BC, D_EBFBE0_801B86C0, D_EBFBE0_801B86C4, &D_80177978, &D_80177980, &D_80177988, + D_EBFBE0_801B86B4, &D_801779A0, &D_801779B8, &D_801779C0, D_EBFBE0_801B86B8, D_EBFBE0_801B86A8, + D_EBFBE0_801B86AC); + + D_EBFBE0_801B7BF0 = 0; + + func_8001D444(0, 35, 0, 255); +} + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018994C.s") + +void func_EBFBE0_8018A2F8(void) { + if (D_EBFBE0_801B8694 != 0) { + func_EBFBE0_8018DF0C(-700.0f); + } + func_EBFBE0_8018E058(); +} + +void func_EBFBE0_8018A338(void) { + D_80178410 = 0; + + D_EBFBE0_801B869C = 255; + + D_80178340 = 255; + D_80178348 = 0; + D_80178350 = 0; + D_80178354 = 0; + + D_EBFBE0_801B8344 = 0; + D_EBFBE0_801B8334 = 0; + D_EBFBE0_801B8338 = 1; + + D_EBFBE0_801B8328 = D_EBFBE0_801B832C = D_EBFBE0_801B8330 = 155.0f; + + D_EBFBE0_801B8328 = 77.0f; + D_EBFBE0_801B832C = 77.0f; + D_EBFBE0_801B8330 = 77.0f; + + D_EBFBE0_801B86C8 = 0.0f; + D_EBFBE0_801B86CC = -90.0f; + D_EBFBE0_801B82F8 = 76; + D_EBFBE0_801B82FC = 45; + D_EBFBE0_801B8300 = 66; + D_EBFBE0_801B8304 = 11.0f; + D_EBFBE0_801B8308 = 1.0f; + D_EBFBE0_801B830C = 1.0f; + D_EBFBE0_801B84D4 = 0.5f; + + D_EBFBE0_801B8350[0].unk_00.x = -20.0f; + D_EBFBE0_801B8350[0].unk_00.y = 0.0f; + D_EBFBE0_801B8350[0].unk_00.z = -600.0f; + D_EBFBE0_801B8350[0].unk_0C = 0.0f; + D_EBFBE0_801B8350[0].unk_10 = 3.0f; + D_EBFBE0_801B8350[0].unk_58 = 14; + D_EBFBE0_801B8350[0].unk_5C = 5; + + D_EBFBE0_801B8350[1].unk_00.x = -209.0f; + D_EBFBE0_801B8350[1].unk_00.y = 0.0f; + D_EBFBE0_801B8350[1].unk_00.z = -820.0f; + D_EBFBE0_801B8350[1].unk_0C = 0.0f; + D_EBFBE0_801B8350[1].unk_10 = 3.0f; + D_EBFBE0_801B8350[1].unk_58 = 0; + D_EBFBE0_801B8350[1].unk_5C = 5; + + D_EBFBE0_801B8350[2].unk_00.x = 62.0f; + D_EBFBE0_801B8350[2].unk_00.y = 0.0f; + D_EBFBE0_801B8350[2].unk_00.z = -813.0f; + D_EBFBE0_801B8350[2].unk_0C = 0.0f; + D_EBFBE0_801B8350[2].unk_10 = 3.0f; + D_EBFBE0_801B8350[2].unk_58 = 29; + D_EBFBE0_801B8350[2].unk_5C = 6; + + D_EBFBE0_801B8350[3].unk_00.x = 183.0f; + D_EBFBE0_801B8350[3].unk_00.y = 0.0f; + D_EBFBE0_801B8350[3].unk_00.z = -990.0f; + D_EBFBE0_801B8350[3].unk_0C = 0.0f; + D_EBFBE0_801B8350[3].unk_10 = 3.0f; + D_EBFBE0_801B8350[3].unk_58 = 41; + D_EBFBE0_801B8350[3].unk_5C = 7; + + D_EBFBE0_801B84D0 = -6000.0f; + D_EBFBE0_801B86BC = 22.0f; + D_EBFBE0_801B86C0 = 116.0f; + D_EBFBE0_801B86C4 = -543.0f; + D_EBFBE0_801B86A8 = 3.0f; + D_EBFBE0_801B86AC = 7.0f; + D_EBFBE0_801B86B4 = 400.0f; + D_EBFBE0_801B86B8 = -100.0f; + D_EBFBE0_801B829C = 0.0f; + D_EBFBE0_801B82A0 = 1.0f; + D_EBFBE0_801B82A4 = 0.0f; + + func_EBFBE0_801914AC(D_EBFBE0_801B86BC, D_EBFBE0_801B86C0, D_EBFBE0_801B86C4, &D_80177978, &D_80177980, &D_80177988, + D_EBFBE0_801B86B4, &D_801779A0, &D_801779B8, &D_801779C0, D_EBFBE0_801B86B8, D_EBFBE0_801B86A8, + D_EBFBE0_801B86AC); +} + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018A644.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018A990.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018ABC0.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018ACEC.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018B038.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018B058.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018B5C4.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018C114.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018C1C0.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018C644.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018CB90.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018CC30.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018CD9C.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018D2B8.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018D510.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018D80C.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018DDB8.s") + +void func_EBFBE0_8018DF0C(f32 arg0) { + f32 sp34; + f32 sp30; + + func_EBFBE0_80191798(&sp34, &sp30); + func_800B8DD0(&gMasterDisp, 0x35); + + if (arg0 != 0.0f) { + D_EBFBE0_801B8688.pos.z = D_80177988 - arg0; + } + + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, D_EBFBE0_801B8688.pos.x, D_EBFBE0_801B8688.pos.y, D_EBFBE0_801B8688.pos.z, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * sp30, 1); + Matrix_RotateX(gGfxMatrix, M_DTOR * sp34, 1); + Matrix_Scale(gGfxMatrix, D_EBFBE0_801B8688.scale, D_EBFBE0_801B8688.scale, D_EBFBE0_801B8688.scale, 1); + Matrix_SetGfxMtx(&gMasterDisp); + + gSPDisplayList(gMasterDisp++, D_6037CF0); + func_EBFBE0_8018E200(); + Matrix_Pop(&gGfxMatrix); +} + +void func_EBFBE0_8018E058(void) { + Lights_SetOneLight(&gMasterDisp, D_EBFBE0_801B82E0, D_EBFBE0_801B82E4, D_EBFBE0_801B82E8, D_80178548, D_8017854C, + D_80178550, D_80178554, D_80178558, D_8017855C); + + Matrix_Push(&gGfxMatrix); + + Matrix_Translate(gGfxMatrix, D_EBFBE0_801B8658.pos.x, D_EBFBE0_801B8658.pos.y, D_EBFBE0_801B8658.pos.z, 1); + + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_EBFBE0_801B8658.angleZ, 1); + Matrix_RotateX(gGfxMatrix, M_DTOR * D_EBFBE0_801B8658.angleX, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_EBFBE0_801B8658.angleY, 1); + + Matrix_Scale(gGfxMatrix, D_EBFBE0_801B8658.scale, D_EBFBE0_801B8658.scale, D_EBFBE0_801B8658.scale, 1); + + Matrix_SetGfxMtx(&gMasterDisp); + func_800B8DD0(&gMasterDisp, 0x17); + + D_80177B8C = 1; + + func_800515C4(); + func_8005F1EC(&D_EBFBE0_801B8658.unk_24); + + Matrix_Pop(&gGfxMatrix); +} + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018E200.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018E67C.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018EA78.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018EDC8.s") + +void func_EBFBE0_8018F438(void) { + f32 sp54; + + Lights_SetOneLight(&gMasterDisp, 0, 0, 0, 0, 0, 0, D_80178554, D_80178558, D_8017855C); + + if (D_801779C0 < D_80177988) { + sp54 = 1.0f; + } else { + sp54 = 3.0f; + } + + D_EBFBE0_801B82C8 += 70.0f; + D_EBFBE0_801B82C8 = Math_ModF(D_EBFBE0_801B82C8, 4101.6f); + + func_800BA1D0(D_80178320, D_80178328, D_80178330, 255, 995, 1000); + + Matrix_Push(&gGfxMatrix); + + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, (3079.2002f * sp54) - D_EBFBE0_801B82C8, 1); + Matrix_Scale(gGfxMatrix, 0.6f, 0.6f, 0.6f, 1); + Matrix_SetGfxMtx(&gMasterDisp); + + gSPDisplayList(gMasterDisp++, D_602E380); + + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -6836.0f, 1); + Matrix_SetGfxMtx(&gMasterDisp); + + gSPDisplayList(gMasterDisp++, D_602E380); + + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -6836.0f, 1); + Matrix_SetGfxMtx(&gMasterDisp); + + gSPDisplayList(gMasterDisp++, D_602E380); + + Matrix_Pop(&gGfxMatrix); +} + +void func_EBFBE0_8018F680(void) { + s32 i; + + func_800B8DD0(&gMasterDisp, 0x53); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + + for (i = 0; i < 30; i++) { + func_8009D418(&gMasterDisp, D_6000000 + (i * 472), 236, 2, D_EBFBE0_801B9054, D_EBFBE0_801B9058 + (i * 2.0f), + 1.0f, 1.0f); + } +} + +void func_EBFBE0_8018F77C(void) { + func_800B8DD0(&gMasterDisp, 0x35); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, D_EBFBE0_801B905C, D_EBFBE0_801B9060, D_EBFBE0_801B9064, 1); + Matrix_Scale(gGfxMatrix, D_EBFBE0_801B9068, D_EBFBE0_801B906C, 1.0f, 1); + Matrix_RotateX(gGfxMatrix, M_DTOR * 90, 1); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, D_60148D0); + Matrix_Pop(&gGfxMatrix); +} + +void func_EBFBE0_8018F85C(void) { + func_800B8DD0(&gMasterDisp, 0x53); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + func_8009D994(&gMasterDisp, D_6013470, 16, 16, 234.0f, 20.0f, 1.0f, 1.0f); +} + +#ifdef IMPORT_DATA_PENDING +void func_EBFBE0_8018F8E4(void) { + f32 temp2; + s32 i; + static f32 D_EBFBE0_801AE464 = 68.0f; + static f32 D_EBFBE0_801AE468 = 170.0f; + static f32 D_EBFBE0_801AE46C = 5.55f; + static f32 D_EBFBE0_801AE470 = 0.9f; + static f32 D_EBFBE0_801AE474 = 70.0f; + static f32 D_EBFBE0_801AE478 = 172.0f; + + if (gStopInputTimer == 0) { + temp2 = 188.0f; + + if ((s32) func_8009BC2C(&D_EBFBE0_801B7BC8, D_EBFBE0_801B7BCC, 0.5f, 100.0f, 1.0f) == 0.0f) { + if (D_EBFBE0_801B7BC8 == 32.0f) { + D_EBFBE0_801B7BCC = 255.0f; + } else { + D_EBFBE0_801B7BCC = 32.0f; + } + } + + if (D_80177AF8 < 0) { + func_800B8DD0(&gMasterDisp, 0x55); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 60, 60, 255, 200); + + func_8009D0BC(&gMasterDisp, &D_601D750, &D_601DB50, 32, 32, D_EBFBE0_801AE464, D_EBFBE0_801AE468, + D_EBFBE0_801AE46C, D_EBFBE0_801AE470); + func_800B8DD0(&gMasterDisp, 0x53); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, (s32) D_EBFBE0_801B7BC8, (s32) D_EBFBE0_801B7BC8, 255); + + for (i = 0; i < 6; i++) { + func_8009D994(&gMasterDisp, D_60123F0 + (704 * i), 176, 4, D_EBFBE0_801AE474, + D_EBFBE0_801AE478 + (i * 4.0f), 1.0f, 1.0f); + } + } else { + func_800B8DD0(&gMasterDisp, 0x53); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, (s32) D_EBFBE0_801B7BC8, (s32) D_EBFBE0_801B7BC8, 255); + + for (i = 0; i < 2; i++) { + func_8009D994(&gMasterDisp, D_600E360 + (i * 720), 120, 6, 101.0f, temp2 + (i * 6.0f), 1.0f, 1.0f); + } + func_8009D994(&gMasterDisp, D_600E360 + 1440, 120, 1, 101.0f, temp2 + 12, 1.0f, 1.0f); + } + } +} +#else +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018F8E4.s") +#endif + +void func_EBFBE0_8018FC14(void) { + s32 i; + + func_800B8DD0(&gMasterDisp, 0x53); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + + for (i = 0; i < 2; i++) { + func_8009D994(&gMasterDisp, D_600DDC0 + (i * 720), 120, 6, 102.0f, 209.0f + (i * 6.0f), 1.0f, 1.0f); + } +} + +#ifdef IMPORT_DATA_PENDING +void func_EBFBE0_8018FD08(void) { + s32 i; + Gfx* temp_v1; + f32 temp_fs2; + s32 var_s0; + s32 var_s0_2; + f32 temp; + static f32 D_EBFBE0_801AE47C[] = { 90.0f, 100.0f, 75.0f, 75.0f }; + + temp_fs2 = D_EBFBE0_801AE47C[D_EBFBE0_801B8340]; + temp = 210.0f; + + func_800B8DD0(&gMasterDisp, 0x53); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + + switch (D_EBFBE0_801B8340) { + case 0: + func_8009D994(&gMasterDisp, D_600F940, 144, 13, temp_fs2, temp, 1.0f, 1.0f); + break; + + case 1: + func_8009D994(&gMasterDisp, D_6010090, 120, 13, temp_fs2, temp, 1.0f, 1.0f); + break; + + case 2: + for (i = 0; i < 3; i++) { + func_8009D994(&gMasterDisp, D_60106B0 + (704 * i), 176, 4, temp_fs2, temp + (i * 4), 1.0f, 1.0f); + } + func_8009D994(&gMasterDisp, D_60106B0 + 2112, 176, 1, temp_fs2, temp + 12.0f, 1.0f, 1.0f); + break; + + case 3: + for (i = 0; i < 3; i++) { + func_8009D994(&gMasterDisp, D_6010FA0 + (i * 704), 176, 4, temp_fs2, temp + (i * 4), 1.0f, 1.0f); + } + func_8009D994(&gMasterDisp, D_6010FA0 + 2112, 176, 1, temp_fs2, temp + 12, 1.0f, 1.0f); + break; + } +} +#else +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_8018FD08.s") +#endif + +void func_EBFBE0_8018FF74(void) { + if (D_EBFBE0_801B7BD8 != 0) { + if ((D_EBFBE0_801B7BB8 > -870.0f) && (D_EBFBE0_801B7BB8 < 900.0f) && (D_80178340 > 0)) { + if ((D_EBFBE0_801B7BB8 < 0.0f) && (D_EBFBE0_801B7BD0 < 255)) { + D_EBFBE0_801B7BD0 += 2; + } + if ((D_EBFBE0_801B7BB8 > 0.0f) && (D_EBFBE0_801B7BD0 > 0)) { + D_EBFBE0_801B7BD0 -= 2; + } + + func_800B8DD0(&gMasterDisp, 0x53); + + gDPSetAlphaDither(gMasterDisp++, G_AD_NOISE); + gDPSetColorDither(gMasterDisp++, G_CD_NOISE); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, D_EBFBE0_801B7BD0); + + func_8009D418(&gMasterDisp, &D_600D5C0, 32, 32, D_EBFBE0_801B9080, D_EBFBE0_801B9084, D_EBFBE0_801B7BB0, + D_EBFBE0_801B7BB4); + D_EBFBE0_801B9080 += 1.66f; + } + + func_EBFBE0_801918FC(); + func_EBFBE0_80190144(); + func_EBFBE0_801903B8(); + + Matrix_Pop(&gGfxMatrix); + } +} + +void func_EBFBE0_80190144(void) { + s32 i; + + if (D_80178340 > 0) { + D_80178340 -= 4; + } + + D_801783D0 = D_EBFBE0_801B7BB8; + D_801783D4 = D_EBFBE0_801B7BBC; + + if (D_801783D0 < 950.0f) { + if (D_801783D0 > -900.0f) { + D_80178340 += 8; + if (D_80178340 > 60) { + D_80178340 = 60; + } + D_80178348 = 208; + D_80178350 = 208; + D_80178354 = 208; + } + } + + if (D_80178340 > 0) { + func_800B8DD0(&gMasterDisp, 0x3E); + + gDPSetAlphaDither(gMasterDisp++, G_AD_NOISE); + gDPSetColorDither(gMasterDisp++, G_CD_NOISE); + + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, D_801783D0, D_801783D4, -200.0f, 1); + + for (i = 0; i < 4; i++) { + Matrix_Push(&gGfxMatrix); + Matrix_Scale(gGfxMatrix, D_EBFBE0_801AE4EC[i] * 0.5f, D_EBFBE0_801AE4EC[i] * 0.5f, + D_EBFBE0_801AE4EC[i] * 0.5f, 1); + Matrix_SetGfxMtx(&gMasterDisp); + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, D_EBFBE0_801AE51C[i], D_EBFBE0_801AE528[i]); + gSPDisplayList(gMasterDisp++, D_EBFBE0_801AE48C[i]); + + Matrix_Pop(&gGfxMatrix); + } + Matrix_Pop(&gGfxMatrix); + } +} + +// needs in-function static +#ifdef IMPORT_DATA_PENDING +void func_EBFBE0_801903B8(void) { + static s32 D_EBFBE0_801AE558 = 12; + f32 temp_fs3; + f32 temp_fs4; + f32 var_fs1; + f32 temp; + s32 i; + + func_800B8DD0(&gMasterDisp, 0x3E); + + gDPSetAlphaDither(gMasterDisp++, G_AD_NOISE); + gDPSetColorDither(gMasterDisp++, G_CD_NOISE); + + if (D_80178340 > 0) { + temp_fs3 = D_801783D0 * -0.03f; + temp_fs4 = D_801783D4 * 0.03f; + + var_fs1 = 1.0f; + if (D_80178340 < 10) { + var_fs1 = D_80178340 / 10.0f; + } + + var_fs1 *= 0.5f; + + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, D_801783D0, D_801783D4, -200.0f, 1); + + for (i = 4; i < 12; i++) { + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, D_EBFBE0_801AE4BC[i] * temp_fs3, -D_EBFBE0_801AE4BC[i] * temp_fs4, 0.0f, 1); + Matrix_Scale(gGfxMatrix, D_EBFBE0_801AE4EC[i] * 0.5f, D_EBFBE0_801AE4EC[i] * 0.5f, + D_EBFBE0_801AE4EC[i] * 0.5f, 1); + + Matrix_SetGfxMtx(&gMasterDisp); + + temp = (f32) D_EBFBE0_801AE528[i] * var_fs1; + + if (i != 10) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, D_EBFBE0_801AE51C[i], (s32) temp); + } else { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, D_EBFBE0_801AE51C[i], D_EBFBE0_801AE558); + } + gSPDisplayList(gMasterDisp++, D_EBFBE0_801AE48C[i]); + Matrix_Pop(&gGfxMatrix); + } + Matrix_Pop(&gGfxMatrix); + } +} +#else +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_801903B8.s") +#endif + +void func_EBFBE0_801906A0(void) { + s32 i; + + switch (D_EBFBE0_801B7BD4) { + case 0: + func_800B8DD0(&gMasterDisp, 0x55); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, (s32) D_EBFBE0_801B7BDC); + func_8009C320(&gMasterDisp, D_6014140, D_60147C0, 256, 13, 90.0f, 110.0f, 1.0f, 1.0f); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, (s32) D_EBFBE0_801B7BE0); + func_8009C320(&gMasterDisp, D_60147E0, D_60148B0, 32, 13, 150.0f, 110.0f, 1.0f, 1.0f); + break; + + case 1: + func_800B8DD0(&gMasterDisp, 0x53); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, (s32) D_EBFBE0_801B7BDC); + + for (i = 0; i < 5; i++) { + func_8009D418(&gMasterDisp, D_6006EA0 + (2048 * i), 128, 16, D_EBFBE0_801B9070, + D_EBFBE0_801B9074 + (16 * i * D_EBFBE0_801B907C), D_EBFBE0_801B9078, D_EBFBE0_801B907C); + } + func_8009D418(&gMasterDisp, D_600BEA0, 128, 8, D_EBFBE0_801B9070, + (80.0f * D_EBFBE0_801B907C) + D_EBFBE0_801B9074, D_EBFBE0_801B9078, D_EBFBE0_801B907C); + + case -1: + break; + } +} + +void func_EBFBE0_80190950(void) { + Lights_SetOneLight(&gMasterDisp, D_EBFBE0_801B82E0, D_EBFBE0_801B82E4, D_EBFBE0_801B82E8, 0, 0, 0, D_80178554, + D_80178558, D_8017855C); + func_800B8DD0(&gMasterDisp, 0x17); + + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, 0.0f, D_EBFBE0_801B9048, D_EBFBE0_801B904C, 1); + Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 0.4f, 1); + Matrix_SetGfxMtx(&gMasterDisp); + + gSPDisplayList(gMasterDisp++, D_6018D40); + + if (D_EBFBE0_801B7BE4 != 0) { + func_EBFBE0_80190A98(); + } + + Matrix_Pop(&gGfxMatrix); +} + +void func_EBFBE0_80190A98(void) { + Matrix_Translate(gGfxMatrix, 401.0f, -249.0f, -22.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, 1); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, D_602A720); +} + +void func_EBFBE0_80190B30(s32 arg0) { + Lights_SetOneLight(&gMasterDisp, D_EBFBE0_801B82E0, D_EBFBE0_801B82E4, D_EBFBE0_801B82E8, D_80178548, D_8017854C, + D_80178550, D_80178554, D_80178558, D_8017855C); + func_800B8DD0(&gMasterDisp, 0x17); + + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, D_EBFBE0_801B84E8[arg0].unk_00.x, -12.8f, D_EBFBE0_801B9044, 1); + Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, 1); + Matrix_SetGfxMtx(&gMasterDisp); + + gSPDisplayList(gMasterDisp++, D_601C7C0); + + Matrix_Pop(&gGfxMatrix); +} + +#ifdef IMPORT_DATA_PENDING +void func_EBFBE0_80190C9C(void) { + s32 i; + static f32 D_EBFBE0_801AE55C = 89.0f; + static f32 D_EBFBE0_801AE560 = 17.0f; + static f32 D_EBFBE0_801AE564 = 101.0f; + static f32 D_EBFBE0_801AE568 = 197.0f; + + switch (D_EBFBE0_801B7BF0) { + case 0: + break; + + case 1: + func_800B8DD0(&gMasterDisp, 0x53); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + func_8009D994(&gMasterDisp, D_600E980, 144, 28, D_EBFBE0_801AE55C, D_EBFBE0_801AE560, 1.0f, 1.0f); + break; + + case 2: + func_800B8DD0(&gMasterDisp, 0x53); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + + for (i = 0; i < 4; i++) { + func_8009D994(&gMasterDisp, D_6011890 + (672 * i), 112, 6, D_EBFBE0_801AE564, + D_EBFBE0_801AE568 + (6.0f * i), 1.0f, 1.0f); + } + func_8009D994(&gMasterDisp, D_6012310, 112, 2, D_EBFBE0_801AE564, D_EBFBE0_801AE568 + (6.0f * 4), 1.0f, + 1.0f); + } +} +#else +#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_EBFBE0/fox_title/func_EBFBE0_80190C9C.s") +#endif + +void func_EBFBE0_80190E64(void) { + if (D_EBFBE0_801B82C4 == 0) { + func_EBFBE0_80190FD0(); + } else { + func_EBFBE0_80190EA4(); + } +} + +void func_EBFBE0_80190EA4(void) { + switch (D_EBFBE0_801B8280) { + case 0: + if (gChangedInput[D_80177AF8].button & 0xD00F) { // START, A, B, C-left, C-Down, C-Up, C-Right + func_80019218(0x49000003, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + D_EBFBE0_801B8284 = 0; + D_EBFBE0_801B8280 = 1; + gStopInputTimer = 0x1E; + } + break; + + case 1: + if (D_EBFBE0_801B8284 < 120) { + D_EBFBE0_801B8284 += 18; + } else { + func_8001DC6C(0, 0x17); + D_80178410 = 0; + D_8017829C = 0; + D_EBFBE0_801B82C0 = 0; + D_80177898 = 0; + D_EBFBE0_801B82C4 = 0; + gStopInputTimer = 30; + D_EBFBE0_801B8284 = 0; + D_EBFBE0_801B8280 = 0; + } + break; + } +} + +void func_EBFBE0_80190FD0(void) { + if (gStopInputTimer == 0) { + switch (D_EBFBE0_801B8280) { + case 0: + if (((gChangedInput[D_80177AF8].button & START_BUTTON) || + (gChangedInput[D_80177AF8].button & A_BUTTON)) && + (D_EBFBE0_801B8280 == 0)) { + func_80019218(0x49000003, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_800182F4(0x101E00FF); + func_800182F4(0x111E00FF); + D_EBFBE0_801B8284 = 0; + D_EBFBE0_801B8280 = 1; + } + break; + + case 1: + if (D_EBFBE0_801B8284 < 120) { + D_EBFBE0_801B8284 += 18; + } else { + D_80177834 = 3; + D_8017783C = 2; + D_8017784C = 0; + D_80177898 = 0; + D_80178410 = 0; + D_EBFBE0_801B8280 = 0; + D_EBFBE0_801B8284 = 0; + gStopInputTimer = 3; + } + break; + } + } +} + +void func_EBFBE0_8019111C(void) { + f32 x; + f32 y; + + if ((D_EBFBE0_801B82B0 == 0) && (D_EBFBE0_801B9040 == 0) && + ((gChangedInput[D_80177AF8].stick_x != 0) || (gChangedInput[D_80177AF8].stick_y != 0))) { + D_EBFBE0_801B9040 = 1; + D_EBFBE0_801B86A4 = 0; + } + + x = gChangedInput[D_80177AF8].stick_x; + y = gChangedInput[D_80177AF8].stick_y; + + if (D_EBFBE0_801B9040 != 0) { + if (((x * 0.2f) + D_EBFBE0_801B905C > -500.0f) && ((x * 0.2f) + D_EBFBE0_801B905C < 500.0f)) { + D_EBFBE0_801B905C += x * 0.2f; + } + if (((y * 0.2f) + D_EBFBE0_801B9060 > -500.0f) && ((y * 0.2f) + D_EBFBE0_801B9060 < 500.0f)) { + D_EBFBE0_801B9060 += y * 0.2f; + } + } + + if ((D_EBFBE0_801B9040 != 0) && (gChangedInput[D_80177AF8].stick_x == 0) && + (gChangedInput[D_80177AF8].stick_y == 0)) { + D_EBFBE0_801B86A4++; + } else { + D_EBFBE0_801B86A4 = 0; + } +} + +void func_EBFBE0_801912A0(void) { + switch (D_EBFBE0_801B869C) { + case 0: + D_80178340 -= 4; + if (D_80178340 < 0) { + D_80178340 = 0; + D_EBFBE0_801B869C = 255; + } + break; + + case 1: + D_80178340 += 15; + if (D_80178340 > 255) { + D_80178340 = 255; + D_EBFBE0_801B869C = 255; + } + break; + } +} + +void func_EBFBE0_80191320(s32 arg0, f32* arg1, f32* arg2, f32* arg3, f32* arg4, f32* arg5, f32* arg6, f32 arg7, + f32 arg8, f32 arg9) { + Vec3f sp54; + Vec3f sp48; + f32* sp44; + f32* sp40; + f32* sp3C; + f32* var_t0; + f32* var_v0; + f32* var_v1; + + if (arg0 != 0) { + var_v0 = arg4; + var_v1 = arg5; + var_t0 = arg6; + sp44 = arg1; + sp40 = arg2; + sp3C = arg3; + } else { + var_v0 = arg1; + var_v1 = arg2; + var_t0 = arg3; + arg9 = -arg9; + sp44 = arg4; + sp40 = arg5; + sp3C = arg6; + } + + sp48.x = 0.0f; + sp48.y = 0.0f; + sp48.z = arg9; + + Matrix_Translate(gCalcMatrix, *var_v0, *var_v1, *var_t0, 0); + Matrix_RotateY(gCalcMatrix, M_DTOR * arg8, 1); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg7, 1); + Matrix_MultVec3f(gCalcMatrix, &sp48, &sp54); + + *sp44 = sp54.x; + *sp40 = sp54.y; + *sp3C = sp54.z; + + sp48.x = 0.0f; + sp48.y = 1.0f; + sp48.z = 0.0f; + + Matrix_RotateY(gCalcMatrix, M_DTOR * arg8, 0); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg7, 1); + Matrix_MultVec3f(gCalcMatrix, &sp48, &sp54); + + D_EBFBE0_801B829C = sp54.x; + D_EBFBE0_801B82A0 = sp54.y; + D_EBFBE0_801B82A4 = sp54.z; +} + +void func_EBFBE0_801914AC(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* arg5, f32 arg6, f32* arg7, f32* arg8, + f32* arg9, f32 argA, f32 argB, f32 argC) { + Vec3f sp44; + Vec3f sp38; + + sp38.x = 0.0f; + sp38.y = 0.0f; + sp38.z = argA; + + Matrix_Translate(gCalcMatrix, arg0, arg1, arg2, 0); + + Matrix_RotateY(gCalcMatrix, M_DTOR * argC, 1); + Matrix_RotateX(gCalcMatrix, M_DTOR * argB, 1); + + Matrix_MultVec3f(gCalcMatrix, &sp38, &sp44); + + *arg7 = sp44.x; + *arg8 = sp44.y; + *arg9 = sp44.z; + + sp38.x = 0.0f; + sp38.y = 0.0f; + sp38.z = arg6; + + Matrix_Translate(gCalcMatrix, arg0, arg1, arg2, 0); + Matrix_RotateY(gCalcMatrix, M_DTOR * argC, 1); + Matrix_RotateX(gCalcMatrix, M_DTOR * argB, 1); + Matrix_MultVec3f(gCalcMatrix, &sp38, &sp44); + + *arg3 = sp44.x; + *arg4 = sp44.y; + *arg5 = sp44.z; + + sp38.x = 0.0f; + sp38.y = 1.0f; + sp38.z = 0.0f; + + Matrix_RotateY(gCalcMatrix, M_DTOR * argC, 0); + Matrix_RotateX(gCalcMatrix, M_DTOR * argB, 1); + Matrix_MultVec3f(gCalcMatrix, &sp38, &sp44); + + D_EBFBE0_801B829C = sp44.x; + D_EBFBE0_801B82A0 = sp44.y; + D_EBFBE0_801B82A4 = sp44.z; +} + +void func_EBFBE0_80191674(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* arg5) { + f32 sp34; + f32 sp30; + Vec3f sp24; + Vec3f sp18; + + sp18.x = 0.0f; + sp18.y = 0.0f; + sp18.z = arg2; + + func_EBFBE0_80191798(&sp34, &sp30); + + Matrix_RotateX(gCalcMatrix, M_DTOR * -sp34, 0); + Matrix_RotateY(gCalcMatrix, M_DTOR * -sp30, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * arg1, 1); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg0, 1); + + Matrix_MultVec3f(gCalcMatrix, &sp18, &sp24); + + *arg3 = sp24.x; + *arg4 = sp24.y; + *arg5 = sp24.z; +} + +void func_EBFBE0_80191798(f32* arg0, f32* arg1) { + f32 temp_fv1 = D_80177978 - D_801779A0; + f32 temp_fv2 = D_80177980 - D_801779B8; + f32 temp_ft4 = D_80177988 - D_801779C0; + + *arg0 = -Math_Atan2F(temp_fv2, sqrtf(SQ(temp_fv1) + SQ(temp_ft4))) * (180.0f / M_PI); + *arg1 = Math_Atan2F(temp_fv1, temp_ft4) * (180.0f / M_PI); +} + +void func_EBFBE0_80191844(f32 arg0, f32 arg1) { + Vec3f sp24; + Vec3f sp18; + + sp18.x = 0.0f; + sp18.y = 1.0f; + sp18.z = 0.0f; + + Matrix_RotateY(gCalcMatrix, M_DTOR * arg1, 0); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg0, 1); + + Matrix_MultVec3f(gCalcMatrix, &sp18, &sp24); + + D_EBFBE0_801B829C = sp24.x; + D_EBFBE0_801B82A0 = sp24.y; + D_EBFBE0_801B82A4 = sp24.z; +} + +void func_EBFBE0_801918FC(void) { + Matrix_Push(&gGfxMatrix); + Matrix_LookAt(gGfxMatrix, D_80177978, D_80177980, D_80177988, D_801779A0, D_801779B8, D_801779C0, D_EBFBE0_801B829C, + D_EBFBE0_801B82A0, D_EBFBE0_801B82A4, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, 1); + Matrix_SetGfxMtx(&gMasterDisp); +} + +void func_EBFBE0_801919C4(u16** arg0, s32 arg1) { + D_80178720 = arg0; + D_80178724 = 0; + D_80178308 = arg0[D_80178724]; + D_80177D68 = arg1; + D_8017829C = 100; + + switch (D_80177834) { + case 2: + D_8017872C = 176; + D_80178728 = 85; + D_80178730 = 80.0f; + D_80178734 = 174.0f; + D_80178738 = 4.63f; + D_8017873C = 32.0f; + D_80178740 = 174.0f; + break; + + case 7: + D_8017872C = 179; + D_80178728 = 79; + D_80178730 = 74.0f; + D_80178734 = 178.0f; + D_80178738 = 4.53f; + D_8017873C = 26.0f; + D_80178740 = 178.0f; + } + + func_8001ACDC(func_800C2890(D_80178308)); +} diff --git a/src/overlays/ovl_EBFBE0/fox_title.h b/src/overlays/ovl_EBFBE0/fox_title.h new file mode 100644 index 00000000..b3eb0722 --- /dev/null +++ b/src/overlays/ovl_EBFBE0/fox_title.h @@ -0,0 +1,117 @@ +#ifndef FOX_TITLE_H +#define FOX_TITLE_H + +#include "global.h" + +typedef struct UnkStruct_D_801B8350 { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ char pad14[0x44]; + /* 0x58 */ s32 unk_58; + /* 0x5C */ s32 unk_5C; +} UnkStruct_D_801B8350; // size = 0x60 + +typedef struct { + /* 0x00 */ Vec3f unk_00; + /* 0x04 */ char pad04[0x50]; +} UnkStruct_D_EBFBE0_801B84E8; // size = 0x5C + +typedef struct { + /* 0x00 */ Vec3f pos; + /* 0x0C */ char pad0C[0x4]; + /* 0x10 */ f32 angleX; + /* 0x14 */ f32 angleY; + /* 0x18 */ f32 angleZ; + /* 0x1C */ f32 scale; + /* 0x20 */ char pad20[0x4]; + /* 0x24 */ Vec3f unk_24; +} UnkStruct_D_EBFBE0_801B8658; // size = 0x30 + +typedef struct { + /* 0x00 */ Vec3f pos; + /* 0x0C */ s32 unk_0C; + /* 0x10 */ f32 scale; +} UnkStruct_D_EBFBE0_801B8688; // size = 0x14 + +extern Gfx* D_EBFBE0_801AE48C[]; +extern f32 D_EBFBE0_801AE4BC[]; +extern f32 D_EBFBE0_801AE4EC[]; +extern u8 D_EBFBE0_801AE51C[]; +extern s32 D_EBFBE0_801AE528[]; +extern f32 D_EBFBE0_801B7BB0; +extern f32 D_EBFBE0_801B7BB4; +extern f32 D_EBFBE0_801B7BB8; +extern f32 D_EBFBE0_801B7BBC; +extern f32 D_EBFBE0_801B7BC0; +extern f32 D_EBFBE0_801B7BC4; +extern s32 D_EBFBE0_801B7BD0; +extern s32 D_EBFBE0_801B7BD4; +extern s32 D_EBFBE0_801B7BD8; +extern f32 D_EBFBE0_801B7BDC; +extern f32 D_EBFBE0_801B7BE0; +extern s32 D_EBFBE0_801B7BE4; +extern s32 D_EBFBE0_801B7BF0; +extern f32 D_EBFBE0_801B7BF8[]; +extern f32 D_EBFBE0_801B7C20[]; +extern f32 D_EBFBE0_801B7C48[]; +extern f32 D_EBFBE0_801B7C70[]; +extern s32 D_EBFBE0_801B7C98; +extern s32 D_EBFBE0_801B7CA0[]; +extern s32 D_EBFBE0_801B7CC8[]; +extern s32 D_EBFBE0_801B7CF0[]; +extern s32 D_EBFBE0_801B7D18[]; +extern f32 D_EBFBE0_801B829C; +extern f32 D_EBFBE0_801B82A0; +extern f32 D_EBFBE0_801B82A4; +extern s32 D_EBFBE0_801B82B0; +extern f32 D_EBFBE0_801B82C8; +extern f32 D_EBFBE0_801B8328; +extern f32 D_EBFBE0_801B832C; +extern f32 D_EBFBE0_801B8330; +extern s32 D_EBFBE0_801B8334; +extern s32 D_EBFBE0_801B8338; +extern s32 D_EBFBE0_801B8340; +extern UnkStruct_D_801B8350 D_EBFBE0_801B8350[]; +extern f32 D_EBFBE0_801B84D0; +extern f32 D_EBFBE0_801B84D4; +extern UnkStruct_D_EBFBE0_801B84E8 D_EBFBE0_801B84E8[]; +extern UnkStruct_D_EBFBE0_801B8658 D_EBFBE0_801B8658; +extern UnkStruct_D_EBFBE0_801B8688 D_EBFBE0_801B8688; +extern s32 D_EBFBE0_801B8694; +extern s32 D_EBFBE0_801B869C; +extern f32 D_EBFBE0_801B86A8; +extern f32 D_EBFBE0_801B86AC; +extern f32 D_EBFBE0_801B86B4; +extern f32 D_EBFBE0_801B86B8; +extern f32 D_EBFBE0_801B86BC; +extern f32 D_EBFBE0_801B86C0; +extern f32 D_EBFBE0_801B86C4; +extern f32 D_EBFBE0_801B9044; +extern f32 D_EBFBE0_801B9048; +extern f32 D_EBFBE0_801B904C; +extern f32 D_EBFBE0_801B9054; +extern f32 D_EBFBE0_801B9058; +extern f32 D_EBFBE0_801B9068; +extern f32 D_EBFBE0_801B906C; +extern f32 D_EBFBE0_801B9070; +extern f32 D_EBFBE0_801B9074; +extern f32 D_EBFBE0_801B9078; +extern f32 D_EBFBE0_801B907C; +extern f32 D_EBFBE0_801B9080; +extern f32 D_EBFBE0_801B9084; + +void func_EBFBE0_8018DF0C(f32 arg0); +void func_EBFBE0_8018E058(void); +void func_EBFBE0_8018E200(void); +void func_EBFBE0_80190A98(void); +void func_EBFBE0_80190EA4(void); +void func_EBFBE0_80190FD0(void); +void func_EBFBE0_80190144(void); +void func_EBFBE0_801903B8(void); +void func_EBFBE0_801914AC(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* arg5, f32 arg6, f32* arg7, f32* arg8, + f32* arg9, f32 argA, f32 argB, f32 argC); +void func_EBFBE0_80191798(f32* arg0, f32* arg1); +void func_EBFBE0_801918FC(void); + +#endif diff --git a/yamls/us/overlays.yaml b/yamls/us/overlays.yaml index 2f43ddec..900718ab 100644 --- a/yamls/us/overlays.yaml +++ b/yamls/us/overlays.yaml @@ -159,14 +159,14 @@ symbol_name_format: EBFBE0_$VRAM subsegments: - [0xEBFBE0, c, EBFBE0] - - [0xEBFCA0, c, EBFCA0] + - [0xEBFCA0, c, fox_title] - [0xECA1E0, c, fox_option] - [0xED6EC0, c, ED6EC0] - - [0xEE60C0, data, EBFCA0] + - [0xEE60C0, data, fox_title] - [0xEE6C30, data, fox_option] - [0xEE7AE0, data, ED6EC0] - [0xEEF410, .rodata, EBFBE0] - - [0xEEF430, .rodata, EBFCA0] + - [0xEEF430, .rodata, fox_title] - [0xEEF7D0, .rodata, fox_option] - [0xEEFB80, .rodata, ED6EC0] - { start: 0xEF0260, type: bss, vram: 0x801B7BA0, name: ovl_EBFBE0 }