From ca9899deed3fa2521f5628835c1fd85c20fed39f Mon Sep 17 00:00:00 2001 From: petrie911 <69443847+petrie911@users.noreply.github.com> Date: Sat, 18 Nov 2023 09:44:33 -0600 Subject: [PATCH] sf_61B30 decomped (#25) * my god it's done * save for later --- diff.py | 1 + include/functions.h | 157 +- include/structs.h | 128 +- include/variables.h | 48 +- linker_scripts/us/symbol_addrs_overlays.txt | 98 +- src/main/sf_61B30.c | 2010 ++++++++++++++++++- src/main/sf_A24B0.c | 10 +- src/main/sf_hud.c | 2 +- src/overlays/ovl_DF4260/DFEE30.c | 6 +- 9 files changed, 2294 insertions(+), 166 deletions(-) create mode 120000 diff.py diff --git a/diff.py b/diff.py new file mode 120000 index 00000000..9f7d52b4 --- /dev/null +++ b/diff.py @@ -0,0 +1 @@ +tools/asm-differ/diff.py \ No newline at end of file diff --git a/include/functions.h b/include/functions.h index 819bb9d8..81334769 100644 --- a/include/functions.h +++ b/include/functions.h @@ -14,6 +14,8 @@ void func_800032B4(Gfx** dList); void func_800033E0(void* var_s2, void* var_s1, s32 var_s0); void func_800034E8(u8 arg0); +void func_8000372C(Gfx** dList, s32 dirX, s32 dirY, s32 dirZ, s32 colR, s32 colG, s32 colB, s32 ambR, s32 ambG, s32 ambB); + f32 Math_ModF(f32 value, f32 mod); void Rand_Init(void); f32 Rand_ZeroOne(void); @@ -61,10 +63,10 @@ void Fault_ThreadEntry(void*); void func_80007FE4(FrameBuffer*, u16, u16); void Fault_Init(void); - void func_80016A50(void); void func_800182F4(s32); void func_80019218(u32, f32*, u8, f32*, f32*, s8*); +void func_8001A500(f32*); // might be Vec3f* void func_8001A838(u32 arg0); void func_8001ACDC(s32); void func_8001AE58(void); @@ -79,12 +81,6 @@ void func_8001DCE0(void); void func_8001DECC(void); SPTask* func_8001DF50(void); -void RdRam_CheckIPL3(void); - -void Mio0_Decompress(void* header, u8* dst); - -s32 vsprintf(char* dst, char* fmt, va_list args); - f32 func_8001FE60(f32); f64 func_8001FE6C(f64); s32 func_8001FE78(f32); @@ -113,6 +109,11 @@ f32 func_8001FB58(f32); f32 func_8001FB88(f32); f32 func_8001FBA8(f32); f32 func_8001FBC8(f32); + +void RdRam_CheckIPL3(void); +void Mio0_Decompress(void* header, u8* dst); +s32 vsprintf(char* dst, char* fmt, va_list args); + f32 Math_FAtanF(f32); f32 Math_FAtan2F(f32, f32); f32 Math_FAsinF(f32); @@ -132,7 +133,8 @@ void func_8002E3E0(Object_2F4 *arg0); void func_8002E548(void); void func_8003DAF0(void); void func_80040CDC(void); - +void func_80042FAC(Object_408 *); +void func_80042FD0(Object_408 *); u8 func_80058F14(u8 arg0, u8 arg1); void func_80059498(void); void func_8005980C(f32 arg0); @@ -142,12 +144,72 @@ void func_80060FBC(Object*, f32*); void func_800612B8(ObjectStruct_1C*, u32); void func_800613C4(Object_2F4*); void func_80061474(Object_8C* arg0); +void func_80061B68(void); +void func_80061CD0(void); +void func_80061E48(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3); +void func_80061F0C(Object_2F4* arg0, ObjectInit* arg1, s32 arg2); +void func_80062180(ObjectInit* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4); +s32 func_800631A8(Vec3f*, f32*, Vec3f*); +s32 func_8006326C(Vec3f* arg0, s32 arg1, s32 arg2, Object* arg3); +void func_800652CC(Object_80*); +void func_800654E4(Object *); +void func_800656D4(Object_2F4*); void func_800660F0(Object_2F4*); +void func_80066254(Object_2F4*); +void func_8006654C(Object_2F4*); +void func_8006684C(Object_2F4*); +void func_800669A0(Object_2F4*); +void func_80066A80(Object_2F4*); +void func_80066C00(Object_80*); +void func_80066EF0(Object_6C *); /* extern */ +void func_800671D0(Object_6C *); +void func_800674B4(f32, f32, f32, f32, f32, f32, f32, f32); +void func_8006753C(Object_2F4*); +void func_80067874(Object_2F4*); +void func_80067B1C(Object_6C*); +void func_80067BEC(Object_6C*); +void func_80067F6C(Object_6C*); +void func_80068020(Object_6C*); +void func_800685D8(Object_6C*); +void func_800685F8(Object_6C*); +void func_80068618(Object_6C*); +void func_80068688(Object_6C*); +void func_80068914(Object_6C*); +void func_80068C48(Object_6C*); +void func_80068C88(Object_6C*); +void func_80068FE0(Object_4C*); +void func_800690D0(s32, s32); +void func_80069924(Object_8C *); +void func_800693E8(Object_2F4 *); +void func_80069658(Object_408 *); +void func_800696F8(Object_80 *); +void func_80069858(Object_4C *); +void func_80069A10(Object_6C *); +void func_80069AAC(Object_2F4*); +void func_80069CBC(Object_408 *); +void func_80069DF4(Object_80 *); +void func_80069E88(Object_4C *); +void func_80069F30(Object_6C *); +void func_80069FD4(Object_8C *); +void func_8006A06C(UnkStruct_D_80174750*); +void func_8006A38C(void); +void func_8006B0A0(Object_2F4 *, s32); void func_8006EEFC(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); + +void func_800763A4(Object_2F4 *, s32); +void func_8007717C(Object_2F4 *, s32); void func_80077240(f32, f32, f32, s32); +void func_80078E50(f32, f32, f32, f32); +void func_800794CC(f32, f32, f32, f32); +void func_8007A6F0(Vec3f *, u32); +void func_8007BFFC(f32, f32, f32, f32, f32, f32, f32, s32); void func_8007C120(f32, f32, f32, f32, f32, f32, f32, s32); +void func_8007D074(f32, f32, f32, f32); +void func_8007D0E0(f32, f32, f32, f32); void func_8007D10C(f32, f32, f32, f32); +void func_8007D2C8(f32, f32, f32, f32); +void func_8007F04C(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32); // Object_Spawn? void func_80084370(s32); void func_800843FC(s32); @@ -177,15 +239,18 @@ void func_8008FA84(void); void func_8008FFF0(Object_408* arg0, s32); s32 func_8009092C(Object_2F4*); s32 func_800915FC(Object_2F4*); +void func_80092D48(Object_2F4 *); void func_80094D20(f32, f32); -void func_8009F574(Gfx **, s32, s32, s32, s32, u8, u8, u8, u8); +s32 func_800998FC(Vec3f*, Vec3f*, s32, s32, Vec3f*, Vec3f*); +s16 func_8009ACDC(s16 *); f32 func_8009BC2C(f32*, f32, f32, f32, f32); f32 func_8009BD38(f32*, f32, f32, f32, f32); void func_8009D418(Gfx**, u16*, u32, u32, f32, f32, f32, f32); void func_8009D994(Gfx**, u16*, u32, u32, f32, f32, f32, f32); +void func_8009F574(Gfx **, s32, s32, s32, s32, u8, u8, u8, u8); void func_8009F6CC(Vec3f*, f32, f32, f32); -void func_8009FC0C(s32, s32, s32); f32 func_8009F768(f32); +void func_8009FC0C(s32, s32, s32); void func_8009FEA0(s32, s32, s32); void func_800A1200(s32, s32, f32, f32, char*); void func_800A18B0(void); @@ -199,11 +264,13 @@ void func_800A24DC(s32); void func_800A26C0(void); void func_800A25DC(void); Object_2F4 *func_800A3608(s32 arg0); +s32 func_800A3690(Vec3f*, Vec3f*, s32, Vec3f*); void func_800A3CA0(void); s32 func_800A3F50(s32); void func_800A5844(void); void func_800A5D6C(void); void func_800A6148(void); +void func_800A6CD0(UnkStruct_D_80178280 *, s32, s32); void func_800B86CC(void); void func_800B8DD0(Gfx**, s16); void func_800BA490(void); @@ -220,14 +287,64 @@ void func_800C2190(void); u16 func_800C2890(u16*); s32 func_800C2F30(u16*, s32); s32 func_800C3084(void); -s32 func_800C3194(void); +s32 func_800C3194(void); void func_EFFA40_80187520(s32, void*); -void func_EF0260_8018A96C(void); -void func_EF0260_8018AAC4(void); -void func_DF4260_801988E0(void); -void func_EBFBE0_8019E8D0(void); +void func_DF4260_801878D8(Object_408 *); +void func_DF4260_801988E0(void); +void func_DF4260_8018B0B4(Object_2F4 *); +void func_DF4260_8018BE7C(Object_408 *); +void func_DF4260_8019250C(Object_2F4 *); +void func_DF4260_80192CB0(Object_2F4 *); +void func_DF4260_80192EA4(Object_2F4 *); +void func_DF4260_801933B4(Object_2F4 *); +void func_DF4260_801935CC(Object_408 *); + +void func_E08400_80188A40(Object_408 *); + +void func_E16C50_80187754(Object_408 *); +void func_E16C50_801932AC(Object_408 *); +void func_E16C50_8019B1F0(Object_2F4 *); +void func_E16C50_8019B810(Object_2F4 *); +void func_E16C50_8019C200(Object_2F4 *); +void func_E16C50_8019D060(Object_2F4 *); +void func_E16C50_801AD688(Object_2F4 *); +void func_E16C50_801AE3AC(Object_2F4 *); +void func_E16C50_801AF9FC(Object_2F4 *); +void func_E16C50_801B10F8(Object_408 *); +void func_E16C50_801B6344(Object_2F4 *); +void func_E16C50_801B6E54(Object_2F4 *); +void func_E16C50_801B7AF0(Object_2F4 *); +void func_E16C50_801BA57C(Object_2F4 *); +void func_E16C50_801BB26C(Object_2F4 *); +void func_E16C50_801915A4(Object_2F4 *); +void func_E16C50_80191BB8(Object_2F4 *); + +void func_E51970_80193CA4(Object_408 *); + +void func_E6A810_80189B80(Object_2F4 *); +void func_E6A810_8018ADC4(Object_2F4 *); +void func_E6A810_8018B96C(Object_2F4 *); +void func_E6A810_8018BFB0(Object_2F4 *); +void func_E6A810_8018E3CC(Object_2F4 *); +void func_E6A810_8018E5E8(Object_2F4 *); +void func_E6A810_8018EFF0(Object_4C *); +void func_E6A810_8018F0D8(Object_80 *); +void func_E6A810_8018FA48(Object_408 *); +void func_E6A810_80199F8C(Object_2F4 *); +void func_E6A810_801A3E70(Object_2F4 *); +void func_E6A810_801A4660(Object_2F4 *); +void func_E6A810_801A4AF8(Object_2F4 *); +void func_E6A810_801A5E2C(Object_2F4 *); +void func_E6A810_801A6134(Object_2F4 *); +void func_E6A810_801A65E0(Object_80 *); +void func_E6A810_801A7D98(Object_2F4 *); +s32 func_E6A810_801B6AEC(f32, f32, f32); +void func_E6A810_801B6E20(f32, f32, f32 *, f32 *, f32 *); + +void func_E9F1D0_80197CC4(Object_408 *); +void func_E9F1D0_8018D16C(Object_408 *); void func_EBFBE0_801877F0(void); s32 func_EBFBE0_80187ABC(void); @@ -262,5 +379,15 @@ void func_EBFBE0_801918FC(void); void func_EBFBE0_8018D2B8(s32); void func_EBFBE0_8018EA78(s32); void func_EBFBE0_80191674(f32, f32, f32, f32*, f32*, f32*); +void func_EBFBE0_8019E8D0(void); +void func_EF0260_8018A96C(void); +void func_EF0260_8018AAC4(void); + +void func_E08400_80187B08(Object_2F4 *, s32); +void func_E9F1D0_801888F4(Object_2F4 *, s32); +void func_E6A810_8018B720(Object_2F4 *, s32); +void func_E51970_80198594(Object_408 *, s32); +void func_E6A810_801990DC(Object_408 *, s32); +void func_E6A810_8018E3B0(Object_2F4 *); #endif diff --git a/include/structs.h b/include/structs.h index 568ee682..b2793363 100644 --- a/include/structs.h +++ b/include/structs.h @@ -124,33 +124,50 @@ typedef struct UnkStruct_D_80178280 { /* 0x080 */ char pad80[0x2C]; /* 0x0AC */ f32 unk_0AC; /* 0x0B0 */ f32 unk_0B0; - /* 0x0B4 */ char padB4[0xC]; + /* 0x0B4 */ f32 unk_0B4; + /* 0x0B8 */ f32 unk_0B8; + /* 0x0BC */ f32 unk_0BC; /* 0x0C0 */ f32 unk_0C0; /* 0x0C4 */ f32 unk_0C4; /* 0x0C8 */ char padC8[8]; /* 0x0D0 */ f32 unk_0D0; - /* 0x0D4 */ char padD4[0x44]; + /* 0x0D4 */ char padD4[0x3C]; + /* 0x110 */ f32 unk_110; + /* 0x114 */ f32 unk_114; /* 0x118 */ f32 unk_118; - /* 0x11C */ char pad11C[0x1C]; + /* 0x11C */ char pad11C[8]; + /* 0x124 */ f32 unk_124; + /* 0x128 */ char pad128[0x10]; /* 0x138 */ f32 unk_138; /* 0x13C */ char pad13C[0x8C]; /* 0x1C8 */ s32 unk_1C8; /* 0x1CC */ s32 unk_1CC; /* 0x1D0 */ s32 unk_1D0; - /* 0x1D4 */ char pad1D4[0x3C]; + /* 0x1D4 */ char pad1D4[0x20]; + /* 0x1F4 */ s32 unk_1F4; + /* 0x1F8 */ char pad1F8[0x18]; /* 0x210 */ s32 unk_210; /* 0x214 */ char pad214[0x10]; /* 0x224 */ s32 unk_224; /* 0x228 */ s32 unk_228; - /* 0x22C */ char pad22C[0x38]; + /* 0x22C */ char pad22C[0xC]; + /* 0x238 */ s32 unk_238; + /* 0x23C */ char pad23C[0x28]; /* 0x264 */ s32 unk_264; /* 0x268 */ char pad268[0x4]; /* 0x26C */ s32 unk_26C; - /* 0x270 */ char pad270[0x44]; + /* 0x270 */ char pad270[0xC]; + /* 0x27C */ s32 unk_27C; + /* 0x280 */ char pad280[0x34]; /* 0x2B4 */ s32 unk_2B4; /* 0x2B8 */ char pad2B8[0x4]; /* 0x2BC */ f32 unk_2BC; - /* 0x2C0 */ char pad2C0[0x220]; + /* 0x2C0 */ char pad2C0[0x1A0]; + /* 0x460 */ f32 unk_460[1]; // might be Vec3f + /* 0x464 */ char pad464[0x38]; + /* 0x49C */ u8 unk_49C; + /* 0x49D */ u8 unk_49D; + /* 0x49E */ char pad49E[0x42]; } UnkStruct_D_80178280; // size = 0x4E0 Might be Player typedef struct { @@ -172,12 +189,14 @@ typedef struct { } Object; // size = 0x1C typedef struct { - /* 0x00 */ char unk0[0xC]; + /* 0x00 */ char unk0[0x8]; + /* 0x08 */ void (*unk_8)(Object*); /* 0x0C */ void* unk_C; /* 0x10 */ f32 unk_10; /* 0x14 */ char unk14[0x2]; /* 0x16 */ s16 unk_16; - /* 0x18 */ char unk18[0xC]; + /* 0x18 */ char unk18[0x8]; + /* 0x20 */ u8 unk_20; } ObjectStruct_1C; // size = 0x24 typedef struct { @@ -186,17 +205,42 @@ typedef struct { /* 0x40 */ char unk40[0x18]; } Object_58; // size = 0x58 +typedef struct { + /* 0x00 */ u8 unk_00; + /* 0x02 */ u16 unk_02; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ f32 unk_20; + /* 0x24 */ f32 unk_24; + /* 0x28 */ char pad28[8]; +} UnkStruct_D_80174750; + typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectStruct_1C unk_1C; - /* 0x40 */ char unk_40[0x40]; + /* 0x40 */ s32 unk_40; + /* 0x44 */ s32 unk_44; + /* 0x48 */ s32 unk_48; + /* 0x4C */ s32 unk_4C; + /* 0x50 */ char pad50[0x10]; + /* 0x60 */ f32 unk_60; + /* 0x64 */ f32 unk_64; + /* 0x68 */ char pad68[8]; + /* 0x70 */ f32 unk_70; + /* 0x74 */ char pad74[0xC]; } Object_80; // size = 0x80 typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectStruct_1C unk_1C; - /* 0x40 */ char pad40[5]; - /* 0x45 */ s8 unk_45; + /* 0x40 */ s32 unk_40; + /* 0x44 */ char pad44[1]; + /* 0x45 */ u8 unk_45; // could be short loaded as u8 /* 0x46 */ s8 unk_46; /* 0x47 */ char pad47[5]; } Object_4C; // size = 0x4C @@ -204,21 +248,31 @@ typedef struct { typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectStruct_1C unk_1C; - /* 0x40 */ char unk40[0x28]; + /* 0x40 */ s32 unk_40; + /* 0x44 */ s16 unk_44; + /* 0x46 */ u8 unk_46; + /* 0x48 */ u16 unk_48; + /* 0x4A */ u16 unk_4A; + /* 0x4C */ s8 unk_4C; + /* 0x4E */ s16 unk_4E; + /* 0x50 */ f32 unk_50; + /* 0x54 */ f32 unk_54; + /* 0x58 */ f32 unk_58; + /* 0x5C */ f32 unk_5C[3]; // could be Vec3f /* 0x68 */ f32 unk_68; } Object_6C; // size 0x6C typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectStruct_1C unk_1C; - /* 0x40 */ char pad40[0x4]; + /* 0x40 */ s32 unk_40; /* 0x44 */ s16 unk_44; /* 0x46 */ s16 unk_46; /* 0x48 */ s16 unk_48; /* 0x4A */ s16 unk_4A; /* 0x4C */ char pad4C[0x2]; /* 0x4E */ s16 unk_4E; - /* 0x50 */ s16 unk_50; + /* 0x50 */ u16 unk_50; /* 0x50 */ char pad50[0x2]; /* 0x54 */ f32 unk_54; /* 0x58 */ f32 unk_58; @@ -234,23 +288,41 @@ typedef struct { typedef struct { /* 0x000 */ Object obj; /* 0x01C */ ObjectStruct_1C unk_01C; - /* 0x040 */ char pad40[0xE]; + /* 0x040 */ s32 unk_40; + /* 0x044 */ char unk_44[0xA]; /* 0x04E */ s16 unk_04E; - /* 0x050 */ char pad50[0x12]; + /* 0x050 */ s16 unk_050; + /* 0x052 */ s16 unk_052; + /* 0x054 */ s16 unk_054; + /* 0x056 */ s16 unk_056; + /* 0x058 */ s16 unk_058; + /* 0x05A */ s16 unk_05A; + /* 0x05C */ s16 unk_05C; + /* 0x05E */ char pad5E[4]; /* 0x062 */ s8 unk_062; - /* 0x063 */ char pad63[0x79]; + /* 0x063 */ char pad63[9]; + /* 0x06C */ f32 unk_6C; + /* 0x070 */ f32 unk_70; + /* 0x074 */ f32 unk_74; + /* 0x078 */ char pad78[0xC]; + /* 0x084 */ f32 unk_84; + /* 0x088 */ char pad88[0x54]; /* 0x0DC */ f32 unk_0DC; /* 0x0E0 */ f32 unk_0E0; /* 0x0E4 */ char padE4[0x314]; /* 0x3F8 */ f32 unk_3F8; - /* 0x3FC */ char pad3FC[0xC]; + /* 0x3FC */ f32 unk_3FC; + /* 0x400 */ char pad400[8]; } Object_408; // size = 0x408 typedef struct { /* 0x000 */ Object obj; /* 0x01C */ ObjectStruct_1C unk_01C; /* 0x040 */ s32 unk_040; - /* 0x044 */ char pad044[0xC]; + /* 0x044 */ u8 unk_44; + /* 0x046 */ s16 unk_46; + /* 0x048 */ s16 unk_48; + /* 0x04A */ char pad4A[6]; /* 0x050 */ s32 unk_050; /* 0x054 */ s32 unk_054; /* 0x058 */ s32 unk_058; @@ -264,18 +336,22 @@ typedef struct { /* 0x078 */ s32 unk_078; /* 0x07C */ s32 unk_07C; /* 0x080 */ s32 unk_080; - /* 0x084 */ char pad84[0x30]; + /* 0x084 */ char pad84[8]; + /* 0x08C */ s32 unk_8C; + /* 0x090 */ char pad90[0x24]; /* 0x0B4 */ s16 unk_0B4; /* 0x0B6 */ s16 unk_0B6; /* 0x0B8 */ s16 unk_0B8; /* 0x0BA */ char pad0BA[0x2]; /* 0x0BC */ u16 unk_0BC; /* 0x0BC */ u16 unk_0BE; - /* 0x0C0 */ char padC0[2]; + /* 0x0C0 */ u16 unk_0C0; /* 0x0C2 */ u16 unk_0C2; - /* 0x0C4 */ char padC4[2]; + /* 0x0C4 */ u16 unk_0C4; /* 0x0C6 */ u16 unk_0C6; - /* 0x0C8 */ char pad0C8[0x6]; + /* 0x0C8 */ char padC8[1]; // could be u16 loaded as u8 + /* 0x0C9 */ u8 unk_0C9; + /* 0x0C9 */ u8 unk_0CA[4]; /* 0x0CE */ s16 unk_0CE; /* 0x0D0 */ s8 unk_0D0; /* 0x0D1 */ s16 unk_0D2; @@ -291,7 +367,7 @@ typedef struct { /* 0x0F8 */ f32 unk_0F8; // angle /* 0x0FC */ f32 unk_0FC; /* 0x100 */ f32 unk_100[3]; // may be Vec3f - /* 0x10C */ char pad10C[0x4]; + /* 0x10C */ f32 unk_10C; /* 0x110 */ f32 unk_110; /* 0x114 */ f32 unk_114; /* 0x118 */ f32 unk_118; @@ -314,7 +390,7 @@ typedef struct { /* 0x178 */ f32 unk_178; /* 0x17C */ f32 unk_17C; /* 0x180 */ f32 unk_180; - /* 0x184 */ char pad184[4]; + /* 0x184 */ f32 unk_184; /* 0x188 */ f32 unk_188; /* 0x18C */ char pad18C[0x150]; /* 0x2DC */ Vec3f unk_2DC; diff --git a/include/variables.h b/include/variables.h index a9f514fb..e6eed414 100644 --- a/include/variables.h +++ b/include/variables.h @@ -159,9 +159,14 @@ extern OverlayInit D_800CBA44[2]; // E6A810 extern OverlayInit D_800CBB74[1]; // DF4260 extern OverlayInit D_800CBC0C[1]; // E08400 extern OverlayInit D_800CBD3C[1]; // EFFA40 +extern f32 D_800CBF18[]; extern ObjectStruct_1C D_800CC124[400]; extern ObjectInit* D_800CFDA0[]; +extern s32 D_800CFDF4[]; extern f32 D_800CFE5C[]; +extern Vec3f D_800CFEC4[6]; +extern Vec3f D_800CFF0C[6]; +extern u32 D_800CFF54[9]; extern s32 D_800CFF90; extern f32 D_800D19AC[]; extern f32 D_800D19E0[]; @@ -195,7 +200,9 @@ extern s32 D_8015F930[3]; extern s32 D_8015F93C; extern s32 D_8015F940; extern f32 D_8015F944; +extern s32 D_80161670[4]; extern s32 D_80161680; +extern u8 D_80161684; extern s32 D_80161690; extern f32 D_801616BC; extern f32 D_801616C0; @@ -232,12 +239,18 @@ extern u8 D_80161A39; extern f32 D_80161A3C; extern f32 D_80161A40; extern f32 D_80161A44; +extern u8 D_80161A50; extern f32 D_80161A54; extern s32 D_80161A5C; extern u16 D_80161A62; +extern s32 D_80161A88; +extern s32 D_80161A8C; extern u8 D_80161A90[]; extern s32 D_80161A98; +extern s32 D_80161A9C; extern s16 D_80161AA0[]; +extern s32 D_80161AA8[]; +extern s32 D_80161AB8; extern Object_80 D_80161B00[50]; extern Object_4C D_80163400[40]; extern Object_2F4 D_80163FE0[60]; @@ -245,7 +258,7 @@ extern Object_408 D_8016F110[4]; extern Object_8C D_80170130[100]; extern Object_6C D_801737E0[20]; // extern size_70 D_80174050[16] -// extern size_30 D_80174750[100] +extern UnkStruct_D_80174750 D_80174750[100]; extern UnkStruct_D_80175A10 D_80175A10[64]; extern UnkStruct_D_80175A10 D_80176410; // extern size_1C D_80176438[10] @@ -277,12 +290,12 @@ extern s32 D_8017789C; extern s32 D_801778A0; extern s32 D_801778A4; extern s32 D_801778A8; -extern u8 D_801778AB; extern s32 D_801778B0[]; -extern s32 D_801778B8; +extern s32 D_801778D0[]; extern s32 D_801778E8; extern u16 D_80177908[]; extern u16 D_80177928[]; +extern s8 D_80177930; extern u16 D_80177938[]; extern f32 D_80177940; extern u16 D_80177948[]; @@ -294,6 +307,7 @@ extern f32 D_80177988; extern f32 D_801779A0; extern f32 D_801779B8; extern f32 D_801779C0; +extern s32 D_801779C8[]; extern s32 D_801779F8; extern s32 D_80177A80; extern s8 D_80177A98; @@ -311,28 +325,36 @@ extern s32 D_80177C9C; extern s32 D_80177CA0; extern s32 D_80177CA4; extern s32 D_80177CAC; +extern f32 D_80177CB0; extern s32 D_80177CB4; extern s32 D_80177CBC; extern s32 D_80177CC4; extern f32 D_80177D08; +extern s32 D_80177D10[]; extern f32 D_80177D20; +extern s32 D_80177D28[]; +extern s32 D_80177D40[]; extern f32 D_80177D50; +extern s32 D_80177D58[]; extern f32 D_80177D68; extern s32 D_80177DA0[]; extern s32 D_80177DB0; extern s32 D_80177DC8; extern s32 D_80177E70; extern s32 D_80177E78; +extern s32 D_80177E80; extern Vec3f D_80177E88; extern Vec3f D_80177F10; extern s32 D_8017812C; extern s32 D_80178234; extern s32 D_8017827C; extern UnkStruct_D_80178280* D_80178280; +extern s32 D_80178284; extern s32 D_8017829C; extern s32 D_801782A4; extern Object_58 *D_801782A8; extern s32 D_801782B8; +extern f32 *D_801782C4; extern s32 D_801782D8; extern s32 D_801782E8; extern s32 D_801782F8; @@ -349,11 +371,19 @@ extern s32 D_80178380[]; extern s32 D_80178390[]; extern s32 D_801783A0[]; extern s32 D_801783B0[]; +extern s32 D_801783D8; extern s32 D_80178410; extern f32 D_80178420; extern f32 D_80178424; extern f32 D_80178428; extern f32 D_8017842C; +extern s32 D_80178480; +extern s32 D_80178488; +extern s32 D_801784A4; +extern s32 D_801784AC; +extern s32 D_801784DC; +extern s32 D_801784E0; +extern s32 D_801784E4; extern s32 D_80178548; extern s32 D_8017854C; extern s32 D_80178550; @@ -477,6 +507,7 @@ extern u16 D_1012988[]; extern u8 D_10129C0[]; extern u16 D_1013090[]; extern Gfx D_1015510[]; +extern Gfx D_10177C0[]; extern Gfx D_1023750[]; extern Gfx D_1024230[]; extern Gfx D_1024830[]; @@ -546,6 +577,17 @@ extern u8 D_500A6E0[]; extern u8 D_500A7D0[]; extern Gfx D_500B600[]; +extern f32 D_6006940[]; +extern f32 D_600695C[]; +extern f32 D_6006978[]; +extern f32 D_6006994[]; +extern f32 D_60069B0[]; +extern f32 D_60069CC[]; +extern f32 D_60069E8[]; +extern f32 D_6006A04[]; +extern f32 D_6006A20[]; +extern s16 D_6029528[]; + extern ObjectInit* D_6010088[]; extern ObjectInit* D_602B148[]; extern ObjectInit* D_602F18C[]; diff --git a/linker_scripts/us/symbol_addrs_overlays.txt b/linker_scripts/us/symbol_addrs_overlays.txt index 1834c0ee..0bb0d61c 100644 --- a/linker_scripts/us/symbol_addrs_overlays.txt +++ b/linker_scripts/us/symbol_addrs_overlays.txt @@ -1,30 +1,73 @@ +func_DF4260_8018ED78 = 0x8018ED78; +func_DF4260_8018EE84 = 0x8018EE84; +func_DF4260_8018B0B4 = 0x8018B0B4; +func_DF4260_801878D8 = 0x801878D8; +func_DF4260_8018BE7C = 0x8018BE7C; +func_DF4260_8019250C = 0x8019250C; +func_DF4260_80192CB0 = 0x80192CB0; +func_DF4260_80192EA4 = 0x80192EA4; +func_DF4260_801933B4 = 0x801933B4; +func_DF4260_801935CC = 0x801935CC; D_DF4260_8019B6C0 = 0x8019B6C0; -D_E08400_80195D70 = 0x80195D70; -D_E16C50_801C2240 = 0x801C2240; -D_E51970_801A03C0 = 0x801A03C0; -D_E6A810_801BBEE0 = 0x801BBEE0; -D_E9F1D0_801A7F30 = 0x801A7F30; -D_EFFA40_801875C0 = 0x801875C0; - -D_E6A810_801BA1E8 = 0x801BA1E8; -D_E51970_8019EE80 = 0x8019EE80; - -D_E51970_801A03DC = 0x801A03DC; - -D_E16C50_801C4188 = 0x801C4188; - -D_E9F1D0_801A7F58 = 0x801A7F58; -D_E9F1D0_801A7F60 = 0x801A7F60; -D_E9F1D0_801A7F68 = 0x801A7F68; -D_E9F1D0_801A7F70 = 0x801A7F70; -D_E9F1D0_801A7F78 = 0x801A7F78; - D_DF4260_8019A008 = 0x8019A008; +func_E08400_80187B08 = 0x80187B08; +func_E08400_80188A40 = 0x80188A40; +D_E08400_80195D70 = 0x80195D70; + +func_E16C50_80187754 = 0x80187754; +func_E16C50_801932AC = 0x801932AC; +func_E16C50_8019B1F0 = 0x8019B1F0; +func_E16C50_8019B810 = 0x8019B810; +func_E16C50_8019C200 = 0x8019C200; +func_E16C50_8019D060 = 0x8019D060; +func_E16C50_801AD688 = 0x801AD688; +func_E16C50_801AE3AC = 0x801AE3AC; +func_E16C50_801AF9FC = 0x801AF9FC; +func_E16C50_801B10F8 = 0x801B10F8; +func_E16C50_801B6344 = 0x801B6344; +func_E16C50_801B6E54 = 0x801B6E54; +func_E16C50_801B7AF0 = 0x801B7AF0; +func_E16C50_801BA57C = 0x801BA57C; +func_E16C50_801BB26C = 0x801BB26C; +func_E16C50_801915A4 = 0x801915A4; +func_E16C50_80191BB8 = 0x80191BB8; +D_E16C50_801C2240 = 0x801C2240; +D_E16C50_801C4188 = 0x801C4188; + +func_E51970_80198594 = 0x80198594; +func_E51970_80193CA4 = 0x80193CA4; +D_E51970_801A03C0 = 0x801A03C0; +D_E51970_8019EE80 = 0x8019EE80; +D_E51970_801A03DC = 0x801A03DC; + +func_E6A810_8018E3B0 = 0x8018E3B0; +func_E6A810_8018B720 = 0x8018B720; +func_E6A810_801990DC = 0x801990DC; +func_E6A810_801B6AEC = 0x801B6AEC; +func_E6A810_80189B80 = 0x80189B80; +func_E6A810_8018ADC4 = 0x8018ADC4; +func_E6A810_8018B96C = 0x8018B96C; +func_E6A810_8018BFB0 = 0x8018BFB0; +func_E6A810_8018E3CC = 0x8018E3CC; +func_E6A810_8018E5E8 = 0x8018E5E8; +func_E6A810_8018EFF0 = 0x8018EFF0; +func_E6A810_8018F0D8 = 0x8018F0D8; +func_E6A810_8018FA48 = 0x8018FA48; +func_E6A810_80199F8C = 0x80199F8C; +func_E6A810_801A3E70 = 0x801A3E70; +func_E6A810_801A4660 = 0x801A4660; +func_E6A810_801A4AF8 = 0x801A4AF8; +func_E6A810_801A5E2C = 0x801A5E2C; +func_E6A810_801A6134 = 0x801A6134; +func_E6A810_801A65E0 = 0x801A65E0; +func_E6A810_801A7D98 = 0x801A7D98; +func_E6A810_801B6E20 = 0x801B6E20; +D_E6A810_801BBEE0 = 0x801BBEE0; +D_E6A810_801BA1E8 = 0x801BA1E8; D_E6A810_801B7584 = 0x801B7584; D_E6A810_801B7608 = 0x801B7608; D_E6A810_801B769C = 0x801B769C; - D_E6A810_801BE250 = 0x801BE250; D_E6A810_801BE258 = 0x801BE258; D_E6A810_801BE25C = 0x801BE25C; @@ -34,3 +77,16 @@ D_E6A810_801BE284 = 0x801BE284; D_E6A810_801BE29C = 0x801BE29C; D_E6A810_801BE2FA = 0x801BE2FA; D_E6A810_801BE2A4 = 0x801BE2A4; + +func_E9F1D0_801888F4 = 0x801888F4; +func_E9F1D0_80197CC4 = 0x80197CC4; +func_E9F1D0_8018D16C = 0x8018D16C; +D_E9F1D0_801A7F30 = 0x801A7F30; +D_E9F1D0_801A7F58 = 0x801A7F58; +D_E9F1D0_801A7F60 = 0x801A7F60; +D_E9F1D0_801A7F68 = 0x801A7F68; +D_E9F1D0_801A7F70 = 0x801A7F70; +D_E9F1D0_801A7F78 = 0x801A7F78; + +D_EFFA40_801875C0 = 0x801875C0; + diff --git a/src/main/sf_61B30.c b/src/main/sf_61B30.c index d5ea47c8..42664a90 100644 --- a/src/main/sf_61B30.c +++ b/src/main/sf_61B30.c @@ -1,10 +1,6 @@ #include "global.h" -extern void func_8001A500(void*); -void func_80062180(ObjectInit* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4); -void func_80061B68(void); - -void func_80060F30(f32* arg0, u32 arg1, u32 arg2) { +void func_80060F30(f32* arg0, u32 arg1, s32 arg2) { if (D_801778E8 == 0) { func_80019218(arg1, D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else { @@ -79,7 +75,7 @@ void func_80061394(Object_4C* arg0) { s32 i; u8* var_v0 = (u8*) arg0; - for (i = 0; i < 0x4C; i++, var_v0++) { + for (i = 0; i < sizeof(Object_4C); i++, var_v0++) { *var_v0 = 0; } } @@ -108,7 +104,7 @@ void func_80061444(Object_6C* arg0) { s32 i; u8* var_v0 = (u8*) arg0; - for (i = 0; i < 0x6C; i++, var_v0++) { + for (i = 0; i < sizeof(Object_6C); i++, var_v0++) { *var_v0 = 0; } } @@ -238,12 +234,6 @@ void func_80061A4C(void) { } } -void func_80061CD0(void); -void func_80061E48(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3); -void func_80061F0C(Object_2F4* arg0, ObjectInit* arg1, s32 arg2); -void func_80062180(ObjectInit* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4); -void func_80069AAC(Object_2F4*); - void func_80061B68(void) { s32 i; f32 sp28; @@ -297,12 +287,12 @@ void func_80061CD0(void) { void func_80061E48(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3) { func_800613C4(arg0); arg0->obj.status = 1; - arg0->obj.id = 0xB5; + arg0->obj.id = 181; if (Rand_ZeroOne() < 0.5f) { - arg0->obj.id = 0xBA; + arg0->obj.id = 186; } if (Rand_ZeroOne() < 0.5f) { - arg0->obj.id = 0xB6; + arg0->obj.id = 182; } arg0->obj.pos.x = arg1; arg0->obj.pos.y = arg2; @@ -425,7 +415,7 @@ void func_80062180(ObjectInit* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { D_E9F1D0_801A7F60 = -(f32) arg0->unk_A; break; case 400: - D_801782B8 += 1; + D_801782B8++; break; case 401: if (D_801782B8 > 0) { @@ -452,7 +442,7 @@ void func_80062568(void) { s32 temp = D_80178234; // seems fake if (1) {} D_80178310 = SEGMENTED_TO_VIRTUAL(D_800CFDA0[temp]); - var_s0 = D_80177CA0 - 0x28; + var_s0 = D_80177CA0 - 40; var_s1 = &D_80178310[var_s0]; for (; var_s0 < D_80177CA0; var_s0++, var_s1++) { @@ -503,19 +493,19 @@ void func_80062664(void) { var_fs4 = var_fs2 = -4000.0f; } - if ((D_80178280->unk_210 != 0) && (D_80178280->unk_118 < 0.0f)) { + if ((D_80178280[0].unk_210 != 0) && (D_80178280[0].unk_118 < 0.0f)) { var_fs1 = 10000.0f; } - if ((D_80178280->unk_210 != 0) && (D_80178280->unk_118 > 0.0f)) { + if ((D_80178280[0].unk_210 != 0) && (D_80178280[0].unk_118 > 0.0f)) { var_fs2 = -10000.0f; } D_80161680 = 0; - for (i = 0, var_s0_2 = &D_80178310[D_80177DC8]; i < 0x2710; i++, D_80177DC8++, var_s0_2++) { + for (i = 0, var_s0_2 = &D_80178310[D_80177DC8]; i < 10000; i++, D_80177DC8++, var_s0_2++) { if ((var_s0_2->unk_10 >= 0) && D_80177D20 <= var_s0_2->unk_0 && var_s0_2->unk_0 <= D_80177D20 + 200.0f) { - if ((D_80178234 == 6) && (var_s0_2->unk_10 >= 0x3E8)) { - if (((var_s0_2->unk_C < 180.0f) && (var_s0_2->unk_6 < D_80178280->unk_0AC)) || - ((var_s0_2->unk_C > 180.0f) && (D_80178280->unk_0AC < var_s0_2->unk_6))) { + if ((D_80178234 == 6) && (var_s0_2->unk_10 >= 1000)) { + if (((var_s0_2->unk_C < 180.0f) && (var_s0_2->unk_6 < D_80178280[0].unk_0AC)) || + ((var_s0_2->unk_C > 180.0f) && (D_80178280[0].unk_0AC < var_s0_2->unk_6))) { func_80062180(var_s0_2, var_fs1, var_fs2, var_fs3, var_fs4); } } else { @@ -535,13 +525,13 @@ void func_80062B60(f32 arg0, f32 arg1, s32 arg2, f32 arg3) { if (D_80170130[i].obj.status == 0) { func_80061474(&D_80170130[i]); D_80170130[i].obj.status = 1; - D_80170130[i].obj.id = 0x15C; + D_80170130[i].obj.id = 348; D_80170130[i].obj.pos.x = arg0; D_80170130[i].obj.pos.y = D_80177940 + 3.0f; D_80170130[i].obj.pos.z = arg1; D_80170130[i].unk_70 = 10.0f; D_80170130[i].unk_6C = arg3; - D_80170130[i].unk_44 = 0x50; + D_80170130[i].unk_44 = 80; D_80170130[i].unk_4E = arg2; func_800612B8(&D_80170130[i].unk_1C, D_80170130[i].obj.id); break; @@ -564,7 +554,7 @@ void func_80062C38(f32 arg0, f32 arg1) { D_80170130[i].obj.pos.z = arg1; D_80170130[i].unk_70 = 1.0f; D_80170130[i].unk_6C = 1.3f; - D_80170130[i].unk_44 = 0x78; + D_80170130[i].unk_44 = 120; func_800612B8(&D_80170130[i].unk_1C, D_80170130[i].obj.id); break; } @@ -659,11 +649,6 @@ s32 func_80062DBC(Vec3f* arg0, f32* var_s0, Object* arg2, f32 arg3, f32 arg4, f3 return 0; } -s32 func_800998FC(Vec3f*, Vec3f*, s32, s32, Vec3f*, Vec3f*); -s32 func_800A3690(Vec3f*, Vec3f*, s32, Vec3f*); -s32 func_8006326C(Vec3f* arg0, s32 arg1, s32 arg2, Object* arg3); -s32 func_800631A8(Vec3f*, f32*, Vec3f*); - s32 func_800631A8(Vec3f* arg0, f32* arg1, Vec3f* arg2) { if (((s32) arg1[0] != 0) && (fabsf((arg1[1] + arg2->z) - arg0->z) < (arg1[2] + 20.0f)) && (fabsf((arg1[5] + arg2->x) - arg0->x) < (arg1[6] + 20.0f)) && @@ -688,7 +673,7 @@ s32 func_8006326C(Vec3f* arg0, s32 arg1, s32 arg2, Object* arg3) { sp74.z = arg0->z - arg3->pos.z; if (((fabsf(sp74.x) < 1100.0f) && (fabsf(sp74.z) < 1100.0f)) || (arg2 == 0xB4)) { sp74.y = arg0->y - arg3->pos.y; - Matrix_RotateY(D_8013BBC8, -arg3->rot.y * 0.017453292f, 0U); + Matrix_RotateY(D_8013BBC8, -arg3->rot.y * M_DTOR, 0U); Matrix_MultVec3fNoTranslate(D_8013BBC8, &sp74, &sp68); sp5C.x = arg3->pos.x + sp68.x; sp5C.y = arg3->pos.y + sp68.y; @@ -896,11 +881,50 @@ void func_80063CAC(Object_80* arg0) { } } -void func_80063D58(Object_80* arg0); -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80063D58.s") +void func_80063D58(Object* arg0) { + s32 i; -void func_80063E5C(Object_80* arg0, f32* arg1); -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80063E5C.s") + arg0->pos.y = D_80177940; + for (i = 0; i < ARRAY_COUNT(D_80163400); i++) { + if (D_80163400[i].obj.status == 0) { + func_80061394(&D_80163400[i]); + D_80163400[i].obj.status = 1; + D_80163400[i].obj.id = 164; + D_80163400[i].unk_45 = arg0->id; + D_80163400[i].obj.pos.x = arg0->pos.x; + D_80163400[i].obj.pos.y = 5.0f; + D_80163400[i].obj.pos.z = arg0->pos.z; + if ((arg0->id == 0) || (arg0->id == 6) || (arg0->id == 7) || (arg0->id == 0x38) || (arg0->id == 0x14) || + (arg0->id == 0x15) || (arg0->id == 0x16)) { + D_80163400[i].obj.rot.y = arg0->rot.y; + } else { + D_80163400[i].obj.rot.y = 44.9f; + } + func_800612B8(&D_80163400[i].unk_1C, D_80163400[i].obj.id); + break; + } + } +} + +void func_80063E5C(Object* arg0, f32* arg1) { + s32 i; + Object_6C* var_v1; + + for (i = 0, var_v1 = D_801737E0; i < ARRAY_COUNT(D_801737E0); i++, var_v1++) { + if (var_v1->obj.status == 0) { + func_80061444(&D_801737E0[i]); + var_v1->obj.status = 1; + var_v1->obj.id = 334; + var_v1->obj.pos.x = arg0->pos.x; + var_v1->obj.pos.y = arg0->pos.y; + var_v1->obj.pos.z = arg0->pos.z; + var_v1->obj.rot.y = arg0->rot.y; + func_800612B8(&var_v1->unk_1C, var_v1->obj.id); + var_v1->unk_1C.unk_C = SEGMENTED_TO_VIRTUAL(arg1); + break; + } + } +} void func_80063F4C(s32 arg0) { } @@ -913,116 +937,1918 @@ void func_80063F74(Object_6C* arg0) { arg0->unk_68 = arg0->obj.rot.z * 100.0f; } -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80063F90.s") +void func_80063F90(s32 arg0, s32 arg1) { + s32 var_a0; + s32 var_a2; + f32 sp54; + f32 sp50; + f32 sp4C; + f32* var_v0; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800652CC.s") + switch (arg1) { + case 0xAA: + func_8007A6F0(&D_80163400[arg0].obj.pos, 0x11000055); + break; + case 0xEA: + func_80019218(0x11030010, D_80163FE0[arg0].unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + break; + case 0x36: + func_80019218(0x11000000, &D_80161B00[arg0].unk_70, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + break; + case 0xC6: + func_80092D48(&D_80163FE0[arg0]); + break; + case 0xEB: + D_80163FE0[arg0].unk_13C = fabsf(Math_ModF(D_80163FE0[arg0].obj.pos.x, 100.0f)); + break; + case 0xF7: + func_E16C50_8019D060(&D_80163FE0[arg0]); + break; + case 0x170: + if (D_80178234 == 0xC) { + func_E6A810_801B6E20(D_80170130[arg0].obj.pos.x, D_80170130[arg0].obj.pos.z + D_80177D20, &sp54, &sp4C, + &sp50); + D_80170130[arg0].obj.pos.y = sp4C + 3.0f; + D_80170130[arg0].obj.rot.x = (sp54 * 180.0f) / M_PI; + D_80170130[arg0].obj.rot.z = (sp50 * 180.0f) / M_PI; + } else if (D_80178234 == 0xB) { + D_80170130[arg0].obj.status = 0; + } + break; + case 0x1E: + func_80063E5C(&D_80161B00[arg0].obj, D_6006940); + break; + case 0x1F: + func_80063E5C(&D_80161B00[arg0].obj, D_600695C); + break; + case 0x20: + func_80063E5C(&D_80161B00[arg0].obj, D_6006978); + break; + case 0x21: + func_80063E5C(&D_80161B00[arg0].obj, D_6006994); + break; + case 0x22: + func_80063E5C(&D_80161B00[arg0].obj, D_60069B0); + break; + case 0x23: + func_80063E5C(&D_80161B00[arg0].obj, D_60069CC); + break; + case 0x24: + func_80063E5C(&D_80161B00[arg0].obj, D_60069E8); + break; + case 0x25: + func_80063E5C(&D_80161B00[arg0].obj, D_6006A04); + break; + case 0x26: + func_80063E5C(&D_80161B00[arg0].obj, D_6006A20); + break; + case 0x17: + func_80063CAC(&D_80161B00[arg0]); + break; + case 0x143: + if (D_80177CA0 != 0) { + D_801737E0[arg0].obj.status = 0; + } + break; + case 0x146: + if (D_80177E80 < 0) { + D_801737E0[arg0].obj.status = 0; + } + break; + case 0x14B: + case 0x14C: + case 0x14D: + func_80063F74(&D_801737E0[arg0]); + break; + case 0x148: + case 0x149: + func_80063F58(&D_801737E0[arg0]); + break; + case 0x14A: + if (((D_80177E80 >= 7) && (D_80178234 == 0) && (D_801778B0[1] > 0)) || (D_80178234 != 0)) { + func_80063F58(&D_801737E0[arg0]); + } else { + D_801737E0[arg0].obj.status = 0; + } + break; + case 0x0: + func_80063E5C(&D_80161B00[arg0].obj, D_800CBF18); + /* fallthrough */ + case 0x6: + case 0x7: + case 0x14: + case 0x15: + case 0x16: + case 0x38: + func_80063D58(&D_80161B00[arg0].obj); + break; + case 0xBB: + D_80163FE0[arg0].unk_114 = D_80163FE0[arg0].obj.pos.x; + D_80163FE0[arg0].unk_118 = D_80163FE0[arg0].obj.pos.y; + D_80163FE0[arg0].obj.rot.z = D_80163FE0[arg0].obj.rot.x; + D_80163FE0[arg0].obj.rot.x = 0.0f; + break; + case 0xB6: + case 0xBA: + D_80163FE0[arg0].unk_46 = D_80178320; + D_80163FE0[arg0].unk_48 = D_801783D8; + D_80163FE0[arg0].obj.rot.x = Rand_ZeroOne() * 360.0f; + D_80163FE0[arg0].obj.rot.y = Rand_ZeroOne() * 360.0f; + break; + case 0xB5: + D_80163FE0[arg0].obj.rot.x = Rand_ZeroOne() * 360.0f; + D_80163FE0[arg0].obj.rot.y = Rand_ZeroOne() * 360.0f; + D_80163FE0[arg0].unk_0CE = 200; + break; + case 0xCA: + D_80163FE0[arg0].unk_0CE = 30; + break; + case 0xFC: + if (D_80178280[0].unk_07C < D_80163FE0[arg0].obj.pos.z) { + func_80060FBC(&D_80163FE0[arg0].obj, D_80163FE0[arg0].unk_100); + } + break; + case 0xEF: + D_80163FE0[arg0].unk_050 = D_801784A4; + D_801784A4++; + break; + case 0xEC: + D_801784A4 = 0; + D_80163FE0[arg0].unk_0F4 = D_80163FE0[arg0].obj.rot.x; + D_80163FE0[arg0].unk_0F8 = D_80163FE0[arg0].obj.rot.y; + D_80163FE0[arg0].obj.rot.x = D_80163FE0[arg0].obj.rot.y = 0.0f; + D_80163FE0[arg0].unk_11C = D_80163FE0[arg0].obj.pos.y; + var_v0 = D_801782C4; + for (var_a0 = 0; var_a0 < 200; var_a0++, var_v0 += 6) { + var_v0[0] = D_80163FE0[arg0].obj.pos.x; + var_v0[1] = D_80163FE0[arg0].obj.pos.y; + var_v0[2] = D_80163FE0[arg0].obj.pos.z; + var_v0[3] = D_80163FE0[arg0].obj.rot.x; + var_v0[4] = D_80163FE0[arg0].obj.rot.y; + var_v0[5] = D_80163FE0[arg0].obj.rot.z; + } + break; + case 0xC2: + D_80163FE0[arg0].unk_46 = 100; + for (var_a0 = 0; var_a0 < 2; var_a0++) { + if (D_80176550[var_a0] == 0) { + D_80176550[var_a0] = 1; + D_80163FE0[arg0].unk_46 = var_a0; + for (var_a2 = 0; var_a2 < 100; var_a2++) { + D_80176878[var_a0][var_a2] = D_80163FE0[arg0].obj.pos.y; + D_80176B98[var_a0][var_a2] = D_80163FE0[arg0].obj.pos.z; + } + break; + } + } + if (D_80163FE0[arg0].unk_46 == 100) { + D_80163FE0[arg0].obj.status = 0; + } + break; + case 0xBE: + case 0xBF: + func_80019218(0x31000012, D_80163FE0[arg0].unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + break; + case 0xC0: + D_80163FE0[arg0].unk_0C9 = 1; + break; + case 0x140: + func_E9F1D0_8018D16C(&D_8016F110[arg0]); + break; + case 0x13C: + func_E51970_80193CA4(&D_8016F110[arg0]); + break; + case 0x13A: + func_E9F1D0_80197CC4(&D_8016F110[arg0]); + break; + case 0xCD: + case 0xCE: + case 0xD0: + case 0xD1: + case 0xD2: + case 0xD3: + case 0xD4: + case 0xD5: + func_E6A810_80199F8C(&D_80163FE0[arg0]); + break; + case 0xCF: + func_E6A810_801A7D98(&D_80163FE0[arg0]); + break; + case 0xD6: + func_E6A810_801A3E70(&D_80163FE0[arg0]); + break; + case 0xD7: + func_E6A810_801A4660(&D_80163FE0[arg0]); + break; + case 0xDF: + func_E6A810_801A4AF8(&D_80163FE0[arg0]); + break; + case 0xD8: + case 0xD9: + func_E6A810_801A5E2C(&D_80163FE0[arg0]); + break; + case 0xDA: + func_E6A810_801A6134(&D_80163FE0[arg0]); + break; + case 0x41: + func_E6A810_801A65E0(&D_80161B00[arg0]); + break; + case 0xB1: + case 0xB2: + func_DF4260_8018B0B4(&D_80163FE0[arg0]); + /* fallthrough */ + case 0xB0: + D_80163FE0[arg0].unk_0CE = 24; + func_80019218(0x31000016, D_80163FE0[arg0].unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + break; + case 0x129: + func_E08400_80188A40(&D_8016F110[arg0]); + break; + case 0x12B: + func_80042FAC(&D_8016F110[arg0]); + break; + case 0x12C: + func_80042FD0(&D_8016F110[arg0]); + break; + case 0x124: + func_DF4260_801878D8(&D_8016F110[arg0]); + break; + case 0x125: + func_DF4260_8018BE7C(&D_8016F110[arg0]); + break; + case 0x12E: + func_E16C50_80187754(&D_8016F110[arg0]); + break; + case 0xE7: + func_E6A810_8018B96C(&D_80163FE0[arg0]); + break; + case 0xE8: + func_E6A810_8018ADC4(&D_80163FE0[arg0]); + break; + case 0xE9: + func_E6A810_80189B80(&D_80163FE0[arg0]); + break; + case 0xE5: + func_E6A810_8018BFB0(&D_80163FE0[arg0]); + break; + case 0xE3: + func_E6A810_8018E3CC(&D_80163FE0[arg0]); + break; + case 0xE4: + func_E6A810_8018E5E8(&D_80163FE0[arg0]); + break; + case 0xA9: + func_E6A810_8018EFF0(&D_80163400[arg0]); + break; + case 0x132: + func_E6A810_8018FA48(&D_8016F110[arg0]); + break; + case 0xF0: + func_E16C50_801915A4(&D_80163FE0[arg0]); + break; + case 0xF1: + func_E16C50_80191BB8(&D_80163FE0[arg0]); + break; + case 0x133: + func_E16C50_801932AC(&D_8016F110[arg0]); + break; + case 0xFA: + func_E16C50_8019B1F0(&D_80163FE0[arg0]); + break; + case 0xFB: + func_E16C50_8019B810(&D_80163FE0[arg0]); + break; + case 0xFD: + func_E16C50_8019C200(&D_80163FE0[arg0]); + break; + case 0xFF: + func_E16C50_801AD688(&D_80163FE0[arg0]); + break; + case 0x100: + func_E16C50_801AE3AC(&D_80163FE0[arg0]); + break; + case 0x101: + func_E16C50_801AF9FC(&D_80163FE0[arg0]); + break; + case 0x13E: + func_E16C50_801B10F8(&D_8016F110[arg0]); + break; + case 0x103: + func_E16C50_801B6344(&D_80163FE0[arg0]); + break; + case 0x106: + func_E16C50_801B6E54(&D_80163FE0[arg0]); + break; + case 0x104: + func_E16C50_801B7AF0(&D_80163FE0[arg0]); + break; + case 0x39: + func_E6A810_8018F0D8(&D_80161B00[arg0]); + break; + case 0x13F: + func_DF4260_801935CC(&D_8016F110[arg0]); + break; + case 0x118: + func_DF4260_8019250C(&D_80163FE0[arg0]); + break; + case 0x119: + case 0x11A: + func_DF4260_80192CB0(&D_80163FE0[arg0]); + break; + case 0x11B: + func_DF4260_80192EA4(&D_80163FE0[arg0]); + break; + case 0x11C: + func_DF4260_801933B4(&D_80163FE0[arg0]); + break; + case 0x109: + func_E16C50_801BA57C(&D_80163FE0[arg0]); + break; + case 0x10B: + func_E16C50_801BB26C(&D_80163FE0[arg0]); + break; + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80065380.s") +void func_800652CC(Object_80* arg0) { + f32 sp2C; + f32 sp28; + f32 sp24; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_8006546C.s") + if ((D_801784AC == 4) && (arg0->unk_48 == 0)) { + func_E6A810_801B6E20(arg0->obj.pos.x, arg0->obj.pos.z + D_80177D20, &sp2C, &sp24, &sp28); + arg0->obj.pos.y = sp24 + 3.0f; + arg0->obj.rot.x = (sp2C * 180.0f) / 3.1415927f; + arg0->obj.rot.z = (sp28 * 180.0f) / 3.1415927f; + arg0->unk_48 += 1; + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800654E4.s") +void func_80065380(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { + func_800613C4(arg0); + arg0->obj.status = 2; + arg0->obj.id = 182; + arg0->unk_0BC = (s32) (Rand_ZeroOne() * 10.0f) + 10; + arg0->unk_0C2 = 30; + arg0->unk_0E8 = arg4; + arg0->unk_0EC = arg5; + arg0->unk_0F0 = arg6; + arg0->obj.pos.x = arg1; + arg0->obj.pos.y = arg2; + arg0->obj.pos.z = arg3; + arg0->unk_46 = 0xFF; + arg0->unk_48 = 900; + arg0->obj.rot.z = Rand_ZeroOne() * 360.0f; + arg0->obj.rot.y = Rand_ZeroOne() * 360.0f; + func_800612B8(&arg0->unk_01C, arg0->obj.id); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800655C8.s") +void func_8006546C(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) { + s32 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_8006566C.s") + for (i = 0; i < ARRAY_COUNT(D_80163FE0); i++) { + if (D_80163FE0[i].obj.status == 0) { + func_80065380(&D_80163FE0[i], arg0, arg1, arg2, arg3, arg4, arg5); + break; + } + } +} +void func_800654E4(Object* arg0) { + f32 temp_fs0; + f32 temp_fs1; + s32 var_s1; + + func_8007D2C8(arg0->pos.x, arg0->pos.y, arg0->pos.z, 12.0f); + for (var_s1 = 0; var_s1 < 4; var_s1++) { + func_8006546C(arg0->pos.x, arg0->pos.y, arg0->pos.z, (Rand_ZeroOne() - 0.5f) * 40.0f, + (Rand_ZeroOne() - 0.5f) * 40.0f, Rand_ZeroOne() * -20.0f); + } +} + +void func_800655C8(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { + func_800613C4(arg0); + arg0->obj.status = 1; + arg0->obj.id = 190; + arg0->obj.pos.x = arg1; + arg0->obj.pos.y = arg2; + arg0->obj.pos.z = arg3; + arg0->unk_0B4 = arg4; + arg0->unk_0BE = 50; + if (arg0->unk_0B4 == 1) { + arg0->unk_0BE = 30; + } + arg0->unk_124.y = 15.0f; + func_800612B8(&arg0->unk_01C, arg0->obj.id); +} + +void func_8006566C(f32 arg0, f32 arg1, f32 arg2, s32 arg3) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(D_80163FE0); i++) { + if (D_80163FE0[i].obj.status == 0) { + func_800655C8(&D_80163FE0[i], arg0, arg1, arg2, arg3); + break; + } + } +} + +#ifdef NON_MATCHING +void func_800656D4(Object_2F4* arg0) { + f32 spD4; + f32 spD0; + f32 spCC; + s32 spC4; + s32 spB4[3]; + s32 spA8[3]; + Vec3f sp98; + Vec3f sp8C; + f32 sp88; + f32 sp84; + f32 sp80; + f32 sp7C; + f32 sp78; + s32 var_ra; + f32 var_fv0; + s32 temp_a0; + s32 temp_a2; + s32 temp_t9; + s32 temp_v0; + s32 i; + s32 j; + + if (D_80177880 == 1) { + var_ra = 2; + } else { + var_ra = 0; + } + if (arg0->unk_058 == 0) { + if (arg0->obj.id == 0xBE) { + for (i = 0, j = 1; j < 4; i++, j++) { + spA8[i] = var_ra + j; + spB4[i] = D_801778B0[j]; + } + for (i = 0, j = 1; j < 3; i++, j++) { + temp_a0 = spB4[i]; + temp_a2 = spB4[j]; + if (spB4[i] < temp_a2) { + temp_v0 = spA8[j]; + spB4[j] = spB4[i]; + spA8[j] = spA8[i]; + spB4[i] = temp_a2; + spA8[i] = temp_v0; + } + } + switch (D_80177DB0 % 6U) { + case 0: + case 1: + case 2: + spC4 = spA8[2]; + break; + case 3: + case 4: + spC4 = spA8[1]; + break; + case 5: + spC4 = spA8[0]; + break; + } + + if (((D_80177880 == 1) && (D_801778B0[spC4 - 1] > 0)) || D_801778B0[spC4 + 1] > 0) { + arg0->unk_054 = spC4; + } else { + arg0->unk_054 = 0x2710; + } + } else { + arg0->unk_054 = 0x2710; + } + arg0->unk_058 = 1; + } + spC4 = arg0->unk_054; + if ((spC4 == var_ra) || ((var_ra + 1) == spC4) || ((var_ra + 2) == spC4)) { + arg0->unk_188 = D_80163FE0[spC4].obj.pos.z; + arg0->unk_184 = D_80163FE0[spC4].obj.pos.y; + arg0->unk_180 = D_80163FE0[spC4].obj.pos.x; + if ((fabsf(arg0->obj.pos.x - D_80163FE0[spC4].obj.pos.x) < 400.0f) && + (fabsf(arg0->obj.pos.z - D_80163FE0[spC4].obj.pos.z) < 400.0f)) { + if ((Rand_ZeroOne() * (spC4 - 1)) < 0.6f) { + D_80163FE0[spC4].unk_078 = 1; + } + } + + } else { + arg0->unk_188 = D_80178280[0].unk_138; + arg0->unk_184 = D_80178280[0].unk_078; + arg0->unk_180 = D_80178280[0].unk_074; + } + if (arg0->unk_0BC != 0) { + func_8009BD38(&arg0->obj.rot.x, 0.0f, 0.3f, 4.0f, 0.001f); + } else { + if ((arg0->unk_078 == 0) && + ((fabsf(arg0->unk_180 - arg0->obj.pos.x) > 300.0f) || (fabsf(arg0->unk_188 - arg0->obj.pos.z) > 300.0f))) { + arg0->unk_114 += 5.0f; + arg0->unk_118 += 8.0f; + sp80 = sqrtf(SQ(arg0->unk_180 - arg0->obj.pos.x) + SQ(arg0->unk_188 - arg0->obj.pos.z)) * 0.2f; + if (arg0->unk_0B4 == 1) { + sp80 = 0.1f; + } + spD0 = __sinf(arg0->unk_114 * M_DTOR) * sp80; + sp88 = __cosf(arg0->unk_118 * M_DTOR) * sp80; + spD4 = __cosf(arg0->obj.rot.y * M_DTOR) * sp88; + spCC = -__sinf(arg0->obj.rot.y * M_DTOR) * sp88; + sp88 = (arg0->unk_180 + spD4) - arg0->obj.pos.x; + sp84 = (arg0->unk_184 + spD0) - arg0->obj.pos.y; + sp80 = (arg0->unk_188 + spCC) - arg0->obj.pos.z; + sp78 = func_8009F768(Math_Atan2F(sp88, sp80)); + sp7C = func_8009F768(-Math_Atan2F(sp84, sqrtf((sp88 * sp88) + (sp80 * sp80)))); + sp84 = func_8009BD38(&arg0->obj.rot.y, sp78, 0.3f, 4.0f, 0.001f); + func_8009BD38(&arg0->obj.rot.x, sp7C, 0.3f, 4.0f, 0.001f); + } + if ((fabsf(arg0->unk_180 - arg0->obj.pos.x) < 60.0f) && (fabsf(arg0->unk_184 - arg0->obj.pos.y) < 60.0f) && + (fabsf(arg0->unk_188 - arg0->obj.pos.z) < 60.0f) && ((spC4 == 2) || (spC4 == 3) || (spC4 == 4))) { + D_80163FE0[spC4].unk_0D0 = 1; + D_80163FE0[spC4].unk_0D6 = 20; + D_80163FE0[spC4].unk_0D4 = 2; + func_8007A6F0(&arg0->obj.pos, 0x2903A008); + func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 5.0f); + func_80060FBC(&arg0->obj, arg0->unk_100); + } + } + func_8009F6CC(&sp98, arg0->obj.rot.x, arg0->obj.rot.y, arg0->unk_124.y); + arg0->unk_0E8 = sp98.x; + arg0->unk_0EC = sp98.y; + arg0->unk_0F0 = sp98.z - D_80177D08; + if (arg0->unk_0B4 == 0) { + arg0->obj.rot.z += 5.0f; + } + if (arg0->unk_0B4 == 1) { + if (arg0->unk_0BE == 0) { + arg0->unk_0BE = 30; + func_8009F6CC(&sp98, arg0->obj.rot.x, arg0->obj.rot.y, 120.0f); + func_8007F04C(0x161, arg0->obj.pos.x + sp98.x, arg0->obj.pos.y + sp98.y, arg0->obj.pos.z + sp98.z, + arg0->obj.rot.x, arg0->obj.rot.y, arg0->obj.rot.z, 0.0f, 0.0f, 0.0f, sp98.x, sp98.y, sp98.z, + 1.0f); + } + var_fv0 = 330.0f; + if (sp84 < 0.0f) { + var_fv0 = 30.0f; + } + func_8009BD38(&arg0->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.01f); + } + if ((D_801784AC == 4) && + (func_E6A810_801B6AEC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z + D_80177D20) != 0)) { + func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 5.0f); + func_80060FBC(&arg0->obj, arg0->unk_100); + } + sp8C.x = arg0->unk_0E8; + sp8C.y = arg0->unk_0EC; + sp8C.z = arg0->unk_0F0; + if ((func_8006351C(arg0->unk_040, &arg0->obj.pos, (s32) &sp8C, 1) != 0) || (arg0->unk_0D0 != 0) || + (arg0->obj.pos.y < (D_80177940 + 10.0f)) || (D_80178280[0].unk_1C8 == 7)) { + func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 3.0f); + func_80060FBC(&arg0->obj, arg0->unk_100); + if (arg0->unk_0D0 != 0) { + arg0->unk_44 = 2; + if ((D_80178234 == 0)) { + if (D_80177880 == 1) { + arg0->unk_44 = 2; + } else { + arg0->unk_44 = 4; + } + } + if (D_80178234 == 3) { + arg0->unk_44 = 22; + } + func_80066254(arg0); + } + func_8007A6F0(&arg0->obj.pos, 0x2903A008); + } + if (D_80177880 == 0) { + if (fabsf(arg0->obj.pos.z - D_80178280[0].unk_138) < 100.0f) { + arg0->unk_078 = 1; + } + if (D_80178280[0].unk_40.z < (arg0->obj.pos.z + D_80177D20)) { + func_80060FBC(&arg0->obj, arg0->unk_100); + } + } +} +#else #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800656D4.s") +#endif -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800660F0.s") +void func_800660F0(Object_2F4* arg0) { + Object_6C* var_s0 = D_801737E0; + s32 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066254.s") + for (i = 0; i < ARRAY_COUNT(D_801737E0); i++, var_s0++) { + if (var_s0->obj.status == 0) { + func_80061444(var_s0); + var_s0->obj.status = 1; + var_s0->obj.id = D_800CFDF4[arg0->unk_44]; + var_s0->obj.pos.x = arg0->obj.pos.x; + var_s0->obj.pos.y = arg0->obj.pos.y; + var_s0->obj.pos.z = arg0->obj.pos.z; + var_s0->unk_4A = 8; + func_800612B8(&var_s0->unk_1C, var_s0->obj.id); + if ((var_s0->obj.id == 0x144) || (var_s0->obj.id == 0x147) || (var_s0->obj.id == 0x142)) { + var_s0->unk_50 = 90.0f; + } + if ((var_s0->obj.id >= 0x150) || (var_s0->obj.id == 0x14F)) { + var_s0->unk_50 = 90.0f; + func_80019218(0x4900000C, D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + var_s0->unk_48 = 1000; + if (var_s0->obj.id == 0x151) { + func_80019218(0x1900302B, var_s0->unk_5C, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + } + break; + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_8006654C.s") +void func_80066254(Object_2F4* arg0) { + Object_2F4* var_v0; + s32 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_8006684C.s") + if (D_801778E8 != 0) { + if ((arg0->unk_0D4 > 0) && (arg0->unk_0D4 < 5) && + !((D_80178768[0] == 0) && (D_80178768[1] == 0) && (D_80178768[2] == 0))) { + D_80177C30[arg0->unk_0D4 - 1] += arg0->unk_01C.unk_20; + } + } else if ((arg0->obj.id != 0xC5) || (arg0->unk_0B6 != 1)) { + if ((arg0->unk_0D4 == 1) && (arg0->unk_01C.unk_20 != 0)) { + D_80161A98 += arg0->unk_01C.unk_20; + D_80177850 = 0xF; + if ((D_80177880 == 1) && (D_80161A62 != 0)) { + switch (D_80161A62) { + case 9: + if (D_80178234 == 0x10) { + func_800BA808(D_80182544, 0xAA); + } + /* fallthrough */ + case 4: + case 19: + case 29: + arg0->unk_44 = 0xE; + break; + case 14: + arg0->unk_44 = 9; + break; + } + D_80161A62 = 0; + } + if (arg0->obj.id == 0xC5) { + if ((arg0->unk_0E4 >= 4) && (arg0->unk_0E4 < 8)) { + func_8002E3E0(arg0); + } + } + } + if (arg0->unk_44) { + if (D_800CFE5C[arg0->unk_44] < 0.0f) { + var_v0 = D_80163FE0; + for (i = 0, var_v0 = D_80163FE0; i < ARRAY_COUNT(D_80163FE0); i++, var_v0++) { + if ((var_v0->obj.status != 0) && (var_v0->unk_040 != arg0->unk_040) && + (arg0->unk_8C == var_v0->unk_8C)) { + return; + } + } + func_800660F0(arg0); + func_80019218(0x4900000C, D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } else if (arg0->unk_44 == 0x18) { + if (D_801778B0[3] > 0) { + func_800BA808(D_80183CA8, 0x1E); + } else if (D_801778B0[2] > 0) { + func_800BA808(D_80183D3C, 0x14); + } else if (D_801778B0[1] > 0) { + func_800BA808(D_80183CF0, 0xA); + } + } else if (Rand_ZeroOne() <= D_800CFE5C[arg0->unk_44]) { + func_800660F0(arg0); + } + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800669A0.s") +void func_8006654C(Object_2F4* arg0) { + arg0->unk_10C = 0.4f; + if (arg0->obj.pos.y <= D_80177940 + 130.0f) { + arg0->obj.pos.y = D_80177940 + 130.0f; + arg0->unk_0EC = 0.0f; + } + arg0->unk_0E8 = __sinf(arg0->obj.rot.y * M_DTOR) * (*arg0).unk_114; + arg0->unk_0F0 = __cosf(arg0->obj.rot.y * M_DTOR) * (*arg0).unk_114; + switch (arg0->unk_0B8) { + case 0: + if (arg0->unk_114 < 20.0f) { + arg0->unk_114 = arg0->unk_114 + 0.5f; + } + arg0->unk_0B6++; + if (func_8009ACDC(D_6029528) < arg0->unk_0B6) { + arg0->unk_0B6 = 0; + } + if ((arg0->obj.rot.z < 15.0f) && (arg0->unk_0B6 < 0x14)) { + arg0->obj.rot.z = arg0->obj.rot.z + 1.0f; + } + if ((arg0->obj.rot.z > -15.0f) && (arg0->unk_0B6 >= 0x15)) { + arg0->obj.rot.z -= 1.0f; + } + if ((arg0->unk_0B6 == 0x14) || (arg0->unk_0B6 == 0x28)) { + arg0->unk_0B8++; + arg0->unk_0BC = 0x14; + } + break; + case 1: + if (arg0->obj.rot.z > 0.0f) { + arg0->obj.rot.z = arg0->obj.rot.z - 0.5f; + } + if (arg0->obj.rot.z < 0.0f) { + arg0->obj.rot.z += 0.5f; + } + if (arg0->unk_114 > 0.0f) { + arg0->unk_114 = arg0->unk_114 - 0.3f; + } + if (arg0->unk_0BC == 0) { + arg0->unk_0B8 = 0; + } + break; + } + arg0->unk_110 = 0.8f; + if (arg0->unk_0D0 != 0) { + arg0->obj.status = 3; + arg0->unk_0EC = (Rand_ZeroOne() * 5.0f) + 6.0f; + if (arg0->unk_0D0 == 2) { + arg0->unk_0EC = -2.0f; + } + arg0->unk_0F0 = -15.0f; + arg0->unk_10C = 0.5f; + func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y + 30.0f, arg0->obj.pos.z, 13.0f); + func_80019218(0x2903A008, arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066A80.s") +void func_8006684C(Object_2F4* arg0) { + s32 pad; // possible recast from Object* -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066A8C.s") + if (arg0->unk_0BE != 0) { + arg0->unk_0F0 = 0.0f; + arg0->unk_0E8 = 0.0f; + arg0->unk_0EC = 0.0f; + if (arg0->unk_0BE == 1) { + func_80060FBC(&arg0->obj, arg0->unk_100); + arg0->unk_44 = 1; + func_80066254(arg0); + func_80019218(0x2903B009, arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80077240(arg0->obj.pos.x, arg0->obj.pos.y + 250.0f, arg0->obj.pos.z, 3); + D_80161A98 += 3; + D_80177850 = 0xF; + } + } else { + arg0->obj.rot.x += 11.0f; + arg0->obj.rot.y += 7.0f; + if (arg0->unk_0EC < -3.0f) { + func_8007BFFC(arg0->obj.pos.x, arg0->obj.pos.y + 30.0f, arg0->obj.pos.z, 0.0f, 0.0f, 0.0f, 7.0f, 5); + arg0->unk_0BE = 3; + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066C00.s") +void func_800669A0(Object_2F4* arg0) { + if (arg0->unk_0BC != 0) { + if (arg0->unk_0BC == 1) { + func_80060FBC(&arg0->obj, arg0->unk_100); + } + } else { + arg0->obj.rot.y += 5.0f; + if (arg0->unk_0D0 != 0) { + func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y + 130.0f, arg0->obj.pos.z, 8.0f); + func_8007BFFC(arg0->obj.pos.x, arg0->obj.pos.y + 130.0f, arg0->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 5); + arg0->unk_0BC = 4; + func_8007A6F0(&arg0->obj.pos, 0x1903400F); + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066D5C.s") +void func_80066A80(Object_2F4* arg0) { +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066E80.s") +void func_80066A8C(Object_80* arg0) { + Vec3f sp64; + Vec3f sp58; + f32 yf; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066E8C.s") + sp64.z = 0.0f; + sp64.x = -120.0f; + if (arg0->obj.rot.y > 90.0f) { + sp64.x = 120.0f; + } + for (yf = 0.0f; yf < 680.0f; yf += 100.0f) { + Matrix_RotateY(D_8013BBC8, arg0->obj.rot.y * M_DTOR, 0); + Matrix_RotateX(D_8013BBC8, arg0->obj.rot.x * M_DTOR, 1); + sp64.y = yf; + Matrix_MultVec3fNoTranslate(D_8013BBC8, &sp64, &sp58); + func_8007D0E0(arg0->obj.pos.x + sp58.x, arg0->obj.pos.y + sp58.y, arg0->obj.pos.z + sp58.z, 4.0f); + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066EA8.s") +void func_80066C00(Object_80* arg0) { + Vec3f sp64; + Vec3f sp58; + f32 zf; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066EE4.s") + sp64.y = 30.0f; + sp64.x = -100.0f; + if (arg0->obj.rot.y > 90.0f) { + sp64.x = 100.0f; + } + Matrix_RotateY(D_8013BBC8, arg0->obj.rot.y * M_DTOR, 0); -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80066EF0.s") + for (zf = -180.0f; zf <= 0.0f; zf += 30.0f) { + sp64.z = zf; + Matrix_MultVec3fNoTranslate(D_8013BBC8, &sp64, &sp58); + func_8007D0E0(arg0->obj.pos.x + sp58.x, arg0->obj.pos.y + sp58.y, arg0->obj.pos.z + sp58.z, + Rand_ZeroOne() + 2.0f); + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800671D0.s") +void func_80066D5C(Object_80* arg0) { + switch (arg0->unk_48) { + case 1: + func_80066C00(arg0); + arg0->unk_48++; + func_80019218(0x2900300F, &arg0->unk_70, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + break; + case 2: + arg0->unk_64 += 0.05f; + arg0->obj.rot.x += arg0->unk_64; + if (arg0->obj.rot.x >= 90.0f) { + arg0->obj.rot.x = 90.0f; + arg0->unk_44 = 40; + func_80066A8C(arg0); + arg0->unk_48 = 0; + D_80178480 = 25; + func_80019218(0x19130003, &arg0->unk_70, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + break; + case 0: + break; + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80067348.s") +void func_80066E80(Object_80* arg0) { +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800674B4.s") +void func_80066E8C(Object_4C* arg0) { + arg0->obj.rot.y += 0.2f; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_8006753C.s") +void func_80066EA8(Object_80* arg0) { + arg0->obj.rot.y = 0.0f; + if (D_80178280[0].unk_40.x < arg0->obj.pos.x) { + arg0->obj.rot.y = 271.0f; + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80067874.s") +void func_80066EE4(Object_4C* arg0) { +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80067A40.s") +void func_80066EF0(Object_6C* arg0) { + f32 var_fa1; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80067B1C.s") + if ((D_80178280[0].unk_1C8 == 7) || (D_80178280[0].unk_1C8 == 0)) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + } + if ((D_80177880 == 0) && (D_80161680 == 0)) { + var_fa1 = 900.0f; + if (D_80178280[0].unk_1CC != 0) { + var_fa1 = 600.0f; + } + if (D_80178280[0].unk_0AC + var_fa1 < arg0->obj.pos.x) { + func_8009BC2C(&arg0->obj.pos.x, D_80178280[0].unk_0AC + var_fa1, 0.1f, 10.0f, 0.01f); + } + if (arg0->obj.pos.x < D_80178280[0].unk_0AC - var_fa1) { + func_8009BC2C(&arg0->obj.pos.x, D_80178280[0].unk_0AC - var_fa1, 0.1f, 10.0f, 0.01f); + } + } + if (arg0->obj.pos.y > 650.0f) { + func_8009BC2C(&arg0->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f); + } + if (D_80177C98 == 0) { + if (arg0->obj.pos.y < D_80177940 + 70.0f) { + func_8009BC2C(&arg0->obj.pos.y, D_80177940 + 70.0f, 0.1f, 5.0f, 0.01f); + } + if ((D_80178234 == 0xD) && (D_80178284 != 0)) { + arg0->obj.pos.z += 20.0f; + } + } else if (arg0->obj.pos.y < -500.0f) { + func_8009BC2C(&arg0->obj.pos.y, -500.0f, 0.1f, 5.0f, 0.01f); + } + if ((D_801778E8 != 0) && (arg0->unk_40 == 0) && (D_801737E0[1].obj.status == 2)) { + if (fabsf(arg0->obj.pos.x - D_801737E0[1].obj.pos.x) < 200.0f) { + if (fabsf(arg0->obj.pos.z - D_801737E0[1].obj.pos.z) < 200.0f) { + arg0->obj.pos.x = arg0->obj.pos.x - 5.0f; + arg0->obj.pos.z = arg0->obj.pos.z - 5.0f; + D_801737E0[1].obj.pos.x += 5.0f; + D_801737E0[1].obj.pos.z += 5.0f; + } + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80067BEC.s") +void func_800671D0(Object_6C* arg0) { + s32 var_v0; + Vec3f sp40; + Vec3f sp34; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80067F6C.s") + func_8009BC2C(&arg0->unk_50, 10.0f, 1.0f, 2.0f, 0.0f); + if (arg0->unk_50 > 30.0f) { + var_v0 = 0; + } else if (arg0->unk_50 > 20.0f) { + var_v0 = 1; + } else { + var_v0 = 7; + } + if (!(var_v0 & D_80177DB0)) { + Matrix_RotateY(D_8013BBC8, D_80177DB0 * 23.0f * 0.017453292f, 0U); + sp40.x = 50.0f; + sp40.y = (Rand_ZeroOne() - 0.5f) * 120.0f; + sp40.z = 0.0f; + Matrix_MultVec3fNoTranslate(D_8013BBC8, &sp40, &sp34); + func_80078E50(arg0->obj.pos.x + sp34.x, arg0->obj.pos.y + sp34.y, arg0->obj.pos.z + sp34.z, 3.0f); + } + arg0->obj.rot.y += arg0->unk_50; + arg0->obj.rot.y = Math_ModF(arg0->obj.rot.y, 360.0f); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80068020.s") +void func_80067348(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8) { + func_800613C4(arg0); + arg0->obj.status = 2; + arg0->obj.id = 189; + arg0->unk_0B8 = 70; + arg0->obj.pos.x = arg1; + arg0->obj.pos.y = arg2; + arg0->obj.pos.z = arg3; + arg0->obj.rot.x = arg4; + arg0->obj.rot.y = arg5; + arg0->unk_0E8 = arg6; + arg0->unk_0EC = arg7; + arg0->unk_0F0 = arg8; + arg0->unk_0BC = (s32) (Rand_ZeroOne() * 15.0f) + 25.0f; + arg0->unk_10C = 0.5f; + func_800612B8(&arg0->unk_01C, arg0->obj.id); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800685D8.s") +void func_800674B4(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { + s32 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800685F8.s") + for (i = 59; i >= 50; i--) { + if (D_80163FE0[i].obj.status == 0) { + func_80067348(&D_80163FE0[i], arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + break; + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80068618.s") +void func_8006753C(Object_2F4* arg0) { + UnkStruct_D_80178280* new_var = D_80178280; // fake + s32 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80068688.s") + arg0->obj.rot.y += 1.0f; + if (D_80177880 == 1) { + if (D_80178234 == 0x12) { + func_8009BC2C(&arg0->obj.pos.x, -2000.0f, 0.05f, 60.0f, 0.01f); + func_8009BC2C(&arg0->obj.pos.y, -200.0f, 0.05f, 3.0f, 0.01f); + func_8009BC2C(&arg0->obj.pos.z, 0.0f, 0.05f, 0.f, 0.01f); + } else { + func_8009BC2C(&arg0->obj.pos.y, 300.0f, 0.05f, 50.0f, 0.01f); + } + } + if (arg0->unk_0D0 != 0) { + arg0->unk_0D0 = 0; + arg0->unk_0CE -= arg0->unk_0D6; + if (arg0->unk_0CE <= 0) { + func_8007A6F0(&arg0->obj.pos, 0x2903A008); + func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 5.0f); + if (((new_var[0].unk_49C < 2) || (new_var[0].unk_49D < 2)) && (new_var[0].unk_1CC != 1)) { + arg0->unk_44 = 0x17; + } else if (D_80178280[0].unk_264 < 0x80) { + arg0->unk_44 = 0x19; + } else if ((D_80161AA8[0] == 0) && (new_var[0].unk_1CC != 1)) { + arg0->unk_44 = 9; + } else { + arg0->unk_44 = 5; + } + func_80066254(arg0); + for (i = 0; i < 6; i++) { + func_800674B4(D_800CFEC4[i].x + arg0->obj.pos.x, D_800CFEC4[i].y + arg0->obj.pos.y, + D_800CFEC4[i].z + arg0->obj.pos.z, D_800CFF0C[i].y + arg0->obj.rot.y, + D_800CFF0C[i].x + arg0->obj.rot.x, (Rand_ZeroOne() - 0.5f) * 40.0f, + (Rand_ZeroOne() * 10.0f) + 10.0f, (Rand_ZeroOne() - 0.5f) * 40.0f); + func_800794CC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 0.6f); + } + func_80060FBC(&arg0->obj, arg0->unk_100); + } + } + D_80175A10[63].unk_00 = 1; + D_80175A10[63].unk_02 = 0x67; + D_80175A10[63].pos.x = arg0->obj.pos.x; + D_80175A10[63].pos.y = arg0->obj.pos.y; + D_80175A10[63].pos.z = arg0->obj.pos.z; + D_80175A10[63].unk_10 = 0.0f; +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80068914.s") +void func_80067874(Object_2F4* arg0) { + s32 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80068C48.s") + func_8000372C(&gMasterDisp, -60, -60, 60, 150, 150, 150, 20, 20, 20); + for (i = 0; i < 6; i++) { + Matrix_Push(&D_8013B3C0); + Matrix_Translate(D_8013B3C0, D_800CFEC4[i].x, D_800CFEC4[i].y, D_800CFEC4[i].z, 1); + Matrix_RotateY(D_8013B3C0, D_800CFF0C[i].y * 0.017453292f, 1); + Matrix_RotateX(D_8013B3C0, D_800CFF0C[i].x * 0.017453292f, 1); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, D_10177C0); + Matrix_Pop(&D_8013B3C0); + } + func_8000372C(&gMasterDisp, D_801784DC, D_801784E0, D_801784E4, D_80178548, D_8017854C, D_80178550, D_80178554, + D_80178558, D_8017855C); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80068C88.s") +void func_80067A40(void) { + func_80019218(0x09008023, D_80178280[0].unk_460, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + if (D_80178280[0].unk_49C < 2) { + D_80177D40[0] = 1050; + D_80178280[0].unk_49C = 2; + } + if (D_80178280[0].unk_49D < 2) { + D_80177D58[0] = 1050; + D_80178280[0].unk_49D = 2; + } + if (D_801779F8 != 0) { + D_80177D10[0] = D_80177D28[0] = 10; + } else { + D_80177D10[0] = D_80177D28[0] = 60; + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80068FE0.s") +void func_80067B1C(Object_6C* arg0) { + func_80066EF0(arg0); + func_800671D0(arg0); + if (arg0->unk_4C != 0) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + func_80060F30(D_80178280[arg0->unk_4E].unk_460, 0x4900C024, arg0->unk_4E); + if (D_80178234 != 0xA) { + D_80161AA0[arg0->unk_4E]++; + } + } + if (arg0->unk_48 == 1) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800690D0.s") +void func_80067BEC(Object_6C* arg0) { + func_80066EF0(arg0); + func_800671D0(arg0); + if (arg0->unk_46 == 0) { + switch (arg0->obj.id) { + case 0x147: + arg0->unk_68 = 18.0f; + if (arg0->unk_4C != 0) { + arg0->unk_4A = 0x32; + arg0->unk_46 = 1; + arg0->unk_48 = 0x14; + arg0->unk_50 = 60.0f; + D_80177DA0[arg0->unk_4E]++; + func_80060F30(D_80178280[arg0->unk_4E].unk_460, 0x49002005, arg0->unk_4E); + func_80060F30(D_80178280[arg0->unk_4E].unk_460, 0x49002006, arg0->unk_4E); + } + break; + case 0x142: + arg0->unk_68 = 18.0f; + if (arg0->unk_4C != 0) { + arg0->unk_4A = 50; + arg0->unk_46 = 1; + arg0->unk_48 = 20; + arg0->unk_50 = 60.0f; + D_80161AA8[arg0->unk_4E]++; + if (D_80161AA8[arg0->unk_4E] >= 3) { + D_80161AA8[arg0->unk_4E] = 2; + } + func_80060F30(D_80178280[arg0->unk_4E].unk_460, 0x49002004, arg0->unk_4E); + if (D_801779F8 != 0) { + D_80177D10[arg0->unk_4E] = D_80177D28[arg0->unk_4E] = 10; + } else { + D_80177D10[arg0->unk_4E] = D_80177D28[arg0->unk_4E] = 60; + } + D_80177D40[arg0->unk_4E] = 1030; + D_80177D58[arg0->unk_4E] = 1030; + } + break; + } + } else { + func_8009BC2C(&arg0->unk_68, 2.5f, 1.0f, 0.5f, 0.0f); + arg0->obj.pos.x += (D_80178280[arg0->unk_4E].unk_074 - arg0->obj.pos.x) * 0.5f; + if (D_80178280[arg0->unk_4E].unk_1CC == 1) { + arg0->obj.pos.y += ((D_80178280[arg0->unk_4E].unk_078 + 50.0f) - arg0->obj.pos.y) * 0.5f; + } else { + arg0->obj.pos.y += (D_80178280[arg0->unk_4E].unk_078 - arg0->obj.pos.y) * 0.5f; + } + arg0->obj.pos.z += (D_80178280[arg0->unk_4E].unk_138 - arg0->obj.pos.z) * 0.5f; + if (arg0->unk_48 == 0) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800693E8.s") +void func_80067F6C(Object_6C* arg0) { + if ((D_801778E8 == 0) && ((D_80178280[0].unk_49D < 2) || (D_80178280[0].unk_49C < 2))) { + arg0->obj.id = 337; + func_800612B8(&arg0->unk_1C, arg0->obj.id); + arg0->unk_48 = 2000; + func_80019218(0x1900302B, arg0->unk_5C, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } else { + func_80067BEC(arg0); + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069658.s") +void func_80068020(Object_6C* arg0) { + Vec3f sp4C; + Vec3f sp40; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800696F8.s") + switch (arg0->unk_46) { + case 0: + func_8009BC2C(&arg0->unk_68, 0.4f, 1.0f, 0.05f, 0.0f); + func_80066EF0(arg0); + func_800671D0(arg0); + if (arg0->unk_4C != 0) { + arg0->unk_46 = 1; + arg0->unk_48 = 0x32; + if (arg0->obj.id == 0x144) { + D_80178280[arg0->unk_4E].unk_26C += 0x20; + func_80060F30(D_80178280[arg0->unk_4E].unk_460, 0x4900200E, arg0->unk_4E); + } else if (arg0->obj.id == 0x150) { + D_80161A90[0]++; + if (D_80161A90[0] == 3) { + func_80060F30(D_80178280[arg0->unk_4E].unk_460, 0x49008015, arg0->unk_4E); + } else if (D_80161A90[0] == 6) { + func_80060F30(D_80178280[arg0->unk_4E].unk_460, 0x4900C024, arg0->unk_4E); + if (D_80178234 != 0xA) { + D_80161AA0[arg0->unk_4E]++; + } + D_80178280[arg0->unk_4E].unk_26C += 0x20; + func_80077240(D_80178280[arg0->unk_4E].unk_074, D_80178280[arg0->unk_4E].unk_078, + D_80178280[arg0->unk_4E].unk_138, 0x65); + } else { + D_80178280[arg0->unk_4E].unk_26C += 0x20; + func_80060F30(D_80178280[arg0->unk_4E].unk_460, 0x49003013, arg0->unk_4E); + } + } else { + D_80178280[arg0->unk_4E].unk_26C += 0x80; + func_80060F30(D_80178280[arg0->unk_4E].unk_460, 0x4900200D, arg0->unk_4E); + } + } + if ((arg0->obj.id == 0x150) && (arg0->unk_48 == 1)) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + } + break; + case 1: + if (arg0->unk_48 >= 0x1F) { + func_8009BC2C(&arg0->unk_68, 1.0f, 1.0f, 0.06f, 0.0f); + } else { + func_8009BC2C(&arg0->unk_68, 0.0f, 1.0f, 0.06f, 0.0f); + } + arg0->obj.pos.x += (D_80178280[arg0->unk_4E].unk_074 - arg0->obj.pos.x) * 0.5f; + if (D_80178280[arg0->unk_4E].unk_1CC == 1) { + arg0->obj.pos.y += (D_80178280[arg0->unk_4E].unk_078 + 50.0f - arg0->obj.pos.y) * 0.5f; + } else { + arg0->obj.pos.y += (D_80178280[arg0->unk_4E].unk_078 - arg0->obj.pos.y) * 0.5f; + } + if ((D_80178280[0].unk_238 != 0) && (D_80177880 == 0)) { + arg0->obj.pos.z += (D_80178280[arg0->unk_4E].unk_138 - 300.0f - arg0->obj.pos.z) * 0.3f; + } else { + arg0->obj.pos.z += (D_80178280[arg0->unk_4E].unk_138 - arg0->obj.pos.z) * 0.5f; + } + arg0->obj.rot.z += 22.0f; + func_8009BD38(&arg0->obj.rot.y, func_8009F768(-D_80178280[arg0->unk_4E].unk_058), 0.2f, 10.0f, 0.0f); + if (arg0->unk_48 == 0) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + } + if (arg0->unk_68 > 0.3f) { + Matrix_RotateY(D_8013BBC8, arg0->obj.rot.y * 0.017453292f, 0); + Matrix_RotateZ(D_8013BBC8, D_80177DB0 * 37.0f * 0.017453292f, 1); + sp4C.x = 0.0f; + sp4C.y = arg0->unk_68 * 100.0f; + sp4C.z = 0.0f; + Matrix_MultVec3fNoTranslate(D_8013BBC8, &sp4C, &sp40); + func_80078E50(arg0->obj.pos.x + sp40.x, arg0->obj.pos.y + sp40.y, arg0->obj.pos.z + sp40.z, 3.5f); + } + break; + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069858.s") +void func_800685D8(Object_6C* arg0) { + func_80068020(arg0); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069924.s") +void func_800685F8(Object_6C* arg0) { + func_80068020(arg0); +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069A10.s") +void func_80068618(Object_6C* arg0) { + func_80066EF0(arg0); + func_800671D0(arg0); + if (arg0->unk_4C != 0) { + func_80067A40(); + func_80060FBC(&arg0->obj, arg0->unk_5C); + } + if (arg0->unk_48 == 1) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069AAC.s") +void func_80068688(Object_6C* arg0) { + func_80066EF0(arg0); + if (arg0->unk_46 > 0) { + if (arg0->unk_46 == 1) { + arg0->obj.rot.z -= 10.0f; + arg0->obj.pos.x += (D_80178280[arg0->unk_4E].unk_074 - arg0->obj.pos.x) * 0.3f; + arg0->obj.pos.y += (D_80178280[arg0->unk_4E].unk_078 - arg0->obj.pos.y) * 0.3f; + arg0->obj.pos.z += (D_80178280[arg0->unk_4E].unk_138 - arg0->obj.pos.z) * 0.3f; + arg0->unk_68 -= 5.0f; + if (arg0->unk_68 < 0.0f) { + arg0->unk_68 = 0.0f; + } + } + arg0->unk_44 -= 10; + if (arg0->unk_44 < 0) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + } + } else { + arg0->unk_68 = 100.0f; + if (D_80177E80 < 0) { + arg0->unk_46 = 2; + arg0->unk_44 = 0xFF; + } else if (arg0->unk_4C != 0) { + arg0->unk_46 = 1; + arg0->unk_44 = 0xFF; + D_80178280[arg0->unk_4E].unk_27C = 100; + func_80019218(D_800CFF54[D_80177E80], D_80178280[0].unk_460, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + if (D_80177E80 == 0) { + D_80178280[0].unk_110 = 0.0f; + } + D_80177E80++; + if (D_80177E80 >= 7) { + D_80178280[0].unk_1C8 = 8; + D_80178280[0].unk_1D0 = 0; + func_80019218(0x1900602A, D_800C5D28, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + D_80177930 = 2; + D_800D3180[D_80178234] = 1; + } + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069CBC.s") +void func_80068914(Object_6C* arg0) { + s32 i; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069DF4.s") + func_80066EF0(arg0); + arg0->unk_58 -= arg0->unk_44; + if (arg0->unk_46 > 0) { + arg0->unk_44++; + arg0->obj.pos.x += (D_80178280[arg0->unk_4E].unk_074 - arg0->obj.pos.x) * 0.3f; + if (D_80178280[arg0->unk_4E].unk_1CC == 1) { + arg0->obj.pos.y += (D_80178280[arg0->unk_4E].unk_078 + 50.0f - arg0->obj.pos.y) * 0.3f; + } else { + arg0->obj.pos.y += (D_80178280[arg0->unk_4E].unk_078 - arg0->obj.pos.y) * 0.3f; + } + if (D_80178280[0].unk_238 != 0) { + arg0->obj.pos.z += (D_80178280[arg0->unk_4E].unk_138 - 200.0f - arg0->obj.pos.z) * 0.3f; + } else { + arg0->obj.pos.z += (D_80178280[arg0->unk_4E].unk_138 - 100.0f - arg0->obj.pos.z) * 0.3f; + } + if (arg0->unk_48 == 0) { + func_8009BC2C(&arg0->unk_68, 5.0f, 0.2f, 15.0f, 0.01f); + func_8009BC2C(&arg0->unk_50, 0.0f, 0.1f, 0.03f, 0.0f); + func_8009BC2C(&arg0->unk_54, 4.0f, 0.1f, 0.2f, 0.01f); + } + if (arg0->unk_68 <= 6.5f) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + } + } else { + arg0->unk_44 = 2; + arg0->unk_50 = 1.0f; + arg0->unk_54 = 1.0f; + arg0->unk_68 = 100.0f; + if (arg0->unk_4C != 0) { + D_80178280[arg0->unk_4E].unk_26C = 0x80; + arg0->unk_46++; + arg0->unk_48 = 15; + D_80161A8C = D_80161A88; + D_80177CB0 = -arg0->obj.pos.z; + D_80177CB0 -= 250.0f; + D_80177CA0 = D_80177DC8; + D_80161A50 = D_80161684; + D_80161A9C = D_80161A98; + for (i = 1; i < 4; i++) { + D_801778D0[i] = D_801778B0[i]; + } + func_80019218(0x4900400F, D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069E88.s") +void func_80068C48(Object_6C* arg0) { + if (arg0->unk_4C != 0) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + D_80177E80++; + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069F30.s") +void func_80068C88(Object_6C* arg0) { + D_80161680 = arg0->obj.id; + if (D_80178280[0].unk_1C8 != 3) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + } else if (((D_80178234 == 1) || (D_80178234 == 2)) && (D_8017827C == 1)) { + D_80178280[0].unk_1C8 = 7; + D_80178280[0].unk_1D0 = 0; + func_80060FBC(&arg0->obj, arg0->unk_5C); + } else if (D_80178234 == 0xA) { + D_80178280[0].unk_1C8 = 9; + D_80178280[0].unk_1D0 = 0; + func_80060FBC(&arg0->obj, arg0->unk_5C); + } else if (arg0->unk_46 == 0) { + if (((arg0->obj.pos.z + D_80177D20) > -2700.0f) && (fabsf(arg0->obj.pos.x - D_80178280[0].unk_074) < 1000.0f)) { + switch (arg0->obj.id) { + case 0x14B: + case 0x14C: + case 0x14D: + break; + case 0x148: + D_80178280[0].unk_228 = 0x30; + break; + case 0x149: + D_80178280[0].unk_228 = 0x20; + break; + case 0x14A: + D_80178280[0].unk_228 = 0x10; + break; + } + } + if (arg0->unk_4C != 0) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + D_80178280[0].unk_0B4 = 0.0f; + D_80178280[0].unk_210 = arg0->unk_68 * 0.05f; + switch (arg0->obj.id) { + case 0x148: + if (arg0->obj.pos.x < D_80178280[0].unk_074) { + D_80178280[0].unk_118 = -30.0f; + D_80178280[0].unk_0B8 = D_80178280[0].unk_0AC + arg0->unk_68; + } else { + D_80178280[0].unk_118 = 30.0f; + D_80178280[0].unk_0B8 = D_80178280[0].unk_0AC - arg0->unk_68; + } + break; + case 0x149: + D_80178280[0].unk_118 = 30.0f; + D_80178280[0].unk_0B8 = D_80178280[0].unk_0AC - arg0->unk_68; + break; + case 0x14A: + D_80178280[0].unk_118 = -30.0f; + D_80178280[0].unk_0B8 = D_80178280[0].unk_0AC + arg0->unk_68; + break; + case 0x14B: + if (arg0->obj.pos.y < D_80178280[0].unk_078) { + D_80178280[0].unk_124 = 30.0f; + D_80178280[0].unk_0BC = D_80178280[0].unk_0B0 + arg0->unk_68; + } else { + D_80178280[0].unk_124 = -30.0f; + D_80178280[0].unk_0BC = D_80178280[0].unk_0B0 - arg0->unk_68; + } + break; + case 0x14C: + D_80178280[0].unk_124 = 30.0f; + D_80178280[0].unk_0BC = D_80178280[0].unk_0B0 + arg0->unk_68; + break; + case 0x14D: + D_80178280[0].unk_124 = -30.0f; + D_80178280[0].unk_0BC = D_80178280[0].unk_0B0 - arg0->unk_68; + break; + } + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069FD4.s") +void func_80068FE0(Object_4C* arg0) { + arg0->obj.rot.y = (Math_Atan2F(D_80178280[0].unk_40.x - arg0->obj.pos.x, + D_80178280[0].unk_40.z - (arg0->obj.pos.z + D_80177D20)) * + 180.0f) / + 3.1415927f; + if (arg0->unk_46 != 0) { + arg0->obj.status = 0; + func_8007A6F0(&arg0->obj.pos, 0x1903400F); + switch (arg0->obj.id) { + case 0xA1: + func_8007D074(arg0->obj.pos.x, arg0->obj.pos.y + 160.0f, arg0->obj.pos.z, 4.0f); + break; + default: + case 0xA9: + func_8007D074(arg0->obj.pos.x, arg0->obj.pos.y + 96.0f, arg0->obj.pos.z, 5.0f); + break; + } + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_8006A06C.s") +void func_800690D0(s32 arg0, s32 arg1) { + switch (arg1) { + case 0xC8: + func_8007717C(&D_80163FE0[arg0], arg1); + break; + case 0xC5: + if (D_80178234 == 9) { + func_E9F1D0_801888F4(&D_80163FE0[arg0], arg1); + } else { + func_800763A4(&D_80163FE0[arg0], arg1); + } + break; + case 0xCA: + func_800763A4(&D_80163FE0[arg0], arg1); + break; + case 0xC2: + func_8006B0A0(&D_80163FE0[arg0], arg1); + break; + case 0xBA: + func_E08400_80187B08(&D_80163FE0[arg0], arg1); + break; + case 0xB5: + func_80060FBC(&D_80163FE0[arg0].obj, D_80163FE0[arg0].unk_100); + func_8007D2C8(D_80163FE0[arg0].obj.pos.x, D_80163FE0[arg0].obj.pos.y, D_80163FE0[arg0].obj.pos.z, 20.0f); + break; + case 0xB6: + func_80060FBC(&D_80163FE0[arg0].obj, D_80163FE0[arg0].unk_100); + func_8007D2C8(D_80163FE0[arg0].obj.pos.x, D_80163FE0[arg0].obj.pos.y, D_80163FE0[arg0].obj.pos.z, 10.0f); + func_80066254(&D_80163FE0[arg0]); + break; + case 0xC0: + func_8006684C(&D_80163FE0[arg0]); + break; + case 0x132: + func_E6A810_801990DC(&D_8016F110[arg0], arg1); + break; + case 0xE8: + func_E6A810_8018B720(&D_80163FE0[arg0], arg1); + break; + case 0x13F: + func_E51970_80198594(&D_8016F110[arg0], arg1); + break; + } +} -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_8006A38C.s") +void func_800693E8(Object_2F4* arg0) { + arg0->obj.pos.x += arg0->unk_0E8; + arg0->obj.pos.z += arg0->unk_0F0; + arg0->obj.pos.y += arg0->unk_0EC; + arg0->unk_0EC -= arg0->unk_10C; + if ((D_80161AB8 != 0) && (arg0->obj.id != 0xC6) && ((D_80178234 != 0xB) || (arg0->obj.id == 0xC8))) { + f32 var_fv0 = 4000.0f; -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_8006A3E8.s") + if ((arg0->obj.id == 0xEC) || (D_80178234 == 0xB) || ((arg0->obj.id == 0xC8) && (arg0->unk_0B4 == 0x38))) { + var_fv0 = 8000.0f; + } else if (D_80178280[0].unk_1C8 == 8) { + var_fv0 = 100000.0f; + } + if (((D_80178280[0].unk_40.z + arg0->unk_01C.unk_10) < (arg0->obj.pos.z + D_80177D20)) || + ((arg0->obj.pos.z + D_80177D20) < -15000.0f) || (arg0->obj.pos.y < (D_80178280[0].unk_0B0 - var_fv0)) || + ((D_80178280[0].unk_0B0 + var_fv0) < arg0->obj.pos.y) || + ((D_80178280[0].unk_0AC + var_fv0) < arg0->obj.pos.x) || + (arg0->obj.pos.x < (D_80178280[0].unk_0AC - var_fv0))) { + func_80060FBC(&arg0->obj, arg0->unk_100); + switch (arg0->obj.id) { /* irregular */ + case 0xEC: + D_801784A4 = 0; + break; + case 0xE5: + func_E6A810_8018E3B0(arg0); + break; + case 0xC2: + D_80176550[arg0->unk_46] = 0; + break; + case 0xC8: + if ((arg0->unk_0B4 >= 0xC8) && (arg0->unk_0B4 < 0x12C)) { + D_80176550[arg0->unk_46] = 0; + } else if ((arg0->unk_0B4 == 0x26) && (arg0->unk_46 != 2)) { + D_80177E80 = -1; + } + break; + case 0xFC: + D_80161684 = 1; + break; + } + } + } +} + +// #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_800693E8.s") + +void func_80069658(Object_408* arg0) { + arg0->obj.pos.x += arg0->unk_6C; + arg0->obj.pos.y += arg0->unk_70; + arg0->obj.pos.z += arg0->unk_74; + arg0->unk_70 -= arg0->unk_84; + if ((D_80161AB8 != 0) && ((arg0->obj.pos.z + D_80177D20) > (arg0->unk_01C.unk_10 - D_80178280[0].unk_40.z))) { + if (D_80178280[0].unk_40.z) {} // fake + func_80060FBC(&arg0->obj, &arg0->unk_3FC); + } +} + +void func_800696F8(Object_80* arg0) { + if (D_80178280[0].unk_1C8 == 2) { + arg0->obj.pos.z += arg0->unk_60; + if (arg0->unk_1C.unk_10 < arg0->obj.pos.z) { + func_80060FBC(&arg0->obj, &arg0->unk_70); + } + } else if ((D_80177880 == 0) && (D_80178284 != 2)) { + f32 temp_fv0 = fabsf(arg0->obj.pos.x - D_80178280[0].unk_40.x); + f32 var_fa0 = 500.0f; + + if ((arg0->obj.id == 6) || (arg0->obj.id == 7)) { + var_fa0 = 1000.0f; + } + temp_fv0 = ((var_fa0 > temp_fv0) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f); + if ((fabsf(D_80178280[0].unk_114) > 1.0f) || (D_80178234 == 0xB)) { + temp_fv0 = 0.0f; + } + temp_fv0 -= D_80178280[0].unk_40.z; + if ((arg0->unk_1C.unk_10 - temp_fv0) < (arg0->obj.pos.z + D_80177D20)) { + func_80060FBC(&arg0->obj, &arg0->unk_70); + } + } +} + +void func_80069858(Object_4C* arg0) { + if (D_80161AB8 != 0) { + f32 temp_fv0 = fabsf(arg0->obj.pos.x - D_80178280[0].unk_40.x); + f32 var_fa0 = 500.0f; + + if (((arg0->obj.id == 0xA4) && ((arg0->unk_45 == 6) || (arg0->unk_45 == 7))) || (arg0->obj.id == 8)) { + var_fa0 = 1000.0f; + } + temp_fv0 = ((var_fa0 > temp_fv0) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f); + temp_fv0 -= D_80178280[0].unk_40.z; + if ((arg0->unk_1C.unk_10 - temp_fv0) < (arg0->obj.pos.z + D_80177D20)) { + arg0->obj.status = 0; + } + } +} + +// #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069858.s") + +// #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069924.s") + +void func_80069924(Object_8C* arg0) { + arg0->obj.pos.x += arg0->unk_54; + arg0->obj.pos.y += arg0->unk_58; + arg0->obj.pos.z += arg0->unk_5C; + if (D_80161AB8 != 0) { + if ((D_80178280[0].unk_40.z + arg0->unk_1C.unk_10) < (arg0->obj.pos.z + D_80177D20)) { + func_80060FBC(&arg0->obj, arg0->unk_80); + } else if ((fabsf(arg0->obj.pos.y - D_80178280[0].unk_40.y) > 25000.0f) || + (fabsf(arg0->obj.pos.x - D_80178280[0].unk_40.x) > 25000.0f)) { + func_80060FBC(&arg0->obj, arg0->unk_80); + } + } +} + +void func_80069A10(Object_6C* arg0) { + if (D_80161AB8 != 0) { + f32 temp = (0.0f - D_80178280[0].unk_40.z); + + if ((arg0->unk_1C.unk_10 - temp) < (arg0->obj.pos.z + D_80177D20)) { + func_80060FBC(&arg0->obj, arg0->unk_5C); + if ((arg0->obj.id == 326) && (arg0->unk_46 == 0)) { + D_80177E80 = -1; + } + } + } +} + +// #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/func_80069A10.s") + +void func_80069AAC(Object_2F4* arg0) { + s32 i; + + if (arg0->unk_0BC != 0) { + arg0->unk_0BC--; + } + if (arg0->unk_0BE != 0) { + arg0->unk_0BE--; + } + if (arg0->unk_0C0 != 0) { + arg0->unk_0C0--; + } + if (arg0->unk_0C2 != 0) { + arg0->unk_0C2--; + } + if (arg0->unk_0C6 != 0) { + arg0->unk_0C6--; + } + if (D_801778E8 != 0) { + for (i = 0; i < D_801778A8; i++) { + if (arg0->unk_0CA[i] != 0) { + if (!(D_800DD880[i].button & 0x8000)) { + arg0->unk_0CA[i]--; + } + D_801779C8[i] = 0; + } + } + } else if (arg0->unk_0CA[0] != 0) { + if (!(D_800DD880[D_80177AF8].button & 0x8000)) { + arg0->unk_0CA[0]--; + } + D_801779C8[0] = 0; + } + if (arg0->unk_0C4 != 0) { + arg0->unk_0C4--; + } + switch (arg0->obj.status) { + case 1: + arg0->obj.status = 2; + func_80063F90(arg0->unk_040, arg0->obj.id); + if (arg0->obj.id != 0xFC) { + func_800693E8(arg0); + } + break; + case 2: + func_800693E8(arg0); + if ((arg0->obj.status != 0) && (arg0->unk_01C.unk_8 != NULL)) { + arg0->unk_01C.unk_8(&arg0->obj); + } + break; + case 3: + func_800693E8(arg0); + if (arg0->obj.status != 0) { + func_800690D0(arg0->unk_040, arg0->obj.id); + } + break; + } +} + +void func_80069CBC(Object_408* arg0) { + if (arg0->unk_050 != 0) { + arg0->unk_050--; + } + if (arg0->unk_052 != 0) { + arg0->unk_052--; + } + if (arg0->unk_054 != 0) { + arg0->unk_054--; + } + if (arg0->unk_056 != 0) { + arg0->unk_056--; + } + if (arg0->unk_058 != 0) { + arg0->unk_058--; + } + if (arg0->unk_05A != 0) { + arg0->unk_05A--; + } + if (arg0->unk_05C != 0) { + arg0->unk_05C--; + } + switch (arg0->obj.status) { + case 1: + arg0->obj.status = 2; + func_80063F90(arg0->unk_40, arg0->obj.id); + func_80069658(arg0); + break; + case 2: + func_80069658(arg0); + if ((arg0->obj.status != 0) && (arg0->unk_01C.unk_8 != NULL)) { + arg0->unk_01C.unk_8(&arg0->obj); + } + break; + case 3: + func_80069658(arg0); + if (arg0->obj.status != 0) { + func_800690D0(arg0->unk_40, arg0->obj.id); + } + break; + } +} + +void func_80069DF4(Object_80* arg0) { + if (arg0->unk_4C != 0) { + arg0->unk_4C--; + } + switch (arg0->obj.status) { + case 1: + arg0->obj.status = 2; + func_80063F90(arg0->unk_40, arg0->obj.id); + func_800696F8(arg0); + break; + case 2: + func_800696F8(arg0); + if (arg0->unk_1C.unk_8 != NULL) { + arg0->unk_1C.unk_8(&arg0->obj); + } + break; + } +} + +void func_80069E88(Object_4C* arg0) { + switch (arg0->obj.status) { + case 1: + arg0->obj.status = 2; + func_80063F90(arg0->unk_40, (s32) arg0->obj.id); + func_80069858(arg0); + break; + case 2: + func_80069858(arg0); + if (arg0->unk_1C.unk_8 != NULL) { + arg0->unk_1C.unk_8(&arg0->obj); + } + break; + case 3: + func_80069858(arg0); + func_800690D0(arg0->unk_40, arg0->obj.id); + break; + } +} + +void func_80069F30(Object_6C* arg0) { + if (arg0->unk_48 != 0) { + arg0->unk_48--; + } + if (arg0->unk_4A != 0) { + arg0->unk_4A--; + } + switch (arg0->obj.status) { + case 1: + arg0->obj.status = 2; + func_80063F90(arg0->unk_40, (s32) arg0->obj.id); + func_80069A10(arg0); + break; + case 2: + func_80069A10(arg0); + if (arg0->unk_1C.unk_8 != NULL) { + arg0->unk_1C.unk_8(&arg0->obj); + } + break; + } +} + +void func_80069FD4(Object_8C* arg0) { + if (arg0->unk_50 != 0) { + arg0->unk_50--; + } + switch (arg0->obj.status) { + case 1: + arg0->obj.status = 2; + func_80063F90(arg0->unk_40, arg0->obj.id); + /* fallthrough */ + case 2: + func_80069924(arg0); + if ((arg0->obj.status != 0) && (arg0->unk_1C.unk_8 != NULL)) { + arg0->unk_1C.unk_8(&arg0->obj); + } + break; + } +} + +void func_8006A06C(UnkStruct_D_80174750* arg0) { + Vec3f sp44; + Vec3f sp38; + f32 sp34; + f32 sp30; + f32 sp2C; + + if (arg0->unk_02 != 0) { + arg0->unk_02--; + } + sp34 = arg0->unk_04 - arg0->unk_10; + sp30 = arg0->unk_08 - arg0->unk_14; + sp2C = arg0->unk_0C - arg0->unk_18; + arg0->unk_20 = Math_Atan2F(sp34, sp2C); + arg0->unk_1C = -Math_Atan2F(sp30, sqrtf(SQ(sp34) + SQ(sp2C))); + if (arg0->unk_00 != 4) { + arg0->unk_24 = sqrtf(SQ(sp34) + SQ(sp30) + SQ(sp2C)); + } + if (D_80177834 == 7) { + if (((arg0->unk_00 == 1) || (arg0->unk_00 == 0x65) || (arg0->unk_00 == 0x32)) && (D_80178280[0].unk_1C8 == 3) && + (D_80178280[0].unk_1F4 == 0)) { + Matrix_RotateX(D_8013BBC8, -arg0->unk_1C, 0); + Matrix_RotateY(D_8013BBC8, -arg0->unk_20, 1); + sp44.x = D_80178280[D_801778A0].unk_074 - arg0->unk_04; + sp44.y = D_80178280[D_801778A0].unk_078 - arg0->unk_08; + sp44.z = D_80178280[D_801778A0].unk_138 - arg0->unk_0C; + Matrix_MultVec3fNoTranslate(D_8013BBC8, &sp44, &sp38); + sp38.x += arg0->unk_04; + sp38.y += arg0->unk_08; + sp38.z += arg0->unk_0C; + if ((fabsf(sp38.x - arg0->unk_04) < 30.0f) && (fabsf(sp38.y - arg0->unk_08) < 30.0f) && + (sp38.z < arg0->unk_0C) && ((arg0->unk_0C - arg0->unk_24) < sp38.z)) { + if (D_80178234 == 0xD) { + func_800A6CD0(D_80178280, 0, 30); + } else { + func_800A6CD0(D_80178280, 0, 20); + } + if (arg0->unk_00 < 100) { + arg0->unk_00 = 0; + } + } + } + if (((arg0->unk_0C + D_80177D20) > 1000.0f) && (D_80177880 != 1)) { + arg0->unk_00 = 0; + } + if (((arg0->unk_00 == 3) || (arg0->unk_00 == 0x32)) && (arg0->unk_02 == 0)) { + arg0->unk_00 = 0; + } + } +} + +void func_8006A38C(void) { + UnkStruct_D_80174750* var_s0; + s32 var_s1; + + for (var_s1 = 0, var_s0 = D_80174750; var_s1 < ARRAY_COUNT(D_80174750); var_s1++, var_s0++) { + if (var_s0->unk_00 != 0) { + func_8006A06C(var_s0); + } + } +} + +void func_8006A3E8(void) { + s32 i; + s32 pad; + Object_58* var_v0; + Object_2F4* sp38; + Object_408* sp34; + Object_4C* sp30; + Object_80* sp2C; + Object_6C* sp28; + Object_8C* sp24; + + D_80161AB8 = 0; + if ((D_80177880 == 0) && + ((D_80178280[0].unk_1C8 == 1) || (D_80178280[0].unk_1C8 == 3) || (D_80178280[0].unk_1C8 == 4) || + (D_80178280[0].unk_1C8 == 8) || (D_80178280[0].unk_1C8 == 9) || (D_80178280[0].unk_1C8 == 6))) { + D_80161AB8 = 1; + } + if (D_80177880 != 1) { + if ((D_80178488 != 0) && (D_80178280[0].unk_1C8 != 2)) { + func_80062664(); + } + for (i = 0, sp2C = D_80161B00; i < ARRAY_COUNT(D_80161B00); i++, sp2C++) { + if (sp2C->obj.status != 0) { + sp2C->unk_40 = i; + func_80069DF4(sp2C); + } + } + } else if (D_801778E8 != 0) { + for (i = 0, var_v0 = D_801782A8; i < 200; i++, var_v0++) { + if ((var_v0->obj.status != 0) && (var_v0->obj.id == 0x92)) { + if (i & 1) { + var_v0->obj.rot.y += 0.5f; + } else { + var_v0->obj.rot.y -= 0.5f; + } + } + } + } + for (i = 0, sp30 = D_80163400; i < ARRAY_COUNT(D_80163400); i++, sp30++) { + if (sp30->obj.status != 0) { + sp30->unk_40 = i; + func_80069E88(sp30); + } + } + for (i = 0, sp34 = D_8016F110; i < ARRAY_COUNT(D_8016F110); i++, sp34++) { + if (sp34->obj.status != 0) { + sp34->unk_40 = i; + func_80069CBC(sp34); + } + } + for (i = 0, sp38 = D_80163FE0; i < ARRAY_COUNT(D_80163FE0); i++, sp38++) { + if (sp38->obj.status != 0) { + sp38->unk_040 = i; + func_80069AAC(sp38); + } + } + for (i = 0, sp28 = D_801737E0; i < ARRAY_COUNT(D_801737E0); i++, sp28++) { + if (sp28->obj.status != 0) { + sp28->unk_40 = i; + func_80069F30(sp28); + } + } + for (i = 0, sp24 = D_80170130; i < ARRAY_COUNT(D_80170130); i++, sp24++) { + if (sp24->obj.status != 0) { + sp24->unk_40 = i; + func_80069FD4(sp24); + } + } + func_8006A38C(); + for (i = 0; i < ARRAY_COUNT(D_80161670); i++) { + if (D_80161670[i] != 0) { + D_80161670[i]--; + } + } +} #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_61B30/D_800D63D0.s") diff --git a/src/main/sf_A24B0.c b/src/main/sf_A24B0.c index 46f62663..ab6f62a7 100644 --- a/src/main/sf_A24B0.c +++ b/src/main/sf_A24B0.c @@ -9,7 +9,7 @@ void func_800A18B0(void) { func_80006F20(); Rand_Init(); Rand_SetSeed(1, 29000, 9876); - D_80177834 = 0x64; + D_80177834 = 100; D_8017783C = 0; D_80161A36 = 0; D_80161A38 = 0xFF; @@ -17,7 +17,7 @@ void func_800A18B0(void) { D_80161A40 = 10.0f; D_80161A44 = 12800.0f; D_80161A10 = D_80161A14 = 0.0f; - D_801774F8 = 0x63; + D_801774F8 = 99; D_80177820 = 0; func_80059498(); D_80161A39 = 1; @@ -289,7 +289,7 @@ void func_800A26C0(void) { func_800A25DC(); if (func_800A1B6C() != 1) { func_8000316C(&gUnkDisp1); - func_800A1FB0(&gUnkDisp1, D_801778AB, 0); + func_800A1FB0(&gUnkDisp1, D_801778A8, 0); if (D_8017783C != 0) { D_8017783C--; } @@ -435,9 +435,9 @@ void func_800A26C0(void) { } else if ((D_801778A8 == 4) && (D_80177898 != 0)) { func_800A1FB0(&gMasterDisp, D_801778A8, 3); func_800A24DC(3); - func_800A1FB0(&gMasterDisp, D_801778AB, 2); + func_800A1FB0(&gMasterDisp, D_801778A8, 2); func_800A24DC(2); - func_800A1FB0(&gMasterDisp, D_801778AB, 1); + func_800A1FB0(&gMasterDisp, D_801778A8, 1); func_800A24DC(1); gDPPipeSync(gMasterDisp++); gDPSetScissor(gMasterDisp++, G_SC_NON_INTERLACE, 8, 8, 312, 232); diff --git a/src/main/sf_hud.c b/src/main/sf_hud.c index a98961f9..bc49ee9c 100644 --- a/src/main/sf_hud.c +++ b/src/main/sf_hud.c @@ -1318,7 +1318,7 @@ void func_8008DE68(void) { f32 temp7; f32 var_fv0; - if ((D_80161734 == 1) && (D_801778B8 > 0)) { + if ((D_80161734 == 1) && (D_801778B0[2] > 0)) { if ((D_80177848 >= 0) && (D_801616BC == -1.0f)) { func_80019218(0x4900C028, D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); D_801616BC = 255.0f; diff --git a/src/overlays/ovl_DF4260/DFEE30.c b/src/overlays/ovl_DF4260/DFEE30.c index 72073603..095a0d9e 100644 --- a/src/overlays/ovl_DF4260/DFEE30.c +++ b/src/overlays/ovl_DF4260/DFEE30.c @@ -31,9 +31,9 @@ void func_DF4260_801924A8(UnkStruct_func_DF4260_801924A8* arg0) { #pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_DF4260/DFEE30/func_DF4260_80192AA4.s") -void func_DF4260_80192CB0(UnkStruct_func_DF4260_80192CB0* arg0) { - arg0->unk50 = arg0->unk10; - arg0->unk10 = 0.0f; +void func_DF4260_80192CB0(Object_2F4* arg0) { + arg0->unk_050 = arg0->obj.rot.x; + arg0->obj.rot.x = 0.0f; } #pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_DF4260/DFEE30/func_DF4260_80192CD4.s")