From 8101aa8bc23ccf7faf34423897094d54e8595b30 Mon Sep 17 00:00:00 2001 From: petrie911 <69443847+petrie911@users.noreply.github.com> Date: Tue, 19 Dec 2023 08:54:50 -0600 Subject: [PATCH] file splits, renames, more functions in play (#53) * stuff * three whole files * format * format and such * a switch in time * merge prep * nintendo switch * format * the great switch statement of our time * 43AC0 matched * stuff * Enums everywhere * oh god the switch * knakyo * new headers * format * fox * everyone hates recursion * format * one more thing * one more one more thing * renames * matches * matrix scale why * names and such * cleanup * name back * it just keeps going * they don't give up * splits * merge going poorly * I object --- include/functions.h | 182 +- include/hud.h | 8 +- include/sf64level.h | 2 +- include/sf64math.h | 5 + include/sf64object.h | 44 +- include/structs.h | 27 +- include/variables.h | 24 +- linker_scripts/us/symbol_addrs_engine.txt | 175 +- linker_scripts/us/symbol_addrs_nlib_vars.txt | 1 - src/main/fox_43AC0.c | 80 +- src/main/fox_6B3B0.c | 3686 +++++++++--------- src/main/fox_97F80.c | 4 + src/main/fox_A4290.c | 49 +- src/main/{fox_52730.c => fox_display.c} | 702 ++-- src/main/fox_edata.c | 6 +- src/main/fox_edata_1C.c | 10 +- src/main/fox_edisplay.c | 885 +++-- src/main/fox_enmy.c | 2738 +++++++------ src/main/fox_fade.c | 48 + src/main/{fox_A24B0.c => fox_game.c} | 28 +- src/main/fox_play.c | 3373 ++++++++++++++++ src/main/fox_radio.c | 6 +- src/main/sf_2EFE0.c | 60 +- src/main/sf_36930.c | 22 +- src/main/sf_3E6F0.c | 21 + src/main/sf_77E40.c | 936 ++--- src/main/{fox_84F70.c => sf_852F0.c} | 49 +- src/main/sf_A4B50.c | 1615 -------- src/main/sf_hud.c | 727 ++-- src/overlays/ovl_DF4260/DF4260.c | 2 +- src/overlays/ovl_DF4260/DFEE30.c | 6 +- yamls/us/main.yaml | 33 +- 32 files changed, 8763 insertions(+), 6791 deletions(-) rename src/main/{fox_52730.c => fox_display.c} (68%) create mode 100644 src/main/fox_fade.c rename src/main/{fox_A24B0.c => fox_game.c} (97%) create mode 100644 src/main/fox_play.c create mode 100644 src/main/sf_3E6F0.c rename src/main/{fox_84F70.c => sf_852F0.c} (73%) delete mode 100644 src/main/sf_A4B50.c diff --git a/include/functions.h b/include/functions.h index 852c6a35..bb7c4c5f 100644 --- a/include/functions.h +++ b/include/functions.h @@ -84,6 +84,8 @@ void RdRam_CheckIPL3(void); void Mio0_Decompress(void* header, u8* dst); s32 vsprintf(char* dst, const char* fmt, va_list args); + + // sf_2EFE0 void func_8002E3E0(Object_2F4*); void func_8002E548(void); @@ -97,13 +99,13 @@ void func_8002E6B8(Object_2F4*); void func_8002E6DC(Object_2F4*); void func_8002E700(Player *); void func_8002EE64(Object_2F4 *); -void func_8002F180(); +void func_8002F180(void); void func_8002F5F4(void); void func_800319AC(Object_2F4*); void func_80035448(Object_2F4*); //sf_36930 -void func_80035E48(Object_70 *); +void Object_70_Initialize(Object_70 *); void func_800365E4(f32, f32, f32, f32, f32, f32, f32, f32, f32, s32, s32); void func_8003D9B8(); void func_8003DA0C(void); @@ -137,10 +139,10 @@ void func_8004F8AC(Object_2F4*); void func_8004FEC0(Object_2F4*); void func_800515C4(void); -// fox_52730 +// fox_display void func_80053658(WingInfo *); void func_8005465C(s32); -void func_80057814(Player* arg0); +void func_80057814(Player*); void func_80057D00(void); // fox_edata @@ -187,13 +189,13 @@ void func_8005F670(Vec3f*); s32 func_8005F9DC(Vec3f*); // fox_enmy -void func_80060714(s32 arg0); -void func_8006089C(u8 arg0); +void func_80060714(s32 ); +void func_8006089C(u8 ); void func_80060968(void); -void func_80060F30(Vec3f* arg0, u32 arg1, s32 arg2); +void func_80060F30(Vec3f* , u32 , s32 ); void Object_Kill(Object*, Vec3f*); s32 func_80060FE4(Vec3f*, f32); -void func_800612B8(ObjectStruct_1C*, u32); +void Object_Set1C(ObjectStruct_1C*, u32); void Object_80_Initialize(Object_80*); void Object_4C_Initialize(Object_4C*); void Object_2F4_Initialize(Object_2F4*); @@ -202,14 +204,14 @@ void Object_6C_Initialize(Object_6C*); void Object_8C_Initialize(Object_8C*); 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); +void func_80061E48(Object_2F4* , f32 , f32 , f32 ); +void func_80061F0C(Object_2F4* , ObjectInit* , s32 ); +void Object_Spawn(ObjectInit* , f32 , f32 , f32 , f32 ); void func_80062568(void); void func_80062C38(f32, f32); s32 func_800631A8(Vec3f*, f32*, Vec3f*); -s32 func_8006326C(Vec3f* arg0, Vec3f* arg1, s32 arg2, Object* arg3); -s32 func_8006351C(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3); +s32 func_8006326C(Vec3f* , Vec3f* , s32 , Object* ); +s32 func_8006351C(s32 , Vec3f* , Vec3f* , s32 ); void func_800652CC(Object_80*); void func_800654E4(Object *); void func_800656D4(Object_2F4*); @@ -248,15 +250,15 @@ 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 Object_2F4_Update(Object_2F4*); +void Object_408_Update(Object_408 *); +void Object_80_Update(Object_80 *); +void Object_4C_Update(Object_4C *); +void Object_6C_Update(Object_6C *); +void Object_8C_Update(Object_8C *); void func_8006A06C(UnkEntity30*); void func_8006A38C(void); -void func_8006A3E8(void); +void Object_UpdateAll(void); //fox_6B3B0 void func_8006A96C(Object_2F4*); @@ -281,46 +283,46 @@ void func_800771CC(Object_2F4*); void func_80077218(Object_2F4*); // sf_77E40 -void func_80077240(f32 posX, f32 posY, f32 posZ, s32 arg3); +void func_80077240(f32 posX, f32 posY, f32 posZ, s32 ); void func_8007729C(void); void func_80077790(void); Object_8C* func_8007783C(s32 objId); -void func_8007797C(f32 posX, f32 posY, f32 posZ, f32 arg3, f32 arg4, f32 arg5, f32 arg6); -void func_80077A00(Object_8C* arg0); -void func_80077A7C(Object_8C* arg0); -void func_80077B78(void* arg0); -void func_80077B84(Object_8C* arg0); -void func_80078038(Object_8C* arg0); -void func_800780F8(Object_8C* arg0); -void func_800783C0(Object_8C* arg0); -void func_80078438(Object_8C* arg0); -void func_800784B4(Object_8C* arg0); -void func_80078550(Object_8C* arg0); -void func_80078604(Object_8C* arg0); -void func_8007868C(Object_8C* arg0); -void func_8007879C(Object_8C* arg0); -void func_800788B0(Object_8C* arg0); -void func_80078A64(Object_8C* arg0); -void func_80078AEC(Object_8C* arg0); -void func_80078B8C(Object_8C *arg0); -void func_80078BE0(Object_8C* arg0); -void func_80078C84(Object_8C* arg0); -void func_80078CE8(Object_8C* arg0); -void func_80078E50(f32 posX, f32 posY, f32 posZ, f32 arg3); -void func_80078EBC(Object_8C* arg0); -void func_80078F78(Object_8C* arg0); -void func_8007905C(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, u8 arg5); -void func_800794CC(f32 posX, f32 posY, f32 posZ, f32 arg3); -void func_8007953C(f32 posX, f32 posY, f32 posZ, f32 arg3); -void func_800795AC(f32 posX, f32 posY, f32 posZ, f32 arg3); -void func_80079618(f32 posX, f32 posY, f32 posZ, f32 arg3); -void func_8007968C(Object_8C *arg0); -s32 func_800798C4(s32 arg0, Gfx** arg1, Vec3f* arg2, Vec3f* arg3, void* arg4); //OverrideLimbDraw -void func_800798F0(Object_8C* arg0); -void func_8007A28C(Object_8C* arg0); -void func_8007A3C0(Object_8C* arg0); -void func_8007A568(f32 xPos, f32 yPos, f32 zPos, f32 arg3); -void func_8007A5F8(Object_8C* arg0, Vec3f* arg1, u32 arg2); +void func_8007797C(f32 posX, f32 posY, f32 posZ, f32 , f32 , f32 , f32 ); +void func_80077A00(Object_8C* ); +void func_80077A7C(Object_8C* ); +void func_80077B78(Object_8C* ); +void func_80077B84(Object_8C* ); +void func_80078038(Object_8C* ); +void func_800780F8(Object_8C* ); +void func_800783C0(Object_8C* ); +void func_80078438(Object_8C* ); +void func_800784B4(Object_8C* ); +void func_80078550(Object_8C* ); +void func_80078604(Object_8C* ); +void func_8007868C(Object_8C* ); +void func_8007879C(Object_8C* ); +void func_800788B0(Object_8C* ); +void func_80078A64(Object_8C* ); +void func_80078AEC(Object_8C* ); +void func_80078B8C(Object_8C *); +void func_80078BE0(Object_8C* ); +void func_80078C84(Object_8C* ); +void func_80078CE8(Object_8C* ); +void func_80078E50(f32 posX, f32 posY, f32 posZ, f32 ); +void func_80078EBC(Object_8C* ); +void func_80078F78(Object_8C* ); +void func_8007905C(Object_8C* , f32 posX, f32 posY, f32 posZ, f32 , u8 ); +void func_800794CC(f32 posX, f32 posY, f32 posZ, f32 ); +void func_8007953C(f32 posX, f32 posY, f32 posZ, f32 ); +void func_800795AC(f32 posX, f32 posY, f32 posZ, f32 ); +void func_80079618(f32 posX, f32 posY, f32 posZ, f32 ); +void func_8007968C(Object_8C *); +s32 func_800798C4(s32 , Gfx** , Vec3f* , Vec3f* , void* ); //OverrideLimbDraw +void func_800798F0(Object_8C* ); +void func_8007A28C(Object_8C* ); +void func_8007A3C0(Object_8C* ); +void func_8007A568(f32 xPos, f32 yPos, f32 zPos, f32 ); +void func_8007A5F8(Object_8C* , Vec3f* , u32 ); void func_8007A6F0(Vec3f *, u32); void func_8007A748(Object_8C*); s32 func_8007A774(Player*, Object_8C*, f32); @@ -330,20 +332,20 @@ void func_8007A994(Object_8C*); void func_8007AA60(Object_8C*); void func_8007AB50(Object_8C*); void func_8007ACE0(f32, f32, f32, f32, f32, f32); -void func_8007ADF4(f32 arg0, f32 posY, f32 arg2, f32 arg3, f32 arg4); -void func_8007AFD0(f32 posX, f32 posZ, f32 arg2, f32 arg3, f32 arg4); +void func_8007ADF4(f32 , f32 posY, f32 , f32 , f32 ); +void func_8007AFD0(f32 posX, f32 posZ, f32 , f32 , f32 ); void func_8007B040(Object_8C*); void func_8007B0F4(Object_8C*); -void func_8007B228(f32 posX, f32 posY, f32 posZ, f32 arg3); -void func_8007B344(f32 xPos, f32 yPos, f32 zPos, f32 arg3, s32 arg4); +void func_8007B228(f32 posX, f32 posY, f32 posZ, f32 ); +void func_8007B344(f32 xPos, f32 yPos, f32 zPos, f32 , s32 ); void func_8007B3B8(Object_8C*); -void func_8007B550(f32 posX, f32 posY, f32 posZ, f32 arg3, s32 arg4); +void func_8007B550(f32 posX, f32 posY, f32 posZ, f32 , s32 ); void func_8007B5C0(Object_8C*); void func_8007B62C(Object_8C*); void func_8007B670(Object_8C*); void func_8007B67C(Object_8C*); void func_8007B758(Object_8C*); -void func_8007B8F8(f32 posX, f32 posY, f32 posZ, f32 arg3); +void func_8007B8F8(f32 posX, f32 posY, f32 posZ, f32 ); void func_8007B960(Object_8C*); void func_8007BC7C(f32, f32, f32, f32); void func_8007BCE8(Object_8C*); @@ -356,7 +358,7 @@ void func_8007C120(f32, f32, f32, f32, f32, f32, f32, s32); void func_8007C250(Object_8C*); void func_8007C484(f32, f32, f32, f32, f32, f32, f32, s32); void func_8007C50C(Object_8C*); -void func_8007C688(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4); +void func_8007C688(f32 , f32 , f32 , f32 , s32 ); void func_8007C8C4(Object_8C*); void func_8007C9E0(Object_8C*); void func_8007CAF0(Object_8C*); @@ -383,9 +385,9 @@ void func_8007E3E4(Object_8C*); void func_8007E45C(Object_8C*); void func_8007E5CC(Object_8C*); void func_8007E648(Object_8C*); -void func_8007E93C(Object_8C *arg0, u16 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5); -void func_8007F04C(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32); // Object_Spawn? -void func_8007F20C(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4); +void func_8007E93C(Object_8C *, u16 , f32 , f32 , f32 , f32 ); +void func_8007F04C(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32); +void func_8007F20C(s32 , f32 , f32 , f32 , f32 ); void func_8007F438(Object_8C*); void func_8007F6B0(Object_8C*); void func_8007F958(Object_8C*); @@ -403,11 +405,11 @@ void func_80081C5C(Object_8C*); void func_80082F78(Object_8C*); void func_800837EC(Object_8C*); void func_80083B8C(Object_8C*); -void func_80083D2C(f32 arg0, f32 arg1, f32 arg2, f32 arg3); +void func_80083D2C(f32 , f32 , f32 , f32 ); void func_80083FA8(Object_8C*); void func_80084194(Object_8C*); -// fox_84F70 +// fox_fade void func_80084370(s32); void func_800843FC(s32); void func_80084488(s32); @@ -455,7 +457,7 @@ void func_80098860(Plane *plane, Vec3f *point, Vec3f *normal); s32 func_800988B4(Vec3f *vec, Plane *plane); s32 func_800998FC(Vec3f*, Vec3f*, Vec3f*, s32, Vec3f*, f32*); -// fox_A24B0 +// fox_game void Game_Initialize(void); void Game_SetGameState(void); bool func_800A1B6C(void); @@ -474,29 +476,30 @@ bool func_800A3690(Vec3f*, Vec3f*, s32, Vec3f*); // fox_A48A0 void func_800A3CA0(void); -// sf_A4B50 +// fox_play s32 Play_CheckMedalStatus(u16); s32 Play_GetMaxHealth(void); void func_800A5844(void); void func_800A5D6C(void); -void func_800A5FA0(Vec3f* arg0, u32 arg1, s32 arg2); +void func_800A5FA0(Vec3f* , u32 , s32 ); void func_800A6148(void); -void func_800A69F8(s32 arg0, f32 arg1, f32 arg2, f32 arg3); +void func_800A69F8(s32 , f32 , f32 , f32 ); void func_800A6CD0(Player *, s32, s32); -s32 func_800A73E4(f32* arg0, s32* arg1, f32 posX, f32 posY, f32 posZ); -s32 func_800A78C4(f32* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6); -void func_800ACDC0(Player *arg0, Object_70 *arg1, s32 arg2); -void func_800B0F50(Player *arg0); -void func_800B44C4(Player *arg0); -void func_800B5FBC(Player *arg0, s32 arg1, s32 arg2); +bool func_800A73E4(f32* , s32* , f32 posX, f32 posY, f32 posZ); +s32 func_800A78C4(f32* hitbox, f32 , f32 , f32 , f32 , f32 , f32 ); +void func_800A8BA4(Player* player); +void func_800AA800(Player *player); +void func_800ACDC0(Player *, Object_70 *, s32 ); +void func_800B0F50(Player *); +void func_800B44C4(Player *); +void func_800B5FBC(Player *, s32 , s32 ); void func_800B63BC(Player *, s32); -void func_800B6848(Player *arg0, s32 arg1); -void func_800B6BFC(Player *arg0, s32 arg1); +void func_800B6848(Player *, s32 ); +void func_800B6BFC(Player *, s32 ); void func_800B6F50(f32, f32, f32, f32, f32, f32); -void func_800B7184(Player *arg0, s32); +void func_800B7184(Player *, s32); void func_800B73E0(Player *); -s32 func_800A73E4(f32* arg0, s32* arg1, f32 posX, f32 posY, f32 posZ); -void func_800B852C(s32 arg0, Object_6C *arg1); +void func_800B852C(s32 , Object_6C *); void func_800B86CC(void); // fox_radio @@ -537,6 +540,7 @@ void func_E08400_80187B08(Object_2F4 *); void func_E08400_80188A40(Object_408 *); void func_E08400_8018CCF8(Object_2F4 *); +void func_E16C50_801A9824(void); void func_E16C50_801AC8A8(f32, f32, f32, f32, s32); void func_E16C50_8019E9F4(f32, f32, f32, f32, f32, f32, f32, s32); void func_E16C50_80187754(Object_408 *); @@ -564,7 +568,14 @@ void func_E16C50_80190430(Object_2F4 *); void func_E51970_80193CA4(Object_408 *); void func_E51970_80198594(Object_408 *); +void func_E51970_8019EA68(Object_58**); +void func_E51970_80198930(Object_58**); +void func_E51970_8018BA2C(Object_58**); +void func_E51970_80191ED8(Object_58**); +void func_E6A810_80188F30(void); +void func_E6A810_80199920(void); +void func_E6A810_801B5110(f32, f32, f32); void func_E6A810_8018769C(Object_2F4 *); void func_E6A810_80189B80(Object_2F4 *); void func_E6A810_8018ADC4(Object_2F4 *); @@ -590,6 +601,9 @@ void func_E6A810_801B58AC(Gfx **, f32); s32 func_E6A810_801B6AEC(f32, f32, f32); void func_E6A810_801B6E20(f32, f32, f32 *, f32 *, f32 *); +void func_E9F1D0_80196968(Object_58**); +void func_E9F1D0_801878A8(Object_58**); +void func_E9F1D0_801961AC(Object_58**); void func_E9F1D0_801A4CB0(Object_2F4*); void func_E9F1D0_801A3BD4(Object_2F4*); void func_E9F1D0_801888F4(Object_2F4 *); diff --git a/include/hud.h b/include/hud.h index 03b17705..bd335a4c 100644 --- a/include/hud.h +++ b/include/hud.h @@ -17,7 +17,7 @@ void func_80085944(void); void func_80086CC8(void); void func_80086DCC(void); void func_80087B5C(void); -void func_80089994(s32 arg0); +void func_80089994(s32); void func_8008A4DC(void); void func_8008B044(void); void func_8008B1B0(void); @@ -33,8 +33,8 @@ void func_8008D7F4(void); void func_8008D984(void); void func_8008DC34(void); void func_8008E5E8(void); -s32 func_80090E8C(Object_2F4* arg0); -s32 func_800910C0(Object_2F4* arg0); +s32 func_80090E8C(Object_2F4*); +s32 func_800910C0(Object_2F4*); // Weird addresses, assets maybe? extern u16 D_1000E80[]; @@ -68,7 +68,7 @@ extern s32 gHitCount; extern s32 D_80177838; extern s32 D_80177854; extern s32 D_80177880; -extern s32 D_801778B0[]; +extern s32 gTeamHealth[]; extern s32 D_801778BC; extern s32 D_801778E8; extern s32 D_80177B48; diff --git a/include/sf64level.h b/include/sf64level.h index 5ab18b4b..7864867e 100644 --- a/include/sf64level.h +++ b/include/sf64level.h @@ -14,7 +14,7 @@ typedef struct { /* 0x00 */ s32 type; /* 0x04 */ s32 unk_04; /* 0x08 */ u16 bgColor; - /* 0x0A */ u16 unk_0A; + /* 0x0A */ u16 seqId; /* 0x0C */ s32 fogR; /* 0x10 */ s32 fogG; /* 0x14 */ s32 fogB; diff --git a/include/sf64math.h b/include/sf64math.h index 420a2d1e..3e4344ab 100644 --- a/include/sf64math.h +++ b/include/sf64math.h @@ -9,6 +9,11 @@ typedef struct { /* 0x8 */ f32 z; } Vec3f; // size = 0xC +typedef struct { + Vec3f pos; + Vec3f rot; +} PosRot; + typedef struct { Vec3f normal; f32 dist; diff --git a/include/sf64object.h b/include/sf64object.h index fa68bc60..c3a600a7 100644 --- a/include/sf64object.h +++ b/include/sf64object.h @@ -45,24 +45,24 @@ typedef struct { }; /* 0x00 */ u8 drawType; /* 0x08 */ ObjectFunc action; // argument must have object type. - /* 0x0C */ f32* unk_0C; // some sort of script? hitboxes? + /* 0x0C */ f32* hitbox; // some sort of script? hitboxes? /* 0x10 */ f32 unk_10; // z coordinate of something /* 0x14 */ s16 unk_14; // can be -1, 0, 1 /* 0x16 */ s16 unk_16; // can be 0, 1, 2 - /* 0x18 */ u8 unk_18; // damage? + /* 0x18 */ u8 damage; // damage? /* 0x19 */ u8 unk_19; // can be 0, 1, 2 /* 0x1C */ f32 unk_1C; // y offset of something - /* 0x20 */ u8 unk_20; // increment for something + /* 0x20 */ u8 bonus; // increment for something } ObjectStruct_1C; // size = 0x24 typedef struct { /* 0x00 */ Object obj; - /* 0x1C */ s32 unk_1C; + /* 0x1C */ s32 index; /* 0x20 */ Vec3f unk_20; /* 0x2C */ f32 unk_2C; /* 0x30 */ f32 unk_30; /* 0x34 */ f32 unk_34; - /* 0x38 */ Vec3f unk_38; + /* 0x38 */ Vec3f sfxPos; /* 0x44 */ f32 unk_44; /* 0x44 */ f32 unk_48; /* 0x44 */ f32 unk_4C; @@ -80,14 +80,14 @@ typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectStruct_1C unk_1C; /* 0x40 */ char unk40[0x8]; - /* 0x48 */ Vec3f unk_48; + /* 0x48 */ Vec3f sfxPos; /* 0x54 */ f32 unk_54; } Object_58; // size = 0x58 typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectStruct_1C unk_1C; - /* 0x40 */ s32 unk_40; + /* 0x40 */ s32 index; /* 0x44 */ s32 unk_44; /* 0x48 */ s32 unk_48; /* 0x4C */ s32 unk_4C; @@ -97,14 +97,14 @@ typedef struct { /* 0x58 */ char pad58[8]; /* 0x60 */ f32 unk_60; /* 0x64 */ Vec3f unk_64; - /* 0x70 */ Vec3f unk_70; + /* 0x70 */ Vec3f sfxPos; /* 0x7C */ char pad7C[4]; } Object_80; // size = 0x80 typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectStruct_1C unk_1C; - /* 0x40 */ s32 unk_40; + /* 0x40 */ s32 index; /* 0x44 */ char pad44[1]; /* 0x45 */ u8 unk_45; // could be short loaded as u8 /* 0x46 */ s8 unk_46; @@ -114,7 +114,7 @@ typedef struct { typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectStruct_1C unk_1C; - /* 0x40 */ s32 unk_40; + /* 0x40 */ s32 index; /* 0x44 */ s16 unk_44; /* 0x46 */ u8 unk_46; /* 0x48 */ u16 unk_48; @@ -124,14 +124,14 @@ typedef struct { /* 0x50 */ f32 unk_50; /* 0x54 */ f32 unk_54; /* 0x58 */ f32 unk_58; - /* 0x5C */ Vec3f unk_5C; + /* 0x5C */ Vec3f sfxPos; /* 0x68 */ f32 unk_68; } Object_6C; // size 0x6C typedef struct { /* 0x00 */ Object obj; /* 0x1C */ ObjectStruct_1C unk_1C; - /* 0x40 */ s32 unk_40; + /* 0x40 */ s32 index; /* 0x44 */ s16 unk_44; /* 0x46 */ s16 unk_46; /* 0x48 */ s16 unk_48; @@ -148,7 +148,7 @@ typedef struct { /* 0x78 */ s16 unk_78; /* 0x7A */ s16 unk_7A; /* 0x7C */ char pad7C[4]; - /* 0x80 */ Vec3f unk_80; + /* 0x80 */ Vec3f sfxPos; } Object_8C; // size 0x8C typedef struct { @@ -171,9 +171,7 @@ typedef struct { /* 0x064 */ s16 unk_064; /* 0x066 */ s16 unk_066; /* 0x068 */ f32 unk_068; - /* 0x06C */ f32 unk_06C; - /* 0x070 */ f32 unk_070; - /* 0x074 */ f32 unk_074; + /* 0x06C */ Vec3f unk_06C; /* 0x078 */ char pad78[0xC]; /* 0x084 */ f32 unk_084; /* 0x088 */ s16 unk_088; @@ -214,7 +212,7 @@ typedef struct { /* 0x308 */ Vec3f unk_308; /* 0x314 */ char pad314[0xE4]; /* 0x3F8 */ f32 unk_3F8; - /* 0x3FC */ Vec3f unk_3FC; + /* 0x3FC */ Vec3f sfxPos; } Object_408; // size = 0x408 typedef struct { @@ -272,7 +270,7 @@ typedef struct { /* 0x0E6 */ s16 unk_0E6; /* 0x0E8 */ Vec3f unk_0E8; /* 0x0F4 */ Vec3f unk_0F4; - /* 0x100 */ Vec3f unk_100; + /* 0x100 */ Vec3f sfxPos; /* 0x10C */ f32 unk_10C; /* 0x110 */ f32 unk_110; /* 0x114 */ f32 unk_114; @@ -633,10 +631,10 @@ typedef enum{ /* 320 */ OBJECT_320, /* 321 */ OBJECT_321, /* 322 */ OBJECT_6C_LASERS, // start of 6C - /* 323 */ OBJECT_323, + /* 323 */ OBJECT_6C_CHECKPOINT, /* 324 */ OBJECT_6C_SILVER_RING, - /* 325 */ OBJECT_325, - /* 326 */ OBJECT_326, + /* 325 */ OBJECT_6C_STAR_RING, + /* 326 */ OBJECT_6C_METEO_WARP, /* 327 */ OBJECT_6C_BOMB, /* 328 */ OBJECT_328, /* 329 */ OBJECT_329, @@ -644,11 +642,11 @@ typedef enum{ /* 331 */ OBJECT_331, /* 332 */ OBJECT_332, /* 333 */ OBJECT_333, - /* 334 */ OBJECT_334, + /* 334 */ OBJECT_6C_CORN_ARCH, /* 335 */ OBJECT_6C_1UP, /* 336 */ OBJECT_6C_GOLD_RING, /* 337 */ OBJECT_6C_WING_REPAIR, - /* 338 */ OBJECT_338, + /* 338 */ OBJECT_6C_TRAINING_RING, /* 339 */ OBJECT_339, // start of 8C /* 340 */ OBJECT_340, /* 341 */ OBJECT_341, diff --git a/include/structs.h b/include/structs.h index 5ccefe3c..b92b7e7a 100644 --- a/include/structs.h +++ b/include/structs.h @@ -6,6 +6,17 @@ #define UNK_TYPE s32 +typedef struct { + f32 offset; + f32 size; +} HitboxDim; + +typedef struct { + HitboxDim z; + HitboxDim y; + HitboxDim x; +} Hitbox; + typedef struct { s16 vtx[3]; s16 unk_06; @@ -81,7 +92,7 @@ typedef struct { /* 0x0 */ u16 unk_0; /* 0x2 */ s8 unk_2; /* 0x3 */ s8 unk_3; -} UnkStruct_D_8017797C; // size = 0x4 +} UnkStruct_gChngInputPtr; // size = 0x4 typedef struct { /* 0x00 */ u8 unk_00; @@ -288,28 +299,28 @@ typedef struct Player { Vec3f unk_460_arr[1]; // probably fake }; /* 0x460 */ Vec3f unk_46C; - /* 0x494 */ u8 unk_478; + /* 0x478 */ u8 unk_478; /* 0x479 */ s8 unk_479; /* 0x47C */ Vec3f *unk_47C; /* 0x480 */ Vec3f *unk_480; /* 0x484 */ s8 unk_484; /* 0x485 */ s8 unk_485; /* 0x488 */ f32 unk_488; - /* 0x48C */ s8 unk_48C; + /* 0x48C */ u8 unk_48C; /* 0x490 */ f32 unk_490; - /* 0x494 */ s32 unk_494; + /* 0x494 */ u8 unk_494; /* 0x498 */ s32 unk_498; /* 0x49C */ WingInfo wings; /* 0x4D8 */ f32 unk_4D8; - /* 0x4DC */ f32 unk_4DC; -} Player; // size = 0x4E0 Might be Player + /* 0x4DC */ s32 unk_4DC; +} Player; // size = 0x4E0 typedef struct { - /* 0x00 */ u8 unk_00; + /* 0x00 */ u8 hits; /* 0x04 */ Vec3f pos; /* 0x10 */ f32 unk_10; /* 0x14 */ char pad14[0x4]; - /* 0x18 */ u16 unk_18; + /* 0x18 */ u16 timer; } UnkEntity1C; // size = 0x1C #endif diff --git a/include/variables.h b/include/variables.h index 764710d5..ea5fa449 100644 --- a/include/variables.h +++ b/include/variables.h @@ -228,7 +228,7 @@ extern CollisionHeader D_800D2B38[]; extern CollisionHeader2 D_800D2CA0[]; extern u8 D_800D2F68; extern u8 D_800D3180[30]; -extern s32 D_800D31A0[4]; // could belong to fox_rcp or sf_A4B50 +extern s32 D_800D31A0[4]; // could belong to fox_rcp or fox_play extern s32 sCurrentMsgPri; extern Save gDefaultSave; @@ -267,7 +267,7 @@ extern f32 D_80161394; // fox_43AC0 extern s32 D_801613A0; -// fox_52730 +// fox_display extern Vec3f D_801613B0[]; extern Vec3f D_801613E0[]; extern s16 D_80161410; @@ -322,7 +322,7 @@ extern s32 D_80161810[]; extern s32 D_80161900[]; extern s32 D_80161910[0x10]; // could be in fox_97F80 -// fox_A24B0 +// fox_game extern f32 D_80161A10; extern f32 D_80161A14; extern s32 D_80161A18[4]; @@ -339,7 +339,7 @@ extern f32 D_80161A3C; extern f32 D_80161A40; extern f32 D_80161A44; -// sf_A4B50 +// fox_play extern u8 D_80161A50; extern f32 D_80161A54; // @@ -360,7 +360,7 @@ extern s32 D_80161A8C; extern u8 gGoldRingCount[4]; extern u8 D_80161A94; extern s32 gHitCount; -extern s32 D_80161A9C; +extern s32 gSavedHitCount; extern s16 gLifeCount[4]; extern s32 gLaserStrength[4]; // @@ -413,17 +413,17 @@ extern s32 D_801778A0; extern s32 D_801778A4; extern s32 gCamCount; extern s32 D_801778AC; -extern s32 D_801778B0[6]; +extern s32 gTeamHealth[6]; extern s32 D_801778C8; // -extern s32 D_801778D0[6]; +extern s32 gSavedTeamHealth[6]; extern s32 D_801778E8; // extern UNK_TYPE D_801778F0[6]; extern u16 D_80177908[4]; extern s32 D_80177910[6]; extern u16 D_80177928[4]; -extern s8 D_80177930; +extern u8 D_80177930; // extern u16 D_80177938[4]; extern f32 D_80177940; @@ -435,9 +435,9 @@ extern f32 D_80177958[4]; extern f32 D_80177968; extern s32 D_8017796C; extern f32 D_80177970; -extern OSContPad *D_80177974; +extern OSContPad *gCurInputPtr; extern f32 D_80177978; -extern OSContPad* D_8017797C; +extern OSContPad* gChngInputPtr; extern f32 D_80177980; extern u8 *D_80177984; extern f32 D_80177988; @@ -483,7 +483,7 @@ extern s32 D_80177B00[4][4]; extern s32 D_80177B40; extern u8 D_80177B44; extern s32 D_80177B48; -extern s8 D_80177B4C; +extern u8 D_80177B4C; extern s32 D_80177B50[7]; extern u8 D_80177B6C; extern s32 D_80177B70[7]; @@ -589,7 +589,7 @@ extern s32 D_801782B4; extern s32 D_801782B8; extern s32 D_801782BC; extern s32 D_801782C0; -extern f32 *D_801782C4; +extern PosRot *D_801782C4; extern s32 D_801782C8; extern f32 *D_801782CC; extern s32 D_801782D0; diff --git a/linker_scripts/us/symbol_addrs_engine.txt b/linker_scripts/us/symbol_addrs_engine.txt index cddfe0e7..026dbb82 100644 --- a/linker_scripts/us/symbol_addrs_engine.txt +++ b/linker_scripts/us/symbol_addrs_engine.txt @@ -1,6 +1,3 @@ -// fox_enmy -Object_Kill = 0x80060FBC; - //fox_std_lib Graphics_ClearPrintBuffer = 0x80099980; Graphics_Printf = 0x800999D8; @@ -49,6 +46,9 @@ Graphics_GetSmallTextWidth = 0x800A13EC; func_800A1540 = 0x800A1540; func_800A1558 = 0x800A1558; +// sf_36930 +Object_70_Initialize = 0x80035E48; + // fox_rcp RCP_SetupDL = 0x800B8DD0; RCP_SetFog = 0x800B8E14; @@ -143,15 +143,171 @@ Message_IsPrintingChar = 0x800C2F30; gDefaultSave = 0x800D4D10; gSaveFile = 0x80178870; //size:0x200 +// fox_edisplay +func_800596C0 = 0x800596C0; +func_800597C0 = 0x800597C0; +func_8005980C = 0x8005980C; +func_80059850 = 0x80059850; +func_800598DC = 0x800598DC; +func_800598E8 = 0x800598E8; +func_800599A4 = 0x800599A4; +func_80059A24 = 0x80059A24; +func_80059AEC = 0x80059AEC; +func_80059B20 = 0x80059B20; +func_80059BB0 = 0x80059BB0; +func_80059BBC = 0x80059BBC; +func_80059BF0 = 0x80059BF0; +func_80059C28 = 0x80059C28; +func_80059C34 = 0x80059C34; +func_80059C40 = 0x80059C40; +func_80059F68 = 0x80059F68; +func_80059FDC = 0x80059FDC; +func_8005A010 = 0x8005A010; +func_8005A07C = 0x8005A07C; +func_8005A088 = 0x8005A088; +func_8005A094 = 0x8005A094; +func_8005ADAC = 0x8005ADAC; +func_8005B1E8 = 0x8005B1E8; +func_8005B388 = 0x8005B388; +func_8005B6A4 = 0x8005B6A4; +func_8005B71C = 0x8005B71C; +func_8005B7CC = 0x8005B7CC; +func_8005B848 = 0x8005B848; +func_8005B9A4 = 0x8005B9A4; +func_8005BA30 = 0x8005BA30; +func_8005BAAC = 0x8005BAAC; +func_8005BAB4 = 0x8005BAB4; +func_8005C5F0 = 0x8005C5F0; +func_8005C900 = 0x8005C900; +func_8005C9C0 = 0x8005C9C0; +func_8005CA80 = 0x8005CA80; +func_8005CB44 = 0x8005CB44; +func_8005CC9C = 0x8005CC9C; +func_8005CDA8 = 0x8005CDA8; +func_8005D008 = 0x8005D008; +func_8005D1F0 = 0x8005D1F0; +func_8005D3CC = 0x8005D3CC; +Object_80_Draw = 0x8005D654; +Object_4C_Draw = 0x8005D8B8; +Object_2F4_Draw2 = 0x8005D954; +Object_2F4_Draw1 = 0x8005DBC0; +Object_408_Draw = 0x8005E1B8; +Object_8C_Draw1 = 0x8005E454; +Object_8C_Draw2 = 0x8005E538; +Object_6C_Draw = 0x8005E7B8; +func_8005EA24 = 0x8005EA24; +func_8005ECD8 = 0x8005ECD8; +func_8005F030 = 0x8005F030; +func_8005F0E8 = 0x8005F0E8; +func_8005F1EC = 0x8005F1EC; +func_8005F290 = 0x8005F290; +Object_58_Draw = 0x8005F2F4; +func_8005F670 = 0x8005F670; +func_8005F9DC = 0x8005F9DC; +Object_DrawAll = 0x8005FB70; +func_8006046C = 0x8006046C; +func_80060714 = 0x80060714; +func_8006089C = 0x8006089C; +func_80060968 = 0x80060968; +func_80060D94 = 0x80060D94; + // fox_enmy +func_80060F30 = 0x80060F30; +Object_Kill = 0x80060FBC; +func_80060FE4 = 0x80060FE4; +func_80061148 = 0x80061148; +Object_Set1C = 0x800612B8; Object_80_Initialize = 0x80061364; Object_4C_Initialize = 0x80061394; Object_2F4_Initialize = 0x800613C4; Object_408_Initialize = 0x80061404; Object_6C_Initialize = 0x80061444; Object_8C_Initialize = 0x80061474; +Object_80_Spawn = 0x800614B4; +Object_4C_Spawn = 0x800615A0; +Object_2F4_Spawn = 0x8006168C; +Object_408_Spawn = 0x80061778; +Object_6C_Spawn = 0x80061864; +func_80061958 = 0x80061958; +func_80061A4C = 0x80061A4C; +func_80061B68 = 0x80061B68; +func_80061CD0 = 0x80061CD0; +func_80061E48 = 0x80061E48; +func_80061F0C = 0x80061F0C; +Object_Spawn = 0x80062180; +func_80062568 = 0x80062568; +func_80062664 = 0x80062664; +func_80062B60 = 0x80062B60; +func_80062C38 = 0x80062C38; +func_80062D04 = 0x80062D04; +func_80062DBC = 0x80062DBC; +func_800631A8 = 0x800631A8; +func_8006326C = 0x8006326C; +func_8006351C = 0x8006351C; +func_80063CAC = 0x80063CAC; +func_80063D58 = 0x80063D58; +func_80063E5C = 0x80063E5C; +func_80063F4C = 0x80063F4C; +func_80063F58 = 0x80063F58; +func_80063F74 = 0x80063F74; +Object_Init = 0x80063F90; +func_800652CC = 0x800652CC; +func_80065380 = 0x80065380; +func_8006546C = 0x8006546C; +func_800654E4 = 0x800654E4; +func_800655C8 = 0x800655C8; +func_8006566C = 0x8006566C; +func_800656D4 = 0x800656D4; +func_800660F0 = 0x800660F0; +func_80066254 = 0x80066254; +func_8006654C = 0x8006654C; +func_8006684C = 0x8006684C; +func_800669A0 = 0x800669A0; +func_80066A80 = 0x80066A80; +func_80066A8C = 0x80066A8C; +func_80066C00 = 0x80066C00; +func_80066D5C = 0x80066D5C; +func_80066E80 = 0x80066E80; +func_80066E8C = 0x80066E8C; +func_80066EA8 = 0x80066EA8; +func_80066EE4 = 0x80066EE4; +func_80066EF0 = 0x80066EF0; +func_800671D0 = 0x800671D0; +func_80067348 = 0x80067348; +func_800674B4 = 0x800674B4; +func_8006753C = 0x8006753C; +func_80067874 = 0x80067874; +func_80067A40 = 0x80067A40; +func_80067B1C = 0x80067B1C; +func_80067BEC = 0x80067BEC; +func_80067F6C = 0x80067F6C; +func_80068020 = 0x80068020; +func_800685D8 = 0x800685D8; +func_800685F8 = 0x800685F8; +func_80068618 = 0x80068618; +func_80068688 = 0x80068688; +func_80068914 = 0x80068914; +func_80068C48 = 0x80068C48; +func_80068C88 = 0x80068C88; +func_80068FE0 = 0x80068FE0; +func_800690D0 = 0x800690D0; +func_800693E8 = 0x800693E8; +func_80069658 = 0x80069658; +func_800696F8 = 0x800696F8; +func_80069858 = 0x80069858; +func_80069924 = 0x80069924; +func_80069A10 = 0x80069A10; +Object_2F4_Update = 0x80069AAC; +Object_408_Update = 0x80069CBC; +Object_80_Update = 0x80069DF4; +Object_4C_Update = 0x80069E88; +Object_6C_Update = 0x80069F30; +Object_8C_Update = 0x80069FD4; +func_8006A06C = 0x8006A06C; +func_8006A38C = 0x8006A38C; +Object_UpdateAll = 0x8006A3E8; -// fox_A24B0 +// fox_game D_80161A10 = 0x80161A10; D_80161A14 = 0x80161A14; D_80161A18 = 0x80161A18; //size:0x10 @@ -191,7 +347,7 @@ func_800A3608 = 0x800A3608; gMedalFlashTimer = 0x801617B8; gMedalStatus = 0x801617B4; -// sf_A4B50 +// fox_play D_80161A50 = 0x80161A50; D_80161A54 = 0x80161A54; D_80161A5C = 0x80161A5C; @@ -209,7 +365,7 @@ D_80161A88 = 0x80161A88; D_80161A8C = 0x80161A8C; gGoldRingCount = 0x80161A90; gHitCount = 0x80161A98; -D_80161A9C = 0x80161A9C; +gSavedHitCount = 0x80161A9C; gLifeCount = 0x80161AA0; gLaserStrength = 0x80161AA8;//size:0x10 D_80161AB8 = 0x80161AB8; @@ -256,9 +412,9 @@ D_801778A4 = 0x801778A4; gCamCount = 0x801778A8; D_801778AB = 0x801778AB; D_801778AC = 0x801778AC; -D_801778B0 = 0x801778B0; +gTeamHealth = 0x801778B0; //size:0x18 D_801778C8 = 0x801778C8; -D_801778D0 = 0x801778D0; +gSavedTeamHealth = 0x801778D0; //size:0x18 D_801778E8 = 0x801778E8; D_80177908 = 0x80177908; D_80177910 = 0x80177910; @@ -269,8 +425,9 @@ D_80177940 = 0x80177940; D_80177948 = 0x80177948; D_80177950 = 0x80177950; D_80177958 = 0x80177958; +gCurInputPtr = 0x80177974; D_80177978 = 0x80177978; -D_8017797C = 0x8017797C; +gChngInputPtr = 0x8017797C; D_80177980 = 0x80177980; D_80177988 = 0x80177988; D_80177990 = 0x80177990; diff --git a/linker_scripts/us/symbol_addrs_nlib_vars.txt b/linker_scripts/us/symbol_addrs_nlib_vars.txt index 7af251ea..dfc223b5 100644 --- a/linker_scripts/us/symbol_addrs_nlib_vars.txt +++ b/linker_scripts/us/symbol_addrs_nlib_vars.txt @@ -137,4 +137,3 @@ gAudioDataBuffer = 0x802D7800; //size:0xB0000 gTextureRenderBuffer = 0x80387800; //size:0x7880 gFillBuffer = 0x8038F080; //size:0x780 gFrameBuffers = 0x8038F800; //size:0x70800 - diff --git a/src/main/fox_43AC0.c b/src/main/fox_43AC0.c index 237a6be9..8a4786db 100644 --- a/src/main/fox_43AC0.c +++ b/src/main/fox_43AC0.c @@ -9,7 +9,7 @@ s32 D_800C9E90[28] = { const f32 D_800D55D0[] = { 6000.0f, 18000.0f, -6000.0f, -18000.0f }; -void func_80042EC0(Object_408* arg0) { +void func_80042EC0(Object_408* obj408) { s32 var_a3; f32 var_fv0; @@ -26,56 +26,56 @@ void func_80042EC0(Object_408* arg0) { } if (var_a3 != 0) { var_fv0 = 0.0f; - if (arg0->obj.id == OBJECT_292) { + if (obj408->obj.id == OBJECT_292) { var_fv0 = 300.0f; - } else if (arg0->obj.id == OBJECT_306) { + } else if (obj408->obj.id == OBJECT_306) { var_fv0 = 200.0f; } - func_80077240(arg0->obj.pos.x, arg0->obj.pos.y + var_fv0, arg0->obj.pos.z, var_a3); + func_80077240(obj408->obj.pos.x, obj408->obj.pos.y + var_fv0, obj408->obj.pos.z, var_a3); } gHitCount += var_a3 + 1; D_80177850 = 0xF; } -void func_80042FAC(Object_408* arg0) { +void func_80042FAC(Object_408* obj408) { } -void func_80042FB8(Object_408* arg0) { +void func_80042FB8(Object_408* obj408) { } -void func_80042FC4(Object_408* arg0) { +void func_80042FC4(Object_408* obj408) { } -void func_80042FD0(Object_408* arg0) { +void func_80042FD0(Object_408* obj408) { } -void func_80042FDC(Object_408* arg0) { +void func_80042FDC(Object_408* obj408) { } -void func_80042FE8(Object_408* arg0) { +void func_80042FE8(Object_408* obj408) { } -void func_80042FF4(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, +void func_80042FF4(Object_2F4* obj2F4, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9, f32 argA, s32 argB, s32 argC) { - Object_2F4_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_189; - arg0->unk_0B8 = argB; - 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->obj.rot.z = arg6; - arg0->unk_0E8.x = arg7; - arg0->unk_0E8.y = arg8; - arg0->unk_0E8.z = arg9; - arg0->unk_110 = argA; - arg0->unk_0BC = argC; - arg0->unk_0BE = 20; - func_800612B8(&arg0->unk_01C, arg0->obj.id); + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 1; + obj2F4->obj.id = OBJECT_189; + obj2F4->unk_0B8 = argB; + obj2F4->obj.pos.x = arg1; + obj2F4->obj.pos.y = arg2; + obj2F4->obj.pos.z = arg3; + obj2F4->obj.rot.x = arg4; + obj2F4->obj.rot.y = arg5; + obj2F4->obj.rot.z = arg6; + obj2F4->unk_0E8.x = arg7; + obj2F4->unk_0E8.y = arg8; + obj2F4->unk_0E8.z = arg9; + obj2F4->unk_110 = argA; + obj2F4->unk_0BC = argC; + obj2F4->unk_0BE = 20; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); if (gLevelType == 0) { - arg0->unk_10C = 0.5f; + obj2F4->unk_10C = 0.5f; } } @@ -91,11 +91,11 @@ void func_800430DC(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f } } -void func_80043188(Object_2F4* arg0) { - arg0->unk_01C.unk_10 = 30000.0f; +void func_80043188(Object_2F4* obj2F4) { + obj2F4->unk_01C.unk_10 = 30000.0f; } -void func_8004319C(Player* arg0, f32 arg1, f32 arg2, f32 arg3) { +void func_8004319C(Player* player, f32 arg1, f32 arg2, f32 arg3) { func_800182F4(0x105000FF); func_800182F4(0x115000FF); @@ -104,14 +104,14 @@ void func_8004319C(Player* arg0, f32 arg1, f32 arg2, f32 arg3) { D_80178440 = arg1; D_80178444 = arg2; - arg0->unk_1C8 = 7; - arg0->unk_1D0 = 10; - arg0->unk_1F8 = 50; - arg0->unk_1FC = 50; - arg0->unk_000 = 0.0f; - arg0->unk_004 = 1.0f; - if (arg0->unk_074 < arg0->unk_0AC) { - arg0->unk_004 = -1.0f; + player->unk_1C8 = 7; + player->unk_1D0 = 10; + player->unk_1F8 = 50; + player->unk_1FC = 50; + player->unk_000 = 0.0f; + player->unk_004 = 1.0f; + if (player->unk_074 < player->unk_0AC) { + player->unk_004 = -1.0f; } gPlayer[0].unk_0C0.x = 0.0f; } diff --git a/src/main/fox_6B3B0.c b/src/main/fox_6B3B0.c index 21f38943..807fb506 100644 --- a/src/main/fox_6B3B0.c +++ b/src/main/fox_6B3B0.c @@ -14,186 +14,186 @@ void func_8006A7B0(u16* msg, s32 character) { } } -void func_8006A800(Object_8C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_361; - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->unk_48 = 3; +void func_8006A800(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_361; + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + obj8C->unk_48 = 3; if (Rand_ZeroOne() < 0.5f) { - arg0->unk_48 = -arg0->unk_48; + obj8C->unk_48 = -obj8C->unk_48; } - arg0->unk_4A = 100; - arg0->unk_70 = arg4 * 0.25f; - arg0->unk_6C = 0.3f; + obj8C->unk_4A = 100; + obj8C->unk_70 = arg4 * 0.25f; + obj8C->unk_6C = 0.3f; if (arg4 < 10.0f) { - arg0->unk_6C = 0.1f; + obj8C->unk_6C = 0.1f; } - arg0->obj.rot.z = Rand_ZeroOne() * 360.0f; - func_800612B8(&arg0->unk_1C, arg0->obj.id); + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } -void func_8006A900(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { +void func_8006A900(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { s32 i; for (i = ARRAY_COUNT(gObjects8C) - 1; i >= 0; i--) { if (gObjects8C[i].obj.status == 0) { - func_8006A800(&gObjects8C[i], arg0, arg1, arg2, arg3); + func_8006A800(&gObjects8C[i], xPos, yPos, zPos, arg3); break; } } } -void func_8006A96C(Object_2F4* arg0) { +void func_8006A96C(Object_2F4* obj2F4) { } -void func_8006A978(Object_2F4* arg0) { +void func_8006A978(Object_2F4* obj2F4) { } -void func_8006A984(Object_8C* arg0, f32 arg1, f32 arg2, f32 arg3) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_365; - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->unk_44 = 40; - arg0->unk_70 = 5.0f; - arg0->unk_6C = 2.0f * (Rand_ZeroOne() - 0.5f); - arg0->unk_54.y = 10.0f; - arg0->obj.rot.z = Rand_ZeroOne() * 360.0f; - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void func_8006A984(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_365; + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + obj8C->unk_44 = 40; + obj8C->unk_70 = 5.0f; + obj8C->unk_6C = 2.0f * (Rand_ZeroOne() - 0.5f); + obj8C->unk_54.y = 10.0f; + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } -void func_8006AA3C(f32 arg0, f32 arg1, f32 arg2) { +void func_8006AA3C(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { if (gObjects8C[i].obj.status == 0) { - func_8006A984(&gObjects8C[i], arg0, arg1, arg2); + func_8006A984(&gObjects8C[i], xPos, yPos, zPos); break; } } } -void func_8006AA98(Object_80* arg0) { +void func_8006AA98(Object_80* obj80) { Vec3f sp24; Vec3f sp18; Texture_Scroll(D_60038F8, 32, 32, 1); if ((gFrameCount % 4) == 0) { - Matrix_RotateY(gCalcMatrix, arg0->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); sp18.x = (Rand_ZeroOne() - 0.5f) * 700.0f; sp18.y = Rand_ZeroOne() * 50.0f; sp18.z = 700.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp18, &sp24); - func_8006AA3C(arg0->obj.pos.x + sp24.x, arg0->obj.pos.y + sp24.y + 50.0f, arg0->obj.pos.z + sp24.z); + func_8006AA3C(obj80->obj.pos.x + sp24.x, obj80->obj.pos.y + sp24.y + 50.0f, obj80->obj.pos.z + sp24.z); } } -s32 func_8006ABA4(Object_2F4* arg0) { - if ((fabsf(arg0->obj.pos.x - gPlayer[0].unk_074) < 700.0f) && - (fabsf(arg0->obj.pos.y - gPlayer[0].unk_078) < 700.0f)) { +s32 func_8006ABA4(Object_2F4* obj2F4) { + if ((fabsf(obj2F4->obj.pos.x - gPlayer[0].unk_074) < 700.0f) && + (fabsf(obj2F4->obj.pos.y - gPlayer[0].unk_078) < 700.0f)) { return 1; } return 0; } // fake? gPlayer[0]. doesn't match -void func_8006AC08(Object_2F4* arg0) { +void func_8006AC08(Object_2F4* obj2F4) { f32 sp2C; - if ((func_8006ABA4(arg0) != 0) && (arg0->unk_0BC == 0)) { - func_8007F11C(OBJECT_353, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, D_80177828); - arg0->unk_0BC = 20; + if ((func_8006ABA4(obj2F4) != 0) && (obj2F4->unk_0BC == 0)) { + func_8007F11C(OBJECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828); + obj2F4->unk_0BC = 20; } - sp2C = arg0->obj.pos.z + D_80177D20; - arg0->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer->unk_040.x - arg0->obj.pos.x, gPlayer->unk_040.z - sp2C)); - arg0->obj.rot.x = - -Math_RadToDeg(Math_Atan2F(gPlayer->unk_040.y - arg0->obj.pos.y, - sqrtf(SQ(gPlayer->unk_040.x - arg0->obj.pos.x) + SQ(gPlayer->unk_040.z - sp2C)))); + sp2C = obj2F4->obj.pos.z + D_80177D20; + obj2F4->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer->unk_040.x - obj2F4->obj.pos.x, gPlayer->unk_040.z - sp2C)); + obj2F4->obj.rot.x = + -Math_RadToDeg(Math_Atan2F(gPlayer->unk_040.y - obj2F4->obj.pos.y, + sqrtf(SQ(gPlayer->unk_040.x - obj2F4->obj.pos.x) + SQ(gPlayer->unk_040.z - sp2C)))); } -void func_8006AD18(Object_2F4* arg0) { +void func_8006AD18(Object_2F4* obj2F4) { bool sp34; - arg0->unk_10C = 1.5f; + obj2F4->unk_10C = 1.5f; sp34 = false; - arg0->obj.rot.y = Math_RadToDeg( - Math_Atan2F(gPlayer[D_801778A0].unk_074 - arg0->obj.pos.x, gPlayer[D_801778A0].unk_138 - arg0->obj.pos.z)); - if (arg0->obj.pos.y < -500.0f) { - arg0->obj.pos.y = -500.0f; - arg0->unk_0E8.y = 0.0f; - arg0->unk_0E8.x = 0.0f; - arg0->unk_0E8.z = 0.0f; + obj2F4->obj.rot.y = Math_RadToDeg( + Math_Atan2F(gPlayer[D_801778A0].unk_074 - obj2F4->obj.pos.x, gPlayer[D_801778A0].unk_138 - obj2F4->obj.pos.z)); + if (obj2F4->obj.pos.y < -500.0f) { + obj2F4->obj.pos.y = -500.0f; + obj2F4->unk_0E8.y = 0.0f; + obj2F4->unk_0E8.x = 0.0f; + obj2F4->unk_0E8.z = 0.0f; sp34 = true; - arg0->unk_054 = true; + obj2F4->unk_054 = true; } if (!(gFrameCount & 0x1F)) { - func_8007F11C(OBJECT_353, arg0->obj.pos.x, arg0->obj.pos.y + 180.0f, arg0->obj.pos.z, D_80177828); + func_8007F11C(OBJECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y + 180.0f, obj2F4->obj.pos.z, D_80177828); } - switch (arg0->unk_0B8) { + switch (obj2F4->unk_0B8) { case 0: - arg0->unk_0B6++; - if (arg0->unk_0B6 >= 30) { - arg0->unk_0B6 = 0; + obj2F4->unk_0B6++; + if (obj2F4->unk_0B6 >= 30) { + obj2F4->unk_0B6 = 0; } - if (arg0->unk_0B6 == 0x15) { - arg0->unk_0B8 = 1; + if (obj2F4->unk_0B6 == 0x15) { + obj2F4->unk_0B8 = 1; - arg0->unk_0E8.y = 40.0f; - arg0->unk_0E8.z = -40.0f; - arg0->unk_0E8.x = 10.0f; + obj2F4->unk_0E8.y = 40.0f; + obj2F4->unk_0E8.z = -40.0f; + obj2F4->unk_0E8.x = 10.0f; - arg0->unk_050 = 1 - arg0->unk_050; - if (arg0->unk_050) { - arg0->unk_0E8.x *= -1.0f; + obj2F4->unk_050 = 1 - obj2F4->unk_050; + if (obj2F4->unk_050) { + obj2F4->unk_0E8.x *= -1.0f; } - if (arg0->unk_054) { - arg0->unk_0E8.x = 0.0f; - arg0->unk_0E8.z = -20.0f; + if (obj2F4->unk_054) { + obj2F4->unk_0E8.x = 0.0f; + obj2F4->unk_0E8.z = -20.0f; } } break; case 1: - if (arg0->unk_0E8.y > 10.0f) { - arg0->unk_0B6++; - if (arg0->unk_0B6 >= 30) { - arg0->unk_0B6 = 29; + if (obj2F4->unk_0E8.y > 10.0f) { + obj2F4->unk_0B6++; + if (obj2F4->unk_0B6 >= 30) { + obj2F4->unk_0B6 = 29; } } else { - arg0->unk_0B6--; - if (arg0->unk_0B6 < 0) { - arg0->unk_0B6 = 0; + obj2F4->unk_0B6--; + if (obj2F4->unk_0B6 < 0) { + obj2F4->unk_0B6 = 0; } } if (sp34) { - arg0->unk_0B8 = 0; + obj2F4->unk_0B8 = 0; } break; } - if (arg0->unk_0D0 != 0) { - arg0->unk_0CE -= 10; - if ((arg0->unk_0CE <= 0) || (arg0->unk_0D0 >= 2)) { - func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y + 180.0f, arg0->obj.pos.z, 10.0f); - func_8007BFFC(arg0->obj.pos.x, arg0->obj.pos.y + 180.0f, arg0->obj.pos.z, arg0->unk_0E8.x, arg0->unk_0E8.y, - arg0->unk_0E8.z, 8.0f, 30); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x2903A008); - gHitCount += arg0->unk_01C.unk_20; + if (obj2F4->unk_0D0 != 0) { + obj2F4->unk_0CE -= 10; + if ((obj2F4->unk_0CE <= 0) || (obj2F4->unk_0D0 >= 2)) { + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 180.0f, obj2F4->obj.pos.z, 10.0f); + func_8007BFFC(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 180.0f, obj2F4->obj.pos.z, obj2F4->unk_0E8.x, + obj2F4->unk_0E8.y, obj2F4->unk_0E8.z, 8.0f, 30); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); + gHitCount += obj2F4->unk_01C.bonus; D_80177850 = 15; } else { - arg0->unk_0D0 = 0; - arg0->unk_0C6 = 20; - func_80019218(0x2903300E, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - func_8007D1E0(arg0->obj.pos.x, arg0->obj.pos.y + 180.0f, arg0->obj.pos.z, 5.0f); + obj2F4->unk_0D0 = 0; + obj2F4->unk_0C6 = 20; + func_80019218(0x2903300E, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_8007D1E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 180.0f, obj2F4->obj.pos.z, 5.0f); } } } -void func_8006B094(Object_2F4* arg0) { +void func_8006B094(Object_2F4* obj2F4) { } s16 D_800CFF94[16] = { @@ -205,48 +205,48 @@ f32 D_800CFFC4[16] = { }; Gfx* D_800D0004[3] = { 0x04000170, 0x040084D0, 0x0400A630 }; -void func_8006B0A0(Object_2F4* arg0) { +void func_8006B0A0(Object_2F4* obj2F4) { Vec3f sp34; s32 temp_hi; - arg0->unk_04E++; - if (arg0->unk_04E >= 100) { - arg0->unk_04E = 0; + obj2F4->unk_04E++; + if (obj2F4->unk_04E >= 100) { + obj2F4->unk_04E = 0; } - D_80176558[arg0->unk_046][arg0->unk_04E] = arg0->obj.pos.x; - D_80176878[arg0->unk_046][arg0->unk_04E] = arg0->obj.pos.y; - D_80176B98[arg0->unk_046][arg0->unk_04E] = arg0->obj.pos.z; - D_80176EB8[arg0->unk_046][arg0->unk_04E] = arg0->obj.rot.x; - D_801771D8[arg0->unk_046][arg0->unk_04E] = arg0->obj.rot.y; - D_80177500[arg0->unk_046][arg0->unk_04E] = arg0->obj.rot.z; - arg0->obj.rot.x -= 10.0f; - arg0->obj.rot.y += 3.0f; - arg0->obj.rot.z += 5.0f; - Math_Vec3fFromAngles(&sp34, arg0->obj.rot.x, arg0->obj.rot.y, 40.0f); - arg0->unk_0E8.x = sp34.x; - arg0->unk_0E8.y = sp34.y; - arg0->unk_0E8.z = sp34.z; - if ((arg0->unk_0BC == 0) && !(gFrameCount & 3)) { - temp_hi = (D_800CFF94[arg0->unk_04A] + arg0->unk_04E) % 100; - if (arg0->unk_04A == 0) { - func_8007D2C8(D_80176558[arg0->unk_046][temp_hi], D_80176878[arg0->unk_046][temp_hi], - D_80176B98[arg0->unk_046][temp_hi], 7.0f); + D_80176558[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.pos.x; + D_80176878[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.pos.y; + D_80176B98[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.pos.z; + D_80176EB8[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.rot.x; + D_801771D8[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.rot.y; + D_80177500[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.rot.z; + obj2F4->obj.rot.x -= 10.0f; + obj2F4->obj.rot.y += 3.0f; + obj2F4->obj.rot.z += 5.0f; + Math_Vec3fFromAngles(&sp34, obj2F4->obj.rot.x, obj2F4->obj.rot.y, 40.0f); + obj2F4->unk_0E8.x = sp34.x; + obj2F4->unk_0E8.y = sp34.y; + obj2F4->unk_0E8.z = sp34.z; + if ((obj2F4->unk_0BC == 0) && !(gFrameCount & 3)) { + temp_hi = (D_800CFF94[obj2F4->unk_04A] + obj2F4->unk_04E) % 100; + if (obj2F4->unk_04A == 0) { + func_8007D2C8(D_80176558[obj2F4->unk_046][temp_hi], D_80176878[obj2F4->unk_046][temp_hi], + D_80176B98[obj2F4->unk_046][temp_hi], 7.0f); } else { - func_8007D2C8(D_80176558[arg0->unk_046][temp_hi], D_80176878[arg0->unk_046][temp_hi], - D_80176B98[arg0->unk_046][temp_hi], 4.0f); + func_8007D2C8(D_80176558[obj2F4->unk_046][temp_hi], D_80176878[obj2F4->unk_046][temp_hi], + D_80176B98[obj2F4->unk_046][temp_hi], 4.0f); } - func_80019218(0x2903B009, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - arg0->unk_04A++; - if (arg0->unk_04A > 15) { - Object_Kill(&arg0->obj, &arg0->unk_100); - D_80176550[arg0->unk_046] = 0; - gHitCount += arg0->unk_01C.unk_20; + func_80019218(0x2903B009, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + obj2F4->unk_04A++; + if (obj2F4->unk_04A > 15) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + D_80176550[obj2F4->unk_046] = 0; + gHitCount += obj2F4->unk_01C.bonus; D_80177850 = 15; } } } -void func_8006B46C(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, u8 arg7, f32 arg8, +void func_8006B46C(Object_2F4* obj2F4, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, u8 arg7, f32 arg8, s32 arg9) { Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; @@ -261,11 +261,11 @@ void func_8006B46C(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 Matrix_SetGfxMtx(&gMasterDisp); if (arg7 != 1) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - if ((arg7 == 0) && (arg0->unk_0CA[0] != 0)) { - sp34.y += arg0->unk_01C.unk_1C; + if ((arg7 == 0) && (obj2F4->unk_0CA[0] != 0)) { + sp34.y += obj2F4->unk_01C.unk_1C; Matrix_MultVec3f(gGfxMatrix, &sp34, D_80161578); if (D_80161578->z > -500.0f) { - arg0->unk_0CA[0] = 0; + obj2F4->unk_0CA[0] = 0; } } } else { @@ -280,265 +280,265 @@ void func_8006B46C(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_8006B74C(Object_2F4* arg0) { +void func_8006B74C(Object_2F4* obj2F4) { s16 var_s0; s16 temp_hi; - for (var_s0 = arg0->unk_04A; var_s0 < 16; var_s0++) { - temp_hi = (D_800CFF94[var_s0] + arg0->unk_04E) % 100; - func_8006B46C(arg0, D_80176558[arg0->unk_046][temp_hi], D_80176878[arg0->unk_046][temp_hi], - D_80176B98[arg0->unk_046][temp_hi], D_80176EB8[arg0->unk_046][temp_hi], - D_801771D8[arg0->unk_046][temp_hi], D_80177500[arg0->unk_046][temp_hi], D_800CFFB4[var_s0], - D_800CFFC4[var_s0], arg0->unk_0C6 & 1); + for (var_s0 = obj2F4->unk_04A; var_s0 < 16; var_s0++) { + temp_hi = (D_800CFF94[var_s0] + obj2F4->unk_04E) % 100; + func_8006B46C(obj2F4, D_80176558[obj2F4->unk_046][temp_hi], D_80176878[obj2F4->unk_046][temp_hi], + D_80176B98[obj2F4->unk_046][temp_hi], D_80176EB8[obj2F4->unk_046][temp_hi], + D_801771D8[obj2F4->unk_046][temp_hi], D_80177500[obj2F4->unk_046][temp_hi], D_800CFFB4[var_s0], + D_800CFFC4[var_s0], obj2F4->unk_0C6 & 1); } } -void func_8006B95C(Object_80* arg0) { - arg0->obj.pos.x += arg0->unk_64.x; - arg0->obj.pos.y += arg0->unk_64.y; - arg0->obj.pos.z += arg0->unk_64.z; - switch (arg0->unk_48) { +void func_8006B95C(Object_80* obj80) { + obj80->obj.pos.x += obj80->unk_64.x; + obj80->obj.pos.y += obj80->unk_64.y; + obj80->obj.pos.z += obj80->unk_64.z; + switch (obj80->unk_48) { case 0: - arg0->unk_64.y -= 1.0f; - if (arg0->obj.pos.y < D_80177940 + 40.0f) { - arg0->obj.pos.y = D_80177940 + 40.0f; - func_80019218(0x19130003, &arg0->unk_70, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - arg0->unk_48 = 2; - arg0->unk_64.y = 0.0f; + obj80->unk_64.y -= 1.0f; + if (obj80->obj.pos.y < D_80177940 + 40.0f) { + obj80->obj.pos.y = D_80177940 + 40.0f; + func_80019218(0x19130003, &obj80->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + obj80->unk_48 = 2; + obj80->unk_64.y = 0.0f; } break; case 2: break; case 1: - arg0->obj.rot.x += 10.0f; + obj80->obj.rot.x += 10.0f; break; } } -void func_8006BA64(Object_8C* arg0, f32 arg1, f32 arg2, f32 arg3) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_375; - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->unk_70 = 0.0f; - arg0->unk_6C = 0.12f; - arg0->obj.rot.y = Rand_ZeroOne() * 360.0f; - arg0->unk_60.y = (Rand_ZeroOne() - 0.5f) * 3.0f; - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void func_8006BA64(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_375; + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + obj8C->unk_70 = 0.0f; + obj8C->unk_6C = 0.12f; + obj8C->obj.rot.y = Rand_ZeroOne() * 360.0f; + obj8C->unk_60.y = (Rand_ZeroOne() - 0.5f) * 3.0f; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } -void func_8006BB1C(f32 arg0, f32 arg1, f32 arg2) { +void func_8006BB1C(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { if (gObjects8C[i].obj.status == 0) { - func_8006BA64(&gObjects8C[i], arg0, arg1, arg2); + func_8006BA64(&gObjects8C[i], xPos, yPos, zPos); break; } } } -void func_8006BB78(Object_2F4* arg0) { +void func_8006BB78(Object_2F4* obj2F4) { Vec3f sp44; - switch (arg0->unk_0B8) { + switch (obj2F4->unk_0B8) { case 0: - arg0->unk_13C = (Rand_ZeroOne() - 0.5f) * 1000.0f; - arg0->unk_0B8 = 1; + obj2F4->unk_13C = (Rand_ZeroOne() - 0.5f) * 1000.0f; + obj2F4->unk_0B8 = 1; break; case 1: - switch (arg0->unk_046) { + switch (obj2F4->unk_046) { case 0: - arg0->unk_114 += 2.0f; - if (arg0->unk_114 > 10.0f) { - arg0->unk_046 = 1; + obj2F4->unk_114 += 2.0f; + if (obj2F4->unk_114 > 10.0f) { + obj2F4->unk_046 = 1; } break; case 1: - arg0->unk_114 -= 2.0f; - if (arg0->unk_114 < -10.0f) { - arg0->unk_046 = 0; + obj2F4->unk_114 -= 2.0f; + if (obj2F4->unk_114 < -10.0f) { + obj2F4->unk_046 = 0; } break; } - Math_Vec3fFromAngles(&sp44, arg0->obj.rot.x, arg0->obj.rot.y, 10.0f); - arg0->unk_0E8.x = sp44.x; - arg0->unk_0E8.y = sp44.y; - arg0->unk_0E8.z = sp44.z; - if (fabsf((arg0->obj.pos.z + arg0->unk_13C) - gPlayer[0].unk_138) < 3000.0f) { - arg0->unk_0B8 = 2; - arg0->unk_0BC = 20; - arg0->unk_0E8.z = 0.0f; - arg0->unk_0E8.x = 0.0f; + Math_Vec3fFromAngles(&sp44, obj2F4->obj.rot.x, obj2F4->obj.rot.y, 10.0f); + obj2F4->unk_0E8.x = sp44.x; + obj2F4->unk_0E8.y = sp44.y; + obj2F4->unk_0E8.z = sp44.z; + if (fabsf((obj2F4->obj.pos.z + obj2F4->unk_13C) - gPlayer[0].unk_138) < 3000.0f) { + obj2F4->unk_0B8 = 2; + obj2F4->unk_0BC = 20; + obj2F4->unk_0E8.z = 0.0f; + obj2F4->unk_0E8.x = 0.0f; } break; case 2: - if (arg0->unk_0BC == 0) { - arg0->unk_0B8 = 3; - arg0->unk_0B6 = 1; - arg0->obj.pos.y += 30.0f; - arg0->unk_0BC = 30; - arg0->unk_0E8.y = 30.0f; - arg0->unk_10C = 1.0f; + if (obj2F4->unk_0BC == 0) { + obj2F4->unk_0B8 = 3; + obj2F4->unk_0B6 = 1; + obj2F4->obj.pos.y += 30.0f; + obj2F4->unk_0BC = 30; + obj2F4->unk_0E8.y = 30.0f; + obj2F4->unk_10C = 1.0f; } break; case 3: - if (arg0->unk_0BC == 1) { - func_8007F11C(OBJECT_353, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, D_80177828); + if (obj2F4->unk_0BC == 1) { + func_8007F11C(OBJECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828); } - if (arg0->unk_0E8.y < 12.0f) { - Math_SmoothStepToF(&arg0->obj.rot.x, 180.0f, 0.1f, 7.0f, 0.01f); + if (obj2F4->unk_0E8.y < 12.0f) { + Math_SmoothStepToF(&obj2F4->obj.rot.x, 180.0f, 0.1f, 7.0f, 0.01f); } - if (arg0->obj.pos.y < (D_80177940 + 10.0f)) { - arg0->obj.pos.y = D_80177940; - arg0->unk_0B8 = 4; - arg0->unk_0B6 = 0; - arg0->unk_0E8.y = 0.0f; - arg0->unk_10C = 0.0f; - arg0->obj.rot.x = 0.0f; + if (obj2F4->obj.pos.y < (D_80177940 + 10.0f)) { + obj2F4->obj.pos.y = D_80177940; + obj2F4->unk_0B8 = 4; + obj2F4->unk_0B6 = 0; + obj2F4->unk_0E8.y = 0.0f; + obj2F4->unk_10C = 0.0f; + obj2F4->obj.rot.x = 0.0f; } break; case 4: - if (arg0->unk_0BC == 0) { - arg0->unk_0B8 = 0; - arg0->obj.rot.y = Rand_ZeroOne() * 360.0f; + if (obj2F4->unk_0BC == 0) { + obj2F4->unk_0B8 = 0; + obj2F4->obj.rot.y = Rand_ZeroOne() * 360.0f; } break; } - if ((arg0->obj.pos.y <= (D_80177940 + 10.0f)) && !(gFrameCount & 7)) { - func_8006BB1C(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z); + if ((obj2F4->obj.pos.y <= (D_80177940 + 10.0f)) && !(gFrameCount & 7)) { + func_8006BB1C(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z); } if (!(gFrameCount & 7)) { - func_8006A900(((Rand_ZeroOne() - 0.5f) * 50.0f) + arg0->obj.pos.x, arg0->obj.pos.y + 10.0f, - ((Rand_ZeroOne() - 0.5f) * 50.0f) + arg0->obj.pos.z, 0.5f); + func_8006A900(((Rand_ZeroOne() - 0.5f) * 50.0f) + obj2F4->obj.pos.x, obj2F4->obj.pos.y + 10.0f, + ((Rand_ZeroOne() - 0.5f) * 50.0f) + obj2F4->obj.pos.z, 0.5f); } - if ((arg0->unk_0D0 != 0) && (arg0->unk_0B6 != 0)) { - func_8007BFFC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 0.0f, arg0->unk_0E8.y, 0.0f, 3.0f, 5); - Object_Kill(&arg0->obj, &arg0->unk_100); - arg0->unk_044 = 1; - func_80066254(arg0); + if ((obj2F4->unk_0D0 != 0) && (obj2F4->unk_0B6 != 0)) { + func_8007BFFC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 0.0f, obj2F4->unk_0E8.y, 0.0f, 3.0f, 5); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + obj2F4->unk_044 = 1; + func_80066254(obj2F4); } - arg0->unk_0D0 = 0; + obj2F4->unk_0D0 = 0; } f32 D_800D001C[5] = { 0.0f, 30.0f, 60.0f, -60.0f, -30.0f }; // could be in-function -void func_8006BF7C(f32 arg0, f32 arg1, f32 arg2) { +void func_8006BF7C(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 0; i < ARRAY_COUNT(D_800D001C); i++) { - func_8006A900(arg0 + D_800D001C[i], arg1, arg2, 6.0f); + func_8006A900(xPos + D_800D001C[i], yPos, zPos, 6.0f); } } // fake? gPlayer[0]. doesn't match Vec3f D_800D0030 = { 0.0f, -10.0f, 0.0f }; // could be in-function -void func_8006C008(Object_2F4* arg0) { +void func_8006C008(Object_2F4* obj2F4) { f32 sp4C; f32 sp48; f32 sp44; s32 sp40; - switch (arg0->unk_0B8) { + switch (obj2F4->unk_0B8) { case 0x28: - if (arg0->unk_04A & 4) { - arg0->obj.pos.x = arg0->unk_120 + gPlayer->unk_074; - arg0->obj.pos.z = arg0->unk_124.x + gPlayer->unk_138; + if (obj2F4->unk_04A & 4) { + obj2F4->obj.pos.x = obj2F4->unk_120 + gPlayer->unk_074; + obj2F4->obj.pos.z = obj2F4->unk_124.x + gPlayer->unk_138; } - arg0->obj.rot.x += arg0->unk_114; - arg0->obj.rot.y += arg0->unk_118; - arg0->obj.rot.z += arg0->unk_11C; - if (((arg0->unk_04A & 1) == 1) && !(arg0->unk_0BC & 3)) { - func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_110); + obj2F4->obj.rot.x += obj2F4->unk_114; + obj2F4->obj.rot.y += obj2F4->unk_118; + obj2F4->obj.rot.z += obj2F4->unk_11C; + if (((obj2F4->unk_04A & 1) == 1) && !(obj2F4->unk_0BC & 3)) { + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_110); } - if ((arg0->unk_124.y + arg0->obj.pos.y) < 0.0f) { - if (arg0->unk_050 >= 2) { - arg0->unk_11C = 0.0f; - arg0->unk_118 = 0.0f; - arg0->unk_114 = 0.0f; - arg0->unk_0E8.x = 0.0f; - arg0->unk_0E8.y = 0.0f; - arg0->unk_0E8.z = 0.0f; - arg0->unk_10C = 0.0f; + if ((obj2F4->unk_124.y + obj2F4->obj.pos.y) < 0.0f) { + if (obj2F4->unk_050 >= 2) { + obj2F4->unk_11C = 0.0f; + obj2F4->unk_118 = 0.0f; + obj2F4->unk_114 = 0.0f; + obj2F4->unk_0E8.x = 0.0f; + obj2F4->unk_0E8.y = 0.0f; + obj2F4->unk_0E8.z = 0.0f; + obj2F4->unk_10C = 0.0f; } else { - if (arg0->unk_04A & 4) { - switch (arg0->unk_046) { + if (obj2F4->unk_04A & 4) { + switch (obj2F4->unk_046) { case 2: - func_80019218(0x19000024, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x19000024, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; case 25: - func_80019218(0x29003031, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x29003031, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; } } - Math_SmoothStepToF(&arg0->unk_114, 0.0f, 0.8f, 1.0f, 0.01f); - Math_SmoothStepToF(&arg0->unk_118, 0.0f, 0.8f, 1.0f, 0.01f); - Math_SmoothStepToF(&arg0->unk_11C, 0.0f, 0.8f, 1.0f, 0.01f); - Math_SmoothStepToF(&arg0->unk_0E8.x, 0.0f, 0.5f, 1.0f, 0.01f); - arg0->obj.pos.y = 0.0f; - arg0->unk_050 += 1; - if (arg0->unk_0E8.y < 0.0f) { - if (arg0->unk_04A & 2) { - arg0->unk_0E8.y = arg0->unk_0E8.y * -0.05f; + Math_SmoothStepToF(&obj2F4->unk_114, 0.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&obj2F4->unk_118, 0.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&obj2F4->unk_11C, 0.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&obj2F4->unk_0E8.x, 0.0f, 0.5f, 1.0f, 0.01f); + obj2F4->obj.pos.y = 0.0f; + obj2F4->unk_050 += 1; + if (obj2F4->unk_0E8.y < 0.0f) { + if (obj2F4->unk_04A & 2) { + obj2F4->unk_0E8.y = obj2F4->unk_0E8.y * -0.05f; } else { - arg0->unk_0E8.y = arg0->unk_0E8.y * -0.3f; + obj2F4->unk_0E8.y = obj2F4->unk_0E8.y * -0.3f; } } } - arg0->unk_04A &= ~4; + obj2F4->unk_04A &= ~4; } break; case 0x2D: - arg0->obj.rot.y += arg0->unk_114; - arg0->obj.rot.z += arg0->unk_118; + obj2F4->obj.rot.y += obj2F4->unk_114; + obj2F4->obj.rot.z += obj2F4->unk_118; break; case 0x2E: - arg0->obj.rot.x += arg0->unk_114; - arg0->obj.rot.y += arg0->unk_118; - arg0->obj.rot.z += arg0->unk_11C; - func_E6A810_801B6E20(arg0->obj.pos.x, arg0->obj.pos.z + D_80177D20, &sp4C, &sp48, &sp4C); - if (arg0->obj.pos.y < sp48) { - arg0->obj.pos.y = sp48; - arg0->unk_058++; - if (arg0->unk_058 >= 2) { - arg0->unk_0E8.x = 0.0f; - arg0->unk_0E8.y = 0.0f; - arg0->unk_0E8.z = 0.0f; - arg0->unk_114 = 0.0f; - arg0->unk_118 = 0.0f; - arg0->unk_11C = 0.0f; - arg0->unk_10C = 0.0f; + obj2F4->obj.rot.x += obj2F4->unk_114; + obj2F4->obj.rot.y += obj2F4->unk_118; + obj2F4->obj.rot.z += obj2F4->unk_11C; + func_E6A810_801B6E20(obj2F4->obj.pos.x, obj2F4->obj.pos.z + D_80177D20, &sp4C, &sp48, &sp4C); + if (obj2F4->obj.pos.y < sp48) { + obj2F4->obj.pos.y = sp48; + obj2F4->unk_058++; + if (obj2F4->unk_058 >= 2) { + obj2F4->unk_0E8.x = 0.0f; + obj2F4->unk_0E8.y = 0.0f; + obj2F4->unk_0E8.z = 0.0f; + obj2F4->unk_114 = 0.0f; + obj2F4->unk_118 = 0.0f; + obj2F4->unk_11C = 0.0f; + obj2F4->unk_10C = 0.0f; } else { - arg0->unk_0E8.y = -arg0->unk_0E8.y * 0.3f; + obj2F4->unk_0E8.y = -obj2F4->unk_0E8.y * 0.3f; } } break; case 0x2F: - func_E6A810_801B6E20(arg0->obj.pos.x, arg0->obj.pos.z + D_80177D20, &sp4C, &sp48, &sp4C); - if (arg0->obj.pos.y < arg0->unk_120 + (-100.0f + sp48)) { - arg0->obj.pos.y = arg0->unk_120 + sp48; - arg0->unk_050 = 0; - arg0->unk_058 = 1; - arg0->unk_0E8.x = 0.0f; - arg0->unk_0E8.y = 0.0f; - arg0->unk_0E8.z = 0.0f; - arg0->unk_10C = 0.0f; - arg0->unk_114 = 0.0f; - arg0->unk_118 = 0.0f; - arg0->unk_11C = 0.0f; + func_E6A810_801B6E20(obj2F4->obj.pos.x, obj2F4->obj.pos.z + D_80177D20, &sp4C, &sp48, &sp4C); + if (obj2F4->obj.pos.y < obj2F4->unk_120 + (-100.0f + sp48)) { + obj2F4->obj.pos.y = obj2F4->unk_120 + sp48; + obj2F4->unk_050 = 0; + obj2F4->unk_058 = 1; + obj2F4->unk_0E8.x = 0.0f; + obj2F4->unk_0E8.y = 0.0f; + obj2F4->unk_0E8.z = 0.0f; + obj2F4->unk_10C = 0.0f; + obj2F4->unk_114 = 0.0f; + obj2F4->unk_118 = 0.0f; + obj2F4->unk_11C = 0.0f; } - arg0->obj.rot.x += arg0->unk_114; - arg0->obj.rot.y += arg0->unk_118; - arg0->obj.rot.z += arg0->unk_11C; - if ((arg0->unk_050 == 1) && !(gFrameCount & 7)) { - func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 2.0f); + obj2F4->obj.rot.x += obj2F4->unk_114; + obj2F4->obj.rot.y += obj2F4->unk_118; + obj2F4->obj.rot.z += obj2F4->unk_11C; + if ((obj2F4->unk_050 == 1) && !(gFrameCount & 7)) { + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 2.0f); } - if (arg0->unk_058 == 1) { - if ((arg0->unk_054 == 1) && ((arg0->unk_048 == 8) || (arg0->unk_048 == 9))) { - func_8007D2C8(arg0->obj.pos.x, sp48 + 20.0f, arg0->obj.pos.z, 8.0f); + if (obj2F4->unk_058 == 1) { + if ((obj2F4->unk_054 == 1) && ((obj2F4->unk_048 == 8) || (obj2F4->unk_048 == 9))) { + func_8007D2C8(obj2F4->obj.pos.x, sp48 + 20.0f, obj2F4->obj.pos.z, 8.0f); } - Object_Kill(&arg0->obj, &arg0->unk_100); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } break; case 0x30: @@ -547,176 +547,179 @@ void func_8006C008(Object_2F4* arg0) { case 0x34: case 0x35: case 0x37: - if (((arg0->unk_0BC == 0) || (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800D0030, 1) != 0) || - (arg0->obj.pos.y < (D_80177940 + 10.0f))) && - (arg0->unk_0BE == 0)) { - func_8007B8F8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z + 50.0f, arg0->unk_110 * 10.0f); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + if (((obj2F4->unk_0BC == 0) || (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800D0030, 1) != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 10.0f))) && + (obj2F4->unk_0BE == 0)) { + func_8007B8F8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z + 50.0f, obj2F4->unk_110 * 10.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } break; case 0x38: - Math_SmoothStepToF(&arg0->unk_110, 0.0f, 0.1f, 2.0f, 0.0001f); - if (((arg0->unk_0BC == 0) || (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800D0030, 1) != 0) || - (arg0->obj.pos.y < (D_80177940 + 10.0f))) && - (arg0->unk_0BE == 0)) { - func_8007B8F8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z + 50.0f, arg0->unk_110 * 10.0f); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + Math_SmoothStepToF(&obj2F4->unk_110, 0.0f, 0.1f, 2.0f, 0.0001f); + if (((obj2F4->unk_0BC == 0) || (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800D0030, 1) != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 10.0f))) && + (obj2F4->unk_0BE == 0)) { + func_8007B8F8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z + 50.0f, obj2F4->unk_110 * 10.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } break; case 0x3A: - if (arg0->unk_046 == 0) { - arg0->unk_046++; - arg0->unk_114 = (Rand_ZeroOne() - 0.5f) * 30.0f; - arg0->unk_118 = (Rand_ZeroOne() - 0.5f) * 30.0f; - arg0->unk_11C = (Rand_ZeroOne() - 0.5f) * 30.0f; + if (obj2F4->unk_046 == 0) { + obj2F4->unk_046++; + obj2F4->unk_114 = (Rand_ZeroOne() - 0.5f) * 30.0f; + obj2F4->unk_118 = (Rand_ZeroOne() - 0.5f) * 30.0f; + obj2F4->unk_11C = (Rand_ZeroOne() - 0.5f) * 30.0f; } - arg0->obj.rot.x += arg0->unk_114; - arg0->obj.rot.y += arg0->unk_118; - arg0->obj.rot.z += arg0->unk_11C; - if (((arg0->unk_0BC == 0) || (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800D0030, 1) != 0) || - (arg0->obj.pos.y < (D_80177940 + 10.0f))) && - (arg0->unk_0BE == 0)) { - func_8007B8F8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z + 50.0f, arg0->unk_110 * 10.0f); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + obj2F4->obj.rot.x += obj2F4->unk_114; + obj2F4->obj.rot.y += obj2F4->unk_118; + obj2F4->obj.rot.z += obj2F4->unk_11C; + if (((obj2F4->unk_0BC == 0) || (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800D0030, 1) != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 10.0f))) && + (obj2F4->unk_0BE == 0)) { + func_8007B8F8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z + 50.0f, obj2F4->unk_110 * 10.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } break; case 0x36: - if (((arg0->unk_0BC == 0) || (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800D0030, 1) != 0) || - (arg0->obj.pos.y < (D_80177940 + 10.0f))) && - (arg0->unk_0BE == 0)) { - func_8007B8F8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z + 70.0f, arg0->unk_110 * 20.0f); - func_8007B8F8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z + 70.0f, arg0->unk_110 * 20.0f); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + if (((obj2F4->unk_0BC == 0) || (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800D0030, 1) != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 10.0f))) && + (obj2F4->unk_0BE == 0)) { + func_8007B8F8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z + 70.0f, obj2F4->unk_110 * 20.0f); + func_8007B8F8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z + 70.0f, obj2F4->unk_110 * 20.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } break; case 0x32: - if ((arg0->unk_050 == 2) && (arg0->unk_0BC == 0)) { - func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 5.0f); - arg0->unk_0BC = 4; + if ((obj2F4->unk_050 == 2) && (obj2F4->unk_0BC == 0)) { + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 5.0f); + obj2F4->unk_0BC = 4; } - arg0->obj.rot.x += arg0->unk_114; - arg0->obj.rot.y += arg0->unk_118; - arg0->obj.rot.z += arg0->unk_11C; - if (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800C9F2C, 1) != 0) { - arg0->unk_0E8.x *= -0.7f; + obj2F4->obj.rot.x += obj2F4->unk_114; + obj2F4->obj.rot.y += obj2F4->unk_118; + obj2F4->obj.rot.z += obj2F4->unk_11C; + if (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800C9F2C, 1) != 0) { + obj2F4->unk_0E8.x *= -0.7f; } - if (arg0->obj.pos.y < D_80177940) { - Object_Kill(&arg0->obj, &arg0->unk_100); + if (obj2F4->obj.pos.y < D_80177940) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } break; case 0x39: - arg0->obj.rot.x += arg0->unk_114; - arg0->obj.rot.y += arg0->unk_118; - arg0->obj.rot.z += arg0->unk_11C; - if (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800C9F2C, 1) != 0) { - arg0->unk_0E8.x *= -0.7f; + obj2F4->obj.rot.x += obj2F4->unk_114; + obj2F4->obj.rot.y += obj2F4->unk_118; + obj2F4->obj.rot.z += obj2F4->unk_11C; + if (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800C9F2C, 1) != 0) { + obj2F4->unk_0E8.x *= -0.7f; } - if (arg0->obj.pos.y < D_80177940) { - if (arg0->unk_050 >= 3) { - arg0->unk_0E8.y = 0.0f; - arg0->unk_10C = 0.0f; - arg0->unk_11C = 0.0f; - arg0->unk_118 = 0.0f; - arg0->unk_114 = 0.0f; + if (obj2F4->obj.pos.y < D_80177940) { + if (obj2F4->unk_050 >= 3) { + obj2F4->unk_0E8.y = 0.0f; + obj2F4->unk_10C = 0.0f; + obj2F4->unk_11C = 0.0f; + obj2F4->unk_118 = 0.0f; + obj2F4->unk_114 = 0.0f; } else { - arg0->unk_050++; - arg0->unk_0E8.y = -arg0->unk_0E8.y * 0.7f; - arg0->obj.pos.y = D_80177940; - arg0->unk_114 *= 0.5f; - arg0->unk_118 *= 0.5f; - arg0->unk_11C *= 0.5f; + obj2F4->unk_050++; + obj2F4->unk_0E8.y = -obj2F4->unk_0E8.y * 0.7f; + obj2F4->obj.pos.y = D_80177940; + obj2F4->unk_114 *= 0.5f; + obj2F4->unk_118 *= 0.5f; + obj2F4->unk_11C *= 0.5f; } } break; default: - if (arg0->unk_046 == 0) { - arg0->unk_046++; - arg0->unk_13C = (Rand_ZeroOne() - 0.5f) * 30.0f; - arg0->unk_140 = (Rand_ZeroOne() - 0.5f) * 30.0f; - arg0->unk_144 = (Rand_ZeroOne() - 0.5f) * 30.0f; + if (obj2F4->unk_046 == 0) { + obj2F4->unk_046++; + obj2F4->unk_13C = (Rand_ZeroOne() - 0.5f) * 30.0f; + obj2F4->unk_140 = (Rand_ZeroOne() - 0.5f) * 30.0f; + obj2F4->unk_144 = (Rand_ZeroOne() - 0.5f) * 30.0f; } - arg0->obj.rot.x += arg0->unk_13C; - arg0->obj.rot.y += arg0->unk_140; - arg0->obj.rot.z += arg0->unk_144; - if (arg0->unk_0B8 == 0x46) { - if ((arg0->unk_0BC == 0) || (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800D0030, 1) != 0) || - (arg0->obj.pos.y < (D_80177940 + 10.0f))) { - Object_Kill(&arg0->obj, &arg0->unk_100); + obj2F4->obj.rot.x += obj2F4->unk_13C; + obj2F4->obj.rot.y += obj2F4->unk_140; + obj2F4->obj.rot.z += obj2F4->unk_144; + if (obj2F4->unk_0B8 == 0x46) { + if ((obj2F4->unk_0BC == 0) || (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800D0030, 1) != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 10.0f))) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } - } else if (arg0->unk_0B8 == 0x27) { - if (((arg0->unk_0BC == 0) || (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800D0030, 1) != 0) || - (arg0->obj.pos.y < (D_80177940 + 10.0f))) && - (arg0->unk_0BE == 0)) { - func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 10.0f); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + } else if (obj2F4->unk_0B8 == 0x27) { + if (((obj2F4->unk_0BC == 0) || + (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800D0030, 1) != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 10.0f))) && + (obj2F4->unk_0BE == 0)) { + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 10.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } - } else if (((arg0->unk_0B8 >= 0x29) && (arg0->unk_0B8 < 0x2D)) || (arg0->unk_0B8 == 0x3B)) { - if (((arg0->unk_0BC == 0) || (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800D0030, 1) != 0)) && - (arg0->unk_0BE == 0)) { - func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 2.0f * arg0->unk_110); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + } else if (((obj2F4->unk_0B8 >= 0x29) && (obj2F4->unk_0B8 < 0x2D)) || (obj2F4->unk_0B8 == 0x3B)) { + if (((obj2F4->unk_0BC == 0) || + (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800D0030, 1) != 0)) && + (obj2F4->unk_0BE == 0)) { + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 2.0f * obj2F4->unk_110); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } - if (func_800A73E4(&sp44, &sp40, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z) != 0) { - func_8007B228(arg0->obj.pos.x, sp44, arg0->obj.pos.z, 2.0f); - Object_Kill(&arg0->obj, &arg0->unk_100); + if (func_800A73E4(&sp44, &sp40, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z) != 0) { + func_8007B228(obj2F4->obj.pos.x, sp44, obj2F4->obj.pos.z, 2.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } - } else if (arg0->unk_0B8 >= 0xA) { - if (!(arg0->unk_0BC & 3)) { - func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_110); + } else if (obj2F4->unk_0B8 >= 0xA) { + if (!(obj2F4->unk_0BC & 3)) { + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_110); } - if (((arg0->unk_0BC == 0) || (func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800D0030, 1) != 0) || - (arg0->obj.pos.y < (D_80177940 + 10.0f))) && - (arg0->unk_0BE == 0)) { - func_8007BFFC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_0E8.x, arg0->unk_0E8.y, - arg0->unk_0E8.z, arg0->unk_110 * 1.5f, 4); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + if (((obj2F4->unk_0BC == 0) || + (func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800D0030, 1) != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 10.0f))) && + (obj2F4->unk_0BE == 0)) { + func_8007BFFC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_0E8.x, + obj2F4->unk_0E8.y, obj2F4->unk_0E8.z, obj2F4->unk_110 * 1.5f, 4); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } } else { - if ((arg0->unk_0B8 == 3) && !(arg0->unk_0BC & 7)) { - func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 1.5f); + if ((obj2F4->unk_0B8 == 3) && !(obj2F4->unk_0BC & 7)) { + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 1.5f); } - if ((func_8006351C(arg0->unk_040, &arg0->obj.pos, &D_800D0030, 1) != 0) || - (arg0->obj.pos.y < (D_80177940 + 10.0f))) { + if ((func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &D_800D0030, 1) != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 10.0f))) { if (gLevelType == 1) { - func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 2.0f); - Object_Kill(&arg0->obj, &arg0->unk_100); + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 2.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); return; } - arg0->unk_0E8.y *= -0.2f; - arg0->obj.pos.y += arg0->unk_0E8.y * 5.0f; - arg0->unk_050++; - if (arg0->unk_050 >= 2) { - Object_Kill(&arg0->obj, &arg0->unk_100); + obj2F4->unk_0E8.y *= -0.2f; + obj2F4->obj.pos.y += obj2F4->unk_0E8.y * 5.0f; + obj2F4->unk_050++; + if (obj2F4->unk_050 >= 2) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } - if ((arg0->unk_0B8 != 2) && (arg0->unk_0B8 != 4)) { - func_8006BF7C(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z); + if ((obj2F4->unk_0B8 != 2) && (obj2F4->unk_0B8 != 4)) { + func_8006BF7C(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z); } else if (gCurrentLevel == LEVEL_FORTUNA) { - func_8007BC7C(((Rand_ZeroOne() - 0.5f) * 10.0f) + arg0->obj.pos.x, arg0->obj.pos.y, - arg0->obj.pos.z, 1.0f); - func_8007BC7C(((Rand_ZeroOne() - 0.5f) * 10.0f) + arg0->obj.pos.x, arg0->obj.pos.y, - arg0->obj.pos.z, 1.0f); - func_8007BC7C(((Rand_ZeroOne() - 0.5f) * 10.0f) + arg0->obj.pos.x, arg0->obj.pos.y, - arg0->obj.pos.z, 1.0f); + func_8007BC7C(((Rand_ZeroOne() - 0.5f) * 10.0f) + obj2F4->obj.pos.x, obj2F4->obj.pos.y, + obj2F4->obj.pos.z, 1.0f); + func_8007BC7C(((Rand_ZeroOne() - 0.5f) * 10.0f) + obj2F4->obj.pos.x, obj2F4->obj.pos.y, + obj2F4->obj.pos.z, 1.0f); + func_8007BC7C(((Rand_ZeroOne() - 0.5f) * 10.0f) + obj2F4->obj.pos.x, obj2F4->obj.pos.y, + obj2F4->obj.pos.z, 1.0f); } } - if (arg0->unk_0B8 == 4) { - if ((gCurrentLevel == LEVEL_KATINA) && (arg0->unk_0BC == 0)) { - Object_Kill(&arg0->obj, &arg0->unk_100); + if (obj2F4->unk_0B8 == 4) { + if ((gCurrentLevel == LEVEL_KATINA) && (obj2F4->unk_0BC == 0)) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } } else { - if (arg0->unk_0BC & 1) { - func_8007D24C(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 1.0f); + if (obj2F4->unk_0BC & 1) { + func_8007D24C(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 1.0f); } - if ((gLevelType == 1) && (arg0->unk_0BC == 0)) { - Object_Kill(&arg0->obj, &arg0->unk_100); + if ((gLevelType == 1) && (obj2F4->unk_0BC == 0)) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } } } @@ -724,7 +727,7 @@ void func_8006C008(Object_2F4* arg0) { } } -void func_8006D0F4(Object_2F4* arg0) { +void func_8006D0F4(Object_2F4* obj2F4) { s32 i; s32 j; f32* var_s0; @@ -746,9 +749,9 @@ void func_8006D0F4(Object_2F4* arg0) { temp_ft4 = *var_s0; if (temp_ft4 != 0) { Matrix_RotateY(gCalcMatrix, -gObjects80[i].obj.rot.y * M_DTOR, 0); - spA8.x = arg0->obj.pos.x - gObjects80[i].obj.pos.x; - spA8.y = arg0->obj.pos.y - gObjects80[i].obj.pos.y; - spA8.z = arg0->obj.pos.z - gObjects80[i].obj.pos.z; + spA8.x = obj2F4->obj.pos.x - gObjects80[i].obj.pos.x; + spA8.y = obj2F4->obj.pos.y - gObjects80[i].obj.pos.y; + spA8.z = obj2F4->obj.pos.z - gObjects80[i].obj.pos.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spA8, &sp9C); var_s0++; temp_fs0 = gObjects80[i].obj.pos.x + sp9C.x; @@ -760,7 +763,7 @@ void func_8006D0F4(Object_2F4* arg0) { D_80161A7C = 10; D_80161A80 = 10; D_80161A84 = 10; - arg0->unk_0C8 = 5; + obj2F4->unk_0C8 = 5; } } } @@ -768,8 +771,8 @@ void func_8006D0F4(Object_2F4* arg0) { } } -void func_8006D350(Object_80* arg0) { - arg0->obj.rot.z += 1.0f; +void func_8006D350(Object_80* obj80) { + obj80->obj.rot.z += 1.0f; } UnkStruct_D003C D_800D003C[108] = { @@ -888,7 +891,7 @@ u8 D_800D0DBC[6][4] = { { 80, 255, 80, 255 }, { 255, 80, 80, 255 }, { 255, 255, 80, 255 }, }; -void func_8006D36C(Object_2F4* arg0) { +void func_8006D36C(Object_2F4* obj2F4) { u16** var_v1; u16* temp_s1; u16* temp_v0_4; @@ -943,781 +946,786 @@ void func_8006D36C(Object_2F4* arg0) { var_v1 = SEGMENTED_TO_VIRTUAL(D_603D9E8); break; } - temp_s1 = SEGMENTED_TO_VIRTUAL(var_v1[arg0->unk_0E4]); + temp_s1 = SEGMENTED_TO_VIRTUAL(var_v1[obj2F4->unk_0E4]); - switch (temp_s1[arg0->unk_0E6] & 0xFE00) { + switch (temp_s1[obj2F4->unk_0E6] & 0xFE00) { case 0xFE00: - arg0->unk_0B8 = 200; - if (arg0->unk_01C.unk_10 > 10000.0f) { - arg0->unk_01C.unk_10 = 100.0f; + obj2F4->unk_0B8 = 200; + if (obj2F4->unk_01C.unk_10 > 10000.0f) { + obj2F4->unk_01C.unk_10 = 100.0f; } break; case 0xD000: - func_8001A500(&arg0->unk_100); - arg0->unk_0B4 = temp_s1[arg0->unk_0E6 + 1]; - if (arg0->unk_0B4 == 40) { - arg0->unk_0C2 = 10000; + func_8001A500(&obj2F4->sfxPos); + obj2F4->unk_0B4 = temp_s1[obj2F4->unk_0E6 + 1]; + if (obj2F4->unk_0B4 == 40) { + obj2F4->unk_0C2 = 10000; } else { - arg0->unk_0C2 = 0; + obj2F4->unk_0C2 = 0; } - arg0->unk_140 = 0.0f; - arg0->unk_144 = 0.0f; - if ((arg0->unk_0B4 == 64) || (arg0->unk_0B4 == 81)) { - arg0->unk_150 = 0.0f; - } else if (arg0->unk_0B4 == 79) { - arg0->unk_01C.drawType = 2; + obj2F4->unk_140 = 0.0f; + obj2F4->unk_144 = 0.0f; + if ((obj2F4->unk_0B4 == 64) || (obj2F4->unk_0B4 == 81)) { + obj2F4->unk_150 = 0.0f; + } else if (obj2F4->unk_0B4 == 79) { + obj2F4->unk_01C.drawType = 2; } - arg0->unk_0CE = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; - if ((arg0->unk_0B4 >= 200) && (arg0->unk_0B4 < 300)) { - arg0->unk_046 = 100; - arg0->unk_01C.unk_0C = D_800CBEC4; - arg0->unk_01C.unk_1C = 1.0f; + obj2F4->unk_0CE = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; + if ((obj2F4->unk_0B4 >= 200) && (obj2F4->unk_0B4 < 300)) { + obj2F4->unk_046 = 100; + obj2F4->unk_01C.hitbox = D_800CBEC4; + obj2F4->unk_01C.unk_1C = 1.0f; for (i = 0; i < 2; i++) { if (D_80176550[i] == 0) { D_80176550[i] = 1; - arg0->unk_046 = i; + obj2F4->unk_046 = i; for (j = 0; j < 100; j++) { - D_80176878[i][j] = arg0->obj.pos.y; - D_80176B98[i][j] = arg0->obj.pos.z; + D_80176878[i][j] = obj2F4->obj.pos.y; + D_80176B98[i][j] = obj2F4->obj.pos.z; } - if (arg0->unk_0B4 == 200) { - func_80019218(0x11032049, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + if (obj2F4->unk_0B4 == 200) { + func_80019218(0x11032049, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } break; } } - if (arg0->unk_046 == 100) { - Object_Kill(&arg0->obj, &arg0->unk_100); + if (obj2F4->unk_046 == 100) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } } - if ((arg0->unk_0B4 == 2) || (arg0->unk_0B4 == 43)) { - arg0->unk_0C9 = 1; - arg0->unk_07C = 1; + if ((obj2F4->unk_0B4 == 2) || (obj2F4->unk_0B4 == 43)) { + obj2F4->unk_0C9 = 1; + obj2F4->unk_07C = 1; } - if (arg0->unk_0B4 == 81) { - arg0->unk_0C9 = 1; + if (obj2F4->unk_0B4 == 81) { + obj2F4->unk_0C9 = 1; } if (gPlayer[0].unk_1C8 == 3) { - if (arg0->unk_0B4 == 86) { + if (obj2F4->unk_0B4 == 86) { func_8001D4AC(0x36, 0x14, 0xA, 0xA); } - if (arg0->unk_0B4 == 85) { + if (obj2F4->unk_0B4 == 85) { func_8001D4AC(0x37, 0x14, 0xA, 0xA); } } - if (arg0->unk_0B4 == 103) { - arg0->unk_0B6 = 0; + if (obj2F4->unk_0B4 == 103) { + obj2F4->unk_0B6 = 0; } - if (arg0->unk_0B4 == 104) { - arg0->unk_0B6 = Animation_GetFrameCount(&D_6014658) - 1; + if (obj2F4->unk_0B4 == 104) { + obj2F4->unk_0B6 = Animation_GetFrameCount(&D_6014658) - 1; } - if (arg0->unk_0B4 < 200) { - arg0->unk_01C.unk_0C = SEGMENTED_TO_VIRTUAL(D_800D003C[arg0->unk_0B4].unk_04); - arg0->unk_110 = D_800D003C[arg0->unk_0B4].unk_08; - arg0->unk_01C.unk_16 = D_800D003C[arg0->unk_0B4].unk_14; - arg0->unk_01C.unk_14 = D_800D003C[arg0->unk_0B4].unk_15; - arg0->unk_01C.unk_19 = D_800D003C[arg0->unk_0B4].unk_17; - arg0->unk_01C.unk_1C = D_800D003C[arg0->unk_0B4].unk_18; - arg0->unk_01C.unk_20 = D_800D003C[arg0->unk_0B4].unk_1C; - if (arg0->unk_0B4 == 78) { - arg0->unk_01C.unk_18 = 0; + if (obj2F4->unk_0B4 < 200) { + obj2F4->unk_01C.hitbox = SEGMENTED_TO_VIRTUAL(D_800D003C[obj2F4->unk_0B4].unk_04); + obj2F4->unk_110 = D_800D003C[obj2F4->unk_0B4].unk_08; + obj2F4->unk_01C.unk_16 = D_800D003C[obj2F4->unk_0B4].unk_14; + obj2F4->unk_01C.unk_14 = D_800D003C[obj2F4->unk_0B4].unk_15; + obj2F4->unk_01C.unk_19 = D_800D003C[obj2F4->unk_0B4].unk_17; + obj2F4->unk_01C.unk_1C = D_800D003C[obj2F4->unk_0B4].unk_18; + obj2F4->unk_01C.bonus = D_800D003C[obj2F4->unk_0B4].unk_1C; + if (obj2F4->unk_0B4 == 78) { + obj2F4->unk_01C.damage = 0; } - arg0->unk_01C.unk_10 = D_800D003C[arg0->unk_0B4].unk_0C; - arg0->unk_178 = D_800D003C[arg0->unk_0B4].unk_10; - switch (D_800D003C[arg0->unk_0B4].unk_16) { + obj2F4->unk_01C.unk_10 = D_800D003C[obj2F4->unk_0B4].unk_0C; + obj2F4->unk_178 = D_800D003C[obj2F4->unk_0B4].unk_10; + switch (D_800D003C[obj2F4->unk_0B4].unk_16) { case 1: - if ((gCurrentLevel != LEVEL_SOLAR) && (arg0->unk_0B4 != 6) && - ((gCurrentLevel != LEVEL_CORNERIA) || (arg0->unk_0B4 != 8))) { - func_80019218(0x31000011, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + if ((gCurrentLevel != LEVEL_SOLAR) && (obj2F4->unk_0B4 != 6) && + ((gCurrentLevel != LEVEL_CORNERIA) || (obj2F4->unk_0B4 != 8))) { + func_80019218(0x31000011, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } break; case 2: - func_80019218(0x3100000C, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x3100000C, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; case 3: - func_80019218(0x11030010, &arg0->unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x11030010, &obj2F4->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; case 4: - func_80019218(0x31012039, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x31012039, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; case 5: - func_80019218(0x1900302B, &arg0->unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x1900302B, &obj2F4->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; case 6: - func_80019218(0x31000014, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x31000014, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; case 7: - func_80019218(0x31000015, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x31000015, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; } - if (gPlayer[0].unk_138 < arg0->obj.pos.z) { - arg0->unk_01C.unk_10 = 3000.0f; + if (gPlayer[0].unk_138 < obj2F4->obj.pos.z) { + obj2F4->unk_01C.unk_10 = 3000.0f; } - if (arg0->unk_01C.unk_16 == 0) { - arg0->obj.rot.z = arg0->unk_170 = arg0->unk_0F4.z; - if (arg0->unk_0B4 != 31) { - arg0->unk_0F4.z = 0.0f; + if (obj2F4->unk_01C.unk_16 == 0) { + obj2F4->obj.rot.z = obj2F4->unk_170 = obj2F4->unk_0F4.z; + if (obj2F4->unk_0B4 != 31) { + obj2F4->unk_0F4.z = 0.0f; } } } - func_8006D36C(arg0); + func_8006D36C(obj2F4); break; case 0xD200: - arg0->unk_080 = temp_s1[arg0->unk_0E6 + 1]; - if (arg0->unk_080 < 4) { - D_800CFF80[arg0->unk_080] = arg0->unk_040; + obj2F4->unk_080 = temp_s1[obj2F4->unk_0E6 + 1]; + if (obj2F4->unk_080 < 4) { + D_800CFF80[obj2F4->unk_080] = obj2F4->unk_040; } - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xE200: - arg0->unk_08C = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_090 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_08C = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_090 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x0600: - D_80177E78 = arg0->unk_040; - D_80177F10.x = arg0->obj.pos.x; - D_80177F10.y = arg0->obj.pos.y; - D_80177F10.z = arg0->obj.pos.z; - D_80177E88.x = arg0->obj.rot.x; - D_80177E88.y = arg0->obj.rot.y; - D_80177E88.z = arg0->obj.rot.z; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + D_80177E78 = obj2F4->unk_040; + D_80177F10.x = obj2F4->obj.pos.x; + D_80177F10.y = obj2F4->obj.pos.y; + D_80177F10.z = obj2F4->obj.pos.z; + D_80177E88.x = obj2F4->obj.rot.x; + D_80177E88.y = obj2F4->obj.rot.y; + D_80177E88.z = obj2F4->obj.rot.z; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xE000: - if (temp_s1[arg0->unk_0E6 + 1] == 0xE) { - arg0->unk_0B8 = 0xA; - arg0->unk_140 = 0.0f; - arg0->unk_0E6 += 2; + if (temp_s1[obj2F4->unk_0E6 + 1] == 0xE) { + obj2F4->unk_0B8 = 0xA; + obj2F4->unk_140 = 0.0f; + obj2F4->unk_0E6 += 2; break; } - if (temp_s1[arg0->unk_0E6 + 1] == 0xF) { - arg0->unk_01C.unk_0C = SEGMENTED_TO_VIRTUAL(D_800CBEC4); - arg0->unk_0B8 = 0xB; - arg0->unk_0E6 += 2; + if (temp_s1[obj2F4->unk_0E6 + 1] == 0xF) { + obj2F4->unk_01C.hitbox = SEGMENTED_TO_VIRTUAL(D_800CBEC4); + obj2F4->unk_0B8 = 0xB; + obj2F4->unk_0E6 += 2; break; } - arg0->unk_048 = temp_s1[arg0->unk_0E6 + 1]; - if (arg0->unk_048 == 3) { - arg0->unk_04C = 4; + obj2F4->unk_048 = temp_s1[obj2F4->unk_0E6 + 1]; + if (obj2F4->unk_048 == 3) { + obj2F4->unk_04C = 4; } - if (arg0->unk_048 == 0xD) { - arg0->unk_0BE = 0x32; + if (obj2F4->unk_048 == 0xD) { + obj2F4->unk_0BE = 0x32; } - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xE800: - arg0->unk_044 = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_044 = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xEC00: - func_8001D400(temp_s1[arg0->unk_0E6 + 1]); - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + func_8001D400(temp_s1[obj2F4->unk_0E6 + 1]); + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xF000: - temp_v0_4 = Message_PtrFromId(temp_s1[arg0->unk_0E6 + 1]); + temp_v0_4 = Message_PtrFromId(temp_s1[obj2F4->unk_0E6 + 1]); if ((temp_v0_4 != NULL) && (gPlayer[0].unk_1C8 == 3)) { - func_800BA808(temp_v0_4, temp_s1[arg0->unk_0E6] & 0x1FF); + func_800BA808(temp_v0_4, temp_s1[obj2F4->unk_0E6] & 0x1FF); } - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xEE00: - if ((D_80161A88 == 2) && (temp_s1[arg0->unk_0E6 + 1] != 2)) { + if ((D_80161A88 == 2) && (temp_s1[obj2F4->unk_0E6 + 1] != 2)) { func_8001A55C(&gPlayer[0].unk_460, 0x1100000B); } - D_80161A88 = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); - arg0->obj.status = 0; + D_80161A88 = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); + obj2F4->obj.status = 0; break; case 0x7000: - D_800CFF90 = temp_s1[arg0->unk_0E6] & 0x1FF; - D_80161690 = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + D_800CFF90 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + D_80161690 = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x7200: - D_801778B0[temp_s1[arg0->unk_0E6 + 1]] = 0xFF; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + gTeamHealth[temp_s1[obj2F4->unk_0E6 + 1]] = 0xFF; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x7400: - func_8001D2FC(&arg0->unk_100, temp_s1[arg0->unk_0E6 + 1]); - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + func_8001D2FC(&obj2F4->sfxPos, temp_s1[obj2F4->unk_0E6 + 1]); + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x7600: - func_8001D3A0(&arg0->unk_100, temp_s1[arg0->unk_0E6 + 1]); - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + func_8001D3A0(&obj2F4->sfxPos, temp_s1[obj2F4->unk_0E6 + 1]); + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xF400: func_800182F4(0x103200FF); func_800182F4(0x113200FF); - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xF200: - if (arg0->unk_080 == temp_s1[arg0->unk_0E6 + 1]) { - arg0->unk_0D0 = 1; - arg0->unk_0D6 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0D4 = 100; + if (obj2F4->unk_080 == temp_s1[obj2F4->unk_0E6 + 1]) { + obj2F4->unk_0D0 = 1; + obj2F4->unk_0D6 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0D4 = 100; } else { - D_80177910[temp_s1[arg0->unk_0E6 + 1]] = temp_s1[arg0->unk_0E6] & 0x1FF; + D_80177910[temp_s1[obj2F4->unk_0E6 + 1]] = temp_s1[obj2F4->unk_0E6] & 0x1FF; } - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xF800: - arg0->unk_06C = 1; + obj2F4->unk_06C = 1; for (i = 0; i < ARRAY_COUNT(gUnkEntities30); i++) { if (gUnkEntities30[i].mode == 0) { gUnkEntities30[i].mode = 1; gUnkEntities30[i].unk_28 = 3.0f; - gUnkEntities30[i].unk_04.x = arg0->obj.pos.x - arg0->unk_0E8.x; - gUnkEntities30[i].unk_04.y = arg0->obj.pos.y - arg0->unk_0E8.y; - gUnkEntities30[i].unk_04.z = arg0->obj.pos.z - arg0->unk_0E8.z; - gUnkEntities30[i].unk_2C = D_800D0DBC[temp_s1[arg0->unk_0E6 + 1]][0]; - gUnkEntities30[i].unk_2D = D_800D0DBC[temp_s1[arg0->unk_0E6 + 1]][1]; - gUnkEntities30[i].unk_2E = D_800D0DBC[temp_s1[arg0->unk_0E6 + 1]][2]; - gUnkEntities30[i].unk_2F = D_800D0DBC[temp_s1[arg0->unk_0E6 + 1]][3]; - arg0->unk_070 = i; + gUnkEntities30[i].unk_04.x = obj2F4->obj.pos.x - obj2F4->unk_0E8.x; + gUnkEntities30[i].unk_04.y = obj2F4->obj.pos.y - obj2F4->unk_0E8.y; + gUnkEntities30[i].unk_04.z = obj2F4->obj.pos.z - obj2F4->unk_0E8.z; + gUnkEntities30[i].unk_2C = D_800D0DBC[temp_s1[obj2F4->unk_0E6 + 1]][0]; + gUnkEntities30[i].unk_2D = D_800D0DBC[temp_s1[obj2F4->unk_0E6 + 1]][1]; + gUnkEntities30[i].unk_2E = D_800D0DBC[temp_s1[obj2F4->unk_0E6 + 1]][2]; + gUnkEntities30[i].unk_2F = D_800D0DBC[temp_s1[obj2F4->unk_0E6 + 1]][3]; + obj2F4->unk_070 = i; break; } } - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xFA00: - arg0->unk_06C = 0; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_06C = 0; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x5000: - arg0->unk_0B8 = 6; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_174 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 6; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_174 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; break; case 0x5200: - arg0->unk_0B8 = 7; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_174 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 7; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_174 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; break; case 0x5400: - arg0->unk_0B8 = 8; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_174 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 8; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_174 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; break; case 0x5600: - arg0->unk_0B8 = 9; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_174 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 9; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_174 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; break; case 0x5A00: - arg0->unk_0B8 = 1; - arg0->unk_054 = D_800CFF80[temp_s1[arg0->unk_0E6] & 0x1FF]; - arg0->unk_158 = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_0BC = 0; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 1; + obj2F4->unk_054 = D_800CFF80[temp_s1[obj2F4->unk_0E6] & 0x1FF]; + obj2F4->unk_158 = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_0BC = 0; + obj2F4->unk_0E6 += 2; break; case 0x5800: - arg0->unk_0B8 = 0xD; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_174 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 0xD; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_174 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; break; case 0x5C00: - arg0->unk_0B8 = 0xE; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_174 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 0xE; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_174 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; break; case 0x5E00: - arg0->unk_0B8 = 0xF; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_174 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 0xF; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_174 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; break; case 0xC000: - arg0->unk_058 = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_05C = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_058 = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_05C = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0xFC00: - if (temp_s1[arg0->unk_0E6 + 1] < arg0->unk_050) { - arg0->unk_0E6 += 2; - arg0->unk_050 = 0; - } else if ((temp_s1[arg0->unk_0E6] & 0x1FF) < 200) { - arg0->unk_0E6 = (temp_s1[arg0->unk_0E6] & 0x1FF) * 2; - arg0->unk_050++; + if (temp_s1[obj2F4->unk_0E6 + 1] < obj2F4->unk_050) { + obj2F4->unk_0E6 += 2; + obj2F4->unk_050 = 0; + } else if ((temp_s1[obj2F4->unk_0E6] & 0x1FF) < 200) { + obj2F4->unk_0E6 = (temp_s1[obj2F4->unk_0E6] & 0x1FF) * 2; + obj2F4->unk_050++; } else { - arg0->unk_0E4 = (temp_s1[arg0->unk_0E6] & 0x1FF) - 200; - arg0->unk_0E6 = 0; - arg0->unk_050 = 0; + obj2F4->unk_0E4 = (temp_s1[obj2F4->unk_0E6] & 0x1FF) - 200; + obj2F4->unk_0E6 = 0; + obj2F4->unk_050 = 0; } - func_8006D36C(arg0); + func_8006D36C(obj2F4); break; case 0x6000: - arg0->unk_0B8 = 1; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 1; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_0E6 += 2; break; case 0x0000: - arg0->unk_114 = temp_s1[arg0->unk_0E6] & 0x7F; - arg0->unk_118 = arg0->unk_114; - arg0->unk_064 = temp_s1[arg0->unk_0E6] & 0x180; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_0B8 = 1; - arg0->unk_0E6 += 2; + obj2F4->unk_114 = temp_s1[obj2F4->unk_0E6] & 0x7F; + obj2F4->unk_118 = obj2F4->unk_114; + obj2F4->unk_064 = temp_s1[obj2F4->unk_0E6] & 0x180; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_0B8 = 1; + obj2F4->unk_0E6 += 2; break; case 0x0400: - arg0->unk_16C = temp_s1[arg0->unk_0E6 + 1] & 0xFF; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_16C = temp_s1[obj2F4->unk_0E6 + 1] & 0xFF; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x0200: - arg0->unk_118 = temp_s1[arg0->unk_0E6] & 0x7F; - arg0->unk_064 = temp_s1[arg0->unk_0E6] & 0x180; - arg0->unk_0BC = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_0B8 = 1; - arg0->unk_0E6 += 2; + obj2F4->unk_118 = temp_s1[obj2F4->unk_0E6] & 0x7F; + obj2F4->unk_064 = temp_s1[obj2F4->unk_0E6] & 0x180; + obj2F4->unk_0BC = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_0B8 = 1; + obj2F4->unk_0E6 += 2; break; case 0x0800: - arg0->unk_0C0 = temp_s1[arg0->unk_0E6 + 1]; - arg0->unk_084 = 1; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_0C0 = temp_s1[obj2F4->unk_0E6 + 1]; + obj2F4->unk_084 = 1; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x1000: - arg0->unk_084 = 0; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_084 = 0; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x1200: - arg0->unk_0B8 = 2; - arg0->unk_11C = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_120 = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 2; + obj2F4->unk_11C = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_120 = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_0E6 += 2; break; case 0x1400: - arg0->unk_0B8 = 3; - arg0->unk_11C = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_120 = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 3; + obj2F4->unk_11C = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_120 = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_0E6 += 2; break; case 0x1600: - arg0->unk_0B8 = 4; - arg0->unk_11C = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_120 = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 4; + obj2F4->unk_11C = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_120 = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_0E6 += 2; break; case 0x1800: - arg0->unk_0B8 = 5; - arg0->unk_11C = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_120 = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_0E6 += 2; + obj2F4->unk_0B8 = 5; + obj2F4->unk_11C = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_120 = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_0E6 += 2; break; case 0x2000: - arg0->unk_124.x = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_124.y = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_124.z = 1.0f; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_124.x = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_124.y = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_124.z = 1.0f; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x2200: - arg0->unk_124.x = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_124.y = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_124.z = -1.0f; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_124.x = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_124.y = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_124.z = -1.0f; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x2400: - arg0->unk_130 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_134 = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_138 = 1.0f; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_130 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_134 = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_138 = 1.0f; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x2600: - arg0->unk_130 = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_134 = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_138 = -1.0f; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_130 = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_134 = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_138 = -1.0f; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x2800: - arg0->unk_13C = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_140 = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_144 = 1.0f; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_13C = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_140 = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_144 = 1.0f; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x2A00: - arg0->unk_13C = temp_s1[arg0->unk_0E6] & 0x1FF; - arg0->unk_140 = temp_s1[arg0->unk_0E6 + 1] * 0.1f; - arg0->unk_144 = -1.0f; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_13C = temp_s1[obj2F4->unk_0E6] & 0x1FF; + obj2F4->unk_140 = temp_s1[obj2F4->unk_0E6 + 1] * 0.1f; + obj2F4->unk_144 = -1.0f; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x3000: - arg0->unk_068 = 1; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_068 = 1; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; case 0x3200: - arg0->unk_068 = 0; - arg0->unk_0E6 += 2; - func_8006D36C(arg0); + obj2F4->unk_068 = 0; + obj2F4->unk_0E6 += 2; + func_8006D36C(obj2F4); break; } } -void func_8006EA50(Object_2F4* arg0) { - if ((arg0->unk_06C != 0) && (gUnkEntities30[arg0->unk_070].mode != 0)) { - gUnkEntities30[arg0->unk_070].unk_10.x = arg0->obj.pos.x; - gUnkEntities30[arg0->unk_070].unk_10.y = arg0->obj.pos.y; - gUnkEntities30[arg0->unk_070].unk_10.z = arg0->obj.pos.z; +void func_8006EA50(Object_2F4* obj2F4) { + if ((obj2F4->unk_06C != 0) && (gUnkEntities30[obj2F4->unk_070].mode != 0)) { + gUnkEntities30[obj2F4->unk_070].unk_10.x = obj2F4->obj.pos.x; + gUnkEntities30[obj2F4->unk_070].unk_10.y = obj2F4->obj.pos.y; + gUnkEntities30[obj2F4->unk_070].unk_10.z = obj2F4->obj.pos.z; } } -void func_8006EAC4(Object_8C* arg0, f32 arg1, f32 arg2, f32 arg3) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_374; - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->unk_50 = 20; - func_800612B8(&arg0->unk_1C, arg0->obj.id); - func_80019218(0x2900201D, &arg0->unk_80, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); +void func_8006EAC4(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_374; + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + obj8C->unk_50 = 20; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); + func_80019218(0x2900201D, &obj8C->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } -void func_8006EB64(f32 arg0, f32 arg1, f32 arg2) { +void func_8006EB64(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 50; i < ARRAY_COUNT(gObjects8C); i++) { if (gObjects8C[i].obj.status == 0) { - func_8006EAC4(&gObjects8C[i], arg0, arg1, arg2); + func_8006EAC4(&gObjects8C[i], xPos, yPos, zPos); break; } } } -void func_8006EBC0(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3) { - Object_2F4_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_225; - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - func_800612B8(&arg0->unk_01C, arg0->obj.id); - arg0->unk_01C.unk_16 = 2; - func_80019218(0x2900201D, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); +void func_8006EBC0(Object_2F4* obj2F4, f32 xPos, f32 yPos, f32 zPos) { + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 1; + obj2F4->obj.id = OBJECT_225; + obj2F4->obj.pos.x = xPos; + obj2F4->obj.pos.y = yPos; + obj2F4->obj.pos.z = zPos; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); + obj2F4->unk_01C.unk_16 = 2; + func_80019218(0x2900201D, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } -void func_8006EC60(f32 arg0, f32 arg1, f32 arg2) { +void func_8006EC60(f32 xPos, f32 yPos, f32 zPos) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { if (gObjects2F4[i].obj.status == 0) { - func_8006EBC0(&gObjects2F4[i], arg0, arg1, arg2); + func_8006EBC0(&gObjects2F4[i], xPos, yPos, zPos); break; } } } -void func_8006ECBC(s32 arg0, Object_70* arg1, s32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, - f32 arg9, f32 argA, f32 argB) { - func_80035E48(arg1); - arg1->obj.status = 1; - arg1->unk_20.z = arg8; - arg1->unk_20.x = arg6; - arg1->unk_20.y = arg7; - arg1->obj.pos.x = arg3; - arg1->obj.pos.y = arg4; - arg1->obj.pos.z = arg5; - arg1->obj.rot.x = arg9 + 180.0f; - arg1->obj.rot.y = argA; - arg1->obj.rot.z = -argB; - arg1->obj.id = arg0; - arg1->unk_58 = 1; - arg1->unk_60 = 0; - if (arg0 == 9) { - arg1->unk_64 = 120; +void func_8006ECBC(s32 objId, Object_70* obj70, s32 arg2, f32 xPos, f32 yPos, f32 zPos, f32 arg6, f32 arg7, f32 arg8, + f32 xRot, f32 yRot, f32 zRot) { + Object_70_Initialize(obj70); + obj70->obj.status = 1; + obj70->unk_20.z = arg8; + obj70->unk_20.x = arg6; + obj70->unk_20.y = arg7; + obj70->obj.pos.x = xPos; + obj70->obj.pos.y = yPos; + obj70->obj.pos.z = zPos; + obj70->obj.rot.x = xRot + 180.0f; + obj70->obj.rot.y = yRot; + obj70->obj.rot.z = -zRot; + obj70->obj.id = objId; + obj70->unk_58 = 1; + obj70->unk_60 = 0; + if (objId == OBJECT_9) { + obj70->unk_64 = 120; } else { - arg1->unk_64 = 30; + obj70->unk_64 = 30; } - arg1->unk_68 = arg2 + 100; + obj70->unk_68 = arg2 + 100; if (D_80177880 == 1) { if (arg2 + 100 < 104) { - func_80019218(0x2900000D, &arg1->unk_38, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x2900000D, &obj70->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else { - func_80019218(0x29002002, &arg1->unk_38, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x29002002, &obj70->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } else if ((arg2 < 60) && (gObjects2F4[arg2].obj.id == OBJECT_200) && (gObjects2F4[arg2].unk_080 > 0)) { - func_80019218(0x2900000D, &arg1->unk_38, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x2900000D, &obj70->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else if (arg2 + 100 == 200) { - arg1->unk_68 = 100; - func_80019218(0x19030037, &arg1->unk_38, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + obj70->unk_68 = 100; + func_80019218(0x19030037, &obj70->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else { - func_80019218(0x29002002, &arg1->unk_38, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x29002002, &obj70->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } -void func_8006EEFC(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { +void func_8006EEFC(s32 objId, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 arg5, f32 arg6, f32 xRot, f32 yRot, + f32 zRot) { s32 i; for (i = 0; i < 10; i++) { if (gObjects70[i].obj.status == 0) { - func_8006ECBC(1, &gObjects70[i], arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); + func_8006ECBC(1, &gObjects70[i], objId, xPos, yPos, zPos, arg4, arg5, arg6, xRot, yRot, zRot); break; } } } -void func_8006EFA0(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9) { +void func_8006EFA0(s32 objId, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 arg5, f32 arg6, f32 xRot, f32 yRot, + f32 zRot) { s32 i; for (i = 0; i < 10; i++) { if (gObjects70[i].obj.status == 0) { - func_8006ECBC(9, &gObjects70[i], arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); + func_8006ECBC(9, &gObjects70[i], objId, xPos, yPos, zPos, arg4, arg5, arg6, xRot, yRot, zRot); break; } } } -void func_8006F044(Object_8C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_347; - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->unk_6C = arg4; - arg0->unk_44 = 100; - func_800612B8(&arg0->unk_1C, arg0->obj.id); - func_8007A6F0(&arg0->obj.pos, 0x2903B009); +void func_8006F044(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_347; + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + obj8C->unk_6C = arg4; + obj8C->unk_44 = 100; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); + func_8007A6F0(&obj8C->obj.pos, 0x2903B009); } -void func_8006F0D8(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { +void func_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { if (gObjects8C[i].obj.status == 0) { - func_8006F044(&gObjects8C[i], arg0, arg1, arg2, arg3); + func_8006F044(&gObjects8C[i], xPos, yPos, zPos, arg3); break; } } } -void func_8006F140(Object_8C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_394; - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->unk_6C = arg4; - arg0->unk_44 = 100; - arg0->unk_78 = 102; - arg0->unk_7A = 18; - func_800612B8(&arg0->unk_1C, arg0->obj.id); - arg0->unk_1C.unk_18 = 40; - func_8007A6F0(&arg0->obj.pos, 0x2903B009); +void func_8006F140(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_394; + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + obj8C->unk_6C = arg4; + obj8C->unk_44 = 100; + obj8C->unk_78 = 102; + obj8C->unk_7A = 18; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); + obj8C->unk_1C.damage = 40; + func_8007A6F0(&obj8C->obj.pos, 0x2903B009); } -void func_8006F1EC(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { +void func_8006F1EC(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { if (gObjects8C[i].obj.status == 0) { - func_8006F140(&gObjects8C[i], arg0, arg1, arg2, arg3); + func_8006F140(&gObjects8C[i], xPos, yPos, zPos, arg3); break; } } } -void func_8006F254(Object_2F4* arg0) { +void func_8006F254(Object_2F4* obj2F4) { Vec3f sp54; Vec3f sp48; - Matrix_RotateY(gCalcMatrix, arg0->unk_2E8.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, arg0->unk_2E8.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (arg0->unk_2E8.z + arg0->unk_0F4.z) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, arg0->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg0->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj2F4->unk_2E8.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, obj2F4->unk_2E8.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, (obj2F4->unk_2E8.z + obj2F4->unk_0F4.z) * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj2F4->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, obj2F4->unk_0F4.x * M_DTOR, 1); sp54.x = 0.0f; sp54.y = 0.0f; sp54.z = D_80177828; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); - func_8007F04C(OBJECT_353, arg0->obj.pos.x + sp48.x, arg0->obj.pos.y + sp48.y, arg0->obj.pos.z + sp48.z, - arg0->obj.rot.x, arg0->obj.rot.y, arg0->obj.rot.z, arg0->unk_2E8.x, arg0->unk_2E8.y, - arg0->unk_2E8.z + arg0->unk_0F4.z, sp48.x, sp48.y, sp48.z, 1.0f); + func_8007F04C(OBJECT_353, obj2F4->obj.pos.x + sp48.x, obj2F4->obj.pos.y + sp48.y, obj2F4->obj.pos.z + sp48.z, + obj2F4->obj.rot.x, obj2F4->obj.rot.y, obj2F4->obj.rot.z, obj2F4->unk_2E8.x, obj2F4->unk_2E8.y, + obj2F4->unk_2E8.z + obj2F4->unk_0F4.z, sp48.x, sp48.y, sp48.z, 1.0f); } -void func_8006F40C(Object_2F4* arg0) { +void func_8006F40C(Object_2F4* obj2F4) { s32 var_v1; Vec3f sp78; Vec3f sp6C; - Object_4C* var_v0; + Object_4C* obj4C; - if ((gPlayer[0].unk_1C8 == 3) && (arg0->unk_0B4 != 0x34) && (arg0->unk_0B4 != 0x67) && (arg0->unk_0B4 != 0x68) && - (arg0->unk_0B4 != 0x30) && (arg0->unk_0B4 != 0x31) && (arg0->unk_0B4 != 0x32)) { - switch (arg0->unk_048) { + if ((gPlayer[0].unk_1C8 == 3) && (obj2F4->unk_0B4 != 0x34) && (obj2F4->unk_0B4 != 0x67) && + (obj2F4->unk_0B4 != 0x68) && (obj2F4->unk_0B4 != 0x30) && (obj2F4->unk_0B4 != 0x31) && + (obj2F4->unk_0B4 != 0x32)) { + switch (obj2F4->unk_048) { case 0: break; case 1: - func_8006F254(arg0); - arg0->unk_048 = 0; + func_8006F254(obj2F4); + obj2F4->unk_048 = 0; break; case 2: - if (arg0->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { - func_8007F11C(OBJECT_353, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, D_80177828); + if (obj2F4->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + func_8007F11C(OBJECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828); } - arg0->unk_048 = 0; + obj2F4->unk_048 = 0; break; case 3: - if (arg0->unk_0BE == 0) { - arg0->unk_0BE = 6; + if (obj2F4->unk_0BE == 0) { + obj2F4->unk_0BE = 6; sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - func_8006EEFC(arg0->unk_040, arg0->obj.pos.x + (sp6C.x * 1.5), arg0->obj.pos.y + (sp6C.y * 1.5), - arg0->obj.pos.z + (sp6C.z * 1.5), sp6C.x, sp6C.y, sp6C.z, arg0->unk_0F4.x, - arg0->unk_0F4.y, arg0->unk_2E8.z + arg0->unk_0F4.z); - arg0->unk_0C2 = 2; - arg0->unk_04C--; - if (arg0->unk_04C <= 0) { - arg0->unk_048 = 0; + func_8006EEFC(obj2F4->unk_040, obj2F4->obj.pos.x + (sp6C.x * 1.5), + obj2F4->obj.pos.y + (sp6C.y * 1.5), obj2F4->obj.pos.z + (sp6C.z * 1.5), sp6C.x, + sp6C.y, sp6C.z, obj2F4->unk_0F4.x, obj2F4->unk_0F4.y, + obj2F4->unk_2E8.z + obj2F4->unk_0F4.z); + obj2F4->unk_0C2 = 2; + obj2F4->unk_04C--; + if (obj2F4->unk_04C <= 0) { + obj2F4->unk_048 = 0; } } break; case 4: - func_8006EB64(arg0->obj.pos.x, arg0->obj.pos.y - 20.0f, arg0->obj.pos.z); - arg0->unk_048 = 0; + func_8006EB64(obj2F4->obj.pos.x, obj2F4->obj.pos.y - 20.0f, obj2F4->obj.pos.z); + obj2F4->unk_048 = 0; break; case 5: - Matrix_RotateY(gCalcMatrix, arg0->unk_2E8.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, arg0->unk_2E8.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (arg0->unk_2E8.z + arg0->unk_0F4.z) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, arg0->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg0->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj2F4->unk_2E8.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, obj2F4->unk_2E8.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, (obj2F4->unk_2E8.z + obj2F4->unk_0F4.z) * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj2F4->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, obj2F4->unk_0F4.x * M_DTOR, 1); sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = D_80177828; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - func_8007F04C(OBJECT_355, arg0->obj.pos.x + sp6C.x, arg0->obj.pos.y + sp6C.y, arg0->obj.pos.z + sp6C.z, - arg0->obj.rot.x, arg0->obj.rot.y, arg0->obj.rot.z, arg0->unk_2E8.x, arg0->unk_2E8.y, - arg0->unk_2E8.z + arg0->unk_0F4.z, sp6C.x, sp6C.y, sp6C.z, 1.0f); - arg0->unk_048 = 0; + func_8007F04C(OBJECT_355, obj2F4->obj.pos.x + sp6C.x, obj2F4->obj.pos.y + sp6C.y, + obj2F4->obj.pos.z + sp6C.z, obj2F4->obj.rot.x, obj2F4->obj.rot.y, obj2F4->obj.rot.z, + obj2F4->unk_2E8.x, obj2F4->unk_2E8.y, obj2F4->unk_2E8.z + obj2F4->unk_0F4.z, sp6C.x, + sp6C.y, sp6C.z, 1.0f); + obj2F4->unk_048 = 0; break; case 6: - if (arg0->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { - func_8007F11C(OBJECT_355, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, D_80177828); + if (obj2F4->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + func_8007F11C(OBJECT_355, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828); } - arg0->unk_048 = 0; + obj2F4->unk_048 = 0; break; case 7: - if (arg0->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { - func_8007F11C(OBJECT_356, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 60.0f); + if (obj2F4->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) { + func_8007F11C(OBJECT_356, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 60.0f); } - arg0->unk_048 = 0; + obj2F4->unk_048 = 0; break; case 8: sp6C.x = gPlayer[0].unk_074; sp6C.y = gPlayer[0].unk_078; gPlayer[0].unk_074 += (Rand_ZeroOne() - 0.5f) * 300.0f; gPlayer[0].unk_078 += (Rand_ZeroOne() - 0.5f) * 300.0f; - func_8007F11C(OBJECT_353, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, D_80177828); + func_8007F11C(OBJECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828); gPlayer[0].unk_074 = sp6C.x; gPlayer[0].unk_078 = sp6C.y; - arg0->unk_048 = 0; + obj2F4->unk_048 = 0; break; case 9: if (gCurrentLevel == LEVEL_AQUAS) { - func_8006F1EC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 12.0f); + func_8006F1EC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 12.0f); } else { - func_8006F0D8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 40.0f); + func_8006F0D8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 40.0f); } - Object_Kill(&arg0->obj, &arg0->unk_100); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); break; case 10: if (gCurrentLevel == LEVEL_AQUAS) { - func_8006F1EC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 6.0f); + func_8006F1EC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 6.0f); } else { - func_8006F0D8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 15.0f); + func_8006F0D8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 15.0f); } - Object_Kill(&arg0->obj, &arg0->unk_100); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); break; case 11: - func_8007BFFC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_0E8.x, arg0->unk_0E8.y, - arg0->unk_0E8.z, arg0->unk_110 * 3.0f, 15); - func_80066254(arg0); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x2903B009); + func_8007BFFC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_0E8.x, + obj2F4->unk_0E8.y, obj2F4->unk_0E8.z, obj2F4->unk_110 * 3.0f, 15); + func_80066254(obj2F4); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x2903B009); break; case 12: - func_80066254(arg0); - Object_Kill(&arg0->obj, &arg0->unk_100); + func_80066254(obj2F4); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); break; case 13: - if (arg0->unk_0BE > 25) { - Math_SmoothStepToF(&arg0->unk_150, 90.0f, 0.2f, 8.0f, 0.01f); + if (obj2F4->unk_0BE > 25) { + Math_SmoothStepToF(&obj2F4->unk_150, 90.0f, 0.2f, 8.0f, 0.01f); } - if (arg0->unk_0BE < 25) { - Math_SmoothStepToF(&arg0->unk_150, 0.0f, 0.2f, 8.0f, 0.01f); + if (obj2F4->unk_0BE < 25) { + Math_SmoothStepToF(&obj2F4->unk_150, 0.0f, 0.2f, 8.0f, 0.01f); } - if (arg0->unk_0BE == 30) { - func_8006EC60(arg0->obj.pos.x, arg0->obj.pos.y - 50.0f, arg0->obj.pos.z); + if (obj2F4->unk_0BE == 30) { + func_8006EC60(obj2F4->obj.pos.x, obj2F4->obj.pos.y - 50.0f, obj2F4->obj.pos.z); } - if (arg0->unk_0BE == 0) { - arg0->unk_048 = 0; + if (obj2F4->unk_0BE == 0) { + obj2F4->unk_048 = 0; } break; case 16: - func_8007F11C(OBJECT_353, arg0->obj.pos.x + 190.0f, arg0->obj.pos.y + 90.0f, arg0->obj.pos.z + 220.0f, - D_80177828); - func_8007F11C(OBJECT_353, arg0->obj.pos.x - 190.0f, arg0->obj.pos.y + 90.0f, arg0->obj.pos.z + 220.0f, - D_80177828); - arg0->unk_048 = 0; + func_8007F11C(OBJECT_353, obj2F4->obj.pos.x + 190.0f, obj2F4->obj.pos.y + 90.0f, + obj2F4->obj.pos.z + 220.0f, D_80177828); + func_8007F11C(OBJECT_353, obj2F4->obj.pos.x - 190.0f, obj2F4->obj.pos.y + 90.0f, + obj2F4->obj.pos.z + 220.0f, D_80177828); + obj2F4->unk_048 = 0; break; case 17: - if (arg0->obj.pos.z < (gPlayer[0].unk_040.z - 600.0f)) { - func_8007F20C(OBJECT_353, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, D_80177828); + if (obj2F4->obj.pos.z < (gPlayer[0].unk_040.z - 600.0f)) { + func_8007F20C(OBJECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828); } - arg0->unk_048 = 0; + obj2F4->unk_048 = 0; break; case 18: - for (var_v1 = 0, var_v0 = gObjects4C; var_v1 < 40; var_v1++, var_v0++) { + for (var_v1 = 0, obj4C = gObjects4C; var_v1 < 40; var_v1++, obj4C++) { - if ((var_v0->obj.status == 2) && (var_v0->obj.id == OBJECT_175)) { + if ((obj4C->obj.status == 2) && (obj4C->obj.id == OBJECT_175)) { f32 sp64; f32 sp60; f32 sp5C; f32 sp58; f32 sp54; - var_v0->obj.status = 0; - sp64 = var_v0->obj.pos.x - arg0->obj.pos.x; - sp60 = var_v0->obj.pos.y - arg0->obj.pos.y; - sp5C = var_v0->obj.pos.z - arg0->obj.pos.z; + obj4C->obj.status = 0; + sp64 = obj4C->obj.pos.x - obj2F4->obj.pos.x; + sp60 = obj4C->obj.pos.y - obj2F4->obj.pos.y; + sp5C = obj4C->obj.pos.z - obj2F4->obj.pos.z; sp54 = Math_Atan2F(sp64, sp5C); sp54 = Math_RadToDeg(sp54); sp58 = -Math_Atan2F(sp60, sqrtf(SQ(sp64) + SQ(sp5C))); @@ -1728,63 +1736,64 @@ void func_8006F40C(Object_2F4* arg0) { sp6C.y = 0.0f; sp6C.z = 50.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp78); - func_8006EFA0(100, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, sp78.x, sp78.y, sp78.z, - sp58, sp54, 0.0f); + func_8006EFA0(100, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, sp78.x, sp78.y, + sp78.z, sp58, sp54, 0.0f); break; } } - arg0->unk_048 = 0; + obj2F4->unk_048 = 0; break; case 19: - func_80083D2C(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 40.0f); - arg0->unk_048 = 0; + func_80083D2C(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 40.0f); + obj2F4->unk_048 = 0; break; } } } -void func_8006FE28(Object_2F4* arg0) { - if ((fabsf(arg0->obj.pos.x - gPlayer[0].unk_074) < 100.0f) && - (fabsf(arg0->obj.pos.y - gPlayer[0].unk_078) < 100.0f) && - (fabsf(arg0->obj.pos.z - gPlayer[0].unk_138) < 50.0f)) { +void func_8006FE28(Object_2F4* obj2F4) { + if ((fabsf(obj2F4->obj.pos.x - gPlayer[0].unk_074) < 100.0f) && + (fabsf(obj2F4->obj.pos.y - gPlayer[0].unk_078) < 100.0f) && + (fabsf(obj2F4->obj.pos.z - gPlayer[0].unk_138) < 50.0f)) { func_80067A40(); - func_8001A55C(&arg0->unk_100, 0x1900302B); - Object_Kill(&arg0->obj, &arg0->unk_100); + func_8001A55C(&obj2F4->sfxPos, 0x1900302B); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } } -void func_8006FEEC(Object_2F4* arg0) { +void func_8006FEEC(Object_2F4* obj2F4) { s32 i; - if ((arg0->unk_0D0 != 0) && (arg0->unk_0CE != 0)) { - arg0->unk_0D0 = 0; - arg0->unk_0C6 = 0xF; - arg0->unk_0CE = arg0->unk_0CE - arg0->unk_0D6; - if (arg0->unk_0CE <= 0) { + if ((obj2F4->unk_0D0 != 0) && (obj2F4->unk_0CE != 0)) { + obj2F4->unk_0D0 = 0; + obj2F4->unk_0C6 = 0xF; + obj2F4->unk_0CE = obj2F4->unk_0CE - obj2F4->unk_0D6; + if (obj2F4->unk_0CE <= 0) { for (i = 3; i < 11; i++) { - func_E16C50_801900FC(&arg0->unk_18C[i], &arg0->unk_18C[i + 11], (Rand_ZeroOne() - 0.5f) * 20.0f, - Rand_ZeroOne() * -10.0f, Rand_ZeroOne() * 10.0f, 41, arg0->unk_110, 200, i); + func_E16C50_801900FC(&obj2F4->unk_18C[i], &obj2F4->unk_18C[i + 11], (Rand_ZeroOne() - 0.5f) * 20.0f, + Rand_ZeroOne() * -10.0f, Rand_ZeroOne() * 10.0f, 41, obj2F4->unk_110, 200, i); } - arg0->unk_044 = 0; - func_80066254(arg0); - Object_Kill(&arg0->obj, &arg0->unk_100); - func_8007A6F0(&arg0->obj.pos, 0x29018036); - func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 4.0f); + obj2F4->unk_044 = 0; + func_80066254(obj2F4); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_8007A6F0(&obj2F4->obj.pos, 0x29018036); + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 4.0f); } else { - func_80019218(0x29033037, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x29033037, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } } -bool func_800700A4(Object_2F4* arg0) { - if ((arg0->unk_0B8 != 12) && (arg0->unk_080 > 0) && (arg0->unk_080 < 4) && (D_801778B0[arg0->unk_080] <= 0)) { - arg0->unk_0B8 = 12; - arg0->unk_058 = 0; - arg0->unk_13C = 360.0f; - arg0->unk_140 = 20.0f; - D_801778B0[arg0->unk_080] = 1; - switch (arg0->unk_080) { +bool func_800700A4(Object_2F4* obj2F4) { + if ((obj2F4->unk_0B8 != 12) && (obj2F4->unk_080 > 0) && (obj2F4->unk_080 < 4) && + (gTeamHealth[obj2F4->unk_080] <= 0)) { + obj2F4->unk_0B8 = 12; + obj2F4->unk_058 = 0; + obj2F4->unk_13C = 360.0f; + obj2F4->unk_140 = 20.0f; + gTeamHealth[obj2F4->unk_080] = 1; + switch (obj2F4->unk_080) { case 1: func_800BA808(gMsg_ID_20220, RCID_FALCO); break; @@ -1795,166 +1804,168 @@ bool func_800700A4(Object_2F4* arg0) { func_800BA808(gMsg_ID_20221, RCID_PEPPY); break; } - D_801778B0[arg0->unk_080] = -1; - D_80177910[arg0->unk_080] = 0; - arg0->unk_0C2 = 5000; - arg0->unk_0D0 = 0; + gTeamHealth[obj2F4->unk_080] = -1; + D_80177910[obj2F4->unk_080] = 0; + obj2F4->unk_0C2 = 5000; + obj2F4->unk_0D0 = 0; return true; } return false; } -void func_800701E0(Object_2F4* arg0) { +void func_800701E0(Object_2F4* obj2F4) { Vec3f sp3C; f32 var_fv1; f32 temp_fv1; - if (func_800700A4(arg0) == 0) { - if ((arg0->unk_0D0 != 0) && (arg0->unk_0B4 == 0x43) && (arg0->unk_0D2 == 0)) { - arg0->unk_0D0 = 0; + if (func_800700A4(obj2F4) == 0) { + if ((obj2F4->unk_0D0 != 0) && (obj2F4->unk_0B4 == 0x43) && (obj2F4->unk_0D2 == 0)) { + obj2F4->unk_0D0 = 0; } - if ((arg0->unk_0D0 != 0) && (arg0->unk_0B4 == 0x53) && (arg0->unk_0C2 >= 2)) { - arg0->unk_0D0 = 0; + if ((obj2F4->unk_0D0 != 0) && (obj2F4->unk_0B4 == 0x53) && (obj2F4->unk_0C2 >= 2)) { + obj2F4->unk_0D0 = 0; } - if ((arg0->unk_0D0 != 0) && (((arg0->unk_0B4 == 0x40) && (arg0->unk_0D2 == 2)) || (arg0->unk_0B4 != 0x40))) { - if (arg0->unk_080 >= 4) { - arg0->unk_0D6 = 0; + if ((obj2F4->unk_0D0 != 0) && + (((obj2F4->unk_0B4 == 0x40) && (obj2F4->unk_0D2 == 2)) || (obj2F4->unk_0B4 != 0x40))) { + if (obj2F4->unk_080 >= 4) { + obj2F4->unk_0D6 = 0; } - if ((arg0->unk_080 > 0) && (arg0->unk_080 < 4)) { - D_801778B0[arg0->unk_080] -= arg0->unk_0D6; - } else if ((arg0->unk_0B4 == 0x53) && ((arg0->unk_0D6 == 0x1E) || (arg0->unk_0D6 == 0x1F))) { - arg0->unk_0CE = 0; + if ((obj2F4->unk_080 > 0) && (obj2F4->unk_080 < 4)) { + gTeamHealth[obj2F4->unk_080] -= obj2F4->unk_0D6; + } else if ((obj2F4->unk_0B4 == 0x53) && ((obj2F4->unk_0D6 == 0x1E) || (obj2F4->unk_0D6 == 0x1F))) { + obj2F4->unk_0CE = 0; } else { - arg0->unk_0CE -= arg0->unk_0D6; + obj2F4->unk_0CE -= obj2F4->unk_0D6; } - if (arg0->unk_0CE <= 0) { - if (arg0->unk_0B4 == 0x6A) { - func_80077240(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 3); + if (obj2F4->unk_0CE <= 0) { + if (obj2F4->unk_0B4 == 0x6A) { + func_80077240(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 3); gHitCount += 4; D_80177850 = 0xF; } - if (arg0->unk_0B4 != 0x53) { - if ((arg0->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) { - func_80019218(0x29018036, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + if (obj2F4->unk_0B4 != 0x53) { + if ((obj2F4->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) { + func_80019218(0x29018036, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else { - func_80019218(0x2903700B, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x2903700B, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } - arg0->obj.status = 3; + obj2F4->obj.status = 3; var_fv1 = 0.7f; if (gLevelType == 1) { var_fv1 = 0.3f; } - if (((Rand_ZeroOne() < var_fv1) || (arg0->unk_080 != 0)) && (arg0->unk_01C.unk_14 == 0) && - (arg0->unk_0B4 != 0xD) && (arg0->unk_0B4 != 0xE) && (arg0->unk_0B4 != 0x3D) && - ((s32) arg0->unk_0D6 < 0x1F) && (arg0->unk_0B4 != 0x3E) && (arg0->unk_0B4 != 0x40) && - (arg0->unk_0B4 != 0x48) && (arg0->unk_0B4 != 0x44)) { - func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_110 * 4.0f); - arg0->unk_0D0 = 0; + if (((Rand_ZeroOne() < var_fv1) || (obj2F4->unk_080 != 0)) && (obj2F4->unk_01C.unk_14 == 0) && + (obj2F4->unk_0B4 != 0xD) && (obj2F4->unk_0B4 != 0xE) && (obj2F4->unk_0B4 != 0x3D) && + ((s32) obj2F4->unk_0D6 < 0x1F) && (obj2F4->unk_0B4 != 0x3E) && (obj2F4->unk_0B4 != 0x40) && + (obj2F4->unk_0B4 != 0x48) && (obj2F4->unk_0B4 != 0x44)) { + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_110 * 4.0f); + obj2F4->unk_0D0 = 0; } - arg0->unk_0C2 = 0xA; - arg0->unk_0BE = 0; - arg0->unk_046 = 0xFF; - arg0->unk_048 = 0x384; - arg0->unk_0C9 = 1; + obj2F4->unk_0C2 = 0xA; + obj2F4->unk_0BE = 0; + obj2F4->unk_046 = 0xFF; + obj2F4->unk_048 = 0x384; + obj2F4->unk_0C9 = 1; if (gLevelType == 0) { - arg0->unk_04C = (s16) (s32) (Rand_ZeroOne() * 2.9f); - if (arg0->unk_0B4 == 2) { - arg0->unk_04C = 1; - if (arg0->obj.pos.x < arg0->unk_0D8.x) { - func_800A69F8(1, arg0->obj.pos.x + 20.0f, arg0->obj.pos.y, arg0->obj.pos.z); - arg0->unk_158 = 777.0f; + obj2F4->unk_04C = (s16) (s32) (Rand_ZeroOne() * 2.9f); + if (obj2F4->unk_0B4 == 2) { + obj2F4->unk_04C = 1; + if (obj2F4->obj.pos.x < obj2F4->unk_0D8.x) { + func_800A69F8(1, obj2F4->obj.pos.x + 20.0f, obj2F4->obj.pos.y, obj2F4->obj.pos.z); + obj2F4->unk_158 = 777.0f; } else { - func_800A69F8(0, arg0->obj.pos.x - 20.0f, arg0->obj.pos.y, arg0->obj.pos.z); - arg0->unk_15C = 777.0f; + func_800A69F8(0, obj2F4->obj.pos.x - 20.0f, obj2F4->obj.pos.y, obj2F4->obj.pos.z); + obj2F4->unk_15C = 777.0f; } } - arg0->unk_0BC = 0x12C; + obj2F4->unk_0BC = 0x12C; if (D_80177880 != 1) { - arg0->unk_0E8.x *= 0.5f; - arg0->unk_0E8.y = Rand_ZeroOne() * 5.0f; - if (arg0->unk_0E8.z < 0.0f) { - arg0->unk_0E8.z = arg0->unk_0E8.z; + obj2F4->unk_0E8.x *= 0.5f; + obj2F4->unk_0E8.y = Rand_ZeroOne() * 5.0f; + if (obj2F4->unk_0E8.z < 0.0f) { + obj2F4->unk_0E8.z = obj2F4->unk_0E8.z; } else { - arg0->unk_0E8.z = arg0->unk_0E8.z * 0.3f; + obj2F4->unk_0E8.z = obj2F4->unk_0E8.z * 0.3f; } - if (((arg0->obj.pos.z + D_80177D20) > -3000.0f) && (arg0->unk_0E8.z > 0.0f)) { - arg0->unk_0E8.z = Rand_ZeroOne() * -10.0f; + if (((obj2F4->obj.pos.z + D_80177D20) > -3000.0f) && (obj2F4->unk_0E8.z > 0.0f)) { + obj2F4->unk_0E8.z = Rand_ZeroOne() * -10.0f; } } - if (arg0->unk_0B4 == 0x5A) { - arg0->unk_04C = 0x3E7; + if (obj2F4->unk_0B4 == 0x5A) { + obj2F4->unk_04C = 0x3E7; } } else { - switch (arg0->unk_0B4) { + switch (obj2F4->unk_0B4) { case 0xD: - func_800654E4(&arg0->obj); + func_800654E4(&obj2F4->obj); break; case 0x3D: - func_E08400_8018CCF8(arg0); + func_E08400_8018CCF8(obj2F4); break; case 0x1B: - arg0->obj.pos.y -= arg0->unk_0E8.y; - arg0->obj.status = 2; - func_8007D0E0(arg0->obj.pos.x - arg0->unk_0E8.x, arg0->obj.pos.y + 30.0f, - arg0->obj.pos.z - arg0->unk_0E8.z, arg0->unk_110 * 5.0f); - arg0->unk_0D0 = 0; - arg0->unk_0C2 = 0x2710; - arg0->unk_01C.unk_1C = 0.0f; - gHitCount += arg0->unk_01C.unk_20; + obj2F4->obj.pos.y -= obj2F4->unk_0E8.y; + obj2F4->obj.status = 2; + func_8007D0E0(obj2F4->obj.pos.x - obj2F4->unk_0E8.x, obj2F4->obj.pos.y + 30.0f, + obj2F4->obj.pos.z - obj2F4->unk_0E8.z, obj2F4->unk_110 * 5.0f); + obj2F4->unk_0D0 = 0; + obj2F4->unk_0C2 = 0x2710; + obj2F4->unk_01C.unk_1C = 0.0f; + gHitCount += obj2F4->unk_01C.bonus; D_80177850 = 0xF; break; default: - arg0->unk_0BC = 0x23; - arg0->unk_04C = 2; - arg0->unk_0E8.y = (Rand_ZeroOne() - 0.5f) * 20.0f; - arg0->unk_0E8.x = (Rand_ZeroOne() - 0.5f) * 20.0f; - arg0->unk_0E8.z = 0.0f; + obj2F4->unk_0BC = 0x23; + obj2F4->unk_04C = 2; + obj2F4->unk_0E8.y = (Rand_ZeroOne() - 0.5f) * 20.0f; + obj2F4->unk_0E8.x = (Rand_ZeroOne() - 0.5f) * 20.0f; + obj2F4->unk_0E8.z = 0.0f; break; } } } - if (arg0->unk_0B4 == 0x52) { - func_80019218(0x11000055, &arg0->unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - arg0->unk_0D0 = 1; - func_8007C688(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 3.0f, 0x3C); + if (obj2F4->unk_0B4 == 0x52) { + func_80019218(0x11000055, &obj2F4->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + obj2F4->unk_0D0 = 1; + func_8007C688(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 3.0f, 0x3C); } } else { - arg0->unk_0C6 = 0x14; - if ((arg0->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) { - func_80019218(0x29033037, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - } else if (arg0->unk_0CE < 0x14) { - func_80019218(0x2943500F, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + obj2F4->unk_0C6 = 0x14; + if ((obj2F4->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) { + func_80019218(0x29033037, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } else if (obj2F4->unk_0CE < 0x14) { + func_80019218(0x2943500F, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else { - func_80019218(0x2903300E, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x2903300E, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } - if ((arg0->unk_0B4 != 0xD) && (arg0->unk_0B4 != 0x3D) && (arg0->unk_0B4 != 0x53)) { - func_8007D10C(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_110 * 1.5f); + if ((obj2F4->unk_0B4 != 0xD) && (obj2F4->unk_0B4 != 0x3D) && (obj2F4->unk_0B4 != 0x53)) { + func_8007D10C(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_110 * 1.5f); } - if (((D_80177880 == 1) || (D_80177880 == 2)) && (arg0->unk_0B4 != 0x15) && (arg0->unk_0B4 != 0x17)) { - arg0->unk_148 = 20.0f; - if (arg0->obj.pos.x < arg0->unk_0D8.x) { - arg0->unk_148 *= -1.0f; + if (((D_80177880 == 1) || (D_80177880 == 2)) && (obj2F4->unk_0B4 != 0x15) && + (obj2F4->unk_0B4 != 0x17)) { + obj2F4->unk_148 = 20.0f; + if (obj2F4->obj.pos.x < obj2F4->unk_0D8.x) { + obj2F4->unk_148 *= -1.0f; } } - if (arg0->unk_0D4 == 1) { - switch (arg0->unk_080) { + if (obj2F4->unk_0D4 == 1) { + switch (obj2F4->unk_080) { case 1: - if (arg0->unk_0D0 == 3) { + if (obj2F4->unk_0D0 == 3) { func_8006A7B0(gMsg_ID_20210, RCID_FALCO); } else { func_8006A7B0(gMsg_ID_20060, RCID_FALCO); } break; case 3: - if (arg0->unk_0D0 == 3) { + if (obj2F4->unk_0D0 == 3) { func_8006A7B0(gMsg_ID_20200, RCID_PEPPY); } else { func_8006A7B0(gMsg_ID_20070, RCID_PEPPY); } break; case 2: - if (arg0->unk_0D0 == 3) { + if (obj2F4->unk_0D0 == 3) { func_8006A7B0(gMsg_ID_20190, RCID_SLIPPY); } else { func_8006A7B0(gMsg_ID_20080, RCID_SLIPPY); @@ -1968,341 +1979,341 @@ void func_800701E0(Object_2F4* arg0) { break; } } - arg0->unk_0D0 = 0; + obj2F4->unk_0D0 = 0; } } - if ((arg0->unk_080 == 0) && (arg0->unk_084 == 0) && (arg0->unk_01C.unk_16 != 2) && (gLevelType == 1)) { - sp3C.x = arg0->unk_0E8.x; - sp3C.y = arg0->unk_0E8.y; - sp3C.z = arg0->unk_0E8.z; - if ((func_8006351C(arg0->unk_040, &arg0->obj.pos, &sp3C, 0) != 0) || - (arg0->obj.pos.y < (D_80177940 + 20.0f))) { - arg0->obj.status = 3; - arg0->obj.pos.z -= arg0->unk_0E8.z; - arg0->unk_0D0 = 1; - if (arg0->unk_0B4 == 13) { - arg0->obj.id = OBJECT_182; - func_800654E4(&arg0->obj); + if ((obj2F4->unk_080 == 0) && (obj2F4->unk_084 == 0) && (obj2F4->unk_01C.unk_16 != 2) && (gLevelType == 1)) { + sp3C.x = obj2F4->unk_0E8.x; + sp3C.y = obj2F4->unk_0E8.y; + sp3C.z = obj2F4->unk_0E8.z; + if ((func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &sp3C, 0) != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 20.0f))) { + obj2F4->obj.status = 3; + obj2F4->obj.pos.z -= obj2F4->unk_0E8.z; + obj2F4->unk_0D0 = 1; + if (obj2F4->unk_0B4 == 13) { + obj2F4->obj.id = OBJECT_182; + func_800654E4(&obj2F4->obj); } - if (arg0->unk_0B4 == 61) { - func_E08400_8018CCF8(arg0); + if (obj2F4->unk_0B4 == 61) { + func_E08400_8018CCF8(obj2F4); } } } } } -void func_80070BA8(Object_2F4* arg0) { - if (arg0->unk_0D0 != 0) { - arg0->unk_0D0 = 0; - if ((arg0->unk_0B4 != 0x11) || ((arg0->unk_0B4 == 0x11) && (arg0->unk_0D2 == 0))) { - arg0->unk_0C6 = 0xA; - func_8007C120(arg0->unk_0D8.x, arg0->unk_0D8.y, arg0->unk_0D8.z, arg0->unk_0E8.x, arg0->unk_0E8.y, - arg0->unk_0E8.z, 0.2f, 0xA); - arg0->unk_0CE -= arg0->unk_0D6; - func_80019218(0x29033064, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - if (arg0->unk_0CE <= 0) { - func_80077240(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_01C.unk_20); - gHitCount += arg0->unk_01C.unk_20 + 1; - D_80177850 = 0xF; +void func_80070BA8(Object_2F4* obj2F4) { + if (obj2F4->unk_0D0 != 0) { + obj2F4->unk_0D0 = 0; + if ((obj2F4->unk_0B4 != 0x11) || ((obj2F4->unk_0B4 == 0x11) && (obj2F4->unk_0D2 == 0))) { + obj2F4->unk_0C6 = 10; + func_8007C120(obj2F4->unk_0D8.x, obj2F4->unk_0D8.y, obj2F4->unk_0D8.z, obj2F4->unk_0E8.x, obj2F4->unk_0E8.y, + obj2F4->unk_0E8.z, 0.2f, 10); + obj2F4->unk_0CE -= obj2F4->unk_0D6; + func_80019218(0x29033064, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + if (obj2F4->unk_0CE <= 0) { + func_80077240(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_01C.bonus); + gHitCount += obj2F4->unk_01C.bonus + 1; + D_80177850 = 15; } } else { - func_80019218(0x29121007, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x29121007, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } } -void func_80070CEC(Object_2F4* arg0) { - if (arg0->unk_05C < 200) { - arg0->unk_0E6 = arg0->unk_05C * 2; - arg0->unk_050 = 0; - arg0->unk_058 = 0; - func_8006D36C(arg0); +void func_80070CEC(Object_2F4* obj2F4) { + if (obj2F4->unk_05C < 200) { + obj2F4->unk_0E6 = obj2F4->unk_05C * 2; + obj2F4->unk_050 = 0; + obj2F4->unk_058 = 0; + func_8006D36C(obj2F4); } else { - arg0->unk_0E4 = arg0->unk_05C - 200; - arg0->unk_0E6 = 0; - arg0->unk_050 = 0; - arg0->unk_058 = 0; - func_8006D36C(arg0); + obj2F4->unk_0E4 = obj2F4->unk_05C - 200; + obj2F4->unk_0E6 = 0; + obj2F4->unk_050 = 0; + obj2F4->unk_058 = 0; + func_8006D36C(obj2F4); } } -void func_80070D44(Object_2F4* arg0) { +void func_80070D44(Object_2F4* obj2F4) { s32 i; s32 var_v1 = 0; s32 var_v1_4; - Object_2F4* temp; + Object_2F4* other2F4; for (i = 1; i < 4; i++) { - if (D_801778B0[i] > 0) { + if (gTeamHealth[i] > 0) { var_v1++; } } - if (arg0->unk_058 >= 100) { - if (fabsf(arg0->obj.pos.z - gPlayer[0].unk_138) <= ((arg0->unk_058 - 100) * 100.0f)) { - func_80070CEC(arg0); + if (obj2F4->unk_058 >= 100) { + if (fabsf(obj2F4->obj.pos.z - gPlayer[0].unk_138) <= ((obj2F4->unk_058 - 100) * 100.0f)) { + func_80070CEC(obj2F4); } return; } - switch (arg0->unk_058) { + switch (obj2F4->unk_058) { case 0: break; case 0x1: - if ((gObjects2F4[arg0->unk_054].obj.status != 2) || (gObjects2F4[arg0->unk_054].unk_0CE <= 0) || - (arg0->unk_078 != gObjects2F4[arg0->unk_054].unk_0E4)) { - func_80070CEC(arg0); + if ((gObjects2F4[obj2F4->unk_054].obj.status != 2) || (gObjects2F4[obj2F4->unk_054].unk_0CE <= 0) || + (obj2F4->unk_078 != gObjects2F4[obj2F4->unk_054].unk_0E4)) { + func_80070CEC(obj2F4); } break; case 0x2: if (var_v1 == 3) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x3: if (var_v1 == 2) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x4: if (var_v1 == 1) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x5: if (var_v1 == 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x6: - if (D_801778B0[1] > 0) { - func_80070CEC(arg0); + if (gTeamHealth[1] > 0) { + func_80070CEC(obj2F4); } break; case 0x7: - if (D_801778B0[3] > 0) { - func_80070CEC(arg0); + if (gTeamHealth[3] > 0) { + func_80070CEC(obj2F4); } break; case 0x8: - if (D_801778B0[2] > 0) { - func_80070CEC(arg0); + if (gTeamHealth[2] > 0) { + func_80070CEC(obj2F4); } break; case 0x9: - if (((arg0->obj.pos.x - gPlayer[0].unk_074) <= 100.0f) && - ((arg0->obj.pos.x - gPlayer[0].unk_074) >= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.x - gPlayer[0].unk_074) <= 100.0f) && + ((obj2F4->obj.pos.x - gPlayer[0].unk_074) >= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0xA: - if (((arg0->obj.pos.x - gPlayer[0].unk_074) <= 400.0f) && - ((arg0->obj.pos.x - gPlayer[0].unk_074) >= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.x - gPlayer[0].unk_074) <= 400.0f) && + ((obj2F4->obj.pos.x - gPlayer[0].unk_074) >= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0xB: - if (((arg0->obj.pos.x - gPlayer[0].unk_074) <= 700.0f) && - ((arg0->obj.pos.x - gPlayer[0].unk_074) >= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.x - gPlayer[0].unk_074) <= 700.0f) && + ((obj2F4->obj.pos.x - gPlayer[0].unk_074) >= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0xC: - if (((arg0->obj.pos.x - gPlayer[0].unk_074) <= 200.0f) && - ((arg0->obj.pos.x - gPlayer[0].unk_074) >= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.x - gPlayer[0].unk_074) <= 200.0f) && + ((obj2F4->obj.pos.x - gPlayer[0].unk_074) >= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0xD: - if (((arg0->obj.pos.x - gPlayer[0].unk_074) >= -100.0f) && - ((arg0->obj.pos.x - gPlayer[0].unk_074) <= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.x - gPlayer[0].unk_074) >= -100.0f) && + ((obj2F4->obj.pos.x - gPlayer[0].unk_074) <= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0xE: - if (((arg0->obj.pos.x - gPlayer[0].unk_074) >= -400.0f) && - ((arg0->obj.pos.x - gPlayer[0].unk_074) <= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.x - gPlayer[0].unk_074) >= -400.0f) && + ((obj2F4->obj.pos.x - gPlayer[0].unk_074) <= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0xF: - if (((arg0->obj.pos.x - gPlayer[0].unk_074) >= -700.0f) && - ((arg0->obj.pos.x - gPlayer[0].unk_074) <= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.x - gPlayer[0].unk_074) >= -700.0f) && + ((obj2F4->obj.pos.x - gPlayer[0].unk_074) <= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x10: - if (((arg0->obj.pos.x - gPlayer[0].unk_074) >= -200.0f) && - ((arg0->obj.pos.x - gPlayer[0].unk_074) <= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.x - gPlayer[0].unk_074) >= -200.0f) && + ((obj2F4->obj.pos.x - gPlayer[0].unk_074) <= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x11: - if (((arg0->obj.pos.y - gPlayer[0].unk_078) <= 100.0f) && - ((arg0->obj.pos.y - gPlayer[0].unk_078) >= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.y - gPlayer[0].unk_078) <= 100.0f) && + ((obj2F4->obj.pos.y - gPlayer[0].unk_078) >= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x12: - if (((arg0->obj.pos.y - gPlayer[0].unk_078) <= 400.0f) && - ((arg0->obj.pos.y - gPlayer[0].unk_078) >= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.y - gPlayer[0].unk_078) <= 400.0f) && + ((obj2F4->obj.pos.y - gPlayer[0].unk_078) >= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x13: - if (((arg0->obj.pos.y - gPlayer[0].unk_078) <= 700.0f) && - ((arg0->obj.pos.y - gPlayer[0].unk_078) >= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.y - gPlayer[0].unk_078) <= 700.0f) && + ((obj2F4->obj.pos.y - gPlayer[0].unk_078) >= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x14: - if (((arg0->obj.pos.y - gPlayer[0].unk_078) <= 200.0f) && - ((arg0->obj.pos.y - gPlayer[0].unk_078) >= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.y - gPlayer[0].unk_078) <= 200.0f) && + ((obj2F4->obj.pos.y - gPlayer[0].unk_078) >= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x15: - if (((arg0->obj.pos.y - gPlayer[0].unk_078) >= -100.0f) && - ((arg0->obj.pos.y - gPlayer[0].unk_078) <= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.y - gPlayer[0].unk_078) >= -100.0f) && + ((obj2F4->obj.pos.y - gPlayer[0].unk_078) <= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x16: - if (((arg0->obj.pos.y - gPlayer[0].unk_078) >= -400.0f) && - ((arg0->obj.pos.y - gPlayer[0].unk_078) <= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.y - gPlayer[0].unk_078) >= -400.0f) && + ((obj2F4->obj.pos.y - gPlayer[0].unk_078) <= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x17: - if (((arg0->obj.pos.y - gPlayer[0].unk_078) >= -700.0f) && - ((arg0->obj.pos.y - gPlayer[0].unk_078) <= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.y - gPlayer[0].unk_078) >= -700.0f) && + ((obj2F4->obj.pos.y - gPlayer[0].unk_078) <= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x18: - if (((arg0->obj.pos.y - gPlayer[0].unk_078) >= -200.0f) && - ((arg0->obj.pos.y - gPlayer[0].unk_078) <= 0.0f)) { - func_80070CEC(arg0); + if (((obj2F4->obj.pos.y - gPlayer[0].unk_078) >= -200.0f) && + ((obj2F4->obj.pos.y - gPlayer[0].unk_078) <= 0.0f)) { + func_80070CEC(obj2F4); } break; case 0x19: if (gPlayer[0].health >= Play_GetMaxHealth()) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x1A: if (gPlayer[0].health >= (Play_GetMaxHealth() * 3 / 4)) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x1B: if (gPlayer[0].health >= (Play_GetMaxHealth() / 2)) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x1C: if (gPlayer[0].health >= (Play_GetMaxHealth() / 4)) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x1D: if (gPlayer[0].health == 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x1E: if (gPlayer[0].unk_270 >= 5) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x1F: if (gPlayer[0].unk_270 != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x20: if (gPlayer[0].unk_270 == 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x21: if (gPlayer[0].unk_250 >= 16.8f) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x22: if (gPlayer[0].unk_250 <= 8.4f) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x23: if (gPlayer[0].wings.unk_14 > -8.0f) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x24: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == 1)) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x25: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == 2)) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x26: if ((gPlayer[0].wings.unk_14 < -8.0f) && (gLaserStrength[0] == 3)) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x27: for (i = 0; i < ARRAY_COUNT(gObjects70); i++) { - if ((gObjects70[i].obj.status == 1) && (fabsf(arg0->obj.pos.x - gObjects70[i].obj.pos.x) < 150.0f) && - (fabsf(arg0->obj.pos.y - gObjects70[i].obj.pos.y) < 150.0f) && - (fabsf(arg0->obj.pos.z - gObjects70[i].obj.pos.z) < 150.0f)) { - func_80070CEC(arg0); + if ((gObjects70[i].obj.status == 1) && (fabsf(obj2F4->obj.pos.x - gObjects70[i].obj.pos.x) < 150.0f) && + (fabsf(obj2F4->obj.pos.y - gObjects70[i].obj.pos.y) < 150.0f) && + (fabsf(obj2F4->obj.pos.z - gObjects70[i].obj.pos.z) < 150.0f)) { + func_80070CEC(obj2F4); break; } } break; case 0x28: for (i = 0; i < ARRAY_COUNT(gObjects70); i++) { - if ((gObjects70[i].obj.status == 1) && (fabsf(arg0->obj.pos.x - gObjects70[i].obj.pos.x) < 300.0f) && - (fabsf(arg0->obj.pos.y - gObjects70[i].obj.pos.y) < 300.0f) && - (fabsf(arg0->obj.pos.z - gObjects70[i].obj.pos.z) < 300.0f)) { - func_80070CEC(arg0); + if ((gObjects70[i].obj.status == 1) && (fabsf(obj2F4->obj.pos.x - gObjects70[i].obj.pos.x) < 300.0f) && + (fabsf(obj2F4->obj.pos.y - gObjects70[i].obj.pos.y) < 300.0f) && + (fabsf(obj2F4->obj.pos.z - gObjects70[i].obj.pos.z) < 300.0f)) { + func_80070CEC(obj2F4); break; } } break; case 0x29: - if ((gObjects2F4[arg0->unk_074].obj.status != 2) || - ((gObjects2F4[arg0->unk_074].unk_110 < 0.0f) && (arg0->unk_0CE <= 0))) { - func_80070CEC(arg0); + if ((gObjects2F4[obj2F4->unk_074].obj.status != 2) || + ((gObjects2F4[obj2F4->unk_074].unk_110 < 0.0f) && (obj2F4->unk_0CE <= 0))) { + func_80070CEC(obj2F4); } break; case 0x2A: for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { if ((gObjects2F4[i].obj.status == 2) && (gObjects2F4[i].obj.id == OBJECT_200) && - (gObjects2F4[i].unk_084 != 0) && (i != arg0->unk_040) && - (arg0->unk_040 == gObjects2F4[i].unk_074)) { + (gObjects2F4[i].unk_084 != 0) && (i != obj2F4->unk_040) && + (obj2F4->unk_040 == gObjects2F4[i].unk_074)) { return; } } - func_80070CEC(arg0); + func_80070CEC(obj2F4); break; case 0x2B: for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { if ((gObjects2F4[i].obj.status == 2) && (gObjects2F4[i].obj.id == OBJECT_200) && - (gObjects2F4[i].unk_084 != 0) && (i != arg0->unk_040) && - (arg0->unk_040 == gObjects2F4[i].unk_074)) { - func_80070CEC(arg0); + (gObjects2F4[i].unk_084 != 0) && (i != obj2F4->unk_040) && + (obj2F4->unk_040 == gObjects2F4[i].unk_074)) { + func_80070CEC(obj2F4); break; } } break; case 0x2C: - if (arg0->unk_0D0 != 0) { - func_80070CEC(arg0); + if (obj2F4->unk_0D0 != 0) { + func_80070CEC(obj2F4); } break; case 0x2D: @@ -2317,15 +2328,15 @@ void func_80070D44(Object_2F4* arg0) { var_v1_4 = 9; break; } - if (((gCurrentLevel != LEVEL_CORNERIA) || (D_801778B0[1] > 0)) && (D_80177E80 >= var_v1_4)) { - func_80070CEC(arg0); + if (((gCurrentLevel != LEVEL_CORNERIA) || (gTeamHealth[1] > 0)) && (D_80177E80 >= var_v1_4)) { + func_80070CEC(obj2F4); } break; case 0x2E: - for (i = 0, temp = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, temp++) { - if (((temp->obj.status == 3) || (temp->obj.status == 0)) && (arg0->unk_08C == temp->unk_08C) && - (temp->unk_090 != 0)) { - func_80070CEC(arg0); + for (i = 0, other2F4 = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, other2F4++) { + if (((other2F4->obj.status == 3) || (other2F4->obj.status == 0)) && + (obj2F4->unk_08C == other2F4->unk_08C) && (other2F4->unk_090 != 0)) { + func_80070CEC(obj2F4); } } break; @@ -2334,107 +2345,107 @@ void func_80070D44(Object_2F4* arg0) { func_8001AF40(0); D_800CFF90 = 0; D_80161690 = 0; - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x30: if ((gPlayer[0].wings.rightState <= 1) || (gPlayer[0].wings.leftState <= 1)) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x31: if (D_800D3180[1] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x32: if (D_800D3180[0xE] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x33: if (D_800D3180[2] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x34: if (D_800D3180[0xC] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x35: if (D_800D3180[0x11] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x36: if (D_800D3180[5] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x37: if (D_800D3180[0x10] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x38: if (D_800D3180[7] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x39: if (D_800D3180[0xB] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x3A: if (D_800D3180[0xD] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x3B: if (D_800D3180[8] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x3C: if (D_800D3180[0x12] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x3D: if (D_800D3180[3] != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x3E: - if (D_80161670[arg0->unk_080] == 0) { - func_80070CEC(arg0); + if (D_80161670[obj2F4->unk_080] == 0) { + func_80070CEC(obj2F4); } break; case 0x3F: - if (D_80161670[arg0->unk_080] != 0) { - func_80070CEC(arg0); + if (D_80161670[obj2F4->unk_080] != 0) { + func_80070CEC(obj2F4); } break; case 0x40: if (D_80161684 != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x41: if (gHitCount >= 30) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x42: if (gHitCount >= 80) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; case 0x43: if (gExpertMode != 0) { - func_80070CEC(arg0); + func_80070CEC(obj2F4); } break; } @@ -2481,149 +2492,149 @@ Vec3f D_800D1194[21] = { { 453.0f, 420.0f, 67.0f }, }; -void func_80071DC0(Object_2F4* arg0) { +void func_80071DC0(Object_2F4* obj2F4) { s32 rInd; Vec3f sp38; - Matrix_RotateY(gCalcMatrix, arg0->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, arg0->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, arg0->obj.rot.z * M_DTOR, 1); - if (arg0->unk_0B4 == 30) { + Matrix_RotateY(gCalcMatrix, obj2F4->obj.rot.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, obj2F4->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, obj2F4->obj.rot.z * M_DTOR, 1); + if (obj2F4->unk_0B4 == 30) { rInd = Rand_ZeroOne() * (ARRAY_COUNT(D_800D1074) - 1.1f); // off by 1 error? Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1074[rInd], &sp38); } - if (arg0->unk_0B4 == 17) { + if (obj2F4->unk_0B4 == 17) { rInd = Rand_ZeroOne() * (ARRAY_COUNT(D_800D0DD4) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D0DD4[rInd], &sp38); } - if (arg0->unk_0B4 == 31) { + if (obj2F4->unk_0B4 == 31) { rInd = Rand_ZeroOne() * (ARRAY_COUNT(D_800D1194) - 0.1f); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1194[rInd], &sp38); } if (!(gFrameCount & 1)) { - func_8007C120(arg0->obj.pos.x + sp38.x, arg0->obj.pos.y + sp38.y, arg0->obj.pos.z + sp38.z, arg0->unk_0E8.x, - arg0->unk_0E8.y, arg0->unk_0E8.z, 0.3f, 0x14); + func_8007C120(obj2F4->obj.pos.x + sp38.x, obj2F4->obj.pos.y + sp38.y, obj2F4->obj.pos.z + sp38.z, + obj2F4->unk_0E8.x, obj2F4->unk_0E8.y, obj2F4->unk_0E8.z, 0.3f, 0x14); } if (!(gFrameCount & 7)) { - func_8007BFFC(arg0->obj.pos.x + sp38.x, arg0->obj.pos.y + sp38.y, arg0->obj.pos.z + sp38.z, arg0->unk_0E8.x, - arg0->unk_0E8.y, arg0->unk_0E8.z, 10.0f, 9); + func_8007BFFC(obj2F4->obj.pos.x + sp38.x, obj2F4->obj.pos.y + sp38.y, obj2F4->obj.pos.z + sp38.z, + obj2F4->unk_0E8.x, obj2F4->unk_0E8.y, obj2F4->unk_0E8.z, 10.0f, 9); } if (!(gFrameCount & 0xF)) { - func_80019218(0x2903B009, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x2903B009, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } - arg0->unk_0E8.y -= 0.1f; - arg0->unk_0E8.z = 0.0f; - arg0->obj.rot.x += 0.2f; - arg0->obj.rot.z += 0.3f; + obj2F4->unk_0E8.y -= 0.1f; + obj2F4->unk_0E8.z = 0.0f; + obj2F4->obj.rot.x += 0.2f; + obj2F4->obj.rot.z += 0.3f; if (!(gFrameCount & 7) && (Rand_ZeroOne() < 0.5f)) { - arg0->unk_0C6 = 4; + obj2F4->unk_0C6 = 4; } } -void func_800720E8(Object_2F4* arg0) { - switch (arg0->unk_046) { +void func_800720E8(Object_2F4* obj2F4) { + switch (obj2F4->unk_046) { case 0: - if (arg0->unk_0D0 != 0) { - if (arg0->unk_0D0 == 2) { - arg0->unk_0D6 = 3; + if (obj2F4->unk_0D0 != 0) { + if (obj2F4->unk_0D0 == 2) { + obj2F4->unk_0D6 = 3; } - if ((arg0->unk_0D4 > 100) && (gObjects2F4[arg0->unk_0D4 - 101].unk_0B4 == 85)) { - arg0->unk_0D6 = 20; + if ((obj2F4->unk_0D4 > 100) && (gObjects2F4[obj2F4->unk_0D4 - 101].unk_0B4 == 85)) { + obj2F4->unk_0D6 = 20; } - arg0->unk_0CE -= arg0->unk_0D6; - arg0->unk_154 += 0.2f; - arg0->unk_0BC = 5; - if (arg0->unk_0BE < 20) { - arg0->unk_0BE += 5; + obj2F4->unk_0CE -= obj2F4->unk_0D6; + obj2F4->unk_154 += 0.2f; + obj2F4->unk_0BC = 5; + if (obj2F4->unk_0BE < 20) { + obj2F4->unk_0BE += 5; } - if (arg0->unk_0CE <= 0) { - arg0->unk_046 = 1; - arg0->unk_01C.unk_0C = SEGMENTED_TO_VIRTUAL(D_6032408); - func_80019218(0x1900000D, &arg0->unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + if (obj2F4->unk_0CE <= 0) { + obj2F4->unk_046 = 1; + obj2F4->unk_01C.hitbox = SEGMENTED_TO_VIRTUAL(D_6032408); + func_80019218(0x1900000D, &obj2F4->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else { - func_80019218(0x2903300E, &arg0->unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x2903300E, &obj2F4->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } - arg0->unk_0D0 = 0; + obj2F4->unk_0D0 = 0; } break; case 1: case 2: - Math_SmoothStepToF(&arg0->unk_154, 130.0f, 0.2f, 8.0f, 0.001f); - if (arg0->unk_154 > 45.0f) { - Math_SmoothStepToF(&arg0->unk_150, 90.0f, 0.2f, 10.0f, 0.001f); + Math_SmoothStepToF(&obj2F4->unk_154, 130.0f, 0.2f, 8.0f, 0.001f); + if (obj2F4->unk_154 > 45.0f) { + Math_SmoothStepToF(&obj2F4->unk_150, 90.0f, 0.2f, 10.0f, 0.001f); } break; } } -void func_800722EC(Object_8C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { +void func_800722EC(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { Vec3f sp2C; Vec3f sp20; - Object_8C_Initialize(arg0); - Matrix_RotateY(gCalcMatrix, M_DTOR * arg4, 0); + Object_8C_Initialize(obj8C); + Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, 0); sp2C.x = 0.0f; sp2C.y = 0.0f; sp2C.z = 20.0f; Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20); - arg0->unk_54.x = sp20.x; - arg0->obj.status = 1; - arg0->obj.id = OBJECT_365; - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->unk_44 = 250; - arg0->unk_70 = 2.0f; - arg0->unk_6C = (Rand_ZeroOne() - 0.5f) * 200.0f; - arg0->obj.rot.z = Rand_ZeroOne() * 360.0f; - arg0->unk_4C = arg0->unk_4E = 1; - func_800612B8(&arg0->unk_1C, arg0->obj.id); + obj8C->unk_54.x = sp20.x; + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_365; + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + obj8C->unk_44 = 250; + obj8C->unk_70 = 2.0f; + obj8C->unk_6C = (Rand_ZeroOne() - 0.5f) * 200.0f; + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; + obj8C->unk_4C = obj8C->unk_4E = 1; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } -void func_8007240C(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { +void func_8007240C(f32 xPos, f32 yPos, f32 zPos, f32 yRot) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { if (gObjects8C[i].obj.status == 0) { - func_800722EC(&gObjects8C[i], arg0, arg1, arg2, arg3); + func_800722EC(&gObjects8C[i], xPos, yPos, zPos, yRot); break; } } } -void func_80072474(Object_2F4* arg0) { +void func_80072474(Object_2F4* obj2F4) { f32 var_fv1; - if (arg0->unk_048 != 0) { - switch (arg0->unk_048) { + if (obj2F4->unk_048 != 0) { + switch (obj2F4->unk_048) { case 1: - arg0->unk_154 = 45.0f; + obj2F4->unk_154 = 45.0f; break; case 2: - arg0->unk_154 = 0.0f; + obj2F4->unk_154 = 0.0f; break; case 3: - arg0->unk_08C = 1; + obj2F4->unk_08C = 1; break; case 4: - arg0->unk_08C = 0; + obj2F4->unk_08C = 0; break; } - arg0->unk_048 = 0; + obj2F4->unk_048 = 0; } - if (arg0->unk_08C != 0) { + if (obj2F4->unk_08C != 0) { var_fv1 = - Math_RadToDeg(Math_Atan2F(gPlayer[0].unk_074 - arg0->obj.pos.x, gPlayer[0].unk_138 - arg0->obj.pos.z)); - } else if (arg0->unk_068 != 0) { - var_fv1 = arg0->unk_0F4.y; + Math_RadToDeg(Math_Atan2F(gPlayer[0].unk_074 - obj2F4->obj.pos.x, gPlayer[0].unk_138 - obj2F4->obj.pos.z)); + } else if (obj2F4->unk_068 != 0) { + var_fv1 = obj2F4->unk_0F4.y; } else { var_fv1 = 0.0f; } - Math_SmoothStepToAngle(&arg0->obj.rot.y, var_fv1, 0.2f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&arg0->unk_150, arg0->unk_154, 0.5f, 8.0f, 0.0f); + Math_SmoothStepToAngle(&obj2F4->obj.rot.y, var_fv1, 0.2f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&obj2F4->unk_150, obj2F4->unk_154, 0.5f, 8.0f, 0.0f); } Vec3f D_800D1290 = { 0.0f, 837.00006f, 0.0f }; // could be in-function -void func_80072594(Object_2F4* arg0) { +void func_80072594(Object_2F4* obj2F4) { s32 spFC; f32 var_fv0; s32 var_s0; @@ -2647,75 +2658,76 @@ void func_80072594(Object_2F4* arg0) { spD8 = 0.0f; spD4 = 0.0f; if ((gPlayer->unk_1C8 == 7) || (D_8017828C != 0)) { - Object_Kill(&arg0->obj, &arg0->unk_100); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); return; } - if (arg0->unk_0B8 == 0x3E8) { - arg0->obj.rot.y += arg0->unk_150; - arg0->obj.rot.x += arg0->unk_154; + if (obj2F4->unk_0B8 == 0x3E8) { + obj2F4->obj.rot.y += obj2F4->unk_150; + obj2F4->obj.rot.x += obj2F4->unk_154; if (!(gFrameCount & 0xF)) { - func_8007C120(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_0E8.x, arg0->unk_0E8.y, - arg0->unk_0E8.z, 0.3f, 0xA); + func_8007C120(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_0E8.x, obj2F4->unk_0E8.y, + obj2F4->unk_0E8.z, 0.3f, 0xA); } } else { - if (((arg0->unk_0B4 == 0x11) || (arg0->unk_0B4 == 0x1E) || (arg0->unk_0B4 == 0x1F)) && (arg0->unk_0CE <= 0)) { - func_80071DC0(arg0); + if (((obj2F4->unk_0B4 == 0x11) || (obj2F4->unk_0B4 == 0x1E) || (obj2F4->unk_0B4 == 0x1F)) && + (obj2F4->unk_0CE <= 0)) { + func_80071DC0(obj2F4); return; } - if (arg0->unk_0B4 == 300) { - gPlayer->unk_1A4 = arg0->unk_040; - arg0->unk_0C2 = 100; - } else if (arg0->unk_0B4 >= 200) { - arg0->unk_04E++; - if (arg0->unk_04E >= 100) { - arg0->unk_04E = 0; + if (obj2F4->unk_0B4 == 300) { + gPlayer->unk_1A4 = obj2F4->unk_040; + obj2F4->unk_0C2 = 100; + } else if (obj2F4->unk_0B4 >= 200) { + obj2F4->unk_04E++; + if (obj2F4->unk_04E >= 100) { + obj2F4->unk_04E = 0; } - D_80176558[arg0->unk_046][arg0->unk_04E] = arg0->obj.pos.x; - D_80176878[arg0->unk_046][arg0->unk_04E] = arg0->obj.pos.y; - D_80176B98[arg0->unk_046][arg0->unk_04E] = arg0->obj.pos.z; - D_80176EB8[arg0->unk_046][arg0->unk_04E] = arg0->obj.rot.x; - D_801771D8[arg0->unk_046][arg0->unk_04E] = arg0->obj.rot.y; - D_80177500[arg0->unk_046][arg0->unk_04E] = arg0->obj.rot.z; - if (arg0->unk_0D0 != 0) { - arg0->unk_0D0 = 0; - arg0->unk_0C6 = 20; - arg0->unk_0CE -= arg0->unk_0D6; - func_80019218(0x29034041, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - if (arg0->unk_0CE <= 0) { - arg0->unk_0C6 = 200; - arg0->obj.status = 3; - func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 8.0f); - arg0->obj.status = 3; - arg0->unk_0BC = 20; - arg0->obj.id = OBJECT_194; + D_80176558[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.pos.x; + D_80176878[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.pos.y; + D_80176B98[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.pos.z; + D_80176EB8[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.rot.x; + D_801771D8[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.rot.y; + D_80177500[obj2F4->unk_046][obj2F4->unk_04E] = obj2F4->obj.rot.z; + if (obj2F4->unk_0D0 != 0) { + obj2F4->unk_0D0 = 0; + obj2F4->unk_0C6 = 20; + obj2F4->unk_0CE -= obj2F4->unk_0D6; + func_80019218(0x29034041, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + if (obj2F4->unk_0CE <= 0) { + obj2F4->unk_0C6 = 200; + obj2F4->obj.status = 3; + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 8.0f); + obj2F4->obj.status = 3; + obj2F4->unk_0BC = 20; + obj2F4->obj.id = OBJECT_194; } } } - if ((arg0->unk_0B4 == 0x1B) && (arg0->unk_0C2 != 0)) { - arg0->unk_0B8 = 0; + if ((obj2F4->unk_0B4 == 27) && (obj2F4->unk_0C2 != 0)) { + obj2F4->unk_0B8 = 0; } - switch (arg0->unk_0B8) { + switch (obj2F4->unk_0B8) { case 0x0: - func_8006D36C(arg0); + func_8006D36C(obj2F4); break; case 0x1: - if (arg0->unk_0BC == 0) { - func_8006D36C(arg0); + if (obj2F4->unk_0BC == 0) { + func_8006D36C(obj2F4); } break; case 0x6: case 0x7: case 0xE: case 0xF: - spF0 = arg0->obj.pos.x; - spEC = arg0->obj.pos.y; - spE8 = arg0->obj.pos.z; - if ((arg0->unk_0B4 == 0x21) || (arg0->unk_0B4 == 0x44)) { - Matrix_RotateZ(gCalcMatrix, -(arg0->unk_2E8.z + arg0->unk_0F4.z) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -arg0->unk_2E8.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -arg0->unk_2E8.y * M_DTOR, 1); - if ((arg0->unk_0B8 == 0xE) || (arg0->unk_0B8 == 0xF)) { + spF0 = obj2F4->obj.pos.x; + spEC = obj2F4->obj.pos.y; + spE8 = obj2F4->obj.pos.z; + if ((obj2F4->unk_0B4 == 0x21) || (obj2F4->unk_0B4 == 0x44)) { + Matrix_RotateZ(gCalcMatrix, -(obj2F4->unk_2E8.z + obj2F4->unk_0F4.z) * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, -obj2F4->unk_2E8.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -obj2F4->unk_2E8.y * M_DTOR, 1); + if ((obj2F4->unk_0B8 == 0xE) || (obj2F4->unk_0B8 == 0xF)) { spB8.x = gPlayer->unk_040.x - spF0; spB8.y = gPlayer->unk_040.y - (spEC + 25.0f); spB8.z = (gPlayer->unk_040.z * 15.0f) - spE8; @@ -2736,36 +2748,37 @@ void func_80072594(Object_2F4* arg0) { spE4 = 30.0f; spFC++; } - arg0->obj.rot.x = 0.0f; - Math_SmoothStepToAngle(&arg0->obj.rot.y, spE0, 0.2f, arg0->unk_174, 0.001f); - Math_SmoothStepToAngle(&arg0->unk_150, spE4, 0.2f, arg0->unk_174, 0.001f); - if (!(arg0->unk_0BC & 0x1F) && (spFC == 0)) { - Matrix_RotateY(gCalcMatrix, arg0->unk_2E8.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, arg0->unk_2E8.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (arg0->unk_2E8.z + arg0->unk_0F4.z) * M_DTOR, 1); + obj2F4->obj.rot.x = 0.0f; + Math_SmoothStepToAngle(&obj2F4->obj.rot.y, spE0, 0.2f, obj2F4->unk_174, 0.001f); + Math_SmoothStepToAngle(&obj2F4->unk_150, spE4, 0.2f, obj2F4->unk_174, 0.001f); + if (!(obj2F4->unk_0BC & 0x1F) && (spFC == 0)) { + Matrix_RotateY(gCalcMatrix, obj2F4->unk_2E8.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, obj2F4->unk_2E8.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, (obj2F4->unk_2E8.z + obj2F4->unk_0F4.z) * M_DTOR, 1); spB8.x = 0.0f; spB8.y = 25.0f; spB8.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spA0); - Matrix_RotateY(gCalcMatrix, arg0->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg0->unk_150 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj2F4->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, obj2F4->unk_150 * M_DTOR, 1); spB8.x = 0.0f; spB8.y = 0.0f; spB8.z = D_80177828; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spAC); - if (arg0->unk_0B4 == 0x44) { + if (obj2F4->unk_0B4 == 0x44) { var_fv0 = 80.0f; } else { var_fv0 = 0.0f; } - func_8007F04C(OBJECT_353, arg0->obj.pos.x + spAC.x + spA0.x, - arg0->obj.pos.y + spAC.y + spA0.y + var_fv0, arg0->obj.pos.z + spAC.z + spA0.z, - arg0->unk_150, arg0->obj.rot.y, arg0->obj.rot.z, arg0->unk_2E8.x, arg0->unk_2E8.y, - arg0->unk_2E8.z + arg0->unk_0F4.z, spAC.x, spAC.y, spAC.z, 1.0f); - arg0->unk_154 = -15.0f; + func_8007F04C(OBJECT_353, obj2F4->obj.pos.x + spAC.x + spA0.x, + obj2F4->obj.pos.y + spAC.y + spA0.y + var_fv0, + obj2F4->obj.pos.z + spAC.z + spA0.z, obj2F4->unk_150, obj2F4->obj.rot.y, + obj2F4->obj.rot.z, obj2F4->unk_2E8.x, obj2F4->unk_2E8.y, + obj2F4->unk_2E8.z + obj2F4->unk_0F4.z, spAC.x, spAC.y, spAC.z, 1.0f); + obj2F4->unk_154 = -15.0f; } } else { - if ((arg0->unk_0B8 == 0xE) || (arg0->unk_0B8 == 0xF)) { + if ((obj2F4->unk_0B8 == 0xE) || (obj2F4->unk_0B8 == 0xF)) { spCC = gPlayer->unk_040.x; spC8 = gPlayer->unk_040.y; spC4 = gPlayer->unk_040.z; @@ -2774,561 +2787,561 @@ void func_80072594(Object_2F4* arg0) { spC8 = gPlayer->unk_078; spC4 = gPlayer->unk_07C; } - Math_SmoothStepToAngle(&arg0->unk_2E8.z, 0.0f, 0.1f, 5.0f, 0.0001f); - Math_SmoothStepToAngle(&arg0->unk_0F4.z, 0.0f, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&obj2F4->unk_2E8.z, 0.0f, 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToAngle(&obj2F4->unk_0F4.z, 0.0f, 0.1f, 5.0f, 0.0001f); spE0 = Math_RadToDeg(Math_Atan2F(spCC - spF0, spC4 - spE8)); - if ((arg0->unk_0B8 == 7) || (arg0->unk_0B8 == 0xF)) { + if ((obj2F4->unk_0B8 == 7) || (obj2F4->unk_0B8 == 0xF)) { spE0 += 180.0f; if (spE0 > 360.0f) { spE0 -= 360.0f; } } spE4 = Math_RadToDeg(-Math_Atan2F(spC8 - spEC, sqrtf(SQ(spCC - spF0) + SQ(spC4 - spE8)))); - spEC = Math_SmoothStepToAngle(&arg0->unk_0F4.y, spE0, 0.2f, arg0->unk_174, 0.0001f); - Math_SmoothStepToAngle(&arg0->unk_0F4.x, spE4, 0.2f, arg0->unk_174, 0.0001f); - if (arg0->unk_068 != 0) { + spEC = Math_SmoothStepToAngle(&obj2F4->unk_0F4.y, spE0, 0.2f, obj2F4->unk_174, 0.0001f); + Math_SmoothStepToAngle(&obj2F4->unk_0F4.x, spE4, 0.2f, obj2F4->unk_174, 0.0001f); + if (obj2F4->unk_068 != 0) { var_fv0 = 330.0f; if (spEC < 0.0f) { var_fv0 = 30.0f; } - Math_SmoothStepToAngle(&arg0->unk_170, var_fv0, 0.1f, 5.0f, 0.01f); + Math_SmoothStepToAngle(&obj2F4->unk_170, var_fv0, 0.1f, 5.0f, 0.01f); } } - if (arg0->unk_0BC == 0) { - func_8006D36C(arg0); + if (obj2F4->unk_0BC == 0) { + func_8006D36C(obj2F4); } break; case 0xD: - spDC = __sinf(((arg0->unk_040 * 0x2D) + gFrameCount) * M_DTOR) * arg0[0].unk_158; - spD8 = __cosf(((arg0->unk_040 * 0x2D) + (gFrameCount * 2)) * M_DTOR) * arg0[0].unk_158; - pad = arg0->unk_054; + spDC = __sinf(((obj2F4->unk_040 * 0x2D) + gFrameCount) * M_DTOR) * obj2F4[0].unk_158; + spD8 = __cosf(((obj2F4->unk_040 * 0x2D) + (gFrameCount * 2)) * M_DTOR) * obj2F4[0].unk_158; + pad = obj2F4->unk_054; pad = gObjects2F4[pad].unk_080; D_80161670[pad] = 5; /* fallthrough */ case 0x8: case 0x9: - spF0 = arg0->obj.pos.x; - spEC = arg0->obj.pos.y; - spE8 = arg0->obj.pos.z; - spE0 = Math_RadToDeg(Math_Atan2F(gObjects2F4[arg0->unk_054].obj.pos.x + spDC - spF0, - gObjects2F4[arg0->unk_054].obj.pos.z + spD4 - spE8)); - if (arg0->unk_0B8 == 7) { + spF0 = obj2F4->obj.pos.x; + spEC = obj2F4->obj.pos.y; + spE8 = obj2F4->obj.pos.z; + spE0 = Math_RadToDeg(Math_Atan2F(gObjects2F4[obj2F4->unk_054].obj.pos.x + spDC - spF0, + gObjects2F4[obj2F4->unk_054].obj.pos.z + spD4 - spE8)); + if (obj2F4->unk_0B8 == 7) { spE0 += 180.0f; if (spE0 > 360.0f) { spE0 -= 360.0f; } } - spE4 = Math_RadToDeg(-Math_Atan2F(gObjects2F4[arg0->unk_054].obj.pos.y + spD8 - spEC, - sqrtf(SQ(gObjects2F4[arg0->unk_054].obj.pos.x + spDC - spF0) + - SQ(gObjects2F4[arg0->unk_054].obj.pos.z + spD4 - spE8)))); - spEC = Math_SmoothStepToAngle(&arg0->unk_0F4.y, spE0, 0.2f, arg0->unk_174, 0.0001f); - Math_SmoothStepToAngle(&arg0->unk_0F4.x, spE4, 0.2f, arg0->unk_174, 0.0001f); - if (arg0->unk_068 != 0) { + spE4 = Math_RadToDeg(-Math_Atan2F(gObjects2F4[obj2F4->unk_054].obj.pos.y + spD8 - spEC, + sqrtf(SQ(gObjects2F4[obj2F4->unk_054].obj.pos.x + spDC - spF0) + + SQ(gObjects2F4[obj2F4->unk_054].obj.pos.z + spD4 - spE8)))); + spEC = Math_SmoothStepToAngle(&obj2F4->unk_0F4.y, spE0, 0.2f, obj2F4->unk_174, 0.0001f); + Math_SmoothStepToAngle(&obj2F4->unk_0F4.x, spE4, 0.2f, obj2F4->unk_174, 0.0001f); + if (obj2F4->unk_068 != 0) { var_fv0 = 310.0f; if (spEC < 0.0f) { var_fv0 = 50.0f; } - Math_SmoothStepToAngle(&arg0->unk_170, var_fv0, 0.1f, 5.0f, 0.01f); + Math_SmoothStepToAngle(&obj2F4->unk_170, var_fv0, 0.1f, 5.0f, 0.01f); } - if (arg0->unk_0BC == 0) { - func_8006D36C(arg0); + if (obj2F4->unk_0BC == 0) { + func_8006D36C(obj2F4); } break; case 0x2: - arg0->unk_0F4.x += arg0->unk_120; - arg0->unk_11C -= arg0->unk_120; - if (arg0->unk_11C <= 0.0f) { - func_8006D36C(arg0); + obj2F4->unk_0F4.x += obj2F4->unk_120; + obj2F4->unk_11C -= obj2F4->unk_120; + if (obj2F4->unk_11C <= 0.0f) { + func_8006D36C(obj2F4); } break; case 0x3: - arg0->unk_0F4.x -= arg0->unk_120; - arg0->unk_11C -= arg0->unk_120; - if (arg0->unk_11C <= 0.0f) { - func_8006D36C(arg0); + obj2F4->unk_0F4.x -= obj2F4->unk_120; + obj2F4->unk_11C -= obj2F4->unk_120; + if (obj2F4->unk_11C <= 0.0f) { + func_8006D36C(obj2F4); } break; case 0x4: - arg0->unk_0F4.y += arg0->unk_120; - arg0->unk_11C -= arg0->unk_120; - if (arg0->unk_11C <= 0.0f) { - func_8006D36C(arg0); + obj2F4->unk_0F4.y += obj2F4->unk_120; + obj2F4->unk_11C -= obj2F4->unk_120; + if (obj2F4->unk_11C <= 0.0f) { + func_8006D36C(obj2F4); } break; case 0x5: - arg0->unk_0F4.y -= arg0->unk_120; - arg0->unk_11C -= arg0->unk_120; - if (arg0->unk_11C <= 0.0f) { - func_8006D36C(arg0); + obj2F4->unk_0F4.y -= obj2F4->unk_120; + obj2F4->unk_11C -= obj2F4->unk_120; + if (obj2F4->unk_11C <= 0.0f) { + func_8006D36C(obj2F4); } break; case 0xA: var_s0 = 0; - if (Math_SmoothStepToAngle(&arg0->obj.rot.x, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + if (Math_SmoothStepToAngle(&obj2F4->obj.rot.x, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { var_s0++; } - if (Math_SmoothStepToAngle(&arg0->obj.rot.y, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + if (Math_SmoothStepToAngle(&obj2F4->obj.rot.y, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { var_s0++; } - if (Math_SmoothStepToF(&arg0->unk_150, 40.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + if (Math_SmoothStepToF(&obj2F4->unk_150, 40.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { var_s0++; } if (var_s0 == 3) { - arg0->unk_01C.unk_0C = SEGMENTED_TO_VIRTUAL(D_602F638); - func_8006D36C(arg0); + obj2F4->unk_01C.hitbox = SEGMENTED_TO_VIRTUAL(D_602F638); + func_8006D36C(obj2F4); } break; case 0xB: - if (Math_SmoothStepToF(&arg0->unk_150, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { - func_8006D36C(arg0); + if (Math_SmoothStepToF(&obj2F4->unk_150, 0.0f, 0.3f, 10.0f, 1.0f) == 0.0f) { + func_8006D36C(obj2F4); } break; case 0xC: - Math_SmoothStepToAngle(&arg0->unk_0F4.x, 270.0f, 0.1f, 2.0f, 0.0f); - D_801778B0[arg0->unk_080] = -1; - D_80177910[arg0->unk_080] = 0; + Math_SmoothStepToAngle(&obj2F4->unk_0F4.x, 270.0f, 0.1f, 2.0f, 0.0f); + gTeamHealth[obj2F4->unk_080] = -1; + D_80177910[obj2F4->unk_080] = 0; break; case 200: break; } - if (arg0->unk_084 != 0) { - if (gObjects2F4[arg0->unk_074].obj.status != 2) { - arg0->unk_084 = 0; + if (obj2F4->unk_084 != 0) { + if (gObjects2F4[obj2F4->unk_074].obj.status != 2) { + obj2F4->unk_084 = 0; } else { - Matrix_RotateY(gCalcMatrix, gObjects2F4[arg0->unk_074].obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, gObjects2F4[arg0->unk_074].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, gObjects2F4[arg0->unk_074].obj.rot.z * M_DTOR, 1); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &arg0->unk_2DC, &spAC); - arg0->obj.pos.x = gObjects2F4[arg0->unk_074].obj.pos.x + spAC.x; - arg0->obj.pos.y = gObjects2F4[arg0->unk_074].obj.pos.y + spAC.y; - arg0->obj.pos.z = gObjects2F4[arg0->unk_074].obj.pos.z + spAC.z; - arg0->unk_2E8.x = gObjects2F4[arg0->unk_074].obj.rot.x; - arg0->unk_2E8.y = gObjects2F4[arg0->unk_074].obj.rot.y; - arg0->unk_2E8.z = gObjects2F4[arg0->unk_074].obj.rot.z; - if (arg0->unk_0C0 == 0) { - arg0->unk_084 = 0; + Matrix_RotateY(gCalcMatrix, gObjects2F4[obj2F4->unk_074].obj.rot.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, gObjects2F4[obj2F4->unk_074].obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, gObjects2F4[obj2F4->unk_074].obj.rot.z * M_DTOR, 1); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &obj2F4->unk_2DC, &spAC); + obj2F4->obj.pos.x = gObjects2F4[obj2F4->unk_074].obj.pos.x + spAC.x; + obj2F4->obj.pos.y = gObjects2F4[obj2F4->unk_074].obj.pos.y + spAC.y; + obj2F4->obj.pos.z = gObjects2F4[obj2F4->unk_074].obj.pos.z + spAC.z; + obj2F4->unk_2E8.x = gObjects2F4[obj2F4->unk_074].obj.rot.x; + obj2F4->unk_2E8.y = gObjects2F4[obj2F4->unk_074].obj.rot.y; + obj2F4->unk_2E8.z = gObjects2F4[obj2F4->unk_074].obj.rot.z; + if (obj2F4->unk_0C0 == 0) { + obj2F4->unk_084 = 0; } } } - Math_SmoothStepToF(&arg0->unk_114, arg0->unk_118, 0.1f, 5.0f, 0.0001f); - if (arg0->unk_0F4.x >= 360.0f) { - arg0->unk_0F4.x -= 360.0f; + Math_SmoothStepToF(&obj2F4->unk_114, obj2F4->unk_118, 0.1f, 5.0f, 0.0001f); + if (obj2F4->unk_0F4.x >= 360.0f) { + obj2F4->unk_0F4.x -= 360.0f; } - if (arg0->unk_0F4.x < 0.0f) { - arg0->unk_0F4.x += 360.0f; + if (obj2F4->unk_0F4.x < 0.0f) { + obj2F4->unk_0F4.x += 360.0f; } - if (arg0->unk_0F4.y >= 360.0f) { - arg0->unk_0F4.y -= 360.0f; + if (obj2F4->unk_0F4.y >= 360.0f) { + obj2F4->unk_0F4.y -= 360.0f; } - if (arg0->unk_0F4.y < 0.0f) { - arg0->unk_0F4.y += 360.0f; + if (obj2F4->unk_0F4.y < 0.0f) { + obj2F4->unk_0F4.y += 360.0f; } - if (arg0->unk_068 != 0) { - if ((D_80177880 == 2) && (arg0->unk_0B4 == 0xC8)) { - Math_SmoothStepToAngle(&arg0->obj.rot.x, arg0->unk_0F4.x, 0.1f, 10.0f, 0.00001f); - Math_SmoothStepToAngle(&arg0->obj.rot.y, arg0->unk_0F4.y, 0.1f, 10.0f, 0.00001f); + if (obj2F4->unk_068 != 0) { + if ((D_80177880 == 2) && (obj2F4->unk_0B4 == 0xC8)) { + Math_SmoothStepToAngle(&obj2F4->obj.rot.x, obj2F4->unk_0F4.x, 0.1f, 10.0f, 0.00001f); + Math_SmoothStepToAngle(&obj2F4->obj.rot.y, obj2F4->unk_0F4.y, 0.1f, 10.0f, 0.00001f); } else { - Math_SmoothStepToAngle(&arg0->obj.rot.x, arg0->unk_0F4.x, 0.2f, 100.0f, 0.00001f); - Math_SmoothStepToAngle(&arg0->obj.rot.y, arg0->unk_0F4.y, 0.2f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&obj2F4->obj.rot.x, obj2F4->unk_0F4.x, 0.2f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&obj2F4->obj.rot.y, obj2F4->unk_0F4.y, 0.2f, 100.0f, 0.00001f); } } - if (arg0->unk_124.x > 0.0f) { - arg0->unk_124.x -= arg0->unk_124.y; - arg0->obj.rot.x += arg0->unk_124.y * arg0->unk_124.z; - if (arg0->obj.rot.x >= 360.0f) { - arg0->obj.rot.x -= 360.0f; + if (obj2F4->unk_124.x > 0.0f) { + obj2F4->unk_124.x -= obj2F4->unk_124.y; + obj2F4->obj.rot.x += obj2F4->unk_124.y * obj2F4->unk_124.z; + if (obj2F4->obj.rot.x >= 360.0f) { + obj2F4->obj.rot.x -= 360.0f; } - if (arg0->obj.rot.x < 0.0f) { - arg0->obj.rot.x += 360.0f; + if (obj2F4->obj.rot.x < 0.0f) { + obj2F4->obj.rot.x += 360.0f; } } - if (arg0->unk_130 > 0.0f) { - arg0->unk_130 -= arg0->unk_134; - arg0->obj.rot.y += arg0->unk_134 * arg0->unk_138; - if (arg0->obj.rot.y >= 360.0f) { - arg0->obj.rot.y = arg0->obj.rot.y - 360.0f; + if (obj2F4->unk_130 > 0.0f) { + obj2F4->unk_130 -= obj2F4->unk_134; + obj2F4->obj.rot.y += obj2F4->unk_134 * obj2F4->unk_138; + if (obj2F4->obj.rot.y >= 360.0f) { + obj2F4->obj.rot.y = obj2F4->obj.rot.y - 360.0f; } - if (arg0->obj.rot.y < 0.0f) { - arg0->obj.rot.y += 360.0f; + if (obj2F4->obj.rot.y < 0.0f) { + obj2F4->obj.rot.y += 360.0f; } } - if (arg0->unk_13C > 0.0f) { - if ((arg0->unk_0B4 == 0xD) || (arg0->unk_0B4 == 0xE) || (arg0->unk_0B4 == 0x3D) || - (arg0->unk_0B4 == 0x3E) || (arg0->unk_0B4 == 0x3F) || (arg0->unk_0B4 == 0x40) || - (arg0->unk_0B4 == 0x41) || (arg0->unk_0B4 == 0x42) || (arg0->unk_0B4 == 0x5E) || - (arg0->unk_0B4 == 0x5F) || (arg0->unk_0B4 == 0x61)) { - arg0->obj.rot.y -= arg0->unk_140 * arg0->unk_144; - arg0->obj.rot.x += arg0->unk_140 * arg0->unk_144; + if (obj2F4->unk_13C > 0.0f) { + if ((obj2F4->unk_0B4 == 0xD) || (obj2F4->unk_0B4 == 0xE) || (obj2F4->unk_0B4 == 0x3D) || + (obj2F4->unk_0B4 == 0x3E) || (obj2F4->unk_0B4 == 0x3F) || (obj2F4->unk_0B4 == 0x40) || + (obj2F4->unk_0B4 == 0x41) || (obj2F4->unk_0B4 == 0x42) || (obj2F4->unk_0B4 == 0x5E) || + (obj2F4->unk_0B4 == 0x5F) || (obj2F4->unk_0B4 == 0x61)) { + obj2F4->obj.rot.y -= obj2F4->unk_140 * obj2F4->unk_144; + obj2F4->obj.rot.x += obj2F4->unk_140 * obj2F4->unk_144; } else { - arg0->unk_13C -= arg0->unk_140; - arg0->unk_170 += arg0->unk_140 * arg0->unk_144; + obj2F4->unk_13C -= obj2F4->unk_140; + obj2F4->unk_170 += obj2F4->unk_140 * obj2F4->unk_144; } } - if (arg0->unk_170 >= 360.0f) { - arg0->unk_170 -= 360.0f; + if (obj2F4->unk_170 >= 360.0f) { + obj2F4->unk_170 -= 360.0f; } - if (arg0->unk_170 < 0.0f) { - arg0->unk_170 += 360.0f; + if (obj2F4->unk_170 < 0.0f) { + obj2F4->unk_170 += 360.0f; } - Math_SmoothStepToAngle(&arg0->obj.rot.z, arg0->unk_170, 0.2f, 100.0f, 0.0001f); - Matrix_RotateZ(gCalcMatrix, (arg0->unk_2E8.z + arg0->unk_0F4.z) * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, arg0->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg0->unk_0F4.x * M_DTOR, 1); + Math_SmoothStepToAngle(&obj2F4->obj.rot.z, obj2F4->unk_170, 0.2f, 100.0f, 0.0001f); + Matrix_RotateZ(gCalcMatrix, (obj2F4->unk_2E8.z + obj2F4->unk_0F4.z) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, obj2F4->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, obj2F4->unk_0F4.x * M_DTOR, 1); spB8.x = 0.0f; spB8.y = 0.0f; - spB8.z = arg0->unk_114; + spB8.z = obj2F4->unk_114; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spAC); - arg0->unk_0E8.x = arg0->unk_148 + spAC.x; - arg0->unk_0E8.y = arg0->unk_14C + spAC.y; - arg0->unk_0E8.z = spAC.z; - arg0->unk_148 -= arg0->unk_148 * 0.1f; - arg0->unk_14C -= arg0->unk_14C * 0.1f; - if (arg0->unk_064 == 0x80) { - arg0->unk_0E8.z -= arg0->unk_16C; + obj2F4->unk_0E8.x = obj2F4->unk_148 + spAC.x; + obj2F4->unk_0E8.y = obj2F4->unk_14C + spAC.y; + obj2F4->unk_0E8.z = spAC.z; + obj2F4->unk_148 -= obj2F4->unk_148 * 0.1f; + obj2F4->unk_14C -= obj2F4->unk_14C * 0.1f; + if (obj2F4->unk_064 == 0x80) { + obj2F4->unk_0E8.z -= obj2F4->unk_16C; if ((gCurrentLevel == 5) && (D_80177D08 < 0.0f)) { - arg0->unk_0E8.z -= D_80177D08; + obj2F4->unk_0E8.z -= D_80177D08; } } - if (arg0->unk_064 == 0x100) { - arg0->unk_0E8.z -= D_80177D08; + if (obj2F4->unk_064 == 0x100) { + obj2F4->unk_0E8.z -= D_80177D08; } if (gPlayer->unk_1C8 == 8) { - arg0->unk_0E8.z = 100.0f; + obj2F4->unk_0E8.z = 100.0f; } - func_80070D44(arg0); - func_8006F40C(arg0); - func_8006EA50(arg0); - if (arg0->unk_0B4 == 0x26) { - func_800720E8(arg0); + func_80070D44(obj2F4); + func_8006F40C(obj2F4); + func_8006EA50(obj2F4); + if (obj2F4->unk_0B4 == 0x26) { + func_800720E8(obj2F4); } else { - if (arg0->unk_110 <= -1.999f) { - func_80070BA8(arg0); + if (obj2F4->unk_110 <= -1.999f) { + func_80070BA8(obj2F4); } else { - if ((arg0->unk_0D0 == 1) && (arg0->unk_110 < 0.5f) && (arg0->unk_0B4 != 0x30) && - (arg0->unk_0B4 != 0x31) && (arg0->unk_0B4 != 0x32)) { - arg0->unk_0D0 = 0; + if ((obj2F4->unk_0D0 == 1) && (obj2F4->unk_110 < 0.5f) && (obj2F4->unk_0B4 != 0x30) && + (obj2F4->unk_0B4 != 0x31) && (obj2F4->unk_0B4 != 0x32)) { + obj2F4->unk_0D0 = 0; if (gCurrentLevel == 1) { - func_80019218(0x2902107D, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x2902107D, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else { - func_80019218(0x29121007, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x29121007, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } - if ((arg0->unk_0B4 < 0xC8) && (arg0->unk_0B4 != 0x4E) && (arg0->unk_110 >= 0.5f)) { - switch (arg0->unk_0B4) { + if ((obj2F4->unk_0B4 < 0xC8) && (obj2F4->unk_0B4 != 0x4E) && (obj2F4->unk_110 >= 0.5f)) { + switch (obj2F4->unk_0B4) { case 0x47: - func_8006FE28(arg0); + func_8006FE28(obj2F4); break; case 0x4F: - func_8006FEEC(arg0); + func_8006FEEC(obj2F4); break; default: - func_800701E0(arg0); + func_800701E0(obj2F4); break; } } } } - switch (arg0->unk_0B4) { + switch (obj2F4->unk_0B4) { case 0x5C: case 0x5D: case 0x5E: case 0x5F: case 0x60: if (!(gFrameCount & 7)) { - arg0->unk_15C = Rand_ZeroOne() * 255.0f; - arg0->unk_160 = Rand_ZeroOne() * 255.0f; - arg0->unk_164 = Rand_ZeroOne() * 255.0f; + obj2F4->unk_15C = Rand_ZeroOne() * 255.0f; + obj2F4->unk_160 = Rand_ZeroOne() * 255.0f; + obj2F4->unk_164 = Rand_ZeroOne() * 255.0f; } - Math_SmoothStepToF(&arg0->unk_150, arg0->unk_15C, 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&arg0->unk_154, arg0->unk_160, 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&arg0->unk_158, arg0->unk_164, 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&obj2F4->unk_150, obj2F4->unk_15C, 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&obj2F4->unk_154, obj2F4->unk_160, 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&obj2F4->unk_158, obj2F4->unk_164, 1.0f, 10.0f, 0.0f); break; case 0x2E: - if (func_800A73E4(&spEC, &spFC, arg0->obj.pos.x, -100.0f, arg0->obj.pos.z) != 0) { + if (func_800A73E4(&spEC, &spFC, obj2F4->obj.pos.x, -100.0f, obj2F4->obj.pos.z) != 0) { spF0 = 10.0f; - if (Math_SmoothStepToF(&arg0->obj.pos.y, spEC, 0.5f, 7.0f, 0.0f) >= 0.0f) { + if (Math_SmoothStepToF(&obj2F4->obj.pos.y, spEC, 0.5f, 7.0f, 0.0f) >= 0.0f) { spF0 = 350.0f; if (!(gFrameCount & 3)) { - func_8007240C(arg0->obj.pos.x, spEC, arg0->obj.pos.z, arg0->obj.rot.y); - func_80019218(0x19800017, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_8007240C(obj2F4->obj.pos.x, spEC, obj2F4->obj.pos.z, obj2F4->obj.rot.y); + func_80019218(0x19800017, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } - Math_SmoothStepToAngle(&arg0->obj.rot.x, spF0, 0.1f, 1.0f, 0.0f); - if ((arg0->unk_0B8 == 4) || (arg0->unk_0B8 == 5)) { - var_fv0 = arg0->unk_120 * 20.0f; - if (arg0->unk_0B8 == 4) { + Math_SmoothStepToAngle(&obj2F4->obj.rot.x, spF0, 0.1f, 1.0f, 0.0f); + if ((obj2F4->unk_0B8 == 4) || (obj2F4->unk_0B8 == 5)) { + var_fv0 = obj2F4->unk_120 * 20.0f; + if (obj2F4->unk_0B8 == 4) { var_fv0 *= -1.0f; } - Math_SmoothStepToAngle(&arg0->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&obj2F4->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.0f); } } - arg0->obj.rot.y = arg0->unk_0F4.y; + obj2F4->obj.rot.y = obj2F4->unk_0F4.y; break; case 0x1F: - arg0->obj.rot.z = (f32) gFrameCount; + obj2F4->obj.rot.z = (f32) gFrameCount; break; case 0x15: case 0x16: - arg0->obj.rot.z = (f32) gFrameCount * 3.0f; + obj2F4->obj.rot.z = (f32) gFrameCount * 3.0f; break; case 0x3: - arg0->unk_0C9 = 1; - arg0->obj.rot.y -= 10.0f; + obj2F4->unk_0C9 = 1; + obj2F4->obj.rot.y -= 10.0f; break; case 0x6: - arg0->unk_0B6++; + obj2F4->unk_0B6++; if (gCurrentLevel == 7) { - if (arg0->unk_0B6 >= Animation_GetFrameCount(&D_600636C)) { - arg0->unk_0B6 = 0; + if (obj2F4->unk_0B6 >= Animation_GetFrameCount(&D_600636C)) { + obj2F4->unk_0B6 = 0; } if (((s32) gFrameCount % 3) == 0) { - func_E16C50_8019E9F4(arg0->obj.pos.x, arg0->obj.pos.y - 20, arg0->obj.pos.z - 180.0f, 0.0f, - Rand_ZeroOne() * 20.0f * -1.0f, 0.0f, 4.0f, 2); + func_E16C50_8019E9F4(obj2F4->obj.pos.x, obj2F4->obj.pos.y - 20, obj2F4->obj.pos.z - 180.0f, + 0.0f, Rand_ZeroOne() * 20.0f * -1.0f, 0.0f, 4.0f, 2); } - } else if (arg0->unk_0B6 >= Animation_GetFrameCount(&D_40057AC)) { - arg0->unk_0B6 = 0; + } else if (obj2F4->unk_0B6 >= Animation_GetFrameCount(&D_40057AC)) { + obj2F4->unk_0B6 = 0; } break; case 0x9: - arg0->unk_0B6++; - if (arg0->unk_0B6 >= Animation_GetFrameCount(&D_40001A4)) { - arg0->unk_0B6 = 0; + obj2F4->unk_0B6++; + if (obj2F4->unk_0B6 >= Animation_GetFrameCount(&D_40001A4)) { + obj2F4->unk_0B6 = 0; } - if (arg0->unk_068 == 0) { - arg0->obj.rot.y = 0.0f; + if (obj2F4->unk_068 == 0) { + obj2F4->obj.rot.y = 0.0f; } break; case 0x30: case 0x31: case 0x32: - func_E9F1D0_801A3BD4(arg0); + func_E9F1D0_801A3BD4(obj2F4); break; case 0x34: - func_80072474(arg0); + func_80072474(obj2F4); break; case 0x4E: - func_8006753C(arg0); + func_8006753C(obj2F4); break; case 0x4F: - if (arg0->unk_0C4 == 0) { - arg0->unk_0B6 += 1; - if (Animation_GetFrameCount(&D_600E5EC) < arg0->unk_0B6) { - arg0->unk_0B6 = 0; + if (obj2F4->unk_0C4 == 0) { + obj2F4->unk_0B6 += 1; + if (Animation_GetFrameCount(&D_600E5EC) < obj2F4->unk_0B6) { + obj2F4->unk_0B6 = 0; } } break; case 0x50: { - Object_8C* temp_v0_8; + Object_8C* obj8C; Vec3f sp90; Vec3f sp84; Vec3f sp78; s32 sp74; - switch (arg0->unk_046) { + switch (obj2F4->unk_046) { case 1: break; case 0: - Matrix_RotateZ(gCalcMatrix, arg0->unk_0F4.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, obj2F4->unk_0F4.z * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); - if ((arg0->obj.pos.y + sp90.y) > -30.0f) { + if ((obj2F4->obj.pos.y + sp90.y) > -30.0f) { for (sp74 = 0; sp74 < 7; sp74++) { - temp_v0_8 = func_8007783C(OBJECT_394); - if (temp_v0_8 != NULL) { - temp_v0_8->unk_78 = temp_v0_8->unk_7A = 12; - temp_v0_8->obj.status = 2; - temp_v0_8->obj.pos.x = arg0->obj.pos.x + sp90.x; - temp_v0_8->obj.pos.y = arg0->obj.pos.y + sp90.y; - temp_v0_8->obj.pos.z = arg0->obj.pos.z; - temp_v0_8->obj.rot.x = Rand_ZeroOne() * 360.0f; - temp_v0_8->obj.rot.y = Rand_ZeroOne() * 360.0f; - temp_v0_8->obj.rot.z = Rand_ZeroOne() * 360.0f; + obj8C = func_8007783C(OBJECT_394); + if (obj8C != NULL) { + obj8C->unk_78 = obj8C->unk_7A = 12; + obj8C->obj.status = 2; + obj8C->obj.pos.x = obj2F4->obj.pos.x + sp90.x; + obj8C->obj.pos.y = obj2F4->obj.pos.y + sp90.y; + obj8C->obj.pos.z = obj2F4->obj.pos.z; + obj8C->obj.rot.x = Rand_ZeroOne() * 360.0f; + obj8C->obj.rot.y = Rand_ZeroOne() * 360.0f; + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; sp84.x = (Rand_ZeroOne() * 25.0f) + 30.0f; sp84.y = (Rand_ZeroOne() * 25.0f) + 20.0f; sp84.z = 0.0f; - temp_v0_8->unk_44 = 10; - temp_v0_8->unk_70 = 1.0f; + obj8C->unk_44 = 10; + obj8C->unk_70 = 1.0f; Matrix_RotateY(gCalcMatrix, ((Rand_ZeroOne() * 180.0f) + 180.0f) * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp84, &sp78); - temp_v0_8->unk_54.x = sp78.x; - temp_v0_8->unk_54.y = sp78.y; - temp_v0_8->unk_54.z = sp78.z; - temp_v0_8->unk_60.x = (Rand_ZeroOne() - 0.5f) + 5.0f; - temp_v0_8->unk_60.y = (Rand_ZeroOne() - 0.5f) + 5.0f; - temp_v0_8->unk_60.z = (Rand_ZeroOne() - 0.5f) + 5.0f; + obj8C->unk_54.x = sp78.x; + obj8C->unk_54.y = sp78.y; + obj8C->unk_54.z = sp78.z; + obj8C->unk_60.x = (Rand_ZeroOne() - 0.5f) + 5.0f; + obj8C->unk_60.y = (Rand_ZeroOne() - 0.5f) + 5.0f; + obj8C->unk_60.z = (Rand_ZeroOne() - 0.5f) + 5.0f; } } - arg0->unk_046++; + obj2F4->unk_046++; } break; } - if ((fabsf(arg0->unk_114) > 10.0f) && !(gFrameCount & 1)) { - temp_v0_8 = func_8007783C(OBJECT_394); - if (temp_v0_8 != NULL) { - Matrix_RotateZ(gCalcMatrix, arg0->unk_0F4.z * M_DTOR, 0); + if ((fabsf(obj2F4->unk_114) > 10.0f) && !(gFrameCount & 1)) { + obj8C = func_8007783C(OBJECT_394); + if (obj8C != NULL) { + Matrix_RotateZ(gCalcMatrix, obj2F4->unk_0F4.z * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); - temp_v0_8->unk_78 = temp_v0_8->unk_7A = 0xB; - temp_v0_8->obj.status = 2; - temp_v0_8->obj.pos.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + arg0->obj.pos.x + sp90.x; - temp_v0_8->obj.pos.y = ((Rand_ZeroOne() - 0.5f) * 3.0f) + arg0->obj.pos.y + sp90.y; - temp_v0_8->obj.pos.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + arg0->obj.pos.z + 180.0f; - temp_v0_8->unk_70 = 9.0f; - temp_v0_8->obj.rot.z = Rand_ZeroOne() * 360.0f; - temp_v0_8->unk_54.x = (Rand_ZeroOne() - 0.5f) * 5.0f; - temp_v0_8->unk_54.y = (Rand_ZeroOne() - 0.5f) * 3.0f + 30.0f; - temp_v0_8->unk_44 = 100; - temp_v0_8->unk_46 = -8; - temp_v0_8->unk_60.z = 3; + obj8C->unk_78 = obj8C->unk_7A = 0xB; + obj8C->obj.status = 2; + obj8C->obj.pos.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.x + sp90.x; + obj8C->obj.pos.y = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.y + sp90.y; + obj8C->obj.pos.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.z + 180.0f; + obj8C->unk_70 = 9.0f; + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; + obj8C->unk_54.x = (Rand_ZeroOne() - 0.5f) * 5.0f; + obj8C->unk_54.y = (Rand_ZeroOne() - 0.5f) * 3.0f + 30.0f; + obj8C->unk_44 = 100; + obj8C->unk_46 = -8; + obj8C->unk_60.z = 3; if (Rand_ZeroOne() < 0.5f) { - temp_v0_8->unk_60.z = -temp_v0_8->unk_60.z; + obj8C->unk_60.z = -obj8C->unk_60.z; } if (gFrameCount & 2) { - temp_v0_8->unk_54.y = -temp_v0_8->unk_54.y; + obj8C->unk_54.y = -obj8C->unk_54.y; } } if (!(gFrameCount & 3)) { - temp_v0_8 = func_8007783C(OBJECT_394); - if (temp_v0_8 != NULL) { - temp_v0_8->unk_78 = temp_v0_8->unk_7A = 0xB; - temp_v0_8->obj.status = 2; - temp_v0_8->obj.pos.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + arg0->obj.pos.x; - temp_v0_8->obj.pos.y = ((Rand_ZeroOne() - 0.5f) * 5.0f) + arg0->obj.pos.y + 50.0f; - temp_v0_8->obj.pos.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + arg0->obj.pos.z + 200.0f; - temp_v0_8->unk_70 = 9.0f; - temp_v0_8->obj.rot.z = Rand_ZeroOne() * 360.0f; - temp_v0_8->unk_54.x = (Rand_ZeroOne() - 0.5f) * 5.0f; - temp_v0_8->unk_54.y = (Rand_ZeroOne() - 0.5f) * 3.0f + 10.0f; - temp_v0_8->unk_44 = 100; - temp_v0_8->unk_46 = -8; - temp_v0_8->unk_60.z = 3; + obj8C = func_8007783C(OBJECT_394); + if (obj8C != NULL) { + obj8C->unk_78 = obj8C->unk_7A = 0xB; + obj8C->obj.status = 2; + obj8C->obj.pos.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.x; + obj8C->obj.pos.y = ((Rand_ZeroOne() - 0.5f) * 5.0f) + obj2F4->obj.pos.y + 50.0f; + obj8C->obj.pos.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.z + 200.0f; + obj8C->unk_70 = 9.0f; + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; + obj8C->unk_54.x = (Rand_ZeroOne() - 0.5f) * 5.0f; + obj8C->unk_54.y = (Rand_ZeroOne() - 0.5f) * 3.0f + 10.0f; + obj8C->unk_44 = 100; + obj8C->unk_46 = -8; + obj8C->unk_60.z = 3; if (Rand_ZeroOne() < 0.5f) { - temp_v0_8->unk_60.z = -temp_v0_8->unk_60.z; + obj8C->unk_60.z = -obj8C->unk_60.z; } if (gFrameCount & 4) { - temp_v0_8->unk_54.y = -temp_v0_8->unk_54.y; + obj8C->unk_54.y = -obj8C->unk_54.y; } } } } } break; case 0x51: - Math_SmoothStepToF(&arg0->unk_150, 1.0f, 0.1f, 0.1f, 0.001f); - if (arg0->unk_150 > 0.5f) { - arg0->unk_01C.unk_0C = SEGMENTED_TO_VIRTUAL(D_601B4C4); + Math_SmoothStepToF(&obj2F4->unk_150, 1.0f, 0.1f, 0.1f, 0.001f); + if (obj2F4->unk_150 > 0.5f) { + obj2F4->unk_01C.hitbox = SEGMENTED_TO_VIRTUAL(D_601B4C4); } - if (arg0->unk_046 == 0) { - arg0->unk_154 += 4.0f; - if (arg0->unk_154 >= 100.0f) { - arg0->unk_046 = 1; - arg0->unk_154 = 100.0f; + if (obj2F4->unk_046 == 0) { + obj2F4->unk_154 += 4.0f; + if (obj2F4->unk_154 >= 100.0f) { + obj2F4->unk_046 = 1; + obj2F4->unk_154 = 100.0f; } } else { - arg0->unk_154 -= 4.0f; - if (arg0->unk_154 <= 0.0f) { - arg0->unk_046 = 0; - arg0->unk_154 = 0.0f; + obj2F4->unk_154 -= 4.0f; + if (obj2F4->unk_154 <= 0.0f) { + obj2F4->unk_046 = 0; + obj2F4->unk_154 = 0.0f; } } break; case 0x53: - if (arg0->unk_0CE <= 0) { - if (arg0->unk_0B6 == 0x14) { - spD4 = arg0->obj.pos.z; - spD8 = arg0->obj.pos.y; + if (obj2F4->unk_0CE <= 0) { + if (obj2F4->unk_0B6 == 0x14) { + spD4 = obj2F4->obj.pos.z; + spD8 = obj2F4->obj.pos.y; - arg0->obj.pos.y += 80.0f; - arg0->obj.pos.z += 40.0f; - func_80066254(arg0); - arg0->obj.pos.y = spD8; - arg0->obj.pos.z = spD4; + obj2F4->obj.pos.y += 80.0f; + obj2F4->obj.pos.z += 40.0f; + func_80066254(obj2F4); + obj2F4->obj.pos.y = spD8; + obj2F4->obj.pos.z = spD4; } - if ((arg0->unk_0B6 >= 0x12) && (arg0->unk_0B6 < 0x18)) { - func_8007BC7C(arg0->obj.pos.x, arg0->obj.pos.y + 80.0f, arg0->obj.pos.z + 60.0f, 20.0f); + if ((obj2F4->unk_0B6 >= 0x12) && (obj2F4->unk_0B6 < 0x18)) { + func_8007BC7C(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 80.0f, obj2F4->obj.pos.z + 60.0f, 20.0f); } - if (arg0->unk_0B6 < 49) { - arg0->unk_0B6++; - if (arg0->unk_0B6 >= 49) { - arg0->unk_0B6 = 49; + if (obj2F4->unk_0B6 < 49) { + obj2F4->unk_0B6++; + if (obj2F4->unk_0B6 >= 49) { + obj2F4->unk_0B6 = 49; } if (gFrameCount & 1) { - func_E16C50_801AC8A8(((Rand_ZeroOne() - 0.5f) * 100.0f) + arg0->obj.pos.x, - (Rand_ZeroOne() * 50.0f) + arg0->obj.pos.y, - ((Rand_ZeroOne() - 0.5f) * 100.0f) + arg0->obj.pos.z, 1.0f, 0); + func_E16C50_801AC8A8(((Rand_ZeroOne() - 0.5f) * 100.0f) + obj2F4->obj.pos.x, + (Rand_ZeroOne() * 50.0f) + obj2F4->obj.pos.y, + ((Rand_ZeroOne() - 0.5f) * 100.0f) + obj2F4->obj.pos.z, 1.0f, 0); } } - arg0->unk_0C2 = 10000; + obj2F4->unk_0C2 = 10000; } break; case 0x58: - if (arg0->unk_04A == 0) { - arg0->unk_046 += 4; - if (arg0->unk_046 >= 0xFF) { - arg0->unk_046 = 0xFF; - arg0->unk_04A = 1; + if (obj2F4->unk_04A == 0) { + obj2F4->unk_046 += 4; + if (obj2F4->unk_046 >= 0xFF) { + obj2F4->unk_046 = 0xFF; + obj2F4->unk_04A = 1; } } else { - arg0->unk_046 -= 4; - if (arg0->unk_046 <= 0) { - arg0->unk_046 = 0; - arg0->unk_04A = 0; + obj2F4->unk_046 -= 4; + if (obj2F4->unk_046 <= 0) { + obj2F4->unk_046 = 0; + obj2F4->unk_04A = 0; } } break; case 0x67: case 0x68: - func_80187530(arg0); + func_80187530(obj2F4); break; case 0x6A: - arg0->unk_0B6 += 1; - if (arg0->unk_0B6 >= 6) { - arg0->unk_0B6 = 0; + obj2F4->unk_0B6 += 1; + if (obj2F4->unk_0B6 >= 6) { + obj2F4->unk_0B6 = 0; } break; } if (D_80177880 == 1) { - D_80177F24[arg0->unk_040] = arg0->obj.pos.x; - D_8017802C[arg0->unk_040] = arg0->obj.pos.z; - D_80178134[arg0->unk_040] = Math_ModF(arg0->unk_0F4.y, 360.0f) + 180.0f; - D_80178238[arg0->unk_040 + 1] = 1; + D_80177F24[obj2F4->unk_040] = obj2F4->obj.pos.x; + D_8017802C[obj2F4->unk_040] = obj2F4->obj.pos.z; + D_80178134[obj2F4->unk_040] = Math_ModF(obj2F4->unk_0F4.y, 360.0f) + 180.0f; + D_80178238[obj2F4->unk_040 + 1] = 1; } } } UNK_TYPE D_800D129C[0x8C] = { 0 }; // unused -bool func_80074BFC(s32 arg0, Gfx** arg1, Vec3f* arg2, Vec3f* arg3, void* arg42) { - Object_2F4* arg4 = arg42; +bool func_80074BFC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { + Object_2F4* obj2F4 = data; - if (arg0 == 1) { - arg2->x += arg4->unk_154; + if (limbIndex == 1) { + pos->x += obj2F4->unk_154; } - if (arg0 == 2) { - arg3->z -= arg4->unk_150; + if (limbIndex == 2) { + rot->z -= obj2F4->unk_150; } return false; } -bool func_80074C44(s32 arg0, Gfx** arg1, Vec3f* arg2, Vec3f* arg3, void* arg42) { - Object_2F4* arg4 = arg42; +bool func_80074C44(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { + Object_2F4* obj2F4 = data; s32 var_s1; - if (arg0 == 5) { - var_s1 = (s32) (arg4->unk_0CE * 0.6375f); + if (limbIndex == 5) { + var_s1 = (s32) (obj2F4->unk_0CE * 0.6375f); if (var_s1 > 255) { var_s1 = 255; } if (var_s1 < 0) { var_s1 = 1.0f / 70.925f; } - Matrix_Translate(gCalcMatrix, arg2->x, arg2->y, arg2->z, 1); - Matrix_RotateZ(gCalcMatrix, arg3->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, arg3->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg3->x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); Matrix_SetGfxMtx(&gMasterDisp); - if (*arg1 != NULL) { + if (*dList != NULL) { RCP_SetupDL(&gMasterDisp, 0x22); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, var_s1, var_s1, 255); - gSPDisplayList(gMasterDisp++, *arg1); + gSPDisplayList(gMasterDisp++, *dList); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } return true; @@ -3336,71 +3349,72 @@ bool func_80074C44(s32 arg0, Gfx** arg1, Vec3f* arg2, Vec3f* arg3, void* arg42) return false; } -void func_80074E3C(Object_2F4* arg0) { +void func_80074E3C(Object_2F4* obj2F4) { Vec3f sp30[10]; Animation_GetFrameData(&D_6013820, 0, sp30); - sp30[6].y += arg0->unk_150; - sp30[5].z += arg0->unk_154 + ((arg0->unk_0BE >> 2) & 1); - sp30[4].z -= arg0->unk_154 + ((arg0->unk_0BE >> 2) & 1); - Animation_DrawSkeleton(1, D_601390C, sp30, func_80074C44, NULL, arg0, &gIdentityMatrix); + sp30[6].y += obj2F4->unk_150; + sp30[5].z += obj2F4->unk_154 + ((obj2F4->unk_0BE >> 2) & 1); + sp30[4].z -= obj2F4->unk_154 + ((obj2F4->unk_0BE >> 2) & 1); + Animation_DrawSkeleton(1, D_601390C, sp30, func_80074C44, NULL, obj2F4, &gIdentityMatrix); } -bool func_80074F04(s32 arg0, Gfx** arg1, Vec3f* arg2, Vec3f* arg3, void* arg4) { +bool func_80074F04(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN); - if ((arg0 == 3) || (arg0 == 5)) { + if ((limbIndex == 3) || (limbIndex == 5)) { gSPTexture(gMasterDisp++, 5000, 5000, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); } return false; } -s32 func_80074F90(Object_80* arg0) { +s32 func_80074F90(Object_80* obj80) { RCP_SetupDL(&gMasterDisp, 0x3C); gSPDisplayList(gMasterDisp++, D_601AD70); RCP_SetupDL(&gMasterDisp, 0x40); return 0; } -void func_80074FF0(Object_2F4* arg0) { +void func_80074FF0(Object_2F4* obj2F4) { Vec3f sp114[31]; f32 sp40; s16 temp_s0; s32 pad; - if (arg0->unk_0C6 && (arg0->unk_0B4 != 0x5A) && (arg0->unk_0B4 != 0x44) && (arg0->unk_0B4 != 0x48)) { - if ((arg0->unk_0B4 != 0xD) && (arg0->unk_0B4 != 0xE) && (arg0->unk_0B4 != 0x3D) && (arg0->unk_0B4 != 0x3E) && - (arg0->unk_0B4 != 0x53) && (arg0->unk_0B4 != 0x62) && (arg0->unk_110 > 0.5f) && (arg0->unk_0C6 >= 9) && - !(arg0->unk_0C6 & 3) && (D_80177854 != 0x64)) { - func_8007C120(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_0E8.x, arg0->unk_0E8.y, - arg0->unk_0E8.z, arg0->unk_110 * 0.07f, 3); + if (obj2F4->unk_0C6 && (obj2F4->unk_0B4 != 0x5A) && (obj2F4->unk_0B4 != 0x44) && (obj2F4->unk_0B4 != 0x48)) { + if ((obj2F4->unk_0B4 != 0xD) && (obj2F4->unk_0B4 != 0xE) && (obj2F4->unk_0B4 != 0x3D) && + (obj2F4->unk_0B4 != 0x3E) && (obj2F4->unk_0B4 != 0x53) && (obj2F4->unk_0B4 != 0x62) && + (obj2F4->unk_110 > 0.5f) && (obj2F4->unk_0C6 >= 9) && !(obj2F4->unk_0C6 & 3) && (D_80177854 != 0x64)) { + func_8007C120(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_0E8.x, obj2F4->unk_0E8.y, + obj2F4->unk_0E8.z, obj2F4->unk_110 * 0.07f, 3); } - if ((arg0->unk_0B4 != 0x15) && (arg0->unk_0B4 != 0x17) && (arg0->unk_0B4 != 0x4F) && (arg0->unk_0B4 != 0x53) && - (arg0->unk_0B4 != 0x1B) && (arg0->unk_0B4 != 0x33) && (arg0->unk_0B4 != 0xD) && (arg0->unk_0B4 != 0x48) && - (arg0->unk_0B4 != 0x1C) && (arg0->unk_110 > 0.5f)) { - sp40 = __sinf(arg0->unk_0C6 * 400.0f * M_DTOR) * arg0->unk_0C6; + if ((obj2F4->unk_0B4 != 0x15) && (obj2F4->unk_0B4 != 0x17) && (obj2F4->unk_0B4 != 0x4F) && + (obj2F4->unk_0B4 != 0x53) && (obj2F4->unk_0B4 != 0x1B) && (obj2F4->unk_0B4 != 0x33) && + (obj2F4->unk_0B4 != 0xD) && (obj2F4->unk_0B4 != 0x48) && (obj2F4->unk_0B4 != 0x1C) && + (obj2F4->unk_110 > 0.5f)) { + sp40 = __sinf(obj2F4->unk_0C6 * 400.0f * M_DTOR) * obj2F4->unk_0C6; Matrix_RotateY(gGfxMatrix, M_DTOR * sp40, 1); Matrix_RotateX(gGfxMatrix, M_DTOR * sp40, 1); Matrix_RotateZ(gGfxMatrix, M_DTOR * sp40, 1); Matrix_SetGfxMtx(&gMasterDisp); } } - if ((arg0->obj.status == 3) && (arg0->unk_0BE != 0)) { + if ((obj2F4->obj.status == 3) && (obj2F4->unk_0BE != 0)) { RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } - if ((arg0->unk_0B4 == 0x1D) || (arg0->unk_0B4 == 0x3B) || (arg0->unk_0B4 == 0x3C)) { + if ((obj2F4->unk_0B4 == 0x1D) || (obj2F4->unk_0B4 == 0x3B) || (obj2F4->unk_0B4 == 0x3C)) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - } else if ((arg0->unk_0B4 == 0x52) || (arg0->unk_0B4 == 0x5A) || - ((arg0->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR))) { - if (!(arg0->unk_0C6 & 1)) { + } else if ((obj2F4->unk_0B4 == 0x52) || (obj2F4->unk_0B4 == 0x5A) || + ((obj2F4->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR))) { + if (!(obj2F4->unk_0C6 & 1)) { RCP_SetupDL(&gMasterDisp, 0x39); } else { RCP_SetupDL(&gMasterDisp, 0x3D); } } - switch (arg0->unk_0B4) { + switch (obj2F4->unk_0B4) { case 0x5C: case 0x5D: case 0x5E: @@ -3408,38 +3422,38 @@ void func_80074FF0(Object_2F4* arg0) { case 0x60: RCP_SetupDL(&gMasterDisp, 0x22); gDPSetTextureFilter(gMasterDisp++, G_TF_POINT); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) arg0[0].unk_150, (s32) arg0[0].unk_154, - (s32) arg0[0].unk_158, 255); - gSPDisplayList(gMasterDisp++, D_800D003C[arg0->unk_0B4].unk_00); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) obj2F4[0].unk_150, (s32) obj2F4[0].unk_154, + (s32) obj2F4[0].unk_158, 255); + gSPDisplayList(gMasterDisp++, D_800D003C[obj2F4->unk_0B4].unk_00); gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); break; default: { - if ((arg0->unk_0B4 < 0xC8) && (D_800D003C[arg0->unk_0B4].unk_00 != NULL)) { - gSPDisplayList(gMasterDisp++, D_800D003C[arg0->unk_0B4].unk_00); + if ((obj2F4->unk_0B4 < 0xC8) && (D_800D003C[obj2F4->unk_0B4].unk_00 != NULL)) { + gSPDisplayList(gMasterDisp++, D_800D003C[obj2F4->unk_0B4].unk_00); } - switch (arg0->unk_0B4) { + switch (obj2F4->unk_0B4) { case 0x38: func_800515C4(); break; case 0x0: - arg0->unk_07C = 1; - func_8005ADAC(arg0); + obj2F4->unk_07C = 1; + func_8005ADAC(obj2F4); break; case 0x2: - arg0->unk_150 -= arg0->unk_150 * 0.1f; - arg0->unk_17C -= arg0->unk_17C * 0.1f; - arg0->unk_154 -= arg0->unk_154 * 0.1f; - arg0->unk_180 -= arg0->unk_180 * 0.1f; - if (arg0->obj.rot.z > 0.0f) { - arg0->unk_150 += (arg0->obj.rot.z * 0.7f - arg0->unk_150) * 0.2f; - arg0->unk_17C += (-arg0->obj.rot.z * 0.7f - arg0->unk_17C) * 0.2f; + obj2F4->unk_150 -= obj2F4->unk_150 * 0.1f; + obj2F4->unk_17C -= obj2F4->unk_17C * 0.1f; + obj2F4->unk_154 -= obj2F4->unk_154 * 0.1f; + obj2F4->unk_180 -= obj2F4->unk_180 * 0.1f; + if (obj2F4->obj.rot.z > 0.0f) { + obj2F4->unk_150 += (obj2F4->obj.rot.z * 0.7f - obj2F4->unk_150) * 0.2f; + obj2F4->unk_17C += (-obj2F4->obj.rot.z * 0.7f - obj2F4->unk_17C) * 0.2f; } - if (arg0->obj.rot.z < 0.0f) { - arg0->unk_154 += (-arg0->obj.rot.z * 0.7f - arg0->unk_154) * 0.2f; - arg0->unk_180 += (arg0->obj.rot.z * 0.7f - arg0->unk_180) * 0.2f; + if (obj2F4->obj.rot.z < 0.0f) { + obj2F4->unk_154 += (-obj2F4->obj.rot.z * 0.7f - obj2F4->unk_154) * 0.2f; + obj2F4->unk_180 += (obj2F4->obj.rot.z * 0.7f - obj2F4->unk_180) * 0.2f; } - func_8005B388(arg0); + func_8005B388(obj2F4); break; case 0x2B: if (gLevelType == 0) { @@ -3447,46 +3461,46 @@ void func_80074FF0(Object_2F4* arg0) { } else { gSPDisplayList(gMasterDisp++, D_4007870); } - func_8005ADAC(arg0); + func_8005ADAC(obj2F4); break; case 0x5: - arg0->unk_07C = 1; - func_8005ADAC(arg0); + obj2F4->unk_07C = 1; + func_8005ADAC(obj2F4); break; case 0x6: if (gCurrentLevel == LEVEL_SOLAR) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Animation_GetFrameData(&D_600636C, arg0->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_6006558, sp114, NULL, NULL, arg0, &gIdentityMatrix); + Animation_GetFrameData(&D_600636C, obj2F4->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_6006558, sp114, NULL, NULL, obj2F4, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } else { - Animation_GetFrameData(&D_40057AC, arg0->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_40058B8, sp114, NULL, NULL, arg0, &gIdentityMatrix); + Animation_GetFrameData(&D_40057AC, obj2F4->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_40058B8, sp114, NULL, NULL, obj2F4, &gIdentityMatrix); } break; case 0x7: - arg0->unk_07C = 1; - func_8005ADAC(arg0); + obj2F4->unk_07C = 1; + func_8005ADAC(obj2F4); break; case 0x9: Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); - Animation_GetFrameData(&D_40001A4, arg0->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_4000270, sp114, NULL, NULL, arg0, &gIdentityMatrix); + Animation_GetFrameData(&D_40001A4, obj2F4->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_4000270, sp114, NULL, NULL, obj2F4, &gIdentityMatrix); break; case 0x12: - if (arg0->unk_114 > 0.1f) { - arg0->unk_07C = 1; + if (obj2F4->unk_114 > 0.1f) { + obj2F4->unk_07C = 1; Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, 1); - func_8005B1E8(arg0, 2); + func_8005B1E8(obj2F4, 2); } break; case 0x13: - if (arg0->unk_114 > 0.1f) { - arg0->unk_07C = 1; + if (obj2F4->unk_114 > 0.1f) { + obj2F4->unk_07C = 1; Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, 1); - func_8005B1E8(arg0, 2); + func_8005B1E8(obj2F4, 2); } break; case 0x14: @@ -3498,23 +3512,23 @@ void func_80074FF0(Object_2F4* arg0) { gSPDisplayList(gMasterDisp++, D_6018BF0); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - arg0->unk_07C = 1; - func_8005B1E8(arg0, 2); + obj2F4->unk_07C = 1; + func_8005B1E8(obj2F4, 2); break; case 0x16: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_6019730); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - arg0->unk_07C = 1; - func_8005B1E8(arg0, 2); + obj2F4->unk_07C = 1; + func_8005B1E8(obj2F4, 2); break; case 0x1B: - if (arg0->unk_0C2 != 0) { - if (!(arg0->unk_0C2 & 3) && (D_80177854 != 0x64)) { - func_8007D0E0(((Rand_ZeroOne() - 0.5f) * 200.0f) + arg0->obj.pos.x, - ((Rand_ZeroOne() - 0.5f) * 200.0f) + arg0->obj.pos.y, - ((Rand_ZeroOne() - 0.5f) * 200.0f) + arg0->obj.pos.z, + if (obj2F4->unk_0C2 != 0) { + if (!(obj2F4->unk_0C2 & 3) && (D_80177854 != 0x64)) { + func_8007D0E0(((Rand_ZeroOne() - 0.5f) * 200.0f) + obj2F4->obj.pos.x, + ((Rand_ZeroOne() - 0.5f) * 200.0f) + obj2F4->obj.pos.y, + ((Rand_ZeroOne() - 0.5f) * 200.0f) + obj2F4->obj.pos.z, (Rand_ZeroOne() * 1.5f) + 2.5f); } RCP_SetupDL(&gMasterDisp, 0x39); @@ -3530,44 +3544,44 @@ void func_80074FF0(Object_2F4* arg0) { gSPDisplayList(gMasterDisp++, D_600E0C0); break; case 0x21: - Animation_GetFrameData(&D_400A30C, arg0->unk_0B6, sp114); + Animation_GetFrameData(&D_400A30C, obj2F4->unk_0B6, sp114); Matrix_RotateY(gGfxMatrix, M_PI, 1); Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, 1); - Animation_DrawSkeleton(1, D_400A398, sp114, func_80074BFC, NULL, arg0, &gIdentityMatrix); - Math_SmoothStepToF(&arg0[0].unk_154, 0.0f, 0.3f, 2.0f, 0.0001f); + Animation_DrawSkeleton(1, D_400A398, sp114, func_80074BFC, NULL, obj2F4, &gIdentityMatrix); + Math_SmoothStepToF(&obj2F4[0].unk_154, 0.0f, 0.3f, 2.0f, 0.0001f); break; case 0x24: - Animation_GetFrameData(&D_700CAF4, arg0->unk_0B6, sp114); - sp114[2].z += arg0->unk_150; - Animation_DrawSkeleton(1, D_700CB60, sp114, NULL, NULL, arg0, &gIdentityMatrix); + Animation_GetFrameData(&D_700CAF4, obj2F4->unk_0B6, sp114); + sp114[2].z += obj2F4->unk_150; + Animation_DrawSkeleton(1, D_700CB60, sp114, NULL, NULL, obj2F4, &gIdentityMatrix); break; case 0x26: - func_80074E3C(arg0); + func_80074E3C(obj2F4); break; case 0x30: case 0x31: case 0x32: - func_E9F1D0_801A4CB0(arg0); + func_E9F1D0_801A4CB0(obj2F4); break; case 0x34: - Animation_GetFrameData(&D_601F874, arg0->unk_0B6, sp114); - sp114[2].z -= arg0->unk_150; + Animation_GetFrameData(&D_601F874, obj2F4->unk_0B6, sp114); + sp114[2].z -= obj2F4->unk_150; gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, 1); - Animation_DrawSkeleton(1, D_601F920, sp114, NULL, NULL, arg0, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_601F920, sp114, NULL, NULL, obj2F4, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; case 0x40: Matrix_Push(&gGfxMatrix); - Matrix_RotateX(gGfxMatrix, arg0->unk_0F4.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, arg0->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, obj2F4->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, obj2F4->unk_0F4.y * M_DTOR, 1); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, arg0->unk_150, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, obj2F4->unk_150, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_600CAA0); Matrix_Pop(&gGfxMatrix); gSPDisplayList(gMasterDisp++, D_600C130); - Matrix_Translate(gGfxMatrix, 0.0f, -arg0->unk_150, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -obj2F4->unk_150, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_600C740); Matrix_Pop(&gGfxMatrix); @@ -3578,13 +3592,13 @@ void func_80074FF0(Object_2F4* arg0) { gSPDisplayList(gMasterDisp++, D_6009E30); break; case 0x4E: - func_80067874(arg0); + func_80067874(obj2F4); break; case 0x4F: - temp_s0 = arg0->unk_0B8; - arg0->unk_0B8 = 2; - func_E16C50_80190430(arg0); - arg0->unk_0B8 = temp_s0; + temp_s0 = obj2F4->unk_0B8; + obj2F4->unk_0B8 = 2; + func_E16C50_80190430(obj2F4); + obj2F4->unk_0B8 = temp_s0; break; case 0x50: Matrix_Scale(gGfxMatrix, 0.6f, 0.6f, 0.6f, 1); @@ -3592,10 +3606,10 @@ void func_80074FF0(Object_2F4* arg0) { gSPDisplayList(gMasterDisp++, D_9011200); break; case 0x51: - if (arg0->unk_150 > 0.001f) { - Matrix_Scale(gGfxMatrix, arg0->unk_150, arg0->unk_150, arg0->unk_150, 1); + if (obj2F4->unk_150 > 0.001f) { + Matrix_Scale(gGfxMatrix, obj2F4->unk_150, obj2F4->unk_150, obj2F4->unk_150, 1); Matrix_SetGfxMtx(&gMasterDisp); - func_800A1558(arg0->unk_154, 0xB0, D_9003890, D_9003DF0, D_9003330); + func_800A1558(obj2F4->unk_154, 0xB0, D_9003890, D_9003DF0, D_9003330); gSPDisplayList(gMasterDisp++, D_9002CF0); } break; @@ -3606,20 +3620,20 @@ void func_80074FF0(Object_2F4* arg0) { break; case 0x53: Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); - Animation_GetFrameData(&D_602201C, arg0->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_60220E8, sp114, NULL, NULL, arg0, &gIdentityMatrix); + Animation_GetFrameData(&D_602201C, obj2F4->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_60220E8, sp114, NULL, NULL, obj2F4, &gIdentityMatrix); break; case 0x55: gSPDisplayList(gMasterDisp++, D_D00B880); - func_8005ADAC(arg0); + func_8005ADAC(obj2F4); break; case 0x56: gSPDisplayList(gMasterDisp++, D_D009A40); - func_8005ADAC(arg0); + func_8005ADAC(obj2F4); break; case 0x58: RCP_SetupDL(&gMasterDisp, 0x16); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, arg0->unk_046, arg0->unk_046, arg0->unk_046, 255); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, obj2F4->unk_046, obj2F4->unk_046, obj2F4->unk_046, 255); gSPDisplayList(gMasterDisp++, D_6008970); break; case 0x59: @@ -3628,7 +3642,7 @@ void func_80074FF0(Object_2F4* arg0) { break; case 0x67: case 0x68: - func_E6A810_8018769C(arg0); + func_E6A810_8018769C(obj2F4); break; case 0x69: RCP_SetupDL(&gMasterDisp, 0x23); @@ -3637,28 +3651,28 @@ void func_80074FF0(Object_2F4* arg0) { gSPDisplayList(gMasterDisp++, D_7000000); break; case 0x6A: - Animation_GetFrameData(&D_4000080, arg0->unk_0B6, sp114); - Animation_DrawSkeleton(1, D_400014C, sp114, NULL, NULL, arg0, &gIdentityMatrix); + Animation_GetFrameData(&D_4000080, obj2F4->unk_0B6, sp114); + Animation_DrawSkeleton(1, D_400014C, sp114, NULL, NULL, obj2F4, &gIdentityMatrix); break; case 0xFFF: - arg0->unk_0C2 = 10; + obj2F4->unk_0C2 = 10; break; } - if ((D_80161410 > 0) && ((arg0->unk_080 > 0) && (arg0->unk_080 < 6))) { + if ((D_80161410 > 0) && ((obj2F4->unk_080 > 0) && (obj2F4->unk_080 < 6))) { Vec3f sp58 = { 0.0f, 0.0f, 0.0f }; - if ((arg0->unk_080 == 4) || (arg0->unk_080 == 5)) { - Matrix_MultVec3f(gGfxMatrix, &sp58, &D_80177E98[arg0->unk_080 + 4]); + if ((obj2F4->unk_080 == 4) || (obj2F4->unk_080 == 5)) { + Matrix_MultVec3f(gGfxMatrix, &sp58, &D_80177E98[obj2F4->unk_080 + 4]); return; } else { - Matrix_MultVec3f(gGfxMatrix, &sp58, &D_80177E98[arg0->unk_080]); + Matrix_MultVec3f(gGfxMatrix, &sp58, &D_80177E98[obj2F4->unk_080]); } } } break; } } -void func_800763A4(Object_2F4* arg0) { +void func_800763A4(Object_2F4* obj2F4) { s32 var_s0; s32 sp60; s32 sp5C; @@ -3666,224 +3680,226 @@ void func_800763A4(Object_2F4* arg0) { Vec3f sp4C; s32 pad; - if (arg0->unk_0B4 == 0x1B) { - arg0->obj.pos.y -= arg0->unk_0E8.y; - arg0->obj.status = 2; - func_8007D0E0(arg0->obj.pos.x - arg0->unk_0E8.x, arg0->obj.pos.y + 30.0f, arg0->obj.pos.z - arg0->unk_0E8.z, - arg0->unk_110 * 5.0f); - arg0->unk_0C2 = 10000; + if (obj2F4->unk_0B4 == 0x1B) { + obj2F4->obj.pos.y -= obj2F4->unk_0E8.y; + obj2F4->obj.status = 2; + func_8007D0E0(obj2F4->obj.pos.x - obj2F4->unk_0E8.x, obj2F4->obj.pos.y + 30.0f, + obj2F4->obj.pos.z - obj2F4->unk_0E8.z, obj2F4->unk_110 * 5.0f); + obj2F4->unk_0C2 = 10000; return; } - if (arg0->unk_0BE != 0) { - arg0->unk_0E8.z = 0.0f; - arg0->unk_0E8.x = 0.0f; - arg0->unk_0E8.y = 0.0f; - if (arg0->unk_0BE == 1) { - Object_Kill(&arg0->obj, &arg0->unk_100); - func_80066254(arg0); + if (obj2F4->unk_0BE != 0) { + obj2F4->unk_0E8.z = 0.0f; + obj2F4->unk_0E8.x = 0.0f; + obj2F4->unk_0E8.y = 0.0f; + if (obj2F4->unk_0BE == 1) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + func_80066254(obj2F4); if (D_80177880 == 1) { - D_80177F24[arg0->unk_040] = arg0->obj.pos.x; - D_8017802C[arg0->unk_040] = arg0->obj.pos.z; - D_80178134[arg0->unk_040] = 1001.0f; + D_80177F24[obj2F4->unk_040] = obj2F4->obj.pos.x; + D_8017802C[obj2F4->unk_040] = obj2F4->obj.pos.z; + D_80178134[obj2F4->unk_040] = 1001.0f; } return; } } else { if ((gLevelType == 0) || (gCurrentLevel == 0x11)) { - arg0->unk_10C = 0.4f; + obj2F4->unk_10C = 0.4f; } - switch (arg0->unk_04C) { + switch (obj2F4->unk_04C) { case 0: case 1: - if (arg0->unk_040 & 1) { - arg0->obj.rot.z -= 8.0f; + if (obj2F4->unk_040 & 1) { + obj2F4->obj.rot.z -= 8.0f; } else { - arg0->obj.rot.z += 8.0f; + obj2F4->obj.rot.z += 8.0f; } break; case 2: - arg0->obj.rot.y += 5.0f; - arg0->obj.rot.x += 7.3f; + obj2F4->obj.rot.y += 5.0f; + obj2F4->obj.rot.x += 7.3f; break; case 3: - arg0->obj.rot.y += 6.0f; - arg0->obj.rot.x += 18.3f; - arg0->unk_10C = 0.7f; + obj2F4->obj.rot.y += 6.0f; + obj2F4->obj.rot.x += 18.3f; + obj2F4->unk_10C = 0.7f; break; case 4: - arg0->obj.rot.x += (-90.0f - arg0->obj.rot.x) * 0.1f; + obj2F4->obj.rot.x += (-90.0f - obj2F4->obj.rot.x) * 0.1f; break; } - if (((arg0->unk_0BC & 3) == 1) && (arg0->unk_0B4 != 0xD) && (arg0->unk_0B4 != 0x3D)) { - func_8007D24C(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 2.2f); + if (((obj2F4->unk_0BC & 3) == 1) && (obj2F4->unk_0B4 != 0xD) && (obj2F4->unk_0B4 != 0x3D)) { + func_8007D24C(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 2.2f); } if ((D_80178294 != 0) && - (func_800A73E4(&sp58, &sp5C, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z) != 0)) { - func_8007BFFC(arg0->obj.pos.x, sp58 + 20.0f, arg0->obj.pos.z, 0.0f, 0.0f, 0.0f, arg0->unk_110 * 3.0f, 5); - func_8007B228(arg0->obj.pos.x, sp58, arg0->obj.pos.z, 2.0f); - arg0->unk_0BE = 2; - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + (func_800A73E4(&sp58, &sp5C, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z) != 0)) { + func_8007BFFC(obj2F4->obj.pos.x, sp58 + 20.0f, obj2F4->obj.pos.z, 0.0f, 0.0f, 0.0f, obj2F4->unk_110 * 3.0f, + 5); + func_8007B228(obj2F4->obj.pos.x, sp58, obj2F4->obj.pos.z, 2.0f); + obj2F4->unk_0BE = 2; + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); return; } if (D_801784AC == 4) { - if (func_E6A810_801B6AEC(arg0->obj.pos.x, arg0->obj.pos.y - 10.0f, arg0->obj.pos.z + D_80177D20) != 0) { - func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y + 20.0f, arg0->obj.pos.z, arg0->unk_110 * 6.0f); - func_8007BFFC(arg0->obj.pos.x - arg0->unk_0E8.x, arg0->obj.pos.y + 30.0f, - arg0->obj.pos.z - arg0->unk_0E8.z, 0.0f, 0.0f, 0.0f, arg0->unk_110 * 4.0f, 0x14); - func_80062C38(arg0->obj.pos.x, arg0->obj.pos.z); - arg0->unk_0BE = 2; - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + if (func_E6A810_801B6AEC(obj2F4->obj.pos.x, obj2F4->obj.pos.y - 10.0f, obj2F4->obj.pos.z + D_80177D20) != + 0) { + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 20.0f, obj2F4->obj.pos.z, obj2F4->unk_110 * 6.0f); + func_8007BFFC(obj2F4->obj.pos.x - obj2F4->unk_0E8.x, obj2F4->obj.pos.y + 30.0f, + obj2F4->obj.pos.z - obj2F4->unk_0E8.z, 0.0f, 0.0f, 0.0f, obj2F4->unk_110 * 4.0f, 0x14); + func_80062C38(obj2F4->obj.pos.x, obj2F4->obj.pos.z); + obj2F4->unk_0BE = 2; + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); return; } } else { - sp4C.x = arg0->unk_0E8.x; - sp4C.y = arg0->unk_0E8.y; - sp4C.z = arg0->unk_0E8.z; - sp60 = func_8006351C(arg0->unk_040, &arg0->obj.pos, &sp4C, 0); - if ((sp60 != 0) || (arg0->obj.pos.y < (D_80177940 + 30.0f))) { - if ((Rand_ZeroOne() < 0.5f) && (arg0->unk_04C < 3) && (gLevelType == 0) && (sp60 != 999) && - (D_80161A88 != 2) && ((arg0->unk_0E8.z < -20.0f) || (arg0->unk_0E8.z > 0.0f))) { + sp4C.x = obj2F4->unk_0E8.x; + sp4C.y = obj2F4->unk_0E8.y; + sp4C.z = obj2F4->unk_0E8.z; + sp60 = func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &sp4C, 0); + if ((sp60 != 0) || (obj2F4->obj.pos.y < (D_80177940 + 30.0f))) { + if ((Rand_ZeroOne() < 0.5f) && (obj2F4->unk_04C < 3) && (gLevelType == 0) && (sp60 != 999) && + (D_80161A88 != 2) && ((obj2F4->unk_0E8.z < -20.0f) || (obj2F4->unk_0E8.z > 0.0f))) { if (gCurrentLevel == 0xE) { - func_8006BF7C(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z - arg0->unk_0E8.z); - func_80062C38(arg0->obj.pos.x, arg0->obj.pos.z); + func_8006BF7C(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z - obj2F4->unk_0E8.z); + func_80062C38(obj2F4->obj.pos.x, obj2F4->obj.pos.z); } - arg0->obj.pos.y -= arg0->unk_0E8.y; - arg0->unk_0E8.y = Rand_ZeroOne() * 10.0f; - arg0->unk_04C = 3; + obj2F4->obj.pos.y -= obj2F4->unk_0E8.y; + obj2F4->unk_0E8.y = Rand_ZeroOne() * 10.0f; + obj2F4->unk_04C = 3; if (D_80177880 == 1) { - func_8007D2C8(arg0->obj.pos.x - arg0->unk_0E8.x, arg0->obj.pos.y, - arg0->obj.pos.z - arg0->unk_0E8.z, arg0->unk_110 * 3.0f); + func_8007D2C8(obj2F4->obj.pos.x - obj2F4->unk_0E8.x, obj2F4->obj.pos.y, + obj2F4->obj.pos.z - obj2F4->unk_0E8.z, obj2F4->unk_110 * 3.0f); } - func_8007D2C8(arg0->obj.pos.x - arg0->unk_0E8.x, arg0->obj.pos.y, arg0->obj.pos.z - arg0->unk_0E8.z, - arg0->unk_110 * 3.0f); - if ((arg0->obj.id == 0xC5) && (arg0->unk_0E4 < 8)) { - func_8007A6F0(&arg0->obj.pos, 0x2903B009); + func_8007D2C8(obj2F4->obj.pos.x - obj2F4->unk_0E8.x, obj2F4->obj.pos.y, + obj2F4->obj.pos.z - obj2F4->unk_0E8.z, obj2F4->unk_110 * 3.0f); + if ((obj2F4->obj.id == 0xC5) && (obj2F4->unk_0E4 < 8)) { + func_8007A6F0(&obj2F4->obj.pos, 0x2903B009); } else { - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } - if ((arg0->obj.id == 0xC8) && (arg0->unk_0B4 == 2)) { - if (arg0->unk_158 < 360.0f) { - func_800A69F8(1, arg0->obj.pos.x + 20.0f, arg0->obj.pos.y, arg0->obj.pos.z); - arg0->unk_158 = 777.0f; + if ((obj2F4->obj.id == 0xC8) && (obj2F4->unk_0B4 == 2)) { + if (obj2F4->unk_158 < 360.0f) { + func_800A69F8(1, obj2F4->obj.pos.x + 20.0f, obj2F4->obj.pos.y, obj2F4->obj.pos.z); + obj2F4->unk_158 = 777.0f; } - if (arg0->unk_15C < 360.0f) { - func_800A69F8(0, arg0->obj.pos.x - 20.0f, arg0->obj.pos.y, arg0->obj.pos.z); - arg0->unk_15C = 777.0f; + if (obj2F4->unk_15C < 360.0f) { + func_800A69F8(0, obj2F4->obj.pos.x - 20.0f, obj2F4->obj.pos.y, obj2F4->obj.pos.z); + obj2F4->unk_15C = 777.0f; } } } else { - if ((arg0->obj.pos.y < (D_80177940 + 30.0f)) && (gLevelType == 0)) { - arg0->unk_0E8.z = 0.0f; + if ((obj2F4->obj.pos.y < (D_80177940 + 30.0f)) && (gLevelType == 0)) { + obj2F4->unk_0E8.z = 0.0f; if (D_80161A88 == 2) { - func_8007D9DC(arg0->obj.pos.x, D_80177940 + 2.0f, arg0->obj.pos.z, 3.0f, 20.0f, 0); - func_8007D9DC(arg0->obj.pos.x, D_80177940 + 2.0f, arg0->obj.pos.z, 3.0f, 20.0f, 0xA); - func_8007D9DC(arg0->obj.pos.x, D_80177940 + 2.0f, arg0->obj.pos.z, 3.0f, 20.0f, 0x14); - func_8007ADF4(arg0->obj.pos.x, D_80177940, arg0->obj.pos.z, 0.1f, 3.0f); + func_8007D9DC(obj2F4->obj.pos.x, D_80177940 + 2.0f, obj2F4->obj.pos.z, 3.0f, 20.0f, 0); + func_8007D9DC(obj2F4->obj.pos.x, D_80177940 + 2.0f, obj2F4->obj.pos.z, 3.0f, 20.0f, 0xA); + func_8007D9DC(obj2F4->obj.pos.x, D_80177940 + 2.0f, obj2F4->obj.pos.z, 3.0f, 20.0f, 0x14); + func_8007ADF4(obj2F4->obj.pos.x, D_80177940, obj2F4->obj.pos.z, 0.1f, 3.0f); } else { - func_800365E4(arg0->obj.pos.x, 3.0f, arg0->obj.pos.z, arg0->obj.pos.x, arg0->obj.pos.z, - 0.0f, 0.0f, 90.0f, 6.5f, 0, 0); + func_800365E4(obj2F4->obj.pos.x, 3.0f, obj2F4->obj.pos.z, obj2F4->obj.pos.x, + obj2F4->obj.pos.z, 0.0f, 0.0f, 90.0f, 6.5f, 0, 0); } - func_8007C120(arg0->obj.pos.x, 20.0f, arg0->obj.pos.z, 0.0f, 0.0f, 0.0f, arg0->unk_110 * 0.05f, - 0x1E); + func_8007C120(obj2F4->obj.pos.x, 20.0f, obj2F4->obj.pos.z, 0.0f, 0.0f, 0.0f, + obj2F4->unk_110 * 0.05f, 0x1E); if ((gCurrentLevel == 0xE) || (gCurrentLevel == 0x13)) { - func_8007C688(arg0->obj.pos.x, D_80177940 + 30.0f, arg0->obj.pos.z, 3.0f, 0x3C); + func_8007C688(obj2F4->obj.pos.x, D_80177940 + 30.0f, obj2F4->obj.pos.z, 3.0f, 0x3C); if (gCurrentLevel == 0xE) { - func_80062C38(arg0->obj.pos.x, arg0->obj.pos.z); + func_80062C38(obj2F4->obj.pos.x, obj2F4->obj.pos.z); } } } - arg0->obj.pos.y -= arg0->unk_0E8.y; - func_8007D0E0(arg0->obj.pos.x - arg0->unk_0E8.x, arg0->obj.pos.y + 30.0f, - arg0->obj.pos.z - arg0->unk_0E8.z, arg0->unk_110 * 5.0f); + obj2F4->obj.pos.y -= obj2F4->unk_0E8.y; + func_8007D0E0(obj2F4->obj.pos.x - obj2F4->unk_0E8.x, obj2F4->obj.pos.y + 30.0f, + obj2F4->obj.pos.z - obj2F4->unk_0E8.z, obj2F4->unk_110 * 5.0f); if (D_80177880 == 1) { - func_8007BFFC(arg0->obj.pos.x, arg0->obj.pos.y + 30.0f, arg0->obj.pos.z, arg0->unk_0E8.x, 10.0f, - arg0->unk_0E8.z, arg0->unk_110 * 3.0f, 0x14); + func_8007BFFC(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 30.0f, obj2F4->obj.pos.z, + obj2F4->unk_0E8.x, 10.0f, obj2F4->unk_0E8.z, obj2F4->unk_110 * 3.0f, 0x14); if (sp60 == 0x3E7) { - func_8007C688(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_110 * 3.0f, - 0x46); + func_8007C688(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, + obj2F4->unk_110 * 3.0f, 0x46); } for (var_s0 = 0; var_s0 < 4; var_s0++) { if (Rand_ZeroOne() < 0.7f) { if (gCurrentLevel == 0xE) { - func_800A69F8(4, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z); + func_800A69F8(4, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z); } else { - func_800794CC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 1.0f); + func_800794CC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 1.0f); } } } } else { - func_8007BFFC(arg0->obj.pos.x - arg0->unk_0E8.x, arg0->obj.pos.y + 30.0f, - (arg0->obj.pos.z - arg0->unk_0E8.z) + 48.0f, 0.0f, 0.0f, 0.0f, - arg0->unk_110 * 3.0f, 5); + func_8007BFFC(obj2F4->obj.pos.x - obj2F4->unk_0E8.x, obj2F4->obj.pos.y + 30.0f, + (obj2F4->obj.pos.z - obj2F4->unk_0E8.z) + 48.0f, 0.0f, 0.0f, 0.0f, + obj2F4->unk_110 * 3.0f, 5); } - arg0->unk_0BE = 2; - if ((arg0->obj.id == 0xC5) && (arg0->unk_0E4 < 8)) { - func_8007A6F0(&arg0->obj.pos, 0x2903B009); + obj2F4->unk_0BE = 2; + if ((obj2F4->obj.id == 0xC5) && (obj2F4->unk_0E4 < 8)) { + func_8007A6F0(&obj2F4->obj.pos, 0x2903B009); } else { - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } } } } - if ((arg0->unk_0D0 != 0) || (arg0->unk_0BC == 0) || ((arg0->unk_044 != 0) && (arg0->obj.id != 0xC5))) { + if ((obj2F4->unk_0D0 != 0) || (obj2F4->unk_0BC == 0) || ((obj2F4->unk_044 != 0) && (obj2F4->obj.id != 0xC5))) { if (D_80177880 == 1) { for (var_s0 = 0; var_s0 < 4; var_s0++) { if (Rand_ZeroOne() < 0.7f) { if (gCurrentLevel == 0xE) { - func_800A69F8(4, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z); + func_800A69F8(4, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z); } else { - func_800794CC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 1.0f); + func_800794CC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 1.0f); } } } - func_8007BFFC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_0E8.x, arg0->unk_0E8.y, - arg0->unk_0E8.z, 5.0f, 0xF); - func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z - arg0->unk_0E8.z, 8.0f); + func_8007BFFC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_0E8.x, + obj2F4->unk_0E8.y, obj2F4->unk_0E8.z, 5.0f, 0xF); + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z - obj2F4->unk_0E8.z, 8.0f); } else { - if ((arg0->unk_0B4 != 0xD) && (arg0->unk_0B4 != 0x3D)) { - func_8007D0E0(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z - arg0->unk_0E8.z, - arg0->unk_110 * 5.0f); + if ((obj2F4->unk_0B4 != 0xD) && (obj2F4->unk_0B4 != 0x3D)) { + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z - obj2F4->unk_0E8.z, + obj2F4->unk_110 * 5.0f); } - if (arg0->unk_0B4 == 0x24) { - func_8007BFFC(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, arg0->unk_0E8.x, arg0->unk_0E8.y, - arg0->unk_0E8.z, 5.0f, 0xF); + if (obj2F4->unk_0B4 == 0x24) { + func_8007BFFC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, obj2F4->unk_0E8.x, + obj2F4->unk_0E8.y, obj2F4->unk_0E8.z, 5.0f, 0xF); } } - arg0->unk_0BE = 2; - if ((arg0->obj.id == 0xC5) && (arg0->unk_0E4 < 8)) { - func_8007A6F0(&arg0->obj.pos, 0x2903B009); + obj2F4->unk_0BE = 2; + if ((obj2F4->obj.id == 0xC5) && (obj2F4->unk_0E4 < 8)) { + func_8007A6F0(&obj2F4->obj.pos, 0x2903B009); } else { - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } } } if (D_80177880 == 1) { - D_80177F24[arg0->unk_040] = arg0->obj.pos.x; - D_8017802C[arg0->unk_040] = arg0->obj.pos.z; - D_80178134[arg0->unk_040] = arg0->unk_0F4.y + 180.0f; + D_80177F24[obj2F4->unk_040] = obj2F4->obj.pos.x; + D_8017802C[obj2F4->unk_040] = obj2F4->obj.pos.z; + D_80178134[obj2F4->unk_040] = obj2F4->unk_0F4.y + 180.0f; } - if (arg0->obj.id == 0xC5) { - func_8002EE64(arg0); + if (obj2F4->obj.id == 0xC5) { + func_8002EE64(obj2F4); } } -void func_8007717C(Object_2F4* arg0) { - if ((arg0->unk_0B4 == 0x30) || (arg0->unk_0B4 == 0x31) || (arg0->unk_0B4 == 0x32)) { - func_E9F1D0_801A3BD4(arg0); +void func_8007717C(Object_2F4* obj2F4) { + if ((obj2F4->unk_0B4 == 0x30) || (obj2F4->unk_0B4 == 0x31) || (obj2F4->unk_0B4 == 0x32)) { + func_E9F1D0_801A3BD4(obj2F4); } else { - func_800763A4(arg0); + func_800763A4(obj2F4); } } -void func_800771CC(Object_2F4* arg0) { +void func_800771CC(Object_2F4* obj2F4) { Vec3f sp24; - Math_Vec3fFromAngles(&sp24, arg0->obj.rot.x, arg0->obj.rot.y, 50.0f); - arg0->unk_0E8.x = sp24.x; - arg0->unk_0E8.y = sp24.y; - arg0->unk_0E8.z = sp24.z; + Math_Vec3fFromAngles(&sp24, obj2F4->obj.rot.x, obj2F4->obj.rot.y, 50.0f); + obj2F4->unk_0E8.x = sp24.x; + obj2F4->unk_0E8.y = sp24.y; + obj2F4->unk_0E8.z = sp24.z; } -void func_80077218(Object_2F4* arg0) { +void func_80077218(Object_2F4* obj2F4) { func_800515C4(); } diff --git a/src/main/fox_97F80.c b/src/main/fox_97F80.c index 3eb1553b..c6935b20 100644 --- a/src/main/fox_97F80.c +++ b/src/main/fox_97F80.c @@ -328,6 +328,7 @@ s32 func_800985CC(Vec3f* vec, Vtx_tn* tri) { return 1; } +// Plane from normal and point void func_80098860(Plane* plane, Vec3f* point, Vec3f* normal) { plane->normal.x = normal->x; plane->normal.y = normal->y; @@ -335,14 +336,17 @@ void func_80098860(Plane* plane, Vec3f* point, Vec3f* normal) { plane->dist = -normal->x * point->x - normal->y * point->y - normal->z * point->z; } +// y dist to plane s32 func_800988B4(Vec3f* vec, Plane* plane) { return (-plane->normal.x * vec->x - plane->normal.z * vec->z - plane->dist) / plane->normal.y; } +// z dist to plane s32 func_800988F8(Vec3f* vec, Plane* plane) { return (-plane->normal.x * vec->x - plane->normal.y * vec->y - plane->dist) / plane->normal.z; } +// x dist to plane s32 func_8009893C(Vec3f* vec, Plane* plane) { return (-plane->normal.y * vec->y - plane->normal.z * vec->z - plane->dist) / plane->normal.x; } diff --git a/src/main/fox_A4290.c b/src/main/fox_A4290.c index 44e8df9b..96b726b0 100644 --- a/src/main/fox_A4290.c +++ b/src/main/fox_A4290.c @@ -79,41 +79,42 @@ bool func_800A36FC(Vec3f* arg0, Vec3f* arg1, CollisionHeader2* arg2, Vec3f* arg3 return sp38; } +// Checks if arg0 is above the triangle arg1. If so, returns the triangle normal in arg2. s32 func_800A3A74(Vec3f* arg0, Vec3f** arg1, Vec3f* arg2) { s32 pad; f32 temp1; s32 var_v1; f32 temp_fv0; - Vec3f sp44; - Vec3f sp38; - Vec3f sp2C; - f32 sp28; - f32 sp24; + Vec3f v1; + Vec3f v2; + Vec3f v3; + f32 a0x; + f32 a0y; - var_v1 = 0; - sp44.x = (*arg1)->x; - sp44.y = (*arg1)->y; - sp44.z = (*arg1)->z; + var_v1 = false; + v1.x = (*arg1)->x; + v1.y = (*arg1)->y; + v1.z = (*arg1)->z; arg1++; - sp38.x = (*arg1)->x; - sp38.y = (*arg1)->y; - sp38.z = (*arg1)->z; + v2.x = (*arg1)->x; + v2.y = (*arg1)->y; + v2.z = (*arg1)->z; arg1++; - sp2C.x = (*arg1)->x; - sp2C.y = (*arg1)->y; - sp2C.z = (*arg1)->z; + v3.x = (*arg1)->x; + v3.y = (*arg1)->y; + v3.z = (*arg1)->z; arg1++; - sp28 = arg0->x; - sp24 = arg0->z; - temp1 = ((sp38.z - sp44.z) * (sp28 - sp38.x)) - ((sp38.x - sp44.x) * (sp24 - sp38.z)); + a0x = arg0->x; + a0y = arg0->z; + temp1 = ((v2.z - v1.z) * (a0x - v2.x)) - ((v2.x - v1.x) * (a0y - v2.z)); if (temp1 >= 0.0f) { - if (((sp2C.x - sp38.x) * (sp24 - sp2C.z)) <= ((sp2C.z - sp38.z) * (sp28 - sp2C.x))) { - if (((sp44.x - sp2C.x) * (sp24 - sp44.z)) <= ((sp44.z - sp2C.z) * (sp28 - sp44.x))) { - var_v1 = 1; - arg2->x = ((sp38.y - sp44.y) * (sp2C.z - sp38.z)) - ((sp38.z - sp44.z) * (sp2C.y - sp38.y)); - arg2->y = ((sp38.z - sp44.z) * (sp2C.x - sp38.x)) - ((sp38.x - sp44.x) * (sp2C.z - sp38.z)); - arg2->z = ((sp38.x - sp44.x) * (sp2C.y - sp38.y)) - ((sp38.y - sp44.y) * (sp2C.x - sp38.x)); + if (((v3.x - v2.x) * (a0y - v3.z)) <= ((v3.z - v2.z) * (a0x - v3.x))) { + if (((v1.x - v3.x) * (a0y - v1.z)) <= ((v1.z - v3.z) * (a0x - v1.x))) { + var_v1 = true; + arg2->x = ((v2.y - v1.y) * (v3.z - v2.z)) - ((v2.z - v1.z) * (v3.y - v2.y)); + arg2->y = ((v2.z - v1.z) * (v3.x - v2.x)) - ((v2.x - v1.x) * (v3.z - v2.z)); + arg2->z = ((v2.x - v1.x) * (v3.y - v2.y)) - ((v2.y - v1.y) * (v3.x - v2.x)); if ((arg2->x != 0.0f) || (arg2->y != 0.0f) || (arg2->z != 0.0f)) { temp_fv0 = sqrtf(SQ(arg2->x) + SQ(arg2->y) + SQ(arg2->z)); if (temp_fv0 != 0) { diff --git a/src/main/fox_52730.c b/src/main/fox_display.c similarity index 68% rename from src/main/fox_52730.c rename to src/main/fox_display.c index ef65e620..d2ff288a 100644 --- a/src/main/fox_52730.c +++ b/src/main/fox_display.c @@ -68,7 +68,7 @@ void func_80051B30(void) { } switch (sp7C) { case 0: - if (D_800CA234->unk_100.x > 0.0f) { + if (D_800CA234->sfxPos.x > 0.0f) { sp78 = 20.0f; sp74 = M_PI / 2.0f; } else { @@ -122,56 +122,56 @@ void func_80051B30(void) { } s32 func_800520FC(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, void* data) { - Player* arg4 = (Player*) data; + Player* player = (Player*) data; gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); - if (arg4->unk_1C4 == 1) { + if (player->unk_1C4 == 1) { if (limbIndex == 0x10) { - rot->y += arg4->unk_154; - rot->y -= arg4->unk_180; + rot->y += player->unk_154; + rot->y -= player->unk_180; } if (limbIndex == 0x16) { - rot->y += -arg4->unk_158 * 0.8f; - rot->x -= arg4->unk_15C; + rot->y += -player->unk_158 * 0.8f; + rot->x -= player->unk_15C; } if (limbIndex == 1) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - rot->y += arg4->unk_164; + rot->y += player->unk_164; } if (limbIndex == 2) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - rot->y += arg4->unk_164; + rot->y += player->unk_164; } if (limbIndex == 3) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - rot->y += arg4->unk_168; + rot->y += player->unk_168; } if (limbIndex == 4) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - rot->y += arg4->unk_168; + rot->y += player->unk_168; } } else { if (limbIndex == 0xB) { - if (arg4->unk_1C4 == 0) { - rot->y += -arg4->unk_154 * 0.8f; + if (player->unk_1C4 == 0) { + rot->y += -player->unk_154 * 0.8f; } - if (arg4->unk_1C4 == 2) { - rot->y += arg4->unk_154; - rot->y -= arg4->unk_180; + if (player->unk_1C4 == 2) { + rot->y += player->unk_154; + rot->y -= player->unk_180; } - if (arg4->unk_1C4 == 3) { - rot->y += arg4->unk_154 * 0.8f; + if (player->unk_1C4 == 3) { + rot->y += player->unk_154 * 0.8f; } } if (limbIndex == 0x10) { - rot->y += -arg4->unk_158 * 0.8f; - rot->x -= arg4->unk_15C; + rot->y += -player->unk_158 * 0.8f; + rot->x -= player->unk_15C; } - if ((limbIndex == 0x11) && (arg4->unk_1C4 != 2)) { - rot->y += arg4->unk_180; - rot->x -= arg4->unk_180; - rot->y += -arg4->unk_158 * 0.2f; - rot->x += -arg4->unk_15C * 0.2f; + if ((limbIndex == 0x11) && (player->unk_1C4 != 2)) { + rot->y += player->unk_180; + rot->x -= player->unk_180; + rot->y += -player->unk_158 * 0.2f; + rot->x += -player->unk_15C * 0.2f; } } return 0; @@ -179,60 +179,60 @@ s32 func_800520FC(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, void* dat void func_800523A8(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; - Player* arg2 = (Player*) data; + Player* player = (Player*) data; if (limbIndex == 0xB) { sp1C.x = 3.0f; sp1C.y = 1.0f; sp1C.z = -28.0f; - Matrix_MultVec3f(gGfxMatrix, &sp1C, &D_801613B0[arg2->unk_1C4]); + Matrix_MultVec3f(gGfxMatrix, &sp1C, &D_801613B0[player->unk_1C4]); } } void func_80052420(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; - Player* arg2 = (Player*) data; + Player* player = (Player*) data; if (limbIndex == 0x10) { sp1C.x = 13.0f; sp1C.y = 2.0f; sp1C.z = 28.0f; - Matrix_MultVec3f(gGfxMatrix, &sp1C, &D_801613B0[arg2->unk_1C4]); + Matrix_MultVec3f(gGfxMatrix, &sp1C, &D_801613B0[player->unk_1C4]); } } void func_80052498(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; - Player* arg2 = (Player*) data; + Player* player = (Player*) data; if (limbIndex == 0xB) { sp1C.x = 0.0f; sp1C.y = 2.0f; sp1C.z = 29.0f; - Matrix_MultVec3f(gGfxMatrix, &sp1C, &D_801613B0[arg2->unk_1C4]); + Matrix_MultVec3f(gGfxMatrix, &sp1C, &D_801613B0[player->unk_1C4]); } } void func_8005250C(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp1C; - Player* arg2 = (Player*) data; + Player* player = (Player*) data; if (limbIndex == 0xB) { sp1C.x = 19.0f; sp1C.y = 1.0f; sp1C.z = 32.0f; - Matrix_MultVec3f(gGfxMatrix, &sp1C, &D_801613B0[arg2->unk_1C4]); + Matrix_MultVec3f(gGfxMatrix, &sp1C, &D_801613B0[player->unk_1C4]); } } -void func_80052584(Player* arg0) { +void func_80052584(Player* player) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &gIdentityMatrix); - if ((arg0->unk_1C8 == 3) && (arg0->unk_1F8 != 0)) { - Matrix_Translate(gGfxMatrix, D_801613B0[arg0->unk_1C4].x, D_801613B0[arg0->unk_1C4].y, - D_801613B0[arg0->unk_1C4].z, 1); - Matrix_Scale(gGfxMatrix, D_800CA23C[arg0->unk_1F8 - 1], D_800CA23C[arg0->unk_1F8 - 1], - D_800CA23C[arg0->unk_1F8 - 1], 1); + if ((player->unk_1C8 == 3) && (player->unk_1F8 != 0)) { + Matrix_Translate(gGfxMatrix, D_801613B0[player->unk_1C4].x, D_801613B0[player->unk_1C4].y, + D_801613B0[player->unk_1C4].z, 1); + Matrix_Scale(gGfxMatrix, D_800CA23C[player->unk_1F8 - 1], D_800CA23C[player->unk_1F8 - 1], + D_800CA23C[player->unk_1F8 - 1], 1); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_40(); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -241,22 +241,22 @@ void func_80052584(Player* arg0) { Matrix_Pop(&gGfxMatrix); } -void func_800526B8(Player* arg0) { +void func_800526B8(Player* player) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gCalcMatrix, 0.5f, 0.5f, 0.5f, 1); Matrix_Translate(gCalcMatrix, 0.0f, 35.0f, 0.0f, 1); - switch (arg0->unk_1C4) { + switch (player->unk_1C4) { case 0: - Animation_DrawSkeleton(5, D_301D258, arg0->jointTable, func_800520FC, func_800523A8, arg0, gCalcMatrix); + Animation_DrawSkeleton(5, D_301D258, player->jointTable, func_800520FC, func_800523A8, player, gCalcMatrix); break; case 1: - Animation_DrawSkeleton(5, D_301DB94, arg0->jointTable, func_800520FC, func_80052420, arg0, gCalcMatrix); + Animation_DrawSkeleton(5, D_301DB94, player->jointTable, func_800520FC, func_80052420, player, gCalcMatrix); break; case 2: - Animation_DrawSkeleton(5, D_301E3E8, arg0->jointTable, func_800520FC, func_80052498, arg0, gCalcMatrix); + Animation_DrawSkeleton(5, D_301E3E8, player->jointTable, func_800520FC, func_80052498, player, gCalcMatrix); break; case 3: - Animation_DrawSkeleton(5, D_301C614, arg0->jointTable, func_800520FC, func_8005250C, arg0, gCalcMatrix); + Animation_DrawSkeleton(5, D_301C614, player->jointTable, func_800520FC, func_8005250C, player, gCalcMatrix); break; } Matrix_Pop(&gGfxMatrix); @@ -265,7 +265,7 @@ void func_800526B8(Player* arg0) { // Vec3f D_800CA254 = {0.0f, 0.0f, 90.0f}; // Vec3f D_800CA260 = {0.0f, 40.0f, -70.0f}; -void func_80052884(Player* arg0) { +void func_80052884(Player* player) { f32 sp64; Vec3f sp58; Vec3f sp4C = { 0.0f, 0.0f, 90.0f }; @@ -277,13 +277,13 @@ void func_80052884(Player* arg0) { } else { gSPDisplayList(gMasterDisp++, D_300FB80); } - Matrix_MultVec3f(gGfxMatrix, &sp40, &D_80161518[arg0->unk_1C4]); + Matrix_MultVec3f(gGfxMatrix, &sp40, &D_80161518[player->unk_1C4]); Matrix_Translate(gGfxMatrix, 0.0f, 51.0f, -10.0f, 1); - Matrix_RotateY(gGfxMatrix, -arg0->unk_180 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, arg0->unk_17C * M_DTOR, 1); - if (D_801778A0 == arg0->unk_1C4) { + Matrix_RotateY(gGfxMatrix, -player->unk_180 * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, player->unk_17C * M_DTOR, 1); + if (D_801778A0 == player->unk_1C4) { sp64 = 0.0f; - if (D_801779C8[arg0->unk_1C4] >= 20) { + if (D_801779C8[player->unk_1C4] >= 20) { sp64 = (f32) (gFrameCount & 7) * 80.0f; } sp58.x = 0.0f; @@ -295,7 +295,7 @@ void func_80052884(Player* arg0) { } Matrix_SetGfxMtx(&gMasterDisp); if (D_801778E8 == 0) { - if (arg0->unk_1A0 != 0) { + if (player->unk_1A0 != 0) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 64, 255, 64, 255); } @@ -303,7 +303,7 @@ void func_80052884(Player* arg0) { } else { gSPDisplayList(gMasterDisp++, D_301F140); } - Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_80161548[arg0->unk_1C4]); + Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_80161548[player->unk_1C4]); Matrix_Pop(&gGfxMatrix); } @@ -315,13 +315,13 @@ f32 D_800CA294 = -10.0f; f32 D_800CA298[] = { 0.0f, 0.0f, 0.0f, 0.0f }; f32 D_800CA2A8 = 0.0f; -void func_80052B80(Player* arg0) { +void func_80052B80(Player* player) { Matrix_Push(&gGfxMatrix); - if ((arg0->unk_1C8 == 3) && (arg0->unk_1A0 != 0)) { - Matrix_Translate(gGfxMatrix, D_80161548[arg0->unk_1C4].x, D_80161548[arg0->unk_1C4].y, - D_80161548[arg0->unk_1C4].z, 1); - Matrix_Scale(gGfxMatrix, D_800CA248[arg0->unk_1A0 - 1], D_800CA248[arg0->unk_1A0 - 1], - D_800CA248[arg0->unk_1A0 - 1], 1); + if ((player->unk_1C8 == 3) && (player->unk_1A0 != 0)) { + Matrix_Translate(gGfxMatrix, D_80161548[player->unk_1C4].x, D_80161548[player->unk_1C4].y, + D_80161548[player->unk_1C4].z, 1); + Matrix_Scale(gGfxMatrix, D_800CA248[player->unk_1A0 - 1], D_800CA248[player->unk_1A0 - 1], + D_800CA248[player->unk_1A0 - 1], 1); Matrix_SetGfxMtx(&gMasterDisp); if (D_801778E8 != 0) { RCP_SetupDL_40(); @@ -339,11 +339,11 @@ void func_80052B80(Player* arg0) { Matrix_Pop(&gGfxMatrix); } -void func_80052D48(Player* arg0) { +void func_80052D48(Player* player) { f32 sp2C; Matrix_Push(&gGfxMatrix); - Matrix_Copy(gGfxMatrix, &D_80161418[arg0->unk_1C4]); + Matrix_Copy(gGfxMatrix, &D_80161418[player->unk_1C4]); if (D_801778E8 != 0) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 150); @@ -352,7 +352,7 @@ void func_80052D48(Player* arg0) { gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 192); RCP_SetupDL(&gMasterDisp, 0x43); } - sp2C = arg0->unk_16C; + sp2C = player->unk_16C; if (sp2C > 0.2f) { if (D_801778E8 == 0) { sp2C *= 1.1f; @@ -375,7 +375,7 @@ void func_80052D48(Player* arg0) { } Matrix_Pop(&gGfxMatrix); } - sp2C = arg0->unk_170; + sp2C = player->unk_170; if (sp2C > 0.2f) { if (D_801778E8 == 0) { sp2C *= 1.1f; @@ -512,35 +512,35 @@ bool func_800531A4(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, void* wi return false; } -void func_80053658(WingInfo* arg0) { +void func_80053658(WingInfo* wings) { Vec3f sp68[30]; s32 sp64; Matrix_Push(&gGfxMatrix); - arg0->unk_18 = 0.0f; - if (arg0->unk_14 < -7.0f) { - arg0->unk_18 = (-arg0->unk_14 - 7.0f) * 2.5f; + wings->unk_18 = 0.0f; + if (wings->unk_14 < -7.0f) { + wings->unk_18 = (-wings->unk_14 - 7.0f) * 2.5f; } if (gGameState == GSTATE_PLAY) { - Animation_DrawSkeleton(1, D_3016610, gPlayer[0].jointTable, func_800531A4, NULL, arg0, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_3016610, gPlayer[0].jointTable, func_800531A4, NULL, wings, &gIdentityMatrix); } else { if (gGameState == GSTATE_MENU) { Animation_GetFrameData(&D_3015AF4, 0, sp68); } else { Animation_GetFrameData(&D_3015C28, 0, sp68); } - Animation_DrawSkeleton(1, D_3016610, sp68, func_800531A4, NULL, arg0, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_3016610, sp68, func_800531A4, NULL, wings, &gIdentityMatrix); } D_800CA22C = 0; - sp64 = arg0->unk_2C; + sp64 = wings->unk_2C; if (D_800CA220 != 0) { sp64 = 1; } if (sp64 != 0) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 6.4f, -16.5f, 1); - Matrix_RotateY(gGfxMatrix, arg0->unk_34 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, arg0->unk_30 * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, wings->unk_34 * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, wings->unk_30 * M_DTOR, 1); Matrix_Scale(gGfxMatrix, 1.0f / 70.925f, 1.0f / 70.925f, 1.0f / 70.925f, 1); if (gGameState == GSTATE_CREDITS) { Matrix_Scale(gGfxMatrix, 0.95f, 0.95f, 0.95f, 1); @@ -554,7 +554,7 @@ void func_80053658(WingInfo* arg0) { Matrix_Pop(&gGfxMatrix); } Matrix_Translate(gGfxMatrix, 0.0f, 17.2f, -25.8f, 1); - Matrix_RotateX(gGfxMatrix, arg0->unk_38 * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, wings->unk_38 * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_64_2(); if ((gGameState == GSTATE_PLAY) && (gPlayer[0].unk_1C8 == 2) && (gCurrentLevel == LEVEL_CORNERIA)) { @@ -591,13 +591,13 @@ void func_80053B18(void) { Matrix_Pop(&gGfxMatrix); } -void func_80053C38(Player* arg0, s32 arg1) { +void func_80053C38(Player* player, s32 arg1) { Vec3f sp4C; f32 sp48; - if ((D_801778A0 == arg0->unk_1C4) && (arg1 == 0)) { + if ((D_801778A0 == player->unk_1C4) && (arg1 == 0)) { sp48 = 0.0f; - if (D_801779C8[arg0->unk_1C4] >= 20) { + if (D_801779C8[player->unk_1C4] >= 20) { sp48 = (f32) (gFrameCount & 7) * 80.0f; } sp4C.x = 0.0f; @@ -607,7 +607,8 @@ void func_80053C38(Player* arg0, s32 arg1) { sp4C.z = 2400.0f + sp48; Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_801613E0[1]); } - if ((arg0->unk_238 != 0) && (D_80177880 == 0) && (fabsf((arg0->unk_138 + D_80177D20) - arg0->unk_040.z) < 10.0f)) { + if ((player->unk_238 != 0) && (D_80177880 == 0) && + (fabsf((player->unk_138 + D_80177D20) - player->unk_040.z) < 10.0f)) { if (arg1 == 0) { D_800CA228 = 1; Matrix_Push(&gGfxMatrix); @@ -619,43 +620,44 @@ void func_80053C38(Player* arg0, s32 arg1) { } } else { if (D_801778E8 != 0) { - if ((arg0->wings.rightState == 2) && (arg0->wings.leftState == 2)) { + if ((player->wings.rightState == 2) && (player->wings.leftState == 2)) { gSPDisplayList(gMasterDisp++, D_300EE80); - } else if ((arg0->wings.rightState <= 1) && (arg0->wings.leftState == 2)) { + } else if ((player->wings.rightState <= 1) && (player->wings.leftState == 2)) { gSPDisplayList(gMasterDisp++, D_3010A90); - } else if ((arg0->wings.rightState == 2) && (arg0->wings.leftState <= 1)) { + } else if ((player->wings.rightState == 2) && (player->wings.leftState <= 1)) { gSPDisplayList(gMasterDisp++, D_3011470); } else { gSPDisplayList(gMasterDisp++, D_300D550); } } else { if ((gLevelType == 1) || (gCurrentLevel == LEVEL_BOLSE)) { - arg0->wings.unk_28 = arg0->wings.unk_04 = arg0->wings.unk_08 = arg0->wings.unk_0C = arg0->wings.unk_10 = - 0.0f; + player->wings.unk_28 = player->wings.unk_04 = player->wings.unk_08 = player->wings.unk_0C = + player->wings.unk_10 = 0.0f; } D_800CA22C = 1; D_80161410 = arg1; - func_80053658(&arg0->wings); + func_80053658(&player->wings); } } } -void func_80053F7C(Player* arg0) { +void func_80053F7C(Player* player) { Vec3f* pad; s32 i; - if ((D_801778A0 == arg0->unk_1C4) && ((arg0->unk_1CC == 0) || (arg0->unk_1CC == 1)) && (arg0->unk_234 != 0) && - (((gGameState == GSTATE_PLAY) && (arg0->unk_1C8 == 3)) || (gGameState == GSTATE_MENU))) { + if ((D_801778A0 == player->unk_1C4) && ((player->unk_1CC == 0) || (player->unk_1CC == 1)) && + (player->unk_234 != 0) && + (((gGameState == GSTATE_PLAY) && (player->unk_1C8 == 3)) || (gGameState == GSTATE_MENU))) { for (i = 0; i < 2; i++) { pad = &D_801613E0[i]; Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, pad->x, pad->y, pad->z, 1); - if (D_801779C8[arg0->unk_1C4] >= 20) { + if (D_801779C8[player->unk_1C4] >= 20) { RCP_SetupDL(&gMasterDisp, 0x3F); if (i == 1) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255); - Math_SmoothStepToF(&D_800CA298[arg0->unk_1C4], 2.0f, 1.0f, 0.4f, 0.0f); + Math_SmoothStepToF(&D_800CA298[player->unk_1C4], 2.0f, 1.0f, 0.4f, 0.0f); } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); gDPSetEnvColor(gMasterDisp++, 255, 255, 0, 255); @@ -664,8 +666,8 @@ void func_80053F7C(Player* arg0) { RCP_SetupDL_36(); } if (i == 1) { - Matrix_Scale(gGfxMatrix, D_800CA298[arg0->unk_1C4], D_800CA298[arg0->unk_1C4], 1.0f, 1); - Math_SmoothStepToF(&D_800CA298[arg0->unk_1C4], 1.0f, 1.0f, 0.2f, 0.0f); + Matrix_Scale(gGfxMatrix, D_800CA298[player->unk_1C4], D_800CA298[player->unk_1C4], 1.0f, 1); + Math_SmoothStepToF(&D_800CA298[player->unk_1C4], 1.0f, 1.0f, 0.2f, 0.0f); } Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); @@ -675,36 +677,36 @@ void func_80053F7C(Player* arg0) { } } -void func_80054280(Player* arg0, s32 arg1) { - switch (arg0->unk_1CC) { +void func_80054280(Player* player, s32 arg1) { + switch (player->unk_1CC) { case 0: - func_80053C38(arg0, arg1); + func_80053C38(player, arg1); return; case 1: - func_80052884(arg0); + func_80052884(player); return; case 2: func_E16C50_801ACBB4(); return; case 3: - func_800526B8(arg0); + func_800526B8(player); return; } } -void func_80054300(Player* arg0) { - Math_SmoothStepToF(&D_800CA2A8, arg0->unk_23C, 1.0f, 10.0f, 0.0f); +void func_80054300(Player* player) { + Math_SmoothStepToF(&D_800CA2A8, player->unk_23C, 1.0f, 10.0f, 0.0f); RCP_SetupDL(&gMasterDisp, 0x42); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, (s32) D_800CA2A8); - if (arg0->unk_068 > 30.0f) { + if (player->unk_068 > 30.0f) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } - if ((D_80161A88 == 2) && (arg0->unk_068 < 10.0f)) { - arg0->unk_23C = 90; + if ((D_80161A88 == 2) && (player->unk_068 < 10.0f)) { + player->unk_23C = 90; } else { - arg0->unk_23C = 180; + player->unk_23C = 180; } - switch (arg0->unk_1CC) { + switch (player->unk_1CC) { case 0: fake_label: Matrix_Scale(gGfxMatrix, 2.5049999f, 1.5f, 2.5049999f, 1); @@ -742,40 +744,40 @@ void func_80054300(Player* arg0) { } } -void func_8005465C(s32 arg0) { +void func_8005465C(s32 levelType) { RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); - switch (arg0) { - case 0: + switch (levelType) { + case LEVELTYPE_GROUND: gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255); break; - case 1: + case LEVELTYPE_SPACE: gDPSetEnvColor(gMasterDisp++, 0, 0, 255, 255); break; - case 2: + case LEVELTYPE_UNK2: gDPSetEnvColor(gMasterDisp++, 0, 255, 0, 255); break; - case 3: + case LEVELTYPE_UNK3: gDPSetEnvColor(gMasterDisp++, 255, 64, 0, 255); break; } gSPDisplayList(gMasterDisp++, D_1024AC0); } -void func_8005478C(Player* arg0) { +void func_8005478C(Player* player) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, arg0->unk_0F8 * M_DTOR, 1); - if (arg0->unk_1CC == 1) { - if (arg0->unk_194 <= 0.0f) { + Matrix_RotateZ(gGfxMatrix, player->unk_0F8 * M_DTOR, 1); + if (player->unk_1CC == 1) { + if (player->unk_194 <= 0.0f) { Matrix_Pop(&gGfxMatrix); return; } - Matrix_Scale(gGfxMatrix, arg0->unk_194, arg0->unk_194, 1.0f, 1); + Matrix_Scale(gGfxMatrix, player->unk_194, player->unk_194, 1.0f, 1); } else { - Matrix_Scale(gGfxMatrix, arg0->unk_194, arg0->unk_194, 1.0f, 1); + Matrix_Scale(gGfxMatrix, player->unk_194, player->unk_194, 1.0f, 1); } if (gFrameCount & 1) { Matrix_Scale(gGfxMatrix, 0.9f, 0.63f, 1.0f, 1); @@ -787,57 +789,58 @@ void func_8005478C(Player* arg0) { Matrix_Pop(&gGfxMatrix); } -void func_80054914(Player* arg0) { +void func_80054914(Player* player) { f32 sp4C; Vec3f sp40; Vec3f sp34; - if (arg0->unk_280 != 0) { - Matrix_RotateY(gCalcMatrix, (arg0->unk_114 + arg0->unk_0E8 + arg0->unk_134 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((arg0->unk_120 + arg0->unk_0E4 + arg0->unk_134 + arg0->unk_4D8) * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((arg0->unk_0F8 + arg0->unk_0F0 + arg0->unk_134) * M_DTOR), 1); - Matrix_Translate(gCalcMatrix, arg0->unk_084, arg0->unk_080, 0.0f, 1); + if (player->unk_280 != 0) { + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR), + 1); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); sp40.x = 0.0f; sp40.y = 0.0f; sp40.z = -30.0f; Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34); sp4C = 1.0f; - if (arg0->unk_1F0 < 0) { + if (player->unk_1F0 < 0) { sp4C = -1.0f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, arg0->unk_074 + sp34.x, arg0->unk_078 + sp34.y, - arg0->unk_138 + arg0->unk_144 + sp34.z, 1); + Matrix_Translate(gGfxMatrix, player->unk_074 + sp34.x, player->unk_078 + sp34.y, + player->unk_138 + player->unk_144 + sp34.z, 1); Matrix_RotateY(gGfxMatrix, -gPlayer[D_801778A0].unk_058, 1); Matrix_RotateX(gGfxMatrix, gPlayer[D_801778A0].unk_05C, 1); Matrix_RotateZ(gGfxMatrix, gFrameCount * 20.0f * sp4C * M_DTOR, 1); - if (arg0->unk_1CC == 0) { + if (player->unk_1CC == 0) { Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); } else { Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, 1); } - if (arg0->unk_1F0 < 0) { + if (player->unk_1F0 < 0) { Matrix_RotateX(gGfxMatrix, M_PI, 1); } Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x43); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, arg0->unk_280); - gDPSetEnvColor(gMasterDisp++, 0, 0, 160, arg0->unk_280); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, player->unk_280); + gDPSetEnvColor(gMasterDisp++, 0, 0, 160, player->unk_280); gSPDisplayList(gMasterDisp++, D_101DC10); Matrix_Pop(&gGfxMatrix); } } -void func_80054CA4(Player* arg0) { - if (D_80177AB8[arg0->unk_1C4] > 1.0f) { +void func_80054CA4(Player* player) { + if (D_80177AB8[player->unk_1C4] > 1.0f) { Matrix_Push(&gGfxMatrix); - Matrix_Copy(gGfxMatrix, &D_80161418[arg0->unk_1C4]); + Matrix_Copy(gGfxMatrix, &D_80161418[player->unk_1C4]); Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 10.0f, 1); Matrix_Scale(gGfxMatrix, 2.5f, 1.6f, 2.5f, 1); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x44); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 255, 255, (s32) D_80177AB8[arg0->unk_1C4]); - gDPSetEnvColor(gMasterDisp++, 255, 0, 255, (s32) D_80177AB8[arg0->unk_1C4]); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 255, 255, (s32) D_80177AB8[player->unk_1C4]); + gDPSetEnvColor(gMasterDisp++, 255, 0, 255, (s32) D_80177AB8[player->unk_1C4]); gSPDisplayList(gMasterDisp++, D_101CD70); Matrix_Pop(&gGfxMatrix); Texture_Scroll(D_101D070, 0x20, 0x20, 3); @@ -849,7 +852,7 @@ void func_80054CA4(Player* arg0) { // Vec3f D_800CA2B8 = {0.0f, -14.0f, 60.0f}; // Vec3f D_800CA2C4 = {30.0f, -10.0f, 30.0f}; // Vec3f D_800CA2D0 = {-30.0f, -10.0f, 30.0f}; -void func_80054E80(Player* arg0) { +void func_80054E80(Player* player) { Vec3f spC4 = { 0.0f, -5.0f, 60.0f }; Vec3f spB8 = { 0.0f, -14.0f, 60.0f }; Vec3f spAC = { 30.0f, -10.0f, 30.0f }; @@ -859,20 +862,20 @@ void func_80054E80(Player* arg0) { u8 var_v1; f32 sp80; - if (D_801779C8[arg0->unk_1C4] > 10) { + if (D_801779C8[player->unk_1C4] > 10) { RCP_SetupDL(&gMasterDisp, 0x43); - Matrix_Copy(gCalcMatrix, &D_80161418[arg0->unk_1C4]); - if ((arg0->unk_238 != 0) && (D_80177880 == 0)) { + Matrix_Copy(gCalcMatrix, &D_80161418[player->unk_1C4]); + if ((player->unk_238 != 0) && (D_80177880 == 0)) { Matrix_MultVec3f(gCalcMatrix, &spB8, &sp94); } else { Matrix_MultVec3f(gCalcMatrix, &spC4, &sp94); } Matrix_Push(&gGfxMatrix); - sp80 = D_801779C8[arg0->unk_1C4] / 20.0f; + sp80 = D_801779C8[player->unk_1C4] / 20.0f; Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, 0); Matrix_Scale(gGfxMatrix, sp80, sp80, 1.0f, 1); Matrix_Push(&gGfxMatrix); - if ((arg0->unk_238 != 0) && (D_80177880 == 0)) { + if ((player->unk_238 != 0) && (D_80177880 == 0)) { Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); } else { Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, 1); @@ -880,7 +883,7 @@ void func_80054E80(Player* arg0) { RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128); if (D_801778E8 != 0) { - switch (arg0->unk_1C4) { + switch (player->unk_1C4) { case 0: gDPSetEnvColor(gMasterDisp++, 255, 255, 32, 128); break; @@ -904,7 +907,7 @@ void func_80054E80(Player* arg0) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); Matrix_Pop(&gGfxMatrix); - if ((arg0->unk_238 != 0) && (D_80177880 == 0)) { + if ((player->unk_238 != 0) && (D_80177880 == 0)) { Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); } Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, 1); @@ -917,26 +920,26 @@ void func_80054E80(Player* arg0) { gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); } - if (D_80177AA0[arg0->unk_1C4] > 0.1f) { + if (D_80177AA0[player->unk_1C4] > 0.1f) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x43); - Matrix_Copy(gCalcMatrix, &D_80161418[arg0->unk_1C4]); - var_v1 = gLaserStrength[arg0->unk_1C4]; - if (arg0->wings.unk_14 > -8.0f) { + Matrix_Copy(gCalcMatrix, &D_80161418[player->unk_1C4]); + var_v1 = gLaserStrength[player->unk_1C4]; + if (player->wings.unk_14 > -8.0f) { var_v1 = 0; } switch (var_v1) { case 0: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 192, 255, 192, 128); gDPSetEnvColor(gMasterDisp++, 64, 255, 64, 128); - if ((arg0->unk_238 != 0) && (D_80177880 == 0)) { + if ((player->unk_238 != 0) && (D_80177880 == 0)) { Matrix_MultVec3f(gCalcMatrix, &spB8, &sp94); } else { Matrix_MultVec3f(gCalcMatrix, &spC4, &sp94); } Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, 0); - Matrix_Scale(gGfxMatrix, D_80177AA0[arg0->unk_1C4], D_80177AA0[arg0->unk_1C4], 1.0f, 1); + Matrix_Scale(gGfxMatrix, D_80177AA0[player->unk_1C4], D_80177AA0[player->unk_1C4], 1.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); @@ -954,13 +957,13 @@ void func_80054E80(Player* arg0) { Matrix_MultVec3f(gCalcMatrix, &spA0, &sp88); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, 0); - Matrix_Scale(gGfxMatrix, D_80177AA0[arg0->unk_1C4], D_80177AA0[arg0->unk_1C4], 1.0f, 1); + Matrix_Scale(gGfxMatrix, D_80177AA0[player->unk_1C4], D_80177AA0[player->unk_1C4], 1.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp88.x, sp88.y, sp88.z, 0); - Matrix_Scale(gGfxMatrix, D_80177AA0[arg0->unk_1C4], D_80177AA0[arg0->unk_1C4], 1.0f, 1); + Matrix_Scale(gGfxMatrix, D_80177AA0[player->unk_1C4], D_80177AA0[player->unk_1C4], 1.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); @@ -970,22 +973,22 @@ void func_80054E80(Player* arg0) { } } -void func_80055788(Player* arg0) { +void func_80055788(Player* player) { f32 sp54; - if (D_801779C8[arg0->unk_1C4] >= 0xB) { + if (D_801779C8[player->unk_1C4] >= 0xB) { RCP_SetupDL(&gMasterDisp, 0x43); Matrix_Push(&gGfxMatrix); - sp54 = D_801779C8[arg0->unk_1C4] / 20.0f; - Matrix_Translate(gGfxMatrix, D_80161548[arg0->unk_1C4].x, D_80161548[arg0->unk_1C4].y, - D_80161548[arg0->unk_1C4].z, 0); + sp54 = D_801779C8[player->unk_1C4] / 20.0f; + Matrix_Translate(gGfxMatrix, D_80161548[player->unk_1C4].x, D_80161548[player->unk_1C4].y, + D_80161548[player->unk_1C4].z, 0); Matrix_Scale(gGfxMatrix, sp54, sp54, 1.0f, 1); Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, 1); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128); if (D_801778E8 != 0) { - switch (arg0->unk_1C4) { + switch (player->unk_1C4) { case 0: gDPSetEnvColor(gMasterDisp++, 255, 255, 32, 128); break; @@ -1021,22 +1024,22 @@ void func_80055788(Player* arg0) { } } -void func_80055B58(Player* arg0) { +void func_80055B58(Player* player) { Vec3f sp4C; Vec3f sp40; f32 var_fv0; s32 pad[3]; - if ((arg0->unk_234 != 0) && (arg0->unk_1C8 != 4)) { - switch (arg0->unk_1CC) { + if ((player->unk_234 != 0) && (player->unk_1C8 != 4)) { + switch (player->unk_1CC) { case 0: - Matrix_RotateY(gCalcMatrix, (arg0->unk_114 + arg0->unk_0E8 + arg0->unk_134 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((arg0->unk_120 + arg0->unk_0E4 + arg0->unk_134 + arg0->unk_4D8) * M_DTOR), - 1); - Matrix_RotateZ(gCalcMatrix, -((arg0->unk_0F8 + arg0->unk_0F0 + arg0->unk_134) * M_DTOR), 1); - Matrix_Translate(gCalcMatrix, arg0->unk_084, arg0->unk_080, 0.0f, 1); - var_fv0 = arg0->unk_194 * 30.0f; + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, + -((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); + var_fv0 = player->unk_194 * 30.0f; if (var_fv0 > 30.0f) { var_fv0 = 30.0f; } @@ -1047,35 +1050,35 @@ void func_80055B58(Player* arg0) { Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, arg0->unk_074 + sp40.x, arg0->unk_078 + sp40.y, - arg0->unk_138 + arg0->unk_144 + sp40.z, 1); + Matrix_Translate(gGfxMatrix, player->unk_074 + sp40.x, player->unk_078 + sp40.y, + player->unk_138 + player->unk_144 + sp40.z, 1); Matrix_RotateY(gGfxMatrix, -gPlayer[D_801778A0].unk_058, 1); Matrix_RotateX(gGfxMatrix, gPlayer[D_801778A0].unk_05C, 1); Matrix_SetGfxMtx(&gMasterDisp); - func_8005478C(arg0); + func_8005478C(player); Matrix_Pop(&gGfxMatrix); - func_80054914(arg0); - func_80054CA4(arg0); - func_80054E80(arg0); + func_80054914(player); + func_80054CA4(player); + func_80054E80(player); break; case 1: - func_80052D48(arg0); + func_80052D48(player); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_80161518[arg0->unk_1C4].x, D_80161518[arg0->unk_1C4].y, - D_80161518[arg0->unk_1C4].z, 0); + Matrix_Translate(gGfxMatrix, D_80161518[player->unk_1C4].x, D_80161518[player->unk_1C4].y, + D_80161518[player->unk_1C4].z, 0); Matrix_SetGfxMtx(&gMasterDisp); - func_8005478C(arg0); + func_8005478C(player); Matrix_Pop(&gGfxMatrix); - func_80055788(arg0); + func_80055788(player); break; case 2: - func_80054914(arg0); + func_80054914(player); break; } } } -void func_80055E98(Player* arg0) { +void func_80055E98(Player* player) { f32 sp5C; f32 sp58; f32 sp54; @@ -1084,33 +1087,33 @@ void func_80055E98(Player* arg0) { sp5C = 70.0f; sp58 = -18.0f; - if (arg0->unk_204 == 2) { + if (player->unk_204 == 2) { sp5C = 108.0f; sp58 = -22.0f; } - if (arg0->unk_25C != 0.0f) { + if (player->unk_25C != 0.0f) { sp54 = 0.0f; if (gFrameCount & 1) { sp54 = 180.0f; } - var_fs0 = arg0->unk_0E8; + var_fs0 = player->unk_0E8; if (var_fs0 > 90.0f) { var_fs0 -= 180.0f; } var_fs0 = var_fs0 * 0.25f; - sp50 = arg0->unk_0E4 * 0.25f; - if (arg0->unk_1C8 == 7) { + sp50 = player->unk_0E4 * 0.25f; + if (player->unk_1C8 == 7) { var_fs0 = 0.0f; sp50 = 0.0f; } RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); - if (arg0->wings.leftState == 2) { + if (player->wings.leftState == 2) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp5C, sp58, -100.0f, 1); Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, 1); Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), 1); - Matrix_Scale(gGfxMatrix, arg0->unk_25C, 1.0f, 50.0f, 1); + Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, 1); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, 1); Matrix_RotateX(gGfxMatrix, M_PI / 2.0f, 1); Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, 1); @@ -1118,12 +1121,12 @@ void func_80055E98(Player* arg0) { gSPDisplayList(gMasterDisp++, D_102A8A0); Matrix_Pop(&gGfxMatrix); } - if (arg0->wings.rightState == 2) { + if (player->wings.rightState == 2) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, -sp5C, sp58, -100.0f, 1); Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, 1); Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), 1); - Matrix_Scale(gGfxMatrix, arg0->unk_25C, 1.0f, 50.0f, 1); + Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, 1); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, 1); Matrix_RotateX(gGfxMatrix, M_PI / 2.0f, 1); Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, 1); @@ -1134,22 +1137,22 @@ void func_80055E98(Player* arg0) { } } -void func_80056230(Player* arg0) { - if ((arg0->unk_234 != 0) && (arg0->unk_1CC == 0) && (gCurrentLevel != LEVEL_VENOM_2) && +void func_80056230(Player* player) { + if ((player->unk_234 != 0) && (player->unk_1CC == 0) && (gCurrentLevel != LEVEL_VENOM_2) && (gCurrentLevel != LEVEL_TRAINING) && (gLevelType == 0)) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, arg0->unk_074, arg0->unk_078, arg0->unk_138 + arg0->unk_144, 1); - Matrix_RotateY(gGfxMatrix, (arg0->unk_114 + arg0->unk_0E8 + 180.0f) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -((arg0->unk_120 + arg0->unk_0E4 + arg0->unk_4D8) * M_DTOR), 1); - Matrix_RotateZ(gGfxMatrix, -((arg0->unk_0F8 + arg0->unk_0F0 + arg0->unk_134) * M_DTOR), 1); - Matrix_Translate(gGfxMatrix, arg0->unk_084, arg0->unk_080, 0.0f, 1); + Matrix_Translate(gGfxMatrix, player->unk_074, player->unk_078, player->unk_138 + player->unk_144, 1); + Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); + Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); - func_80055E98(arg0); + func_80055E98(player); Matrix_Pop(&gGfxMatrix); } } -bool func_800563B4(s32 arg0, s32 arg1) { +bool func_800563B4(s32 index, s32 arg1) { Vec3f sp2C = { 0.0f, 0.0f, 0.0f }; Vec3f sp20; @@ -1158,111 +1161,113 @@ bool func_800563B4(s32 arg0, s32 arg1) { if (fabsf(sp20.x) < (fabsf(sp20.z * 0.5f) + 500.0f)) { if (fabsf(sp20.y) < (fabsf(sp20.z * 0.5f) + 500.0f)) { if (arg1 == 0) { - D_800CA224[arg0] = 1; + D_800CA224[index] = 1; } return true; } } } if (arg1 == 0) { - D_800CA224[arg0] = 0; + D_800CA224[index] = 0; } return false; } s32 D_800CA2E8[16] = { 60, 40, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0 }; -void func_800564C0(Player* arg0, s32 arg1) { +void func_800564C0(Player* player, s32 arg1) { s32 i; Vec3f sp50 = { 0.0f, 0.0f, 0.0f }; - if (arg0->unk_234 != 0) { + if (player->unk_234 != 0) { Matrix_Push(&gGfxMatrix); - if (arg0->unk_1CC == 1) { - if (arg0->unk_1D4 != 0) { + if (player->unk_1CC == 1) { + if (player->unk_1D4 != 0) { Matrix_Translate(gGfxMatrix, 0.0f, D_8017847C, 0.0f, 1); } - Matrix_Translate(gGfxMatrix, arg0->unk_074, arg0->unk_078 + arg0->unk_18C + 30.0f, - arg0->unk_138 + arg0->unk_144, 1); + Matrix_Translate(gGfxMatrix, player->unk_074, player->unk_078 + player->unk_18C + 30.0f, + player->unk_138 + player->unk_144, 1); if (D_801778E8 != 0) { for (i = 0; i < gCamCount; i++) { - if (D_80177B00[arg0->unk_1C4][i] != 0) { + if (D_80177B00[player->unk_1C4][i] != 0) { Matrix_MultVec3f(gGfxMatrix, &sp50, &D_80161578[i]); if ((i == D_801778A0) && ((D_80161578[i].z > 300.0f) || (D_80161578[i].z < -8000.0f) || (fabsf(D_80161578[i].x) > (fabsf(D_80161578[i].z * 0.5f) + 100.0f)) || (fabsf(D_80161578[i].y)) > (fabsf(D_80161578[i].z * 0.5f) + 100.0f))) { - D_80177B00[arg0->unk_1C4][i] = 0; + D_80177B00[player->unk_1C4][i] = 0; } } } } - if (func_800563B4(arg0->unk_1C4, arg1) == 0) { + if (func_800563B4(player->unk_1C4, arg1) == 0) { Matrix_Pop(&gGfxMatrix); return; } - Matrix_RotateX(gGfxMatrix, (arg0->unk_0E4 + arg0->unk_134) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (arg0->unk_0EC + arg0->unk_0F0 + arg0->unk_134) * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, (arg0->unk_114 + arg0->unk_0E8 + 180.0f) * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_134) * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); if (D_801778E8 != 0) { - Matrix_RotateX(gGfxMatrix, arg0->unk_000 * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, player->unk_000 * M_DTOR, 1); } - Matrix_RotateZ(gGfxMatrix, (-arg0->unk_12C - arg0->unk_130) * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, arg0->unk_084, arg0->unk_080 - 30.0f, 0.0f, 1); + Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080 - 30.0f, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); - } else if (arg0->unk_1CC == 3) { + } else if (player->unk_1CC == 3) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, arg0->unk_074, arg0->unk_078, arg0->unk_138 + arg0->unk_144, 1); - if (func_800563B4(arg0->unk_1C4, arg1) == 0) { + Matrix_Translate(gGfxMatrix, player->unk_074, player->unk_078, player->unk_138 + player->unk_144, 1); + if (func_800563B4(player->unk_1C4, arg1) == 0) { Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix); return; } Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gCalcMatrix, arg0->unk_074, arg0->unk_078 + D_8017847C, arg0->unk_138 + arg0->unk_144, 0); - Matrix_RotateY(gCalcMatrix, (arg0->unk_114 + arg0->unk_0E8 + arg0->unk_134 + 180.0f) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -((arg0->unk_120 + arg0->unk_0E4 + arg0->unk_134) * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((arg0->unk_0F8 + arg0->unk_0F0 + arg0->unk_134) * M_DTOR), 1); - Matrix_Translate(gCalcMatrix, arg0->unk_084, arg0->unk_080, 0.0f, 1); + Matrix_Translate(gCalcMatrix, player->unk_074, player->unk_078 + D_8017847C, + player->unk_138 + player->unk_144, 0); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134) * M_DTOR), 1); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); } else { - Matrix_Translate(gGfxMatrix, arg0->unk_074, arg0->unk_078, arg0->unk_138 + arg0->unk_144, 1); + Matrix_Translate(gGfxMatrix, player->unk_074, player->unk_078, player->unk_138 + player->unk_144, 1); if (D_801778E8 != 0) { for (i = 0; i < gCamCount; i++) { - if (D_80177B00[arg0->unk_1C4][i] != 0) { + if (D_80177B00[player->unk_1C4][i] != 0) { Matrix_MultVec3f(gGfxMatrix, &sp50, &D_80161578[i]); if ((i == D_801778A0) && ((D_80161578[i].z > 300.0f) || (D_80161578[i].z < -8000.0f) || (fabsf(D_80161578[i].x) > (fabsf(D_80161578[i].z * 0.5f) + 100.0f)) || (fabsf(D_80161578[i].y) > (fabsf(D_80161578[i].z * 0.5f) + 100.0f)))) { - D_80177B00[arg0->unk_1C4][i] = 0; + D_80177B00[player->unk_1C4][i] = 0; } } } } - if (func_800563B4(arg0->unk_1C4, arg1) == 0) { + if (func_800563B4(player->unk_1C4, arg1) == 0) { Matrix_Pop(&gGfxMatrix); return; } - Matrix_RotateY(gGfxMatrix, (arg0->unk_114 + arg0->unk_0E8 + arg0->unk_134 + 180.0f) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -((arg0->unk_120 + arg0->unk_0E4 + arg0->unk_4D8 + arg0->unk_134) * M_DTOR), 1); - Matrix_RotateZ(gGfxMatrix, -((arg0->unk_0F8 + arg0->unk_0F0 + arg0->unk_134) * M_DTOR), 1); - Matrix_Translate(gGfxMatrix, arg0->unk_084, arg0->unk_080, 0.0f, 1); + Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, + -((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), 1); + Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); + Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); } - switch (arg0->unk_200) { + switch (player->unk_200) { case 0: if (D_801778E8 == 0) { if ((gCurrentLevel == LEVEL_FORTUNA) || (gCurrentLevel == LEVEL_TITANIA)) { - RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, 0x3ED); + RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, 1005); } else { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } } else if (D_8017789C == 2) { - RCP_SetupDL_29(0x80, 0x80, 0xFF, 0xFF, gFogNear, gFogFar); + RCP_SetupDL_29(128, 128, 255, 255, gFogNear, gFogFar); } else { - RCP_SetupDL_29(0, 0, 0, 0xFF, gFogNear, gFogFar); + RCP_SetupDL_29(0, 0, 0, 255, gFogNear, gFogFar); } break; case 1: @@ -1276,9 +1281,9 @@ void func_800564C0(Player* arg0, s32 arg1) { if (arg1 != 0) { func_800596C0(); } else { - Matrix_Copy(&D_80161418[arg0->unk_1C4], gGfxMatrix); + Matrix_Copy(&D_80161418[player->unk_1C4], gGfxMatrix); } - func_80054280(arg0, arg1); + func_80054280(player, arg1); Matrix_Pop(&gGfxMatrix); } } @@ -1300,48 +1305,49 @@ f32 D_800CA38C[] = { -50.0f, }; -void func_80056E2C(Player* arg0) { +void func_80056E2C(Player* player) { f32 sp34; f32 sp30; f32 sp2C; - if ((arg0->unk_234 != 0) && (arg0->unk_240 == 0)) { + if ((player->unk_234 != 0) && (player->unk_240 == 0)) { sp34 = D_800CA334[gFrameCount & 7]; sp30 = D_800CA334[(gFrameCount + 4) & 7]; - if (arg0->unk_1D4 != 0) { + if (player->unk_1D4 != 0) { sp34 = sp30 = 0.0f; } Matrix_Push(&gGfxMatrix); if (D_80177880 == 1) { - if (arg0->unk_1CC == 3) { - Matrix_Translate(gGfxMatrix, arg0->unk_064, arg0->unk_068 + 2.0f, arg0->unk_06C, 1); + if (player->unk_1CC == 3) { + Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, 1); } else { - Matrix_Translate(gGfxMatrix, arg0->unk_064, arg0->unk_068 + 2.0f, arg0->unk_06C, 1); + Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, 1); } } else { - Matrix_Translate(gGfxMatrix, arg0->unk_064, arg0->unk_068 + 2.0f, arg0->unk_06C + arg0->unk_144, 1); + Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C + player->unk_144, 1); } - Matrix_RotateY(gGfxMatrix, arg0->unk_070, 1); - Matrix_RotateX(gGfxMatrix, arg0->unk_248, 1); - Matrix_RotateZ(gGfxMatrix, arg0->unk_24C, 1); + Matrix_RotateY(gGfxMatrix, player->unk_070, 1); + Matrix_RotateX(gGfxMatrix, player->unk_248, 1); + Matrix_RotateZ(gGfxMatrix, player->unk_24C, 1); Matrix_Scale(gGfxMatrix, 0.8f + sp34, 0.0f, 0.8f + sp30, 1); - if ((arg0->unk_1CC == 0) || (arg0->unk_1CC == 2) || (arg0->unk_1CC == 3)) { - sp2C = arg0->unk_0F8 + arg0->unk_0F0 + arg0->unk_134; + if ((player->unk_1CC == 0) || (player->unk_1CC == 2) || (player->unk_1CC == 3)) { + sp2C = player->unk_0F8 + player->unk_0F0 + player->unk_134; if (((sp2C > 70.0f) && (sp2C < 110.0f)) || ((sp2C < -70.0f) && (sp2C > -110.0f))) { sp2C = 70.0f; } - Matrix_RotateY(gGfxMatrix, -arg0->unk_070, 1); - Matrix_RotateY(gGfxMatrix, (arg0->unk_114 + arg0->unk_0E8 + arg0->unk_134) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -((arg0->unk_120 + arg0->unk_0E4 + arg0->unk_4D8 + arg0->unk_134) * M_DTOR), 1); + Matrix_RotateY(gGfxMatrix, -player->unk_070, 1); + Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134) * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, + -((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), 1); Matrix_RotateZ(gGfxMatrix, M_DTOR * sp2C, 1); } else { - Matrix_RotateY(gGfxMatrix, arg0->unk_114 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, (arg0->unk_0E4 + arg0->unk_4D8 + arg0->unk_134) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (arg0->unk_0EC + arg0->unk_0F0 + arg0->unk_134) * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, arg0->unk_0E8 * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (-arg0->unk_12C - arg0->unk_130) * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, player->unk_114 * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, 1); } - func_80054300(arg0); + func_80054300(player); Matrix_Pop(&gGfxMatrix); } } @@ -1424,28 +1430,28 @@ void func_80057504(void) { } } -void func_80057814(Player* arg0) { +void func_80057814(Player* player) { Vec3f sp2C; Vec3f sp20; - sp20.x = arg0->unk_074; - sp20.y = arg0->unk_078; - sp20.z = arg0->unk_138; - sp2C.x = arg0->unk_460.x; - sp2C.y = arg0->unk_460.y; - sp2C.z = arg0->unk_460.z; - func_8005F0E8(&arg0->unk_460, &sp20); - arg0->unk_46C.x = arg0->unk_460.x - sp2C.x; - arg0->unk_46C.y = arg0->unk_460.y - sp2C.y; - arg0->unk_46C.z = arg0->unk_460.z - sp2C.z; - arg0->unk_480 = &arg0->unk_46C; - arg0->unk_47C = &arg0->unk_460; - arg0->unk_488 = arg0->unk_0C0.y; - arg0->unk_490 = arg0->unk_0F8; + sp20.x = player->unk_074; + sp20.y = player->unk_078; + sp20.z = player->unk_138; + sp2C.x = player->unk_460.x; + sp2C.y = player->unk_460.y; + sp2C.z = player->unk_460.z; + func_8005F0E8(&player->unk_460, &sp20); + player->unk_46C.x = player->unk_460.x - sp2C.x; + player->unk_46C.y = player->unk_460.y - sp2C.y; + player->unk_46C.z = player->unk_460.z - sp2C.z; + player->unk_480 = &player->unk_46C; + player->unk_47C = &player->unk_460; + player->unk_488 = player->unk_0C0.y; + player->unk_490 = player->unk_0F8; } // Vec3f D_800CA39C = {0.0f, 0.0f, -300.0f}; -void func_800578C4(Player* arg0) { +void func_800578C4(Player* player) { Vec3f sp4C = { 0.0f, 0.0f, -300.0f }; Vec3f sp40; f32 sp3C; @@ -1453,26 +1459,26 @@ void func_800578C4(Player* arg0) { switch (D_800CA220) { case 0: - Math_SmoothStepToAngle(&arg0->wings.unk_30, 0.0f, 0.2f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&arg0->wings.unk_34, 0.0f, 0.2f, 3.0f, 0.0f); - D_801779D8.x = arg0->unk_040.x; - D_801779D8.y = arg0->unk_040.y; - D_801779D8.z = arg0->unk_040.z; - D_801779E8.x = arg0->unk_04C.x; - D_801779E8.y = arg0->unk_04C.y; - D_801779E8.z = arg0->unk_04C.z; + Math_SmoothStepToAngle(&player->wings.unk_30, 0.0f, 0.2f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&player->wings.unk_34, 0.0f, 0.2f, 3.0f, 0.0f); + D_801779D8.x = player->unk_040.x; + D_801779D8.y = player->unk_040.y; + D_801779D8.z = player->unk_040.z; + D_801779E8.x = player->unk_04C.x; + D_801779E8.y = player->unk_04C.y; + D_801779E8.z = player->unk_04C.z; break; case 1: case 2: case 3: - sp38 = Math_RadToDeg(arg0->unk_05C) + arg0->unk_0E4; + sp38 = Math_RadToDeg(player->unk_05C) + player->unk_0E4; if (sp38 > 360.0f) { sp38 -= 360.0f; } if (sp38 < 0.0f) { sp38 += 360.0f; } - sp3C = (Math_RadToDeg(arg0->unk_058) + 180.0f) - arg0->unk_0E8; + sp3C = (Math_RadToDeg(player->unk_058) + 180.0f) - player->unk_0E8; if (sp3C > 360.0f) { sp3C -= 360.0f; } @@ -1480,21 +1486,21 @@ void func_800578C4(Player* arg0) { sp3C += 360.0f; } sp3C = 360.0f - sp3C; - Math_SmoothStepToAngle(&arg0->wings.unk_30, sp38, 0.2f, 6.0f, 0.0f); - Math_SmoothStepToAngle(&arg0->wings.unk_34, sp3C, 0.2f, 6.0f, 0.0f); + Math_SmoothStepToAngle(&player->wings.unk_30, sp38, 0.2f, 6.0f, 0.0f); + Math_SmoothStepToAngle(&player->wings.unk_34, sp3C, 0.2f, 6.0f, 0.0f); Math_SmoothStepToF(&D_800CA380, gChangedInput->stick_y * 0.75f, 0.1f, 2.0f, 0.0f); Math_SmoothStepToF(&D_800CA384, gChangedInput->stick_x * 3.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&D_800CA388, D_800CA38C[D_800CA220], 0.1f, 10.0f, 0.0f); sp4C.z = D_800CA388; - Matrix_RotateX(gCalcMatrix, (arg0->unk_0E8 + D_800CA380) * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, (arg0->unk_0E4 + D_800CA384) * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, (player->unk_0E8 + D_800CA380) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (player->unk_0E4 + D_800CA384) * M_DTOR, 1); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); - D_801779D8.x = arg0->unk_074 + sp40.x; - D_801779D8.y = arg0->unk_078 + sp40.y + 20.0f; - D_801779D8.z = arg0->unk_138 + sp40.z; - D_801779E8.x = (__sinf(gFrameCount * 3.0f * M_DTOR) * 3.0f) + arg0->unk_074; - D_801779E8.y = (__cosf(gFrameCount * 4.0f * M_DTOR) * 3.0f) + arg0->unk_078; - D_801779E8.z = (__sinf(gFrameCount * 3.5f * M_DTOR) * 3.0f) + arg0->unk_138; + D_801779D8.x = player->unk_074 + sp40.x; + D_801779D8.y = player->unk_078 + sp40.y + 20.0f; + D_801779D8.z = player->unk_138 + sp40.z; + D_801779E8.x = (__sinf(gFrameCount * 3.0f * M_DTOR) * 3.0f) + player->unk_074; + D_801779E8.y = (__cosf(gFrameCount * 4.0f * M_DTOR) * 3.0f) + player->unk_078; + D_801779E8.z = (__sinf(gFrameCount * 3.5f * M_DTOR) * 3.0f) + player->unk_138; break; } } @@ -1505,8 +1511,8 @@ void func_80057D00(void) { Vec3f sp6C; Vec3f sp60; s32 pad; - Player* var_s0; - Player* sp54 = &gPlayer[D_801778A0]; + Player* opponent; + Player* player = &gPlayer[D_801778A0]; D_800CA228 = 0; @@ -1524,45 +1530,45 @@ void func_80057D00(void) { Matrix_RotateZ(gGfxMatrix, -(f32) gFrameCount * 10.0f * M_DTOR, 1); Matrix_Scale(gGfxMatrix, 1.0f + D_800CA230, 1.0f - D_800CA230, 1.0f, 1); Matrix_Push(&gGfxMatrix); - func_800B73E0(sp54); + func_800B73E0(player); Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); if (D_80177880 == 0) { - Matrix_RotateY(gCalcMatrix, sp54->unk_114 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, sp54->unk_120 * M_DTOR, 1); - sp78.x = sp54->unk_040.x - sp54->unk_074; - sp78.y = sp54->unk_040.y - sp54->unk_078; - sp78.z = sp54->unk_040.z - (sp54->unk_138 + sp54->unk_144); + Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, 1); + sp78.x = player->unk_040.x - player->unk_074; + sp78.y = player->unk_040.y - player->unk_078; + sp78.z = player->unk_040.z - (player->unk_138 + player->unk_144); Matrix_MultVec3f(gCalcMatrix, &sp78, &D_801779D8); - D_801779D8.x += sp54->unk_074; - D_801779D8.y += sp54->unk_078; - D_801779D8.z += sp54->unk_138 + sp54->unk_144; - sp78.x = sp54->unk_04C.x - sp54->unk_074; - sp78.y = sp54->unk_04C.y - sp54->unk_078; - sp78.z = sp54->unk_04C.z - (sp54->unk_138 + sp54->unk_144); + D_801779D8.x += player->unk_074; + D_801779D8.y += player->unk_078; + D_801779D8.z += player->unk_138 + player->unk_144; + sp78.x = player->unk_04C.x - player->unk_074; + sp78.y = player->unk_04C.y - player->unk_078; + sp78.z = player->unk_04C.z - (player->unk_138 + player->unk_144); Matrix_MultVec3f(gCalcMatrix, &sp78, &D_801779E8); - D_801779E8.x += sp54->unk_074; - D_801779E8.y += sp54->unk_078; - D_801779E8.z += sp54->unk_138 + sp54->unk_144; - if ((sp54->unk_238 != 0) && (sp54->unk_110 > 5.0f)) { - D_801779E8.x += __sinf((f32) gFrameCount * 150.0f * M_DTOR) * sp54->unk_110 * 0.2f; + D_801779E8.x += player->unk_074; + D_801779E8.y += player->unk_078; + D_801779E8.z += player->unk_138 + player->unk_144; + if ((player->unk_238 != 0) && (player->unk_110 > 5.0f)) { + D_801779E8.x += __sinf((f32) gFrameCount * 150.0f * M_DTOR) * player->unk_110 * 0.2f; } - } else if (sp54->unk_1C8 == 7) { - func_800578C4(sp54); + } else if (player->unk_1C8 == 7) { + func_800578C4(player); } else { - D_801779D8.x = sp54->unk_040.x; - D_801779D8.y = sp54->unk_040.y; - D_801779D8.z = sp54->unk_040.z; - D_801779E8.x = sp54->unk_04C.x; - D_801779E8.y = sp54->unk_04C.y; - D_801779E8.z = sp54->unk_04C.z; + D_801779D8.x = player->unk_040.x; + D_801779D8.y = player->unk_040.y; + D_801779D8.z = player->unk_040.z; + D_801779E8.x = player->unk_04C.x; + D_801779E8.y = player->unk_04C.y; + D_801779E8.z = player->unk_04C.z; } - sp54->unk_058 = -Math_Atan2F(D_801779D8.x - D_801779E8.x, D_801779D8.z - D_801779E8.z); - sp54->unk_05C = -Math_Atan2F(D_801779D8.y - D_801779E8.y, - sqrtf(SQ(D_801779D8.z - D_801779E8.z) + SQ(D_801779D8.x - D_801779E8.x))); - Matrix_RotateY(gCalcMatrix, -sp54->unk_058, 0); - Matrix_RotateX(gCalcMatrix, sp54->unk_05C, 1); - Matrix_RotateZ(gCalcMatrix, -sp54->unk_034 * M_DTOR, 1); + player->unk_058 = -Math_Atan2F(D_801779D8.x - D_801779E8.x, D_801779D8.z - D_801779E8.z); + player->unk_05C = -Math_Atan2F(D_801779D8.y - D_801779E8.y, + sqrtf(SQ(D_801779D8.z - D_801779E8.z) + SQ(D_801779D8.x - D_801779E8.x))); + Matrix_RotateY(gCalcMatrix, -player->unk_058, 0); + Matrix_RotateX(gCalcMatrix, player->unk_05C, 1); + Matrix_RotateZ(gCalcMatrix, -player->unk_034 * M_DTOR, 1); sp78.x = 0.0f; sp78.y = 100.0f; sp78.z = 0.0f; @@ -1592,24 +1598,24 @@ void func_80057D00(void) { } Lights_SetOneLight(&gMasterDisp, gLight2x, gLight2y, gLight2z, gLight2R, gLight2G, gLight2B, gAmbientR, gAmbientG, gAmbientB); - for (i = 0, var_s0 = gPlayer; i < gCamCount; i++, var_s0++) { - sp60.x = var_s0->unk_074; - sp60.y = var_s0->unk_078; - sp60.z = var_s0->unk_138; + for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { + sp60.x = opponent->unk_074; + sp60.y = opponent->unk_078; + sp60.z = opponent->unk_138; func_8005F670(&sp60); - func_800564C0(var_s0, 0); - func_80057814(var_s0); + func_800564C0(opponent, 0); + func_80057814(opponent); } if ((D_80161A88 == 2) && (gPlayer[0].unk_1C8 != 2)) { Lights_SetOneLight(&gMasterDisp, gLight2x, -1 * gLight2y, gLight2z, gLight2R, gLight2G, gLight2B, gAmbientR, gAmbientG, gAmbientB); Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); - for (i = 0, var_s0 = gPlayer; i < gCamCount; i++, var_s0++) { - sp60.x = var_s0->unk_074; - sp60.y = var_s0->unk_078; - sp60.z = var_s0->unk_138; - func_800564C0(var_s0, 1); + for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { + sp60.x = opponent->unk_074; + sp60.y = opponent->unk_078; + sp60.z = opponent->unk_138; + func_800564C0(opponent, 1); } Matrix_Pop(&gGfxMatrix); } @@ -1630,10 +1636,10 @@ void func_80057D00(void) { if ((D_80161A88 == 2) && (gPlayer[0].unk_1C8 != 2)) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); - for (i = 0, var_s0 = gPlayer; i < gCamCount; i++, var_s0++) { + for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { if (D_800CA224[i] != 0) { - func_80055B58(var_s0); - func_80056230(var_s0); + func_80055B58(opponent); + func_80056230(opponent); } Matrix_Pop(&gGfxMatrix); } @@ -1651,11 +1657,11 @@ void func_80057D00(void) { func_8006089C(0); } D_80161410 = 1; - for (i = 0, var_s0 = gPlayer; i < gCamCount; i++, var_s0++) { + for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { if (D_800CA224[i] != 0) { - func_80056E2C(var_s0); - func_80055B58(var_s0); - func_80056230(var_s0); + func_80056E2C(opponent); + func_80055B58(opponent); + func_80056230(opponent); } } if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].unk_1C8 == 3)) { @@ -1672,15 +1678,15 @@ void func_80057D00(void) { if (D_800CA228 != 0) { func_80053B18(); } - for (i = 0, var_s0 = gPlayer; i < gCamCount; i++, var_s0++) { + for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { if (D_800CA224[i] != 0) { if (D_800D2860[i] != 0) { - func_80053F7C(var_s0); + func_80053F7C(opponent); } - if (var_s0->unk_1CC == 1) { - func_80052B80(var_s0); - } else if (var_s0->unk_1CC == 3) { - func_80052584(var_s0); + if (opponent->unk_1CC == 1) { + func_80052B80(opponent); + } else if (opponent->unk_1CC == 3) { + func_80052584(opponent); } } } @@ -1688,7 +1694,7 @@ void func_80057D00(void) { func_E9F1D0_801A6164(gPlayer); } func_80040954(); - if ((gCamCount != 1) && ((sp54->unk_1C8 == 3) || (sp54->unk_1C8 == 5))) { + if ((gCamCount != 1) && ((player->unk_1C8 == 3) || (player->unk_1C8 == 5))) { func_8008FA84(); func_8008CA44(); } diff --git a/src/main/fox_edata.c b/src/main/fox_edata.c index f95e1895..44ef2d64 100644 --- a/src/main/fox_edata.c +++ b/src/main/fox_edata.c @@ -4,7 +4,7 @@ f32* D_800CF964[] = { NULL }; -void func_800594F0(Object_80* arg0) { +void func_800594F0(Object_80* obj80) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); Matrix_RotateY(gGfxMatrix, M_PI, 1); Matrix_SetGfxMtx(&gMasterDisp); @@ -12,7 +12,7 @@ void func_800594F0(Object_80* arg0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_800595D0(Object_80* arg0) { +void func_800595D0(Object_80* obj80) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); Matrix_RotateY(gGfxMatrix, M_PI, 1); Matrix_SetGfxMtx(&gMasterDisp); @@ -20,5 +20,5 @@ void func_800595D0(Object_80* arg0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_800596B0(Object_2F4* arg0) { +void func_800596B0(Object_2F4* obj2F4) { } diff --git a/src/main/fox_edata_1C.c b/src/main/fox_edata_1C.c index c3e2355e..7bbcb9bf 100644 --- a/src/main/fox_edata_1C.c +++ b/src/main/fox_edata_1C.c @@ -659,10 +659,10 @@ ObjectStruct_1C D_800CC124[0x190] = { /* OBJECT_408_320 */ {(void*) func_801928C8, 2, (ObjectFunc) func_8018DBF0, D_C038DC0, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJECT_408_321 */ {(void*) func_8018B8C0, 1, (ObjectFunc) func_80189B70, D_C038F24, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJECT_6C_LASERS */ {(void*) func_8005CC9C, 1, (ObjectFunc) func_80067F6C, D_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJECT_6C_323 */ {(void*) func_8005C5F0, 1, (ObjectFunc) func_80068914, D_800CBF38, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJECT_6C_CHECKPOINT */ {(void*) func_8005C5F0, 1, (ObjectFunc) func_80068914, D_800CBF38, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_6C_SILVER_RING */ {(void*) func_8005C900, 1, (ObjectFunc) func_80068020, D_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJECT_6C_325 */ {(void*) func_8005C9C0, 1, (ObjectFunc) func_800685D8, D_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJECT_6C_326 */ {(void*) func_8005CDA8, 1, (ObjectFunc) func_80068688, D_800CBF70, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJECT_6C_STAR_RING */ {(void*) func_8005C9C0, 1, (ObjectFunc) func_800685D8, D_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJECT_6C_METEO_WARP */ {(void*) func_8005CDA8, 1, (ObjectFunc) func_80068688, D_800CBF70, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_6C_BOMB */ {(void*) func_8005CB44, 1, (ObjectFunc) func_80067BEC, D_800CBFC8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_6C_328 */ {(void*) NULL, 1, (ObjectFunc) func_80068C88, D_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_6C_329 */ {(void*) NULL, 1, (ObjectFunc) func_80068C88, D_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, @@ -670,11 +670,11 @@ ObjectStruct_1C D_800CC124[0x190] = { /* OBJECT_6C_331 */ {(void*) NULL, 1, (ObjectFunc) func_80068C88, D_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_6C_332 */ {(void*) NULL, 1, (ObjectFunc) func_80068C88, D_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_6C_333 */ {(void*) NULL, 1, (ObjectFunc) func_80068C88, D_800CBF8C, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJECT_6C_334 */ {(void*) NULL, 1, (ObjectFunc) func_80068C48, D_800CBF18, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJECT_6C_CORN_ARCH */ {(void*) NULL, 1, (ObjectFunc) func_80068C48, D_800CBF18, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_6C_1UP */ {(void*) D_1022120, 0, (ObjectFunc) func_80067B1C, D_800CBE8C, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_6C_GOLD_RING */ {(void*) func_8005CA80, 1, (ObjectFunc) func_800685F8, D_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_6C_WING_REPAIR */ {(void*) D_3007650, 0, (ObjectFunc) func_80068618, D_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJECT_6C_338 */ {(void*) D_6006140, 0, (ObjectFunc) func_80198968, D_6009CFC, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJECT_6C_TRAINING_RING */ {(void*) D_6006140, 0, (ObjectFunc) func_80198968, D_6009CFC, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJECT_8C_339 */ {(void*) func_8007D55C, 1, (ObjectFunc) func_8007D2F4, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, /* OBJECT_8C_340 */ {(void*) func_8007D55C, 1, (ObjectFunc) func_8007D748, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, /* OBJECT_8C_341 */ {(void*) func_8007D55C, 1, (ObjectFunc) func_8007D8A8, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, diff --git a/src/main/fox_edisplay.c b/src/main/fox_edisplay.c index a4c7358b..61e6c859 100644 --- a/src/main/fox_edisplay.c +++ b/src/main/fox_edisplay.c @@ -23,12 +23,12 @@ void func_800597C0(s32 arg0) { } } -void func_8005980C(f32 arg0) { - Matrix_Scale(gGfxMatrix, arg0, arg0, arg0, 1); +void func_8005980C(f32 scale) { + Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); Matrix_SetGfxMtx(&gMasterDisp); } -void func_80059850(Object_4C* arg0) { +void func_80059850(Object_4C* obj4C) { RCP_SetupDL(&gMasterDisp, 0x40); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 60); RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -37,22 +37,22 @@ void func_80059850(Object_4C* arg0) { void func_800598DC(s32 arg0) { } -void func_800598E8(Object_2F4* arg0) { +void func_800598E8(Object_2F4* obj2F4) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_6025B50); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_800599A4(s32 arg0, Vec3f* arg1, void* arg2) { +void func_800599A4(s32 limbIndex, Vec3f* rot, void* index) { Vec3f sp24; Vec3f sp18; - if (arg0 == 1) { + if (limbIndex == 1) { sp24.x = 0.0f; sp24.y = 0.0f; sp24.z = 0.0f; Matrix_MultVec3f(gCalcMatrix, &sp24, &sp18); - gObjects2F4[*((s32*) arg2)].unk_114 = sp18.y; + gObjects2F4[*((s32*) index)].unk_114 = sp18.y; } } @@ -66,25 +66,25 @@ f32 D_800CFA2C[] = { 1.0f, 1.0f, 0.95f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, 0.6f, }; -void func_80059A24(Object_2F4* arg0) { +void func_80059A24(Object_2F4* obj2F4) { Vec3f sp30[30]; - f32 temp = D_800CF9B0[arg0->unk_0B6] - 114.0f; + f32 temp = D_800CF9B0[obj2F4->unk_0B6] - 114.0f; Matrix_Translate(gGfxMatrix, 0.f, -temp, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); - Animation_GetFrameData(&D_601E8C4, arg0->unk_0B6, sp30); - Animation_DrawSkeleton(1, D_601E9D0, sp30, NULL, func_800599A4, &arg0->unk_040, &gIdentityMatrix); + Animation_GetFrameData(&D_601E8C4, obj2F4->unk_0B6, sp30); + Animation_DrawSkeleton(1, D_601E9D0, sp30, NULL, func_800599A4, &obj2F4->unk_040, &gIdentityMatrix); } -void func_80059AEC(Object_80* arg0) { +void func_80059AEC(Object_80* obj80) { gSPDisplayList(gMasterDisp++, D_601AE40); } -void func_80059B20(Object_80* arg0) { - if (arg0->obj.id == OBJECT_29) { +void func_80059B20(Object_80* obj80) { + if (obj80->obj.id == OBJECT_29) { gSPDisplayList(gMasterDisp++, D_7007350); } else { - func_8005980C(D_800CF9B0[arg0->obj.id + 2]); + func_8005980C(D_800CF9B0[obj80->obj.id + 2]); gSPDisplayList(gMasterDisp++, D_700BB10); } } @@ -92,12 +92,12 @@ void func_80059B20(Object_80* arg0) { void func_80059BB0(void* arg0) { } -void func_80059BBC(Object_80* arg0) { +void func_80059BBC(Object_80* obj80) { gSPDisplayList(gMasterDisp++, D_6023AC0); } -void func_80059BF0(Object_2F4* arg0) { - if (arg0->unk_0B6 != 0) { +void func_80059BF0(Object_2F4* obj2F4) { + if (obj2F4->unk_0B6 != 0) { gSPDisplayList(gMasterDisp++, D_6032BC0); } } @@ -105,13 +105,13 @@ void func_80059BF0(Object_2F4* arg0) { void func_80059C28(void* arg0) { } -void func_80059C34(Object_4C* arg0) { +void func_80059C34(Object_4C* obj4C) { } -void func_80059C40(Object_4C* arg0) { +void func_80059C40(Object_4C* obj4C) { RCP_SetupDL_47(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 180); - switch (arg0->unk_45) { + switch (obj4C->unk_45) { case 0: Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.7f, 1); Matrix_SetGfxMtx(&gMasterDisp); @@ -147,18 +147,18 @@ void func_80059C40(Object_4C* arg0) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_80059F68(Object_6C* arg0) { +void func_80059F68(Object_6C* obj6C) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -95.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_602DA20); } -void func_80059FDC(Object_6C* arg0) { +void func_80059FDC(Object_6C* obj6C) { gSPDisplayList(gMasterDisp++, D_6035DA0); } -void func_8005A010(Object_4C* arg0) { - if (arg0->unk_48 == 0) { +void func_8005A010(Object_4C* obj4C) { + if (obj4C->unk_48 == 0) { Matrix_RotateY(gGfxMatrix, M_PI / 2.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_60361F0); @@ -232,8 +232,8 @@ Gfx* D_800CFC7C[] = { 0x0601B570, 0x0601B710, 0x060209B0, 0x06020B70, 0x06020D50, 0x0601B8F0, 0x0601B3B0, 0x0601B1C0, 0x06011660, }; -void func_8005A094(Object_2F4* arg0) { - switch (arg0->unk_0B8) { +void func_8005A094(Object_2F4* obj2F4) { + switch (obj2F4->unk_0B8) { case 0: Matrix_Translate(gGfxMatrix, 18.0f, 15.0f, -15.0f, 1); Matrix_RotateY(gGfxMatrix, M_PI, 1); @@ -247,15 +247,15 @@ void func_8005A094(Object_2F4* arg0) { gSPDisplayList(gMasterDisp++, D_3015D80); break; case 2: - func_8005980C(arg0->unk_110); + func_8005980C(obj2F4->unk_110); gSPDisplayList(gMasterDisp++, D_30155E0); break; case 3: gSPDisplayList(gMasterDisp++, D_3011720); break; case 4: - func_8005980C(arg0->unk_110); - if (arg0->unk_040 & 1) { + func_8005980C(obj2F4->unk_110); + if (obj2F4->unk_040 & 1) { gSPDisplayList(gMasterDisp++, D_10194C0); } else { gSPDisplayList(gMasterDisp++, D_1024290); @@ -263,11 +263,11 @@ void func_8005A094(Object_2F4* arg0) { break; case 39: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - gSPDisplayList(gMasterDisp++, D_800CFAC4[arg0->unk_048]); + gSPDisplayList(gMasterDisp++, D_800CFAC4[obj2F4->unk_048]); break; case 40: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); - switch (arg0->unk_048) { + switch (obj2F4->unk_048) { case 0: break; case 1: @@ -283,7 +283,7 @@ void func_8005A094(Object_2F4* arg0) { break; } if (gCurrentLevel != LEVEL_SOLAR) { - gSPDisplayList(gMasterDisp++, D_E6A810_801B769C[arg0->unk_046]); + gSPDisplayList(gMasterDisp++, D_E6A810_801B769C[obj2F4->unk_046]); } else { if (gObjects408[0].unk_0E4 < 4800.0f) { RCP_SetupDL(&gMasterDisp, 0x1E); @@ -294,58 +294,58 @@ void func_8005A094(Object_2F4* arg0) { gDPSetFogColor(gMasterDisp++, 0x10, 0x10, 0x10, gFogAlpha); gSPFogPosition(gMasterDisp++, gFogNear, gFogFar); } - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFB40[arg0->unk_046]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFB40[obj2F4->unk_046]); } break; case 41: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFADC[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFADC[obj2F4->unk_048]); break; case 42: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFB08[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFB08[obj2F4->unk_048]); break; case 43: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFB14[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFB14[obj2F4->unk_048]); break; case 44: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFB28[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFB28[obj2F4->unk_048]); break; case 45: gSPDisplayList(gMasterDisp++, D_40018A0); break; case 46: - if ((arg0->unk_048 == 2) || (arg0->unk_048 == 3) || (arg0->unk_048 == 4)) { + if ((obj2F4->unk_048 == 2) || (obj2F4->unk_048 == 3) || (obj2F4->unk_048 == 4)) { RCP_SetupDL(&gMasterDisp, 0x21); } gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - gSPDisplayList(gMasterDisp++, D_E6A810_801B7584[arg0->unk_048]); + gSPDisplayList(gMasterDisp++, D_E6A810_801B7584[obj2F4->unk_048]); break; case 47: - gSPDisplayList(gMasterDisp++, D_E6A810_801B7608[arg0->unk_048]); + gSPDisplayList(gMasterDisp++, D_E6A810_801B7608[obj2F4->unk_048]); break; case 48: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFB64[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFB64[obj2F4->unk_048]); break; case 49: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFB88[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFB88[obj2F4->unk_048]); break; case 50: func_8005980C(0.7f); - if (arg0->unk_054 == 1) { + if (obj2F4->unk_054 == 1) { RCP_SetupDL(&gMasterDisp, 0x1E); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); - } else if (arg0->unk_054 == 2) { + } else if (obj2F4->unk_054 == 2) { RCP_SetupDL(&gMasterDisp, 0x1E); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); func_8005980C(0.7f); } - switch (arg0->unk_050) { + switch (obj2F4->unk_050) { case 0: gSPDisplayList(gMasterDisp++, D_90234D0); break; @@ -359,94 +359,94 @@ void func_8005A094(Object_2F4* arg0) { gSPDisplayList(gMasterDisp++, D_9010FD0); break; } - if (arg0->unk_054 != 0) { + if (obj2F4->unk_054 != 0) { RCP_SetupDL(&gMasterDisp, 0x1D); func_8005980C(0.7f); } break; case 51: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFBA8[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFBA8[obj2F4->unk_048]); break; case 52: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFBE4[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFBE4[obj2F4->unk_048]); break; case 53: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFC0C[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFC0C[obj2F4->unk_048]); break; case 54: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFC40[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFC40[obj2F4->unk_048]); break; case 55: - func_8005980C(arg0->unk_110); - gSPDisplayList(gMasterDisp++, D_800CFC50[arg0->unk_048]); + func_8005980C(obj2F4->unk_110); + gSPDisplayList(gMasterDisp++, D_800CFC50[obj2F4->unk_048]); break; case 56: - func_8005980C(arg0->unk_110); + func_8005980C(obj2F4->unk_110); RCP_SetupDL(&gMasterDisp, 0x29); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 191, 255, 223, 255); - gSPDisplayList(gMasterDisp++, D_800CFC64[arg0->unk_048]); + gSPDisplayList(gMasterDisp++, D_800CFC64[obj2F4->unk_048]); break; case 58: - func_8005980C(arg0->unk_110); + func_8005980C(obj2F4->unk_110); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_60148B0); break; case 59: - func_8005980C(arg0->unk_110); + func_8005980C(obj2F4->unk_110); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_800CFC7C[arg0->unk_048]); + gSPDisplayList(gMasterDisp++, D_800CFC7C[obj2F4->unk_048]); break; case 70: gSPDisplayList(gMasterDisp++, D_10177C0); break; case 57: - gSPDisplayList(gMasterDisp++, D_DF4260_8019A008[arg0->unk_048]); + gSPDisplayList(gMasterDisp++, D_DF4260_8019A008[obj2F4->unk_048]); break; default: - if (arg0->unk_0B8 > 9) { // part of switch tree somehow? - if (arg0->unk_0B8 == 0x24) { + if (obj2F4->unk_0B8 > 9) { // part of switch tree somehow? + if (obj2F4->unk_0B8 == 0x24) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); } - gSPDisplayList(gMasterDisp++, D_800CFA54[arg0->unk_0B8 - 10]); + gSPDisplayList(gMasterDisp++, D_800CFA54[obj2F4->unk_0B8 - 10]); } break; } } -void func_8005ADAC(Object_2F4* arg0) { +void func_8005ADAC(Object_2F4* obj2F4) { f32 sp5C; f32 temp1; f32 sp54; s32 pad[5]; // fake? seems like a lot of padding - if ((arg0->unk_07C != 0) && (arg0->obj.status == 2)) { + if ((obj2F4->unk_07C != 0) && (obj2F4->obj.status == 2)) { temp1 = 652.5f * 0.001f; // 0.65250003f; - if (arg0->unk_07C >= 2) { + if (obj2F4->unk_07C >= 2) { temp1 = 1.3050001f; } - Math_SmoothStepToF(&arg0->unk_188, temp1, 0.3f, 5.0f, 0.0f); - sp5C = arg0->unk_188; + Math_SmoothStepToF(&obj2F4->unk_188, temp1, 0.3f, 5.0f, 0.0f); + sp5C = obj2F4->unk_188; if (gFrameCount & 1) { sp5C *= 1.111f; } Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); Matrix_Scale(gGfxMatrix, sp5C, sp5C * 0.7f, sp5C, 1); - Matrix_RotateZ(gGfxMatrix, -arg0->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -arg0->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -arg0->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, -obj2F4->obj.rot.z * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, -obj2F4->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, -obj2F4->obj.rot.y * M_DTOR, 1); Matrix_RotateY(gGfxMatrix, -gPlayer[D_801778A0].unk_058, 1); Matrix_RotateX(gGfxMatrix, gPlayer[D_801778A0].unk_05C, 1); Matrix_SetGfxMtx(&gMasterDisp); func_8005465C(gLevelType); Matrix_Pop(&gGfxMatrix); } - sp5C = arg0->unk_168; + sp5C = obj2F4->unk_168; if ((sp5C != 0.0f) && (gLevelType == 0)) { sp54 = 0.0f; if (gFrameCount & 1) { @@ -479,30 +479,30 @@ f32 D_800CFCA0[] = { 1.7f, 1.8f, 2.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, }; -void func_8005B1E8(Object_2F4* arg0, s32 arg1) { - f32 var_fv0; +void func_8005B1E8(Object_2F4* obj2F4, s32 levelType) { + f32 scale; - if ((arg0->unk_07C != 0) && (arg0->obj.status == 2)) { - var_fv0 = 0.63f; - if (arg0->unk_07C >= 2) { - var_fv0 = D_800CFCA0[arg0->unk_07C - 2] * 0.45f; + if ((obj2F4->unk_07C != 0) && (obj2F4->obj.status == 2)) { + scale = 0.63f; + if (obj2F4->unk_07C >= 2) { + scale = D_800CFCA0[obj2F4->unk_07C - 2] * 0.45f; } if (gFrameCount & 1) { - var_fv0 *= 1.2f; + scale *= 1.2f; } Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, var_fv0, var_fv0, var_fv0, 1); - Matrix_RotateZ(gGfxMatrix, -arg0->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -arg0->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -arg0->obj.rot.y * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_RotateZ(gGfxMatrix, -obj2F4->obj.rot.z * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, -obj2F4->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, -obj2F4->obj.rot.y * M_DTOR, 1); Matrix_RotateY(gGfxMatrix, -gPlayer[D_801778A0].unk_058, 1); Matrix_SetGfxMtx(&gMasterDisp); - func_8005465C(arg1); + func_8005465C(levelType); Matrix_Pop(&gGfxMatrix); } } -void func_8005B388(Object_2F4* arg0) { +void func_8005B388(Object_2F4* obj2F4) { Vec3f sp3C = { 0.0f, 0.0f, 0.0f }; Vec3f sp30; @@ -510,11 +510,11 @@ void func_8005B388(Object_2F4* arg0) { if ((((fabsf(sp30.z) < 3000.0f) && (fabsf(sp30.x) < 3000.0f) && (D_80178284 == 0)) || (gPlayer[0].unk_1C8 == 0) || (gCurrentLevel == LEVEL_VENOM_2) || (gCurrentLevel == LEVEL_VENOM_SW) || (gPlayer[0].unk_1C8 == 7)) && (gCurrentLevel != LEVEL_MACBETH) && (gCurrentLevel != LEVEL_TITANIA)) { - if (arg0->obj.id == OBJECT_195) { - if (((gCurrentLevel == LEVEL_VENOM_SW) && (gPlayer[0].unk_1C8 == 7) && (arg0->unk_040 == 10)) || + if (obj2F4->obj.id == OBJECT_195) { + if (((gCurrentLevel == LEVEL_VENOM_SW) && (gPlayer[0].unk_1C8 == 7) && (obj2F4->unk_040 == 10)) || ((gPlayer[0].unk_1C8 == 7) && (gPlayer[0].unk_1D0 >= 100) && (gCurrentLevel == LEVEL_KATINA) && - (arg0->unk_040 == 1)) || - ((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].unk_1C8 == 0) && (arg0->unk_0B8 == 5))) { + (obj2F4->unk_040 == 1)) || + ((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].unk_1C8 == 0) && (obj2F4->unk_0B8 == 5))) { D_80161630.rightState = gPlayer[0].wings.rightState; D_80161630.leftState = gPlayer[0].wings.leftState; } else { @@ -523,52 +523,52 @@ void func_8005B388(Object_2F4* arg0) { } else { D_80161630.rightState = D_80161630.leftState = 2; } - D_80161630.unk_04 = arg0->unk_150; - D_80161630.unk_0C = arg0->unk_154; - D_80161630.unk_08 = arg0->unk_17C; - D_80161630.unk_10 = arg0->unk_180; + D_80161630.unk_04 = obj2F4->unk_150; + D_80161630.unk_0C = obj2F4->unk_154; + D_80161630.unk_08 = obj2F4->unk_17C; + D_80161630.unk_10 = obj2F4->unk_180; D_80161630.unk_14 = D_80161630.unk_18 = D_80161630.unk_1C = D_80161630.unk_20 = D_80161630.unk_38 = D_80161630.unk_24 = 0.0f; - D_80161630.unk_28 = arg0->unk_158; - D_80161630.unk_2C = arg0->unk_088; - D_80161630.unk_30 = arg0->unk_164; - D_80161630.unk_34 = arg0->unk_160; - if (gLevelType == 1) { + D_80161630.unk_28 = obj2F4->unk_158; + D_80161630.unk_2C = obj2F4->unk_088; + D_80161630.unk_30 = obj2F4->unk_164; + D_80161630.unk_34 = obj2F4->unk_160; + if (gLevelType == LEVELTYPE_SPACE) { D_80161630.unk_04 = D_80161630.unk_08 = D_80161630.unk_0C = D_80161630.unk_10 = 0.0f; } func_80053658(&D_80161630); - } else if (gLevelType == 0) { + } else if (gLevelType == LEVELTYPE_GROUND) { gSPDisplayList(gMasterDisp++, D_40018A0); } else if (gPlayer[0].unk_204 == 2) { gSPDisplayList(gMasterDisp++, D_4003BD0); } else { gSPDisplayList(gMasterDisp++, D_4007870); } - func_8005ADAC(arg0); + func_8005ADAC(obj2F4); } -void func_8005B6A4(Object_2F4* arg0) { +void func_8005B6A4(Object_2F4* obj2F4) { Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_6024B60); } -void func_8005B71C(Object_2F4* arg0) { - RCP_SetupDL_29(arg0->unk_046, gFogGreen, gFogBlue, gFogAlpha, arg0->unk_048, gFogFar); +void func_8005B71C(Object_2F4* obj2F4) { + RCP_SetupDL_29(obj2F4->unk_046, gFogGreen, gFogBlue, gFogAlpha, obj2F4->unk_048, gFogFar); Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_6018C00); } -void func_8005B7CC(Object_2F4* arg0) { - RCP_SetupDL_29(arg0->unk_046, gFogGreen, gFogBlue, gFogAlpha, arg0->unk_048, gFogFar); +void func_8005B7CC(Object_2F4* obj2F4) { + RCP_SetupDL_29(obj2F4->unk_046, gFogGreen, gFogBlue, gFogAlpha, obj2F4->unk_048, gFogFar); gSPDisplayList(gMasterDisp++, D_6022920); } -void func_8005B848(Object_2F4* arg0) { - f32 var_fv0; +void func_8005B848(Object_2F4* obj2F4) { + f32 scale; - switch (arg0->unk_0B4) { + switch (obj2F4->unk_0B4) { case 0: gSPDisplayList(gMasterDisp++, D_1028230); break; @@ -580,24 +580,24 @@ void func_8005B848(Object_2F4* arg0) { } break; } - var_fv0 = 2.0f; + scale = 2.0f; if (gFrameCount & 1) { - var_fv0 = 1.7f; + scale = 1.7f; } Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); - arg0->unk_07C = 1; - Matrix_Scale(gGfxMatrix, var_fv0, var_fv0, var_fv0, 1); - func_8005B1E8(arg0, 2); + obj2F4->unk_07C = 1; + Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + func_8005B1E8(obj2F4, 2); } -void func_8005B9A4(Object_2F4* arg0) { +void func_8005B9A4(Object_2F4* obj2F4) { Matrix_Translate(gGfxMatrix, 0.0f, -124.0f, 0.0f, 1); - Animation_GetFrameData(&D_6029528, arg0->unk_0B6, arg0->unk_18C); - Animation_DrawSkeleton(1, D_6029674, arg0->unk_18C, NULL, NULL, arg0, &gIdentityMatrix); + Animation_GetFrameData(&D_6029528, obj2F4->unk_0B6, obj2F4->unk_18C); + Animation_DrawSkeleton(1, D_6029674, obj2F4->unk_18C, NULL, NULL, obj2F4, &gIdentityMatrix); } -void func_8005BA30(Object_2F4* arg0) { - if (arg0->unk_0BC != 0) { +void func_8005BA30(Object_2F4* obj2F4) { + if (obj2F4->unk_0BC != 0) { RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } @@ -611,14 +611,14 @@ f32 D_800CFCCC[] = { 0.0f, 0.05f, 0.03f, 0.02f, 0.01f, 0.05f, 0.0f, 0.02f, }; -void func_8005BAB4(s32 objId, s32 arg1) { +void func_8005BAB4(s32 objId, s32 index) { f32 temp_fv0; f32 temp1; f32 temp2; switch (objId) { case OBJECT_374: - if (gObjects8C[arg1].unk_4E == 0) { + if (gObjects8C[index].unk_4E == 0) { Matrix_Scale(gGfxMatrix, 1.2f, 0.0f, 1.2f, 1); Matrix_RotateX(gGfxMatrix, M_PI / 2.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); @@ -629,7 +629,7 @@ void func_8005BAB4(s32 objId, s32 arg1) { case OBJECT_195: case OBJECT_198: case OBJECT_200: - switch (gObjects2F4[arg1].unk_0B4) { + switch (gObjects2F4[index].unk_0B4) { case 3: Matrix_Scale(gGfxMatrix, 2.3f, 0.0f, 2.3f, 1); Matrix_RotateX(gGfxMatrix, M_PI / 2.0f, 1); @@ -640,7 +640,7 @@ void func_8005BAB4(s32 objId, s32 arg1) { RCP_SetupDL(&gMasterDisp, 0x30); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 255); - temp_fv0 = gObjects2F4[arg1].unk_150 * 3.0f; + temp_fv0 = gObjects2F4[index].unk_150 * 3.0f; Matrix_Scale(gGfxMatrix, temp_fv0, temp_fv0, temp_fv0, 1); Matrix_RotateX(gGfxMatrix, -M_PI / 2.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); @@ -674,7 +674,7 @@ void func_8005BAB4(s32 objId, s32 arg1) { case OBJECT_294: case OBJECT_295: case OBJECT_296: - __cosf(gObjects408[arg1].obj.rot.z * M_DTOR); + __cosf(gObjects408[index].obj.rot.z * M_DTOR); if (D_80161A88 == 2) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 90); } else { @@ -695,7 +695,7 @@ void func_8005BAB4(s32 objId, s32 arg1) { break; case OBJECT_192: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 150); - Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, gObjects2F4[arg1].unk_110, 1); + Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, gObjects2F4[index].unk_110, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_6034B90); break; @@ -705,9 +705,9 @@ void func_8005BAB4(s32 objId, s32 arg1) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); - Matrix_RotateX(gGfxMatrix, gObjects2F4[arg1].unk_114, 1); - Matrix_RotateZ(gGfxMatrix, gObjects2F4[arg1].unk_11C, 1); - Matrix_Scale(gGfxMatrix, gObjects2F4[arg1].unk_110, 1.0f, gObjects2F4[arg1].unk_110, 1); + Matrix_RotateX(gGfxMatrix, gObjects2F4[index].unk_114, 1); + Matrix_RotateZ(gGfxMatrix, gObjects2F4[index].unk_11C, 1); + Matrix_Scale(gGfxMatrix, gObjects2F4[index].unk_110, 1.0f, gObjects2F4[index].unk_110, 1); Matrix_RotateX(gGfxMatrix, -M_PI / 2.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); @@ -718,9 +718,9 @@ void func_8005BAB4(s32 objId, s32 arg1) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 120.0f, 1); - Matrix_RotateX(gGfxMatrix, gObjects2F4[arg1].unk_118 * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, gObjects2F4[arg1].unk_11C * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, gObjects2F4[arg1].obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, gObjects2F4[index].unk_118 * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, gObjects2F4[index].unk_11C * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, gObjects2F4[index].obj.rot.y * M_DTOR, 1); Matrix_Scale(gGfxMatrix, 6.0f, 1.0f, 7.5f, 1); Matrix_RotateX(gGfxMatrix, -M_PI / 2.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); @@ -730,8 +730,8 @@ void func_8005BAB4(s32 objId, s32 arg1) { RCP_SetupDL(&gMasterDisp, 0x45); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); - Matrix_RotateX(gGfxMatrix, gObjects2F4[arg1].unk_118, 1); - Matrix_RotateZ(gGfxMatrix, gObjects2F4[arg1].unk_11C, 1); + Matrix_RotateX(gGfxMatrix, gObjects2F4[index].unk_118, 1); + Matrix_RotateZ(gGfxMatrix, gObjects2F4[index].unk_11C, 1); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, 1); Matrix_Scale(gGfxMatrix, 1.2f, 1.0f, 1.2f, 1); Matrix_RotateX(gGfxMatrix, -M_PI / 2.0f, 1); @@ -747,15 +747,15 @@ void func_8005BAB4(s32 objId, s32 arg1) { gSPDisplayList(gMasterDisp++, D_1024AC0); break; case OBJECT_319: - func_DF4260_80198310(&gObjects408[arg1]); + func_DF4260_80198310(&gObjects408[index]); break; } } -void func_8005C5F0(Object_6C* arg0) { +void func_8005C5F0(Object_6C* obj6C) { s32 i; - if ((gFrameCount & 0x18) && (arg0->unk_46 == 0)) { + if ((gFrameCount & 0x18) && (obj6C->unk_46 == 0)) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x40); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); @@ -769,53 +769,53 @@ void func_8005C5F0(Object_6C* arg0) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); - Matrix_RotateZ(gGfxMatrix, arg0->unk_58 * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj6C->unk_58 * M_DTOR, 1); for (i = 0; i < 8; i++) { Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, i * 45.0f * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, 2.0f * arg0->unk_68, 0.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, (gFrameCount + (i * 110.0f)) * M_DTOR * 7.2f * arg0->unk_54, 1); - func_8005980C(2.0f * arg0->unk_50); + Matrix_Translate(gGfxMatrix, 2.0f * obj6C->unk_68, 0.0f, 0.0f, 1); + Matrix_RotateZ(gGfxMatrix, (gFrameCount + (i * 110.0f)) * M_DTOR * 7.2f * obj6C->unk_54, 1); + func_8005980C(2.0f * obj6C->unk_50); gSPDisplayList(gMasterDisp++, D_101CAE0); Matrix_Pop(&gGfxMatrix); } gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN); } -void func_8005C900(Object_6C* arg0) { +void func_8005C900(Object_6C* obj6C) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); - func_8005980C(arg0->unk_68); + func_8005980C(obj6C->unk_68); gSPDisplayList(gMasterDisp++, D_101A570); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } -void func_8005C9C0(Object_6C* arg0) { +void func_8005C9C0(Object_6C* obj6C) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 3000, 0, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); - func_8005980C(arg0->unk_68); + func_8005980C(obj6C->unk_68); gSPDisplayList(gMasterDisp++, D_1019CA0); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } -void func_8005CA80(Object_6C* arg0) { +void func_8005CA80(Object_6C* obj6C) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 1900, 1700, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); - func_8005980C(arg0->unk_68); + func_8005980C(obj6C->unk_68); gSPDisplayList(gMasterDisp++, D_1016870); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); } -void func_8005CB44(Object_6C* arg0) { +void func_8005CB44(Object_6C* obj6C) { if (gCurrentLevel == LEVEL_AQUAS) { - func_8005980C(arg0->unk_68); + func_8005980C(obj6C->unk_68); gSPDisplayList(gMasterDisp++, D_3005980); } else { - func_8005980C(arg0->unk_68 * 0.1f); + func_8005980C(obj6C->unk_68 * 0.1f); RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); @@ -827,8 +827,8 @@ void func_8005CB44(Object_6C* arg0) { } } -void func_8005CC9C(Object_6C* arg0) { - func_8005980C(arg0->unk_68 * 0.1f); +void func_8005CC9C(Object_6C* obj6C) { + func_8005980C(obj6C->unk_68 * 0.1f); RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); @@ -839,16 +839,16 @@ void func_8005CC9C(Object_6C* arg0) { gSPDisplayList(gMasterDisp++, D_101A8E0); } -void func_8005CDA8(Object_6C* arg0) { +void func_8005CDA8(Object_6C* obj6C) { s32 i; - arg0->obj.rot.y = (Math_Atan2F(gPlayer[D_801778A0].unk_040.x - arg0->obj.pos.x, - gPlayer[D_801778A0].unk_040.z - (arg0->obj.pos.z + D_80177D20)) * - 180.0f) / - M_PI; - if (arg0->unk_46 != 0) { + obj6C->obj.rot.y = (Math_Atan2F(gPlayer[D_801778A0].unk_040.x - obj6C->obj.pos.x, + gPlayer[D_801778A0].unk_040.z - (obj6C->obj.pos.z + D_80177D20)) * + 180.0f) / + M_PI; + if (obj6C->unk_46 != 0) { RCP_SetupDL(&gMasterDisp, 0x29); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, arg0->unk_44); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, obj6C->unk_44); } else { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } @@ -856,7 +856,7 @@ void func_8005CDA8(Object_6C* arg0) { for (i = 0; i < 7; i++) { Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, (i * 360.0f / 7.0f) * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, 0.0f, arg0->unk_68, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, obj6C->unk_68, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102FE80); Matrix_Pop(&gGfxMatrix); @@ -864,90 +864,90 @@ void func_8005CDA8(Object_6C* arg0) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK | G_LIGHTING); } -void func_8005D008(Object* arg0, s32 arg1) { - if (arg1 == 2) { +void func_8005D008(Object* obj, s32 drawType) { + if (drawType == 2) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_80177D20, 1); - Matrix_Translate(gCalcMatrix, arg0->pos.x, arg0->pos.y, arg0->pos.z, 0); + Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, 0); Matrix_Push(&gGfxMatrix); Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); Matrix_Copy(&D_801615F0, gGfxMatrix); Matrix_Pop(&gGfxMatrix); - Matrix_RotateY(gCalcMatrix, arg0->rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg0->rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, arg0->rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, 1); } else { - Matrix_Translate(gGfxMatrix, arg0->pos.x, arg0->pos.y, arg0->pos.z + D_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_80177D20, 1); Matrix_Copy(&D_801615F0, gGfxMatrix); - Matrix_RotateY(gGfxMatrix, arg0->rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, arg0->rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, arg0->rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); } } -void func_8005D1F0(Object* arg0, s32 arg1) { - if (arg1 == 2) { +void func_8005D1F0(Object* obj, s32 drawType) { + if (drawType == 2) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_80177D20, 1); - Matrix_Translate(gCalcMatrix, arg0->pos.x, arg0->pos.y, arg0->pos.z, 0); + Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, 0); Matrix_Push(&gGfxMatrix); Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); Matrix_Copy(&D_801615F0, gGfxMatrix); Matrix_Pop(&gGfxMatrix); - Matrix_RotateY(gCalcMatrix, arg0->rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg0->rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, arg0->rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, 1); } else { - Matrix_Translate(gGfxMatrix, arg0->pos.x, arg0->pos.y, arg0->pos.z + D_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_80177D20, 1); Matrix_Copy(&D_801615F0, gGfxMatrix); - Matrix_RotateY(gGfxMatrix, arg0->rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, arg0->rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, arg0->rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, 1); } } -void func_8005D3CC(Object* arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { - if (arg4 == 2) { +void func_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawType) { + if (drawType == 2) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_80177D20, 1); - Matrix_Translate(gCalcMatrix, arg0->pos.x, arg0->pos.y, arg0->pos.z, 0); + Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, 0); Matrix_Push(&gGfxMatrix); Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); Matrix_Copy(&D_801615F0, gGfxMatrix); Matrix_Pop(&gGfxMatrix); - Matrix_RotateY(gCalcMatrix, M_DTOR * arg2, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * arg1, 1); - Matrix_RotateZ(gCalcMatrix, M_DTOR * arg3, 1); - Matrix_RotateY(gCalcMatrix, arg0->rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg0->rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, arg0->rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, 1); + Matrix_RotateX(gCalcMatrix, M_DTOR * xRot, 1); + Matrix_RotateZ(gCalcMatrix, M_DTOR * zRot, 1); + Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, 1); } else { - Matrix_Translate(gGfxMatrix, arg0->pos.x, arg0->pos.y, arg0->pos.z + D_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_80177D20, 1); Matrix_Copy(&D_801615F0, gGfxMatrix); - Matrix_RotateY(gGfxMatrix, M_DTOR * arg2, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * arg1, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * arg3, 1); - Matrix_RotateY(gGfxMatrix, arg0->rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, arg0->rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, arg0->rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, 1); + Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * zRot, 1); + Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); } } -void func_8005D654(Object_80* arg0, s32 arg1) { - arg0->obj.pos.y += D_8017847C; - func_8005D008(&arg0->obj, arg0->unk_1C.drawType); - arg0->obj.pos.y -= D_8017847C; - if (arg0->unk_1C.drawType == 0) { - if ((arg0->obj.id == OBJECT_19) || (arg0->obj.id == OBJECT_55) || (arg0->obj.id == OBJECT_9) || - (arg0->obj.id == OBJECT_50)) { +void Object_80_Draw(Object_80* obj80, s32 arg1) { + obj80->obj.pos.y += D_8017847C; + func_8005D008(&obj80->obj, obj80->unk_1C.drawType); + obj80->obj.pos.y -= D_8017847C; + if (obj80->unk_1C.drawType == 0) { + if ((obj80->obj.id == OBJECT_19) || (obj80->obj.id == OBJECT_55) || (obj80->obj.id == OBJECT_9) || + (obj80->obj.id == OBJECT_50)) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); if (arg1 < 0) { func_800596C0(); } - gSPDisplayList(gMasterDisp++, arg0->unk_1C.dList); + gSPDisplayList(gMasterDisp++, obj80->unk_1C.dList); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { - if (arg0->obj.id == OBJECT_8) { + if (obj80->obj.id == OBJECT_8) { if (arg1 < 0) { return; // weird control flow } @@ -957,78 +957,78 @@ void func_8005D654(Object_80* arg0, s32 arg1) { if (arg1 < 0) { func_800596C0(); } - gSPDisplayList(gMasterDisp++, arg0->unk_1C.dList); - if (arg0->obj.id == OBJECT_8) { + gSPDisplayList(gMasterDisp++, obj80->unk_1C.dList); + if (obj80->obj.id == OBJECT_8) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } } - } else if (arg0->unk_1C.draw != NULL) { + } else if (obj80->unk_1C.draw != NULL) { func_800597C0(arg1); - arg0->unk_1C.draw(&arg0->obj); + obj80->unk_1C.draw(&obj80->obj); } } -void func_8005D8B8(Object_4C* arg0, s32 arg1) { +void Object_4C_Draw(Object_4C* obj4C, s32 arg1) { if (arg1 >= 0) { - arg0->obj.pos.y += D_8017847C; - func_8005D008(&arg0->obj, 0); - arg0->obj.pos.y -= D_8017847C; - if (arg0->unk_1C.drawType == 0) { - gSPDisplayList(gMasterDisp++, arg0->unk_1C.dList); - } else if (arg0->unk_1C.draw != NULL) { - arg0->unk_1C.draw(&arg0->obj); + obj4C->obj.pos.y += D_8017847C; + func_8005D008(&obj4C->obj, 0); + obj4C->obj.pos.y -= D_8017847C; + if (obj4C->unk_1C.drawType == 0) { + gSPDisplayList(gMasterDisp++, obj4C->unk_1C.dList); + } else if (obj4C->unk_1C.draw != NULL) { + obj4C->unk_1C.draw(&obj4C->obj); } } } -void func_8005D954(Object_2F4* arg0) { +void Object_2F4_Draw2(Object_2F4* obj2F4) { Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; - if (arg0->unk_01C.draw != NULL) { - switch (arg0->obj.id) { + if (obj2F4->unk_01C.draw != NULL) { + switch (obj2F4->obj.id) { case OBJECT_194: - func_8006B74C(arg0); + func_8006B74C(obj2F4); return; case OBJECT_236: - func_E16C50_80190F08(arg0); + func_E16C50_80190F08(obj2F4); return; } - if ((arg0->obj.id == OBJECT_200) && (arg0->unk_0B4 == 200)) { - func_8006B74C(arg0); + if ((obj2F4->obj.id == OBJECT_200) && (obj2F4->unk_0B4 == 200)) { + func_8006B74C(obj2F4); } else { - if (arg0->unk_01C.unk_19 != 0) { - arg0->obj.pos.y += D_8017847C; - func_8005D008(&arg0->obj, arg0->unk_01C.drawType); - arg0->obj.pos.y -= D_8017847C; - } else if ((arg0->obj.id == OBJECT_200) && (arg0->unk_0B4 != 31)) { - func_8005D3CC(&arg0->obj, arg0->unk_2E8.x, arg0->unk_2E8.y, arg0->unk_2E8.z + arg0->unk_0F4.z, - arg0->unk_01C.drawType); + if (obj2F4->unk_01C.unk_19 != 0) { + obj2F4->obj.pos.y += D_8017847C; + func_8005D008(&obj2F4->obj, obj2F4->unk_01C.drawType); + obj2F4->obj.pos.y -= D_8017847C; + } else if ((obj2F4->obj.id == OBJECT_200) && (obj2F4->unk_0B4 != 31)) { + func_8005D3CC(&obj2F4->obj, obj2F4->unk_2E8.x, obj2F4->unk_2E8.y, obj2F4->unk_2E8.z + obj2F4->unk_0F4.z, + obj2F4->unk_01C.drawType); } else { - func_8005D008(&arg0->obj, arg0->unk_01C.drawType); + func_8005D008(&obj2F4->obj, obj2F4->unk_01C.drawType); } - if (arg0->unk_01C.drawType == 0) { - gSPDisplayList(gMasterDisp++, arg0->unk_01C.dList); - func_8005F1EC(&arg0->unk_100); + if (obj2F4->unk_01C.drawType == 0) { + gSPDisplayList(gMasterDisp++, obj2F4->unk_01C.dList); + func_8005F1EC(&obj2F4->sfxPos); } else { - arg0->unk_01C.draw(&arg0->obj); - func_8005F1EC(&arg0->unk_100); - if (((arg0->obj.id == OBJECT_198) || ((arg0->obj.id == OBJECT_203) && (arg0->unk_0B6 > 0))) && + obj2F4->unk_01C.draw(&obj2F4->obj); + func_8005F1EC(&obj2F4->sfxPos); + if (((obj2F4->obj.id == OBJECT_198) || ((obj2F4->obj.id == OBJECT_203) && (obj2F4->unk_0B6 > 0))) && (D_80161410 > 0)) { - Matrix_MultVec3f(gGfxMatrix, &sp34, &D_80177E98[arg0->unk_0E4]); + Matrix_MultVec3f(gGfxMatrix, &sp34, &D_80177E98[obj2F4->unk_0E4]); } } - if ((arg0->unk_0CA[0] != 0) && (D_80161410 > 0)) { - sp34.y += arg0->unk_01C.unk_1C; + if ((obj2F4->unk_0CA[0] != 0) && (D_80161410 > 0)) { + sp34.y += obj2F4->unk_01C.unk_1C; Matrix_MultVec3f(gGfxMatrix, &sp34, &D_80161578[0]); if (D_80161578[0].z > -200.0f) { - arg0->unk_0CA[0] = 0; + obj2F4->unk_0CA[0] = 0; } } } } } -void func_8005DBC0(Object_2F4* arg0) { +void Object_2F4_Draw1(Object_2F4* obj2F4) { s32 var_v1; Vec3f sp50 = { 0.0f, 0.0f, 0.0f }; f32 var_fa1; @@ -1037,39 +1037,39 @@ void func_8005DBC0(Object_2F4* arg0) { f32 var_fv1; D_801615EC = 0; - if (arg0->unk_01C.drawType == 2) { + if (obj2F4->unk_01C.drawType == 2) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_80177D20, 1); - Matrix_Translate(gCalcMatrix, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 0); + Matrix_Translate(gCalcMatrix, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 0); Matrix_Push(&gGfxMatrix); Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); Matrix_MultVec3f(gGfxMatrix, &sp50, &D_801615E0); Matrix_Pop(&gGfxMatrix); var_fv0 = 0.0f; var_fv1 = -12000.0f; - if ((arg0->obj.id == OBJECT_197) && (arg0->unk_0E4 >= 100)) { + if ((obj2F4->obj.id == OBJECT_197) && (obj2F4->unk_0E4 >= 100)) { var_fv0 = 1000.0f; var_fv1 = -25000.0f; } if ((var_fv0 > D_801615E0.z) && (D_801615E0.z > var_fv1)) { if (fabsf(D_801615E0.x) < (fabsf(D_801615E0.z * 0.5f) + 500.0f)) { if (fabsf(D_801615E0.y) < (fabsf(D_801615E0.z * 0.5f) + 500.0f)) { - Matrix_RotateY(gCalcMatrix, arg0->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg0->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, arg0->obj.rot.z * M_DTOR, 1); - arg0->unk_01C.draw(&arg0->obj); + Matrix_RotateY(gCalcMatrix, obj2F4->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, obj2F4->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, obj2F4->obj.rot.z * M_DTOR, 1); + obj2F4->unk_01C.draw(&obj2F4->obj); D_801615EC = 1; - if ((gPlayer[0].unk_1C8 == 3) && (arg0->obj.id == OBJECT_197) && (arg0->unk_0E4 == 200)) { + if ((gPlayer[0].unk_1C8 == 3) && (obj2F4->obj.id == OBJECT_197) && (obj2F4->unk_0E4 == 200)) { D_80177E98[0] = D_801615E0; } } } } } else { - Matrix_Translate(gGfxMatrix, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 1); + Matrix_Translate(gGfxMatrix, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 1); Matrix_MultVec3f(gGfxMatrix, &sp50, &D_801615E0); if ((gPlayer[0].unk_1C8 == 2) || (gPlayer[0].unk_1C8 == 0) || - ((arg0->obj.id == OBJECT_197) && (arg0->unk_0E4 >= 100)) || - ((arg0->obj.id == OBJECT_195) && (arg0->unk_01C.unk_20 != 0))) { + ((obj2F4->obj.id == OBJECT_197) && (obj2F4->unk_0E4 >= 100)) || + ((obj2F4->obj.id == OBJECT_195) && (obj2F4->unk_01C.bonus != 0))) { var_ft5 = var_fv0 = 3000.0f; var_fv1 = -29000.0f; var_fa1 = 0.7f; @@ -1082,18 +1082,18 @@ void func_8005DBC0(Object_2F4* arg0) { if ((var_fv0 > D_801615E0.z) && (D_801615E0.z > var_fv1)) { if (fabsf(D_801615E0.x) < (fabsf(D_801615E0.z * var_fa1) + var_ft5)) { if (fabsf(D_801615E0.y) < (fabsf(D_801615E0.z * var_fa1) + var_ft5)) { - if (arg0->unk_01C.draw != NULL) { - Matrix_RotateY(gGfxMatrix, arg0->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, arg0->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, arg0->obj.rot.z * M_DTOR, 1); + if (obj2F4->unk_01C.draw != NULL) { + Matrix_RotateY(gGfxMatrix, obj2F4->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, obj2F4->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj2F4->obj.rot.z * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); - arg0->unk_01C.draw(&arg0->obj); + obj2F4->unk_01C.draw(&obj2F4->obj); D_801615EC = 1; if ((gPlayer[0].unk_1C8 == 3) && - (((arg0->obj.id == OBJECT_197) && - ((arg0->unk_0E4 < 4) || (arg0->unk_0E4 == 8) || (arg0->unk_0E4 == 9))) || - (arg0->obj.id == OBJECT_198))) { - D_80177E98[arg0->unk_0E4] = D_801615E0; + (((obj2F4->obj.id == OBJECT_197) && + ((obj2F4->unk_0E4 < 4) || (obj2F4->unk_0E4 == 8) || (obj2F4->unk_0E4 == 9))) || + (obj2F4->obj.id == OBJECT_198))) { + D_80177E98[obj2F4->unk_0E4] = D_801615E0; } } } @@ -1101,25 +1101,25 @@ void func_8005DBC0(Object_2F4* arg0) { } } if (D_801615EC == 0) { - arg0->unk_0CA[D_801778A0] = 0; - if ((arg0->obj.id == OBJECT_189) || (arg0->obj.id == OBJECT_286)) { - Object_Kill(&arg0->obj, &arg0->unk_100); + obj2F4->unk_0CA[D_801778A0] = 0; + if ((obj2F4->obj.id == OBJECT_189) || (obj2F4->obj.id == OBJECT_286)) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } } for (var_v1 = 0; var_v1 < gCamCount; var_v1++) { - if (arg0->unk_0CA[var_v1] != 0) { + if (obj2F4->unk_0CA[var_v1] != 0) { D_80161578[var_v1] = D_801615E0; - D_80161578[var_v1].y += arg0->unk_01C.unk_1C; + D_80161578[var_v1].y += obj2F4->unk_01C.unk_1C; if ((var_v1 == D_801778A0) && (D_80161578[var_v1].z > -300.0f)) { - arg0->unk_0CA[var_v1] = 0; + obj2F4->unk_0CA[var_v1] = 0; } } } - func_8005F290(&arg0->unk_100, &D_801615E0); - arg0->unk_0B0 = D_801615EC; + func_8005F290(&obj2F4->sfxPos, &D_801615E0); + obj2F4->unk_0B0 = D_801615EC; } -void func_8005E1B8(Object_408* arg0, s32 arg1) { +void Object_408_Draw(Object_408* obj408, s32 arg1) { f32 var_fa1; f32 var_ft5; f32 var_fv0; @@ -1127,21 +1127,21 @@ void func_8005E1B8(Object_408* arg0, s32 arg1) { f32 sp3C; Vec3f sp30 = { 0.0f, 0.0f, 0.0f }; - if (arg0->unk_01C.unk_19 != 0) { - arg0->obj.pos.y += arg0->unk_068 + D_8017847C; - func_8005D1F0(&arg0->obj, arg0->unk_01C.drawType); - arg0->obj.pos.y -= arg0->unk_068 + D_8017847C; + if (obj408->unk_01C.unk_19 != 0) { + obj408->obj.pos.y += obj408->unk_068 + D_8017847C; + func_8005D1F0(&obj408->obj, obj408->unk_01C.drawType); + obj408->obj.pos.y -= obj408->unk_068 + D_8017847C; } else { - func_8005D1F0(&arg0->obj, arg0->unk_01C.drawType); + func_8005D1F0(&obj408->obj, obj408->unk_01C.drawType); } Matrix_MultVec3f(&D_801615F0, &sp30, &D_801615D0); - func_8005F290(&arg0->unk_3FC, &D_801615D0); - if ((arg0->obj.id == OBJECT_316) || (arg0->obj.id == OBJECT_317)) { + func_8005F290(&obj408->sfxPos, &D_801615D0); + if ((obj408->obj.id == OBJECT_316) || (obj408->obj.id == OBJECT_317)) { var_fa1 = 6000.0f; var_fv0 = 6000.0f; var_ft5 = 0.9f; var_fv1 = -20000.0f; - } else if (arg0->obj.id == OBJECT_313) { + } else if (obj408->obj.id == OBJECT_313) { var_fv1 = -25000.0f; var_ft5 = 0.7f; var_fa1 = 3000.0f; @@ -1157,58 +1157,58 @@ void func_8005E1B8(Object_408* arg0, s32 arg1) { if (fabsf(D_801615D0.x) < (fabsf(D_801615D0.z * var_ft5) + var_fa1)) { if (fabsf(D_801615D0.y) < (fabsf(D_801615D0.z * var_ft5) + var_fa1)) { sp3C = 1.0f; - if (arg0->obj.id != OBJECT_309) { - if (arg0->obj.id != OBJECT_316) { - func_8005F670(&arg0->obj.pos); + if (obj408->obj.id != OBJECT_309) { + if (obj408->obj.id != OBJECT_316) { + func_8005F670(&obj408->obj.pos); } - if (arg0->unk_01C.drawType != 2) { + if (obj408->unk_01C.drawType != 2) { Matrix_SetGfxMtx(&gMasterDisp); } if (arg1 < 0) { func_800596C0(); } - arg0->unk_01C.draw(&arg0->obj); + obj408->unk_01C.draw(&obj408->obj); } } } } D_801615D0.y = sp3C; - if (arg0->obj.id == OBJECT_309) { - arg0->unk_308 = D_801615D0; - func_8005F670(&arg0->obj.pos); + if (obj408->obj.id == OBJECT_309) { + obj408->unk_308 = D_801615D0; + func_8005F670(&obj408->obj.pos); Matrix_SetGfxMtx(&gMasterDisp); - arg0->unk_01C.draw(&arg0->obj); + obj408->unk_01C.draw(&obj408->obj); } } -void func_8005E454(Object_8C* arg0, s32 arg1) { - if ((arg1 < 0) && (arg0->obj.pos.y < 7.0f)) { +void Object_8C_Draw1(Object_8C* obj8C, s32 arg1) { + if ((arg1 < 0) && (obj8C->obj.pos.y < 7.0f)) { return; } - if ((arg0->obj.id == OBJECT_353) || (arg0->obj.id == OBJECT_369)) { - func_8005D3CC(&arg0->obj, arg0->unk_60.x, arg0->unk_60.y, arg0->unk_60.z, 0); - } else if (arg0->unk_1C.unk_14 == -1) { - arg0->obj.pos.y += D_8017847C; - func_8005D008(&arg0->obj, 0); - arg0->obj.pos.y -= D_8017847C; + if ((obj8C->obj.id == OBJECT_353) || (obj8C->obj.id == OBJECT_369)) { + func_8005D3CC(&obj8C->obj, obj8C->unk_60.x, obj8C->unk_60.y, obj8C->unk_60.z, 0); + } else if (obj8C->unk_1C.unk_14 == -1) { + obj8C->obj.pos.y += D_8017847C; + func_8005D008(&obj8C->obj, 0); + obj8C->obj.pos.y -= D_8017847C; } else { - func_8005D008(&arg0->obj, 0); + func_8005D008(&obj8C->obj, 0); } - if (arg0->unk_1C.draw != NULL) { - arg0->unk_1C.draw(&arg0->obj); + if (obj8C->unk_1C.draw != NULL) { + obj8C->unk_1C.draw(&obj8C->obj); } } -void func_8005E538(Object_8C* arg0) { +void Object_8C_Draw2(Object_8C* obj8C) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; Vec3f sp40; f32 var_fv0; u8 sp3B = 0; - if (arg0->unk_1C.unk_14 == -1) { - Matrix_Translate(gGfxMatrix, arg0->obj.pos.x, arg0->obj.pos.y + D_8017847C, arg0->obj.pos.z + D_80177D20, 1); + if (obj8C->unk_1C.unk_14 == -1) { + Matrix_Translate(gGfxMatrix, obj8C->obj.pos.x, obj8C->obj.pos.y + D_8017847C, obj8C->obj.pos.z + D_80177D20, 1); } else { - Matrix_Translate(gGfxMatrix, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z + D_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj8C->obj.pos.x, obj8C->obj.pos.y, obj8C->obj.pos.z + D_80177D20, 1); } Matrix_MultVec3f(gGfxMatrix, &sp4C, &sp40); if ((gCurrentLevel == LEVEL_SECTOR_Z) || (gCurrentLevel == LEVEL_BOLSE)) { @@ -1219,79 +1219,79 @@ void func_8005E538(Object_8C* arg0) { if ((sp40.z < 0.0f) && (var_fv0 < sp40.z)) { if (fabsf(sp40.x) < (fabsf(sp40.z * 0.5f) + 500.0f)) { if (fabsf(sp40.y) < (fabsf(sp40.z * 0.5f) + 500.0f)) { - if (arg0->unk_1C.draw != NULL) { - Matrix_RotateY(gGfxMatrix, arg0->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, arg0->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, arg0->obj.rot.z * M_DTOR, 1); + if (obj8C->unk_1C.draw != NULL) { + Matrix_RotateY(gGfxMatrix, obj8C->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, obj8C->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj8C->obj.rot.z * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); - arg0->unk_1C.draw(&arg0->obj); + obj8C->unk_1C.draw(&obj8C->obj); } sp3B = 1; } } } - func_8005F290(&arg0->unk_80, &sp40); - if ((sp3B == 0) && (arg0->obj.id != OBJECT_352) && (arg0->obj.id != OBJECT_373) && (D_801778E8 == 0)) { - Object_Kill(&arg0->obj, &arg0->unk_80); + func_8005F290(&obj8C->sfxPos, &sp40); + if ((sp3B == 0) && (obj8C->obj.id != OBJECT_352) && (obj8C->obj.id != OBJECT_373) && (D_801778E8 == 0)) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } -void func_8005E7B8(Object_6C* arg0, s32 arg1) { +void Object_6C_Draw(Object_6C* obj6C, s32 arg1) { Vec3f sp44 = { 0.0f, 0.0f, 0.0f }; Vec3f sp38; u8 var_v0; - Matrix_Translate(gGfxMatrix, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z + D_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj6C->obj.pos.x, obj6C->obj.pos.y, obj6C->obj.pos.z + D_80177D20, 1); Matrix_MultVec3f(gGfxMatrix, &sp44, &sp38); var_v0 = 0; if ((sp38.z < 0.0f) && (sp38.z > -12000.0f)) { if (fabsf(sp38.x) < (fabsf(sp38.z * 0.5f) + 500.0f)) { if (fabsf(sp38.y) < (fabsf(sp38.z * 0.5f) + 500.0f)) { - if (arg0->unk_1C.draw != NULL) { - Matrix_RotateY(gGfxMatrix, arg0->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, arg0->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, arg0->obj.rot.z * M_DTOR, 1); + if (obj6C->unk_1C.draw != NULL) { + Matrix_RotateY(gGfxMatrix, obj6C->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, obj6C->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj6C->obj.rot.z * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); - if (arg0->unk_1C.drawType == 0) { - gSPDisplayList(gMasterDisp++, arg0->unk_1C.dList); + if (obj6C->unk_1C.drawType == 0) { + gSPDisplayList(gMasterDisp++, obj6C->unk_1C.dList); } else { - arg0->unk_1C.draw(&arg0->obj); + obj6C->unk_1C.draw(&obj6C->obj); } } var_v0 = 1; } } } - func_8005F290(&arg0->unk_5C, &sp38); - if ((var_v0 == 0) && (D_80177880 == 1) && (gCamCount == 1) && (arg0->obj.id < 336) && + func_8005F290(&obj6C->sfxPos, &sp38); + if ((var_v0 == 0) && (D_80177880 == 1) && (gCamCount == 1) && (obj6C->obj.id < 336) && (gCurrentLevel != LEVEL_VENOM_2)) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } } -void func_8005EA24(Object_2F4* arg0) { - Matrix_Translate(gGfxMatrix, arg0->obj.pos.x, arg0->unk_178 + 3.0f, arg0->obj.pos.z, 1); +void func_8005EA24(Object_2F4* obj2F4) { + Matrix_Translate(gGfxMatrix, obj2F4->obj.pos.x, obj2F4->unk_178 + 3.0f, obj2F4->obj.pos.z, 1); if (gCurrentLevel == LEVEL_FORTUNA) { - Matrix_RotateY(gGfxMatrix, arg0->unk_180, 1); - Matrix_RotateX(gGfxMatrix, arg0->unk_17C, 1); - Matrix_RotateZ(gGfxMatrix, arg0->unk_184, 1); - Matrix_RotateY(gGfxMatrix, -arg0->unk_180, 1); + Matrix_RotateY(gGfxMatrix, obj2F4->unk_180, 1); + Matrix_RotateX(gGfxMatrix, obj2F4->unk_17C, 1); + Matrix_RotateZ(gGfxMatrix, obj2F4->unk_184, 1); + Matrix_RotateY(gGfxMatrix, -obj2F4->unk_180, 1); } Matrix_Scale(gGfxMatrix, 1.4f, 0.0f, 1.4f, 1); - Matrix_RotateY(gGfxMatrix, (arg0->obj.rot.y + 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, arg0->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, (obj2F4->obj.rot.y + 180.0f) * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj2F4->obj.rot.z * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); - if (arg0->unk_0E4 < 4) { + if (obj2F4->unk_0E4 < 4) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1032780); } else if (gCurrentLevel == LEVEL_KATINA) { - if ((arg0->unk_0B6 == 1) || (arg0->unk_0B6 == 2)) { + if ((obj2F4->unk_0B6 == 1) || (obj2F4->unk_0B6 == 2)) { gSPDisplayList(gMasterDisp++, D_600D730); } else { gSPDisplayList(gMasterDisp++, D_600DBC0); } - } else if ((arg0->unk_0E4 < 8) || (gCurrentLevel != LEVEL_FORTUNA)) { + } else if ((obj2F4->unk_0E4 < 8) || (gCurrentLevel != LEVEL_FORTUNA)) { gSPDisplayList(gMasterDisp++, D_F014310); } else if (gCurrentLevel == LEVEL_FORTUNA) { gSPDisplayList(gMasterDisp++, D_6009F90); @@ -1300,40 +1300,39 @@ void func_8005EA24(Object_2F4* arg0) { } } -void func_8005ECD8(s32 arg0, Object* arg1) { +void func_8005ECD8(s32 index, Object* obj) { RCP_SetupDL(&gMasterDisp, 0x42); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 180); - if (arg1->id == OBJECT_197) { - func_8005EA24(&gObjects2F4[arg0]); + if (obj->id == OBJECT_197) { + func_8005EA24(&gObjects2F4[index]); } else { - switch (arg1->id) { + switch (obj->id) { case OBJECT_230: - Matrix_Translate(gGfxMatrix, arg1->pos.x, D_80177940 + 2.0f + gObjects2F4[arg0].unk_118, - arg1->pos.z + D_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, D_80177940 + 2.0f + gObjects2F4[index].unk_118, + obj->pos.z + D_80177D20, 1); break; case OBJECT_229: case OBJECT_231: - Matrix_Translate(gGfxMatrix, arg1->pos.x, D_80177940 + 2.0f + gObjects2F4[arg0].unk_114, - arg1->pos.z + D_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, D_80177940 + 2.0f + gObjects2F4[index].unk_114, + obj->pos.z + D_80177D20, 1); break; case OBJECT_316: - Matrix_Translate(gGfxMatrix, arg1->pos.x, D_80177940 + 2.0f + D_8017847C, arg1->pos.z, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, D_80177940 + 2.0f + D_8017847C, obj->pos.z, 1); break; default: - Matrix_Translate(gGfxMatrix, arg1->pos.x, D_80177940 + 2.0f, arg1->pos.z + D_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, D_80177940 + 2.0f, obj->pos.z + D_80177D20, 1); break; } - if ((D_801784AC != 4) || (arg1->id == OBJECT_200) || (arg1->id == OBJECT_195) || (arg1->id == OBJECT_198)) { + if ((D_801784AC != 4) || (obj->id == OBJECT_200) || (obj->id == OBJECT_195) || (obj->id == OBJECT_198)) { Matrix_Scale(gGfxMatrix, 1.0f, 0.0f, 1.0f, 1); - Matrix_RotateY(gGfxMatrix, arg1->rot.y * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); } - if ((arg1->id < OBJECT_292) && (arg1->id != OBJECT_230) && (arg1->id != OBJECT_229) && - (arg1->id != OBJECT_231)) { - Matrix_RotateX(gGfxMatrix, arg1->rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, arg1->rot.z * M_DTOR, 1); + if ((obj->id < OBJECT_292) && (obj->id != OBJECT_230) && (obj->id != OBJECT_229) && (obj->id != OBJECT_231)) { + Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, 1); } Matrix_SetGfxMtx(&gMasterDisp); - func_8005BAB4(arg1->id, arg0); + func_8005BAB4(obj->id, index); } } @@ -1377,7 +1376,7 @@ void func_8005F0E8(Vec3f* arg0, Vec3f* arg1) { } func_8005F030(arg0); } - +// check void func_8005F1EC(Vec3f* arg0) { Vec3f sp2C = { 0.0f, 0.0f, 0.0f }; Vec3f sp20; @@ -1409,7 +1408,7 @@ void func_8005F290(Vec3f* arg0, Vec3f* arg1) { func_8005F030(arg0); } -void func_8005F2F4(Object_58* arg0) { +void Object_58_Draw(Object_58* obj58) { Vec3f sp54 = { 0.0f, 0.0f, 0.0f }; Vec3f sp48; f32 sp44 = 1000.0f; @@ -1417,41 +1416,41 @@ void func_8005F2F4(Object_58* arg0) { f32 sp3C = 2000.0f; f32 sp38 = 0.5f; - if (arg0->obj.id == OBJECT_156) { + if (obj58->obj.id == OBJECT_156) { sp44 = 4000.0f; sp40 = -13000.0f; sp3C = 4500.0f; } else if (gCurrentLevel == LEVEL_VENOM_2) { sp40 = -20000.0f; sp38 = 0.4f; - } else if (arg0->obj.id == OBJECT_143) { + } else if (obj58->obj.id == OBJECT_143) { sp44 = 6000.0f; sp40 = -20000.0f; sp3C = 6000.0f; sp38 = 0.9f; } if ((gLevelType == 0) || (gCurrentLevel == LEVEL_BOLSE)) { - Matrix_Translate(gGfxMatrix, arg0->obj.pos.x, arg0->obj.pos.y + D_8017847C, arg0->obj.pos.z, 1); + Matrix_Translate(gGfxMatrix, obj58->obj.pos.x, obj58->obj.pos.y + D_8017847C, obj58->obj.pos.z, 1); } else { - Matrix_Translate(gGfxMatrix, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 1); + Matrix_Translate(gGfxMatrix, obj58->obj.pos.x, obj58->obj.pos.y, obj58->obj.pos.z, 1); } Matrix_MultVec3f(gGfxMatrix, &sp54, &sp48); if ((sp48.z < sp44) && (sp40 < sp48.z)) { if (fabsf(sp48.y) < (fabsf(sp48.z * sp38) + sp3C)) { if (fabsf(sp48.x) < (fabsf(sp48.z * sp38) + sp3C)) { - func_8005F670(&arg0->obj.pos); - if (arg0->obj.id == OBJECT_131) { - Matrix_RotateY(gGfxMatrix, arg0->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, arg0->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, arg0->obj.rot.z * M_DTOR, 1); + func_8005F670(&obj58->obj.pos); + if (obj58->obj.id == OBJECT_131) { + Matrix_RotateY(gGfxMatrix, obj58->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, obj58->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, obj58->obj.rot.z * M_DTOR, 1); Matrix_RotateY(gGfxMatrix, M_PI / 2.0f, 1); Matrix_Translate(gGfxMatrix, -551.0f, 0.0f, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_6007650); } else { - Matrix_RotateY(gGfxMatrix, arg0->obj.rot.y * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, obj58->obj.rot.y * M_DTOR, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, arg0->unk_1C.dList); + gSPDisplayList(gMasterDisp++, obj58->unk_1C.dList); } } } @@ -1527,53 +1526,53 @@ bool func_8005F9DC(Vec3f* arg0) { return false; } -void func_8005FB70(s32 arg0) { +void Object_DrawAll(s32 arg0) { Vec3f spAC; s32 i; s32 pad[5]; // probably separate iterators for each loop - Object_2F4* var_s0_5; - Object_408* var_s0_3; - Object_4C* var_s0_4; - Object_58* var_s0; - Object_6C* var_s0_6; - Object_80* var_s0_2; + Object_2F4* obj2F4; + Object_408* obj408; + Object_4C* obj4C; + Object_58* obj58; + Object_6C* obj6C; + Object_80* obj80; if ((D_80177880 == 1) && (gCurrentLevel != LEVEL_KATINA)) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); if (D_80177AB0 == 5) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); } - for (i = 0, var_s0 = gObjects58; i < 200; i++, var_s0++) { - if ((var_s0->obj.status == 2) && (var_s0->obj.id != OBJECT_147)) { + for (i = 0, obj58 = gObjects58; i < 200; i++, obj58++) { + if ((obj58->obj.status == 2) && (obj58->obj.id != OBJECT_147)) { if (gCurrentLevel == LEVEL_BOLSE) { - spAC.x = var_s0->unk_48.x; - spAC.y = var_s0->unk_48.y; - spAC.z = var_s0->unk_48.z; - Matrix_MultVec3fNoTranslate(&D_E51970_8019EE80, &spAC, &var_s0->obj.pos); - var_s0->obj.rot.y = var_s0->unk_54 + gObjects408->obj.rot.y; + spAC.x = obj58->sfxPos.x; + spAC.y = obj58->sfxPos.y; + spAC.z = obj58->sfxPos.z; + Matrix_MultVec3fNoTranslate(&D_E51970_8019EE80, &spAC, &obj58->obj.pos); + obj58->obj.rot.y = obj58->unk_54 + gObjects408->obj.rot.y; } Matrix_Push(&gGfxMatrix); - func_8005F2F4(var_s0); + Object_58_Draw(obj58); Matrix_Pop(&gGfxMatrix); } } } else { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - for (i = 0, var_s0_2 = gObjects80; i < ARRAY_COUNT(gObjects80); i++, var_s0_2++) { - if (var_s0_2->obj.status >= 2) { + for (i = 0, obj80 = gObjects80; i < ARRAY_COUNT(gObjects80); i++, obj80++) { + if (obj80->obj.status >= 2) { if (arg0 > 0) { - func_8005F670(&var_s0_2->obj.pos); + func_8005F670(&obj80->obj.pos); } Matrix_Push(&gGfxMatrix); - func_8005D654(var_s0_2, arg0); + Object_80_Draw(obj80, arg0); Matrix_Pop(&gGfxMatrix); - func_8005F1EC(&var_s0_2->unk_70); + func_8005F1EC(&obj80->sfxPos); } } } - for (i = 0, var_s0_3 = gObjects408; i < ARRAY_COUNT(gObjects408); i++, var_s0_3++) { - if ((var_s0_3->obj.status >= 2) && (var_s0_3->obj.id != OBJECT_310)) { - if (!(var_s0_3->unk_05C & 1)) { + for (i = 0, obj408 = gObjects408; i < ARRAY_COUNT(gObjects408); i++, obj408++) { + if ((obj408->obj.status >= 2) && (obj408->obj.id != OBJECT_310)) { + if (!(obj408->unk_05C & 1)) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { RCP_SetupDL_27(); @@ -1581,32 +1580,32 @@ void func_8005FB70(s32 arg0) { } func_800597C0(arg0); Matrix_Push(&gGfxMatrix); - func_8005E1B8(var_s0_3, arg0); + Object_408_Draw(obj408, arg0); Matrix_Pop(&gGfxMatrix); - if ((var_s0_3->unk_05E != 0) && (D_801615D0.y > 0.0f)) { + if ((obj408->unk_05E != 0) && (D_801615D0.y > 0.0f)) { Matrix_Push(&gGfxMatrix); - func_8005ECD8(i, &var_s0_3->obj); + func_8005ECD8(i, &obj408->obj); Matrix_Pop(&gGfxMatrix); } } } Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); - for (i = 0, var_s0_4 = gObjects4C; i < ARRAY_COUNT(gObjects4C); i++, var_s0_4++) { - if ((var_s0_4->obj.status >= 2) && (func_80060FE4(&var_s0_4->obj.pos, -12000.0f) != 0)) { + for (i = 0, obj4C = gObjects4C; i < ARRAY_COUNT(gObjects4C); i++, obj4C++) { + if ((obj4C->obj.status >= 2) && (func_80060FE4(&obj4C->obj.pos, -12000.0f) != 0)) { Matrix_Push(&gGfxMatrix); - if ((var_s0_4->obj.id == OBJECT_165) || (var_s0_4->obj.id == OBJECT_166)) { + if ((obj4C->obj.id == OBJECT_165) || (obj4C->obj.id == OBJECT_166)) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } - func_8005D8B8(var_s0_4, arg0); + Object_4C_Draw(obj4C, arg0); Matrix_Pop(&gGfxMatrix); } } - for (i = 0, var_s0_5 = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, var_s0_5++) { - if (var_s0_5->obj.status >= 2) { - if (!(var_s0_5->unk_0C6 & 1)) { + for (i = 0, obj2F4 = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, obj2F4++) { + if (obj2F4->obj.status >= 2) { + if (!(obj2F4->unk_0C6 & 1)) { if (gCurrentLevel == LEVEL_UNK_15) { RCP_SetupDL_23(); } else { @@ -1614,7 +1613,7 @@ void func_8005FB70(s32 arg0) { } } else { RCP_SetupDL_27(); - if (var_s0_5->unk_110 >= 0.0f) { + if (obj2F4->unk_110 >= 0.0f) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 64, 64, 255, 255); @@ -1625,25 +1624,25 @@ void func_8005FB70(s32 arg0) { case 2: Matrix_Push(&gGfxMatrix); if ((gPlayer[0].unk_1C8 == 2) || (gPlayer[0].unk_1C8 == 7) || (gCurrentLevel == LEVEL_AQUAS)) { - func_8005F670(&var_s0_5->obj.pos); + func_8005F670(&obj2F4->obj.pos); } func_800597C0(arg0); - func_8005D954(var_s0_5); + Object_2F4_Draw2(obj2F4); Matrix_Pop(&gGfxMatrix); - if (var_s0_5->unk_0C9 != 0) { + if (obj2F4->unk_0C9 != 0) { Matrix_Push(&gGfxMatrix); - func_8005ECD8(i, &var_s0_5->obj); + func_8005ECD8(i, &obj2F4->obj); Matrix_Pop(&gGfxMatrix); } break; case 1: Matrix_Push(&gGfxMatrix); - func_8005DBC0(var_s0_5); + Object_2F4_Draw1(obj2F4); Matrix_Pop(&gGfxMatrix); - if ((var_s0_5->unk_0C9 != 0) && (D_801615EC != 0) && + if ((obj2F4->unk_0C9 != 0) && (D_801615EC != 0) && ((D_801615E0.z > -4000.0f) || (gCurrentLevel != LEVEL_KATINA))) { Matrix_Push(&gGfxMatrix); - func_8005ECD8(i, &var_s0_5->obj); + func_8005ECD8(i, &obj2F4->obj); Matrix_Pop(&gGfxMatrix); } break; @@ -1653,12 +1652,12 @@ void func_8005FB70(s32 arg0) { gDPSetFogColor(gMasterDisp++, gFogRed, gFogGreen, gFogBlue, gFogAlpha); gSPFogPosition(gMasterDisp++, gFogNear, gFogFar); Lights_SetOneLight(&gMasterDisp, -0x3C, -0x3C, 0x3C, 0x96, 0x96, 0x96, 0x14, 0x14, 0x14); - for (i = 0, var_s0_6 = gObjects6C; i < ARRAY_COUNT(gObjects6C); i++, var_s0_6++) { - if (var_s0_6->obj.status >= 2) { + for (i = 0, obj6C = gObjects6C; i < ARRAY_COUNT(gObjects6C); i++, obj6C++) { + if (obj6C->obj.status >= 2) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x1D); func_800597C0(arg0); - func_8005E7B8(var_s0_6, arg0); + Object_6C_Draw(obj6C, arg0); Matrix_Pop(&gGfxMatrix); } } @@ -1668,43 +1667,43 @@ void func_8005FB70(s32 arg0) { void func_8006046C(s32 arg0) { s32 i; - Object_408* var_s0_2; - Object_8C* var_s0; + Object_408* obj408; + Object_8C* obj8C; RCP_SetupDL(&gMasterDisp, 0x40); - for (i = 0, var_s0 = gObjects8C; i < ARRAY_COUNT(gObjects8C); i++, var_s0++) { - if (var_s0->obj.status >= 2) { - if (var_s0->unk_1C.unk_14 == 1) { - var_s0->obj.rot.y = (-gPlayer[D_801778A0].unk_058 * 180.0f) / M_PI; - var_s0->obj.rot.x = (gPlayer[D_801778A0].unk_05C * 180.0f) / M_PI; + for (i = 0, obj8C = gObjects8C; i < ARRAY_COUNT(gObjects8C); i++, obj8C++) { + if (obj8C->obj.status >= 2) { + if (obj8C->unk_1C.unk_14 == 1) { + obj8C->obj.rot.y = (-gPlayer[D_801778A0].unk_058 * 180.0f) / M_PI; + obj8C->obj.rot.x = (gPlayer[D_801778A0].unk_05C * 180.0f) / M_PI; } if (D_80177880 == 1) { Matrix_Push(&gGfxMatrix); - func_8005E538(var_s0); + Object_8C_Draw2(obj8C); Matrix_Pop(&gGfxMatrix); } else { Matrix_Push(&gGfxMatrix); - func_8005E454(var_s0, arg0); + Object_8C_Draw1(obj8C, arg0); Matrix_Pop(&gGfxMatrix); - func_8005F1EC(&var_s0->unk_80); - if (var_s0->obj.id == OBJECT_374) { + func_8005F1EC(&obj8C->sfxPos); + if (obj8C->obj.id == OBJECT_374) { Matrix_Push(&gGfxMatrix); - func_8005ECD8(i, &var_s0->obj); + func_8005ECD8(i, &obj8C->obj); Matrix_Pop(&gGfxMatrix); } } } } - for (i = 0, var_s0_2 = gObjects408; i < ARRAY_COUNT(gObjects408); i++, var_s0_2++) { - if ((var_s0_2->obj.status >= 2) && (var_s0_2->obj.id == OBJECT_310)) { - if (!(var_s0_2->unk_05C & 1)) { + for (i = 0, obj408 = gObjects408; i < ARRAY_COUNT(gObjects408); i++, obj408++) { + if ((obj408->obj.status >= 2) && (obj408->obj.id == OBJECT_310)) { + if (!(obj408->unk_05C & 1)) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 64, 64, 255, 255); } Matrix_Push(&gGfxMatrix); - func_8005E1B8(var_s0_2, arg0); + Object_408_Draw(obj408, arg0); Matrix_Pop(&gGfxMatrix); } } @@ -1712,14 +1711,14 @@ void func_8006046C(s32 arg0) { void func_80060714(s32 arg0) { D_80161410 = 1; - func_8005FB70(1); + Object_DrawAll(1); if ((D_80161A88 == 2) && (gPlayer[0].unk_1C8 != 2)) { D_80161410 = -1; Lights_SetOneLight(&gMasterDisp, gLight1x, -1 * gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); - func_8005FB70(-1); + Object_DrawAll(-1); Matrix_Pop(&gGfxMatrix); Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); @@ -1807,20 +1806,20 @@ void func_80060968(void) { } void func_80060D94(s32 arg0) { - UnkEntity30* temp_s0 = &gUnkEntities30[arg0]; + UnkEntity30* ent30 = &gUnkEntities30[arg0]; - if (temp_s0->unk_2F == 0xFF) { + if (ent30->unk_2F == 0xFF) { RCP_SetupDL(&gMasterDisp, 5); } else { RCP_SetupDL(&gMasterDisp, 0xE); } - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, temp_s0->unk_2C, temp_s0->unk_2D, temp_s0->unk_2E, temp_s0->unk_2F); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, ent30->unk_2C, ent30->unk_2D, ent30->unk_2E, ent30->unk_2F); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, temp_s0->unk_04.x, temp_s0->unk_04.y, temp_s0->unk_04.z, 1); - Matrix_RotateY(gGfxMatrix, temp_s0->unk_20, 1); - Matrix_RotateX(gGfxMatrix, temp_s0->unk_1C, 1); - Matrix_RotateZ(gGfxMatrix, temp_s0->unk_1C, 1); - Matrix_Scale(gGfxMatrix, temp_s0->unk_28, 1.0f, temp_s0->unk_24, 1); + Matrix_Translate(gGfxMatrix, ent30->unk_04.x, ent30->unk_04.y, ent30->unk_04.z, 1); + Matrix_RotateY(gGfxMatrix, ent30->unk_20, 1); + Matrix_RotateX(gGfxMatrix, ent30->unk_1C, 1); + Matrix_RotateZ(gGfxMatrix, ent30->unk_1C, 1); + Matrix_Scale(gGfxMatrix, ent30->unk_28, 1.0f, ent30->unk_24, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_800CFD80); diff --git a/src/main/fox_enmy.c b/src/main/fox_enmy.c index 78b63048..31e76766 100644 --- a/src/main/fox_enmy.c +++ b/src/main/fox_enmy.c @@ -35,7 +35,7 @@ s32 D_800CFDF4[] = { OBJECT_6C_SILVER_RING, OBJECT_6C_WING_REPAIR, OBJECT_0, - OBJECT_325, + OBJECT_6C_STAR_RING, }; f32 D_800CFE5C[] = { 0.0f, 1.0f, 0.5f, 0.33f, 0.25f, 1.0f, 0.5f, 0.33f, 0.25f, 1.0f, 0.5f, 0.33f, 0.25f, @@ -53,21 +53,21 @@ u32 D_800CFF54[9] = { 0x19404038, 0x19404139, 0x1940423A, 0x1940433B, 0x1940443C, 0x1940453D, 0x1940463E, 0x1940463E, 0x1940463E, }; -void func_80060F30(Vec3f* arg0, u32 arg1, s32 arg2) { +void func_80060F30(Vec3f* pos, u32 sfxId, s32 arg2) { (void) "CHIME SET \n"; (void) "BOMB SET 1\n"; (void) "BOMB SET 2\n"; (void) "center_X %f\n"; (void) "Enm->obj.pos.x %f\n"; if (D_801778E8 == 0) { - func_80019218(arg1, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(sfxId, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else { - func_80019218(arg1, arg0, arg2, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(sfxId, pos, arg2, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } -void Object_Kill(Object* arg0, Vec3f* arg1) { - arg0->status = 0; +void Object_Kill(Object* obj, Vec3f* arg1) { + obj->status = 0; func_8001A500(arg1); } @@ -112,181 +112,181 @@ s32 func_80061148(Vec3f* arg0, f32 arg1) { return false; } -void func_800612B8(ObjectStruct_1C* arg0, u32 arg1) { - *arg0 = D_800CC124[arg1]; - arg0->unk_0C = SEGMENTED_TO_VIRTUAL(D_800CC124[arg1].unk_0C); +void Object_Set1C(ObjectStruct_1C* arg1C, u32 objId) { + *arg1C = D_800CC124[objId]; + arg1C->hitbox = SEGMENTED_TO_VIRTUAL(D_800CC124[objId].hitbox); if (D_80177880 == 2) { - arg0->unk_10 += 200.0f; + arg1C->unk_10 += 200.0f; } } -void Object_80_Initialize(Object_80* arg0) { +void Object_80_Initialize(Object_80* obj80) { s32 i; - u8* var_v0 = (u8*) arg0; + u8* var_v0 = (u8*) obj80; for (i = 0; i < sizeof(Object_80); i++, var_v0++) { *var_v0 = 0; } } -void Object_4C_Initialize(Object_4C* arg0) { +void Object_4C_Initialize(Object_4C* obj4C) { s32 i; - u8* var_v0 = (u8*) arg0; + u8* var_v0 = (u8*) obj4C; for (i = 0; i < sizeof(Object_4C); i++, var_v0++) { *var_v0 = 0; } } -void Object_2F4_Initialize(Object_2F4* arg0) { +void Object_2F4_Initialize(Object_2F4* obj2F4) { s32 i; - u8* var_v0 = (u8*) arg0; + u8* var_v0 = (u8*) obj2F4; for (i = 0; i < sizeof(Object_2F4); i++, var_v0++) { *var_v0 = 0; } - arg0->unk_110 = 1.0f; + obj2F4->unk_110 = 1.0f; } -void Object_408_Initialize(Object_408* arg0) { +void Object_408_Initialize(Object_408* obj408) { s32 i; - u8* var_v0 = (u8*) arg0; + u8* var_v0 = (u8*) obj408; for (i = 0; i < sizeof(Object_408); i++, var_v0++) { *var_v0 = 0; } - arg0->unk_3F8 = 1.0f; + obj408->unk_3F8 = 1.0f; } -void Object_6C_Initialize(Object_6C* arg0) { +void Object_6C_Initialize(Object_6C* obj6C) { s32 i; - u8* var_v0 = (u8*) arg0; + u8* var_v0 = (u8*) obj6C; for (i = 0; i < sizeof(Object_6C); i++, var_v0++) { *var_v0 = 0; } } -void Object_8C_Initialize(Object_8C* arg0) { +void Object_8C_Initialize(Object_8C* obj8C) { s32 i; - u8* var_v0 = (u8*) arg0; + u8* var_v0 = (u8*) obj8C; for (i = 0; i < sizeof(Object_8C); i++, var_v0++) { *var_v0 = 0; } - arg0->unk_70 = 1.0f; + obj8C->unk_70 = 1.0f; } -void func_800614B4(Object_80* arg0, ObjectInit* arg1) { - Object_80_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.pos.z = -arg1->zPos1; - arg0->obj.pos.z += -3000.0f + arg1->zPos2; - arg0->obj.pos.x = arg1->xPos; - arg0->obj.pos.y = arg1->yPos; - arg0->obj.rot.x = arg1->unk_A; - arg0->obj.rot.y = arg1->unk_C; - arg0->obj.rot.z = arg1->unk_E; - arg0->obj.id = arg1->id; - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void Object_80_Spawn(Object_80* obj80, ObjectInit* objInit) { + Object_80_Initialize(obj80); + obj80->obj.status = 1; + obj80->obj.pos.z = -objInit->zPos1; + obj80->obj.pos.z += -3000.0f + objInit->zPos2; + obj80->obj.pos.x = objInit->xPos; + obj80->obj.pos.y = objInit->yPos; + obj80->obj.rot.x = objInit->unk_A; + obj80->obj.rot.y = objInit->unk_C; + obj80->obj.rot.z = objInit->unk_E; + obj80->obj.id = objInit->id; + Object_Set1C(&obj80->unk_1C, obj80->obj.id); } -void func_800615A0(Object_4C* arg0, ObjectInit* arg1) { - Object_4C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.pos.z = -arg1->zPos1; - arg0->obj.pos.z += -3000.0f + arg1->zPos2; - arg0->obj.pos.x = arg1->xPos; - arg0->obj.pos.y = arg1->yPos; - arg0->obj.rot.y = arg1->unk_C; - arg0->obj.rot.x = arg1->unk_A; - arg0->obj.rot.z = arg1->unk_E; - arg0->obj.id = arg1->id; - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void Object_4C_Spawn(Object_4C* obj4C, ObjectInit* objInit) { + Object_4C_Initialize(obj4C); + obj4C->obj.status = 1; + obj4C->obj.pos.z = -objInit->zPos1; + obj4C->obj.pos.z += -3000.0f + objInit->zPos2; + obj4C->obj.pos.x = objInit->xPos; + obj4C->obj.pos.y = objInit->yPos; + obj4C->obj.rot.y = objInit->unk_C; + obj4C->obj.rot.x = objInit->unk_A; + obj4C->obj.rot.z = objInit->unk_E; + obj4C->obj.id = objInit->id; + Object_Set1C(&obj4C->unk_1C, obj4C->obj.id); } -void func_8006168C(Object_2F4* arg0, ObjectInit* arg1) { - Object_2F4_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.pos.z = -arg1->zPos1; - arg0->obj.pos.z += -3000.0f + arg1->zPos2; - arg0->obj.pos.x = arg1->xPos; - arg0->obj.pos.y = arg1->yPos; - arg0->obj.rot.y = arg1->unk_C; - arg0->obj.rot.x = arg1->unk_A; - arg0->obj.rot.z = arg1->unk_E; - arg0->obj.id = arg1->id; - func_800612B8(&arg0->unk_01C, arg0->obj.id); +void Object_2F4_Spawn(Object_2F4* obj2F4, ObjectInit* objInit) { + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 1; + obj2F4->obj.pos.z = -objInit->zPos1; + obj2F4->obj.pos.z += -3000.0f + objInit->zPos2; + obj2F4->obj.pos.x = objInit->xPos; + obj2F4->obj.pos.y = objInit->yPos; + obj2F4->obj.rot.y = objInit->unk_C; + obj2F4->obj.rot.x = objInit->unk_A; + obj2F4->obj.rot.z = objInit->unk_E; + obj2F4->obj.id = objInit->id; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); } -void func_80061778(Object_408* arg0, ObjectInit* arg1) { - Object_408_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.pos.z = -arg1->zPos1; - arg0->obj.pos.z += -3000.0f + arg1->zPos2; - arg0->obj.pos.x = arg1->xPos; - arg0->obj.pos.y = arg1->yPos; - arg0->obj.rot.y = arg1->unk_C; - arg0->obj.rot.x = arg1->unk_A; - arg0->obj.rot.z = arg1->unk_E; - arg0->obj.id = arg1->id; - func_800612B8(&arg0->unk_01C, arg0->obj.id); +void Object_408_Spawn(Object_408* obj408, ObjectInit* objInit) { + Object_408_Initialize(obj408); + obj408->obj.status = 1; + obj408->obj.pos.z = -objInit->zPos1; + obj408->obj.pos.z += -3000.0f + objInit->zPos2; + obj408->obj.pos.x = objInit->xPos; + obj408->obj.pos.y = objInit->yPos; + obj408->obj.rot.y = objInit->unk_C; + obj408->obj.rot.x = objInit->unk_A; + obj408->obj.rot.z = objInit->unk_E; + obj408->obj.id = objInit->id; + Object_Set1C(&obj408->unk_01C, obj408->obj.id); } -void func_80061864(Object_6C* arg0, ObjectInit* arg1) { - Object_6C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.pos.z = -arg1->zPos1; - arg0->obj.pos.z += -3000.0f + arg1->zPos2; - arg0->obj.pos.x = arg1->xPos; - arg0->obj.pos.y = arg1->yPos; - arg0->obj.rot.y = arg1->unk_C; - arg0->obj.rot.x = arg1->unk_A; - arg0->obj.rot.z = arg1->unk_E; - arg0->obj.id = arg1->id; - arg0->unk_68 = 1.0f; - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void Object_6C_Spawn(Object_6C* obj6C, ObjectInit* objInit) { + Object_6C_Initialize(obj6C); + obj6C->obj.status = 1; + obj6C->obj.pos.z = -objInit->zPos1; + obj6C->obj.pos.z += -3000.0f + objInit->zPos2; + obj6C->obj.pos.x = objInit->xPos; + obj6C->obj.pos.y = objInit->yPos; + obj6C->obj.rot.y = objInit->unk_C; + obj6C->obj.rot.x = objInit->unk_A; + obj6C->obj.rot.z = objInit->unk_E; + obj6C->obj.id = objInit->id; + obj6C->unk_68 = 1.0f; + Object_Set1C(&obj6C->unk_1C, obj6C->obj.id); } -void func_80061958(Object_8C* arg0, f32 arg1, f32 arg2, f32 arg3) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_346; - arg0->unk_50 = 50; - arg0->unk_70 = 0.2f; +void func_80061958(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_346; + obj8C->unk_50 = 50; + obj8C->unk_70 = 0.2f; if (gCurrentLevel == LEVEL_AQUAS) { - arg0->unk_50 = 200; - arg0->unk_70 = 0.3f; - arg0->unk_6C = Rand_ZeroOne() * 255.0f; + obj8C->unk_50 = 200; + obj8C->unk_70 = 0.3f; + obj8C->unk_6C = Rand_ZeroOne() * 255.0f; } - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->obj.rot.z = Rand_ZeroOne() * 360.0f; - func_800612B8(&arg0->unk_1C, arg0->obj.id); + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); if (gLevelType == 0) { - arg0->unk_1C.unk_10 = 100.0f; + obj8C->unk_1C.unk_10 = 100.0f; } } void func_80061A4C(void) { s32 i; - f32 sp28; - f32 sp24; - f32 sp20; + f32 x; + f32 y; + f32 z; f32 sp1C; for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { if (gObjects8C[i].obj.status == 0) { sp1C = (Rand_ZeroOne() - 0.5f); - sp28 = gPlayer[0].unk_074 + (sp1C * 400.0f) + (5.0f * gPlayer[0].unk_0C0.x); + x = gPlayer[0].unk_074 + (sp1C * 400.0f) + (5.0f * gPlayer[0].unk_0C0.x); sp1C = (Rand_ZeroOne() - 0.5f); - sp24 = gPlayer[0].unk_078 + (sp1C * 400.0f) + (5.0f * gPlayer[0].unk_0C0.y); - sp20 = -D_80177D20 - 500.0f; + y = gPlayer[0].unk_078 + (sp1C * 400.0f) + (5.0f * gPlayer[0].unk_0C0.y); + z = -D_80177D20 - 500.0f; if (D_80177D08 < 0.0f) { - sp20 = -D_80177D20 + 500.0f; + z = -D_80177D20 + 500.0f; } - func_80061958(&gObjects8C[i], sp28, sp24, sp20); + func_80061958(&gObjects8C[i], x, y, z); break; } } @@ -294,26 +294,26 @@ void func_80061A4C(void) { void func_80061B68(void) { s32 i; - f32 sp28; - f32 sp24; - f32 sp20; + f32 x; + f32 y; + f32 z; f32 sp1C; for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { if (gObjects8C[i].obj.status == 0) { sp1C = (Rand_ZeroOne() - 0.5f); - sp28 = gPlayer[0].unk_074 + (sp1C * 2000.0f) + (5.0f * gPlayer[0].unk_0C0.x); - sp24 = 0; - while (sp24 <= D_80177940) { + x = gPlayer[0].unk_074 + (sp1C * 2000.0f) + (5.0f * gPlayer[0].unk_0C0.x); + y = 0; + while (y <= D_80177940) { sp1C = (Rand_ZeroOne() - 0.5f); - sp24 = gPlayer[0].unk_078 + (sp1C * 2000.0f) + (5.0f * gPlayer[0].unk_0C0.y); + y = gPlayer[0].unk_078 + (sp1C * 2000.0f) + (5.0f * gPlayer[0].unk_0C0.y); } - sp20 = -D_80177D20 - 3000.0f; + z = -D_80177D20 - 3000.0f; if (D_80177D08 < 0.0f) { - sp20 = -D_80177D20 + 1000.0f; + z = -D_80177D20 + 1000.0f; } - func_80061958(&gObjects8C[i], sp28, sp24, sp20); + func_80061958(&gObjects8C[i], x, y, z); break; } } @@ -321,144 +321,143 @@ void func_80061B68(void) { void func_80061CD0(void) { s32 i; - f32 sp28; - f32 sp24; - f32 sp20; + f32 x; + f32 y; + f32 z; f32 sp1C; for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { if (gObjects8C[i].obj.status == 0) { sp1C = (Rand_ZeroOne() - 0.5f); - sp28 = gPlayer[D_801778A0].unk_074 + (sp1C * 3000.0f) + (5.0f * gPlayer[D_801778A0].unk_0C0.x); + x = gPlayer[D_801778A0].unk_074 + (sp1C * 3000.0f) + (5.0f * gPlayer[D_801778A0].unk_0C0.x); sp1C = (Rand_ZeroOne() - 0.5f); - sp24 = gPlayer[D_801778A0].unk_078 + 1000.0f + (sp1C * 500.0f) + (5.0f * gPlayer[D_801778A0].unk_0C0.y); - sp20 = -D_80177D20 - 2000.0f * Rand_ZeroOne(); + y = gPlayer[D_801778A0].unk_078 + 1000.0f + (sp1C * 500.0f) + (5.0f * gPlayer[D_801778A0].unk_0C0.y); + z = -D_80177D20 - 2000.0f * Rand_ZeroOne(); if (D_80177D08 < 0.0f) { - sp20 = -D_80177D20 + 1000.0f; + z = -D_80177D20 + 1000.0f; } - func_80061958(&gObjects8C[i], sp28, sp24, sp20); + func_80061958(&gObjects8C[i], x, y, z); break; } } } -void func_80061E48(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3) { - Object_2F4_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_181; +void func_80061E48(Object_2F4* obj2F4, f32 xPos, f32 yPos, f32 zPos) { + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 1; + obj2F4->obj.id = OBJECT_181; if (Rand_ZeroOne() < 0.5f) { - arg0->obj.id = OBJECT_186; + obj2F4->obj.id = OBJECT_186; } if (Rand_ZeroOne() < 0.5f) { - arg0->obj.id = OBJECT_182; + obj2F4->obj.id = OBJECT_182; } - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->unk_0E8.z = 10.0f; - func_800612B8(&arg0->unk_01C, arg0->obj.id); + obj2F4->obj.pos.x = xPos; + obj2F4->obj.pos.y = yPos; + obj2F4->obj.pos.z = zPos; + obj2F4->unk_0E8.z = 10.0f; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); } -void func_80061F0C(Object_2F4* arg0, ObjectInit* arg1, s32 arg2) { +void func_80061F0C(Object_2F4* obj2F4, ObjectInit* objInit, s32 arg2) { Vec3f sp24; - Object_2F4_Initialize(arg0); - arg0->obj.status = 2; - arg0->unk_040 = arg2; - arg0->obj.pos.z = -arg1->zPos1; - arg0->obj.pos.z += -3000.0f + arg1->zPos2; - arg0->obj.pos.x = arg1->xPos; - arg0->obj.pos.y = arg1->yPos; - arg0->obj.rot.y = arg0->unk_0F4.y = arg1->unk_C; - arg0->obj.rot.x = arg0->unk_0F4.x = arg1->unk_A; - arg0->unk_0F4.z = arg1->unk_E; - arg0->obj.id = OBJECT_200; - arg0->unk_0C2 = 10; - arg0->unk_0B4 = 4095; - arg0->unk_0E4 = arg1->id - OBJECT_UNK_1000; + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 2; + obj2F4->unk_040 = arg2; + obj2F4->obj.pos.z = -objInit->zPos1; + obj2F4->obj.pos.z += -3000.0f + objInit->zPos2; + obj2F4->obj.pos.x = objInit->xPos; + obj2F4->obj.pos.y = objInit->yPos; + obj2F4->obj.rot.y = obj2F4->unk_0F4.y = objInit->unk_C; + obj2F4->obj.rot.x = obj2F4->unk_0F4.x = objInit->unk_A; + obj2F4->unk_0F4.z = objInit->unk_E; + obj2F4->obj.id = OBJECT_200; + obj2F4->unk_0C2 = 10; + obj2F4->unk_0B4 = 4095; + obj2F4->unk_0E4 = objInit->id - OBJECT_UNK_1000; - func_800612B8(&arg0->unk_01C, arg0->obj.id); - arg0->unk_01C.unk_10 = 3000.0f; - arg0->unk_178 = 20000.0f; - arg0->unk_054 = D_80177E70; - arg0->unk_078 = gObjects2F4[D_80177E70].unk_0E4; - arg0->unk_16C = D_80161A54; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); + obj2F4->unk_01C.unk_10 = 3000.0f; + obj2F4->unk_178 = 20000.0f; + obj2F4->unk_054 = D_80177E70; + obj2F4->unk_078 = gObjects2F4[D_80177E70].unk_0E4; + obj2F4->unk_16C = D_80161A54; Matrix_RotateZ(gCalcMatrix, -D_80177E88.z * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, -D_80177E88.x * M_DTOR, 1); Matrix_RotateY(gCalcMatrix, -D_80177E88.y * M_DTOR, 1); - sp24.x = arg0->obj.pos.x - D_80177F10.x; - sp24.y = arg0->obj.pos.y - D_80177F10.y; - sp24.z = arg0->obj.pos.z - D_80177F10.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp24, &arg0->unk_2DC); - arg0->unk_074 = D_80177E78; + sp24.x = obj2F4->obj.pos.x - D_80177F10.x; + sp24.y = obj2F4->obj.pos.y - D_80177F10.y; + sp24.z = obj2F4->obj.pos.z - D_80177F10.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp24, &obj2F4->unk_2DC); + obj2F4->unk_074 = D_80177E78; D_80177E70 = arg2; - func_80069AAC(arg0); + Object_2F4_Update(obj2F4); } -void func_80062180(ObjectInit* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { - f32 temp_fv0; +void Object_Spawn(ObjectInit* objInit, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { s32 i; - if ((arg1 > arg0->xPos - gPlayer[0].unk_0AC) && (arg0->xPos - gPlayer[0].unk_0AC > arg2) && - (arg3 > arg0->yPos - gPlayer[0].unk_0B0) && (arg0->yPos - gPlayer[0].unk_0B0 > arg4)) { - if (arg0->id < OBJECT_161) { + if ((arg1 > objInit->xPos - gPlayer[0].unk_0AC) && (objInit->xPos - gPlayer[0].unk_0AC > arg2) && + (arg3 > objInit->yPos - gPlayer[0].unk_0B0) && (objInit->yPos - gPlayer[0].unk_0B0 > arg4)) { + if (objInit->id < OBJECT_161) { for (i = 0; i < ARRAY_COUNT(gObjects80); i++) { if (gObjects80[i].obj.status == 0) { - func_800614B4(&gObjects80[i], arg0); + Object_80_Spawn(&gObjects80[i], objInit); break; } } } - if ((arg0->id >= OBJECT_161) && (arg0->id < OBJECT_176)) { + if ((objInit->id >= OBJECT_161) && (objInit->id < OBJECT_176)) { for (i = 0; i < ARRAY_COUNT(gObjects4C); i++) { if (gObjects4C[i].obj.status == 0) { - func_800615A0(&gObjects4C[i], arg0); + Object_4C_Spawn(&gObjects4C[i], objInit); break; } } } - if ((arg0->id >= OBJECT_176) && (arg0->id < OBJECT_292)) { - if ((arg0->id == OBJECT_267) || (arg0->id == OBJECT_254)) { + if ((objInit->id >= OBJECT_176) && (objInit->id < OBJECT_292)) { + if ((objInit->id == OBJECT_267) || (objInit->id == OBJECT_254)) { for (i = ARRAY_COUNT(gObjects2F4) - 1; i >= 0; i--) { if (gObjects2F4[i].obj.status == 0) { - func_8006168C(&gObjects2F4[i], arg0); + Object_2F4_Spawn(&gObjects2F4[i], objInit); break; } } - } else if (arg0->id == OBJECT_198) { + } else if (objInit->id == OBJECT_198) { for (i = 0; i < 3; i++) { if (gObjects2F4[i].obj.status == 0) { - func_8006168C(&gObjects2F4[i], arg0); + Object_2F4_Spawn(&gObjects2F4[i], objInit); break; } } } else { for (i = 4; i < ARRAY_COUNT(gObjects2F4); i++) { if (gObjects2F4[i].obj.status == 0) { - func_8006168C(&gObjects2F4[i], arg0); + Object_2F4_Spawn(&gObjects2F4[i], objInit); break; } } } } - if ((arg0->id >= OBJECT_292) && (arg0->id < OBJECT_6C_LASERS)) { + if ((objInit->id >= OBJECT_292) && (objInit->id < OBJECT_6C_LASERS)) { for (i = 0; i < ARRAY_COUNT(gObjects408); i++) { if (gObjects408[i].obj.status == 0) { - func_80061778(&gObjects408[i], arg0); + Object_408_Spawn(&gObjects408[i], objInit); break; } } } - if ((arg0->id >= OBJECT_6C_LASERS) && (arg0->id < OBJECT_339)) { + if ((objInit->id >= OBJECT_6C_LASERS) && (objInit->id < OBJECT_339)) { for (i = 0; i < ARRAY_COUNT(gObjects6C); i++) { if (gObjects6C[i].obj.status == 0) { - func_80061864(&gObjects6C[i], arg0); + Object_6C_Spawn(&gObjects6C[i], objInit); break; } } } - if (arg0->id >= OBJECT_339 && arg0->id <= OBJECT_UNK_406) { - switch (arg0->id) { + if (objInit->id >= OBJECT_339 && objInit->id <= OBJECT_UNK_406) { + switch (objInit->id) { case OBJECT_UNK_403: D_E6A810_801BA1E8 = 99; break; @@ -469,8 +468,8 @@ void func_80062180(ObjectInit* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { D_E6A810_801BA1E8 = 98; break; case OBJECT_UNK_402: - D_E9F1D0_801A7F78 = arg0->unk_E * 0.1f; - D_E9F1D0_801A7F60 = -(f32) arg0->unk_A; + D_E9F1D0_801A7F78 = objInit->unk_E * 0.1f; + D_E9F1D0_801A7F60 = -(f32) objInit->unk_A; break; case OBJECT_UNK_400: D_801782B8++; @@ -483,10 +482,10 @@ void func_80062180(ObjectInit* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { break; } } - if (arg0->id > OBJECT_UNK_406) { + if (objInit->id > OBJECT_UNK_406) { for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { if (gObjects2F4[i].obj.status == 0) { - func_80061F0C(&gObjects2F4[i], arg0, i); + func_80061F0C(&gObjects2F4[i], objInit, i); break; } } @@ -504,12 +503,12 @@ void func_80062568(void) { var_s1 = &D_80178310[var_s0]; for (; var_s0 < D_80177CA0; var_s0++, var_s1++) { - func_80062180(var_s1, 4000.0f, -4000.0f, 4000.0f, -4000.0f); + Object_Spawn(var_s1, 4000.0f, -4000.0f, 4000.0f, -4000.0f); } } void func_80062664(void) { - ObjectInit* var_s0_2; + ObjectInit* objInit; f32 var_fs1; f32 var_fs2; f32 var_fs3; @@ -559,16 +558,15 @@ void func_80062664(void) { } D_80161680 = 0; - for (i = 0, var_s0_2 = &D_80178310[D_80177DC8]; i < 10000; i++, D_80177DC8++, var_s0_2++) { - if ((var_s0_2->id > OBJECT_INVALID) && D_80177D20 <= var_s0_2->zPos1 && - var_s0_2->zPos1 <= D_80177D20 + 200.0f) { - if ((gCurrentLevel == LEVEL_VENOM_1) && (var_s0_2->id >= OBJECT_UNK_1000)) { - if (((var_s0_2->unk_C < 180.0f) && (var_s0_2->xPos < gPlayer[0].unk_0AC)) || - ((var_s0_2->unk_C > 180.0f) && (gPlayer[0].unk_0AC < var_s0_2->xPos))) { - func_80062180(var_s0_2, var_fs1, var_fs2, var_fs3, var_fs4); + for (i = 0, objInit = &D_80178310[D_80177DC8]; i < 10000; i++, D_80177DC8++, objInit++) { + if ((objInit->id > OBJECT_INVALID) && D_80177D20 <= objInit->zPos1 && objInit->zPos1 <= D_80177D20 + 200.0f) { + if ((gCurrentLevel == LEVEL_VENOM_1) && (objInit->id >= OBJECT_UNK_1000)) { + if (((objInit->unk_C < 180.0f) && (objInit->xPos < gPlayer[0].unk_0AC)) || + ((objInit->unk_C > 180.0f) && (gPlayer[0].unk_0AC < objInit->xPos))) { + Object_Spawn(objInit, var_fs1, var_fs2, var_fs3, var_fs4); } } else { - func_80062180(var_s0_2, var_fs1, var_fs2, var_fs3, var_fs4); + Object_Spawn(objInit, var_fs1, var_fs2, var_fs3, var_fs4); } } else { break; @@ -576,7 +574,7 @@ void func_80062664(void) { } } -void func_80062B60(f32 arg0, f32 arg1, s32 arg2, f32 arg3) { +void func_80062B60(f32 xPos, f32 zPos, s32 arg2, f32 arg3) { s32 i; if (gLevelType == 0) { @@ -585,21 +583,21 @@ void func_80062B60(f32 arg0, f32 arg1, s32 arg2, f32 arg3) { Object_8C_Initialize(&gObjects8C[i]); gObjects8C[i].obj.status = 1; gObjects8C[i].obj.id = OBJECT_348; - gObjects8C[i].obj.pos.x = arg0; + gObjects8C[i].obj.pos.x = xPos; gObjects8C[i].obj.pos.y = D_80177940 + 3.0f; - gObjects8C[i].obj.pos.z = arg1; + gObjects8C[i].obj.pos.z = zPos; gObjects8C[i].unk_70 = 10.0f; gObjects8C[i].unk_6C = arg3; gObjects8C[i].unk_44 = 80; gObjects8C[i].unk_4E = arg2; - func_800612B8(&gObjects8C[i].unk_1C, gObjects8C[i].obj.id); + Object_Set1C(&gObjects8C[i].unk_1C, gObjects8C[i].obj.id); break; } } } } -void func_80062C38(f32 arg0, f32 arg1) { +void func_80062C38(f32 xPos, f32 yPos) { s32 i; if (gLevelType == 0) { @@ -608,20 +606,20 @@ void func_80062C38(f32 arg0, f32 arg1) { Object_8C_Initialize(&gObjects8C[i]); gObjects8C[i].obj.status = 1; gObjects8C[i].obj.id = OBJECT_349; - gObjects8C[i].obj.pos.x = arg0; + gObjects8C[i].obj.pos.x = xPos; gObjects8C[i].obj.pos.y = D_80177940 + 3.0f; - gObjects8C[i].obj.pos.z = arg1; + gObjects8C[i].obj.pos.z = yPos; gObjects8C[i].unk_70 = 1.0f; gObjects8C[i].unk_6C = 1.3f; gObjects8C[i].unk_44 = 120; - func_800612B8(&gObjects8C[i].unk_1C, gObjects8C[i].obj.id); + Object_Set1C(&gObjects8C[i].unk_1C, gObjects8C[i].obj.id); break; } } } } -void func_80062D04(f32 arg0, f32 arg1) { +void func_80062D04(f32 xPos, f32 yPos) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { @@ -629,95 +627,91 @@ void func_80062D04(f32 arg0, f32 arg1) { Object_8C_Initialize(&gObjects8C[i]); gObjects8C[i].obj.status = 1; gObjects8C[i].obj.id = OBJECT_350; - gObjects8C[i].obj.pos.x = arg0; + gObjects8C[i].obj.pos.x = xPos; gObjects8C[i].obj.pos.y = D_80177940 + 3.0f; - gObjects8C[i].obj.pos.z = arg1; + gObjects8C[i].obj.pos.z = yPos; gObjects8C[i].unk_70 = 3.0f; gObjects8C[i].unk_6C = 2.0f; gObjects8C[i].unk_44 = 120; - func_800612B8(&gObjects8C[i].unk_1C, gObjects8C[i].obj.id); + Object_Set1C(&gObjects8C[i].unk_1C, gObjects8C[i].obj.id); break; } } } -s32 func_80062DBC(Vec3f* arg0, f32* var_s0, Object* arg2, f32 arg3, f32 arg4, f32 arg5) { - f32 temp_fv1; - f32 var_fa0; - f32 var_fa1; - f32 var_fs1; - f32 var_fs2; - f32 var_ft4; - f32 var_ft5; - f32 var_fv0; - s32 temp_ft1; +s32 func_80062DBC(Vec3f* pos, f32* hitboxData, Object* obj, f32 xRot, f32 yRot, f32 zRot) { + s32 var_s4; + Vec3f hitRot; + Vec3f hitPos; + f32 rotate; + s32 boxCount; Vec3f sp80; Vec3f sp74; - s32 var_s4; + Hitbox* hitbox; - temp_ft1 = var_s0[0]; - var_s0++; - if (temp_ft1 != 0) { - for (var_s4 = 0; var_s4 < temp_ft1; var_s4++) { - var_fv0 = 0.0f; - var_fa0 = 0.0f; - var_fs2 = 0.0f; - var_fs1 = 0.0f; - if (var_s0[0] >= 300000.0f) { + boxCount = *hitboxData++; + if (boxCount != 0) { + for (var_s4 = 0; var_s4 < boxCount; var_s4++) { + rotate = 0.0f; + hitRot.x = hitRot.y = hitRot.z = 0.0f; + if (*hitboxData >= 300000.0f) { return 0; } - if (var_s0[0] == 200000.0f) { - var_fv0 = 1.0f; - var_fs1 = var_s0[1]; - var_fs2 = var_s0[2]; - var_fa0 = var_s0[3]; - var_s0 += 4; + if (*hitboxData == 200000.0f) { + hitboxData++; + rotate = 1.0f; + hitRot.x = *hitboxData++; + hitRot.y = *hitboxData++; + hitRot.z = *hitboxData++; } - if ((arg2->rot.y == 0.0f) && (arg2->rot.z == 0.0f) && (arg2->rot.x == 0.0f) && (var_fv0 == 0.0f)) { - var_fa1 = arg0->x; - var_ft4 = arg0->y; - var_ft5 = arg0->z; + if ((obj->rot.y == 0.0f) && (obj->rot.z == 0.0f) && (obj->rot.x == 0.0f) && (rotate == 0.0f)) { + hitPos.x = pos->x; + hitPos.y = pos->y; + hitPos.z = pos->z; } else { - Matrix_RotateZ(gCalcMatrix, -var_fa0 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -var_fs1 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -var_fs2 * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -arg2->rot.z * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -arg2->rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -arg2->rot.y * M_DTOR, 1); - if ((arg3 != 0.0f) || (arg4 != 0.0f) || (arg5 != 0.0f)) { - Matrix_RotateZ(gCalcMatrix, -arg5 * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -arg3 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -arg4 * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -hitRot.z * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, -hitRot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -hitRot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -obj->rot.z * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -obj->rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, 1); + if ((xRot != 0.0f) || (yRot != 0.0f) || (zRot != 0.0f)) { + Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, 1); } - sp80.x = arg0->x - arg2->pos.x; - sp80.y = arg0->y - arg2->pos.y; - sp80.z = arg0->z - arg2->pos.z; + sp80.x = pos->x - obj->pos.x; + sp80.y = pos->y - obj->pos.y; + sp80.z = pos->z - obj->pos.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp80, &sp74); - var_fa1 = arg2->pos.x + sp74.x; - var_ft4 = arg2->pos.y + sp74.y; - var_ft5 = arg2->pos.z + sp74.z; + hitPos.x = obj->pos.x + sp74.x; + hitPos.y = obj->pos.y + sp74.y; + hitPos.z = obj->pos.z + sp74.z; } - if ((var_s0[1] + 20.0f) > (fabsf((var_s0[0] + arg2->pos.z) - var_ft5)) && - ((var_s0[5] + 20.0f) > fabsf((var_s0[4] + arg2->pos.x) - var_fa1)) && - ((var_s0[3] + 10.0f) > fabsf((var_s0[2] + arg2->pos.y) - var_ft4))) { + hitbox = (Hitbox*) hitboxData; + if (((hitbox->z.size + 20.0f) > fabsf(hitbox->z.offset + obj->pos.z - hitPos.z)) && + ((hitbox->x.size + 20.0f) > fabsf(hitbox->x.offset + obj->pos.x - hitPos.x)) && + ((hitbox->y.size + 10.0f) > fabsf(hitbox->y.offset + obj->pos.y - hitPos.y))) { return true; } - var_s0 += 6; + hitboxData += 6; } } return false; } -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)) && - (fabsf((arg1[3] + arg2->y) - arg0->y) < (arg1[4] + 20.0f))) { - return true; +s32 func_800631A8(Vec3f* posD, f32* hitboxData, Vec3f* posA) { + if ((s32) hitboxData[0] != 0) { + if ((fabsf(hitboxData[1] + posA->z - posD->z) < (hitboxData[2] + 20.0f)) && + (fabsf(hitboxData[5] + posA->x - posD->x) < (hitboxData[6] + 20.0f)) && + (fabsf(hitboxData[3] + posA->y - posD->y) < (hitboxData[4] + 20.0f))) { + return true; + } } return false; } -s32 func_8006326C(Vec3f* arg0, Vec3f* arg1, s32 arg2, Object* arg3) { +s32 func_8006326C(Vec3f* arg0, Vec3f* arg1, s32 objId, Object* obj) { Vec3f sp74; Vec3f sp68; Vec3f sp5C; @@ -728,35 +722,35 @@ s32 func_8006326C(Vec3f* arg0, Vec3f* arg1, s32 arg2, Object* arg3) { f32 sp30; s32 pad2; - sp74.x = arg0->x - arg3->pos.x; - 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(gCalcMatrix, -arg3->rot.y * M_DTOR, 0); + sp74.x = arg0->x - obj->pos.x; + sp74.z = arg0->z - obj->pos.z; + if (((fabsf(sp74.x) < 1100.0f) && (fabsf(sp74.z) < 1100.0f)) || (objId == OBJECT_180)) { + sp74.y = arg0->y - obj->pos.y; + Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp74, &sp68); - sp5C.x = arg3->pos.x + sp68.x; - sp5C.y = arg3->pos.y + sp68.y; - sp5C.z = arg3->pos.z + sp68.z; - sp50.x = arg3->pos.x; - sp50.y = arg3->pos.y; - sp50.z = arg3->pos.z; - if ((arg2 == 180) || (arg2 == 149) || (arg2 == 150) || (arg2 == 308) || (arg2 == 313) || (arg2 == 312) || - (arg2 == 309) || (arg2 == 39)) { + sp5C.x = obj->pos.x + sp68.x; + sp5C.y = obj->pos.y + sp68.y; + sp5C.z = obj->pos.z + sp68.z; + sp50.x = obj->pos.x; + sp50.y = obj->pos.y; + sp50.z = obj->pos.z; + if ((objId == OBJECT_180) || (objId == OBJECT_149) || (objId == OBJECT_150) || (objId == OBJECT_308) || + (objId == OBJECT_313) || (objId == OBJECT_312) || (objId == OBJECT_309) || (objId == OBJECT_39)) { var_s1 = 0; - if (arg2 == 312) { + if (objId == OBJECT_312) { var_s1 = 9; } - if (arg2 == 39) { + if (objId == OBJECT_39) { var_s1 = 1; - } else if (arg2 == 308) { + } else if (objId == OBJECT_308) { var_s1 = 4; - } else if (arg2 == 309) { + } else if (objId == OBJECT_309) { var_s1 = 7; - } else if (arg2 == 149) { + } else if (objId == OBJECT_149) { var_s1 = 5; - } else if (arg2 == 150) { + } else if (objId == OBJECT_150) { var_s1 = 6; - } else if (arg2 == 313) { + } else if (objId == OBJECT_313) { var_s1 = 8; } if (func_800998FC(&sp5C, &sp50, arg1, var_s1, &sp44, &sp30) > 0) { @@ -764,24 +758,24 @@ s32 func_8006326C(Vec3f* arg0, Vec3f* arg1, s32 arg2, Object* arg3) { } } else { var_s1 = 0; - if (arg2 == 2) { + if (objId == OBJECT_2) { var_s1 = 2; } - if (arg2 == 3) { + if (objId == OBJECT_3) { var_s1 = 3; } - if (arg2 == 140) { + if (objId == OBJECT_140) { var_s1 = 4; } - if (arg2 == 141) { + if (objId == OBJECT_141) { var_s1 = 6; } - if (arg2 == 117) { + if (objId == OBJECT_117) { var_s1 = 14; - } else if ((arg2 == 4) || (arg2 == 5)) { + } else if ((objId == OBJECT_4) || (objId == OBJECT_5)) { var_s1 = 1; } - if (func_800A3690(&sp5C, &sp50, var_s1, &sp44) != 0) { + if (func_800A3690(&sp5C, &sp50, var_s1, &sp44)) { return true; } } @@ -789,93 +783,89 @@ s32 func_8006326C(Vec3f* arg0, Vec3f* arg1, s32 arg2, Object* arg3) { return false; } -s32 func_8006351C(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { - Object_58* var_s0; - Object_80* var_s0_2; - Object_4C* var_s0_3; - Object_408* var_s0_4; - Object_2F4* var_s0_5; +s32 func_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { + Object_58* obj58; + Object_80* obj80; + Object_4C* obj4C; + Object_408* obj408; + Object_2F4* obj2F4; Vec3f temp; s32 i; if ((D_80177880 == 1) && (gCurrentLevel != LEVEL_KATINA)) { - var_s0 = gObjects58; - for (i = 0; i < 200; i++, var_s0++) { - if (var_s0->obj.status == 2) { - if ((var_s0->obj.id == OBJECT_1) || (var_s0->obj.id == OBJECT_3) || (var_s0->obj.id == OBJECT_117) || - (var_s0->obj.id == OBJECT_141) || (var_s0->obj.id == OBJECT_150) || - (var_s0->obj.id == OBJECT_149) || (var_s0->obj.id == OBJECT_148) || - (var_s0->obj.id == OBJECT_140)) { - if (func_8006326C(arg1, arg2, var_s0->obj.id, &var_s0->obj)) { + obj58 = gObjects58; + for (i = 0; i < 200; i++, obj58++) { + if (obj58->obj.status == 2) { + if ((obj58->obj.id == OBJECT_1) || (obj58->obj.id == OBJECT_3) || (obj58->obj.id == OBJECT_117) || + (obj58->obj.id == OBJECT_141) || (obj58->obj.id == OBJECT_150) || (obj58->obj.id == OBJECT_149) || + (obj58->obj.id == OBJECT_148) || (obj58->obj.id == OBJECT_140)) { + if (func_8006326C(pos, arg2, obj58->obj.id, &obj58->obj)) { return 999; } - } else if ((fabsf(arg1->x - var_s0->obj.pos.x) < 2000.0f) && - (fabsf(arg1->z - var_s0->obj.pos.z) < 2000.0f)) { - if (func_80062DBC(arg1, var_s0->unk_1C.unk_0C, &var_s0->obj, 0.0f, 0.0f, 0.0f)) { + } else if ((fabsf(pos->x - obj58->obj.pos.x) < 2000.0f) && + (fabsf(pos->z - obj58->obj.pos.z) < 2000.0f)) { + if (func_80062DBC(pos, obj58->unk_1C.hitbox, &obj58->obj, 0.0f, 0.0f, 0.0f)) { return 2; } } } } } - var_s0_2 = gObjects80; - for (i = 0; i < ARRAY_COUNT(gObjects80) && D_80177880 == 0; i++, var_s0_2++) { - if (var_s0_2->obj.status == 2) { - if ((var_s0_2->obj.id == OBJECT_1) || (var_s0_2->obj.id == OBJECT_4) || (var_s0_2->obj.id == OBJECT_5) || - (var_s0_2->obj.id == OBJECT_2) || (var_s0_2->obj.id == OBJECT_39) || (var_s0_2->obj.id == OBJECT_3)) { - if (func_8006326C(arg1, arg2, var_s0_2->obj.id, &var_s0_2->obj)) { + obj80 = gObjects80; + for (i = 0; i < ARRAY_COUNT(gObjects80) && D_80177880 == 0; i++, obj80++) { + if (obj80->obj.status == 2) { + if ((obj80->obj.id == OBJECT_1) || (obj80->obj.id == OBJECT_4) || (obj80->obj.id == OBJECT_5) || + (obj80->obj.id == OBJECT_2) || (obj80->obj.id == OBJECT_39) || (obj80->obj.id == OBJECT_3)) { + if (func_8006326C(pos, arg2, obj80->obj.id, &obj80->obj)) { return 2; } - } else if ((fabsf(arg1->x - var_s0_2->obj.pos.x) < 2000.0f) && - (fabsf(arg1->z - var_s0_2->obj.pos.z) < 2000.0f)) { - if (func_80062DBC(arg1, var_s0_2->unk_1C.unk_0C, &var_s0_2->obj, 0.0f, 0.0f, 0.0f)) { + } else if ((fabsf(pos->x - obj80->obj.pos.x) < 2000.0f) && (fabsf(pos->z - obj80->obj.pos.z) < 2000.0f)) { + if (func_80062DBC(pos, obj80->unk_1C.hitbox, &obj80->obj, 0.0f, 0.0f, 0.0f)) { return i + 10; } } } } - var_s0_3 = gObjects4C; - for (i = 0; i < ARRAY_COUNT(gObjects4C); i++, var_s0_3++) { - if ((var_s0_3->obj.status == 2) && (fabsf(arg1->x - var_s0_3->obj.pos.x) < 500.0f) && - (fabsf(arg1->z - var_s0_3->obj.pos.z) < 500.0f) && - func_800631A8(arg1, var_s0_3->unk_1C.unk_0C, &var_s0_3->obj.pos)) { - if ((var_s0_3->obj.id == OBJECT_163) || (var_s0_3->obj.id == OBJECT_162) || - (var_s0_3->obj.id == OBJECT_162)) { - var_s0_3->unk_46 = 1; + obj4C = gObjects4C; + for (i = 0; i < ARRAY_COUNT(gObjects4C); i++, obj4C++) { + if ((obj4C->obj.status == 2) && (fabsf(pos->x - obj4C->obj.pos.x) < 500.0f) && + (fabsf(pos->z - obj4C->obj.pos.z) < 500.0f) && func_800631A8(pos, obj4C->unk_1C.hitbox, &obj4C->obj.pos)) { + if ((obj4C->obj.id == OBJECT_163) || (obj4C->obj.id == OBJECT_162) || (obj4C->obj.id == OBJECT_162)) { + obj4C->unk_46 = 1; } return 0; } } if ((arg3 == 0) || (arg3 == 2) || (arg3 == 3)) { if (arg3 != 2) { - var_s0_4 = gObjects408; - for (i = 0; i < ARRAY_COUNT(gObjects408); i++, var_s0_4++) { - if (var_s0_4->obj.status == 2) { - if ((var_s0_4->obj.id == OBJECT_308) || (var_s0_4->obj.id == OBJECT_312) || - (var_s0_4->obj.id == OBJECT_313) || (var_s0_4->obj.id == OBJECT_309)) { - if (func_8006326C(arg1, arg2, var_s0_4->obj.id, &var_s0_4->obj)) { + obj408 = gObjects408; + for (i = 0; i < ARRAY_COUNT(gObjects408); i++, obj408++) { + if (obj408->obj.status == 2) { + if ((obj408->obj.id == OBJECT_308) || (obj408->obj.id == OBJECT_312) || + (obj408->obj.id == OBJECT_313) || (obj408->obj.id == OBJECT_309)) { + if (func_8006326C(pos, arg2, obj408->obj.id, &obj408->obj)) { return 2; } - } else if (var_s0_4->obj.id == OBJECT_310) { - temp.x = fabsf(var_s0_4->obj.pos.x - arg1->x) * (5.0f / 6.0f); - temp.y = fabsf(var_s0_4->obj.pos.y - arg1->y) * 2; - temp.z = fabsf(var_s0_4->obj.pos.z - arg1->z) * (5.0f / 6.0f); + } else if (obj408->obj.id == OBJECT_310) { + temp.x = fabsf(obj408->obj.pos.x - pos->x) * (5.0f / 6.0f); + temp.y = fabsf(obj408->obj.pos.y - pos->y) * 2; + temp.z = fabsf(obj408->obj.pos.z - pos->z) * (5.0f / 6.0f); if (sqrtf(VEC3F_SQ(temp)) < 1500.0f) { - var_s0_4->unk_062 = 1; + obj408->unk_062 = 1; return 2; } } else { - if (var_s0_4->obj.id == OBJECT_316) { - temp.x = fabsf(var_s0_4->obj.pos.x - arg1->x); - temp.y = fabsf(var_s0_4->obj.pos.y - 300.0f - arg1->y) * 7.42f; - temp.z = fabsf(var_s0_4->obj.pos.z - arg1->z); + if (obj408->obj.id == OBJECT_316) { + temp.x = fabsf(obj408->obj.pos.x - pos->x); + temp.y = fabsf(obj408->obj.pos.y - 300.0f - pos->y) * 7.42f; + temp.z = fabsf(obj408->obj.pos.z - pos->z); if (sqrtf(VEC3F_SQ(temp)) < 2700.0f) { return 2; } } - if ((fabsf(arg1->x - var_s0_4->obj.pos.x) < 2000.0f) && - (fabsf(arg1->z - var_s0_4->obj.pos.z) < 2000.0f)) { - if (func_80062DBC(arg1, var_s0_4->unk_01C.unk_0C, &var_s0_4->obj, 0.0f, 0.0f, 0.0f)) { + if ((fabsf(pos->x - obj408->obj.pos.x) < 2000.0f) && + (fabsf(pos->z - obj408->obj.pos.z) < 2000.0f)) { + if (func_80062DBC(pos, obj408->unk_01C.hitbox, &obj408->obj, 0.0f, 0.0f, 0.0f)) { return 2; } } @@ -883,39 +873,38 @@ s32 func_8006351C(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { } } } - var_s0_5 = gObjects2F4; - for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++, var_s0_5++) { - if ((var_s0_5->obj.status >= 2) && (fabsf(arg1->x - var_s0_5->obj.pos.x) < 1000.0f) && - (fabsf(arg1->z - var_s0_5->obj.pos.z) < 1500.0f) && (arg0 != i) && (var_s0_5->unk_01C.unk_16 != 2) && - ((var_s0_5->obj.id != OBJECT_197) || (var_s0_5->unk_0E4 >= 4)) && (var_s0_5->unk_0C2 == 0)) { - if (var_s0_5->obj.id == OBJECT_180) { - if (func_8006326C(arg1, arg2, var_s0_5->obj.id, &var_s0_5->obj) != 0) { + obj2F4 = gObjects2F4; + for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++, obj2F4++) { + if ((obj2F4->obj.status >= 2) && (fabsf(pos->x - obj2F4->obj.pos.x) < 1000.0f) && + (fabsf(pos->z - obj2F4->obj.pos.z) < 1500.0f) && (index != i) && (obj2F4->unk_01C.unk_16 != 2) && + ((obj2F4->obj.id != OBJECT_197) || (obj2F4->unk_0E4 >= 4)) && (obj2F4->unk_0C2 == 0)) { + if (obj2F4->obj.id == OBJECT_180) { + if (func_8006326C(pos, arg2, obj2F4->obj.id, &obj2F4->obj) != 0) { return 2; } - } else if (var_s0_5->unk_110 < 0.0f) { - if (func_80062DBC(arg1, var_s0_5->unk_01C.unk_0C, &var_s0_5->obj, var_s0_5->unk_2E8.x, - var_s0_5->unk_2E8.y, var_s0_5->unk_2E8.z + var_s0_5->unk_0F4.z)) { - var_s0_5->unk_0D0 = 1; - var_s0_5->unk_0D6 = 10; - var_s0_5->unk_0D2 = -1; - var_s0_5->unk_0D8.x = arg1->x; - var_s0_5->unk_0D8.y = arg1->y; - var_s0_5->unk_0D8.z = arg1->z; + } else if (obj2F4->unk_110 < 0.0f) { + if (func_80062DBC(pos, obj2F4->unk_01C.hitbox, &obj2F4->obj, obj2F4->unk_2E8.x, obj2F4->unk_2E8.y, + obj2F4->unk_2E8.z + obj2F4->unk_0F4.z)) { + obj2F4->unk_0D0 = 1; + obj2F4->unk_0D6 = 10; + obj2F4->unk_0D2 = -1; + obj2F4->unk_0D8.x = pos->x; + obj2F4->unk_0D8.y = pos->y; + obj2F4->unk_0D8.z = pos->z; return 2; } } else if ((arg3 != 2) && (arg3 != 3)) { - if (func_800631A8(arg1, var_s0_5->unk_01C.unk_0C, &var_s0_5->obj.pos)) { - var_s0_5->unk_0D0 = 1; - var_s0_5->unk_0D6 = 10; - var_s0_5->unk_0D2 = -1; - if (((var_s0_5->obj.id != OBJECT_200) || (var_s0_5->unk_080 == 0)) && - ((var_s0_5->obj.id != OBJECT_197) || - ((var_s0_5->unk_0E4 >= 10) && (var_s0_5->unk_0E4 < 100)))) { - var_s0_5->unk_0CE = 0; + if (func_800631A8(pos, obj2F4->unk_01C.hitbox, &obj2F4->obj.pos)) { + obj2F4->unk_0D0 = 1; + obj2F4->unk_0D6 = 10; + obj2F4->unk_0D2 = -1; + if (((obj2F4->obj.id != OBJECT_200) || (obj2F4->unk_080 == 0)) && + ((obj2F4->obj.id != OBJECT_197) || ((obj2F4->unk_0E4 >= 10) && (obj2F4->unk_0E4 < 100)))) { + obj2F4->unk_0CE = 0; } - var_s0_5->unk_0D8.x = arg1->x; - var_s0_5->unk_0D8.y = arg1->y; - var_s0_5->unk_0D8.z = arg1->z; + obj2F4->unk_0D8.x = pos->x; + obj2F4->unk_0D8.y = pos->y; + obj2F4->unk_0D8.z = pos->z; return 1; } } @@ -925,7 +914,7 @@ s32 func_8006351C(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { return 0; } -void func_80063CAC(Object_80* arg0) { +void func_80063CAC(Object_80* obj80) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { @@ -933,57 +922,57 @@ void func_80063CAC(Object_80* arg0) { Object_2F4_Initialize(&gObjects2F4[i]); gObjects2F4[i].obj.status = 1; gObjects2F4[i].obj.id = OBJECT_193; - gObjects2F4[i].obj.pos.x = arg0->obj.pos.x; - gObjects2F4[i].obj.pos.y = arg0->obj.pos.y; - gObjects2F4[i].obj.pos.z = arg0->obj.pos.z; + gObjects2F4[i].obj.pos.x = obj80->obj.pos.x; + gObjects2F4[i].obj.pos.y = obj80->obj.pos.y; + gObjects2F4[i].obj.pos.z = obj80->obj.pos.z; gObjects2F4[i].obj.rot.y = Rand_ZeroOne() * 360.0f; - func_800612B8(&gObjects2F4[i].unk_01C, gObjects2F4[i].obj.id); + Object_Set1C(&gObjects2F4[i].unk_01C, gObjects2F4[i].obj.id); break; } } } -void func_80063D58(Object_80* arg0) { +void func_80063D58(Object_80* obj80) { s32 i; - arg0->obj.pos.y = D_80177940; + obj80->obj.pos.y = D_80177940; for (i = 0; i < ARRAY_COUNT(gObjects4C); i++) { if (gObjects4C[i].obj.status == 0) { Object_4C_Initialize(&gObjects4C[i]); gObjects4C[i].obj.status = 1; gObjects4C[i].obj.id = OBJECT_164; - gObjects4C[i].unk_45 = arg0->obj.id; - gObjects4C[i].obj.pos.x = arg0->obj.pos.x; + gObjects4C[i].unk_45 = obj80->obj.id; + gObjects4C[i].obj.pos.x = obj80->obj.pos.x; gObjects4C[i].obj.pos.y = 5.0f; - gObjects4C[i].obj.pos.z = arg0->obj.pos.z; - if ((arg0->obj.id == OBJECT_0) || (arg0->obj.id == OBJECT_6) || (arg0->obj.id == OBJECT_7) || - (arg0->obj.id == OBJECT_56) || (arg0->obj.id == OBJECT_20) || (arg0->obj.id == OBJECT_21) || - (arg0->obj.id == OBJECT_22)) { - gObjects4C[i].obj.rot.y = arg0->obj.rot.y; + gObjects4C[i].obj.pos.z = obj80->obj.pos.z; + if ((obj80->obj.id == OBJECT_0) || (obj80->obj.id == OBJECT_6) || (obj80->obj.id == OBJECT_7) || + (obj80->obj.id == OBJECT_56) || (obj80->obj.id == OBJECT_20) || (obj80->obj.id == OBJECT_21) || + (obj80->obj.id == OBJECT_22)) { + gObjects4C[i].obj.rot.y = obj80->obj.rot.y; } else { gObjects4C[i].obj.rot.y = 44.9f; } - func_800612B8(&gObjects4C[i].unk_1C, gObjects4C[i].obj.id); + Object_Set1C(&gObjects4C[i].unk_1C, gObjects4C[i].obj.id); break; } } } -void func_80063E5C(Object_80* arg0, f32* arg1) { +void func_80063E5C(Object_80* obj80, f32* hitboxData) { s32 i; - Object_6C* var_v1; + Object_6C* obj6C; - for (i = 0, var_v1 = gObjects6C; i < ARRAY_COUNT(gObjects6C); i++, var_v1++) { - if (var_v1->obj.status == 0) { + for (i = 0, obj6C = gObjects6C; i < ARRAY_COUNT(gObjects6C); i++, obj6C++) { + if (obj6C->obj.status == 0) { Object_6C_Initialize(&gObjects6C[i]); - var_v1->obj.status = 1; - var_v1->obj.id = OBJECT_334; - var_v1->obj.pos.x = arg0->obj.pos.x; - var_v1->obj.pos.y = arg0->obj.pos.y; - var_v1->obj.pos.z = arg0->obj.pos.z; - var_v1->obj.rot.y = arg0->obj.rot.y; - func_800612B8(&var_v1->unk_1C, var_v1->obj.id); - var_v1->unk_1C.unk_0C = SEGMENTED_TO_VIRTUAL(arg1); + obj6C->obj.status = 1; + obj6C->obj.id = OBJECT_6C_CORN_ARCH; + obj6C->obj.pos.x = obj80->obj.pos.x; + obj6C->obj.pos.y = obj80->obj.pos.y; + obj6C->obj.pos.z = obj80->obj.pos.z; + obj6C->obj.rot.y = obj80->obj.rot.y; + Object_Set1C(&obj6C->unk_1C, obj6C->obj.id); + obj6C->unk_1C.hitbox = SEGMENTED_TO_VIRTUAL(hitboxData); break; } } @@ -992,433 +981,433 @@ void func_80063E5C(Object_80* arg0, f32* arg1) { void func_80063F4C(s32 arg0) { } -void func_80063F58(Object_6C* arg0) { - arg0->unk_68 = arg0->obj.rot.z * 100.0f; +void func_80063F58(Object_6C* obj6C) { + obj6C->unk_68 = obj6C->obj.rot.z * 100.0f; } -void func_80063F74(Object_6C* arg0) { - arg0->unk_68 = arg0->obj.rot.z * 100.0f; +void func_80063F74(Object_6C* obj6C) { + obj6C->unk_68 = obj6C->obj.rot.z * 100.0f; } -void func_80063F90(s32 arg0, s32 objId) { +void Object_Init(s32 index, s32 objId) { s32 var_a0; s32 var_a2; f32 sp54; f32 sp50; f32 sp4C; - f32* var_v0; + PosRot* var_v0; switch (objId) { - case 170: - func_8007A6F0(&gObjects4C[arg0].obj.pos, 0x11000055); + case OBJECT_170: + func_8007A6F0(&gObjects4C[index].obj.pos, 0x11000055); break; - case 234: - func_80019218(0x11030010, &gObjects2F4[arg0].unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + case OBJECT_234: + func_80019218(0x11030010, &gObjects2F4[index].sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; - case 54: - func_80019218(0x11000000, &gObjects80[arg0].unk_70, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + case OBJECT_54: + func_80019218(0x11000000, &gObjects80[index].sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; - case 198: - func_80092D48(&gObjects2F4[arg0]); + case OBJECT_198: + func_80092D48(&gObjects2F4[index]); break; - case 235: - gObjects2F4[arg0].unk_13C = fabsf(Math_ModF(gObjects2F4[arg0].obj.pos.x, 100.0f)); + case OBJECT_235: + gObjects2F4[index].unk_13C = fabsf(Math_ModF(gObjects2F4[index].obj.pos.x, 100.0f)); break; - case 0xF7: - func_E16C50_8019D060(&gObjects2F4[arg0]); + case OBJECT_247: + func_E16C50_8019D060(&gObjects2F4[index]); break; - case 0x170: + case OBJECT_368: if (gCurrentLevel == LEVEL_TITANIA) { - func_E6A810_801B6E20(gObjects8C[arg0].obj.pos.x, gObjects8C[arg0].obj.pos.z + D_80177D20, &sp54, &sp4C, - &sp50); - gObjects8C[arg0].obj.pos.y = sp4C + 3.0f; - gObjects8C[arg0].obj.rot.x = (sp54 * 180.0f) / M_PI; - gObjects8C[arg0].obj.rot.z = (sp50 * 180.0f) / M_PI; + func_E6A810_801B6E20(gObjects8C[index].obj.pos.x, gObjects8C[index].obj.pos.z + D_80177D20, &sp54, + &sp4C, &sp50); + gObjects8C[index].obj.pos.y = sp4C + 3.0f; + gObjects8C[index].obj.rot.x = (sp54 * 180.0f) / M_PI; + gObjects8C[index].obj.rot.z = (sp50 * 180.0f) / M_PI; } else if (gCurrentLevel == LEVEL_MACBETH) { - gObjects8C[arg0].obj.status = 0; + gObjects8C[index].obj.status = 0; } break; - case 0x1E: - func_80063E5C(&gObjects80[arg0], D_6006940); + case OBJECT_30: + func_80063E5C(&gObjects80[index], D_6006940); break; - case 0x1F: - func_80063E5C(&gObjects80[arg0], D_600695C); + case OBJECT_31: + func_80063E5C(&gObjects80[index], D_600695C); break; - case 0x20: - func_80063E5C(&gObjects80[arg0], D_6006978); + case OBJECT_32: + func_80063E5C(&gObjects80[index], D_6006978); break; - case 0x21: - func_80063E5C(&gObjects80[arg0], D_6006994); + case OBJECT_33: + func_80063E5C(&gObjects80[index], D_6006994); break; - case 0x22: - func_80063E5C(&gObjects80[arg0], D_60069B0); + case OBJECT_34: + func_80063E5C(&gObjects80[index], D_60069B0); break; - case 0x23: - func_80063E5C(&gObjects80[arg0], D_60069CC); + case OBJECT_35: + func_80063E5C(&gObjects80[index], D_60069CC); break; - case 0x24: - func_80063E5C(&gObjects80[arg0], D_60069E8); + case OBJECT_36: + func_80063E5C(&gObjects80[index], D_60069E8); break; - case 0x25: - func_80063E5C(&gObjects80[arg0], D_6006A04); + case OBJECT_37: + func_80063E5C(&gObjects80[index], D_6006A04); break; - case 0x26: - func_80063E5C(&gObjects80[arg0], D_6006A20); + case OBJECT_38: + func_80063E5C(&gObjects80[index], D_6006A20); break; - case 0x17: - func_80063CAC(&gObjects80[arg0]); + case OBJECT_23: + func_80063CAC(&gObjects80[index]); break; - case 0x143: + case OBJECT_6C_CHECKPOINT: if (D_80177CA0 != 0) { - gObjects6C[arg0].obj.status = 0; + gObjects6C[index].obj.status = 0; } break; - case 0x146: + case OBJECT_6C_METEO_WARP: if (D_80177E80 < 0) { - gObjects6C[arg0].obj.status = 0; + gObjects6C[index].obj.status = 0; } break; - case 0x14B: - case 0x14C: - case 0x14D: - func_80063F74(&gObjects6C[arg0]); + case OBJECT_331: + case OBJECT_332: + case OBJECT_333: + func_80063F74(&gObjects6C[index]); break; - case 0x148: - case 0x149: - func_80063F58(&gObjects6C[arg0]); + case OBJECT_328: + case OBJECT_329: + func_80063F58(&gObjects6C[index]); break; - case 0x14A: - if (((D_80177E80 >= 7) && (gCurrentLevel == LEVEL_CORNERIA) && (D_801778B0[1] > 0)) || + case OBJECT_330: + if (((D_80177E80 >= 7) && (gCurrentLevel == LEVEL_CORNERIA) && (gTeamHealth[1] > 0)) || (gCurrentLevel != LEVEL_CORNERIA)) { - func_80063F58(&gObjects6C[arg0]); + func_80063F58(&gObjects6C[index]); } else { - gObjects6C[arg0].obj.status = 0; + gObjects6C[index].obj.status = 0; } break; - case 0x0: - func_80063E5C(&gObjects80[arg0], D_800CBF18); + case OBJECT_0: + func_80063E5C(&gObjects80[index], D_800CBF18); /* fallthrough */ - case 0x6: - case 0x7: - case 0x14: - case 0x15: - case 0x16: - case 0x38: - func_80063D58(&gObjects80[arg0]); + case OBJECT_6: + case OBJECT_7: + case OBJECT_20: + case OBJECT_21: + case OBJECT_22: + case OBJECT_56: + func_80063D58(&gObjects80[index]); break; - case 0xBB: - gObjects2F4[arg0].unk_114 = gObjects2F4[arg0].obj.pos.x; - gObjects2F4[arg0].unk_118 = gObjects2F4[arg0].obj.pos.y; - gObjects2F4[arg0].obj.rot.z = gObjects2F4[arg0].obj.rot.x; - gObjects2F4[arg0].obj.rot.x = 0.0f; + case OBJECT_187: + gObjects2F4[index].unk_114 = gObjects2F4[index].obj.pos.x; + gObjects2F4[index].unk_118 = gObjects2F4[index].obj.pos.y; + gObjects2F4[index].obj.rot.z = gObjects2F4[index].obj.rot.x; + gObjects2F4[index].obj.rot.x = 0.0f; break; - case 0xB6: - case 0xBA: - gObjects2F4[arg0].unk_046 = gFogRed; - gObjects2F4[arg0].unk_048 = gFogNear; - gObjects2F4[arg0].obj.rot.x = Rand_ZeroOne() * 360.0f; - gObjects2F4[arg0].obj.rot.y = Rand_ZeroOne() * 360.0f; + case OBJECT_182: + case OBJECT_186: + gObjects2F4[index].unk_046 = gFogRed; + gObjects2F4[index].unk_048 = gFogNear; + gObjects2F4[index].obj.rot.x = Rand_ZeroOne() * 360.0f; + gObjects2F4[index].obj.rot.y = Rand_ZeroOne() * 360.0f; break; - case 0xB5: - gObjects2F4[arg0].obj.rot.x = Rand_ZeroOne() * 360.0f; - gObjects2F4[arg0].obj.rot.y = Rand_ZeroOne() * 360.0f; - gObjects2F4[arg0].unk_0CE = 200; + case OBJECT_181: + gObjects2F4[index].obj.rot.x = Rand_ZeroOne() * 360.0f; + gObjects2F4[index].obj.rot.y = Rand_ZeroOne() * 360.0f; + gObjects2F4[index].unk_0CE = 200; break; - case 0xCA: - gObjects2F4[arg0].unk_0CE = 30; + case OBJECT_202: + gObjects2F4[index].unk_0CE = 30; break; - case 0xFC: - if (gPlayer[0].unk_07C < gObjects2F4[arg0].obj.pos.z) { - Object_Kill(&gObjects2F4[arg0].obj, &gObjects2F4[arg0].unk_100); + case OBJECT_252: + if (gPlayer[0].unk_07C < gObjects2F4[index].obj.pos.z) { + Object_Kill(&gObjects2F4[index].obj, &gObjects2F4[index].sfxPos); } break; - case 0xEF: - gObjects2F4[arg0].unk_050 = D_801784A4; + case OBJECT_239: + gObjects2F4[index].unk_050 = D_801784A4; D_801784A4++; break; - case 0xEC: + case OBJECT_236: D_801784A4 = 0; - gObjects2F4[arg0].unk_0F4.x = gObjects2F4[arg0].obj.rot.x; - gObjects2F4[arg0].unk_0F4.y = gObjects2F4[arg0].obj.rot.y; - gObjects2F4[arg0].obj.rot.x = gObjects2F4[arg0].obj.rot.y = 0.0f; - gObjects2F4[arg0].unk_11C = gObjects2F4[arg0].obj.pos.y; + gObjects2F4[index].unk_0F4.x = gObjects2F4[index].obj.rot.x; + gObjects2F4[index].unk_0F4.y = gObjects2F4[index].obj.rot.y; + gObjects2F4[index].obj.rot.x = gObjects2F4[index].obj.rot.y = 0.0f; + gObjects2F4[index].unk_11C = gObjects2F4[index].obj.pos.y; var_v0 = D_801782C4; - for (var_a0 = 0; var_a0 < 200; var_a0++, var_v0 += 6) { - var_v0[0] = gObjects2F4[arg0].obj.pos.x; - var_v0[1] = gObjects2F4[arg0].obj.pos.y; - var_v0[2] = gObjects2F4[arg0].obj.pos.z; - var_v0[3] = gObjects2F4[arg0].obj.rot.x; - var_v0[4] = gObjects2F4[arg0].obj.rot.y; - var_v0[5] = gObjects2F4[arg0].obj.rot.z; + for (var_a0 = 0; var_a0 < 200; var_a0++, var_v0++) { + var_v0->pos.x = gObjects2F4[index].obj.pos.x; + var_v0->pos.y = gObjects2F4[index].obj.pos.y; + var_v0->pos.z = gObjects2F4[index].obj.pos.z; + var_v0->rot.x = gObjects2F4[index].obj.rot.x; + var_v0->rot.y = gObjects2F4[index].obj.rot.y; + var_v0->rot.z = gObjects2F4[index].obj.rot.z; } break; - case 0xC2: - gObjects2F4[arg0].unk_046 = 100; + case OBJECT_194: + gObjects2F4[index].unk_046 = 100; for (var_a0 = 0; var_a0 < 2; var_a0++) { if (D_80176550[var_a0] == 0) { D_80176550[var_a0] = 1; - gObjects2F4[arg0].unk_046 = var_a0; + gObjects2F4[index].unk_046 = var_a0; for (var_a2 = 0; var_a2 < 100; var_a2++) { - D_80176878[var_a0][var_a2] = gObjects2F4[arg0].obj.pos.y; - D_80176B98[var_a0][var_a2] = gObjects2F4[arg0].obj.pos.z; + D_80176878[var_a0][var_a2] = gObjects2F4[index].obj.pos.y; + D_80176B98[var_a0][var_a2] = gObjects2F4[index].obj.pos.z; } break; } } - if (gObjects2F4[arg0].unk_046 == 100) { - gObjects2F4[arg0].obj.status = 0; + if (gObjects2F4[index].unk_046 == 100) { + gObjects2F4[index].obj.status = 0; } break; - case 0xBE: - case 0xBF: - func_80019218(0x31000012, &gObjects2F4[arg0].unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + case OBJECT_190: + case OBJECT_191: + func_80019218(0x31000012, &gObjects2F4[index].sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; - case 0xC0: - gObjects2F4[arg0].unk_0C9 = 1; + case OBJECT_192: + gObjects2F4[index].unk_0C9 = 1; break; - case 0x140: - func_E9F1D0_8018D16C(&gObjects408[arg0]); + case OBJECT_320: + func_E9F1D0_8018D16C(&gObjects408[index]); break; - case 0x13C: - func_E51970_80193CA4(&gObjects408[arg0]); + case OBJECT_316: + func_E51970_80193CA4(&gObjects408[index]); break; - case 0x13A: - func_E9F1D0_80197CC4(&gObjects408[arg0]); + case OBJECT_314: + func_E9F1D0_80197CC4(&gObjects408[index]); break; - case 0xCD: - case 0xCE: - case 0xD0: - case 0xD1: - case 0xD2: - case 0xD3: - case 0xD4: - case 0xD5: - func_E6A810_80199F8C(&gObjects2F4[arg0]); + case OBJECT_205: + case OBJECT_206: + case OBJECT_208: + case OBJECT_209: + case OBJECT_210: + case OBJECT_211: + case OBJECT_212: + case OBJECT_213: + func_E6A810_80199F8C(&gObjects2F4[index]); break; - case 0xCF: - func_E6A810_801A7D98(&gObjects2F4[arg0]); + case OBJECT_207: + func_E6A810_801A7D98(&gObjects2F4[index]); break; - case 0xD6: - func_E6A810_801A3E70(&gObjects2F4[arg0]); + case OBJECT_214: + func_E6A810_801A3E70(&gObjects2F4[index]); break; - case 0xD7: - func_E6A810_801A4660(&gObjects2F4[arg0]); + case OBJECT_215: + func_E6A810_801A4660(&gObjects2F4[index]); break; - case 0xDF: - func_E6A810_801A4AF8(&gObjects2F4[arg0]); + case OBJECT_223: + func_E6A810_801A4AF8(&gObjects2F4[index]); break; - case 0xD8: - case 0xD9: - func_E6A810_801A5E2C(&gObjects2F4[arg0]); + case OBJECT_216: + case OBJECT_217: + func_E6A810_801A5E2C(&gObjects2F4[index]); break; - case 0xDA: - func_E6A810_801A6134(&gObjects2F4[arg0]); + case OBJECT_218: + func_E6A810_801A6134(&gObjects2F4[index]); break; - case 0x41: - func_E6A810_801A65E0(&gObjects80[arg0]); + case OBJECT_65: + func_E6A810_801A65E0(&gObjects80[index]); break; - case 0xB1: - case 0xB2: - func_DF4260_8018B0B4(&gObjects2F4[arg0]); + case OBJECT_177: + case OBJECT_178: + func_DF4260_8018B0B4(&gObjects2F4[index]); /* fallthrough */ - case 0xB0: - gObjects2F4[arg0].unk_0CE = 24; - func_80019218(0x31000016, &gObjects2F4[arg0].unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + case OBJECT_176: + gObjects2F4[index].unk_0CE = 24; + func_80019218(0x31000016, &gObjects2F4[index].sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; - case 0x129: - func_E08400_80188A40(&gObjects408[arg0]); + case OBJECT_297: + func_E08400_80188A40(&gObjects408[index]); break; - case 0x12B: - func_80042FAC(&gObjects408[arg0]); + case OBJECT_299: + func_80042FAC(&gObjects408[index]); break; - case 0x12C: - func_80042FD0(&gObjects408[arg0]); + case OBJECT_300: + func_80042FD0(&gObjects408[index]); break; - case 0x124: - func_DF4260_801878D8(&gObjects408[arg0]); + case OBJECT_292: + func_DF4260_801878D8(&gObjects408[index]); break; - case 0x125: - func_DF4260_8018BE7C(&gObjects408[arg0]); + case OBJECT_293: + func_DF4260_8018BE7C(&gObjects408[index]); break; - case 0x12E: - func_E16C50_80187754(&gObjects408[arg0]); + case OBJECT_302: + func_E16C50_80187754(&gObjects408[index]); break; - case 0xE7: - func_E6A810_8018B96C(&gObjects2F4[arg0]); + case OBJECT_231: + func_E6A810_8018B96C(&gObjects2F4[index]); break; - case 0xE8: - func_E6A810_8018ADC4(&gObjects2F4[arg0]); + case OBJECT_232: + func_E6A810_8018ADC4(&gObjects2F4[index]); break; - case 0xE9: - func_E6A810_80189B80(&gObjects2F4[arg0]); + case OBJECT_233: + func_E6A810_80189B80(&gObjects2F4[index]); break; - case 0xE5: - func_E6A810_8018BFB0(&gObjects2F4[arg0]); + case OBJECT_229: + func_E6A810_8018BFB0(&gObjects2F4[index]); break; - case 0xE3: - func_E6A810_8018E3CC(&gObjects2F4[arg0]); + case OBJECT_227: + func_E6A810_8018E3CC(&gObjects2F4[index]); break; - case 0xE4: - func_E6A810_8018E5E8(&gObjects2F4[arg0]); + case OBJECT_228: + func_E6A810_8018E5E8(&gObjects2F4[index]); break; - case 0xA9: - func_E6A810_8018EFF0(&gObjects4C[arg0]); + case OBJECT_169: + func_E6A810_8018EFF0(&gObjects4C[index]); break; - case 0x132: - func_E6A810_8018FA48(&gObjects408[arg0]); + case OBJECT_306: + func_E6A810_8018FA48(&gObjects408[index]); break; - case 0xF0: - func_E16C50_801915A4(&gObjects2F4[arg0]); + case OBJECT_240: + func_E16C50_801915A4(&gObjects2F4[index]); break; - case 0xF1: - func_E16C50_80191BB8(&gObjects2F4[arg0]); + case OBJECT_241: + func_E16C50_80191BB8(&gObjects2F4[index]); break; - case 0x133: - func_E16C50_801932AC(&gObjects408[arg0]); + case OBJECT_307: + func_E16C50_801932AC(&gObjects408[index]); break; - case 0xFA: - func_E16C50_8019B1F0(&gObjects2F4[arg0]); + case OBJECT_250: + func_E16C50_8019B1F0(&gObjects2F4[index]); break; - case 0xFB: - func_E16C50_8019B810(&gObjects2F4[arg0]); + case OBJECT_251: + func_E16C50_8019B810(&gObjects2F4[index]); break; - case 0xFD: - func_E16C50_8019C200(&gObjects2F4[arg0]); + case OBJECT_253: + func_E16C50_8019C200(&gObjects2F4[index]); break; - case 0xFF: - func_E16C50_801AD688(&gObjects2F4[arg0]); + case OBJECT_255: + func_E16C50_801AD688(&gObjects2F4[index]); break; - case 0x100: - func_E16C50_801AE3AC(&gObjects2F4[arg0]); + case OBJECT_256: + func_E16C50_801AE3AC(&gObjects2F4[index]); break; - case 0x101: - func_E16C50_801AF9FC(&gObjects2F4[arg0]); + case OBJECT_257: + func_E16C50_801AF9FC(&gObjects2F4[index]); break; - case 0x13E: - func_E16C50_801B10F8(&gObjects408[arg0]); + case OBJECT_318: + func_E16C50_801B10F8(&gObjects408[index]); break; - case 0x103: - func_E16C50_801B6344(&gObjects2F4[arg0]); + case OBJECT_259: + func_E16C50_801B6344(&gObjects2F4[index]); break; - case 0x106: - func_E16C50_801B6E54(&gObjects2F4[arg0]); + case OBJECT_262: + func_E16C50_801B6E54(&gObjects2F4[index]); break; - case 0x104: - func_E16C50_801B7AF0(&gObjects2F4[arg0]); + case OBJECT_260: + func_E16C50_801B7AF0(&gObjects2F4[index]); break; - case 0x39: - func_E6A810_8018F0D8(&gObjects80[arg0]); + case OBJECT_57: + func_E6A810_8018F0D8(&gObjects80[index]); break; - case 0x13F: - func_DF4260_801935CC(&gObjects408[arg0]); + case OBJECT_319: + func_DF4260_801935CC(&gObjects408[index]); break; - case 0x118: - func_DF4260_8019250C(&gObjects2F4[arg0]); + case OBJECT_280: + func_DF4260_8019250C(&gObjects2F4[index]); break; - case 0x119: - case 0x11A: - func_DF4260_80192CB0(&gObjects2F4[arg0]); + case OBJECT_281: + case OBJECT_282: + func_DF4260_80192CB0(&gObjects2F4[index]); break; - case 0x11B: - func_DF4260_80192EA4(&gObjects2F4[arg0]); + case OBJECT_283: + func_DF4260_80192EA4(&gObjects2F4[index]); break; - case 0x11C: - func_DF4260_801933B4(&gObjects2F4[arg0]); + case OBJECT_284: + func_DF4260_801933B4(&gObjects2F4[index]); break; - case 0x109: - func_E16C50_801BA57C(&gObjects2F4[arg0]); + case OBJECT_265: + func_E16C50_801BA57C(&gObjects2F4[index]); break; - case 0x10B: - func_E16C50_801BB26C(&gObjects2F4[arg0]); + case OBJECT_267: + func_E16C50_801BB26C(&gObjects2F4[index]); break; } } -void func_800652CC(Object_80* arg0) { +void func_800652CC(Object_80* obj80) { f32 sp2C; f32 sp28; f32 sp24; - 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) / M_PI; - arg0->obj.rot.z = (sp28 * 180.0f) / M_PI; - arg0->unk_48 += 1; + if ((D_801784AC == 4) && (obj80->unk_48 == 0)) { + func_E6A810_801B6E20(obj80->obj.pos.x, obj80->obj.pos.z + D_80177D20, &sp2C, &sp24, &sp28); + obj80->obj.pos.y = sp24 + 3.0f; + obj80->obj.rot.x = (sp2C * 180.0f) / M_PI; + obj80->obj.rot.z = (sp28 * 180.0f) / M_PI; + obj80->unk_48 += 1; } } -void func_80065380(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { - Object_2F4_Initialize(arg0); - arg0->obj.status = 2; - arg0->obj.id = OBJECT_182; - arg0->unk_0BC = (s32) (Rand_ZeroOne() * 10.0f) + 10; - arg0->unk_0C2 = 30; - arg0->unk_0E8.x = arg4; - arg0->unk_0E8.y = arg5; - arg0->unk_0E8.z = arg6; - arg0->obj.pos.x = arg1; - arg0->obj.pos.y = arg2; - arg0->obj.pos.z = arg3; - arg0->unk_046 = 0xFF; - arg0->unk_048 = 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); +void func_80065380(Object_2F4* obj2F4, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 arg5, f32 arg6) { + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 2; + obj2F4->obj.id = OBJECT_182; + obj2F4->unk_0BC = (s32) (Rand_ZeroOne() * 10.0f) + 10; + obj2F4->unk_0C2 = 30; + obj2F4->unk_0E8.x = arg4; + obj2F4->unk_0E8.y = arg5; + obj2F4->unk_0E8.z = arg6; + obj2F4->obj.pos.x = xPos; + obj2F4->obj.pos.y = yPos; + obj2F4->obj.pos.z = zPos; + obj2F4->unk_046 = 0xFF; + obj2F4->unk_048 = 900; + obj2F4->obj.rot.z = Rand_ZeroOne() * 360.0f; + obj2F4->obj.rot.y = Rand_ZeroOne() * 360.0f; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); } -void func_8006546C(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) { +void func_8006546C(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 arg4, f32 arg5) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { if (gObjects2F4[i].obj.status == 0) { - func_80065380(&gObjects2F4[i], arg0, arg1, arg2, arg3, arg4, arg5); + func_80065380(&gObjects2F4[i], xPos, yPos, zPos, arg3, arg4, arg5); break; } } } -void func_800654E4(Object* arg0) { +void func_800654E4(Object* obj) { f32 temp_fs0; f32 temp_fs1; s32 var_s1; - func_8007D2C8(arg0->pos.x, arg0->pos.y, arg0->pos.z, 12.0f); + func_8007D2C8(obj->pos.x, obj->pos.y, obj->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, + func_8006546C(obj->pos.x, obj->pos.y, obj->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) { - Object_2F4_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_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; +void func_800655C8(Object_2F4* obj2F4, f32 xPos, f32 yPos, f32 zPos, s32 arg4) { + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 1; + obj2F4->obj.id = OBJECT_190; + obj2F4->obj.pos.x = xPos; + obj2F4->obj.pos.y = yPos; + obj2F4->obj.pos.z = zPos; + obj2F4->unk_0B4 = arg4; + obj2F4->unk_0BE = 50; + if (obj2F4->unk_0B4 == 1) { + obj2F4->unk_0BE = 30; } - arg0->unk_124.y = 15.0f; - func_800612B8(&arg0->unk_01C, arg0->obj.id); + obj2F4->unk_124.y = 15.0f; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); } -void func_8006566C(f32 arg0, f32 arg1, f32 arg2, s32 arg3) { +void func_8006566C(f32 xPos, f32 yPos, f32 zPos, s32 arg3) { s32 i; for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { if (gObjects2F4[i].obj.status == 0) { - func_800655C8(&gObjects2F4[i], arg0, arg1, arg2, arg3); + func_800655C8(&gObjects2F4[i], xPos, yPos, zPos, arg3); break; } } } #ifdef NON_MATCHING -void func_800656D4(Object_2F4* arg0) { +void func_800656D4(Object_2F4* obj2F4) { f32 spD4; f32 spD0; f32 spCC; @@ -1446,11 +1435,11 @@ void func_800656D4(Object_2F4* arg0) { } else { var_ra = 0; } - if (arg0->unk_058 == 0) { - if (arg0->obj.id == OBJECT_190) { + if (obj2F4->unk_058 == 0) { + if (obj2F4->obj.id == OBJECT_190) { for (i = 0, j = 1; j < 4; i++, j++) { spA8[i] = var_ra + j; - spB4[i] = D_801778B0[j]; + spB4[i] = gTeamHealth[j]; } for (i = 0, j = 1; j < 3; i++, j++) { temp_a0 = spB4[i]; @@ -1479,131 +1468,131 @@ void func_800656D4(Object_2F4* arg0) { } if (D_80177880 == 1) { - - if (D_801778B0[spC4 - 1] > 0) { - arg0->unk_054 = spC4; + if (gTeamHealth[spC4 - 1] > 0) { + obj2F4->unk_054 = spC4; goto label; } else { - arg0->unk_054 = 10000; + obj2F4->unk_054 = 10000; } } else { - if (D_801778B0[spC4 + 1] > 0) { - arg0->unk_054 = spC4; + if (gTeamHealth[spC4 + 1] > 0) { + obj2F4->unk_054 = spC4; goto label; } else { - arg0->unk_054 = 10000; + obj2F4->unk_054 = 10000; } } } - arg0->unk_054 = 10000; + obj2F4->unk_054 = 10000; label: - arg0->unk_058 = 1; + obj2F4->unk_058 = 1; } - spC4 = arg0->unk_054; + spC4 = obj2F4->unk_054; if ((spC4 == var_ra) || ((var_ra + 1) == spC4) || ((var_ra + 2) == spC4)) { - arg0->unk_188 = gObjects2F4[spC4].obj.pos.z; - arg0->unk_184 = gObjects2F4[spC4].obj.pos.y; - arg0->unk_180 = gObjects2F4[spC4].obj.pos.x; - if ((fabsf(arg0->obj.pos.x - gObjects2F4[spC4].obj.pos.x) < 400.0f) && - (fabsf(arg0->obj.pos.z - gObjects2F4[spC4].obj.pos.z) < 400.0f)) { + obj2F4->unk_188 = gObjects2F4[spC4].obj.pos.z; + obj2F4->unk_184 = gObjects2F4[spC4].obj.pos.y; + obj2F4->unk_180 = gObjects2F4[spC4].obj.pos.x; + if ((fabsf(obj2F4->obj.pos.x - gObjects2F4[spC4].obj.pos.x) < 400.0f) && + (fabsf(obj2F4->obj.pos.z - gObjects2F4[spC4].obj.pos.z) < 400.0f)) { if ((Rand_ZeroOne() * (spC4 - 1)) < 0.6f) { gObjects2F4[spC4].unk_078 = 1; } } } else { - arg0->unk_188 = gPlayer[0].unk_138; - arg0->unk_184 = gPlayer[0].unk_078; - arg0->unk_180 = gPlayer[0].unk_074; + obj2F4->unk_188 = gPlayer[0].unk_138; + obj2F4->unk_184 = gPlayer[0].unk_078; + obj2F4->unk_180 = gPlayer[0].unk_074; } - if (arg0->unk_0BC != 0) { - Math_SmoothStepToAngle(&arg0->obj.rot.x, 0.0f, 0.3f, 4.0f, 0.001f); + if (obj2F4->unk_0BC != 0) { + Math_SmoothStepToAngle(&obj2F4->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) { + if ((obj2F4->unk_078 == 0) && ((fabsf(obj2F4->unk_180 - obj2F4->obj.pos.x) > 300.0f) || + (fabsf(obj2F4->unk_188 - obj2F4->obj.pos.z) > 300.0f))) { + obj2F4->unk_114 += 5.0f; + obj2F4->unk_118 += 8.0f; + sp80 = sqrtf(SQ(obj2F4->unk_180 - obj2F4->obj.pos.x) + SQ(obj2F4->unk_188 - obj2F4->obj.pos.z)) * 0.2f; + if (obj2F4->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; + spD0 = __sinf(obj2F4->unk_114 * M_DTOR) * sp80; + sp88 = __cosf(obj2F4->unk_118 * M_DTOR) * sp80; + spD4 = __cosf(obj2F4->obj.rot.y * M_DTOR) * sp88; + spCC = -__sinf(obj2F4->obj.rot.y * M_DTOR) * sp88; + sp88 = (obj2F4->unk_180 + spD4) - obj2F4->obj.pos.x; + sp84 = (obj2F4->unk_184 + spD0) - obj2F4->obj.pos.y; + sp80 = (obj2F4->unk_188 + spCC) - obj2F4->obj.pos.z; sp78 = Math_RadToDeg(Math_Atan2F(sp88, sp80)); - sp7C = Math_RadToDeg(-Math_Atan2F(sp84, sqrtf((sp88 * sp88) + (sp80 * sp80)))); - sp84 = Math_SmoothStepToAngle(&arg0->obj.rot.y, sp78, 0.3f, 4.0f, 0.001f); - Math_SmoothStepToAngle(&arg0->obj.rot.x, sp7C, 0.3f, 4.0f, 0.001f); + sp7C = Math_RadToDeg(-Math_Atan2F(sp84, sqrtf(SQ(sp88) + SQ(sp80)))); + sp84 = Math_SmoothStepToAngle(&obj2F4->obj.rot.y, sp78, 0.3f, 4.0f, 0.001f); + Math_SmoothStepToAngle(&obj2F4->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))) { + if ((fabsf(obj2F4->unk_180 - obj2F4->obj.pos.x) < 60.0f) && + (fabsf(obj2F4->unk_184 - obj2F4->obj.pos.y) < 60.0f) && + (fabsf(obj2F4->unk_188 - obj2F4->obj.pos.z) < 60.0f) && ((spC4 == 2) || (spC4 == 3) || (spC4 == 4))) { gObjects2F4[spC4].unk_0D0 = 1; gObjects2F4[spC4].unk_0D6 = 20; gObjects2F4[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); - Object_Kill(&arg0->obj, &arg0->unk_100); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 5.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } } - Math_Vec3fFromAngles(&sp98, arg0->obj.rot.x, arg0->obj.rot.y, arg0->unk_124.y); - arg0->unk_0E8.x = sp98.x; - arg0->unk_0E8.y = sp98.y; - arg0->unk_0E8.z = sp98.z - D_80177D08; - if (arg0->unk_0B4 == 0) { - arg0->obj.rot.z += 5.0f; + Math_Vec3fFromAngles(&sp98, obj2F4->obj.rot.x, obj2F4->obj.rot.y, obj2F4->unk_124.y); + obj2F4->unk_0E8.x = sp98.x; + obj2F4->unk_0E8.y = sp98.y; + obj2F4->unk_0E8.z = sp98.z - D_80177D08; + if (obj2F4->unk_0B4 == 0) { + obj2F4->obj.rot.z += 5.0f; } - if (arg0->unk_0B4 == 1) { - if (arg0->unk_0BE == 0) { - arg0->unk_0BE = 30; - Math_Vec3fFromAngles(&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); + if (obj2F4->unk_0B4 == 1) { + if (obj2F4->unk_0BE == 0) { + obj2F4->unk_0BE = 30; + Math_Vec3fFromAngles(&sp98, obj2F4->obj.rot.x, obj2F4->obj.rot.y, 120.0f); + func_8007F04C(0x161, obj2F4->obj.pos.x + sp98.x, obj2F4->obj.pos.y + sp98.y, obj2F4->obj.pos.z + sp98.z, + obj2F4->obj.rot.x, obj2F4->obj.rot.y, obj2F4->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; } - Math_SmoothStepToAngle(&arg0->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.01f); + Math_SmoothStepToAngle(&obj2F4->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); - Object_Kill(&arg0->obj, &arg0->unk_100); + (func_E6A810_801B6AEC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z + D_80177D20) != 0)) { + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 5.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } - sp8C.x = arg0->unk_0E8.x; - sp8C.y = arg0->unk_0E8.y; - sp8C.z = arg0->unk_0E8.z; - if ((func_8006351C(arg0->unk_040, &arg0->obj.pos, &sp8C, 1) != 0) || (arg0->unk_0D0 != 0) || - (arg0->obj.pos.y < (D_80177940 + 10.0f)) || (gPlayer[0].unk_1C8 == 7)) { - func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 3.0f); - Object_Kill(&arg0->obj, &arg0->unk_100); - if (arg0->unk_0D0 != 0) { - arg0->unk_044 = 2; + sp8C.x = obj2F4->unk_0E8.x; + sp8C.y = obj2F4->unk_0E8.y; + sp8C.z = obj2F4->unk_0E8.z; + if ((func_8006351C(obj2F4->unk_040, &obj2F4->obj.pos, &sp8C, 1) != 0) || (obj2F4->unk_0D0 != 0) || + (obj2F4->obj.pos.y < (D_80177940 + 10.0f)) || (gPlayer[0].unk_1C8 == 7)) { + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 3.0f); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + if (obj2F4->unk_0D0 != 0) { + obj2F4->unk_044 = 2; if ((gCurrentLevel == LEVEL_CORNERIA)) { if (D_80177880 == 1) { - arg0->unk_044 = 2; + obj2F4->unk_044 = 2; } else { - arg0->unk_044 = 4; + obj2F4->unk_044 = 4; } } if (gCurrentLevel == LEVEL_AREA_6) { - arg0->unk_044 = 22; + obj2F4->unk_044 = 22; } - func_80066254(arg0); + func_80066254(obj2F4); } - func_8007A6F0(&arg0->obj.pos, 0x2903A008); + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); } if (D_80177880 == 0) { - if (fabsf(arg0->obj.pos.z - gPlayer[0].unk_138) < 100.0f) { - arg0->unk_078 = 1; + if (fabsf(obj2F4->obj.pos.z - gPlayer[0].unk_138) < 100.0f) { + obj2F4->unk_078 = 1; } - if (gPlayer[0].unk_040.z < (arg0->obj.pos.z + D_80177D20)) { - Object_Kill(&arg0->obj, &arg0->unk_100); + if (gPlayer[0].unk_040.z < (obj2F4->obj.pos.z + D_80177D20)) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } } } @@ -1611,30 +1600,30 @@ void func_800656D4(Object_2F4* arg0) { #pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_enmy/func_800656D4.s") #endif -void func_800660F0(Object_2F4* arg0) { - Object_6C* var_s0 = gObjects6C; +void func_800660F0(Object_2F4* obj2F4) { + Object_6C* obj6C = gObjects6C; s32 i; - for (i = 0; i < ARRAY_COUNT(gObjects6C); i++, var_s0++) { - if (var_s0->obj.status == 0) { - Object_6C_Initialize(var_s0); - var_s0->obj.status = 1; - var_s0->obj.id = D_800CFDF4[arg0->unk_044]; - 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 == OBJECT_6C_SILVER_RING) || (var_s0->obj.id == OBJECT_6C_BOMB) || - (var_s0->obj.id == OBJECT_6C_LASERS)) { - var_s0->unk_50 = 90.0f; + for (i = 0; i < ARRAY_COUNT(gObjects6C); i++, obj6C++) { + if (obj6C->obj.status == 0) { + Object_6C_Initialize(obj6C); + obj6C->obj.status = 1; + obj6C->obj.id = D_800CFDF4[obj2F4->unk_044]; + obj6C->obj.pos.x = obj2F4->obj.pos.x; + obj6C->obj.pos.y = obj2F4->obj.pos.y; + obj6C->obj.pos.z = obj2F4->obj.pos.z; + obj6C->unk_4A = 8; + Object_Set1C(&obj6C->unk_1C, obj6C->obj.id); + if ((obj6C->obj.id == OBJECT_6C_SILVER_RING) || (obj6C->obj.id == OBJECT_6C_BOMB) || + (obj6C->obj.id == OBJECT_6C_LASERS)) { + obj6C->unk_50 = 90.0f; } - if ((var_s0->obj.id >= OBJECT_6C_GOLD_RING) || (var_s0->obj.id == OBJECT_6C_1UP)) { - var_s0->unk_50 = 90.0f; + if ((obj6C->obj.id >= OBJECT_6C_GOLD_RING) || (obj6C->obj.id == OBJECT_6C_1UP)) { + obj6C->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 == OBJECT_6C_WING_REPAIR) { - func_80019218(0x1900302B, &var_s0->unk_5C, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + obj6C->unk_48 = 1000; + if (obj6C->obj.id == OBJECT_6C_WING_REPAIR) { + func_80019218(0x1900302B, &obj6C->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } break; @@ -1642,18 +1631,18 @@ void func_800660F0(Object_2F4* arg0) { } } -void func_80066254(Object_2F4* arg0) { - Object_2F4* var_v0; +void func_80066254(Object_2F4* obj2F4) { + Object_2F4* other2F4; s32 i; if (D_801778E8 != 0) { - if ((arg0->unk_0D4 > 0) && (arg0->unk_0D4 < 5) && + if ((obj2F4->unk_0D4 > 0) && (obj2F4->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; + D_80177C30[obj2F4->unk_0D4 - 1] += obj2F4->unk_01C.bonus; } - } else if ((arg0->obj.id != OBJECT_197) || (arg0->unk_0B6 != 1)) { - if ((arg0->unk_0D4 == 1) && (arg0->unk_01C.unk_20 != 0)) { - gHitCount += arg0->unk_01C.unk_20; + } else if ((obj2F4->obj.id != OBJECT_197) || (obj2F4->unk_0B6 != 1)) { + if ((obj2F4->unk_0D4 == 1) && (obj2F4->unk_01C.bonus != 0)) { + gHitCount += obj2F4->unk_01C.bonus; D_80177850 = 0xF; if ((D_80177880 == 1) && (D_80161A62 != 0)) { switch (D_80161A62) { @@ -1665,204 +1654,204 @@ void func_80066254(Object_2F4* arg0) { case 4: case 19: case 29: - arg0->unk_044 = 14; + obj2F4->unk_044 = 14; break; case 14: - arg0->unk_044 = 9; + obj2F4->unk_044 = 9; break; } D_80161A62 = 0; } - if (arg0->obj.id == OBJECT_197) { - if ((arg0->unk_0E4 >= 4) && (arg0->unk_0E4 < 8)) { - func_8002E3E0(arg0); + if (obj2F4->obj.id == OBJECT_197) { + if ((obj2F4->unk_0E4 >= 4) && (obj2F4->unk_0E4 < 8)) { + func_8002E3E0(obj2F4); } } } - if (arg0->unk_044) { - if (D_800CFE5C[arg0->unk_044] < 0.0f) { - var_v0 = gObjects2F4; - for (i = 0, var_v0 = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, var_v0++) { - if ((var_v0->obj.status != 0) && (var_v0->unk_040 != arg0->unk_040) && - (arg0->unk_08C == var_v0->unk_08C)) { + if (obj2F4->unk_044) { + if (D_800CFE5C[obj2F4->unk_044] < 0.0f) { + other2F4 = gObjects2F4; + for (i = 0, other2F4 = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, other2F4++) { + if ((other2F4->obj.status != 0) && (other2F4->unk_040 != obj2F4->unk_040) && + (obj2F4->unk_08C == other2F4->unk_08C)) { return; } } - func_800660F0(arg0); + func_800660F0(obj2F4); func_80019218(0x4900000C, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - } else if (arg0->unk_044 == 24) { - if (D_801778B0[3] > 0) { + } else if (obj2F4->unk_044 == 24) { + if (gTeamHealth[3] > 0) { func_800BA808(gMsg_ID_20261, RCID_PEPPY); - } else if (D_801778B0[2] > 0) { + } else if (gTeamHealth[2] > 0) { func_800BA808(gMsg_ID_20263, RCID_SLIPPY); - } else if (D_801778B0[1] > 0) { + } else if (gTeamHealth[1] > 0) { func_800BA808(gMsg_ID_20262, RCID_FALCO); } - } else if (Rand_ZeroOne() <= D_800CFE5C[arg0->unk_044]) { - func_800660F0(arg0); + } else if (Rand_ZeroOne() <= D_800CFE5C[obj2F4->unk_044]) { + func_800660F0(obj2F4); } } } } -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_0E8.y = 0.0f; +void func_8006654C(Object_2F4* obj2F4) { + obj2F4->unk_10C = 0.4f; + if (obj2F4->obj.pos.y <= D_80177940 + 130.0f) { + obj2F4->obj.pos.y = D_80177940 + 130.0f; + obj2F4->unk_0E8.y = 0.0f; } - arg0->unk_0E8.x = __sinf(arg0->obj.rot.y * M_DTOR) * (*arg0).unk_114; - arg0->unk_0E8.z = __cosf(arg0->obj.rot.y * M_DTOR) * (*arg0).unk_114; - switch (arg0->unk_0B8) { + obj2F4->unk_0E8.x = __sinf(obj2F4->obj.rot.y * M_DTOR) * (*obj2F4).unk_114; + obj2F4->unk_0E8.z = __cosf(obj2F4->obj.rot.y * M_DTOR) * (*obj2F4).unk_114; + switch (obj2F4->unk_0B8) { case 0: - if (arg0->unk_114 < 20.0f) { - arg0->unk_114 += 0.5f; + if (obj2F4->unk_114 < 20.0f) { + obj2F4->unk_114 += 0.5f; } - arg0->unk_0B6++; - if (Animation_GetFrameCount(&D_6029528) < arg0->unk_0B6) { - arg0->unk_0B6 = 0; + obj2F4->unk_0B6++; + if (Animation_GetFrameCount(&D_6029528) < obj2F4->unk_0B6) { + obj2F4->unk_0B6 = 0; } - if ((arg0->obj.rot.z < 15.0f) && (arg0->unk_0B6 < 0x14)) { - arg0->obj.rot.z += 1.0f; + if ((obj2F4->obj.rot.z < 15.0f) && (obj2F4->unk_0B6 < 0x14)) { + obj2F4->obj.rot.z += 1.0f; } - if ((arg0->obj.rot.z > -15.0f) && (arg0->unk_0B6 >= 0x15)) { - arg0->obj.rot.z -= 1.0f; + if ((obj2F4->obj.rot.z > -15.0f) && (obj2F4->unk_0B6 >= 0x15)) { + obj2F4->obj.rot.z -= 1.0f; } - if ((arg0->unk_0B6 == 0x14) || (arg0->unk_0B6 == 0x28)) { - arg0->unk_0B8++; - arg0->unk_0BC = 0x14; + if ((obj2F4->unk_0B6 == 0x14) || (obj2F4->unk_0B6 == 0x28)) { + obj2F4->unk_0B8++; + obj2F4->unk_0BC = 0x14; } break; case 1: - if (arg0->obj.rot.z > 0.0f) { - arg0->obj.rot.z -= 0.5f; + if (obj2F4->obj.rot.z > 0.0f) { + obj2F4->obj.rot.z -= 0.5f; } - if (arg0->obj.rot.z < 0.0f) { - arg0->obj.rot.z += 0.5f; + if (obj2F4->obj.rot.z < 0.0f) { + obj2F4->obj.rot.z += 0.5f; } - if (arg0->unk_114 > 0.0f) { - arg0->unk_114 -= 0.3f; + if (obj2F4->unk_114 > 0.0f) { + obj2F4->unk_114 -= 0.3f; } - if (arg0->unk_0BC == 0) { - arg0->unk_0B8 = 0; + if (obj2F4->unk_0BC == 0) { + obj2F4->unk_0B8 = 0; } break; } - arg0->unk_110 = 0.8f; - if (arg0->unk_0D0 != 0) { - arg0->obj.status = 3; - arg0->unk_0E8.y = (Rand_ZeroOne() * 5.0f) + 6.0f; - if (arg0->unk_0D0 == 2) { - arg0->unk_0E8.y = -2.0f; + obj2F4->unk_110 = 0.8f; + if (obj2F4->unk_0D0 != 0) { + obj2F4->obj.status = 3; + obj2F4->unk_0E8.y = (Rand_ZeroOne() * 5.0f) + 6.0f; + if (obj2F4->unk_0D0 == 2) { + obj2F4->unk_0E8.y = -2.0f; } - arg0->unk_0E8.z = -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); + obj2F4->unk_0E8.z = -15.0f; + obj2F4->unk_10C = 0.5f; + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 30.0f, obj2F4->obj.pos.z, 13.0f); + func_80019218(0x2903A008, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } -void func_8006684C(Object_2F4* arg0) { +void func_8006684C(Object_2F4* obj2F4) { s32 pad; - if (arg0->unk_0BE != 0) { - arg0->unk_0E8.z = 0.0f; - arg0->unk_0E8.x = 0.0f; - arg0->unk_0E8.y = 0.0f; - if (arg0->unk_0BE == 1) { - Object_Kill(&arg0->obj, &arg0->unk_100); - arg0->unk_044 = 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); + if (obj2F4->unk_0BE != 0) { + obj2F4->unk_0E8.z = 0.0f; + obj2F4->unk_0E8.x = 0.0f; + obj2F4->unk_0E8.y = 0.0f; + if (obj2F4->unk_0BE == 1) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + obj2F4->unk_044 = 1; + func_80066254(obj2F4); + func_80019218(0x2903B009, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80077240(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 250.0f, obj2F4->obj.pos.z, 3); gHitCount += 3; D_80177850 = 0xF; } } else { - arg0->obj.rot.x += 11.0f; - arg0->obj.rot.y += 7.0f; - if (arg0->unk_0E8.y < -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; + obj2F4->obj.rot.x += 11.0f; + obj2F4->obj.rot.y += 7.0f; + if (obj2F4->unk_0E8.y < -3.0f) { + func_8007BFFC(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 30.0f, obj2F4->obj.pos.z, 0.0f, 0.0f, 0.0f, 7.0f, 5); + obj2F4->unk_0BE = 3; } } } -void func_800669A0(Object_2F4* arg0) { - if (arg0->unk_0BC != 0) { - if (arg0->unk_0BC == 1) { - Object_Kill(&arg0->obj, &arg0->unk_100); +void func_800669A0(Object_2F4* obj2F4) { + if (obj2F4->unk_0BC != 0) { + if (obj2F4->unk_0BC == 1) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } } 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); + obj2F4->obj.rot.y += 5.0f; + if (obj2F4->unk_0D0 != 0) { + func_8007D0E0(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 130.0f, obj2F4->obj.pos.z, 8.0f); + func_8007BFFC(obj2F4->obj.pos.x, obj2F4->obj.pos.y + 130.0f, obj2F4->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 5); + obj2F4->unk_0BC = 4; + func_8007A6F0(&obj2F4->obj.pos, 0x1903400F); } } } -void func_80066A80(Object_2F4* arg0) { +void func_80066A80(Object_2F4* obj2F4) { } -void func_80066A8C(Object_80* arg0) { +void func_80066A8C(Object_80* obj80) { Vec3f sp64; Vec3f sp58; f32 yf; sp64.z = 0.0f; sp64.x = -120.0f; - if (arg0->obj.rot.y > 90.0f) { + if (obj80->obj.rot.y > 90.0f) { sp64.x = 120.0f; } for (yf = 0.0f; yf < 680.0f; yf += 100.0f) { - Matrix_RotateY(gCalcMatrix, arg0->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, arg0->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, 1); sp64.y = yf; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); - func_8007D0E0(arg0->obj.pos.x + sp58.x, arg0->obj.pos.y + sp58.y, arg0->obj.pos.z + sp58.z, 4.0f); + func_8007D0E0(obj80->obj.pos.x + sp58.x, obj80->obj.pos.y + sp58.y, obj80->obj.pos.z + sp58.z, 4.0f); } } -void func_80066C00(Object_80* arg0) { +void func_80066C00(Object_80* obj80) { Vec3f sp64; Vec3f sp58; f32 zf; sp64.y = 30.0f; sp64.x = -100.0f; - if (arg0->obj.rot.y > 90.0f) { + if (obj80->obj.rot.y > 90.0f) { sp64.x = 100.0f; } - Matrix_RotateY(gCalcMatrix, arg0->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); for (zf = -180.0f; zf <= 0.0f; zf += 30.0f) { sp64.z = zf; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); - func_8007D0E0(arg0->obj.pos.x + sp58.x, arg0->obj.pos.y + sp58.y, arg0->obj.pos.z + sp58.z, + func_8007D0E0(obj80->obj.pos.x + sp58.x, obj80->obj.pos.y + sp58.y, obj80->obj.pos.z + sp58.z, Rand_ZeroOne() + 2.0f); } } -void func_80066D5C(Object_80* arg0) { - switch (arg0->unk_48) { +void func_80066D5C(Object_80* obj80) { + switch (obj80->unk_48) { case 1: - func_80066C00(arg0); - arg0->unk_48++; - func_80019218(0x2900300F, &arg0->unk_70, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80066C00(obj80); + obj80->unk_48++; + func_80019218(0x2900300F, &obj80->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); break; case 2: - arg0->unk_64.x += 0.05f; - arg0->obj.rot.x += arg0->unk_64.x; - if (arg0->obj.rot.x >= 90.0f) { - arg0->obj.rot.x = 90.0f; - arg0->unk_44 = 40; - func_80066A8C(arg0); - arg0->unk_48 = 0; + obj80->unk_64.x += 0.05f; + obj80->obj.rot.x += obj80->unk_64.x; + if (obj80->obj.rot.x >= 90.0f) { + obj80->obj.rot.x = 90.0f; + obj80->unk_44 = 40; + func_80066A8C(obj80); + obj80->unk_48 = 0; D_80178480 = 25; - func_80019218(0x19130003, &arg0->unk_70, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(0x19130003, &obj80->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } break; case 0: @@ -1870,59 +1859,59 @@ void func_80066D5C(Object_80* arg0) { } } -void func_80066E80(Object_80* arg0) { +void func_80066E80(Object_80* obj80) { } -void func_80066E8C(Object_4C* arg0) { - arg0->obj.rot.y += 0.2f; +void func_80066E8C(Object_4C* obj4C) { + obj4C->obj.rot.y += 0.2f; } -void func_80066EA8(Object_80* arg0) { - arg0->obj.rot.y = 0.0f; - if (gPlayer[0].unk_040.x < arg0->obj.pos.x) { - arg0->obj.rot.y = 271.0f; +void func_80066EA8(Object_80* obj80) { + obj80->obj.rot.y = 0.0f; + if (gPlayer[0].unk_040.x < obj80->obj.pos.x) { + obj80->obj.rot.y = 271.0f; } } -void func_80066EE4(Object_4C* arg0) { +void func_80066EE4(Object_4C* obj4C) { } -void func_80066EF0(Object_6C* arg0) { +void func_80066EF0(Object_6C* obj6C) { f32 var_fa1; if ((gPlayer[0].unk_1C8 == 7) || (gPlayer[0].unk_1C8 == 0)) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } if ((D_80177880 == 0) && (D_80161680 == 0)) { var_fa1 = 900.0f; if (gPlayer[0].unk_1CC != 0) { var_fa1 = 600.0f; } - if (gPlayer[0].unk_0AC + var_fa1 < arg0->obj.pos.x) { - Math_SmoothStepToF(&arg0->obj.pos.x, gPlayer[0].unk_0AC + var_fa1, 0.1f, 10.0f, 0.01f); + if (gPlayer[0].unk_0AC + var_fa1 < obj6C->obj.pos.x) { + Math_SmoothStepToF(&obj6C->obj.pos.x, gPlayer[0].unk_0AC + var_fa1, 0.1f, 10.0f, 0.01f); } - if (arg0->obj.pos.x < gPlayer[0].unk_0AC - var_fa1) { - Math_SmoothStepToF(&arg0->obj.pos.x, gPlayer[0].unk_0AC - var_fa1, 0.1f, 10.0f, 0.01f); + if (obj6C->obj.pos.x < gPlayer[0].unk_0AC - var_fa1) { + Math_SmoothStepToF(&obj6C->obj.pos.x, gPlayer[0].unk_0AC - var_fa1, 0.1f, 10.0f, 0.01f); } } - if (arg0->obj.pos.y > 650.0f) { - Math_SmoothStepToF(&arg0->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f); + if (obj6C->obj.pos.y > 650.0f) { + Math_SmoothStepToF(&obj6C->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f); } if (gLevelType == 0) { - if (arg0->obj.pos.y < D_80177940 + 70.0f) { - Math_SmoothStepToF(&arg0->obj.pos.y, D_80177940 + 70.0f, 0.1f, 5.0f, 0.01f); + if (obj6C->obj.pos.y < D_80177940 + 70.0f) { + Math_SmoothStepToF(&obj6C->obj.pos.y, D_80177940 + 70.0f, 0.1f, 5.0f, 0.01f); } if ((gCurrentLevel == LEVEL_AQUAS) && (D_80178284 != 0)) { - arg0->obj.pos.z += 20.0f; + obj6C->obj.pos.z += 20.0f; } - } else if (arg0->obj.pos.y < -500.0f) { - Math_SmoothStepToF(&arg0->obj.pos.y, -500.0f, 0.1f, 5.0f, 0.01f); + } else if (obj6C->obj.pos.y < -500.0f) { + Math_SmoothStepToF(&obj6C->obj.pos.y, -500.0f, 0.1f, 5.0f, 0.01f); } - if ((D_801778E8 != 0) && (arg0->unk_40 == 0) && (gObjects6C[1].obj.status == 2)) { - if (fabsf(arg0->obj.pos.x - gObjects6C[1].obj.pos.x) < 200.0f) { - if (fabsf(arg0->obj.pos.z - gObjects6C[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; + if ((D_801778E8 != 0) && (obj6C->index == 0) && (gObjects6C[1].obj.status == 2)) { + if (fabsf(obj6C->obj.pos.x - gObjects6C[1].obj.pos.x) < 200.0f) { + if (fabsf(obj6C->obj.pos.z - gObjects6C[1].obj.pos.z) < 200.0f) { + obj6C->obj.pos.x = obj6C->obj.pos.x - 5.0f; + obj6C->obj.pos.z = obj6C->obj.pos.z - 5.0f; gObjects6C[1].obj.pos.x += 5.0f; gObjects6C[1].obj.pos.z += 5.0f; } @@ -1930,15 +1919,15 @@ void func_80066EF0(Object_6C* arg0) { } } -void func_800671D0(Object_6C* arg0) { +void func_800671D0(Object_6C* obj6C) { s32 var_v0; Vec3f sp40; Vec3f sp34; - Math_SmoothStepToF(&arg0->unk_50, 10.0f, 1.0f, 2.0f, 0.0f); - if (arg0->unk_50 > 30.0f) { + Math_SmoothStepToF(&obj6C->unk_50, 10.0f, 1.0f, 2.0f, 0.0f); + if (obj6C->unk_50 > 30.0f) { var_v0 = 0; - } else if (arg0->unk_50 > 20.0f) { + } else if (obj6C->unk_50 > 20.0f) { var_v0 = 1; } else { var_v0 = 7; @@ -1949,91 +1938,90 @@ void func_800671D0(Object_6C* arg0) { sp40.y = (Rand_ZeroOne() - 0.5f) * 120.0f; sp40.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp40, &sp34); - func_80078E50(arg0->obj.pos.x + sp34.x, arg0->obj.pos.y + sp34.y, arg0->obj.pos.z + sp34.z, 3.0f); + func_80078E50(obj6C->obj.pos.x + sp34.x, obj6C->obj.pos.y + sp34.y, obj6C->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); + obj6C->obj.rot.y += obj6C->unk_50; + obj6C->obj.rot.y = Math_ModF(obj6C->obj.rot.y, 360.0f); } -void func_80067348(Object_2F4* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8) { - Object_2F4_Initialize(arg0); - arg0->obj.status = 2; - arg0->obj.id = OBJECT_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.x = arg6; - arg0->unk_0E8.y = arg7; - arg0->unk_0E8.z = arg8; - arg0->unk_0BC = (s32) (Rand_ZeroOne() * 15.0f) + 25.0f; - arg0->unk_10C = 0.5f; - func_800612B8(&arg0->unk_01C, arg0->obj.id); +void func_80067348(Object_2F4* obj2F4, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 arg6, f32 arg7, f32 arg8) { + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 2; + obj2F4->obj.id = OBJECT_189; + obj2F4->unk_0B8 = 70; + obj2F4->obj.pos.x = xPos; + obj2F4->obj.pos.y = yPos; + obj2F4->obj.pos.z = zPos; + obj2F4->obj.rot.x = xRot; + obj2F4->obj.rot.y = yRot; + obj2F4->unk_0E8.x = arg6; + obj2F4->unk_0E8.y = arg7; + obj2F4->unk_0E8.z = arg8; + obj2F4->unk_0BC = (s32) (Rand_ZeroOne() * 15.0f) + 25.0f; + obj2F4->unk_10C = 0.5f; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); } -void func_800674B4(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { +void func_800674B4(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 arg5, f32 arg6, f32 arg7) { s32 i; for (i = 59; i >= 50; i--) { if (gObjects2F4[i].obj.status == 0) { - func_80067348(&gObjects2F4[i], arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + func_80067348(&gObjects2F4[i], xPos, yPos, zPos, xRot, yRot, arg5, arg6, arg7); break; } } } -void func_8006753C(Object_2F4* arg0) { - Player* new_var = gPlayer; // fake? +void func_8006753C(Object_2F4* obj2F4) { + Player* player = gPlayer; // fake? s32 i; - arg0->obj.rot.y += 1.0f; + obj2F4->obj.rot.y += 1.0f; if (D_80177880 == 1) { if (gCurrentLevel == LEVEL_SECTOR_Z) { - Math_SmoothStepToF(&arg0->obj.pos.x, -2000.0f, 0.05f, 60.0f, 0.01f); - Math_SmoothStepToF(&arg0->obj.pos.y, -200.0f, 0.05f, 3.0f, 0.01f); - Math_SmoothStepToF(&arg0->obj.pos.z, 0.0f, 0.05f, 0.f, 0.01f); + Math_SmoothStepToF(&obj2F4->obj.pos.x, -2000.0f, 0.05f, 60.0f, 0.01f); + Math_SmoothStepToF(&obj2F4->obj.pos.y, -200.0f, 0.05f, 3.0f, 0.01f); + Math_SmoothStepToF(&obj2F4->obj.pos.z, 0.0f, 0.05f, 0.f, 0.01f); } else { - Math_SmoothStepToF(&arg0->obj.pos.y, 300.0f, 0.05f, 50.0f, 0.01f); + Math_SmoothStepToF(&obj2F4->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].wings.rightState <= 1) || (new_var[0].wings.leftState <= 1)) && - (new_var[0].unk_1CC != 1)) { - arg0->unk_044 = 23; + if (obj2F4->unk_0D0 != 0) { + obj2F4->unk_0D0 = 0; + obj2F4->unk_0CE -= obj2F4->unk_0D6; + if (obj2F4->unk_0CE <= 0) { + func_8007A6F0(&obj2F4->obj.pos, 0x2903A008); + func_8007D2C8(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 5.0f); + if (((player[0].wings.rightState <= 1) || (player[0].wings.leftState <= 1)) && (player[0].unk_1CC != 1)) { + obj2F4->unk_044 = 23; } else if (gPlayer[0].health < 0x80) { - arg0->unk_044 = 25; - } else if ((gLaserStrength[0] == 0) && (new_var[0].unk_1CC != 1)) { - arg0->unk_044 = 9; + obj2F4->unk_044 = 25; + } else if ((gLaserStrength[0] == 0) && (player[0].unk_1CC != 1)) { + obj2F4->unk_044 = 9; } else { - arg0->unk_044 = 5; + obj2F4->unk_044 = 5; } - func_80066254(arg0); + func_80066254(obj2F4); 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, + func_800674B4(D_800CFEC4[i].x + obj2F4->obj.pos.x, D_800CFEC4[i].y + obj2F4->obj.pos.y, + D_800CFEC4[i].z + obj2F4->obj.pos.z, D_800CFF0C[i].y + obj2F4->obj.rot.y, + D_800CFF0C[i].x + obj2F4->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_800794CC(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 0.6f); } - Object_Kill(&arg0->obj, &arg0->unk_100); + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } } gUnkEntities28[63].unk_00 = 1; gUnkEntities28[63].unk_02 = 103; - gUnkEntities28[63].pos.x = arg0->obj.pos.x; - gUnkEntities28[63].pos.y = arg0->obj.pos.y; - gUnkEntities28[63].pos.z = arg0->obj.pos.z; + gUnkEntities28[63].pos.x = obj2F4->obj.pos.x; + gUnkEntities28[63].pos.y = obj2F4->obj.pos.y; + gUnkEntities28[63].pos.z = obj2F4->obj.pos.z; gUnkEntities28[63].unk_10 = 0.0f; } -void func_80067874(Object_2F4* arg0) { +void func_80067874(Object_2F4* obj2F4) { s32 i; Lights_SetOneLight(&gMasterDisp, -60, -60, 60, 150, 150, 150, 20, 20, 20); @@ -2067,210 +2055,211 @@ void func_80067A40(void) { } } -void func_80067B1C(Object_6C* arg0) { - func_80066EF0(arg0); - func_800671D0(arg0); - if (arg0->unk_4C != 0) { +void func_80067B1C(Object_6C* obj6C) { + func_80066EF0(obj6C); + func_800671D0(obj6C); + if (obj6C->unk_4C != 0) { Player** players; - Object_Kill(&arg0->obj, &arg0->unk_5C); + Object_Kill(&obj6C->obj, &obj6C->sfxPos); players = &gPlayer; // seems fake - func_80060F30(&(*players)[arg0->unk_4E].unk_460, 0x4900C024, arg0->unk_4E); + func_80060F30(&(*players)[obj6C->unk_4E].unk_460, 0x4900C024, obj6C->unk_4E); if (gCurrentLevel != LEVEL_TRAINING) { - gLifeCount[arg0->unk_4E]++; + gLifeCount[obj6C->unk_4E]++; } } - if (arg0->unk_48 == 1) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + if (obj6C->unk_48 == 1) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } } -void func_80067BEC(Object_6C* arg0) { - func_80066EF0(arg0); - func_800671D0(arg0); - if (arg0->unk_46 == 0) { - switch (arg0->obj.id) { +void func_80067BEC(Object_6C* obj6C) { + func_80066EF0(obj6C); + func_800671D0(obj6C); + if (obj6C->unk_46 == 0) { + switch (obj6C->obj.id) { case OBJECT_6C_BOMB: - 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; - gBombCount[arg0->unk_4E]++; - func_80060F30(gPlayer[arg0->unk_4E].unk_460_arr, 0x49002005, arg0->unk_4E); - func_80060F30(gPlayer[arg0->unk_4E].unk_460_arr, 0x49002006, arg0->unk_4E); + obj6C->unk_68 = 18.0f; + if (obj6C->unk_4C != 0) { + obj6C->unk_4A = 50; + obj6C->unk_46 = 1; + obj6C->unk_48 = 20; + obj6C->unk_50 = 60.0f; + gBombCount[obj6C->unk_4E]++; + func_80060F30(gPlayer[obj6C->unk_4E].unk_460_arr, 0x49002005, obj6C->unk_4E); + func_80060F30(gPlayer[obj6C->unk_4E].unk_460_arr, 0x49002006, obj6C->unk_4E); } break; case OBJECT_6C_LASERS: - 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; - gLaserStrength[arg0->unk_4E]++; - if (gLaserStrength[arg0->unk_4E] > 2) { - gLaserStrength[arg0->unk_4E] = 2; + obj6C->unk_68 = 18.0f; + if (obj6C->unk_4C != 0) { + obj6C->unk_4A = 50; + obj6C->unk_46 = 1; + obj6C->unk_48 = 20; + obj6C->unk_50 = 60.0f; + gLaserStrength[obj6C->unk_4E]++; + if (gLaserStrength[obj6C->unk_4E] > 2) { + gLaserStrength[obj6C->unk_4E] = 2; } - func_80060F30(gPlayer[arg0->unk_4E].unk_460_arr, 0x49002004, arg0->unk_4E); + func_80060F30(gPlayer[obj6C->unk_4E].unk_460_arr, 0x49002004, obj6C->unk_4E); if (gExpertMode) { - gRightWingHealth[arg0->unk_4E] = gLeftWingHealth[arg0->unk_4E] = 10; + gRightWingHealth[obj6C->unk_4E] = gLeftWingHealth[obj6C->unk_4E] = 10; } else { - gRightWingHealth[arg0->unk_4E] = gLeftWingHealth[arg0->unk_4E] = 60; + gRightWingHealth[obj6C->unk_4E] = gLeftWingHealth[obj6C->unk_4E] = 60; } - D_80177D40[arg0->unk_4E] = 1030; - D_80177D58[arg0->unk_4E] = 1030; + D_80177D40[obj6C->unk_4E] = 1030; + D_80177D58[obj6C->unk_4E] = 1030; } break; } } else { - Math_SmoothStepToF(&arg0->unk_68, 2.5f, 1.0f, 0.5f, 0.0f); - arg0->obj.pos.x += (gPlayer[arg0->unk_4E].unk_074 - arg0->obj.pos.x) * 0.5f; - if (gPlayer[arg0->unk_4E].unk_1CC == 1) { - arg0->obj.pos.y += ((gPlayer[arg0->unk_4E].unk_078 + 50.0f) - arg0->obj.pos.y) * 0.5f; + Math_SmoothStepToF(&obj6C->unk_68, 2.5f, 1.0f, 0.5f, 0.0f); + obj6C->obj.pos.x += (gPlayer[obj6C->unk_4E].unk_074 - obj6C->obj.pos.x) * 0.5f; + if (gPlayer[obj6C->unk_4E].unk_1CC == 1) { + obj6C->obj.pos.y += ((gPlayer[obj6C->unk_4E].unk_078 + 50.0f) - obj6C->obj.pos.y) * 0.5f; } else { - arg0->obj.pos.y += (gPlayer[arg0->unk_4E].unk_078 - arg0->obj.pos.y) * 0.5f; + obj6C->obj.pos.y += (gPlayer[obj6C->unk_4E].unk_078 - obj6C->obj.pos.y) * 0.5f; } - arg0->obj.pos.z += (gPlayer[arg0->unk_4E].unk_138 - arg0->obj.pos.z) * 0.5f; - if (arg0->unk_48 == 0) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + obj6C->obj.pos.z += (gPlayer[obj6C->unk_4E].unk_138 - obj6C->obj.pos.z) * 0.5f; + if (obj6C->unk_48 == 0) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } } } -void func_80067F6C(Object_6C* arg0) { +void func_80067F6C(Object_6C* obj6C) { if ((D_801778E8 == 0) && ((gPlayer[0].wings.leftState <= 1) || (gPlayer[0].wings.rightState <= 1))) { - arg0->obj.id = OBJECT_6C_WING_REPAIR; - 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); + obj6C->obj.id = OBJECT_6C_WING_REPAIR; + Object_Set1C(&obj6C->unk_1C, obj6C->obj.id); + obj6C->unk_48 = 2000; + func_80019218(0x1900302B, &obj6C->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } else { - func_80067BEC(arg0); + func_80067BEC(obj6C); } } -void func_80068020(Object_6C* arg0) { +void func_80068020(Object_6C* obj6C) { Vec3f sp4C; Vec3f sp40; - switch (arg0->unk_46) { + switch (obj6C->unk_46) { case 0: - Math_SmoothStepToF(&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 = 50; - if (arg0->obj.id == OBJECT_6C_SILVER_RING) { - gPlayer[arg0->unk_4E].heal += 0x20; - func_80060F30(gPlayer[arg0->unk_4E].unk_460_arr, 0x4900200E, arg0->unk_4E); - } else if (arg0->obj.id == OBJECT_6C_GOLD_RING) { + Math_SmoothStepToF(&obj6C->unk_68, 0.4f, 1.0f, 0.05f, 0.0f); + func_80066EF0(obj6C); + func_800671D0(obj6C); + if (obj6C->unk_4C != 0) { + obj6C->unk_46 = 1; + obj6C->unk_48 = 50; + if (obj6C->obj.id == OBJECT_6C_SILVER_RING) { + gPlayer[obj6C->unk_4E].heal += 0x20; + func_80060F30(gPlayer[obj6C->unk_4E].unk_460_arr, 0x4900200E, obj6C->unk_4E); + } else if (obj6C->obj.id == OBJECT_6C_GOLD_RING) { gGoldRingCount[0]++; if (gGoldRingCount[0] == 3) { - func_80060F30(gPlayer[arg0->unk_4E].unk_460_arr, 0x49008015, arg0->unk_4E); + func_80060F30(gPlayer[obj6C->unk_4E].unk_460_arr, 0x49008015, obj6C->unk_4E); } else if (gGoldRingCount[0] == 6) { - func_80060F30(gPlayer[arg0->unk_4E].unk_460_arr, 0x4900C024, arg0->unk_4E); + func_80060F30(gPlayer[obj6C->unk_4E].unk_460_arr, 0x4900C024, obj6C->unk_4E); if (gCurrentLevel != LEVEL_TRAINING) { - gLifeCount[arg0->unk_4E]++; + gLifeCount[obj6C->unk_4E]++; } - gPlayer[arg0->unk_4E].heal += 0x20; - func_80077240(gPlayer[arg0->unk_4E].unk_074, gPlayer[arg0->unk_4E].unk_078, - gPlayer[arg0->unk_4E].unk_138, 101); + gPlayer[obj6C->unk_4E].heal += 0x20; + func_80077240(gPlayer[obj6C->unk_4E].unk_074, gPlayer[obj6C->unk_4E].unk_078, + gPlayer[obj6C->unk_4E].unk_138, 101); } else { - gPlayer[arg0->unk_4E].heal += 0x20; - func_80060F30(gPlayer[arg0->unk_4E].unk_460_arr, 0x49003013, arg0->unk_4E); + gPlayer[obj6C->unk_4E].heal += 0x20; + func_80060F30(gPlayer[obj6C->unk_4E].unk_460_arr, 0x49003013, obj6C->unk_4E); } } else { - gPlayer[arg0->unk_4E].heal += 0x80; - func_80060F30(gPlayer[arg0->unk_4E].unk_460_arr, 0x4900200D, arg0->unk_4E); + gPlayer[obj6C->unk_4E].heal += 0x80; + func_80060F30(gPlayer[obj6C->unk_4E].unk_460_arr, 0x4900200D, obj6C->unk_4E); } } - if ((arg0->obj.id == OBJECT_6C_GOLD_RING) && (arg0->unk_48 == 1)) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + if ((obj6C->obj.id == OBJECT_6C_GOLD_RING) && (obj6C->unk_48 == 1)) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } break; case 1: - if (arg0->unk_48 > 30) { - Math_SmoothStepToF(&arg0->unk_68, 1.0f, 1.0f, 0.06f, 0.0f); + if (obj6C->unk_48 > 30) { + Math_SmoothStepToF(&obj6C->unk_68, 1.0f, 1.0f, 0.06f, 0.0f); } else { - Math_SmoothStepToF(&arg0->unk_68, 0.0f, 1.0f, 0.06f, 0.0f); + Math_SmoothStepToF(&obj6C->unk_68, 0.0f, 1.0f, 0.06f, 0.0f); } - arg0->obj.pos.x += (gPlayer[arg0->unk_4E].unk_074 - arg0->obj.pos.x) * 0.5f; - if (gPlayer[arg0->unk_4E].unk_1CC == 1) { - arg0->obj.pos.y += (gPlayer[arg0->unk_4E].unk_078 + 50.0f - arg0->obj.pos.y) * 0.5f; + obj6C->obj.pos.x += (gPlayer[obj6C->unk_4E].unk_074 - obj6C->obj.pos.x) * 0.5f; + if (gPlayer[obj6C->unk_4E].unk_1CC == 1) { + obj6C->obj.pos.y += (gPlayer[obj6C->unk_4E].unk_078 + 50.0f - obj6C->obj.pos.y) * 0.5f; } else { - arg0->obj.pos.y += (gPlayer[arg0->unk_4E].unk_078 - arg0->obj.pos.y) * 0.5f; + obj6C->obj.pos.y += (gPlayer[obj6C->unk_4E].unk_078 - obj6C->obj.pos.y) * 0.5f; } if ((gPlayer[0].unk_238 != 0) && (D_80177880 == 0)) { - arg0->obj.pos.z += (gPlayer[arg0->unk_4E].unk_138 - 300.0f - arg0->obj.pos.z) * 0.3f; + obj6C->obj.pos.z += (gPlayer[obj6C->unk_4E].unk_138 - 300.0f - obj6C->obj.pos.z) * 0.3f; } else { - arg0->obj.pos.z += (gPlayer[arg0->unk_4E].unk_138 - arg0->obj.pos.z) * 0.5f; + obj6C->obj.pos.z += (gPlayer[obj6C->unk_4E].unk_138 - obj6C->obj.pos.z) * 0.5f; } - arg0->obj.rot.z += 22.0f; - Math_SmoothStepToAngle(&arg0->obj.rot.y, Math_RadToDeg(-gPlayer[arg0->unk_4E].unk_058), 0.2f, 10.0f, 0.0f); - if (arg0->unk_48 == 0) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + obj6C->obj.rot.z += 22.0f; + Math_SmoothStepToAngle(&obj6C->obj.rot.y, Math_RadToDeg(-gPlayer[obj6C->unk_4E].unk_058), 0.2f, 10.0f, + 0.0f); + if (obj6C->unk_48 == 0) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } - if (arg0->unk_68 > 0.3f) { - Matrix_RotateY(gCalcMatrix, arg0->obj.rot.y * M_DTOR, 0); + if (obj6C->unk_68 > 0.3f) { + Matrix_RotateY(gCalcMatrix, obj6C->obj.rot.y * M_DTOR, 0); Matrix_RotateZ(gCalcMatrix, gFrameCount * 37.0f * M_DTOR, 1); sp4C.x = 0.0f; - sp4C.y = arg0->unk_68 * 100.0f; + sp4C.y = obj6C->unk_68 * 100.0f; sp4C.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp4C, &sp40); - func_80078E50(arg0->obj.pos.x + sp40.x, arg0->obj.pos.y + sp40.y, arg0->obj.pos.z + sp40.z, 3.5f); + func_80078E50(obj6C->obj.pos.x + sp40.x, obj6C->obj.pos.y + sp40.y, obj6C->obj.pos.z + sp40.z, 3.5f); } break; } } -void func_800685D8(Object_6C* arg0) { - func_80068020(arg0); +void func_800685D8(Object_6C* obj6C) { + func_80068020(obj6C); } -void func_800685F8(Object_6C* arg0) { - func_80068020(arg0); +void func_800685F8(Object_6C* obj6C) { + func_80068020(obj6C); } -void func_80068618(Object_6C* arg0) { - func_80066EF0(arg0); - func_800671D0(arg0); - if (arg0->unk_4C != 0) { +void func_80068618(Object_6C* obj6C) { + func_80066EF0(obj6C); + func_800671D0(obj6C); + if (obj6C->unk_4C != 0) { func_80067A40(); - Object_Kill(&arg0->obj, &arg0->unk_5C); + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } - if (arg0->unk_48 == 1) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + if (obj6C->unk_48 == 1) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } } -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 += (gPlayer[arg0->unk_4E].unk_074 - arg0->obj.pos.x) * 0.3f; - arg0->obj.pos.y += (gPlayer[arg0->unk_4E].unk_078 - arg0->obj.pos.y) * 0.3f; - arg0->obj.pos.z += (gPlayer[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; +void func_80068688(Object_6C* obj6C) { + func_80066EF0(obj6C); + if (obj6C->unk_46 > 0) { + if (obj6C->unk_46 == 1) { + obj6C->obj.rot.z -= 10.0f; + obj6C->obj.pos.x += (gPlayer[obj6C->unk_4E].unk_074 - obj6C->obj.pos.x) * 0.3f; + obj6C->obj.pos.y += (gPlayer[obj6C->unk_4E].unk_078 - obj6C->obj.pos.y) * 0.3f; + obj6C->obj.pos.z += (gPlayer[obj6C->unk_4E].unk_138 - obj6C->obj.pos.z) * 0.3f; + obj6C->unk_68 -= 5.0f; + if (obj6C->unk_68 < 0.0f) { + obj6C->unk_68 = 0.0f; } } - arg0->unk_44 -= 10; - if (arg0->unk_44 < 0) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + obj6C->unk_44 -= 10; + if (obj6C->unk_44 < 0) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } } else { - arg0->unk_68 = 100.0f; + obj6C->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; - gPlayer[arg0->unk_4E].unk_27C = 100; + obj6C->unk_46 = 2; + obj6C->unk_44 = 0xFF; + } else if (obj6C->unk_4C != 0) { + obj6C->unk_46 = 1; + obj6C->unk_44 = 0xFF; + gPlayer[obj6C->unk_4E].unk_27C = 100; func_80019218(D_800CFF54[D_80177E80], &gPlayer[0].unk_460, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); if (D_80177E80 == 0) { gPlayer[0].unk_110 = 0.0f; @@ -2287,77 +2276,77 @@ void func_80068688(Object_6C* arg0) { } } -void func_80068914(Object_6C* arg0) { +void func_80068914(Object_6C* obj6C) { s32 i; - func_80066EF0(arg0); - arg0->unk_58 -= arg0->unk_44; - if (arg0->unk_46 > 0) { - arg0->unk_44++; - arg0->obj.pos.x += (gPlayer[arg0->unk_4E].unk_074 - arg0->obj.pos.x) * 0.3f; - if (gPlayer[arg0->unk_4E].unk_1CC == 1) { - arg0->obj.pos.y += (gPlayer[arg0->unk_4E].unk_078 + 50.0f - arg0->obj.pos.y) * 0.3f; + func_80066EF0(obj6C); + obj6C->unk_58 -= obj6C->unk_44; + if (obj6C->unk_46 > 0) { + obj6C->unk_44++; + obj6C->obj.pos.x += (gPlayer[obj6C->unk_4E].unk_074 - obj6C->obj.pos.x) * 0.3f; + if (gPlayer[obj6C->unk_4E].unk_1CC == 1) { + obj6C->obj.pos.y += (gPlayer[obj6C->unk_4E].unk_078 + 50.0f - obj6C->obj.pos.y) * 0.3f; } else { - arg0->obj.pos.y += (gPlayer[arg0->unk_4E].unk_078 - arg0->obj.pos.y) * 0.3f; + obj6C->obj.pos.y += (gPlayer[obj6C->unk_4E].unk_078 - obj6C->obj.pos.y) * 0.3f; } if (gPlayer[0].unk_238 != 0) { - arg0->obj.pos.z += (gPlayer[arg0->unk_4E].unk_138 - 200.0f - arg0->obj.pos.z) * 0.3f; + obj6C->obj.pos.z += (gPlayer[obj6C->unk_4E].unk_138 - 200.0f - obj6C->obj.pos.z) * 0.3f; } else { - arg0->obj.pos.z += (gPlayer[arg0->unk_4E].unk_138 - 100.0f - arg0->obj.pos.z) * 0.3f; + obj6C->obj.pos.z += (gPlayer[obj6C->unk_4E].unk_138 - 100.0f - obj6C->obj.pos.z) * 0.3f; } - if (arg0->unk_48 == 0) { - Math_SmoothStepToF(&arg0->unk_68, 5.0f, 0.2f, 15.0f, 0.01f); - Math_SmoothStepToF(&arg0->unk_50, 0.0f, 0.1f, 0.03f, 0.0f); - Math_SmoothStepToF(&arg0->unk_54, 4.0f, 0.1f, 0.2f, 0.01f); + if (obj6C->unk_48 == 0) { + Math_SmoothStepToF(&obj6C->unk_68, 5.0f, 0.2f, 15.0f, 0.01f); + Math_SmoothStepToF(&obj6C->unk_50, 0.0f, 0.1f, 0.03f, 0.0f); + Math_SmoothStepToF(&obj6C->unk_54, 4.0f, 0.1f, 0.2f, 0.01f); } - if (arg0->unk_68 <= 6.5f) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + if (obj6C->unk_68 <= 6.5f) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } } 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) { - gPlayer[arg0->unk_4E].heal = 0x80; - arg0->unk_46++; - arg0->unk_48 = 15; + obj6C->unk_44 = 2; + obj6C->unk_50 = 1.0f; + obj6C->unk_54 = 1.0f; + obj6C->unk_68 = 100.0f; + if (obj6C->unk_4C != 0) { + gPlayer[obj6C->unk_4E].heal = 0x80; + obj6C->unk_46++; + obj6C->unk_48 = 15; D_80161A8C = D_80161A88; - D_80177CB0 = -arg0->obj.pos.z; + D_80177CB0 = -obj6C->obj.pos.z; D_80177CB0 -= 250.0f; D_80177CA0 = D_80177DC8; D_80161A50 = D_80161684; - D_80161A9C = gHitCount; + gSavedHitCount = gHitCount; for (i = 1; i < 4; i++) { - D_801778D0[i] = D_801778B0[i]; + gSavedTeamHealth[i] = gTeamHealth[i]; } func_80019218(0x4900400F, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } } } -void func_80068C48(Object_6C* arg0) { - if (arg0->unk_4C != 0) { - Object_Kill(&arg0->obj, &arg0->unk_5C); +void func_80068C48(Object_6C* obj6C) { + if (obj6C->unk_4C != 0) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); D_80177E80++; } } -void func_80068C88(Object_6C* arg0) { - D_80161680 = arg0->obj.id; +void func_80068C88(Object_6C* obj6C) { + D_80161680 = obj6C->obj.id; if (gPlayer[0].unk_1C8 != 3) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } else if (((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X)) && (D_8017827C == 1)) { gPlayer[0].unk_1C8 = 7; gPlayer[0].unk_1D0 = 0; - Object_Kill(&arg0->obj, &arg0->unk_5C); + Object_Kill(&obj6C->obj, &obj6C->sfxPos); } else if (gCurrentLevel == LEVEL_TRAINING) { gPlayer[0].unk_1C8 = 9; gPlayer[0].unk_1D0 = 0; - Object_Kill(&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 - gPlayer[0].unk_074) < 1000.0f)) { - switch (arg0->obj.id) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); + } else if (obj6C->unk_46 == 0) { + if (((obj6C->obj.pos.z + D_80177D20) > -2700.0f) && (fabsf(obj6C->obj.pos.x - gPlayer[0].unk_074) < 1000.0f)) { + switch (obj6C->obj.id) { case OBJECT_331: case OBJECT_332: case OBJECT_333: @@ -2373,150 +2362,153 @@ void func_80068C88(Object_6C* arg0) { break; } } - if (arg0->unk_4C != 0) { - Object_Kill(&arg0->obj, &arg0->unk_5C); + if (obj6C->unk_4C != 0) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); gPlayer[0].unk_0B4 = 0.0f; - gPlayer[0].unk_210 = arg0->unk_68 * 0.05f; - switch (arg0->obj.id) { + gPlayer[0].unk_210 = obj6C->unk_68 * 0.05f; + switch (obj6C->obj.id) { case OBJECT_328: - if (arg0->obj.pos.x < gPlayer[0].unk_074) { + if (obj6C->obj.pos.x < gPlayer[0].unk_074) { gPlayer[0].unk_118 = -30.0f; - gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + arg0->unk_68; + gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + obj6C->unk_68; } else { gPlayer[0].unk_118 = 30.0f; - gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - arg0->unk_68; + gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - obj6C->unk_68; } break; case OBJECT_329: gPlayer[0].unk_118 = 30.0f; - gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - arg0->unk_68; + gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC - obj6C->unk_68; break; case OBJECT_330: gPlayer[0].unk_118 = -30.0f; - gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + arg0->unk_68; + gPlayer[0].unk_0B8 = gPlayer[0].unk_0AC + obj6C->unk_68; break; case OBJECT_331: - if (arg0->obj.pos.y < gPlayer[0].unk_078) { + if (obj6C->obj.pos.y < gPlayer[0].unk_078) { gPlayer[0].unk_124 = 30.0f; - gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + arg0->unk_68; + gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + obj6C->unk_68; } else { gPlayer[0].unk_124 = -30.0f; - gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - arg0->unk_68; + gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - obj6C->unk_68; } break; case OBJECT_332: gPlayer[0].unk_124 = 30.0f; - gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + arg0->unk_68; + gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 + obj6C->unk_68; break; case OBJECT_333: gPlayer[0].unk_124 = -30.0f; - gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - arg0->unk_68; + gPlayer[0].unk_0BC = gPlayer[0].unk_0B0 - obj6C->unk_68; break; } } } } -void func_80068FE0(Object_4C* arg0) { - arg0->obj.rot.y = - (Math_Atan2F(gPlayer[0].unk_040.x - arg0->obj.pos.x, gPlayer[0].unk_040.z - (arg0->obj.pos.z + D_80177D20)) * +void func_80068FE0(Object_4C* obj4C) { + obj4C->obj.rot.y = + (Math_Atan2F(gPlayer[0].unk_040.x - obj4C->obj.pos.x, gPlayer[0].unk_040.z - (obj4C->obj.pos.z + D_80177D20)) * 180.0f) / M_PI; - if (arg0->unk_46 != 0) { - arg0->obj.status = 0; - func_8007A6F0(&arg0->obj.pos, 0x1903400F); - switch (arg0->obj.id) { + if (obj4C->unk_46 != 0) { + obj4C->obj.status = 0; + func_8007A6F0(&obj4C->obj.pos, 0x1903400F); + switch (obj4C->obj.id) { case OBJECT_161: - func_8007D074(arg0->obj.pos.x, arg0->obj.pos.y + 160.0f, arg0->obj.pos.z, 4.0f); + func_8007D074(obj4C->obj.pos.x, obj4C->obj.pos.y + 160.0f, obj4C->obj.pos.z, 4.0f); break; default: case OBJECT_169: - func_8007D074(arg0->obj.pos.x, arg0->obj.pos.y + 96.0f, arg0->obj.pos.z, 5.0f); + func_8007D074(obj4C->obj.pos.x, obj4C->obj.pos.y + 96.0f, obj4C->obj.pos.z, 5.0f); break; } } } -void func_800690D0(s32 arg0, s32 objId) { +void func_800690D0(s32 index, s32 objId) { switch (objId) { case OBJECT_200: - func_8007717C(&gObjects2F4[arg0]); + func_8007717C(&gObjects2F4[index]); break; case OBJECT_197: if (gCurrentLevel == LEVEL_VENOM_2) { - func_E9F1D0_801888F4(&gObjects2F4[arg0]); + func_E9F1D0_801888F4(&gObjects2F4[index]); } else { - func_800763A4(&gObjects2F4[arg0]); + func_800763A4(&gObjects2F4[index]); } break; case OBJECT_202: - func_800763A4(&gObjects2F4[arg0]); + func_800763A4(&gObjects2F4[index]); break; case OBJECT_194: - func_8006B0A0(&gObjects2F4[arg0]); + func_8006B0A0(&gObjects2F4[index]); break; case OBJECT_186: - func_E08400_80187B08(&gObjects2F4[arg0]); + func_E08400_80187B08(&gObjects2F4[index]); break; case OBJECT_181: - Object_Kill(&gObjects2F4[arg0].obj, &gObjects2F4[arg0].unk_100); - func_8007D2C8(gObjects2F4[arg0].obj.pos.x, gObjects2F4[arg0].obj.pos.y, gObjects2F4[arg0].obj.pos.z, 20.0f); + Object_Kill(&gObjects2F4[index].obj, &gObjects2F4[index].sfxPos); + func_8007D2C8(gObjects2F4[index].obj.pos.x, gObjects2F4[index].obj.pos.y, gObjects2F4[index].obj.pos.z, + 20.0f); break; case OBJECT_182: - Object_Kill(&gObjects2F4[arg0].obj, &gObjects2F4[arg0].unk_100); - func_8007D2C8(gObjects2F4[arg0].obj.pos.x, gObjects2F4[arg0].obj.pos.y, gObjects2F4[arg0].obj.pos.z, 10.0f); - func_80066254(&gObjects2F4[arg0]); + Object_Kill(&gObjects2F4[index].obj, &gObjects2F4[index].sfxPos); + func_8007D2C8(gObjects2F4[index].obj.pos.x, gObjects2F4[index].obj.pos.y, gObjects2F4[index].obj.pos.z, + 10.0f); + func_80066254(&gObjects2F4[index]); break; case OBJECT_192: - func_8006684C(&gObjects2F4[arg0]); + func_8006684C(&gObjects2F4[index]); break; case OBJECT_306: - func_E6A810_801990DC(&gObjects408[arg0]); + func_E6A810_801990DC(&gObjects408[index]); break; case OBJECT_232: - func_E6A810_8018B720(&gObjects2F4[arg0]); + func_E6A810_8018B720(&gObjects2F4[index]); break; case OBJECT_319: - func_E51970_80198594(&gObjects408[arg0]); + func_E51970_80198594(&gObjects408[index]); break; } } -void func_800693E8(Object_2F4* arg0) { - arg0->obj.pos.x += arg0->unk_0E8.x; - arg0->obj.pos.z += arg0->unk_0E8.z; - arg0->obj.pos.y += arg0->unk_0E8.y; - arg0->unk_0E8.y -= arg0->unk_10C; +void func_800693E8(Object_2F4* obj2F4) { + obj2F4->obj.pos.x += obj2F4->unk_0E8.x; + obj2F4->obj.pos.z += obj2F4->unk_0E8.z; + obj2F4->obj.pos.y += obj2F4->unk_0E8.y; + obj2F4->unk_0E8.y -= obj2F4->unk_10C; - if ((D_80161AB8 != 0) && (arg0->obj.id != OBJECT_198) && - ((gCurrentLevel != LEVEL_MACBETH) || (arg0->obj.id == OBJECT_200))) { + if ((D_80161AB8 != 0) && (obj2F4->obj.id != OBJECT_198) && + ((gCurrentLevel != LEVEL_MACBETH) || (obj2F4->obj.id == OBJECT_200))) { f32 var_fv0 = 4000.0f; - if ((arg0->obj.id == OBJECT_236) || (gCurrentLevel == LEVEL_MACBETH) || - ((arg0->obj.id == OBJECT_200) && (arg0->unk_0B4 == 56))) { + if ((obj2F4->obj.id == OBJECT_236) || (gCurrentLevel == LEVEL_MACBETH) || + ((obj2F4->obj.id == OBJECT_200) && (obj2F4->unk_0B4 == 56))) { var_fv0 = 8000.0f; } else if (gPlayer[0].unk_1C8 == 8) { var_fv0 = 100000.0f; } - if (((gPlayer[0].unk_040.z + arg0->unk_01C.unk_10) < (arg0->obj.pos.z + D_80177D20)) || - ((arg0->obj.pos.z + D_80177D20) < -15000.0f) || (arg0->obj.pos.y < (gPlayer[0].unk_0B0 - var_fv0)) || - ((gPlayer[0].unk_0B0 + var_fv0) < arg0->obj.pos.y) || ((gPlayer[0].unk_0AC + var_fv0) < arg0->obj.pos.x) || - (arg0->obj.pos.x < (gPlayer[0].unk_0AC - var_fv0))) { - Object_Kill(&arg0->obj, &arg0->unk_100); - switch (arg0->obj.id) { + if (((gPlayer[0].unk_040.z + obj2F4->unk_01C.unk_10) < (obj2F4->obj.pos.z + D_80177D20)) || + ((obj2F4->obj.pos.z + D_80177D20) < -15000.0f) || (obj2F4->obj.pos.y < (gPlayer[0].unk_0B0 - var_fv0)) || + ((gPlayer[0].unk_0B0 + var_fv0) < obj2F4->obj.pos.y) || + ((gPlayer[0].unk_0AC + var_fv0) < obj2F4->obj.pos.x) || + (obj2F4->obj.pos.x < (gPlayer[0].unk_0AC - var_fv0))) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); + switch (obj2F4->obj.id) { case OBJECT_236: D_801784A4 = 0; break; case OBJECT_229: - func_E6A810_8018E3B0(arg0); + func_E6A810_8018E3B0(obj2F4); break; case OBJECT_194: - D_80176550[arg0->unk_046] = 0; + D_80176550[obj2F4->unk_046] = 0; break; case OBJECT_200: - if ((arg0->unk_0B4 >= 200) && (arg0->unk_0B4 < 300)) { - D_80176550[arg0->unk_046] = 0; - } else if ((arg0->unk_0B4 == 38) && (arg0->unk_046 != 2)) { + if ((obj2F4->unk_0B4 >= 200) && (obj2F4->unk_0B4 < 300)) { + D_80176550[obj2F4->unk_046] = 0; + } else if ((obj2F4->unk_0B4 == 38) && (obj2F4->unk_046 != 2)) { D_80177E80 = -1; } break; @@ -2528,28 +2520,28 @@ void func_800693E8(Object_2F4* arg0) { } } -void func_80069658(Object_408* arg0) { - arg0->obj.pos.x += arg0->unk_06C; - arg0->obj.pos.y += arg0->unk_070; - arg0->obj.pos.z += arg0->unk_074; - arg0->unk_070 -= arg0->unk_084; - if ((D_80161AB8 != 0) && ((arg0->obj.pos.z + D_80177D20) > (arg0->unk_01C.unk_10 - gPlayer[0].unk_040.z))) { +void func_80069658(Object_408* obj408) { + obj408->obj.pos.x += obj408->unk_06C.x; + obj408->obj.pos.y += obj408->unk_06C.y; + obj408->obj.pos.z += obj408->unk_06C.z; + obj408->unk_06C.y -= obj408->unk_084; + if ((D_80161AB8 != 0) && ((obj408->obj.pos.z + D_80177D20) > (obj408->unk_01C.unk_10 - gPlayer[0].unk_040.z))) { if (gPlayer[0].unk_040.z) {} // fake - Object_Kill(&arg0->obj, &arg0->unk_3FC); + Object_Kill(&obj408->obj, &obj408->sfxPos); } } -void func_800696F8(Object_80* arg0) { +void func_800696F8(Object_80* obj80) { if (gPlayer[0].unk_1C8 == 2) { - arg0->obj.pos.z += arg0->unk_60; - if (arg0->unk_1C.unk_10 < arg0->obj.pos.z) { - Object_Kill(&arg0->obj, &arg0->unk_70); + obj80->obj.pos.z += obj80->unk_60; + if (obj80->unk_1C.unk_10 < obj80->obj.pos.z) { + Object_Kill(&obj80->obj, &obj80->sfxPos); } } else if ((D_80177880 == 0) && (D_80178284 != 2)) { - f32 temp_fv0 = fabsf(arg0->obj.pos.x - gPlayer[0].unk_040.x); + f32 temp_fv0 = fabsf(obj80->obj.pos.x - gPlayer[0].unk_040.x); f32 var_fa0 = 500.0f; - if ((arg0->obj.id == OBJECT_6) || (arg0->obj.id == OBJECT_7)) { + if ((obj80->obj.id == OBJECT_6) || (obj80->obj.id == OBJECT_7)) { var_fa0 = 1000.0f; } temp_fv0 = ((var_fa0 > temp_fv0) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f); @@ -2557,284 +2549,284 @@ void func_800696F8(Object_80* arg0) { temp_fv0 = 0.0f; } temp_fv0 -= gPlayer[0].unk_040.z; - if ((arg0->unk_1C.unk_10 - temp_fv0) < (arg0->obj.pos.z + D_80177D20)) { - Object_Kill(&arg0->obj, &arg0->unk_70); + if ((obj80->unk_1C.unk_10 - temp_fv0) < (obj80->obj.pos.z + D_80177D20)) { + Object_Kill(&obj80->obj, &obj80->sfxPos); } } } -void func_80069858(Object_4C* arg0) { +void func_80069858(Object_4C* obj4C) { if (D_80161AB8 != 0) { - f32 temp_fv0 = fabsf(arg0->obj.pos.x - gPlayer[0].unk_040.x); + f32 temp_fv0 = fabsf(obj4C->obj.pos.x - gPlayer[0].unk_040.x); f32 var_fa0 = 500.0f; - if (((arg0->obj.id == OBJECT_164) && ((arg0->unk_45 == 6) || (arg0->unk_45 == 7))) || - (arg0->obj.id == OBJECT_8)) { + if (((obj4C->obj.id == OBJECT_164) && ((obj4C->unk_45 == 6) || (obj4C->unk_45 == 7))) || + (obj4C->obj.id == OBJECT_8)) { var_fa0 = 1000.0f; } temp_fv0 = ((var_fa0 > temp_fv0) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f); temp_fv0 -= gPlayer[0].unk_040.z; - if ((arg0->unk_1C.unk_10 - temp_fv0) < (arg0->obj.pos.z + D_80177D20)) { - arg0->obj.status = 0; + if ((obj4C->unk_1C.unk_10 - temp_fv0) < (obj4C->obj.pos.z + D_80177D20)) { + obj4C->obj.status = 0; } } } -void func_80069924(Object_8C* arg0) { - arg0->obj.pos.x += arg0->unk_54.x; - arg0->obj.pos.y += arg0->unk_54.y; - arg0->obj.pos.z += arg0->unk_54.z; +void func_80069924(Object_8C* obj8C) { + obj8C->obj.pos.x += obj8C->unk_54.x; + obj8C->obj.pos.y += obj8C->unk_54.y; + obj8C->obj.pos.z += obj8C->unk_54.z; if (D_80161AB8 != 0) { - if ((gPlayer[0].unk_040.z + arg0->unk_1C.unk_10) < (arg0->obj.pos.z + D_80177D20)) { - Object_Kill(&arg0->obj, &arg0->unk_80); - } else if ((fabsf(arg0->obj.pos.y - gPlayer[0].unk_040.y) > 25000.0f) || - (fabsf(arg0->obj.pos.x - gPlayer[0].unk_040.x) > 25000.0f)) { - Object_Kill(&arg0->obj, &arg0->unk_80); + if ((gPlayer[0].unk_040.z + obj8C->unk_1C.unk_10) < (obj8C->obj.pos.z + D_80177D20)) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); + } else if ((fabsf(obj8C->obj.pos.y - gPlayer[0].unk_040.y) > 25000.0f) || + (fabsf(obj8C->obj.pos.x - gPlayer[0].unk_040.x) > 25000.0f)) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } } -void func_80069A10(Object_6C* arg0) { +void func_80069A10(Object_6C* obj6C) { if (D_80161AB8 != 0) { f32 temp = (0.0f - gPlayer[0].unk_040.z); - if ((arg0->unk_1C.unk_10 - temp) < (arg0->obj.pos.z + D_80177D20)) { - Object_Kill(&arg0->obj, &arg0->unk_5C); - if ((arg0->obj.id == OBJECT_326) && (arg0->unk_46 == 0)) { + if ((obj6C->unk_1C.unk_10 - temp) < (obj6C->obj.pos.z + D_80177D20)) { + Object_Kill(&obj6C->obj, &obj6C->sfxPos); + if ((obj6C->obj.id == OBJECT_6C_METEO_WARP) && (obj6C->unk_46 == 0)) { D_80177E80 = -1; } } } } -void func_80069AAC(Object_2F4* arg0) { +void Object_2F4_Update(Object_2F4* obj2F4) { s32 i; - if (arg0->unk_0BC != 0) { - arg0->unk_0BC--; + if (obj2F4->unk_0BC != 0) { + obj2F4->unk_0BC--; } - if (arg0->unk_0BE != 0) { - arg0->unk_0BE--; + if (obj2F4->unk_0BE != 0) { + obj2F4->unk_0BE--; } - if (arg0->unk_0C0 != 0) { - arg0->unk_0C0--; + if (obj2F4->unk_0C0 != 0) { + obj2F4->unk_0C0--; } - if (arg0->unk_0C2 != 0) { - arg0->unk_0C2--; + if (obj2F4->unk_0C2 != 0) { + obj2F4->unk_0C2--; } - if (arg0->unk_0C6 != 0) { - arg0->unk_0C6--; + if (obj2F4->unk_0C6 != 0) { + obj2F4->unk_0C6--; } if (D_801778E8 != 0) { for (i = 0; i < gCamCount; i++) { - if (arg0->unk_0CA[i] != 0) { + if (obj2F4->unk_0CA[i] != 0) { if (!(gCurrentInput[i].button & A_BUTTON)) { - arg0->unk_0CA[i]--; + obj2F4->unk_0CA[i]--; } D_801779C8[i] = 0; } } - } else if (arg0->unk_0CA[0] != 0) { + } else if (obj2F4->unk_0CA[0] != 0) { if (!(gCurrentInput[D_80177AF8].button & A_BUTTON)) { - arg0->unk_0CA[0]--; + obj2F4->unk_0CA[0]--; } D_801779C8[0] = 0; } - if (arg0->unk_0C4 != 0) { - arg0->unk_0C4--; + if (obj2F4->unk_0C4 != 0) { + obj2F4->unk_0C4--; } - switch (arg0->obj.status) { + switch (obj2F4->obj.status) { case 1: - arg0->obj.status = 2; - func_80063F90(arg0->unk_040, arg0->obj.id); - if (arg0->obj.id != OBJECT_252) { - func_800693E8(arg0); + obj2F4->obj.status = 2; + Object_Init(obj2F4->unk_040, obj2F4->obj.id); + if (obj2F4->obj.id != OBJECT_252) { + func_800693E8(obj2F4); } break; case 2: - func_800693E8(arg0); - if ((arg0->obj.status != 0) && (arg0->unk_01C.action != NULL)) { - arg0->unk_01C.action(&arg0->obj); + func_800693E8(obj2F4); + if ((obj2F4->obj.status != 0) && (obj2F4->unk_01C.action != NULL)) { + obj2F4->unk_01C.action(&obj2F4->obj); } break; case 3: - func_800693E8(arg0); - if (arg0->obj.status != 0) { - func_800690D0(arg0->unk_040, arg0->obj.id); + func_800693E8(obj2F4); + if (obj2F4->obj.status != 0) { + func_800690D0(obj2F4->unk_040, obj2F4->obj.id); } break; } } -void func_80069CBC(Object_408* arg0) { - if (arg0->unk_050 != 0) { - arg0->unk_050--; +void Object_408_Update(Object_408* obj408) { + if (obj408->unk_050 != 0) { + obj408->unk_050--; } - if (arg0->unk_052 != 0) { - arg0->unk_052--; + if (obj408->unk_052 != 0) { + obj408->unk_052--; } - if (arg0->unk_054 != 0) { - arg0->unk_054--; + if (obj408->unk_054 != 0) { + obj408->unk_054--; } - if (arg0->unk_056 != 0) { - arg0->unk_056--; + if (obj408->unk_056 != 0) { + obj408->unk_056--; } - if (arg0->unk_058 != 0) { - arg0->unk_058--; + if (obj408->unk_058 != 0) { + obj408->unk_058--; } - if (arg0->unk_05A != 0) { - arg0->unk_05A--; + if (obj408->unk_05A != 0) { + obj408->unk_05A--; } - if (arg0->unk_05C != 0) { - arg0->unk_05C--; + if (obj408->unk_05C != 0) { + obj408->unk_05C--; } - switch (arg0->obj.status) { + switch (obj408->obj.status) { case 1: - arg0->obj.status = 2; - func_80063F90(arg0->unk_040, arg0->obj.id); - func_80069658(arg0); + obj408->obj.status = 2; + Object_Init(obj408->unk_040, obj408->obj.id); + func_80069658(obj408); break; case 2: - func_80069658(arg0); - if ((arg0->obj.status != 0) && (arg0->unk_01C.action != NULL)) { - arg0->unk_01C.action(&arg0->obj); + func_80069658(obj408); + if ((obj408->obj.status != 0) && (obj408->unk_01C.action != NULL)) { + obj408->unk_01C.action(&obj408->obj); } break; case 3: - func_80069658(arg0); - if (arg0->obj.status != 0) { - func_800690D0(arg0->unk_040, arg0->obj.id); + func_80069658(obj408); + if (obj408->obj.status != 0) { + func_800690D0(obj408->unk_040, obj408->obj.id); } break; } } -void func_80069DF4(Object_80* arg0) { - if (arg0->unk_4C != 0) { - arg0->unk_4C--; +void Object_80_Update(Object_80* obj80) { + if (obj80->unk_4C != 0) { + obj80->unk_4C--; } - switch (arg0->obj.status) { + switch (obj80->obj.status) { case 1: - arg0->obj.status = 2; - func_80063F90(arg0->unk_40, arg0->obj.id); - func_800696F8(arg0); + obj80->obj.status = 2; + Object_Init(obj80->index, obj80->obj.id); + func_800696F8(obj80); break; case 2: - func_800696F8(arg0); - if (arg0->unk_1C.action != NULL) { - arg0->unk_1C.action(&arg0->obj); + func_800696F8(obj80); + if (obj80->unk_1C.action != NULL) { + obj80->unk_1C.action(&obj80->obj); } break; } } -void func_80069E88(Object_4C* arg0) { - switch (arg0->obj.status) { +void Object_4C_Update(Object_4C* obj4C) { + switch (obj4C->obj.status) { case 1: - arg0->obj.status = 2; - func_80063F90(arg0->unk_40, arg0->obj.id); - func_80069858(arg0); + obj4C->obj.status = 2; + Object_Init(obj4C->index, obj4C->obj.id); + func_80069858(obj4C); break; case 2: - func_80069858(arg0); - if (arg0->unk_1C.action != NULL) { - arg0->unk_1C.action(&arg0->obj); + func_80069858(obj4C); + if (obj4C->unk_1C.action != NULL) { + obj4C->unk_1C.action(&obj4C->obj); } break; case 3: - func_80069858(arg0); - func_800690D0(arg0->unk_40, arg0->obj.id); + func_80069858(obj4C); + func_800690D0(obj4C->index, obj4C->obj.id); break; } } -void func_80069F30(Object_6C* arg0) { - if (arg0->unk_48 != 0) { - arg0->unk_48--; +void Object_6C_Update(Object_6C* obj6C) { + if (obj6C->unk_48 != 0) { + obj6C->unk_48--; } - if (arg0->unk_4A != 0) { - arg0->unk_4A--; + if (obj6C->unk_4A != 0) { + obj6C->unk_4A--; } - switch (arg0->obj.status) { + switch (obj6C->obj.status) { case 1: - arg0->obj.status = 2; - func_80063F90(arg0->unk_40, arg0->obj.id); - func_80069A10(arg0); + obj6C->obj.status = 2; + Object_Init(obj6C->index, obj6C->obj.id); + func_80069A10(obj6C); break; case 2: - func_80069A10(arg0); - if (arg0->unk_1C.action != NULL) { - arg0->unk_1C.action(&arg0->obj); + func_80069A10(obj6C); + if (obj6C->unk_1C.action != NULL) { + obj6C->unk_1C.action(&obj6C->obj); } break; } } -void func_80069FD4(Object_8C* arg0) { - if (arg0->unk_50 != 0) { - arg0->unk_50--; +void Object_8C_Update(Object_8C* obj8C) { + if (obj8C->unk_50 != 0) { + obj8C->unk_50--; } - switch (arg0->obj.status) { + switch (obj8C->obj.status) { case 1: - arg0->obj.status = 2; - func_80063F90(arg0->unk_40, arg0->obj.id); + obj8C->obj.status = 2; + Object_Init(obj8C->index, obj8C->obj.id); /* fallthrough */ case 2: - func_80069924(arg0); - if ((arg0->obj.status != 0) && (arg0->unk_1C.action != NULL)) { - arg0->unk_1C.action(&arg0->obj); + func_80069924(obj8C); + if ((obj8C->obj.status != 0) && (obj8C->unk_1C.action != NULL)) { + obj8C->unk_1C.action(&obj8C->obj); } break; } } -void func_8006A06C(UnkEntity30* arg0) { +void func_8006A06C(UnkEntity30* unkEnt30) { Vec3f sp44; Vec3f sp38; f32 sp34; f32 sp30; f32 sp2C; - if (arg0->timer != 0) { - arg0->timer--; + if (unkEnt30->timer != 0) { + unkEnt30->timer--; } - sp34 = arg0->unk_04.x - arg0->unk_10.x; - sp30 = arg0->unk_04.y - arg0->unk_10.y; - sp2C = arg0->unk_04.z - arg0->unk_10.z; - arg0->unk_20 = Math_Atan2F(sp34, sp2C); - arg0->unk_1C = -Math_Atan2F(sp30, sqrtf(SQ(sp34) + SQ(sp2C))); - if (arg0->mode != 4) { - arg0->unk_24 = sqrtf(SQ(sp34) + SQ(sp30) + SQ(sp2C)); + sp34 = unkEnt30->unk_04.x - unkEnt30->unk_10.x; + sp30 = unkEnt30->unk_04.y - unkEnt30->unk_10.y; + sp2C = unkEnt30->unk_04.z - unkEnt30->unk_10.z; + unkEnt30->unk_20 = Math_Atan2F(sp34, sp2C); + unkEnt30->unk_1C = -Math_Atan2F(sp30, sqrtf(SQ(sp34) + SQ(sp2C))); + if (unkEnt30->mode != 4) { + unkEnt30->unk_24 = sqrtf(SQ(sp34) + SQ(sp30) + SQ(sp2C)); } if (gGameState == GSTATE_PLAY) { - if (((arg0->mode == 1) || (arg0->mode == 0x65) || (arg0->mode == 0x32)) && (gPlayer[0].unk_1C8 == 3) && - (gPlayer[0].unk_1F4 == 0)) { - Matrix_RotateX(gCalcMatrix, -arg0->unk_1C, 0); - Matrix_RotateY(gCalcMatrix, -arg0->unk_20, 1); - sp44.x = gPlayer[D_801778A0].unk_074 - arg0->unk_04.x; - sp44.y = gPlayer[D_801778A0].unk_078 - arg0->unk_04.y; - sp44.z = gPlayer[D_801778A0].unk_138 - arg0->unk_04.z; + if (((unkEnt30->mode == 1) || (unkEnt30->mode == 0x65) || (unkEnt30->mode == 0x32)) && + (gPlayer[0].unk_1C8 == 3) && (gPlayer[0].unk_1F4 == 0)) { + Matrix_RotateX(gCalcMatrix, -unkEnt30->unk_1C, 0); + Matrix_RotateY(gCalcMatrix, -unkEnt30->unk_20, 1); + sp44.x = gPlayer[D_801778A0].unk_074 - unkEnt30->unk_04.x; + sp44.y = gPlayer[D_801778A0].unk_078 - unkEnt30->unk_04.y; + sp44.z = gPlayer[D_801778A0].unk_138 - unkEnt30->unk_04.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - sp38.x += arg0->unk_04.x; - sp38.y += arg0->unk_04.y; - sp38.z += arg0->unk_04.z; - if ((fabsf(sp38.x - arg0->unk_04.x) < 30.0f) && (fabsf(sp38.y - arg0->unk_04.y) < 30.0f) && - (sp38.z < arg0->unk_04.z) && ((arg0->unk_04.z - arg0->unk_24) < sp38.z)) { + sp38.x += unkEnt30->unk_04.x; + sp38.y += unkEnt30->unk_04.y; + sp38.z += unkEnt30->unk_04.z; + if ((fabsf(sp38.x - unkEnt30->unk_04.x) < 30.0f) && (fabsf(sp38.y - unkEnt30->unk_04.y) < 30.0f) && + (sp38.z < unkEnt30->unk_04.z) && ((unkEnt30->unk_04.z - unkEnt30->unk_24) < sp38.z)) { if (gCurrentLevel == LEVEL_AQUAS) { func_800A6CD0(&gPlayer[0], 0, 30); } else { func_800A6CD0(&gPlayer[0], 0, 20); } - if (arg0->mode < 100) { - arg0->mode = 0; + if (unkEnt30->mode < 100) { + unkEnt30->mode = 0; } } } - if (((arg0->unk_04.z + D_80177D20) > 1000.0f) && (D_80177880 != 1)) { - arg0->mode = 0; + if (((unkEnt30->unk_04.z + D_80177D20) > 1000.0f) && (D_80177880 != 1)) { + unkEnt30->mode = 0; } - if (((arg0->mode == 3) || (arg0->mode == 50)) && (arg0->timer == 0)) { - arg0->mode = 0; + if (((unkEnt30->mode == 3) || (unkEnt30->mode == 50)) && (unkEnt30->timer == 0)) { + unkEnt30->mode = 0; } } } @@ -2850,16 +2842,16 @@ void func_8006A38C(void) { } } -void func_8006A3E8(void) { +void Object_UpdateAll(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; + Object_58* obj58; + Object_2F4* obj2F4; + Object_408* obj408; + Object_4C* obj4C; + Object_80* obj80; + Object_6C* obj6C; + Object_8C* obj8C; D_80161AB8 = 0; if ((D_80177880 == 0) && ((gPlayer[0].unk_1C8 == 1) || (gPlayer[0].unk_1C8 == 3) || (gPlayer[0].unk_1C8 == 4) || @@ -2870,51 +2862,51 @@ void func_8006A3E8(void) { if ((D_80178488 != 0) && (gPlayer[0].unk_1C8 != 2)) { func_80062664(); } - for (i = 0, sp2C = gObjects80; i < ARRAY_COUNT(gObjects80); i++, sp2C++) { - if (sp2C->obj.status != 0) { - sp2C->unk_40 = i; - func_80069DF4(sp2C); + for (i = 0, obj80 = gObjects80; i < ARRAY_COUNT(gObjects80); i++, obj80++) { + if (obj80->obj.status != 0) { + obj80->index = i; + Object_80_Update(obj80); } } } else if (D_801778E8 != 0) { - for (i = 0, var_v0 = gObjects58; i < 200; i++, var_v0++) { - if ((var_v0->obj.status != 0) && (var_v0->obj.id == OBJECT_146)) { + for (i = 0, obj58 = gObjects58; i < 200; i++, obj58++) { + if ((obj58->obj.status != 0) && (obj58->obj.id == OBJECT_146)) { if (i & 1) { - var_v0->obj.rot.y += 0.5f; + obj58->obj.rot.y += 0.5f; } else { - var_v0->obj.rot.y -= 0.5f; + obj58->obj.rot.y -= 0.5f; } } } } - for (i = 0, sp30 = gObjects4C; i < ARRAY_COUNT(gObjects4C); i++, sp30++) { - if (sp30->obj.status != 0) { - sp30->unk_40 = i; - func_80069E88(sp30); + for (i = 0, obj4C = gObjects4C; i < ARRAY_COUNT(gObjects4C); i++, obj4C++) { + if (obj4C->obj.status != 0) { + obj4C->index = i; + Object_4C_Update(obj4C); } } - for (i = 0, sp34 = gObjects408; i < ARRAY_COUNT(gObjects408); i++, sp34++) { - if (sp34->obj.status != 0) { - sp34->unk_040 = i; - func_80069CBC(sp34); + for (i = 0, obj408 = gObjects408; i < ARRAY_COUNT(gObjects408); i++, obj408++) { + if (obj408->obj.status != 0) { + obj408->unk_040 = i; + Object_408_Update(obj408); } } - for (i = 0, sp38 = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, sp38++) { - if (sp38->obj.status != 0) { - sp38->unk_040 = i; - func_80069AAC(sp38); + for (i = 0, obj2F4 = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, obj2F4++) { + if (obj2F4->obj.status != 0) { + obj2F4->unk_040 = i; + Object_2F4_Update(obj2F4); } } - for (i = 0, sp28 = gObjects6C; i < ARRAY_COUNT(gObjects6C); i++, sp28++) { - if (sp28->obj.status != 0) { - sp28->unk_40 = i; - func_80069F30(sp28); + for (i = 0, obj6C = gObjects6C; i < ARRAY_COUNT(gObjects6C); i++, obj6C++) { + if (obj6C->obj.status != 0) { + obj6C->index = i; + Object_6C_Update(obj6C); } } - for (i = 0, sp24 = gObjects8C; i < ARRAY_COUNT(gObjects8C); i++, sp24++) { - if (sp24->obj.status != 0) { - sp24->unk_40 = i; - func_80069FD4(sp24); + for (i = 0, obj8C = gObjects8C; i < ARRAY_COUNT(gObjects8C); i++, obj8C++) { + if (obj8C->obj.status != 0) { + obj8C->index = i; + Object_8C_Update(obj8C); } } func_8006A38C(); diff --git a/src/main/fox_fade.c b/src/main/fox_fade.c new file mode 100644 index 00000000..1f1e9240 --- /dev/null +++ b/src/main/fox_fade.c @@ -0,0 +1,48 @@ +#include "global.h" + +void func_80084370(s32 arg0) { + Graphics_FillRectangle(&gMasterDisp, 0, 0, arg0, SCREEN_HEIGHT, 0, 0, 0, 255); + Graphics_FillRectangle(&gMasterDisp, SCREEN_WIDTH - arg0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255); +} + +void func_800843FC(s32 arg0) { + Graphics_FillRectangle(&gMasterDisp, 0, 0, SCREEN_WIDTH, arg0, 0, 0, 0, 255); + Graphics_FillRectangle(&gMasterDisp, 0, SCREEN_HEIGHT - arg0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255); +} + +void func_80084488(s32 arg0) { + s32 var_s1; + + RCP_SetupDL_12(); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -150.0f, 0); + for (var_s1 = 0; var_s1 < MIN(360, arg0 * 15); var_s1 += 15) { + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, MIN((arg0 - (var_s1 / 15)) * 15, 255)); + Matrix_Push(&gGfxMatrix); + Matrix_RotateZ(gGfxMatrix, var_s1 * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, 0.53f, 1.0f, 1.0f, 1); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, D_Gfx_800D9688); + Matrix_Pop(&gGfxMatrix); + } + Matrix_Pop(&gGfxMatrix); +} + +void func_80084688(s32 arg0, s32 arg1) { + if (arg1 != 0) { + switch (arg0) { + case 0: + func_80084488(arg1); + break; + case 1: + func_80084370(arg1); + break; + case 2: + func_800843FC(arg1); + break; + default: + (void) "そのような フェード は ない (%d)\n"; // There is no such fade + break; + } + } +} diff --git a/src/main/fox_A24B0.c b/src/main/fox_game.c similarity index 97% rename from src/main/fox_A24B0.c rename to src/main/fox_game.c index 6c2e067d..f8b6343b 100644 --- a/src/main/fox_A24B0.c +++ b/src/main/fox_game.c @@ -390,16 +390,16 @@ void func_800A26C0(void) { gNextGameState = D_80177C94 = D_80177CAC = D_80177CB4 = D_80177CBC = D_80177CC4 = D_80177C9C = D_80177CA4 = D_80161A5C = D_80161A34 = 0; for (i = 0; i < 4; i++) { - D_80177908[i] = 2; - D_80177928[i] = 4; - D_80177938[i] = 0x8000; - D_80177948[i] = 0x4000; + D_80177908[i] = L_CBUTTONS; + D_80177928[i] = D_CBUTTONS; + D_80177938[i] = A_BUTTON; + D_80177948[i] = B_BUTTON; D_80177958[i] = 1.0f; D_80177858[i] = 3; D_80177870[i] = 0; - D_800D2860[i] = 1; + D_800D2860[i] = R_CBUTTONS; D_80178380[i] = 0; } D_8017789C = 0; @@ -542,20 +542,20 @@ void func_800A26C0(void) { } Object_2F4* func_800A3608(s32 arg0) { - Object_2F4* var_a2 = gObjects2F4; + Object_2F4* obj2F4 = gObjects2F4; s32 i; - for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++, var_a2++) { - if (var_a2->obj.status == 0) { - Object_2F4_Initialize(var_a2); - var_a2->obj.status = 1; - var_a2->obj.id = arg0; - func_800612B8(&var_a2->unk_01C, var_a2->obj.id); + for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++, obj2F4++) { + if (obj2F4->obj.status == 0) { + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 1; + obj2F4->obj.id = arg0; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); break; } } if (i == ARRAY_COUNT(gObjects2F4)) { - var_a2 = NULL; + obj2F4 = NULL; } - return var_a2; + return obj2F4; } diff --git a/src/main/fox_play.c b/src/main/fox_play.c new file mode 100644 index 00000000..b4b01e04 --- /dev/null +++ b/src/main/fox_play.c @@ -0,0 +1,3373 @@ +#include "global.h" + +extern UNK_TYPE D_800D2F50; // type unclear. unused? +extern s32 D_800D2F54; // only gets set to 0. unused? +extern f32 D_800D2F58; +extern f32 D_800D2F5C[3]; // holds float versions of gVolumeSettings. Unused? +extern u8 D_800D2F68; +extern u8 D_800D2F6C[20]; +extern Vec3f D_800D2F80; +extern Vec3f D_800D2F8C; +extern EnvSettings* D_800D2F98[21]; +extern f32 D_800D2FEC[5]; +extern s32 D_800D3000[4][4]; +extern Vec3f D_800D3040[6]; +extern Vec3f D_800D3088[4]; +extern Vec3f D_800D30B8[4]; +extern Vec3f D_800D30E8; +extern f32 D_800D30F4[4]; +extern f32 D_800D3104[4]; +extern f32 D_800D3114[4]; +extern f32 D_800D3124[12]; +extern f32 D_800D3154[4]; +extern s32 D_800D3164[4]; +extern u8 D_800D317C; +extern u8 D_800D3180[30]; +extern s32 D_800D31A0[4]; + +s32 Play_CheckMedalStatus(u16 hitCount) { + if ((gTeamHealth[2] > 0) && (gTeamHealth[3] > 0) && (gTeamHealth[1] > 0) && (gHitCount >= hitCount)) { + return true; + } + return false; +} + +void func_800A3FB0(void) { + D_800D2F5C[2] = 0.0f; +} + +s32 Play_GetMaxHealth(void) { + if (gGoldRingCount[0] >= 3) { + return 0x17F; + } + return 0xFF; +} + +void func_800A3FEC(void) { + Vec3f spC4; + Vec3f spB8; + Vtx* spB4; + u16* spB0; + s32 i; + s32 spA8; + f32* var_s3; + f32* var_s5; + f32* var_s4; + f32* var_s0; + f32* var_s1; + f32 sp90; + f32 sp8C; + f32 sp88; + f32 sp84; + + D_801782FC++; + switch (gCurrentLevel) { + case LEVEL_SOLAR: + if (gFrameCount & 1) { + spB4 = SEGMENTED_TO_VIRTUAL(D_6001C50); + } else { + spB4 = SEGMENTED_TO_VIRTUAL(D_6004500); + } + spB0 = SEGMENTED_TO_VIRTUAL(D_6022760); + spA8 = 15; + sp90 = 70.0f; + sp8C = 0.1f; + sp88 = 2.2f; + sp84 = 0.5f; + break; + case LEVEL_ZONESS: + if (gFrameCount & 1) { + spB4 = SEGMENTED_TO_VIRTUAL(D_6009ED0); + } else { + spB4 = SEGMENTED_TO_VIRTUAL(D_600C780); + } + spB0 = SEGMENTED_TO_VIRTUAL(D_602AC50); + spA8 = 7; + sp90 = 40.0f; + sp8C = 0.2f; + sp88 = 1.0f; + sp84 = 2.0f; + break; + } + var_s3 = D_801782CC; + var_s5 = D_801782D4; + var_s4 = D_801782DC; + var_s0 = D_801782E4; + var_s1 = D_801782EC; + for (i = 0; i < 17 * 17; i++, var_s3++, var_s5++, var_s4++, var_s0++, var_s1++, spB0++) { + Math_SmoothStepToF(var_s3, *var_s5, sp8C, *var_s4, 0.0f); + Math_SmoothStepToF(var_s4, 100.0f, 1.0f, sp84, 0.0f); + if ((D_801782FC & spA8) == (i & spA8)) { + *var_s5 = Rand_ZeroOne() * sp90; + *var_s4 = 0.0f; + } + *var_s0 += *var_s1; + *var_s1 -= 0.5f; + if (*var_s0 < 0.0f) { + *var_s1 = *var_s0 = 0.0f; + } + spB4[*spB0].n.ob[1] = (s16) *var_s3 + (s16) *var_s0; + Matrix_RotateZ(gCalcMatrix, *var_s3 * sp88 * M_DTOR, 0); + spC4.x = 120.0f; + spC4.y = 0.0f; + spC4.z = 0.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &spC4, &spB8); + spB4[*spB0].n.n[0] = spB8.x; + spB4[*spB0].n.n[1] = spB8.y; + spB4[*spB0].n.n[2] = spB8.z; + } +} + +void func_800A4460(Player* player) { + if ((gCurrentLevel == LEVEL_VENOM_2) && (gObjects408[0].obj.status == 2) && (gObjects408[0].unk_04E == 17)) { + player->unk_060 = __sinf(player->unk_0F4 * 0.7f * M_DTOR) * 0.5f; + player->unk_088 += 13.0f; + player->unk_0F4 += 20.0f; + player->unk_080 = -__sinf(player->unk_088 * M_DTOR) * 5.0f; + player->unk_0F0 = __sinf(player->unk_0F4 * M_DTOR) * 10.0f; + return; + } else { + player->unk_060 = __sinf(player->unk_0F4 * 0.7f * M_DTOR) * 0.5f; + player->unk_088 += 10.0f; + player->unk_0F4 += 8.0f; + if ((gLevelType == 0) || ((player->unk_238 == 1) && (D_80177880 == 0))) { + player->unk_080 = -__sinf(player->unk_088 * M_DTOR) * 0.5f; + if ((player->wings.rightState <= 1) || (player->wings.leftState <= 1)) { + player->unk_0F0 = __sinf(player->unk_0F4 * M_DTOR) * 5.0f; + } else { + player->unk_0F0 = __sinf(player->unk_0F4 * M_DTOR) * 1.5f; + } + } + } +} + +void func_800A46A0(Player* player) { + s32 var_v1; + f32 sp40; + + if ((player->unk_238 == 0) || (D_80177880 == 1)) { + if (player->wings.rightState <= 1) { + if (!(gFrameCount & 1) && (D_80177D70[player->unk_1C4] != 0)) { + func_8007D10C(((Rand_ZeroOne() - 0.5f) * 10.0f) + player->unk_2D4.x, + (Rand_ZeroOne() * 5.0f) + player->unk_2D4.y, player->unk_2D4.z, 1.0f); + } + if (!(gFrameCount & 1) && (Rand_ZeroOne() < 0.5f) && (D_801778E8 == 0)) { + func_8007C484(((Rand_ZeroOne() - 0.5f) * 5.0f) + player->unk_2D4.x, + (Rand_ZeroOne() * 5.0f) + player->unk_2D4.y, player->unk_2D4.z, player->unk_0C0.x, + player->unk_0C0.y, player->unk_0C0.z, (Rand_ZeroOne() * 0.02f) + 0.02f, + player->unk_1C4 + 1); + } + } + if (player->wings.leftState <= 1) { + if (!(gFrameCount & 1) && (D_80177D88[player->unk_1C4] != 0)) { + func_8007D10C(((Rand_ZeroOne() - 0.5f) * 10.0f) + player->unk_2C8.x, + (Rand_ZeroOne() * 5.0f) + player->unk_2C8.y, player->unk_2C8.z, 1.0f); + } + if (!(gFrameCount & 1) && (Rand_ZeroOne() < 0.5f) && (D_801778E8 == 0)) { + func_8007C484(((Rand_ZeroOne() - 0.5f) * 5.0f) + player->unk_2C8.x, + (Rand_ZeroOne() * 5.0f) + player->unk_2C8.y, player->unk_2C8.z, player->unk_0C0.x, + player->unk_0C0.y, player->unk_0C0.z, (Rand_ZeroOne() * 0.02f) + 0.02f, + player->unk_1C4 + 1); + } + } + } + var_v1 = 7; + if (player->health < 0x40) { + if (player->health > 0x10) { + var_v1 = 0xF; + } + if (player->health > 0x20) { + var_v1 = 0x1F; + } + if (player->health > 0x30) { + var_v1 = 0x3F; + } + if ((player->unk_238 == 0) || (D_80177880 == 1)) { + sp40 = 0.0f; + if (player->unk_1CC == 1) { + sp40 = 30.0f; + } + if (!(gFrameCount & var_v1)) { + func_8007D10C(((Rand_ZeroOne() - 0.5f) * 10.0f) + player->unk_074, + (Rand_ZeroOne() * 10.0f) + (player->unk_078 + sp40), + ((Rand_ZeroOne() - 0.5f) * 10.0f) + player->unk_138, 2.2f); + } + if (!((var_v1 >> 2) & gFrameCount) && (Rand_ZeroOne() < 0.5f)) { + func_8007C484(((Rand_ZeroOne() - 0.5f) * 30.0f) + player->unk_074, + (Rand_ZeroOne() * 10.0f) + (player->unk_078 + sp40), + ((Rand_ZeroOne() - 0.5f) * 30.0f) + player->unk_138, player->unk_0C0.x, player->unk_0C0.y, + player->unk_0C0.z, (Rand_ZeroOne() * 0.03f) + 0.04f, player->unk_1C4 + 1); + if (player->unk_224 == 0) { + player->unk_224 = 2; + } + } + } else if (!((var_v1 >> 2) & gFrameCount) && (Rand_ZeroOne() < 0.5f) && (player->unk_224 == 0)) { + player->unk_224 = 2; + } + } +} + +void func_800A4C40(Player* player) { + Vec3f sp54 = D_800D2F80; + Vec3f sp48 = D_800D2F8C; + Vec3f sp3C; + Vec3f sp30; + + if (D_80161A88 == 2) { + Matrix_Translate(gCalcMatrix, player->unk_074, player->unk_078, player->unk_138, 0); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateZ(gCalcMatrix, -(player->unk_0F8 * M_DTOR), 1); + Matrix_MultVec3f(gCalcMatrix, &sp54, &sp3C); + Matrix_MultVec3f(gCalcMatrix, &sp48, &sp30); + if (player->unk_078 < (D_80177940 + 100.0f)) { + if ((sp3C.y < D_80177940 + 80.0f) && !(gFrameCount & 1)) { + if (D_80161A64) {} + func_8007ACE0(sp3C.x, D_80177940, sp3C.z, 0.1f, 2.0f, player->unk_0E8 + player->unk_114 + 20.0f); + } + if ((sp30.y < D_80177940 + 80.0f) && !(gFrameCount & 1)) { + func_8007ACE0(sp30.x, D_80177940, sp30.z, 0.1f, 2.0f, player->unk_0E8 + player->unk_114 - 20.0f); + } + } + if ((sp30.y < D_80177940 + 80.0f) || (sp3C.y < D_80177940 + 80.0f)) { + if (D_80161A64 == 0) { + D_80161A64 = 1; + func_80019218(0x1100000B, &player->unk_460, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + } else { + D_80161A64 = 0; + func_8001A55C(&player->unk_460, 0x1100000B); + } + } +} + +void func_800A4F4C(Object_58* obj58) { + s32 i; + u8* ptr = (u8*) obj58; + + for (i = 0; i < sizeof(Object_58); i++, ptr++) { + *ptr = 0; + } +} + +void func_800A4F7C(void) { + s16 temp_v0; + s16 temp_v0_2; + s32 var_s1; + s32 var_s1_2; + s32 i; + s32 j; + s32 var_s4_2; + + switch (D_8017789C) { + case 0: + D_80178310 = SEGMENTED_TO_VIRTUAL(D_302DE3C); + break; + case 1: + D_80178310 = SEGMENTED_TO_VIRTUAL(D_302E0E4); + break; + case 2: + if (D_801778AC == 2) { + D_80178310 = SEGMENTED_TO_VIRTUAL(D_302E378); + } else { + D_80178310 = SEGMENTED_TO_VIRTUAL(D_302E170); + } + break; + } + for (i = 0, j = 0; i < 199; j++) { + if (D_80178310[j].id <= OBJECT_INVALID) { + break; + } + if (D_80178310[j].id == OBJECT_147) { + func_800A4F4C(&gObjects58[i]); + gObjects58[i].obj.status = 2; + gObjects58[i].obj.id = D_80178310[j].id; + gObjects58[i].obj.pos.x = D_80178310[j].xPos; + gObjects58[i].obj.pos.z = D_80178310[j].zPos1; + gObjects58[i].obj.pos.y = D_80178310[j].yPos; + Object_Set1C(&gObjects58[i].unk_1C, gObjects58[i].obj.id); + i++; + } + } + for (i = 5, j = 0; i < 199; j++) { + if (D_80178310[j].id <= OBJECT_INVALID) { + break; + } + if (D_80178310[j].id != OBJECT_147) { + func_800A4F4C(&gObjects58[i]); + gObjects58[i].obj.status = 2; + gObjects58[i].obj.id = D_80178310[j].id; + gObjects58[i].obj.pos.x = D_80178310[j].xPos; + gObjects58[i].obj.pos.z = D_80178310[j].zPos1; + gObjects58[i].obj.pos.y = D_80178310[j].yPos; + gObjects58[i].obj.rot.y = D_80178310[j].unk_C; + Object_Set1C(&gObjects58[i].unk_1C, gObjects58[i].obj.id); + i++; + } + } +} + +void func_800A5330(void) { +} + +void func_800A5338(void) { + Object_4C* obj4C; + Object_58* obj58; + s32 i; + s32 j; + + D_80178310 = SEGMENTED_TO_VIRTUAL(D_603B074); + + for (j = 0, obj58 = gObjects58; j < 200; j++) { + if (D_80178310[j].id <= OBJECT_INVALID) { + break; + } + if (D_80178310[j].id < OBJECT_161) { + func_800A4F4C(obj58); + obj58->obj.status = 2; + obj58->obj.id = D_80178310[j].id; + obj58->obj.pos.x = D_80178310[j].xPos; + obj58->obj.pos.z = D_80178310[j].zPos1; + obj58->obj.pos.y = D_80178310[j].yPos; + obj58->obj.rot.y = D_80178310[j].unk_C; + Object_Set1C(&obj58->unk_1C, obj58->obj.id); + if (obj58->obj.id == OBJECT_1) { + obj58->unk_1C.dList = D_6020760; + } + obj58++; + } + } + + for (j = 0, obj4C = gObjects4C; j < ARRAY_COUNT(gObjects4C); j++) { + if (D_80178310[j].id <= OBJECT_INVALID) { + break; + } + if (D_80178310[j].id == OBJECT_162) { + Object_4C_Initialize(obj4C); + obj4C->obj.status = 1; + obj4C->obj.id = D_80178310[j].id; + obj4C->obj.pos.x = D_80178310[j].xPos; + obj4C->obj.pos.z = D_80178310[j].zPos1; + obj4C->obj.pos.y = D_80178310[j].yPos; + Object_Set1C(&obj4C->unk_1C, obj4C->obj.id); + obj4C++; + } + } + i = 0; // fake? + Object_408_Initialize(&gObjects408[i]); + gObjects408[i].obj.status = 1; + gObjects408[i].obj.pos.x = 0.0f; + gObjects408[i].obj.pos.y = 0.0f; + gObjects408[i].obj.pos.z = 0.0f; + gObjects408[i].obj.id = OBJECT_292; + Object_Set1C(&gObjects408[i].unk_01C, gObjects408[i].obj.id); +} + +void func_800A55B0(void) { + Object_58* obj58; + s32 i; + s32 j; + + D_80178310 = SEGMENTED_TO_VIRTUAL(D_6030B14); + + for (j = 0, obj58 = gObjects58; j < 200; j++) { + if (D_80178310[j].id <= OBJECT_INVALID) { + break; + } + if (D_80178310[j].id < OBJECT_161) { + func_800A4F4C(obj58); + obj58->obj.status = 2; + obj58->obj.id = D_80178310[j].id; + obj58->obj.pos.x = D_80178310[j].xPos; + obj58->obj.pos.z = D_80178310[j].zPos1; + obj58->obj.pos.y = D_80178310[j].yPos; + obj58->obj.rot.y = D_80178310[j].unk_C; + Object_Set1C(&obj58->unk_1C, obj58->obj.id); + obj58++; + } + } + i = 0; // fake? + Object_408_Initialize(&gObjects408[i]); + gObjects408[i].obj.status = 1; + gObjects408[i].obj.pos.x = 0.0f; + gObjects408[i].obj.pos.y = 0.0f; + gObjects408[i].obj.pos.z = 0.0f; + gObjects408[i].obj.id = OBJECT_314; + Object_Set1C(&gObjects408[i].unk_01C, gObjects408[i].obj.id); + i = 1; + Object_408_Initialize(&gObjects408[i]); + gObjects408[i].obj.status = 1; + gObjects408[i].obj.pos.x = 0.0f; + gObjects408[i].obj.pos.y = 0.0f; + gObjects408[i].obj.pos.z = 0.0f; + gObjects408[i].obj.id = OBJECT_314; + Object_Set1C(&gObjects408[i].unk_01C, gObjects408[i].obj.id); + i = 2; + Object_408_Initialize(&gObjects408[i]); + gObjects408[i].obj.status = 1; + gObjects408[i].obj.pos.x = 0.0f; + gObjects408[i].obj.pos.y = 0.0f; + gObjects408[i].obj.pos.z = 0.0f; + gObjects408[i].obj.id = OBJECT_314; + Object_Set1C(&gObjects408[i].unk_01C, gObjects408[i].obj.id); +} + +void func_800A57E0(void) { + s32 i = 0; // fake? + + Object_408_Initialize(&gObjects408[i]); + gObjects408[i].obj.status = 1; + gObjects408[i].obj.pos.x = 0.0f; + gObjects408[i].obj.pos.y = 0.0f; + gObjects408[i].obj.pos.z = 0.0f; + gObjects408[i].obj.id = OBJECT_321; + Object_Set1C(&gObjects408[i].unk_01C, gObjects408[i].obj.id); +} + +void func_800A5844(void) { + s32 i; + + D_80178410 = 0; + D_8017827C = 0; + D_80161684 = 0; + D_80161A50 = 0; + gOverlayStage = 0; + D_8015F924 = D_80177CA0 = 0; + D_80177CB0 = 0.0f; + gSavedHitCount = D_80177A80 = D_80177838 = D_80177840 = D_8017829C = 0; + D_8017782C = 1; + if (((gCurrentLevel == LEVEL_VENOM_SW) && (D_80161A2E == 2)) || (gCurrentLevel == LEVEL_VENOM_2)) { + return; + } + for (i = 1; i < 4; i++) { + if (gSavedTeamHealth[i] < 0) { + if (gSavedTeamHealth[i] == -1) { + gSavedTeamHealth[i] = 0; + } + } else if (gSavedTeamHealth[i] == 0) { + gSavedTeamHealth[i] = 0xFF; + } + } +} + +void func_800A594C(void) { + if (D_801778E8 != 0) { + switch (D_8017789C) { + case 0: + sEnvSettings = SEGMENTED_TO_VIRTUAL(D_302DD70); + break; + case 1: + sEnvSettings = SEGMENTED_TO_VIRTUAL(D_302DDB4); + break; + case 2: + sEnvSettings = SEGMENTED_TO_VIRTUAL(D_302DDF8); + break; + } + } else { + sEnvSettings = SEGMENTED_TO_VIRTUAL(D_800D2F98[gCurrentLevel]); + } + if (D_8017782C == 0) { + if (gCurrentLevel == LEVEL_SOLAR) { + func_8001D1C8(0xFF, 1); + func_80019218(0x4100C023, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_8001A55C(&gPlayer[0].unk_460, 0x3140807E); + } + } else if (gCurrentLevel == LEVEL_AQUAS) { + sEnvSettings = SEGMENTED_TO_VIRTUAL(D_602E584); + } + D_80177C90 = sEnvSettings->seqId; + gLevelType = sEnvSettings->type; + D_801784AC = sEnvSettings->unk_04; + gBgColor = sEnvSettings->bgColor; + gFogRed = sEnvSettings->fogR; + gFogGreen = sEnvSettings->fogG; + gFogBlue = sEnvSettings->fogB; + gFogNear = sEnvSettings->fogN; + gFogFar = sEnvSettings->fogF; + gLight1R = gLight2R = D_80161A70 = sEnvSettings->lightR; + gLight1G = gLight2G = D_80161A74 = sEnvSettings->lightG; + gLight1B = gLight2B = D_80161A78 = sEnvSettings->lightB; + gAmbientR = sEnvSettings->ambR; + gAmbientG = sEnvSettings->ambG; + gAmbientB = sEnvSettings->ambB; + D_801784D0 = D_801784F8 = D_80178520 = D_801784B8 = D_801784C4 = sEnvSettings->unk_20.x; + D_801784D4 = D_801784FC = D_80178524 = D_801784BC = D_801784C8 = sEnvSettings->unk_20.y; + D_801784D8 = D_80178500 = D_80178528 = D_801784C0 = D_801784CC = sEnvSettings->unk_20.z; + D_80161A44 = 12800.0f; + D_80178540 = 40; + D_80178544 = 40; + D_80161A3C = 45.0f; +} + +// #define ARRAY_ALLOCATE(arr, count) (arr) = Memory_Allocate((count) * sizeof(*array)) + +void func_800A5D6C(void) { + u32 i; + + D_80178288 = Memory_Allocate(1000 * sizeof(f32)); + D_80178290 = Memory_Allocate(1000 * sizeof(f32)); + D_80178298 = Memory_Allocate(1000 * sizeof(u32)); + Rand_SetSeed(1, 29000, 9876); + for (i = 0; i < 1000; i++) { + D_80178288[i] = (Rand_ZeroOneSeeded() * 480.0f) - 80.0f; + D_80178290[i] = (Rand_ZeroOneSeeded() * 360.0f) - 60.0f; + D_80178298[i] = FILL_COLOR(D_800C9C3C[i % ARRAY_COUNT(D_800C9C3C)]); + } +} + +void func_800A5EBC(void) { + func_800A5D6C(); + D_80177940 = -25000.0f; + D_80178410 = 600; + if (gCurrentLevel == LEVEL_AREA_6) { + D_80178410 = 300; + } + if (gCurrentLevel == LEVEL_UNK_15) { + D_80178410 = 400; + } + if (gGameState != GSTATE_PLAY) { + D_80178410 = 800; + } + if (gCurrentLevel == LEVEL_FORTUNA) { + D_80178410 = 500; + } + if (D_801778E8 != 0) { + D_80178410 = 0; + } + if (gCurrentLevel == LEVEL_BOLSE) { + D_80178410 = 300; + D_80177940 = -0.0f; + } + if (gCurrentLevel == LEVEL_TRAINING) { + D_80178410 = 800; + D_80177940 = -0.0f; + } +} + +void func_800A5FA0(Vec3f* arg0, u32 arg1, s32 arg2) { + if (D_801778E8 == 0) { + func_80019218(arg1, arg0, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } else { + func_80019218(arg1, arg0, arg2, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } +} + +void func_800A6028(Vec3f* arg0, u32 arg1) { + func_80019218(arg1, arg0, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); +} + +void func_800A6070(Vec3f* arg0, u32 arg1) { + func_80019218(arg1, arg0, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); +} + +void func_800A60B8(UnkEntity1C* unkEnt1C) { + s32 i; + u8* ptr = (u8*) unkEnt1C; + + for (i = 0; i < sizeof(UnkEntity1C); i++, ptr++) { + *ptr = 0; + } +} + +void func_800A60E8(UnkEntity30* unkEnt30) { + s32 i; + u8* ptr = (u8*) unkEnt30; + + for (i = 0; i < sizeof(UnkEntity30); i++, ptr++) { + *ptr = 0; + } +} + +void func_800A6118(UnkEntity28* unkEnt28) { + s32 i; + u8* ptr = (u8*) unkEnt28; + + for (i = 0; i < sizeof(UnkEntity28); i++, ptr++) { + *ptr = 0; + } +} + +void func_800A6148(void) { + s16 i; + s16 j; + + for (i = 0; i < ARRAY_COUNT(gUnkEntities1C); i++) { + func_800A60B8(&gUnkEntities1C[i]); + } + for (i = 0; i < ARRAY_COUNT(gUnkEntities28); i++) { + func_800A6118(&gUnkEntities28[i]); + } + for (i = 0; i < ARRAY_COUNT(gUnkEntities30); i++) { + func_800A60E8(&gUnkEntities30[i]); + } + for (i = 0; i < ARRAY_COUNT(gObjects80); i++) { + Object_Kill(&gObjects80[i].obj, &gObjects80[i].sfxPos); + Object_80_Initialize(&gObjects80[i]); + } + for (i = 0; i < ARRAY_COUNT(gObjects4C); i++) { + Object_4C_Initialize(&gObjects4C[i]); + } + for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { + Object_Kill(&gObjects2F4[i].obj, &gObjects2F4[i].sfxPos); + Object_2F4_Initialize(&gObjects2F4[i]); + } + for (i = 0; i < ARRAY_COUNT(gObjects408); i++) { + Object_Kill(&gObjects408[i].obj, &gObjects408[i].sfxPos); + Object_408_Initialize(&gObjects408[i]); + } + for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { + Object_Kill(&gObjects8C[i].obj, &gObjects8C[i].sfxPos); + Object_8C_Initialize(&gObjects8C[i]); + } + for (i = 0; i < ARRAY_COUNT(gObjects6C); i++) { + Object_Kill(&gObjects6C[i].obj, &gObjects6C[i].sfxPos); + Object_6C_Initialize(&gObjects6C[i]); + } + for (i = 0; i < ARRAY_COUNT(gObjects70); i++) { + Object_Kill(&gObjects70[i].obj, &gObjects70[i].sfxPos); + Object_70_Initialize(&gObjects70[i]); + } + D_801782B8 = D_801782BC = D_801782C0 = D_801782D0 = D_80178284 = D_8017828C = D_8017812C = D_80177E70 = D_80177E78 = + D_80177E80 = 0; + D_80177F10.x = D_80177F10.y = D_80177F10.z = D_80177E88.x = D_80177E88.y = D_80177E88.z = 0.0f; + for (i = 0; i < ARRAY_COUNT(D_80177E98); i++) { + D_80177E98[i].x = D_80177E98[i].y = D_80177E98[i].z = 100.0f; + } + for (i = 0; i < ARRAY_COUNT(D_80176878); i++) { + D_80176550[i] = 0; + for (j = 0; j < ARRAY_COUNT(*D_80176878); j++) { + D_80176878[i][j] = -5000.0f; + } + } +} + +void func_800A6590(void) { + if (D_80178340 != D_80178358) { + if (D_80178340 < D_80178358) { + D_80178340 += D_8017835C; + if (D_80178340 >= D_80178358) { + D_80178340 = D_80178358; + } + } else { + D_80178340 -= D_8017835C; + if (D_80178358 >= D_80178340) { + D_80178340 = D_80178358; + } + } + } + D_8017835C = 0x10; + Math_SmoothStepToF(&D_8017836C, 0.0f, 1.0f, 0.04f, 0.001f); + if (D_80161A60 != 0) { + D_80161A60--; + if (D_80161A60 & 2) { + D_80178348 = 255; + D_80178350 = 255; + D_80178354 = 255; + D_80178340 = 254; + } else { + D_80178340 = 0; + } + } +} + +void func_800A668C(f32 xPos, f32 yPos, f32 zPos) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(gObjects70); i++) { + if (gObjects70[i].obj.status == 0) { + Object_70_Initialize(&gObjects70[i]); + gObjects70[i].obj.status = 2; + gObjects70[i].unk_60 = 0; + gObjects70[i].obj.pos.x = xPos; + gObjects70[i].obj.pos.y = yPos; + gObjects70[i].obj.pos.z = zPos; + break; + } + } +} + +void func_800A670C(Object_2F4* obj2F4, s32 arg1, f32 arg2, f32 arg3, f32 arg4) { + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 1; + obj2F4->obj.id = OBJECT_189; + obj2F4->unk_0B8 = arg1; + obj2F4->obj.pos.x = arg2; + obj2F4->obj.pos.y = arg3; + obj2F4->obj.pos.z = arg4; + obj2F4->unk_10C = 0.5f; + if ((arg1 == 0) || (arg1 == 1)) { + obj2F4->unk_0E8.y = (Rand_ZeroOne() * 5.0f) + 10.0f; + obj2F4->unk_0E8.x = 10.0f; + + if (arg1 == 0) { + obj2F4->unk_0E8.x = -10.0f; + } + obj2F4->unk_0BC = 15; + } else { + if (gLevelType == 0) { + obj2F4->unk_0E8.y = (Rand_ZeroOne() * 7.0f) + 7.0f; + obj2F4->unk_0E8.x = (Rand_ZeroOne() - 0.5f) * 10.0f; + obj2F4->unk_0E8.z = (Rand_ZeroOne() * 5.0f) + 5.0f; + if (D_80177880 == 1) { + obj2F4->unk_0E8.z = (Rand_ZeroOne() - 0.5f) * 10.0f; + } + obj2F4->unk_0BC = (s32) (Rand_ZeroOne() * 10.0f) + 10; + } else { + obj2F4->unk_0E8.x = (Rand_ZeroOne() - 0.5f) * 10.0f; + obj2F4->unk_0E8.y = (Rand_ZeroOne() - 0.5f) * 10.0f; + obj2F4->unk_0E8.z = (Rand_ZeroOne() - 0.5f) * 10.0f; + obj2F4->unk_0BC = (s32) (Rand_ZeroOne() * 25.0f) + 25; + obj2F4->unk_10C = 0.0f; + } + if (arg1 == 2) { + obj2F4->unk_110 = (Rand_ZeroOne() * 1.5f) + 0.75f; + } else if (arg1 == 4) { + obj2F4->unk_110 = (Rand_ZeroOne() * 0.8f) + 0.3f; + obj2F4->unk_0BC = (s32) (Rand_ZeroOne() * 50.0f) + 70; + } + obj2F4->obj.rot.x = Rand_ZeroOne() * 360.0f; + } + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); +} + +void func_800A69F8(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { + s32 i; + + if (D_801778E8 == 0) { + for (i = ARRAY_COUNT(gObjects2F4) - 1; i >= 10; i--) { + if (gObjects2F4[i].obj.status == 0) { + func_800A670C(&gObjects2F4[i], arg0, arg1, arg2, arg3); + break; + } + } + } +} + +// has to be int. s32 and u32 don't match +int func_800A6A74(void) { + return gGoldRingCount[0] && gGoldRingCount[1] && gGoldRingCount[2] && gGoldRingCount[3]; +} + +void func_800A6AC0(Player* player, s32 side, s32 damage) { + if ((player->unk_1CC == 0) && (D_80177AB8[player->unk_1C4] < 1.0f)) { + if (side == 1) { + D_80177D40[player->unk_1C4] = 30; + if (player->wings.rightState == 2) { + gRightWingHealth[player->unk_1C4] -= damage; + if (gRightWingHealth[player->unk_1C4] <= 0) { + func_800A69F8(1, player->unk_2D4.x, player->unk_2D4.y, player->unk_2D4.z); + player->wings.rightState = 1; + func_8007D0E0(player->unk_2D4.x, player->unk_2D4.y, player->unk_2D4.z, 2.0f); + D_80177D70[player->unk_1C4] = 50; + func_800A5FA0(&player->unk_460, 0x0900A02C, player->unk_1C4); + if (D_8015F90C == 0) { + D_8015F90C = 1000; + } + } + } + } else if (side == 2) { + D_80177D58[player->unk_1C4] = 30; + if (player->wings.leftState == 2) { + gLeftWingHealth[player->unk_1C4] -= damage; + if (gLeftWingHealth[player->unk_1C4] <= 0) { + func_800A69F8(0, player->unk_2C8.x, player->unk_2C8.y, player->unk_2C8.z); + player->wings.leftState = 1; + func_8007D0E0(player->unk_2C8.x, player->unk_2C8.y, player->unk_2C8.z, 2.0f); + D_80177D88[player->unk_1C4] = 50; + func_800A5FA0(&player->unk_460, 0x0900A02C, player->unk_1C4); + if (D_8015F90C == 0) { + D_8015F90C = 1000; + } + } + } + } + } +} + +void func_800A6CD0(Player* player, s32 arg1, s32 damage) { + Vec3f sp44; + Vec3f sp38; + f32 sp34 = 20.0f; + + player->unk_1A4 = damage; + player->unk_21C = arg1; + if ((damage == 39) || (damage == 41) || (damage == 42) || (damage == 43)) { + damage = 40; + } + if (gExpertMode) { + player->damage = damage * 2; + } else { + player->damage = damage; + } + if (player->damage != 0) { + player->unk_220 = 4; + } + player->unk_284 = 0; + player->unk_1F4 = 20; + if (player->unk_1A4 > 40) { + sp34 = (player->unk_110 * 0.3f) + 20.0f; + player->unk_498 = 5; + } else if ((gCurrentLevel == LEVEL_VENOM_2) && (D_80178284 == 0)) { + player->unk_498 = 3; + } else if ((gCurrentLevel == LEVEL_VENOM_1) || (gCurrentLevel == LEVEL_AQUAS)) { + player->unk_498 = 5; + } else { + player->unk_498 = 20; + } + if (D_80177AD0[player->unk_1C4] != 0) { + func_800A5FA0(&player->unk_460, 0x0903900E, player->unk_1C4); + D_80177AE8[player->unk_1C4] = 5; + D_80177AB8[player->unk_1C4] = 2.0f; + player->damage = 0; + } else { + if (player->health != 0) { + if (player->health < 50) { + func_80019218(0x49008011, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } else if (player->health < 100) { + func_80019218(0x49008010, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + } + if (damage < 25) { + func_800A5FA0(&player->unk_460, 0x0903900E, player->unk_1C4); + } else { + func_800A5FA0(&player->unk_460, 0x0903A00F, player->unk_1C4); + } + } + Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, player->unk_0F8 * M_DTOR, 1); + sp44.z = 0.0f; + switch (player->unk_21C) { + case 0: + player->unk_224 = 20; + player->unk_0D8.x = 0.f; + player->unk_0D8.y = 0.f; + player->unk_0D8.z = 0.f; + break; + case 1: + sp44.x = -sp34; + sp44.y = 0.0f; + + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); + player->unk_0D8.x = sp38.x; + player->unk_0D8.y = sp38.y; + player->unk_0D8.z = sp38.z; + func_800A668C(player->unk_2D4.x - player->unk_0C0.x, player->unk_2D4.y, + player->unk_2D4.z - player->unk_0C0.z); + func_800A6AC0(player, 1, 20); + break; + case 2: + sp44.x = sp34; + sp44.y = 0.0f; + + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); + player->unk_0D8.x = sp38.x; + player->unk_0D8.y = sp38.y; + player->unk_0D8.z = sp38.z; + func_800A668C(player->unk_2C8.x - player->unk_0C0.x, player->unk_2C8.y, + player->unk_2C8.z - player->unk_0C0.z); + func_800A6AC0(player, 2, 20); + break; + case 3: + player->unk_224 = 20; + func_800A668C(player->unk_2EC.x - player->unk_0C0.x, player->unk_2EC.y, + player->unk_2EC.z - player->unk_0C0.z); + if (player->unk_1CC != 1) { + sp44.x = 0.0f; + sp44.y = -sp34; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); + player->unk_0D8.x = sp38.x; + player->unk_0D8.y = sp38.y; + player->unk_0D8.z = sp38.z; + } + if (Rand_ZeroOne() < 0.5f) { + func_800A6AC0(player, 1, 15); + } else { + func_800A6AC0(player, 2, 15); + } + break; + case 4: + player->unk_224 = 20; + func_800A668C(player->unk_2E0.x - player->unk_0C0.x, player->unk_2E0.y, + player->unk_2E0.z - player->unk_0C0.z); + sp44.x = 0.0f; + sp44.y = sp34; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); + player->unk_0D8.x = sp38.x; + player->unk_0D8.y = sp38.y; + player->unk_0D8.z = sp38.z; + if (Rand_ZeroOne() < 0.5f) { + func_800A6AC0(player, 1, 15); + } else { + func_800A6AC0(player, 2, 15); + } + break; + } + if ((gCurrentLevel == LEVEL_VENOM_1) && (player->unk_1A4 == 42)) { + if (player->unk_074 > 0.0f) { + player->unk_0D8.x = -30.0f; + } else { + player->unk_0D8.x = 30.0f; + } + player->unk_498 = 10; + } +} + +void func_800A729C(Player* player, u32 arg1, f32 arg2, f32 arg3) { + player->unk_21C = arg1; + switch (arg1) { + case 1: + case 2: + player->unk_074 = player->unk_08C.y; + player->unk_0D8.x = 0.0f; + player->unk_074 += D_800D2FEC[player->unk_21C]; + if (player->unk_1CC == 1) { + player->unk_074 -= D_800D2FEC[player->unk_21C]; + } + Math_SmoothStepToF(&player->unk_0D0, 2.0f, 1.0f, 2.0f, 0.00001f); + break; + case 3: + case 4: + player->unk_07C = player->unk_098; + player->unk_0D8.z = 0.0f; + player->unk_07C += D_800D2FEC[player->unk_21C]; + if (player->unk_1CC == 1) { + player->unk_07C += D_800D2FEC[player->unk_21C]; + } + player->unk_138 = player->unk_07C; + Math_SmoothStepToF(&player->unk_0D0, 2.0f, 1.0f, 2.0f, 0.00001f); + break; + case 0: + case 5: + break; + } +} + +bool func_800A73E4(f32* arg0, s32* arg1, f32 posX, f32 posY, f32 posZ) { + Vtx* spA4; + u16* spA0; + s32 sp9C; + s32 sp98; + f32 sp94; + f32 sp90; + s32 sp8C; + f32 x0; + f32 y0; + f32 z0; + f32 x1; + f32 y1; + f32 z1; + f32 x2; + f32 y2; + f32 z2; + f32 temp1; + f32 dz21; + f32 dx10; + f32 dx21; + f32 dy10; + f32 dy21; + f32 dz10; + f32 sp48; + f32 crz; + f32 cry; + f32 crx; + + switch (gCurrentLevel) { + case LEVEL_SOLAR: + spA4 = SEGMENTED_TO_VIRTUAL(D_6001C50); + spA0 = SEGMENTED_TO_VIRTUAL(D_6022760); + break; + case LEVEL_ZONESS: + spA4 = SEGMENTED_TO_VIRTUAL(D_6009ED0); + spA0 = SEGMENTED_TO_VIRTUAL(D_602AC50); + break; + default: + return false; + } + + sp9C = (s32) ((posX + 2400.0f) / 300.0f); + sp98 = (s32) ((posZ + D_80177D20 + 1500.0f + 2400.0f) / 300.0f); + if ((sp9C < 0) || (sp9C >= 16) || (sp98 < 0) || (sp98 >= 16)) { + return 0; + } + sp90 = Math_ModF(posX + 2400.0f, 300.0f); + sp94 = Math_ModF(posZ + D_80177D20 + 1500.0f + 2400.0f, 300.0f); + sp8C = (sp98 * 17) + sp9C; + x0 = spA4[spA0[sp8C]].n.ob[0] * 3.0f; + y0 = spA4[spA0[sp8C]].n.ob[1] * 2.0f; + z0 = spA4[spA0[sp8C]].n.ob[2] * 3.0f; + if (sp90 < sp94) { + x1 = spA4[spA0[sp8C + 18]].n.ob[0] * 3.0f; + y1 = spA4[spA0[sp8C + 18]].n.ob[1] * 2.0f; + z1 = spA4[spA0[sp8C + 18]].n.ob[2] * 3.0f; + x2 = spA4[spA0[sp8C + 17]].n.ob[0] * 3.0f; + y2 = spA4[spA0[sp8C + 17]].n.ob[1] * 2.0f; + z2 = spA4[spA0[sp8C + 17]].n.ob[2] * 3.0f; + } else { + x1 = spA4[spA0[sp8C + 1]].n.ob[0] * 3.0f; + y1 = spA4[spA0[sp8C + 1]].n.ob[1] * 2.0f; + z1 = spA4[spA0[sp8C + 1]].n.ob[2] * 3.0f; + x2 = spA4[spA0[sp8C + 18]].n.ob[0] * 3.0f; + y2 = spA4[spA0[sp8C + 18]].n.ob[1] * 2.0f; + z2 = spA4[spA0[sp8C + 18]].n.ob[2] * 3.0f; + } + dx10 = x1 - x0; + dx21 = x2 - x1; + dy10 = y1 - y0; + + dy21 = y2 - y1; + dz10 = z1 - z0; + dz21 = z2 - z1; + + crx = (dy10 * dz21) - (dz10 * dy21); + cry = (dz10 * dx21) - (dx10 * dz21); + crz = (dx10 * dy21) - (dy10 * dx21); + + temp1 = -crx * x0 - cry * y0 - crz * z0; + sp48 = (-temp1 - crx * posX - crz * (posZ + D_80177D20 + 1500.0f)) / cry; + if (posY < sp48) { + *arg0 = sp48; + *arg1 = sp8C; + return true; + } + return false; +} + +s32 func_800A78C4(f32* hitbox, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { + if ((fabsf(hitbox[0] + arg3 - arg6) < (hitbox[1] + D_8017853C)) && + (fabsf(hitbox[4] + arg1 - arg4) < (hitbox[5] + D_8017853C)) && + (fabsf(hitbox[2] + arg2 - arg5) < (hitbox[3] + D_8017853C))) { + return true; + } + return false; +} + +s32 func_800A7974(Player* player, f32* hitboxData, s32* index, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, + f32 zRot, f32 arg9, f32 argA, f32 argB) { + s32 spB4; + s32 i; + f32 var_fv0; + f32 var_fv1; + f32 var_fa0; + f32 spA0; + Vec3f sp94; + Vec3f sp88; + + spB4 = *hitboxData++; + if (spB4 != 0) { + for (i = 0; i < spB4; i++, hitboxData += 6) { + spA0 = 0; + if (hitboxData[0] == 200000.0f) { + Matrix_RotateZ(gCalcMatrix, -hitboxData[3] * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, -hitboxData[1] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -hitboxData[2] * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, 1); + hitboxData += 4; + spA0 = 1; + } else { + if (hitboxData[0] >= 300000.0f) { + hitboxData++; + } + Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, 1); + } + if (!((arg9 == 0) && (argA == 0) && (argB == 0))) { + Matrix_RotateZ(gCalcMatrix, -argB * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -arg9 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -argA * M_DTOR, 1); + } + if ((yRot == 0.0f) && (zRot == 0.0f) && (xRot == 0.0f) && (spA0 == 0)) { + var_fv0 = player->unk_2E0.x; + var_fv1 = player->unk_2E0.y; + var_fa0 = player->unk_2E0.z; + } else { + sp94.x = player->unk_2E0.x - xPos; + sp94.y = player->unk_2E0.y - yPos; + sp94.z = player->unk_2E0.z - zPos; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp94, &sp88); + var_fv0 = sp88.x + xPos; + var_fv1 = sp88.y + yPos; + var_fa0 = sp88.z + zPos; + } + if (func_800A78C4(hitboxData, xPos, yPos, zPos, var_fv0, var_fv1, var_fa0)) { + *index = i + 1; + if (hitboxData[-1] == 300000.0f) { + return -1; + } + if (hitboxData[-1] == 400000.0f) { + return -2; + } + return 3; + } + if (hitboxData[-1] < 300000.0f) { + if ((yRot == 0.0f) && (zRot == 0.0f) && (xRot == 0.0f) && (spA0 == 0)) { + var_fv0 = player->unk_2EC.x; + var_fv1 = player->unk_2EC.y; + var_fa0 = player->unk_2EC.z; + } else { + sp94.x = player->unk_2EC.x - xPos; + sp94.y = player->unk_2EC.y - yPos; + sp94.z = player->unk_2EC.z - zPos; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp94, &sp88); + var_fv0 = sp88.x + xPos; + var_fv1 = sp88.y + yPos; + var_fa0 = sp88.z + zPos; + } + if (func_800A78C4(hitboxData, xPos, yPos, zPos, var_fv0, var_fv1, var_fa0)) { + *index = i + 1; + return 4; + } + if ((yRot == 0.0f) && (zRot == 0.0f) && (xRot == 0.0f) && (spA0 == 0)) { + var_fv0 = player->unk_2D4.x; + var_fv1 = player->unk_2D4.y; + var_fa0 = player->unk_2D4.z; + } else { + sp94.x = player->unk_2D4.x - xPos; + sp94.y = player->unk_2D4.y - yPos; + sp94.z = player->unk_2D4.z - zPos; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp94, &sp88); + var_fv0 = sp88.x + xPos; + var_fv1 = sp88.y + yPos; + var_fa0 = sp88.z + zPos; + } + if (func_800A78C4(hitboxData, xPos, yPos, zPos, var_fv0, var_fv1, var_fa0)) { + *index = i + 1; + return 1; + } + if ((yRot == 0.0f) && (zRot == 0.0f) && (xRot == 0.0f) && (spA0 == 0)) { + var_fv0 = player->unk_2C8.x; + var_fv1 = player->unk_2C8.y; + var_fa0 = player->unk_2C8.z; + } else { + sp94.x = player->unk_2C8.x - xPos; + sp94.y = player->unk_2C8.y - yPos; + sp94.z = player->unk_2C8.z - zPos; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp94, &sp88); + var_fv0 = sp88.x + xPos; + var_fv1 = sp88.y + yPos; + var_fa0 = sp88.z + zPos; + } + if (func_800A78C4(hitboxData, xPos, yPos, zPos, var_fv0, var_fv1, var_fa0)) { + *index = i + 1; + return 2; + } + } + } + } + return 0; +} + +bool func_800A8054(s32 objId, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, Vec3f* arg7, Vec3f* arg8) { + Vec3f sp54; + Vec3f sp48; + Vec3f sp3C; + f32 pad1; + f32 sp34; + s32 var_s0; + s32 var_v0; + + sp54.x = arg4; + sp54.y = arg5; + sp54.z = arg6; + sp48.x = arg1; + sp48.y = arg2; + sp48.z = arg3; + + var_v0 = false; + switch (objId) { + case OBJECT_180: + var_s0 = 0; + break; + case OBJECT_4: + case OBJECT_5: + var_s0 = 1; + var_v0 = true; + break; + case OBJECT_149: + var_s0 = 5; + break; + case OBJECT_150: + var_s0 = 6; + break; + case OBJECT_308: + var_s0 = 4; + break; + case OBJECT_312: + var_s0 = 9; + break; + case OBJECT_309: + var_s0 = 7; + break; + case OBJECT_UNK_1000: + var_s0 = 3; + break; + case OBJECT_313: + var_s0 = 8; + break; + case OBJECT_39: + var_s0 = 1; + break; + case OBJECT_120: + var_s0 = 18; + var_v0 = true; + break; + case OBJECT_124: + var_s0 = 15; + var_v0 = true; + break; + case OBJECT_126: + var_s0 = 16; + var_v0 = true; + break; + case OBJECT_47: + var_s0 = 7; + var_v0 = true; + break; + case OBJECT_2: + var_s0 = 2; + var_v0 = true; + break; + case OBJECT_3: + case OBJECT_69: + var_s0 = 3; + var_v0 = true; + break; + case OBJECT_143: + var_s0 = 17; + var_v0 = true; + break; + case OBJECT_140: + var_s0 = 4; + var_v0 = true; + break; + case OBJECT_141: + var_s0 = 6; + var_v0 = true; + break; + case OBJECT_117: + var_s0 = 14; + var_v0 = true; + break; + case OBJECT_70: + var_s0 = 8; + var_v0 = true; + break; + case OBJECT_72: + var_s0 = 9; + var_v0 = true; + break; + case OBJECT_71: + var_s0 = 10; + var_v0 = true; + break; + case OBJECT_73: + var_s0 = 11; + var_v0 = true; + break; + case OBJECT_67: + var_s0 = 12; + var_v0 = true; + break; + case OBJECT_74: + var_s0 = 13; + var_v0 = true; + break; + case OBJECT_118: + case OBJECT_119: + case OBJECT_121: + case OBJECT_122: + case OBJECT_123: + case OBJECT_125: + case OBJECT_127: + case OBJECT_128: + case OBJECT_129: + case OBJECT_130: + case OBJECT_131: + case OBJECT_132: + case OBJECT_133: + case OBJECT_134: + case OBJECT_135: + case OBJECT_136: + case OBJECT_137: + case OBJECT_138: + case OBJECT_139: + case OBJECT_142: + case OBJECT_144: + case OBJECT_145: + case OBJECT_146: + case OBJECT_147: + case OBJECT_148: + case OBJECT_40: + case OBJECT_41: + case OBJECT_42: + case OBJECT_43: + case OBJECT_44: + case OBJECT_45: + case OBJECT_46: + case OBJECT_48: + case OBJECT_49: + case OBJECT_50: + case OBJECT_51: + case OBJECT_52: + case OBJECT_53: + case OBJECT_54: + case OBJECT_55: + case OBJECT_56: + case OBJECT_57: + case OBJECT_58: + case OBJECT_59: + case OBJECT_60: + case OBJECT_61: + case OBJECT_62: + case OBJECT_63: + case OBJECT_64: + case OBJECT_65: + case OBJECT_66: + case OBJECT_68: + default: + var_s0 = 0; + var_v0 = true; + break; + } + + if (!var_v0) { + if (func_800998FC(&sp54, &sp48, arg8, var_s0, &sp3C, &sp34) > 0) { + return true; + } + } else { + if (func_800A3690(&sp54, &sp48, var_s0, arg7)) { + return true; + } + } + return false; +} + +// arg5 could be Vec3f (not Vec3f*) +s32 func_800A8304(Player* player, s32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { + Vec3f sp84; + Vec3f sp78; + Vec3f sp6C; + Vec3f sp60; + Vec3f sp54; + + sp84.x = arg2; + sp84.y = arg3; + sp84.z = arg4; + Matrix_RotateY(gCalcMatrix, -arg6 * M_DTOR, 0); + sp78.x = player->unk_0C0.x; + sp78.y = player->unk_0C0.y; + sp78.z = player->unk_0C0.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp54); + if ((player->unk_1CC == 1) || (player->unk_1CC == 3)) { + sp78.x = player->unk_074 - sp84.x; + sp78.y = player->unk_078 - sp84.y; + sp78.z = player->unk_138 - sp84.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); + if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, + &sp54)) { + player->unk_078 = sp60.y; + player->unk_104 = Math_RadToDeg(sp60.x); + player->unk_10C = Math_RadToDeg(sp60.z); + player->unk_0C0.y = 0.0f; + if (player->unk_1CC == 3) { + player->unk_0C0.y = -5.0f; + } + player->unk_1D4 = 1; + return 5; + } + return 0; + } + sp78.x = player->unk_2E0.x - sp84.x; + sp78.y = player->unk_2E0.y - sp84.y; + sp78.z = player->unk_2E0.z - sp84.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); + if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, &sp54)) { + return 3; + } + sp78.x = player->unk_2EC.x - sp84.x; + sp78.y = player->unk_2EC.y - sp84.y; + sp78.z = player->unk_2EC.z - sp84.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); + if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, &sp54)) { + return 4; + } + sp78.x = player->unk_2D4.x - sp84.x; + sp78.y = player->unk_2D4.y - sp84.y; + sp78.z = player->unk_2D4.z - sp84.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); + if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, &sp54)) { + return 1; + } + sp78.x = player->unk_2C8.x - sp84.x; + sp78.y = player->unk_2C8.y - sp84.y; + sp78.z = player->unk_2C8.z - sp84.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); + if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, &sp54)) { + return 2; + } + return 0; +} + +void func_800A86E4(Player* player) { + s32 i; + Object_6C* obj6C; + s32 sp6C; + + for (i = 0, obj6C = gObjects6C; i < ARRAY_COUNT(gObjects6C); i++, obj6C++) { + if ((obj6C->obj.status == 2) && ((player->unk_1C8 == 3) || (player->unk_1C8 == 5)) && (obj6C->unk_4A == 0) && + func_800A7974(player, obj6C->unk_1C.hitbox, &sp6C, obj6C->obj.pos.x, obj6C->obj.pos.y, obj6C->obj.pos.z, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)) { + obj6C->unk_4C = 1; + obj6C->unk_4E = D_801778A0; + } + } +} + +void func_800A8804(Player* playerA, Player* playerB) { + if (playerA->unk_498 == 0) { + func_800A6CD0(playerA, 0, D_800D3000[playerA->unk_1CC][playerB->unk_1CC]); + playerA->unk_288 = playerB->unk_1C4 + 1; + playerB->unk_288 = playerA->unk_1C4 + 1; + } +} + +void func_800A887C(Player* player) { + Vec3f sp3C; + + Matrix_Translate(gCalcMatrix, player->unk_074, player->unk_078, player->unk_138, 0); + if (player->unk_1CC == 1) { + player->unk_10C = 0.0f; + player->unk_104 = 0.0f; + + sp3C.x = -40.0f; + sp3C.y = 40.0f; + sp3C.z = 0.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2C8); + sp3C.x = 40.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2D4); + sp3C.x = 0.0f; + sp3C.z = -40.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2E0); + sp3C.z = 40.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2EC); + } + if ((player->unk_1CC == 3) || (player->unk_1CC == 4)) { + sp3C.x = 20.0f; + sp3C.y = 20.0f; + sp3C.z = 0.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2C8); + sp3C.x = -20.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2D4); + sp3C.x = 0.0f; + sp3C.z = -20.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2E0); + sp3C.z = 20.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2EC); + } + if ((player->unk_1CC == 0) || (player->unk_1CC == 2)) { + Matrix_RotateY(gCalcMatrix, (player->unk_114 + 180.0f) * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -(player->unk_0F8 * M_DTOR), 1); + sp3C.y = 0.0f; + sp3C.z = 0.0f; + if (player->wings.leftState == 2) { + sp3C.x = 40.0f; + } else { + sp3C.y = -10.0f; + sp3C.x = 30.0f; + } + if (player->unk_1CC == 2) { + sp3C.x = 24.0f; + } + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2C8); + if (player->wings.rightState == 2) { + sp3C.x = -40.0f; + } else { + sp3C.x = -30.0f; + } + if (player->unk_1CC == 2) { + sp3C.x = -24.0f; + } + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2D4); + sp3C.x = 0.0f; + sp3C.y = 24.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2E0); + sp3C.y = -24.0f; + Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->unk_2EC); + } +} + +#ifdef NON_MATCHING +void func_800A8BA4(Player* player) { + s32 i; + s32 j; + s32 temp_v0; + f32 spE8; + f32 spE4; + f32 spE0; + Vec3f spfD4; + Vec3f spC8; + Vec3f spBC; + f32 padB8; // B8 + Object_2F4* obj2F4; // B4 + f32 padB0; // B0 + Object_408* obj408; // AC + Object_4C* obj4C; // A8 + Object_58* obj58; // A4 + Object_80* obj80; // A0 + Player* opponent; // 9C + s32 sp98; + f32 sp94; + s32 sp90; + f32 sp8C; + + func_800A887C(player); + if (D_801784AC == 4) { + switch (player->unk_1CC) { + case 1: + func_800444BC(player); + break; + case 2: + if (func_E6A810_801B6AEC(player->unk_074, player->unk_078 - 12.0f, player->unk_138 + player->unk_144) != + 0) { + func_E6A810_801B6E20(player->unk_074, player->unk_138 + player->unk_144, &spE8, &spE0, &spE4); + player->unk_078 = spE0 + 10.0f; + } + break; + } + } else if (player->unk_1CC == 0) { + if ((player->unk_2D4.y < (D_80177940 + 13.0f)) && (player->unk_1C8 != 4)) { + if (D_80161A88 == 2) { + player->unk_1F4 = 7; + player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.5f; + } else { + func_800A6CD0(player, 1, 0x15); + } + if (gCurrentLevel == LEVEL_FORTUNA) { + func_8007BC7C(player->unk_2D4.x, player->unk_2D4.y, player->unk_2D4.z, 6.0f); + func_8007BC7C(player->unk_2D4.x, player->unk_2D4.y, player->unk_2D4.z, 6.0f); + func_8007BC7C(player->unk_2D4.x, player->unk_2D4.y, player->unk_2D4.z, 6.0f); + } + } + if ((player->unk_2C8.y < (D_80177940 + 13.0f)) && (player->unk_1C8 != 4)) { + if (D_80161A88 == 2) { + player->unk_1F4 = 7; + player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.5f; + } else { + func_800A6CD0(player, 2, 0x15); + } + if (gCurrentLevel == LEVEL_FORTUNA) { + func_8007BC7C(player->unk_2C8.x, player->unk_2C8.y, player->unk_2C8.z, 6.0f); + func_8007BC7C(player->unk_2C8.x, player->unk_2C8.y, player->unk_2C8.z, 6.0f); + func_8007BC7C(player->unk_2C8.x, player->unk_2C8.y, player->unk_2C8.z, 6.0f); + } + } + } else if ((player->unk_1CC == 1) && (D_801778E8 == 0)) { + func_800444BC(player); + } + + if ((player->unk_498 == 0) || ((gCamCount != 1) && (player->unk_1CC != 0))) { + if (D_80177880 == 1) { + sp8C = 1100.0f; + if ((gCurrentLevel == LEVEL_SECTOR_Y) || (gCurrentLevel == LEVEL_VENOM_2)) { + sp8C = 4000.0f; + } + for (i = 0, obj58 = gObjects58; i < 200; i++, obj58++) { + if (obj58->obj.status == 2) { + spC8.x = obj58->obj.pos.x - player->unk_074; + spC8.z = obj58->obj.pos.z - player->unk_138; + if (sqrtf(SQ(spC8.x) + SQ(spC8.z)) < sp8C) { + if ((obj58->obj.id == OBJECT_117) || (obj58->obj.id == OBJECT_143) || + (obj58->obj.id == OBJECT_141) || (obj58->obj.id == OBJECT_149) || + (obj58->obj.id == OBJECT_150) || (obj58->obj.id == OBJECT_148) || + (obj58->obj.id == OBJECT_160) || (obj58->obj.id == OBJECT_1) || + (obj58->obj.id == OBJECT_3) || (obj58->obj.id == OBJECT_140)) { + temp_v0 = + func_800A8304(player, obj58->obj.id, obj58->obj.pos.x, obj58->obj.pos.y, + obj58->obj.pos.z, obj58->obj.rot.x, obj58->obj.rot.y, obj58->obj.rot.z); + if (temp_v0 != 0) { + if ((player->unk_1CC == 1) || (player->unk_1CC == 3)) { + func_800A729C(player, temp_v0, obj58->obj.pos.x, obj58->obj.pos.z); + } else { + func_800A6CD0(player, temp_v0, obj58->unk_1C.damage); + } + } + if ((gCurrentLevel == LEVEL_FORTUNA) || (gCurrentLevel == LEVEL_VENOM_SW)) { + temp_v0 = func_800A7974(player, obj58->unk_1C.hitbox, &sp98, obj58->obj.pos.x, + obj58->obj.pos.y, obj58->obj.pos.z, obj58->obj.rot.x, + obj58->obj.rot.y, obj58->obj.rot.z, 0.0f, 0.0f, 0.0f); + if ((temp_v0 != 0) && (temp_v0 < 0)) { + if (player->unk_22C == 0) { + func_8007A6F0(&obj58->obj.pos, 0x19000001); + } + player->unk_22C += 2; + if (player->unk_22C >= 4) { + player->unk_22C = 4; + } + } + } + } else { + temp_v0 = func_800A7974(player, obj58->unk_1C.hitbox, &sp98, obj58->obj.pos.x, + obj58->obj.pos.y, obj58->obj.pos.z, obj58->obj.rot.x, + obj58->obj.rot.y, obj58->obj.rot.z, 0.0f, 0.0f, 0.0f); + if (temp_v0 != 0) { + if (temp_v0 < 0) { + if (player->unk_22C == 0) { + func_8007A6F0(&obj58->obj.pos, 0x19000001); + } + player->unk_22C += 2; + if (player->unk_22C >= 4) { + player->unk_22C = 4; + } + } else if ((player->unk_1CC == 1) || (player->unk_1CC == 3)) { + func_800A729C(player, temp_v0, obj58->obj.pos.x, obj58->obj.pos.z); + } else { + func_800A6CD0(player, temp_v0, obj58->unk_1C.damage); + if (obj58->obj.id == OBJECT_131) { + Matrix_RotateY(gCalcMatrix, (obj58->obj.rot.y + 180.0f) * M_DTOR, 0); + Matrix_MultVec3f(gCalcMatrix, &D_800D3040[sp98 - 1], &spBC); + player->unk_0D8.x = spBC.x; + player->unk_0D8.y = spBC.y; + player->unk_0D8.z = spBC.z; + + player->unk_0E8 = player->unk_0E4 = 0.0f; + player->unk_074 = player->unk_08C.y; + player->unk_078 = player->unk_08C.z; + player->unk_07C = player->unk_098; + player->unk_114 = obj58->obj.rot.y + 180.0f; + player->unk_498 = 5; + } + if ((obj58->obj.id == OBJECT_135) || (obj58->obj.id == OBJECT_136)) { + if (obj58->obj.id == OBJECT_135) { + Matrix_RotateY(gCalcMatrix, (obj58->obj.rot.y + 180.0f) * M_DTOR, 0); + Matrix_MultVec3f(gCalcMatrix, &D_800D3088[sp98 - 1], &spBC); + } else { + Matrix_RotateY(gCalcMatrix, obj58->obj.rot.y * M_DTOR, 0); + Matrix_MultVec3f(gCalcMatrix, &D_800D30B8[sp98 - 1], &spBC); + } + player->unk_0D8.x = spBC.x; + player->unk_0D8.y = spBC.y; + player->unk_0D8.z = spBC.z; + player->unk_0E8 = 0.0f; + player->unk_0E4 = 0.0f; + player->unk_074 = player->unk_08C.y; + player->unk_078 = player->unk_08C.z; + player->unk_07C = player->unk_098; + if (obj58->obj.id == OBJECT_135) { + player->unk_114 = obj58->obj.rot.y + 180.0f; + } else { + player->unk_114 = obj58->obj.rot.y; + } + player->unk_498 = 5; + } + } + } + } + } + } + } + } else { + for (i = 0, obj80 = gObjects80; i < ARRAY_COUNT(gObjects80); i++, obj80++) { + if ((obj80->obj.status == 2) && (obj80->obj.id != 0x3A) && (obj80->obj.id != 0x69) && + (obj80->obj.id != 0x3B) && (obj80->obj.id != 0x3C) && (obj80->obj.id != 0x3D) && + (obj80->obj.id != 0x42) && (obj80->obj.id != 0x43) && (obj80->obj.id != 0x46) && + (obj80->obj.id != 0x48) && (obj80->obj.id != 0x47) && (obj80->obj.id != 0x49) && + (obj80->obj.id != 0x4A) && (obj80->obj.id != 0x45) && + ((player->unk_138 - 2000.0f) < obj80->obj.pos.z)) { + if ((obj80->obj.id == OBJECT_1) || (obj80->obj.id == OBJECT_4) || (obj80->obj.id == OBJECT_5) || + (obj80->obj.id == OBJECT_47) || (obj80->obj.id == OBJECT_117) || + (obj80->obj.id == OBJECT_120) || (obj80->obj.id == OBJECT_124) || + (obj80->obj.id == OBJECT_126) || (obj80->obj.id == OBJECT_2) || (obj80->obj.id == OBJECT_3)) { + spC8.x = obj80->obj.pos.x - player->unk_074; + spC8.z = obj80->obj.pos.z - player->unk_138; + if (sqrtf(SQ(spC8.x) + SQ(spC8.z)) < 100.0f) { + temp_v0 = + func_800A8304(player, obj80->obj.id, obj80->obj.pos.x, obj80->obj.pos.y, + obj80->obj.pos.z, obj80->obj.rot.x, obj80->obj.rot.y, obj80->obj.rot.z); + if (temp_v0 != 0) { + func_800A6CD0(player, temp_v0, obj80->unk_1C.damage); + } + } + } else { + padB0 = obj80->obj.rot.y; + if ((ObjectFunc) func_80066EA8 == obj80->unk_1C.action) { + padB0 = 0.0f; + } + temp_v0 = func_800A7974(player, obj80->unk_1C.hitbox, &sp98, obj80->obj.pos.x, obj80->obj.pos.y, + obj80->obj.pos.z, obj80->obj.rot.x, padB0, obj80->obj.rot.z, 0.0f, 0.0f, + 0.0f); + if (temp_v0 != 0) { + if (temp_v0 < 0) { + if (temp_v0 == -1) { + D_80178540 = 40; + D_80178570 = 20; + D_80178574 = 20; + D_80178578 = 20; + player->unk_23C = 0x50; + } + if (player->unk_22C == 0) { + func_80019218(0x19000001, &obj80->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + player->unk_22C += 2; + if (player->unk_22C >= 4) { + player->unk_22C = 4; + } + } else if (obj80->obj.id == OBJECT_54) { + if (player->unk_22C == 0) { + func_80019218(0x19832019, &obj80->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + player->unk_22C += 2; + if (player->unk_22C >= 4) { + player->unk_22C = 4; + } + } else { + func_800A6CD0(player, temp_v0, obj80->unk_1C.damage); + if ((obj80->obj.id == OBJECT_48) || (obj80->obj.id == OBJECT_55) || + (obj80->obj.id == OBJECT_49)) { + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); + spC8.x = -(player->unk_0D0 + player->unk_110) * 0.7f; + spC8.y = 0.0f; + spC8.z = 0.0f; + + Matrix_MultVec3f(gCalcMatrix, &spC8, &spBC); + player->unk_0D8.x = spBC.x; + player->unk_0D8.y = spBC.y; + player->unk_074 = player->unk_08C.y; + player->unk_498 = 5; + } else if (obj80->obj.id == OBJECT_50) { + if (player->unk_074 < obj80->obj.pos.x) { + player->unk_0D8.x = -30.0f; + player->unk_0E8 = 45.0f; + } else { + player->unk_0D8.x = 30.0f; + player->unk_0E8 = -45.0f; + } + player->unk_0D8.y = 0.0f; + player->unk_074 = player->unk_08C.y; + player->unk_498 = 5; + } else if (obj80->obj.id == OBJECT_131) { + Matrix_RotateY(gCalcMatrix, (obj80->obj.rot.y + 180.0f) * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, -obj80->obj.rot.z * M_DTOR, 1); + Matrix_MultVec3f(gCalcMatrix, &D_800D3040[sp98 - 1], &spBC); + player->unk_0D8.x = spBC.x; + player->unk_0D8.y = spBC.y; + player->unk_0E8 = 0.0f; + player->unk_0E4 = 0.0f; + player->unk_498 = 5; + player->unk_074 = player->unk_08C.y; + player->unk_078 = player->unk_08C.z; + } + } + } + } + } + } + } + for (i = 0, obj408 = gObjects408; i < ARRAY_COUNT(gObjects408); i++, obj408++) { + if (obj408->obj.status == 2) { + if ((obj408->obj.id == OBJECT_312) || (obj408->obj.id == OBJECT_308) || + (obj408->obj.id == OBJECT_313) || (obj408->obj.id == OBJECT_309)) { + temp_v0 = func_800A8304(player, obj408->obj.id, obj408->obj.pos.x, obj408->obj.pos.y, + obj408->obj.pos.z, obj408->obj.rot.x, obj408->obj.rot.y, obj408->obj.rot.z); + if (temp_v0 != 0) { + func_800A6CD0(player, temp_v0, obj408->unk_01C.damage); + break; + } + } else if (obj408->obj.id == OBJECT_310) { + spfD4.x = fabsf(obj408->obj.pos.x - player->unk_074) * (5.0f / 6.0f); + spfD4.y = fabsf(obj408->obj.pos.y - player->unk_078) * 2.0f; + spfD4.z = fabsf(obj408->obj.pos.z - player->unk_138) * (5.0f / 6.0f); + if (sqrtf(VEC3F_SQ(spfD4)) < 1500.0f) { + func_800A6CD0(player, 0, obj408->unk_01C.damage); + player->unk_110 = 0.0f; + player->unk_498 = 5; + player->unk_0D8.y = 30.0f; + obj408->unk_062 = 1; + func_8007BFFC(((Rand_ZeroOne() - 0.5f) * 10.0f) + player->unk_074, + (Rand_ZeroOne() * 10.0f) + player->unk_078, + ((Rand_ZeroOne() - 0.5f) * 10.0f) + player->unk_138, 0.0f, 15.0f, 0.0f, 2.0f, 5); + for (j = 0; j < 10; j++) { + func_8007C484(((Rand_ZeroOne() - 0.5f) * 30.0f) + player->unk_074, + (Rand_ZeroOne() * 10.0f) + player->unk_078, + ((Rand_ZeroOne() - 0.5f) * 30.0f) + player->unk_138, player->unk_0C0.x, + player->unk_0C0.y + 20.0f, player->unk_0C0.z, (Rand_ZeroOne() * 0.1f) + 0.1f, + player->unk_1C4 + 11); + } + } + } else { + if (obj408->obj.id == OBJECT_316) { + spfD4.x = fabsf(obj408->obj.pos.x - player->unk_074); + spfD4.y = fabsf((obj408->obj.pos.y - 300.0f) - player->unk_078) * 7.42f; + spfD4.z = fabsf(obj408->obj.pos.z - player->unk_138); + if (sqrtf(VEC3F_SQ(spfD4)) < 2700.0f) { + func_800A6CD0(player, 3, obj408->unk_01C.damage); + } + } + temp_v0 = func_800A7974(player, obj408->unk_01C.hitbox, &sp98, obj408->obj.pos.x, obj408->obj.pos.y, + obj408->obj.pos.z, obj408->obj.rot.x, obj408->obj.rot.y, obj408->obj.rot.z, + 0.0f, 0.0f, 0.0f); + if (temp_v0 != 0) { + if (temp_v0 < 0) { + if (player->unk_22C == 0) { + func_80019218(0x19000001, &obj408->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + player->unk_22C += 2; + if (player->unk_22C >= 4) { + player->unk_22C = 4; + } + } else { + if ((obj408->obj.id == OBJECT_320) && (obj408->unk_056 != 0) && (sp98 == 5)) { + break; + } + func_800A6CD0(player, obj408->obj.id, obj408->unk_01C.damage); + if ((obj408->obj.id == OBJECT_303) && ((obj408->unk_04E == 2) || (obj408->unk_04E == 3)) && + (sp98 >= 9)) { + player->unk_0D8.y = -100.0f; + } + if ((obj408->obj.id == OBJECT_320) && (sp98 < 5)) { + player->unk_0D8.x = obj408->unk_110; + player->unk_0D8.y = obj408->unk_114; + } + } + } + } + } + } + for (i = 0, obj2F4 = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, obj2F4++) { + if ((obj2F4->obj.status == 2) && (obj2F4->unk_0C2 == 0)) { + if (obj2F4->obj.id == OBJECT_180) { + temp_v0 = func_800A8304(player, obj2F4->obj.id, obj2F4->obj.pos.x, obj2F4->obj.pos.y, + obj2F4->obj.pos.z, obj2F4->obj.rot.x, obj2F4->obj.rot.y, obj2F4->obj.rot.z); + if (temp_v0 != 0) { + func_800A6CD0(player, temp_v0, obj2F4->unk_01C.damage); + } + } else if (obj2F4->obj.id == OBJECT_200) { + if (obj2F4->unk_0B4 == 42) { + temp_v0 = func_800A8304(player, 1000, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, + obj2F4->obj.rot.x, obj2F4->obj.rot.y, obj2F4->obj.rot.z); + if (temp_v0 != 0) { + func_800A6CD0(player, temp_v0, obj2F4->unk_01C.damage); + } + } else if (obj2F4->unk_0B4 == 63) { + spfD4.x = fabsf(obj2F4->obj.pos.x - player->unk_074); + spfD4.y = fabsf(obj2F4->obj.pos.y - player->unk_078); + spfD4.z = fabsf(obj2F4->obj.pos.z - player->unk_138); + if (sqrtf(VEC3F_SQ(spfD4)) < 900.0f) { + func_800A6CD0(player, 0, obj2F4->unk_01C.damage); + obj2F4->unk_0D0 = 3; + } + } else { + temp_v0 = + func_800A7974(player, obj2F4->unk_01C.hitbox, &sp98, obj2F4->obj.pos.x, obj2F4->obj.pos.y, + obj2F4->obj.pos.z, obj2F4->obj.rot.x, obj2F4->obj.rot.y, obj2F4->obj.rot.z, + obj2F4->unk_2E8.x, obj2F4->unk_2E8.y, obj2F4->unk_2E8.z + obj2F4->unk_0F4.z); + if (temp_v0 != 0) { + if ((temp_v0 < 0) && (obj2F4->unk_0B4 == 38)) { + obj2F4->unk_01C.hitbox = SEGMENTED_TO_VIRTUAL(D_6032328); + if (D_80177E80 >= 0) { + obj2F4->unk_046 = 2; + D_80177E80++; + if (D_80177E80 == 3) { + func_800BA808(gMsg_ID_5504, RCID_FALCO); + } + func_80019218(D_800CFF54[D_80177E80], &gPlayer->unk_460, 0, &D_800C5D34, + &D_800C5D34, &D_800C5D3C); + func_80019218(0x49008025, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + } else if (temp_v0 < 0) { + if (player->unk_22C == 0) { + func_80019218(0x19000001, &obj2F4->sfxPos, 0, &D_800C5D34, &D_800C5D34, + &D_800C5D3C); + } + player->unk_22C += 2; + if (player->unk_22C >= 4) { + player->unk_22C = 4; + } + } else { + func_800A6CD0(player, temp_v0, obj2F4->unk_01C.damage); + obj2F4->unk_0D0 = 3; + obj2F4->unk_0D4 = player->unk_1C4 + 1; + } + } + } + } else if ((obj2F4->obj.id >= 0xCD) && (obj2F4->obj.id < 0xD6)) { + temp_v0 = func_800A7974(player, obj2F4->unk_01C.hitbox, &sp98, obj2F4->unk_178 + obj2F4->obj.pos.x, + obj2F4->unk_134 + obj2F4->obj.pos.y + 25.0f, obj2F4->obj.pos.z, + obj2F4->unk_188, obj2F4->unk_17C, obj2F4->obj.rot.z, 0.0f, 0.0f, 0.0f); + if (temp_v0 != 0) { + obj2F4->unk_0D0 = 3; + if (obj2F4->unk_01C.damage != 0) { + func_800A6CD0(player, temp_v0, obj2F4->unk_01C.damage); + } else { + obj2F4->unk_0D0 = -1; + } + } + } else { + temp_v0 = func_800A7974(player, obj2F4->unk_01C.hitbox, &sp98, obj2F4->obj.pos.x, obj2F4->obj.pos.y, + obj2F4->obj.pos.z, obj2F4->obj.rot.x, obj2F4->obj.rot.y, obj2F4->obj.rot.z, + 0.0f, 0.0f, 0.0f); + if (temp_v0 != 0) { + if (temp_v0 < 0) { + if (player->unk_22C == 0) { + func_80019218(0x19000001, &obj2F4->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + } + player->unk_22C += 2; + if (player->unk_22C >= 4) { + player->unk_22C = 4; + } + } else { + obj2F4->unk_0D0 = 3; + if (obj2F4->obj.id == OBJECT_190) { + obj2F4->unk_0D0 = -1; + } + if (obj2F4->unk_01C.damage != 0) { + func_800A6CD0(player, temp_v0, obj2F4->unk_01C.damage); + if (obj2F4->obj.id == OBJECT_225) { + player->unk_0D8.y = 0.0f; + } + } else { + obj2F4->unk_0D0 = -1; + } + } + } + } + } + } + for (i = 0, obj4C = gObjects4C; i < ARRAY_COUNT(gObjects4C); i++, obj4C++) { + if (obj4C->obj.status == 2) { + if ((player->unk_138 - 200.0f) < obj4C->obj.pos.z) { + temp_v0 = func_800A7974(player, obj4C->unk_1C.hitbox, &sp98, obj4C->obj.pos.x, obj4C->obj.pos.y, + obj4C->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + if (temp_v0 != 0) { + if ((obj4C->obj.id == OBJECT_163) || (obj4C->obj.id == OBJECT_161) || + (obj4C->obj.id == OBJECT_169) || (obj4C->obj.id == OBJECT_162)) { + obj4C->unk_46 = 1; + player->unk_1F4 = 6; + player->unk_21C = 0; + } else { + func_800A6CD0(player, temp_v0, obj4C->unk_1C.damage); + } + } + } + } + } + } + func_800A86E4(player); + if (gCamCount == 4) { + for (i = 3, opponent = &gPlayer[3]; i >= 0; i--, opponent--) { + if ((i != D_801778A0) && (opponent->unk_1C8 == 3)) { + spC8.x = 25.0f; + if (player->unk_1CC == 3) { + spC8.x = 4.0f; + } + spC8.y = 25.0f; + if (opponent->unk_1CC == 3) { + spC8.y = 4.0f; + } + spBC.x = spBC.z = spC8.x + spC8.y; + spC8.x = 23.0f; + if (player->unk_1CC == 3) { + spC8.x = 7.0f; + } + spC8.y = 23.0f; + if (opponent->unk_1CC == 3) { + spC8.y = 7.0f; + } + spBC.y = spC8.x + spC8.y; + if ((fabsf(opponent->unk_138 - player->unk_138) <= spBC.z) && + (fabsf(opponent->unk_078 - player->unk_078) <= spBC.y) && + (fabsf(opponent->unk_074 - player->unk_074) <= spBC.x)) { + if ((player->unk_1CC == 3) && (opponent->unk_1CC == 3)) { + player->unk_074 = player->unk_08C.y; + player->unk_078 = player->unk_08C.z; + player->unk_07C = player->unk_138 = player->unk_098; + opponent->unk_074 = opponent->unk_08C.y; + opponent->unk_078 = opponent->unk_08C.z; + opponent->unk_07C = opponent->unk_138 = opponent->unk_098; + player->unk_0D8.x = (player->unk_074 - opponent->unk_08C.y) * 0.5f; + player->unk_0D8.z = (player->unk_138 - opponent->unk_138) * 0.5f; + opponent->unk_0D8.x = -player->unk_0D8.x; + opponent->unk_0D8.z = -player->unk_0D8.z; + opponent->unk_0D0 = player->unk_0D0 = 2.0f; + } else { + func_800A8804(player, opponent); + func_800A8804(opponent, player); + } + } + } + } + } + if (D_80178294 != 0) { + if (func_800A73E4(&sp94, &sp90, player->unk_2EC.x, player->unk_2EC.y, player->unk_2EC.z)) { + if (gCurrentLevel == LEVEL_ZONESS) { + player->unk_1F4 = 15; + player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.8f; + func_8007B228(player->unk_2EC.x, sp94, player->unk_2EC.z, 1.0f); + } else { + if (player->unk_1F4 == 0) { + func_800A6CD0(player, 4, 0xA); + } + player->unk_0D8.y = 30.0f; + player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.8f; + } + if (player->unk_1C8 == 4) { + player->unk_220 = 2; + func_8007AFD0(player->unk_074, player->unk_138, 30.0f, 0.0f, 5.0f); + func_8007AFD0(player->unk_074, player->unk_138, -30.0f, 0.0f, 5.0f); + } + } + if (func_800A73E4(&sp94, &sp90, player->unk_074 + ((player->unk_2D4.x - player->unk_074) * 1.5f), + player->unk_078 + (player->unk_2D4.y - player->unk_078) * 1.5f, player->unk_2D4.z)) { + if (gCurrentLevel == LEVEL_ZONESS) { + func_8007B228(player->unk_074 + (player->unk_2D4.x - player->unk_074) * 1.5f, sp94, player->unk_2D4.z, + 1.0f); + } else { + if (player->unk_1F4 == 0) { + func_800A6CD0(player, 1, 10); + } + player->unk_0D8.y = 30.0f; + } + } + if (func_800A73E4(&sp94, &sp90, player->unk_074 + ((player->unk_2C8.x - player->unk_074) * 1.5f), + player->unk_078 + (player->unk_2C8.y - player->unk_078) * 1.5f, player->unk_2C8.z)) { + if (gCurrentLevel == LEVEL_ZONESS) { + func_8007B228(player->unk_074 + (player->unk_2C8.x - player->unk_074) * 1.5f, sp94, player->unk_2C8.z, + 1.0f); + } else { + if (player->unk_1F4 == 0) { + func_800A6CD0(player, 2, 40); + } + player->unk_0D8.y = 30.0f; + } + } + } +} +#else +void func_800A8BA4(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800A8BA4.s") +#endif + +void func_800AA800(Player* player) { + s32 sp144; + Object_58* obj58; + Object_80* obj80; + s32 temp_ft3; + s32 var_s0; + s32 var_s6_2; + f32 tempx; + f32 tempy; + f32 tempz; + f32 sp120; + f32* temp_s0; + s32 pad1; + f32 var_fs0; + f32 var_fs1; + f32 tempx2; + f32 tempy2; + f32 tempz2; + f32 sp100; + f32 spFC; + f32 spF8; + Vec3f spEC; + Vec3f spE0; + Vec3f spD4; + Vec3f spC8; + Vec3f spBC; + Vec3f spB0; + f32 spA8[2]; + Vec3f sp9C = D_800D30E8; + s32 pad2; + s32 pad3; + s32 pad4; + + if (player->unk_240 == 0) { + player->unk_064 = player->unk_074; + player->unk_06C = player->unk_138 - player->unk_078; + if (D_801784AC != 4) { + if (gCamCount == 1) { + player->unk_068 = D_80177940 + 3.0f; + } else { + player->unk_068 = D_80177940; + if (player->unk_1CC == 3) { + player->unk_06C = player->unk_138; + } + } + player->unk_248 = player->unk_24C = player->unk_070 = 0.0f; + } + sp100 = 0.0f; + spFC = 0.0f; + spF8 = 0.0f; + if (gCamCount != 1) { + if (player->unk_1CC == 3) { + for (sp144 = 0; sp144 < 200; sp144++) { + obj58 = &gObjects58[sp144]; + if ((obj58->obj.status == 2) && + ((obj58->obj.id == OBJECT_143) || (obj58->obj.id == OBJECT_140) || + (obj58->obj.id == OBJECT_141)) && + (fabsf(obj58->obj.pos.x - player->unk_074) < 2000.0f) && + (fabsf(obj58->obj.pos.z - player->unk_138) < 2000.0f)) { + spC8.x = obj58->obj.pos.x; + spC8.y = obj58->obj.pos.y; + spC8.z = obj58->obj.pos.z; + spD4.x = player->unk_074; + spD4.y = D_80177940; + spD4.z = player->unk_138; + var_s0 = 4; + if (obj58->obj.id == OBJECT_141) { + var_s0 = 6; + } else if (obj58->obj.id == OBJECT_143) { + var_s0 = 17; + } + if (func_800A3690(&spD4, &spC8, var_s0, &spBC) != 0) { + player->unk_068 = spBC.y + 1.0f; + player->unk_248 = spBC.x; + player->unk_24C = spBC.z; + break; + } + } + } + } + } else { + if ((D_80177880 == 1) && (gLevelType == 0)) { + player->unk_064 = player->unk_074; + player->unk_06C = player->unk_138; + for (sp144 = 0, obj58 = gObjects58; sp144 < 200; sp144++, obj58++) { + if ((obj58->obj.status == 2) && + ((obj58->obj.id == OBJECT_150) || (obj58->obj.id == OBJECT_149) || + (obj58->obj.id == OBJECT_148) || (obj58->obj.id == OBJECT_1) || (obj58->obj.id == OBJECT_3)) && + (fabsf(obj58->obj.pos.x - player->unk_074) < 2500.0f) && + (fabsf(obj58->obj.pos.z - player->unk_138) < 2500.0f)) { + tempx = obj58->obj.pos.x; + tempy = obj58->obj.pos.y; + tempz = obj58->obj.pos.z; + sp120 = obj58->obj.rot.y; + Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, 0); + spEC.x = player->unk_074 - tempx; + spEC.y = 0.0f; + spEC.z = player->unk_138 - tempz; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &spEC, &spE0); + spD4.x = spE0.x + tempx; + spD4.y = spE0.y + tempy; + spD4.z = spE0.z + tempz; + spC8.x = tempx; + spC8.y = tempy; + spC8.z = tempz; + + if ((obj58->obj.id == OBJECT_149) || (obj58->obj.id == OBJECT_150)) { + if (obj58->obj.id == OBJECT_149) { + var_s0 = 5; + } else { + var_s0 = 6; + } + if (func_800998FC(&spD4, &spC8, &sp9C, var_s0, &spB0, spA8) > 0) { + player->unk_068 = spB0.y; + player->unk_248 = spA8[0]; + player->unk_24C = spA8[1]; + player->unk_070 = (sp120 / 180.0f) * M_PI; + } + } else { + var_s0 = 0; + if (obj58->obj.id == OBJECT_3) { + var_s0 = 3; + } + if (func_800A3690(&spD4, &spC8, var_s0, &spBC) != 0) { + player->unk_068 = spBC.y; + player->unk_248 = spBC.x; + player->unk_24C = spBC.z; + player->unk_070 = (sp120 / 180.0f) * M_PI; + } + } + } + } + } + for (sp144 = 0, obj80 = gObjects80; (sp144 < 50) && (D_80177880 == 0) && (gCurrentLevel != 6); + sp144++, obj80++) { + if ((obj80->obj.status == 2) && ((player->unk_138 - 3000.0f) < obj80->obj.pos.z) && + (obj80->obj.id != 0) && (obj80->obj.id != 8)) { + tempx = obj80->obj.pos.x; + tempy = obj80->obj.pos.y; + tempz = obj80->obj.pos.z; + sp120 = obj80->obj.rot.y; + if ((obj80->obj.id == OBJECT_3) || (obj80->obj.id == OBJECT_2) || (obj80->obj.id == OBJECT_47) || + (obj80->obj.id == OBJECT_4) || (obj80->obj.id == OBJECT_5)) { + Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, 0); + for (var_fs1 = var_fs0 = -50.0f; var_fs0 > -500.0f; var_fs0 -= 5.0f, var_fs1 -= 5.0f) { + spEC.x = player->unk_074 - tempx; + spEC.y = player->unk_078 + var_fs0 - tempy; + spEC.z = player->unk_138 + var_fs1 - tempz; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &spEC, &spE0); + if ((player->unk_078 + var_fs0) <= D_80177940) { + break; + } + spD4.x = spE0.x + tempx; + spD4.y = spE0.y + tempy; + spD4.z = spE0.z + tempz; + spC8.x = tempx; + spC8.y = tempy; + spC8.z = tempz; + + var_s0 = 0; + + if (obj80->obj.id == OBJECT_47) { + var_s0 = 7; + } + if (obj80->obj.id == OBJECT_2) { + var_s0 = 2; + } else if (obj80->obj.id == OBJECT_3) { + var_s0 = 3; + } else if ((obj80->obj.id == OBJECT_4) || (obj80->obj.id == OBJECT_5)) { + var_s0 = 1; + } + if (func_800A3690(&spD4, &spC8, var_s0, &spBC) != 0) { + player->unk_068 = spBC.y; + player->unk_06C = player->unk_138 + var_fs1; + player->unk_248 = spBC.x; + player->unk_24C = spBC.z; + player->unk_070 = (sp120 / 180.0f) * M_PI; + break; + } + } + } else { + temp_s0 = obj80->unk_1C.hitbox; + temp_ft3 = (s32) *temp_s0; + if (temp_ft3 != 0) { + if (obj80->unk_1C.action == (ObjectFunc) func_80066EA8) { + sp120 = 0.0f; + } + + for (var_s6_2 = 0, temp_s0++; var_s6_2 < temp_ft3; var_s6_2++, temp_s0 += 6) { + if (temp_s0[0] >= 300000.0f) { + break; + } + + if (temp_s0[0] == 200000.0f) { + sp100 = temp_s0[1]; + spFC = temp_s0[2]; + spF8 = temp_s0[3]; + temp_s0 += 4; + Matrix_RotateZ(gCalcMatrix, -spF8 * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, -sp100 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -spFC * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, 1); + + } else { + Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, 0); + } + for (var_fs0 = var_fs1 = -50.0f; var_fs0 > -500.0f; var_fs0 -= 5.0f, var_fs1 -= 5.0f) { + spEC.x = player->unk_074 - tempx; + spEC.y = player->unk_078 + var_fs0 - tempy; + spEC.z = player->unk_138 + var_fs1 - tempz; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &spEC, &spE0); + tempx2 = spE0.x + tempx; + tempy2 = spE0.y + tempy; + tempz2 = spE0.z + tempz; + if (spEC.y + tempy <= D_80177940) { + break; + } + if (func_800A78C4(temp_s0, tempx, tempy, tempz, tempx2, tempy2, tempz2) != 0) { + if (D_80177940 < player->unk_068) { + player->unk_068 = spEC.y + 15.0f + tempy; + player->unk_06C = spEC.z + 10.0f + tempz; + player->unk_248 = (sp100 / 180.0f) * M_PI; + player->unk_070 = (sp120 / 180.0f) * M_PI; + } + break; + } + } + } + } + } + } + } + } + } +} + +void func_800AB2AC(void) { + u8* ptr = (u8*) gPlayer; + u32 i; + + for (i = 0; i < gCamCount * sizeof(Player); i++, ptr++) { + *ptr = 0; + } +} + +void func_800AB304(Player* player) { + u8* ptr = (u8*) player; + u32 i; + + for (i = 0; i < sizeof(Player); i++, ptr++) { + *ptr = 0; + } +} + +void func_800AB334(void) { + Vtx* mesh; + u8* ptr; + s32 i; + f32* fptr; + + switch (gCurrentLevel) { + case LEVEL_TRAINING: + func_8001DC6C(0, 28); + D_8017796C = -1; + break; + case LEVEL_VENOM_1: + func_8001DC6C(0, 6); + break; + case LEVEL_VENOM_SW: + func_8001DC6C(0, 6); + break; + case LEVEL_VENOM_2: + func_8001DC6C(0, 15); + func_8001D400(0); + D_8017796C = -1; + break; + } + D_80178294 = 0; + switch (gCurrentLevel) { + case LEVEL_SECTOR_Z: + D_80177B8C = 1; + break; + case LEVEL_METEO: + case LEVEL_SECTOR_X: + if (D_8017827C == 1) { + gFogRed = 178; + gFogGreen = 190; + gFogBlue = 90; + gLight1R = 200; + gLight1G = 200; + gLight1B = 120; + gAmbientR = 0; + gAmbientG = 50; + gAmbientB = 100; + } + break; + case LEVEL_VENOM_2: + D_80177A98 = 0; + D_80177AB0 = 6; + D_E9F1D0_801A7F78 = 0.0f; + D_E9F1D0_801A7F70 = D_E9F1D0_801A7F78; + D_E9F1D0_801A7F68 = D_E9F1D0_801A7F70; + D_E9F1D0_801A7F60 = D_E9F1D0_801A7F68; + D_E9F1D0_801A7F58 = D_E9F1D0_801A7F60; + break; + case LEVEL_AQUAS: + D_80137E78 = 3; + D_8015F970 = 1600.0f; + D_E16C50_801C4188 = 128.0f; + func_E16C50_801A9824(); + break; + case LEVEL_TITANIA: + func_E6A810_80188F30(); + gTeamHealth[2] = -2; + break; + case LEVEL_MACBETH: + func_E6A810_80199920(); + break; + case LEVEL_ZONESS: + D_801782C4 = Memory_Allocate(200 * sizeof(PosRot)); + ptr = (u8*) D_801782C4; + for (i = 0; i < 200 * sizeof(PosRot); i++, ptr++) { + *ptr = 0; + } + D_801784A4 = 0; + /* fallthrough */ + case LEVEL_SOLAR: + D_80178294 = 1; + D_80177940 = -20000.0f; + fptr = D_801782CC = Memory_Allocate(17 * 17 * sizeof(f32)); + for (i = 0; i < 17 * 17; i++, fptr++) { + *fptr = 0.0f; + } + fptr = D_801782D4 = Memory_Allocate(17 * 17 * sizeof(f32)); + for (i = 0; i < 17 * 17; i++, fptr++) { + *fptr = 0.0f; + } + fptr = D_801782DC = Memory_Allocate(17 * 17 * sizeof(f32)); + for (i = 0; i < 17 * 17; i++, fptr++) { + *fptr = 0.0f; + } + fptr = D_801782E4 = Memory_Allocate(17 * 17 * sizeof(f32)); + for (i = 0; i < 17 * 17; i++, fptr++) { + *fptr = 0.0f; + } + fptr = D_801782EC = Memory_Allocate(17 * 17 * sizeof(f32)); + for (i = 0; i < 17 * 17; i++, fptr++) { + *fptr = 0.0f; + } + + switch (gCurrentLevel) { + case 7: + mesh = SEGMENTED_TO_VIRTUAL(D_6001C50); + break; + case 8: + mesh = SEGMENTED_TO_VIRTUAL(D_6009ED0); + break; + } + for (i = 0; i < 17 * 17; i++, mesh++) { + if (mesh->v.ob[0] == 800) { + mesh->v.ob[0] = 1400; + } + if (mesh->v.ob[0] == -800) { + mesh->v.ob[0] = -1400; + } + if (mesh->v.ob[2] == -800) { + mesh->v.ob[2] = -1400; + } + } + + switch (gCurrentLevel) { + case 7: + mesh = SEGMENTED_TO_VIRTUAL(D_6004500); + break; + case 8: + mesh = SEGMENTED_TO_VIRTUAL(D_600C780); + break; + } + for (i = 0; i < 17 * 17; i++, mesh++) { + if (mesh->v.ob[0] == 800) { + mesh->v.ob[0] = 1400; + } + if (mesh->v.ob[0] == -800) { + mesh->v.ob[0] = -1400; + } + if (mesh->v.ob[2] == -800) { + mesh->v.ob[2] = -1400; + } + } + break; + } +} + +void func_800AB964(void) { + s32 i; + s32 j; + + D_80178754 = 0; + for (i = 0; i < 4; i++) { + D_80177DB8[i] = 0; + for (j = 0; j < 10; j++) { + D_80177DD0[i][j] = 0; + } + gLaserStrength[i] = 0; + gBombCount[i] = 0; + } + D_80177E7C = D_80177E74 = 0; +} + +void func_800ABA08(void) { + s32 i; + + func_800AB964(); + for (i = 0; i < 4; i++) { + D_801778A0 = i; + func_800AB304(&gPlayer[i]); + func_800B0F50(&gPlayer[i]); + func_800B44C4(&gPlayer[i]); + func_800B7184(&gPlayer[i], 1); + } + func_800A6148(); +} + +void func_800ABAB4(void) { + s32 i; + + D_80161A54 = 40.0f; + for (i = 0; i < 4; i++) { + gRumbleStatus[i] = 0; + } + + if (gExpertMode != 0) { + D_80177828 = 200; + } else { + D_80177828 = 100; + } + D_801779BC = 0; + D_80137E78 = 2; + D_80177C70 = 0; + D_800CA234 = NULL; + D_800CA238 = 0; + func_8001A838(0x11403076U); + func_8001A838(0x49000014U); + Memory_FreeAll(); + D_80177C78 = D_80177C8C = D_80161734 = D_8015F908 = D_8015F90C = D_8015F910 = 0; + D_800CA220 = 0; + D_80177830 = 0; + if (gCurrentLevel != LEVEL_VERSUS) { + gOverlayStage = 0; + } + D_80161A2C = 1; + D_80177A98 = D_80177AB0 = 1; + D_80177AC8 = D_800D2F54 = 0; + D_800CA230 = D_800D2F58 = 0.0f; + D_80177880 = 0; + D_80177CE8 = D_8015F968 = 0.0f; + D_800D1970 = D_801778E8 = D_80178300 = D_80177E84 = 0; + if (gCurrentLevel >= LEVEL_FORTUNA) { + D_80177880 = 1; + if (gCurrentLevel == LEVEL_VERSUS) { + D_801778E8 = 1; + func_800AB964(); + } + } + if ((gCurrentLevel == LEVEL_VENOM_2) && (D_8017827C == 1)) { + D_80177880 = 1; + } + D_80177E7C = 0; + func_800A594C(); + D_80161A62 = D_8017796C = D_80177B44 = D_80177B4C = D_8015F928 = D_8015F940 = D_80178284 = gFrameCount = + D_80178480 = D_801782FC = D_801613A0 = D_80161690 = D_8015F900 = D_80177930 = 0; + + if (gCurrentLevel == LEVEL_SECTOR_X) { + D_80177930 = 1; + } + D_80177CC0 = -25000.0f; + D_80177950 = 1.0f; + if ((gCurrentLevel == 19) && (D_8017827C == 2)) { + D_80178348 = D_80178350 = D_80178354 = 255; + } else { + D_80178348 = D_80178350 = D_80178354 = 0; + } + D_80161A60 = D_80178360 = D_80178364 = D_80178368 = D_80161704 = D_80161708 = D_80178340 = D_80177C50 = D_8015F93C = + D_80177B6C = 0; + + D_80177A80 = 0; + D_80178340 = D_80178358 = 255; + + D_8017835C = 16; + D_8017836C = 0.0f; + D_8015F960 = 0.0f; + D_80177940 = 0.0f; + D_80178414 = D_80178420 = D_80178424 = D_80178428 = D_8017842C = D_80178430 = 0.0f; + + if ((gLevelType == LEVELTYPE_SPACE) || (gCurrentLevel == LEVEL_TRAINING)) { + func_800A5EBC(); + if (gCurrentLevel != LEVEL_TRAINING) { + D_80177A98 = 0; + } + } else { + D_80178410 = 0; + } + gFogAlpha = 255; + D_801784E8 = 5.0f; + D_80178510 = 5.0f; + D_80178538 = 5.0f; + func_800A6148(); + D_801782C8 = 0; + if (gCurrentLevel == LEVEL_TITANIA) { + func_E6A810_801B5110(0.0f, 0.0f, 200.0f); + } + if (gCurrentLevel == LEVEL_AQUAS) { + D_80177CC0 = 1000.0f; + } + D_80178488 = 0; + gCamCount = 1; + if (gCurrentLevel == LEVEL_VERSUS) { + gCamCount = 4; + } + for (i = 1; i < 6; i++) { + gTeamHealth[i] = gSavedTeamHealth[i]; + } + gPlayer = Memory_Allocate(gCamCount * sizeof(Player)); + func_800AB2AC(); + for (i = 0; i < gCamCount; i++) { + gPlayer[i].unk_1C8 = 1; + D_80178380[i] = D_801783C0[i] = 0; + D_80177BD0[i] = 0; + D_80177C30[i] = 0; + } + if (D_80177880 == 1) { + gObjects58 = Memory_Allocate(200 * sizeof(Object_58)); + for (i = 0; i < 200; i++) { + gObjects58[i].obj.status = 0; + } + switch (gCurrentLevel) { + case LEVEL_SECTOR_Z: + if (D_8017782C == 0) { + func_E51970_8019EA68(&gObjects58); + func_8002F180(); + } + break; + case LEVEL_FORTUNA: + func_E51970_8018BA2C(&gObjects58); + func_8002F180(); + break; + case LEVEL_KATINA: + func_E51970_80198930(&gObjects58); + if (D_8017782C == 0) { + func_8002F180(); + } + break; + case LEVEL_BOLSE: + if (D_8017782C == 0) { + func_E51970_80191ED8(&gObjects58); + func_8002F180(); + } + break; + case LEVEL_VENOM_SW: + func_E9F1D0_80196968(&gObjects58); + if (D_8017827C == 0) { + func_8002F180(); + } + break; + case LEVEL_VENOM_2: + if (D_8017827C == 1) { + if (D_8015F924 == 0) { + func_E9F1D0_801878A8(&gObjects58); + } else { + func_E9F1D0_801961AC(&gObjects58); + } + } + break; + case LEVEL_VERSUS: + func_800A4F7C(); + D_8017796C = -1; + break; + } + } + func_800AB334(); +} + +void func_800AC290(Player* player, Object_70* obj70, f32 arg2, f32 arg3, s32 arg4, f32 arg5) { + Vec3f sp44; + Vec3f sp38; + Vec3f sp2C; + + Object_70_Initialize(obj70); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * 0.017453292f, 0); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * 0.017453292f), 1); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * 0.017453292f), 1); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); + if ((D_801778E8 != 0) && (arg4 <= OBJECT_1)) { + arg5 *= 0.5f; + } + sp44.x = 0.0f; + sp44.y = 0.0f; + sp44.z = arg5; + Matrix_MultVec3f(gCalcMatrix, &sp44, &sp38); + sp44.x = arg2; + sp44.y = -5.0f + arg3; + sp44.z = 0.0f; + Matrix_MultVec3f(gCalcMatrix, &sp44, &sp2C); + obj70->obj.status = 1; + obj70->unk_20.x = sp38.x; + obj70->unk_20.y = sp38.y; + obj70->unk_20.z = sp38.z; + obj70->unk_60 = 0; + obj70->obj.id = arg4; + + if (D_801778E8 == 0) { + obj70->unk_64 = 35; + } else { + obj70->unk_64 = 37; + } + if (obj70->obj.id == OBJECT_4) { + obj70->obj.pos.x = player->unk_074 + sp2C.x; + obj70->obj.pos.y = player->unk_078 + sp2C.y; + obj70->obj.pos.z = player->unk_138 + sp2C.z; + obj70->unk_64 = 38; + } else { + obj70->obj.pos.x = player->unk_074 + sp2C.x + (sp38.x * 1.2); + obj70->obj.pos.y = player->unk_078 + sp2C.y + (sp38.y * 1.2); + obj70->obj.pos.z = player->unk_138 + sp2C.z + (sp38.z * 1.2f); + } + obj70->obj.rot.x = player->unk_120 + player->unk_0E4 + player->unk_4D8; + obj70->obj.rot.y = player->unk_0E8 + player->unk_114; + obj70->obj.rot.z = player->unk_0F8; + if (arg4 == 8) { + if (gCurrentLevel == LEVEL_AQUAS) { + obj70->unk_58 = Rand_ZeroOne() * 360.0f; + obj70->unk_60 = Rand_ZeroOne() * 360.0f; + obj70->unk_2C = player->unk_0E4 + player->unk_4D8; + obj70->unk_30 = player->unk_0E8; + obj70->unk_34 = player->unk_0F8; + obj70->unk_5C = D_80178494; + } else { + obj70->unk_30 = player->unk_0E8 + player->unk_114; + obj70->unk_2C = player->unk_0E4 + player->unk_4D8; + if (arg5 <= 65.0f) { + obj70->unk_5C = 1; + } + obj70->unk_64 = 30; + } + } + obj70->unk_68 = player->unk_1C4; +} + +void func_800AC650(Player* player, Object_70* obj70, s32 objId, f32 arg3) { + Vec3f sp54; + Vec3f sp48; + Vec3f sp3C; + + Object_70_Initialize(obj70); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * 0.017453292f, 0); + Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * 0.017453292f, 1); + Matrix_RotateY(gCalcMatrix, player->unk_114 * 0.017453292f, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * 0.017453292f, 1); + Matrix_RotateZ(gCalcMatrix, (-player->unk_12C - player->unk_130) * 0.017453292f, 1); + Matrix_RotateY(gCalcMatrix, -player->unk_180 * 0.017453292f, 1); + Matrix_RotateX(gCalcMatrix, player->unk_17C * 0.017453292f, 1); + sp54.x = 0; + sp54.y = 0; + sp54.z = arg3; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); + Matrix_Translate(gCalcMatrix, 0.0f, player->unk_18C + 30.0f, 0, 0); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * 0.017453292f, 1); + Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * 0.017453292f, 1); + Matrix_RotateY(gCalcMatrix, player->unk_114 * 0.017453292f, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * 0.017453292f, 1); + Matrix_RotateZ(gCalcMatrix, (-player->unk_12C - player->unk_130) * 0.017453292f, 1); + Matrix_Translate(gCalcMatrix, 0.0f, -30.0f, 0, 1); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); + Matrix_Translate(gCalcMatrix, 0.0f, 51.0f, -4.0f, 1); + Matrix_RotateY(gCalcMatrix, -player->unk_180 * 0.017453292f, 1); + Matrix_RotateX(gCalcMatrix, player->unk_17C * 0.017453292f, 1); + sp54.x = 0; + sp54.y = 7; + sp54.z = 0; + Matrix_MultVec3f(gCalcMatrix, &sp54, &sp3C); + obj70->unk_20.x = sp48.x; + obj70->unk_20.y = sp48.y; + obj70->unk_20.z = sp48.z; + obj70->obj.pos.x = player->unk_074 + sp3C.x; + obj70->obj.pos.y = player->unk_078 + sp3C.y; + obj70->obj.pos.z = player->unk_138 + sp3C.z; + obj70->obj.status = 1; + obj70->unk_2C = -player->unk_17C; + obj70->unk_30 = -player->unk_180; + obj70->unk_34 = player->unk_12C; + obj70->obj.rot.x = player->unk_0E4 + player->unk_120; + obj70->obj.rot.y = player->unk_0E8 + player->unk_114; + obj70->obj.rot.z = player->unk_0EC; + obj70->unk_64 = 40; + obj70->obj.id = objId; + + obj70->unk_68 = player->unk_1C4; + if (objId == 8) { + if (arg3 <= 65.0f) { + obj70->unk_5C = 1; + } + obj70->unk_64 = 30; + obj70->unk_30 = player->unk_0E8 + player->unk_114; + } +} + +void func_800ACA40(Player* player) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(gObjects70) - 1; i++) { + if (gObjects70[i].obj.status == 0) { + func_800AC650(player, &gObjects70[i], 5, 100.0f); + func_800A5FA0(&player->unk_460, 0x09000014, player->unk_1C4); + player->unk_1A0 = 2; + break; + } + } +} + +void func_800ACABC(Player* player) { + s32 i; + s32 laser = gLaserStrength[D_801778A0]; + + if (player->wings.unk_14 > -8.0f) { + laser = 0; + } + switch (laser) { + case 0: + for (i = 0; i < ARRAY_COUNT(gObjects70) - 1; i++) { + if (gObjects70[i].obj.status == 0) { + func_800AC290(player, &gObjects70[i], 0.0f, 0.0f, 0, 400.0f / 3.0f); + func_800A5FA0(&player->unk_460, 0x09400000, player->unk_1C4); + D_80177AA0[player->unk_1C4] = 0.5f; + break; + } + } + break; + case 1: + case 2: + for (i = 0; i < ARRAY_COUNT(gObjects70) - 1; i++) { + if (gObjects70[i].obj.status == 0) { + func_800AC290(player, &gObjects70[i], 0.0f, -10.0f, 1, 400.0f / 3.0f); + if (laser == 1) { + func_800A5FA0(&player->unk_460, 0x0940800C, player->unk_1C4); + D_80177AA0[player->unk_1C4] = 0.5f; + } else { + func_800A5FA0(&player->unk_460, 0x0940802B, player->unk_1C4); + D_80177AA0[player->unk_1C4] = 0.75f; + } + break; + } + } + break; + } +} + +void func_800ACC7C(Player* player) { + if ((gBombCount[player->unk_1C4] != 0) && (D_80177948[player->unk_1C4] & gChngInputPtr->button) && + (gObjects70[ARRAY_COUNT(gObjects70) - 1].obj.status == 0)) { + if (D_801778E8 != 0) { + gBombCount[player->unk_1C4] = 0; + } else { + gBombCount[player->unk_1C4]--; + } + if (player->unk_1CC == 0) { + func_800AC290(player, &gObjects70[ARRAY_COUNT(gObjects70) - 1], 0.0f, 0.0f, 3, 180.0f); + } else if (player->unk_1CC == 1) { + func_800AC650(player, &gObjects70[ARRAY_COUNT(gObjects70) - 1], 3, 180.0f); + } else { + func_800ACDC0(player, &gObjects70[ARRAY_COUNT(gObjects70) - 1], 3); + } + gObjects70[ARRAY_COUNT(gObjects70) - 1].unk_48 = 30.0f; + gObjects70[ARRAY_COUNT(gObjects70) - 1].unk_60 = 0; + func_8001CB80(player->unk_1C4, 1); + func_8001CCDC(player->unk_1C4, &gObjects70[ARRAY_COUNT(gObjects70) - 1].sfxPos); + } +} + +void func_800ACDC0(Player* player, Object_70* obj70, s32 objId) { + Vec3f sp5C; + Vec3f sp50; + Vec3f sp44; + + Object_70_Initialize(obj70); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * 0.017453292f, 0); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_134) * 0.017453292f), 1); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * 0.017453292f), 1); + Matrix_RotateX(gCalcMatrix, player->unk_154 * 0.017453292f, 1); + sp5C.x = 0.0f; + sp5C.y = 0.0f; + if (objId == OBJECT_3) { + sp5C.z = 100.0f; + } else { + sp5C.z = 150.0f; + } + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp5C, &sp50); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * 0.017453292f, 0); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_134) * 0.017453292f), 1); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * 0.017453292f), 1); + Matrix_Translate(gCalcMatrix, 0.0f, player->unk_080, 0, 1); + Matrix_Translate(gCalcMatrix, -10.0f, 25.0f, 0.0f, 1); + Matrix_RotateX(gCalcMatrix, player->unk_154 * 0.017453292f, 1); + sp5C.x = 0.0f; + sp5C.y = 0.0f; + sp5C.z = 0; + Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp44); + obj70->unk_20.x = sp50.x; + obj70->unk_20.y = sp50.y; + obj70->unk_20.z = sp50.z; + obj70->obj.pos.x = player->unk_074 + sp44.x; + obj70->obj.pos.y = player->unk_078 + sp44.y; + obj70->obj.pos.z = player->unk_138 + sp44.z; + + obj70->unk_44 = 1.0f; + + obj70->obj.status = 1; + obj70->obj.id = objId; + obj70->unk_64 = 30; + obj70->unk_58 = 1; + + obj70->unk_68 = player->unk_1C4; +} + +void func_800AD094(Player* player) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(gObjects70); i++) { + if (gObjects70[i].obj.status == 0) { + func_800ACDC0(player, &gObjects70[i], 6); + func_800A5FA0(&player->unk_460, 0x09000014, player->unk_1C4); + player->unk_1F8 = 2; + player->unk_180 = 10.0f; + break; + } + } +} + +s32 func_800AD118(s32 arg0) { + Object_2F4* obj2F4; + s32 i; + + for (i = 0, obj2F4 = gObjects2F4; i < ARRAY_COUNT(gObjects2F4); i++, obj2F4++) { + if ((obj2F4->obj.status == 2) && (obj2F4->unk_0CA[arg0] != 0)) { + return 0; + } + } + if (D_801778E8 != 0) { + for (i = 0; i < gCamCount; i++) { + if (((gPlayer[arg0].unk_1C8 == 3) || (gPlayer[arg0].unk_1C8 == 5)) && (D_80177B00[i][arg0] != 0)) { + return 0; + } + } + } + return 1; +} + +s32 func_800AD1F4(Player* player) { + s32 var_a2; + s32 i; + + if (gCurInputPtr->button & A_BUTTON) { + D_801779C8[player->unk_1C4]++; + if (D_801779C8[player->unk_1C4] > 21) { + D_801779C8[player->unk_1C4] = 21; + } + if (D_801779C8[player->unk_1C4] == 20) { + func_80060F30(&player->unk_460, 0x0900302D, player->unk_1C4); + } + if ((!(gCurInputPtr->button & R_TRIG) || !(gCurInputPtr->button & Z_TRIG) || (player->unk_1CC != 0) || + (player->unk_1C8 != 3)) && + !(gFrameCount & 3) && (func_800AD118(player->unk_1C4) != 0)) { + if (D_801779C8[player->unk_1C4] >= 21) { + for (i = 0; i < 13; i++) { + if (gObjects70[i].obj.status == 0) { + if (player->unk_1CC == 0) { + func_800AC290(player, &gObjects70[i], 0.0f, 0.0f, 4, 400.0f); + } else { + func_800AC650(player, &gObjects70[i], 4, 400.0f); + } + return 1; + } + } + } + } + } else { + if (D_801779C8[player->unk_1C4] != 0) { + D_801779C8[player->unk_1C4]--; + } + } + + if (gChngInputPtr->button & A_BUTTON) { + for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { + if ((gObjects2F4[i].obj.status == 2) && (gObjects2F4[i].unk_0CA[player->unk_1C4] != 0)) { + if ((gObjects70[14 - player->unk_1C4].obj.status == 0) || + (gObjects70[14 - player->unk_1C4].obj.id != 8) || + ((gObjects70[14 - player->unk_1C4].obj.id == 8) && + (gObjects70[14 - player->unk_1C4].unk_60 != 0))) { + if (player->unk_1CC == 0) { + func_800AC290(player, &gObjects70[14 - player->unk_1C4], 0.0f, 0.0f, 8, 70.0f); + } else { + func_800AC650(player, &gObjects70[14 - player->unk_1C4], 8, 70.0f); + } + func_80060F30(&player->unk_460, 0x09007029, player->unk_1C4); + D_80177BD0[player->unk_1C4] = 5; + return 1; + } + break; + } + } + if (D_801779C8[player->unk_1C4] > 10) { + if ((gObjects70[14 - player->unk_1C4].obj.status == 0) || (gObjects70[14 - player->unk_1C4].obj.id != 8) || + ((gObjects70[14 - player->unk_1C4].obj.id == 8) && (gObjects70[14 - player->unk_1C4].unk_44 > 1.0f))) { + if (player->unk_1CC == 0) { + func_800AC290(player, &gObjects70[14 - player->unk_1C4], 0.0f, 0.0f, 8, 70.0f); + } else { + func_800AC650(player, &gObjects70[14 - player->unk_1C4], 8, 70.0f); + } + func_80060F30(&player->unk_460, 0x09007029, player->unk_1C4); + D_801779C8[player->unk_1C4] = 0; + D_80177BD0[player->unk_1C4] = 5; + return 1; + } + } + D_801779C8[player->unk_1C4] = 0; + } + if (gChngInputPtr->button & B_BUTTON) { + var_a2 = 0; + for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { + if ((gObjects2F4[i].obj.status == 2) && (gObjects2F4[i].unk_0CA[player->unk_1C4] != 0)) { + var_a2 = 1; + break; + } + } + for (i = 0; i < gCamCount; i++) { + if (D_80177B00[i][player->unk_1C4] != 0) { + var_a2 = 1; + break; + } + } + if (var_a2 != 0) { + if ((gBombCount[player->unk_1C4] != 0) && (gObjects70[ARRAY_COUNT(gObjects70) - 1].obj.status == 0)) { + gBombCount[player->unk_1C4]--; + if (player->unk_1CC == 0) { + func_800AC290(player, &gObjects70[ARRAY_COUNT(gObjects70) - 1], 0.0f, 0.0f, 8, 60.0f); + } else { + func_800AC650(player, &gObjects70[ARRAY_COUNT(gObjects70) - 1], 8, 60.0f); + } + gObjects70[ARRAY_COUNT(gObjects70) - 1].unk_48 = 30.0f; + gObjects70[ARRAY_COUNT(gObjects70) - 1].unk_60 = 0; + func_8001CB80(player->unk_1C4, 1); + func_8001CCDC(player->unk_1C4, &gObjects70[ARRAY_COUNT(gObjects70) - 1].sfxPos); + return 1; + } + } + } + return 0; +} + +void func_800AD7F0(Player* player) { + switch (player->unk_1CC) { /* irregular */ + case 0: + if ((player->wings.rightState < 2) || (player->wings.leftState < 2)) { + gLaserStrength[player->unk_1C4] = 0; + } + if (func_800AD1F4(player) == 0) { + if (gLaserStrength[D_801778A0] > 0) { + Math_SmoothStepToF(&player->wings.unk_14, -10.0f, 1.0f, 0.5f, 0.0f); + } else { + Math_SmoothStepToF(&player->wings.unk_14, 0.0f, 1.0f, 0.5f, 0.0f); + } + if (D_80177938[player->unk_1C4] & gChngInputPtr->button) { + func_800ACABC(player); + player->unk_244 = 8; + } + if (player->unk_244 != 0) { + player->unk_244--; + if ((D_80177938[player->unk_1C4] & gCurInputPtr->button) && !(player->unk_244 & 3)) { + func_800ACABC(player); + } + } + func_800ACC7C(player); + } + break; + case 1: + if (func_800AD1F4(player) == 0) { + if (D_80177938[player->unk_1C4] & gChngInputPtr->button) { + func_800ACA40(player); + } + func_800ACC7C(player); + } + break; + case 3: + if (gChngInputPtr->button & A_BUTTON) { + player->unk_244 = 0; + } + if (gCurInputPtr->button & A_BUTTON) { + if (player->unk_244 == 0) { + func_800AD094(player); + } + player->unk_244++; + if (player->unk_244 > 4) { + player->unk_244 = 0; + } + } + func_800ACC7C(player); + break; + } +} + +void func_800ADA28(Player* player) { + f32 sp3C; + f32 sp38; + + sp3C = 0.0f; + if ((player->wings.rightState < 2) && (player->wings.leftState == 2)) { + sp3C = -17.0f; + } else if ((player->wings.leftState < 2) && (player->wings.rightState == 2)) { + sp3C = 17.0f; + } + sp38 = 0.1f; + if ((gCurInputPtr->button & Z_TRIG) && !(gCurInputPtr->button & R_TRIG)) { + sp3C = 90.0f; + sp38 = 0.2f; + if (player->unk_12C < 70.0f) { + Math_SmoothStepToF(&player->wings.unk_04, -70.0f, 0.3f, 100.0f, 0.0f); + Math_SmoothStepToF(&player->wings.unk_08, -70.0f, 0.3f, 100.0f, 0.f); + Math_SmoothStepToF(&player->wings.unk_0C, 70.0f, 0.3f, 100.0f, 0.f); + Math_SmoothStepToF(&player->wings.unk_10, 70.0f, 0.3f, 100.0f, 0.f); + if (player->unk_078 < (D_80177940 + 70.0f)) { + player->unk_078 += 6.0f; + } + } + } + + if ((gCurInputPtr->button & R_TRIG) && !(gCurInputPtr->button & Z_TRIG)) { + sp3C = -90.0f; + sp38 = 0.2f; + if (player->unk_12C > -70.0f) { + Math_SmoothStepToF(&player->wings.unk_04, 70.0f, 0.3f, 100.0f, 0.0f); + Math_SmoothStepToF(&player->wings.unk_08, 70.0f, 0.3f, 100.0f, 0.0f); + Math_SmoothStepToF(&player->wings.unk_0C, -70.0f, 0.3f, 100.0f, 0.0f); + Math_SmoothStepToF(&player->wings.unk_10, -70.0f, 0.3f, 100.0f, 0.0f); + if (player->unk_078 < (D_80177940 + 70.0f)) { + player->unk_078 += 6.0f; + } + } + } + Math_SmoothStepToF(&player->unk_12C, sp3C, sp38, 10.0f, 0.f); + if (gChngInputPtr->button & Z_TRIG) { + player->unk_48C = 1; + if (player->unk_1E0 != 0) { + player->unk_1DC = 1; + player->unk_1E8 = 10; + player->unk_1EC = player->unk_1F0 = 30; + player->unk_494 = 1; + } else { + player->unk_1E0 = 10; + } + } + if (gChngInputPtr->button & R_TRIG) { + player->unk_48C = 1; + if (player->unk_1E4 != 0) { + player->unk_1DC = 1; + player->unk_1E8 = 10; + player->unk_1EC = player->unk_1F0 = -30; + player->unk_494 = 1; + } else { + player->unk_1E4 = 10; + } + } +} + +void func_800ADD98(Player* player) { + Math_SmoothStepToF(&player->unk_170, 0.0f, 1.0f, 0.2f, 0.0f); + Math_SmoothStepToF(&player->unk_16C, 0.0f, 1.0f, 0.2f, 0.0f); + if (gChngInputPtr->button & Z_TRIG) { + if ((player->unk_1E0 != 0) && (player->unk_12C > 0.0f) && (player->unk_2BC < 10.0f)) { + player->unk_1DC = 1; + player->unk_1E8 = 15; + player->unk_1EC = player->unk_1F0 = 20; + } else { + player->unk_1E0 = 10; + } + } + if (gChngInputPtr->button & R_TRIG) { + if ((player->unk_1E4 != 0) && (player->unk_12C < 0.0f) && (player->unk_2BC < 10.0f)) { + player->unk_1DC = 1; + player->unk_1E8 = 15; + player->unk_1EC = player->unk_1F0 = -20; + } else { + player->unk_1E4 = 10; + } + } + player->unk_18C = fabsf(__sinf(player->unk_12C * 0.017453292f) * 25.0f); + player->unk_18C += fabsf(__sinf(player->unk_130 * 0.017453292f) * 20.0f); +} + +void func_800ADF58(Player* player) { + f32 temp_fv0; + f32 temp_fv0_2; + s32 temp_v0; + + player->unk_140 = -player->unk_0C0.z; + player->unk_144 += -player->unk_0C0.z; + D_80177D08 = -player->unk_0C0.z; + D_80177D20 = player->unk_144; + D_80177CE8 += player->unk_140; + if (D_801784AC == 4) { + D_80177CC8 = player->unk_140; + } + if ((D_80178284 == 0) && (player->unk_144 > 500000.0f)) { + player->unk_144 = 0.0f; + player->unk_07C = 0.0f; + D_80177DC8 = 0; + func_800A6148(); + } + player->unk_138 = player->unk_07C + player->unk_08C.x; + player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; + + while (1) { + if (player->unk_0F8 > 360.0f) { + player->unk_0F8 -= 360.0f; + } else { + break; + } + } + while (1) { + if (player->unk_0F8 < -360.0f) { + player->unk_0F8 += 360.0f; + } else { + break; + } + } + if (gCurrentLevel == LEVEL_UNK_15) { + Math_SmoothStepToF(&player->unk_0B4, 10.0f, 0.1f, 0.5f, 0.0001f); + player->unk_074 += Math_SmoothStepToF(&player->unk_0AC, player->unk_0B8, 0.1f, player->unk_0B4, 0.0001f); + player->unk_078 += Math_SmoothStepToF(&player->unk_0B0, player->unk_0BC, 0.1f, player->unk_0B4, 0.0001f); + } else { + Math_SmoothStepToF(&player->unk_0B4, D_80177D08 * 0.54f, 0.1f, 2.0f, 0.0001f); + D_801779E4 = Math_SmoothStepToF(&player->unk_0AC, player->unk_0B8, 0.1f, player->unk_0B4, 0.0001f); + D_801779F4 = Math_SmoothStepToF(&player->unk_0B0, player->unk_0BC, 0.1f, player->unk_0B4, 0.0001f); + } + if (player->unk_210 != 0) { + player->unk_210--; + Math_SmoothStepToF(&player->unk_114, player->unk_118, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&player->unk_120, player->unk_124, 0.03f, 0.5f, 0.0001f); + } else { + Math_SmoothStepToF(&player->unk_114, 0.0f, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&player->unk_120, 0.0f, 0.03f, 0.5f, 0.0001f); + } +} + +void func_800AE278(Player* player) { + f32 var_fv1; + s32 var_v0; + + var_v0 = 0; + if (gCamCount != 1) { + if (player->unk_074 > 12000.0f) { + var_v0 = 1; + player->unk_074 -= 24000.0f; + player->unk_040.x -= 24000.0f; + player->unk_04C.x -= 24000.0f; + } + if (player->unk_074 < -12000.0f) { + var_v0 = 1; + player->unk_074 += 24000.0f; + player->unk_040.x += 24000.0f; + player->unk_04C.x += 24000.0f; + } + + if (player->unk_07C > 12000.0f) { + var_v0 = 1; + player->unk_07C -= 24000.0f; + player->unk_040.z -= 24000.0f; + player->unk_04C.z -= 24000.0f; + } + if (player->unk_07C < -12000.0f) { + var_v0 = 1; + player->unk_07C += 24000.0f; + player->unk_040.z += 24000.0f; + player->unk_04C.z += 24000.0f; + } + if (var_v0 != 0) { + D_80177B00[player->unk_1C4][0] = D_80177B00[player->unk_1C4][1] = D_80177B00[player->unk_1C4][2] = + D_80177B00[player->unk_1C4][3] = 0; + } + } else { + var_fv1 = 12500.0f; + if (gCurrentLevel == LEVEL_CORNERIA) { + var_fv1 = 8000.0f; + } else if (gCurrentLevel == LEVEL_BOLSE) { + var_fv1 = 10000.0f; + } else if (gCurrentLevel == LEVEL_SECTOR_Z) { + var_fv1 = 20000.0f; + } else if ((gCurrentLevel == LEVEL_VENOM_2) && (D_80177AB0 >= 4)) { + var_fv1 = 100000.0f; + } + if ((var_fv1 < fabsf(player->unk_074)) || (var_fv1 < fabsf(player->unk_07C))) { + player->unk_1C8 = 5; + player->unk_19C = 0; + player->unk_1D0 = 0; + player->unk_000 = 0.0f; + player->unk_004 = 0.0f; + } + } +} + +void func_800AE4A4(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800AE4A4.s") + +void func_800AECAC(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800AECAC.s") + +void func_800AF07C(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800AF07C.s") + +void func_800AF928(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800AF928.s") + +void func_800B00C0(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B00C0.s") + +void func_800B0194(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B0194.s") + +void func_800B0F50(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B0F50.s") + +void func_800B2130(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B2130.s") + +void func_800B22C0(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B22C0.s") + +void func_800B2574(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B2574.s") + +void func_800B2BE0(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B2BE0.s") + +void func_800B2C00(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B2C00.s") + +void func_800B3010(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B3010.s") + +void func_800B3314(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B3314.s") + +void func_800B39E0(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B39E0.s") + +void func_800B40AC(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B40AC.s") + +void func_800B415C(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B415C.s") + +void func_800B41E0(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B41E0.s") + +void func_800B41EC(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B41EC.s") + +void func_800B42B0(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B42B0.s") + +void func_800B44C4(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B44C4.s") + +void func_800B46F8(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B46F8.s") + +void func_800B48BC(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B48BC.s") + +void func_800B56BC(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B56BC.s") + +void func_800B5D30(Player* player, s32); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B5D30.s") + +void func_800B5FBC(Player* player, s32 arg1, s32 arg2); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B5FBC.s") + +void func_800B63BC(Player* player, s32); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B63BC.s") + +void func_800B6848(Player* player, s32 arg1); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B6848.s") + +void func_800B6BFC(Player* player, s32 arg1); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B6BFC.s") + +void func_800B6F50(f32, f32, f32, f32, f32, f32); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B6F50.s") + +void func_800B7184(Player* player, s32); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B7184.s") + +void func_800B71E4(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B71E4.s") + +void func_800B73E0(Player* player); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B73E0.s") + +void func_800B79B0(void); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B79B0.s") + +void func_800B832C(void); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B832C.s") + +void func_800B852C(s32 arg0, Object_6C* obj6C); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B852C.s") + +void func_800B86A4(f32* arg0); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B86A4.s") + +void func_800B86CC(void); +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/func_800B86CC.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_play/D_800D82F0.s") diff --git a/src/main/fox_radio.c b/src/main/fox_radio.c index a4eaca91..d87c3671 100644 --- a/src/main/fox_radio.c +++ b/src/main/fox_radio.c @@ -68,7 +68,7 @@ void func_800BA808(u16* msg, s32 character) { if (character == RCID_PEPPY) { var_v1 = 3; } - if ((D_801778B0[var_v1] <= 0) && (D_801778B0[var_v1] != -2)) { + if ((gTeamHealth[var_v1] <= 0) && (gTeamHealth[var_v1] != -2)) { return; } } @@ -644,7 +644,7 @@ void func_800BB5D0(void) { if (temp_ft0 == RCID_PEPPY) { var_v1 = 3; } - if ((D_801778B0[var_v1] <= 0) && (gFrameCount & 4) && (D_801778B0[var_v1] != -2) && (D_801782A4 != 2) && + if ((gTeamHealth[var_v1] <= 0) && (gFrameCount & 4) && (gTeamHealth[var_v1] != -2) && (D_801782A4 != 2) && (D_801782A4 != 3) && (D_801782A4 != 1000)) { RCP_SetupDL(&gMasterDisp, 0x4C); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); @@ -652,7 +652,7 @@ void func_800BB5D0(void) { func_80084B94(1); } if ((D_801782A4 != 2) && (D_801782A4 != 3) && (D_801782A4 != 1000)) { - func_80086110(22.0f, 165.0f, D_801778B0[var_v1]); + func_80086110(22.0f, 165.0f, gTeamHealth[var_v1]); } } temp_ft0 = (s32) D_80177D68; diff --git a/src/main/sf_2EFE0.c b/src/main/sf_2EFE0.c index 7e0c1ed0..9dac47e4 100644 --- a/src/main/sf_2EFE0.c +++ b/src/main/sf_2EFE0.c @@ -2,35 +2,35 @@ void func_80187520(s32, void*); -void func_8002E3E0(Object_2F4* arg0) { - s32 var_a3 = 0; +void func_8002E3E0(Object_2F4* obj2F4) { + s32 hits = 0; if (gCurrentLevel == LEVEL_VENOM_SW) { if (D_8015F940 < 0xF00) { - var_a3 = 50; + hits = 50; } else if (D_8015F940 < 0x1680) { - var_a3 = 30; + hits = 30; } else if (D_8015F940 < 0x1E00) { - var_a3 = 20; + hits = 20; } else if (D_8015F940 < 0x2580) { - var_a3 = 10; + hits = 10; } } else { if (D_8015F940 < 0xF00) { - var_a3 = 10; + hits = 10; } else if (D_8015F940 < 0x1680) { - var_a3 = 5; + hits = 5; } else if (D_8015F940 < 0x1E00) { - var_a3 = 2; + hits = 2; } else if (D_8015F940 < 0x2580) { - var_a3 = 1; + hits = 1; } } - if (var_a3 != 0) { - func_80077240(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, var_a3); + if (hits != 0) { + func_80077240(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, hits); } - gHitCount += var_a3; - D_80177850 = 0xF; + gHitCount += hits; + D_80177850 = 15; } s32 func_8002E4F8(u16* arg0, s32 arg1) { @@ -53,36 +53,36 @@ void func_8002E548(void) { } } -void func_8002E5E0(Object_408* arg0) { - func_80187520(0x5B, arg0); +void func_8002E5E0(Object_408* obj408) { + func_80187520(0x5B, obj408); } -void func_8002E604(Object_408* arg0) { - func_80187520(0x5C, arg0); +void func_8002E604(Object_408* obj408) { + func_80187520(0x5C, obj408); } -void func_8002E628(Object_408* arg0) { - func_80187520(0x5D, arg0); +void func_8002E628(Object_408* obj408) { + func_80187520(0x5D, obj408); } -void func_8002E64C(Object_408* arg0) { - func_80187520(0x5E, arg0); +void func_8002E64C(Object_408* obj408) { + func_80187520(0x5E, obj408); } -void func_8002E670(Object_2F4* arg0) { - func_80187520(0x5F, arg0); +void func_8002E670(Object_2F4* obj408) { + func_80187520(0x5F, obj408); } -void func_8002E694(Object_2F4* arg0) { - func_80187520(0x60, arg0); +void func_8002E694(Object_2F4* obj408) { + func_80187520(0x60, obj408); } -void func_8002E6B8(Object_2F4* arg0) { - func_80187520(0x61, arg0); +void func_8002E6B8(Object_2F4* obj408) { + func_80187520(0x61, obj408); } -void func_8002E6DC(Object_2F4* arg0) { - func_80187520(0x62, arg0); +void func_8002E6DC(Object_2F4* obj408) { + func_80187520(0x62, obj408); } #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_2EFE0/func_8002E700.s") diff --git a/src/main/sf_36930.c b/src/main/sf_36930.c index 9a4f59b0..6998ba07 100644 --- a/src/main/sf_36930.c +++ b/src/main/sf_36930.c @@ -4,7 +4,7 @@ #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_80035DEC.s") -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_80035E48.s") +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/Object_70_Initialize.s") #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_80035E78.s") @@ -73,23 +73,3 @@ #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_8003D9B8.s") #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_8003DA0C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_8003DAF0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_8003DE68.s") - -void func_8003E1E0(void) { -} - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_8003E1E8.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_80040450.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_80040954.s") - -void func_80040CDC(void) { -} - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_80040CE4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_36930/func_80042D38.s") diff --git a/src/main/sf_3E6F0.c b/src/main/sf_3E6F0.c new file mode 100644 index 00000000..7c7f24cd --- /dev/null +++ b/src/main/sf_3E6F0.c @@ -0,0 +1,21 @@ +#include "common.h" + +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_3E6F0/func_8003DAF0.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_3E6F0/func_8003DE68.s") + +void func_8003E1E0(void) { +} + +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_3E6F0/func_8003E1E8.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_3E6F0/func_80040450.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_3E6F0/func_80040954.s") + +void func_80040CDC(void) { +} + +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_3E6F0/func_80040CE4.s") + +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_3E6F0/func_80042D38.s") diff --git a/src/main/sf_77E40.c b/src/main/sf_77E40.c index eeee8db8..fb738f63 100644 --- a/src/main/sf_77E40.c +++ b/src/main/sf_77E40.c @@ -1,55 +1,55 @@ #include "global.h" -void func_80077240(f32 posX, f32 posY, f32 posZ, s32 arg3) { +void func_80077240(f32 posX, f32 posY, f32 posZ, s32 hits) { s32 i; for (i = 0; i < ARRAY_COUNT(gUnkEntities1C); i++) { - if (gUnkEntities1C[i].unk_00 == 0) { - gUnkEntities1C[i].unk_00 = arg3; + if (gUnkEntities1C[i].hits == 0) { + gUnkEntities1C[i].hits = hits; gUnkEntities1C[i].pos.x = posX; gUnkEntities1C[i].pos.y = posY; gUnkEntities1C[i].pos.z = posZ; gUnkEntities1C[i].unk_10 = 0.0f; - gUnkEntities1C[i].unk_18 = 65; + gUnkEntities1C[i].timer = 65; break; } } } void func_8007729C(void) { - UnkEntity1C* var_s0; + UnkEntity1C* ent1C; s32 i; - for (i = 0, var_s0 = gUnkEntities1C; i < ARRAY_COUNT(gUnkEntities1C); i++, var_s0++) { - if (var_s0->unk_00 != 0) { - if (var_s0->unk_18 != 0) { - var_s0->unk_18 -= 1; + for (i = 0, ent1C = gUnkEntities1C; i < ARRAY_COUNT(gUnkEntities1C); i++, ent1C++) { + if (ent1C->hits != 0) { + if (ent1C->timer != 0) { + ent1C->timer -= 1; // can't be -- } - if (var_s0->unk_18 == 0) { - var_s0->unk_00 = 0; + if (ent1C->timer == 0) { + ent1C->hits = 0; } if (D_80177880 == 0) { - var_s0->pos.z -= D_80177D08; + ent1C->pos.z -= D_80177D08; } else if (gPlayer[0].unk_1C8 == 3) { - var_s0->pos.x += gPlayer[0].unk_0C0.x; - var_s0->pos.z += gPlayer[0].unk_0C0.z; + ent1C->pos.x += gPlayer[0].unk_0C0.x; + ent1C->pos.z += gPlayer[0].unk_0C0.z; } - if (var_s0->unk_18 < 45) { - Math_SmoothStepToF(&var_s0->unk_10, 300.0f, 0.1f, 20.0f, 0.0f); + if (ent1C->timer < 45) { + Math_SmoothStepToF(&ent1C->unk_10, 300.0f, 0.1f, 20.0f, 0.0f); } } } } -void func_80077404(UnkEntity1C* arg0) { +void func_80077404(UnkEntity1C* ent1C) { s32 var_a2; Vec3f sp60; Vec3f sp54; f32 sp50; sp60 = D_800D1528; - if (arg0->unk_18 <= 45) { - Matrix_Translate(gGfxMatrix, arg0->pos.x, arg0->pos.y, arg0->pos.z + D_80177D20, 1); + if (ent1C->timer <= 45) { + Matrix_Translate(gGfxMatrix, ent1C->pos.x, ent1C->pos.y, ent1C->pos.z + D_80177D20, 1); Matrix_MultVec3f(gGfxMatrix, &sp60, &sp54); if ((fabsf(sp54.x) < 20000.0f) && (fabsf(sp54.y) < 20000.0f)) { if ((sp54.z < 0.0f) && (sp54.z > -20000.0f)) { @@ -57,18 +57,18 @@ void func_80077404(UnkEntity1C* arg0) { Matrix_RotateY(gGfxMatrix, -gPlayer[D_801778A0].unk_058, 1); Matrix_RotateX(gGfxMatrix, gPlayer[D_801778A0].unk_05C, 1); Matrix_Scale(gGfxMatrix, sp50, sp50, 1.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, arg0->unk_10, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, ent1C->unk_10, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); - if (arg0->unk_00 < 11) { + if (ent1C->hits <= 10) { gSPDisplayList(gMasterDisp++, D_1015980); - gSPDisplayList(gMasterDisp++, D_800D14FC[arg0->unk_00]); - } else if (arg0->unk_00 == 101) { + gSPDisplayList(gMasterDisp++, D_800D14FC[ent1C->hits]); + } else if (ent1C->hits == 101) { gSPDisplayList(gMasterDisp++, D_1011F20); - } else if (arg0->unk_00 == 100) { + } else if (ent1C->hits == 100) { gSPDisplayList(gMasterDisp++, D_1016580); } else { gSPDisplayList(gMasterDisp++, D_1015980); - switch (arg0->unk_00) { + switch (ent1C->hits) { case 20: var_a2 = 0; break; @@ -87,62 +87,62 @@ void func_80077404(UnkEntity1C* arg0) { gSPDisplayList(gMasterDisp++, D_800D14E0[var_a2][1]); } } else { - arg0->unk_00 = 0; + ent1C->hits = 0; } } } } void func_80077790(void) { - UnkEntity1C* var_s0; + UnkEntity1C* ent1C; s32 i; RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - for (i = 0, var_s0 = gUnkEntities1C; i < ARRAY_COUNT(gUnkEntities1C); i++, var_s0++) { - if (var_s0->unk_00 != 0) { + for (i = 0, ent1C = gUnkEntities1C; i < ARRAY_COUNT(gUnkEntities1C); i++, ent1C++) { + if (ent1C->hits != 0) { Matrix_Push(&gGfxMatrix); - func_80077404(var_s0); + func_80077404(ent1C); Matrix_Pop(&gGfxMatrix); } } } Object_8C* func_8007783C(s32 objId) { - Object_8C* var_a2; + Object_8C* obj8C; s32 i; - for (i = 0, var_a2 = gObjects8C; i < ARRAY_COUNT(gObjects8C); i++, var_a2++) { - if (var_a2->obj.status == 0) { - Object_8C_Initialize(var_a2); - var_a2->obj.status = 2; - var_a2->obj.id = objId; - func_800612B8(&var_a2->unk_1C, var_a2->obj.id); + for (i = 0, obj8C = gObjects8C; i < ARRAY_COUNT(gObjects8C); i++, obj8C++) { + if (obj8C->obj.status == 0) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 2; + obj8C->obj.id = objId; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); break; } } if (i == ARRAY_COUNT(gObjects8C)) { - var_a2 = NULL; + obj8C = NULL; } - return var_a2; + return obj8C; } -void func_800778C4(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_339; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = posY; - arg0->obj.pos.z = posZ; - arg0->unk_54.x = arg4; - arg0->unk_54.y = arg5; - arg0->unk_54.z = arg6; - arg0->unk_70 = arg7; - arg0->unk_4C = 0; - arg0->unk_6C = 0.5f; - arg0->obj.rot.z = Rand_ZeroOne() * 360.0f; - func_800612B8(&arg0->unk_1C, arg0->obj.id); - arg0->unk_44 = 0xFF; +void func_800778C4(Object_8C* obj8C, f32 posX, f32 posY, f32 posZ, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_339; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = posY; + obj8C->obj.pos.z = posZ; + obj8C->unk_54.x = arg4; + obj8C->unk_54.y = arg5; + obj8C->unk_54.z = arg6; + obj8C->unk_70 = arg7; + obj8C->unk_4C = 0; + obj8C->unk_6C = 0.5f; + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); + obj8C->unk_44 = 0xFF; } void func_8007797C(f32 posX, f32 posY, f32 posZ, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { @@ -156,88 +156,88 @@ void func_8007797C(f32 posX, f32 posY, f32 posZ, f32 arg3, f32 arg4, f32 arg5, f } } -void func_80077A00(Object_8C* arg0) { - func_8005980C(arg0->unk_70); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_44); +void func_80077A00(Object_8C* obj8C) { + func_8005980C(obj8C->unk_70); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_44); gSPDisplayList(gMasterDisp++, D_3016B30); } -void func_80077A7C(Object_8C* arg0) { +void func_80077A7C(Object_8C* obj8C) { RCP_SetupDL_49(); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_44); - gDPSetEnvColor(gMasterDisp++, 255, 255, 255, arg0->unk_44); - Matrix_Scale(gGfxMatrix, arg0->unk_6C, arg0->unk_70, 1.0f, 1); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 255, 255, obj8C->unk_44); + Matrix_Scale(gGfxMatrix, obj8C->unk_6C, obj8C->unk_70, 1.0f, 1); Matrix_Translate(gGfxMatrix, 0.0f, 20.0f, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_6024220); RCP_SetupDL(&gMasterDisp, 0x40); } -void func_80077B78(void* arg0) { +void func_80077B78(Object_8C* obj8C) { } -void func_80077B84(Object_8C* arg0) { - func_8005980C(arg0->unk_70); - if ((arg0->unk_6C == 71.0f) || ((gPlayer[0].unk_1C8 == 7) && (gCurrentLevel == LEVEL_CORNERIA))) { +void func_80077B84(Object_8C* obj8C) { + func_8005980C(obj8C->unk_70); + if ((obj8C->unk_6C == 71.0f) || ((gPlayer[0].unk_1C8 == 7) && (gCurrentLevel == LEVEL_CORNERIA))) { RCP_SetupDL(&gMasterDisp, 0x26); } else { RCP_SetupDL(&gMasterDisp, 0x43); } - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_44); - switch (arg0->unk_4C) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_44); + switch (obj8C->unk_4C) { case 0: - gDPSetEnvColor(gMasterDisp++, 0, 128, 255, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 0, 128, 255, obj8C->unk_44); break; case 1: - gDPSetEnvColor(gMasterDisp++, 255, 64, 255, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 64, 255, obj8C->unk_44); break; case 2: - gDPSetEnvColor(gMasterDisp++, 255, 128, 0, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 128, 0, obj8C->unk_44); break; case 3: - gDPSetEnvColor(gMasterDisp++, 255, 48, 48, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 48, 48, obj8C->unk_44); break; case 4: - gDPSetEnvColor(gMasterDisp++, 255, 255, 48, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 255, 48, obj8C->unk_44); break; case 5: - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, arg0->unk_44); - gDPSetEnvColor(gMasterDisp++, 255, 32, 32, arg0->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, obj8C->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 32, 32, obj8C->unk_44); break; case 6: if (gCurrentLevel == LEVEL_BOLSE) { RCP_SetupDL(&gMasterDisp, 0x26); } - switch ((arg0->unk_40 + gFrameCount) & 3) { + switch ((obj8C->index + gFrameCount) & 3) { case 0: - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 0, 0, arg0->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 0, 0, obj8C->unk_44); break; case 1: - gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 255, 0, arg0->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 255, 0, obj8C->unk_44); break; case 2: - gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 255, arg0->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 255, obj8C->unk_44); break; case 3: - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, arg0->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, obj8C->unk_44); break; } - gDPSetEnvColor(gMasterDisp++, 0, 0, 0, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 0, 0, 0, obj8C->unk_44); break; case 7: - gDPSetEnvColor(gMasterDisp++, 48, 48, 255, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 48, 48, 255, obj8C->unk_44); break; case 10: - gDPSetEnvColor(gMasterDisp++, 255, 255, 32, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 255, 32, obj8C->unk_44); break; case 11: - gDPSetEnvColor(gMasterDisp++, 255, 32, 32, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 32, 32, obj8C->unk_44); break; case 12: - gDPSetEnvColor(gMasterDisp++, 32, 255, 32, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 32, 255, 32, obj8C->unk_44); break; case 13: - gDPSetEnvColor(gMasterDisp++, 32, 32, 255, arg0->unk_44); + gDPSetEnvColor(gMasterDisp++, 32, 32, 255, obj8C->unk_44); break; } @@ -245,33 +245,33 @@ void func_80077B84(Object_8C* arg0) { RCP_SetupDL(&gMasterDisp, 0x40); } -void func_80078038(Object_8C* arg0) { - func_8005980C(arg0->unk_70); +void func_80078038(Object_8C* obj8C) { + func_8005980C(obj8C->unk_70); RCP_SetupDL_49(); RCP_SetupDL(&gMasterDisp, 0x26); - gDPSetPrimColor(gMasterDisp++, 0, 0, 64, 192, 255, arg0->unk_44); - gDPSetEnvColor(gMasterDisp++, 0, 0, 0, arg0->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 64, 192, 255, obj8C->unk_44); + gDPSetEnvColor(gMasterDisp++, 0, 0, 0, obj8C->unk_44); gSPDisplayList(gMasterDisp++, D_1024AC0); RCP_SetupDL(&gMasterDisp, 0x40); } -void func_800780F8(Object_8C* arg0) { +void func_800780F8(Object_8C* obj8C) { s32 i; - if (arg0->unk_4A >= 0xB) { - if (!((arg0->unk_40 + gFrameCount) & 1)) { + if (obj8C->unk_4A >= 0xB) { + if (!((obj8C->index + gFrameCount) & 1)) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 128, 128, 32); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 128, 128, 128); } - } else if (!((arg0->unk_40 + gFrameCount) & 1)) { + } else if (!((obj8C->index + gFrameCount) & 1)) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, 96, 96, 255, 255); } - func_8005980C(arg0->unk_70); + func_8005980C(obj8C->unk_70); for (i = 0; i < 10; i++) { - if ((i >= arg0->unk_48) && (i < arg0->unk_46)) { + if ((i >= obj8C->unk_48) && (i < obj8C->unk_46)) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, -60.0f, 0.0f, 1); Matrix_Scale(gGfxMatrix, 0.8f, 3.0f, 1.0f, 1); @@ -280,52 +280,52 @@ void func_800780F8(Object_8C* arg0) { Matrix_Pop(&gGfxMatrix); } Matrix_Translate(gGfxMatrix, 0.0f, -120.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, D_800D1534[arg0->unk_4C][i] * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, D_800D1534[obj8C->unk_4C][i] * M_DTOR, 1); } } -void func_800783C0(Object_8C* arg0) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_44); - func_8005980C(arg0->unk_70); +void func_800783C0(Object_8C* obj8C) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_44); + func_8005980C(obj8C->unk_70); gSPDisplayList(gMasterDisp++, D_2006F50); } -void func_80078438(Object_8C* arg0) { - func_8005980C(arg0->unk_70); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_4A); +void func_80078438(Object_8C* obj8C) { + func_8005980C(obj8C->unk_70); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_4A); gSPDisplayList(gMasterDisp++, D_102A8A0); } -void func_800784B4(Object_8C* arg0) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_46); - func_8005980C(arg0->unk_70); +void func_800784B4(Object_8C* obj8C) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_46); + func_8005980C(obj8C->unk_70); Matrix_RotateX(gGfxMatrix, (M_PI / 2.0f), 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_200D750); } -void func_80078550(Object_8C* arg0) { +void func_80078550(Object_8C* obj8C) { RCP_SetupDL(&gMasterDisp, 0x43); - func_8005980C(arg0->unk_70); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_4A); + func_8005980C(obj8C->unk_70); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_4A); gDPSetEnvColor(gMasterDisp++, 101, 138, 153, 255); gSPDisplayList(gMasterDisp++, D_3000660); RCP_SetupDL(&gMasterDisp, 0x40); } -void func_80078604(Object_8C* arg0) { - if (arg0->unk_50 == 0) { - func_8005980C(arg0->unk_70); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_44); +void func_80078604(Object_8C* obj8C) { + if (obj8C->unk_50 == 0) { + func_8005980C(obj8C->unk_70); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_44); gSPDisplayList(gMasterDisp++, D_20112C0); } } -void func_8007868C(Object_8C* arg0) { +void func_8007868C(Object_8C* obj8C) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Scale(gGfxMatrix, arg0->unk_70, arg0->unk_70, arg0->unk_70, 1); - if (arg0->unk_44 >= 2) { + Matrix_Scale(gGfxMatrix, obj8C->unk_70, obj8C->unk_70, obj8C->unk_70, 1); + if (obj8C->unk_44 >= 2) { Matrix_RotateX(gGfxMatrix, (M_PI / 2.0f), 1); } Matrix_SetGfxMtx(&gMasterDisp); @@ -333,61 +333,61 @@ void func_8007868C(Object_8C* arg0) { RCP_SetupDL(&gMasterDisp, 0x40); } -void func_8007879C(Object_8C* arg0) { +void func_8007879C(Object_8C* obj8C) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Scale(gGfxMatrix, arg0->unk_70 * 0.6f, 1.0f, arg0->unk_70 * 3.5f, 1); + Matrix_Scale(gGfxMatrix, obj8C->unk_70 * 0.6f, 1.0f, obj8C->unk_70 * 3.5f, 1); Matrix_RotateX(gGfxMatrix, (M_PI / 2.0f), 1); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1029780); RCP_SetupDL(&gMasterDisp, 0x40); } -void func_800788B0(Object_8C* arg0) { +void func_800788B0(Object_8C* obj8C) { s32 temp_ft3; s32* tmp; switch (gCurrentLevel) { case LEVEL_METEO: - func_8005980C(arg0->unk_70); + func_8005980C(obj8C->unk_70); gDPSetPrimColor(gMasterDisp++, 0, 0, 128, 128, 128, 255); gSPDisplayList(gMasterDisp++, D_601FF80); break; case LEVEL_AQUAS: RCP_SetupDL(&gMasterDisp, 0x43); - temp_ft3 = Math_ModF(arg0->unk_40, 4.0f); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, (s32) arg0->unk_6C); + temp_ft3 = Math_ModF(obj8C->index, 4.0f); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, (s32) obj8C->unk_6C); tmp = &D_800D173C[(s32) (temp_ft3 * 4.0f)]; gDPSetEnvColor(gMasterDisp++, tmp[0], tmp[1], tmp[2], 255); - func_8005980C(arg0->unk_70); + func_8005980C(obj8C->unk_70); gSPDisplayList(gMasterDisp++, D_1024AC0); RCP_SetupDL(&gMasterDisp, 0x40); break; } } -void func_80078A64(Object_8C* arg0) { - func_8005980C(arg0->unk_70); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_44); +void func_80078A64(Object_8C* obj8C) { + func_8005980C(obj8C->unk_70); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_44); gSPDisplayList(gMasterDisp++, D_20112C0); } -void func_80078AE0(void* arg0) { +void func_80078AE0(void* obj8C) { } -void func_80078AEC(Object_8C* arg0) { +void func_80078AEC(Object_8C* obj8C) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 180); - func_8005980C(arg0->unk_70 * (13.0f + ((gFrameCount & 1) * 2.5f))); + func_8005980C(obj8C->unk_70 * (13.0f + ((gFrameCount & 1) * 2.5f))); gSPDisplayList(gMasterDisp++, D_102ED50); } -void func_80078B8C(Object_8C* arg0) { +void func_80078B8C(Object_8C* obj8C) { RCP_SetupDL_21(); gSPDisplayList(gMasterDisp++, D_101ABD0); RCP_SetupDL(&gMasterDisp, 0x40); } -void func_80078BE0(Object_8C* arg0) { +void func_80078BE0(Object_8C* obj8C) { f32 var_fv0; gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 160); @@ -395,43 +395,43 @@ void func_80078BE0(Object_8C* arg0) { if (gFrameCount & 1) { var_fv0 *= 1.2f; } - func_8005980C(arg0->unk_70 * var_fv0); + func_8005980C(obj8C->unk_70 * var_fv0); gSPDisplayList(gMasterDisp++, D_600F8A0); } -void func_80078C84(Object_8C* arg0) { - func_8005980C(arg0->unk_70); +void func_80078C84(Object_8C* obj8C) { + func_8005980C(obj8C->unk_70); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 192); gSPDisplayList(gMasterDisp++, D_6000A80); } -void func_80078CE8(Object_8C* arg0) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_4A); - func_8005980C(arg0->unk_70); +void func_80078CE8(Object_8C* obj8C) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_4A); + func_8005980C(obj8C->unk_70); gSPDisplayList(gMasterDisp++, D_6033000); } -void func_80078D60(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_393; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = posY; - arg0->obj.pos.z = posZ; - arg0->unk_70 = arg4; +void func_80078D60(Object_8C* obj8C, f32 posX, f32 posY, f32 posZ, f32 arg4) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_393; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = posY; + obj8C->obj.pos.z = posZ; + obj8C->unk_70 = arg4; if (arg4 == 3.1f) { - arg0->unk_54.x = gObjects2F4[8].unk_0E8.x; - arg0->unk_54.y = gObjects2F4[8].unk_0E8.y; - arg0->unk_54.z = gObjects2F4[8].unk_0E8.z; + obj8C->unk_54.x = gObjects2F4[8].unk_0E8.x; + obj8C->unk_54.y = gObjects2F4[8].unk_0E8.y; + obj8C->unk_54.z = gObjects2F4[8].unk_0E8.z; } if (arg4 != 30.0f) { - arg0->unk_4E = 1; + obj8C->unk_4E = 1; } if (arg4 == 3.5f) { - arg0->unk_4E = 2; + obj8C->unk_4E = 2; } - arg0->unk_50 = 0xE; - func_800612B8(&arg0->unk_1C, arg0->obj.id); + obj8C->unk_50 = 0xE; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_80078E50(f32 posX, f32 posY, f32 posZ, f32 arg3) { @@ -445,37 +445,37 @@ void func_80078E50(f32 posX, f32 posY, f32 posZ, f32 arg3) { } } -void func_80078EBC(Object_8C* arg0) { - if (arg0->unk_4E == 2) { - arg0->unk_54.x = gPlayer[0].unk_0C0.x; - arg0->unk_54.y = gPlayer[0].unk_0C0.y; - arg0->unk_54.z = gPlayer[0].unk_0C0.z; +void func_80078EBC(Object_8C* obj8C) { + if (obj8C->unk_4E == 2) { + obj8C->unk_54.x = gPlayer[0].unk_0C0.x; + obj8C->unk_54.y = gPlayer[0].unk_0C0.y; + obj8C->unk_54.z = gPlayer[0].unk_0C0.z; } - arg0->obj.rot.z += 35.0f; - if (arg0->unk_50 >= 7) { - arg0->unk_6C += 0.25f; + obj8C->obj.rot.z += 35.0f; + if (obj8C->unk_50 >= 7) { + obj8C->unk_6C += 0.25f; } else { - arg0->unk_6C -= 0.25f; + obj8C->unk_6C -= 0.25f; } - if (arg0->unk_6C <= 0.0f) { - Object_Kill(&arg0->obj, &arg0->unk_80); + if (obj8C->unk_6C <= 0.0f) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } -void func_80078F78(Object_8C* arg0) { - if (arg0->unk_4E != 0) { +void func_80078F78(Object_8C* obj8C) { + if (obj8C->unk_4E != 0) { RCP_SetupDL(&gMasterDisp, 0x43); } else { RCP_SetupDL(&gMasterDisp, 0x3F); } gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 255, 0, 255); - func_8005980C(arg0->unk_70 * arg0->unk_6C); + func_8005980C(obj8C->unk_70 * obj8C->unk_6C); gSPDisplayList(gMasterDisp++, D_101C2E0); RCP_SetupDL(&gMasterDisp, 0x40); } -void func_8007905C(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, u8 arg5) { +void func_8007905C(Object_8C* obj8C, f32 posX, f32 posY, f32 posZ, f32 arg4, u8 arg5) { Vec3f sp54; Vec3f sp48; Vec3f sp3C; @@ -483,23 +483,23 @@ void func_8007905C(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, u8 a f32 xAng; f32 yAng; - Object_8C_Initialize(arg0); - arg0->obj.status = 2; - arg0->obj.id = OBJECT_357; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = posY; - arg0->obj.pos.z = posZ; - arg0->unk_4C = arg5; + Object_8C_Initialize(obj8C); + obj8C->obj.status = 2; + obj8C->obj.id = OBJECT_357; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = posY; + obj8C->obj.pos.z = posZ; + obj8C->unk_4C = arg5; if (arg4 == 1.6f) { - arg0->unk_54.x = (posX - gObjects408[1].obj.pos.x) * 0.1f; - arg0->unk_54.z = (posZ - gObjects408[1].obj.pos.z) * 0.1f; + obj8C->unk_54.x = (posX - gObjects408[1].obj.pos.x) * 0.1f; + obj8C->unk_54.z = (posZ - gObjects408[1].obj.pos.z) * 0.1f; } else if (arg4 == 1.3f) { - arg0->unk_54.x = ((Rand_ZeroOne() * 0.05f) + 0.03f) * posX; - arg0->unk_54.z = ((Rand_ZeroOne() * 0.05f) + 0.03f) * posZ; - arg0->unk_54.y = 5.0f; + obj8C->unk_54.x = ((Rand_ZeroOne() * 0.05f) + 0.03f) * posX; + obj8C->unk_54.z = ((Rand_ZeroOne() * 0.05f) + 0.03f) * posZ; + obj8C->unk_54.y = 5.0f; } else if (arg4 == 1.55f) { - arg0->unk_54.x = (Rand_ZeroOne() - 0.5f) * 10.0f; - arg0->unk_54.z = (Rand_ZeroOne() - 0.5f) * 10.0f; + obj8C->unk_54.x = (Rand_ZeroOne() - 0.5f) * 10.0f; + obj8C->unk_54.z = (Rand_ZeroOne() - 0.5f) * 10.0f; } else if ((gCurrentLevel == LEVEL_BOLSE) && ((arg4 == 5.11f) || (arg4 == 7.22f))) { sp3C.x = gPlayer[0].unk_074; sp3C.y = gPlayer[0].unk_078; @@ -513,21 +513,21 @@ void func_8007905C(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, u8 a sp54.y = (Rand_ZeroOne() - 0.5f) * 50.0f; sp54.z = (Rand_ZeroOne() * 10.0f) + 150.0f; Matrix_MultVec3f(gCalcMatrix, &sp54, &sp48); - arg0->unk_54.x = sp48.x; - arg0->unk_54.y = sp48.y; - arg0->unk_54.z = sp48.z; + obj8C->unk_54.x = sp48.x; + obj8C->unk_54.y = sp48.y; + obj8C->unk_54.z = sp48.z; } else { - arg0->unk_54.y = (gLevelType == 0) ? (Rand_ZeroOne() * 7.0f) + 7.0f : (Rand_ZeroOne() - 0.5f) * 10.0f; - arg0->unk_54.x = (Rand_ZeroOne() - 0.5f) * 10.0f; - arg0->unk_54.z = (Rand_ZeroOne() - 0.5f) * 10.0f; + obj8C->unk_54.y = (gLevelType == 0) ? (Rand_ZeroOne() * 7.0f) + 7.0f : (Rand_ZeroOne() - 0.5f) * 10.0f; + obj8C->unk_54.x = (Rand_ZeroOne() - 0.5f) * 10.0f; + obj8C->unk_54.z = (Rand_ZeroOne() - 0.5f) * 10.0f; } - arg0->unk_70 = ((Rand_ZeroOne() * 0.8f) + 0.3f) * arg4; - arg0->unk_50 = (s32) (Rand_ZeroOne() * 50.0f) + 0x46; - arg0->obj.rot.x = Rand_ZeroOne() * 360.0f; - arg0->unk_60.x = (Rand_ZeroOne() - 0.5f) * 30.0f; - arg0->unk_60.y = (Rand_ZeroOne() - 0.5f) * 30.0f; - arg0->unk_60.z = (Rand_ZeroOne() - 0.5f) * 30.0f; - func_800612B8(&arg0->unk_1C, arg0->obj.id); + obj8C->unk_70 = ((Rand_ZeroOne() * 0.8f) + 0.3f) * arg4; + obj8C->unk_50 = (s32) (Rand_ZeroOne() * 50.0f) + 0x46; + obj8C->obj.rot.x = Rand_ZeroOne() * 360.0f; + obj8C->unk_60.x = (Rand_ZeroOne() - 0.5f) * 30.0f; + obj8C->unk_60.y = (Rand_ZeroOne() - 0.5f) * 30.0f; + obj8C->unk_60.z = (Rand_ZeroOne() - 0.5f) * 30.0f; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_800794CC(f32 posX, f32 posY, f32 posZ, f32 arg3) { @@ -574,37 +574,37 @@ void func_80079618(f32 posX, f32 posY, f32 posZ, f32 arg3) { } } -void func_8007968C(Object_8C* arg0) { - if ((gCurrentLevel != LEVEL_MACBETH) || (arg0->unk_44 != 7)) { - if ((arg0->unk_50 == 0) || (arg0->obj.pos.y < D_80177940)) { - Object_Kill(&arg0->obj, &arg0->unk_80); +void func_8007968C(Object_8C* obj8C) { + if ((gCurrentLevel != LEVEL_MACBETH) || (obj8C->unk_44 != 7)) { + if ((obj8C->unk_50 == 0) || (obj8C->obj.pos.y < D_80177940)) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } else { if (!(gFrameCount & 3)) { - func_8007D2C8(arg0->obj.pos.x, arg0->obj.pos.y + 550.0f, arg0->obj.pos.z, 10.0f); + func_8007D2C8(obj8C->obj.pos.x, obj8C->obj.pos.y + 550.0f, obj8C->obj.pos.z, 10.0f); } - if ((arg0->unk_50 == 0) || (arg0->obj.pos.y < (D_80177940 - 100.0f))) { - Object_Kill(&arg0->obj, &arg0->unk_80); + if ((obj8C->unk_50 == 0) || (obj8C->obj.pos.y < (D_80177940 - 100.0f))) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } - arg0->obj.rot.x += arg0->unk_60.x; - arg0->obj.rot.y += arg0->unk_60.y; - arg0->obj.rot.z += arg0->unk_60.z; + obj8C->obj.rot.x += obj8C->unk_60.x; + obj8C->obj.rot.y += obj8C->unk_60.y; + obj8C->obj.rot.z += obj8C->unk_60.z; if (gLevelType == 0) { - arg0->unk_54.y -= 0.5f; + obj8C->unk_54.y -= 0.5f; } - if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].unk_1C8 == 7) && (D_80177A80 >= 0xB0)) { - arg0->unk_54.x *= 0.95f; - arg0->unk_54.y *= 0.95f; - arg0->unk_54.z *= 0.95f; + if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].unk_1C8 == 7) && (D_80177A80 >= 176)) { + obj8C->unk_54.x *= 0.95f; + obj8C->unk_54.y *= 0.95f; + obj8C->unk_54.z *= 0.95f; } - if ((gCurrentLevel == LEVEL_MACBETH) && (arg0->unk_44 == 0xA)) { - arg0->obj.rot.x = 0.0f; - arg0->obj.rot.y = 0.0f; - if (arg0->unk_50 >= 25) { - arg0->unk_6C = 0.5f; - } else if (arg0->unk_6C > 0.03) { - arg0->unk_6C -= 0.02f; + if ((gCurrentLevel == LEVEL_MACBETH) && (obj8C->unk_44 == 10)) { + obj8C->obj.rot.x = 0.0f; + obj8C->obj.rot.y = 0.0f; + if (obj8C->unk_50 >= 25) { + obj8C->unk_6C = 0.5f; + } else if (obj8C->unk_6C > 0.03) { + obj8C->unk_6C -= 0.02f; } } } @@ -616,22 +616,22 @@ s32 func_800798C4(s32 arg0, Gfx** arg1, Vec3f* arg2, Vec3f* arg3, void* arg4) { return 0; } -void func_800798F0(Object_8C* arg0) { +void func_800798F0(Object_8C* obj8C) { Vec3f frameJointTable[50]; if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].unk_1C8 == 7)) { - func_8005F670(&arg0->obj.pos); + func_8005F670(&obj8C->obj.pos); } RCP_SetupDL(&gMasterDisp, 0x1D); if (gCurrentLevel == LEVEL_KATINA) { gSPFogPosition(gMasterDisp++, gFogNear, 1005); } - func_8005980C(arg0->unk_70); + func_8005980C(obj8C->unk_70); switch (gCurrentLevel) { case LEVEL_MACBETH: - switch (arg0->unk_44) { + switch (obj8C->unk_44) { case 1: - if (arg0->unk_40 & 1) { + if (obj8C->index & 1) { gSPDisplayList(gMasterDisp++, D_6022530); } else { gSPDisplayList(gMasterDisp++, D_6022450); @@ -639,7 +639,7 @@ void func_800798F0(Object_8C* arg0) { break; case 2: RCP_SetupDL(&gMasterDisp, 0x39); - if (arg0->unk_40 & 1) { + if (obj8C->index & 1) { gSPDisplayList(gMasterDisp++, D_601A7A0); } else { gSPDisplayList(gMasterDisp++, D_60223C0); @@ -648,7 +648,7 @@ void func_800798F0(Object_8C* arg0) { break; case 7: Animation_GetFrameData(&D_6027320, 0, frameJointTable); - Animation_DrawSkeleton(1, D_602742C, frameJointTable, func_800798C4, NULL, arg0, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_602742C, frameJointTable, func_800798C4, NULL, obj8C, &gIdentityMatrix); break; case 8: gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -664,7 +664,7 @@ void func_800798F0(Object_8C* arg0) { RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 80, 0, 255); - func_8005980C(arg0->unk_6C); + func_8005980C(obj8C->unk_6C); gSPDisplayList(gMasterDisp++, D_1024AC0); break; case 11: @@ -703,7 +703,7 @@ void func_800798F0(Object_8C* arg0) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; default: - if (arg0->unk_40 & 1) { + if (obj8C->index & 1) { gSPDisplayList(gMasterDisp++, D_10194C0); } else { gSPDisplayList(gMasterDisp++, D_1024290); @@ -717,16 +717,16 @@ void func_800798F0(Object_8C* arg0) { gSPDisplayList(gMasterDisp++, D_600A220); break; default: - switch (arg0->unk_4C) { + switch (obj8C->unk_4C) { case 0: - if (arg0->unk_40 & 1) { + if (obj8C->index & 1) { gSPDisplayList(gMasterDisp++, D_10194C0); } else { gSPDisplayList(gMasterDisp++, D_1024290); } break; case 1: - switch (arg0->unk_40 & 3) { + switch (obj8C->index & 3) { case 0: Matrix_Scale(gGfxMatrix, 1.0f, 0.3f, 1.0f, 1); break; @@ -755,38 +755,38 @@ void func_800798F0(Object_8C* arg0) { } } -void func_8007A28C(Object_8C* arg0) { +void func_8007A28C(Object_8C* obj8C) { Texture_Scroll(D_10190C0, 16, 32, 0); D_8017812C = 2; - arg0->obj.rot.y += 1.0f; - Math_SmoothStepToF(&arg0->unk_70, arg0->unk_6C, 0.05f, 1.5f, 0.001f); - if (arg0->unk_50 >= 0xB) { + obj8C->obj.rot.y += 1.0f; + Math_SmoothStepToF(&obj8C->unk_70, obj8C->unk_6C, 0.05f, 1.5f, 0.001f); + if (obj8C->unk_50 >= 0xB) { D_801779A8[0] = 60.0f; } - if (arg0->unk_50 == 48) { + if (obj8C->unk_50 == 48) { D_80178340 = 150; } - if (arg0->unk_50 > 45) { + if (obj8C->unk_50 > 45) { D_80178358 = 0; D_80178348 = D_80178350 = D_80178354 = 255; } D_8017835C = 3; - if (arg0->unk_50 == 0) { - arg0->unk_44 -= 2; - if (arg0->unk_44 < 0) { - arg0->unk_44 = 0; - Object_Kill(&arg0->obj, &arg0->unk_80); + if (obj8C->unk_50 == 0) { + obj8C->unk_44 -= 2; + if (obj8C->unk_44 < 0) { + obj8C->unk_44 = 0; + Object_Kill(&obj8C->obj, &obj8C->sfxPos); D_8017812C = 0; } } } -void func_8007A3C0(Object_8C* arg0) { +void func_8007A3C0(Object_8C* obj8C) { if (D_80161410 > 0) { - Matrix_Scale(gGfxMatrix, arg0->unk_70, arg0->unk_70, arg0->unk_70, 1); + Matrix_Scale(gGfxMatrix, obj8C->unk_70, obj8C->unk_70, obj8C->unk_70, 1); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_64_2(); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_44); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_10182C0); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -794,18 +794,18 @@ void func_8007A3C0(Object_8C* arg0) { } } -void func_8007A4B8(Object_8C* arg0, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_383; - arg0->unk_6C = arg4; - arg0->unk_50 = 50; - arg0->unk_44 = 200; - arg0->obj.pos.x = xPos; - arg0->obj.pos.y = yPos; - arg0->obj.pos.z = zPos; - func_80019218(0x2940F026, &arg0->unk_80, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void func_8007A4B8(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_383; + obj8C->unk_6C = arg4; + obj8C->unk_50 = 50; + obj8C->unk_44 = 200; + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + func_80019218(0x2940F026, &obj8C->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_8007A568(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { @@ -820,23 +820,23 @@ void func_8007A568(f32 xPos, f32 yPos, f32 zPos, f32 arg3) { func_8007B344(xPos, yPos, zPos, 80.0f, 4); } -void func_8007A5F8(Object_8C* arg0, Vec3f* arg1, u32 arg2) { - Object_8C_Initialize(arg0); - arg0->obj.status = 2; - arg0->obj.id = 0x175; - arg0->obj.pos.x = arg1->x; - arg0->obj.pos.y = arg1->y; - arg0->obj.pos.z = arg1->z; - arg0->unk_50 = 0x32; +void func_8007A5F8(Object_8C* obj8C, Vec3f* arg1, u32 arg2) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 2; + obj8C->obj.id = OBJECT_373; + obj8C->obj.pos.x = arg1->x; + obj8C->obj.pos.y = arg1->y; + obj8C->obj.pos.z = arg1->z; + obj8C->unk_50 = 50; if ((arg2 == 0x1903400F) || (arg2 == 0x11000055)) { - func_80019218(arg2, &arg0->unk_80, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(arg2, &obj8C->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); if (arg2 == 0x11000055) { - arg0->unk_50 = 0x12C; + obj8C->unk_50 = 300; } } else { - func_80019218(arg2, &arg0->unk_80, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_80019218(arg2, &obj8C->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } - func_800612B8(&arg0->unk_1C, arg0->obj.id); + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_8007A6F0(Vec3f* arg0, u32 arg1) { @@ -850,38 +850,38 @@ void func_8007A6F0(Vec3f* arg0, u32 arg1) { } } -void func_8007A748(Object_8C* arg0) { - if (arg0->unk_50 == 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); +void func_8007A748(Object_8C* obj8C) { + if (obj8C->unk_50 == 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } -s32 func_8007A774(Player* arg0, Object_8C* arg1, f32 arg2) { - if ((fabsf(arg0->unk_138 - arg1->obj.pos.z) < arg2) && (fabsf(arg0->unk_074 - arg1->obj.pos.x) < arg2) && - (fabsf(arg0->unk_078 - arg1->obj.pos.y) < arg2) && (arg0->unk_498 == 0)) { - func_800A6CD0(arg0, 0, arg1->unk_1C.unk_18); +s32 func_8007A774(Player* player, Object_8C* obj8C, f32 arg2) { + if ((fabsf(player->unk_138 - obj8C->obj.pos.z) < arg2) && (fabsf(player->unk_074 - obj8C->obj.pos.x) < arg2) && + (fabsf(player->unk_078 - obj8C->obj.pos.y) < arg2) && (player->unk_498 == 0)) { + func_800A6CD0(player, 0, obj8C->unk_1C.damage); return 1; } else { return 0; } } -void func_8007A818(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, u8 arg5, u8 arg6, u16 arg7) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_359; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = posY; - arg0->obj.pos.z = posZ; - arg0->unk_6C = arg4; - arg0->unk_44 = arg5; - arg0->unk_46 = arg6; - arg0->unk_60.z = (Rand_ZeroOne() - 0.5f) * 10.0f; - arg0->unk_60.y = arg4 * 0.1f; +void func_8007A818(Object_8C* obj8C, f32 posX, f32 posY, f32 posZ, f32 arg4, u8 arg5, u8 arg6, u16 arg7) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_359; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = posY; + obj8C->obj.pos.z = posZ; + obj8C->unk_6C = arg4; + obj8C->unk_44 = arg5; + obj8C->unk_46 = arg6; + obj8C->unk_60.z = (Rand_ZeroOne() - 0.5f) * 10.0f; + obj8C->unk_60.y = arg4 * 0.1f; if (arg7 != 0) { - arg0->unk_54.x = (Rand_ZeroOne() - 0.5f) * 30.0f; + obj8C->unk_54.x = (Rand_ZeroOne() - 0.5f) * 30.0f; } - func_800612B8(&arg0->unk_1C, arg0->obj.id); + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_8007A900(f32 posX, f32 posY, f32 posZ, f32 arg3, u8 arg4, u8 arg5, u16 arg6) { @@ -897,21 +897,21 @@ void func_8007A900(f32 posX, f32 posY, f32 posZ, f32 arg3, u8 arg4, u8 arg5, u16 } } -void func_8007A994(Object_8C* arg0) { - Math_SmoothStepToF(&arg0->unk_70, arg0->unk_6C, 0.1f, 10.0f, 0.01f); - arg0->obj.rot.z += arg0->unk_60.z; - arg0->unk_54.y += arg0->unk_60.y; - if (arg0->unk_4A & 1) { - arg0->unk_48++; - if (arg0->unk_48 >= 6) { - arg0->unk_48 = 5; +void func_8007A994(Object_8C* obj8C) { + Math_SmoothStepToF(&obj8C->unk_70, obj8C->unk_6C, 0.1f, 10.0f, 0.01f); + obj8C->obj.rot.z += obj8C->unk_60.z; + obj8C->unk_54.y += obj8C->unk_60.y; + if (obj8C->unk_4A & 1) { + obj8C->unk_48++; + if (obj8C->unk_48 >= 6) { + obj8C->unk_48 = 5; } } - arg0->unk_44 -= arg0->unk_46; - if (arg0->unk_44 < 0x15) { - Object_Kill(&arg0->obj, &arg0->unk_80); + obj8C->unk_44 -= obj8C->unk_46; + if (obj8C->unk_44 < 0x15) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } - arg0->unk_4A++; + obj8C->unk_4A++; } // Gfx* D_800D178C[6] = { @@ -919,47 +919,47 @@ void func_8007A994(Object_8C* arg0) { // 0x06003620, 0x060036C0, 0x06003760 // }; -void func_8007AA60(Object_8C* arg0) { +void func_8007AA60(Object_8C* obj8C) { RCP_SetupDL(&gMasterDisp, 0x44); - gDPSetPrimColor(gMasterDisp++, 0, 0, 31, 10, 00, arg0->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 31, 10, 00, obj8C->unk_44); gDPSetEnvColor(gMasterDisp++, 141, 73, 5, 0); - Matrix_Scale(gGfxMatrix, arg0->unk_70, arg0->unk_70, 1.0f, 1); + Matrix_Scale(gGfxMatrix, obj8C->unk_70, obj8C->unk_70, 1.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_800D178C[arg0->unk_4C]); - arg0->unk_4C = arg0->unk_48; + gSPDisplayList(gMasterDisp++, D_800D178C[obj8C->unk_4C]); + obj8C->unk_4C = obj8C->unk_48; RCP_SetupDL(&gMasterDisp, 0x40); } -void func_8007AB50(Object_8C* arg0) { - if (arg0->unk_4E == 0) { - Math_SmoothStepToF(&arg0->unk_70, arg0->unk_6C, 0.1f, 10.0f, 0.0f); - arg0->unk_44 -= 20; - if (arg0->unk_44 < 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); +void func_8007AB50(Object_8C* obj8C) { + if (obj8C->unk_4E == 0) { + Math_SmoothStepToF(&obj8C->unk_70, obj8C->unk_6C, 0.1f, 10.0f, 0.0f); + obj8C->unk_44 -= 20; + if (obj8C->unk_44 < 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } else { - Math_SmoothStepToF(&arg0->unk_70, arg0->unk_6C, 0.1f, 10.0f, 0.0f); - arg0->unk_44 -= 10; - if (arg0->unk_44 < 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); + Math_SmoothStepToF(&obj8C->unk_70, obj8C->unk_6C, 0.1f, 10.0f, 0.0f); + obj8C->unk_44 -= 10; + if (obj8C->unk_44 < 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } } -void func_8007AC0C(Object_8C* arg0, f32 posX, f32 unused_posY, f32 posY, f32 arg4, f32 arg5, f32 arg6) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_372; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = D_80177940; - arg0->obj.pos.z = posY; - arg0->unk_44 = 0xB4; - arg0->unk_70 = arg4; - arg0->unk_6C = arg5; - arg0->obj.rot.y = arg6; - arg0->unk_54.x = gPlayer[0].unk_0C0.x * 0.6f; - arg0->unk_54.z = gPlayer[0].unk_0C0.z * 0.6; // Forgotten f means bad codegen - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void func_8007AC0C(Object_8C* obj8C, f32 posX, f32 unused_posY, f32 posZ, f32 arg4, f32 arg5, f32 arg6) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_372; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = D_80177940; + obj8C->obj.pos.z = posZ; + obj8C->unk_44 = 0xB4; + obj8C->unk_70 = arg4; + obj8C->unk_6C = arg5; + obj8C->obj.rot.y = arg6; + obj8C->unk_54.x = gPlayer[0].unk_0C0.x * 0.6f; + obj8C->unk_54.z = gPlayer[0].unk_0C0.z * 0.6; // Forgotten f means bad codegen + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_8007ACE0(f32 posX, f32 posY, f32 posZ, f32 arg3, f32 arg4, f32 arg5) { @@ -973,22 +973,22 @@ void func_8007ACE0(f32 posX, f32 posY, f32 posZ, f32 arg3, f32 arg4, f32 arg5) { } } -void func_8007AD58(Object_8C* arg0, f32 posX, f32 unused_posY, f32 posZ, f32 arg4, f32 arg5, f32 arg6) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_372; - arg0->unk_4E = 1; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = D_80177940; - arg0->obj.pos.z = posZ; - arg0->unk_44 = 0xB4; - arg0->unk_70 = arg4; - arg0->unk_6C = arg5; - arg0->obj.rot.y = arg6; - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void func_8007AD58(Object_8C* obj8C, f32 posX, f32 unused_posY, f32 posZ, f32 arg4, f32 arg5, f32 arg6) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_372; + obj8C->unk_4E = 1; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = D_80177940; + obj8C->obj.pos.z = posZ; + obj8C->unk_44 = 0xB4; + obj8C->unk_70 = arg4; + obj8C->unk_6C = arg5; + obj8C->obj.rot.y = arg6; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } -void func_8007ADF4(f32 arg0, f32 posY, f32 arg2, f32 arg3, f32 arg4) { +void func_8007ADF4(f32 posX, f32 posY, f32 posZ, f32 arg3, f32 arg4) { f32 temp_fs0; f32 temp_fs2; f32 var_fs1; @@ -1000,25 +1000,25 @@ void func_8007ADF4(f32 arg0, f32 posY, f32 arg2, f32 arg3, f32 arg4) { if (gObjects8C[i].obj.status == 0) { temp_fs2 = __sinf(M_DTOR * var_fs1) * arg4 * 20.0f; temp_fs0 = __cosf(M_DTOR * var_fs1) * arg4 * 20.0f; - func_8007AD58(&gObjects8C[i], arg0 + temp_fs2, posY, arg2 + temp_fs0, arg3, arg4, var_fs1); + func_8007AD58(&gObjects8C[i], posX + temp_fs2, posY, posZ + temp_fs0, arg3, arg4, var_fs1); break; } } } } -void func_8007AF30(Object_8C* arg0, f32 posX, f32 posZ, f32 arg3, f32 arg4, f32 arg5) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_382; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = -10.0f; - arg0->obj.pos.z = posZ; - arg0->unk_54.x = arg3; - arg0->unk_54.z = arg4 - D_80177D08; - arg0->unk_6C = arg5; - arg0->unk_50 = 0x64; - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void func_8007AF30(Object_8C* obj8C, f32 posX, f32 posZ, f32 arg3, f32 arg4, f32 arg5) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_382; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = -10.0f; + obj8C->obj.pos.z = posZ; + obj8C->unk_54.x = arg3; + obj8C->unk_54.z = arg4 - D_80177D08; + obj8C->unk_6C = arg5; + obj8C->unk_50 = 0x64; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_8007AFD0(f32 posX, f32 posZ, f32 arg2, f32 arg3, f32 arg4) { @@ -1032,40 +1032,40 @@ void func_8007AFD0(f32 posX, f32 posZ, f32 arg2, f32 arg3, f32 arg4) { } } -void func_8007B040(Object_8C* arg0) { +void func_8007B040(Object_8C* obj8C) { f32 sp2C; s32 sp28; - if (func_800A73E4(&sp2C, &sp28, arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z)) { - D_801782EC[sp28] = arg0->unk_6C; - D_801782EC[sp28 + 1] = arg0->unk_6C * 0.7f; - D_801782EC[sp28 - 1] = arg0->unk_6C * 0.7f; + if (func_800A73E4(&sp2C, &sp28, obj8C->obj.pos.x, obj8C->obj.pos.y, obj8C->obj.pos.z)) { + D_801782EC[sp28] = obj8C->unk_6C; + D_801782EC[sp28 + 1] = obj8C->unk_6C * 0.7f; + D_801782EC[sp28 - 1] = obj8C->unk_6C * 0.7f; } - if (arg0->unk_50 == 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); + if (obj8C->unk_50 == 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } -void func_8007B0F4(Object_8C* arg0) { - Math_SmoothStepToF(&arg0->unk_70, arg0->unk_6C * 3.0f, 0.1f, 10.0f, 0.0f); - arg0->unk_44 -= 13; - arg0->obj.rot.y = 180.0f - arg0->obj.rot.y; - if (arg0->unk_44 < 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); +void func_8007B0F4(Object_8C* obj8C) { + Math_SmoothStepToF(&obj8C->unk_70, obj8C->unk_6C * 3.0f, 0.1f, 10.0f, 0.0f); + obj8C->unk_44 -= 13; + obj8C->obj.rot.y = 180.0f - obj8C->obj.rot.y; + if (obj8C->unk_44 < 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } -void func_8007B180(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_381; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = posY; - arg0->obj.pos.z = posZ; - arg0->unk_44 = 0xFF; - arg0->unk_6C = arg4; - func_800612B8(&arg0->unk_1C, arg0->obj.id); - func_80019218(0x1100000C, &arg0->unk_80, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); +void func_8007B180(Object_8C* obj8C, f32 posX, f32 posY, f32 posZ, f32 arg4) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_381; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = posY; + obj8C->obj.pos.z = posZ; + obj8C->unk_44 = 0xFF; + obj8C->unk_6C = arg4; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); + func_80019218(0x1100000C, &obj8C->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } void func_8007B228(f32 posX, f32 posY, f32 posZ, f32 arg3) { @@ -1079,17 +1079,17 @@ void func_8007B228(f32 posX, f32 posY, f32 posZ, f32 arg3) { } } -void func_8007B2BC(Object_8C* arg0, f32 xPos, f32 yPos, f32 zPos, f32 arg4, s32 arg5) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_384; - arg0->obj.pos.x = xPos; - arg0->obj.pos.y = yPos; - arg0->obj.pos.z = zPos; - arg0->unk_6C = arg4; - arg0->unk_44 = 0xFF; - arg0->unk_4C = arg5; - func_800612B8(&arg0->unk_1C, arg0->obj.id); +void func_8007B2BC(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 arg4, s32 arg5) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_384; + obj8C->obj.pos.x = xPos; + obj8C->obj.pos.y = yPos; + obj8C->obj.pos.z = zPos; + obj8C->unk_6C = arg4; + obj8C->unk_44 = 0xFF; + obj8C->unk_4C = arg5; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_8007B344(f32 xPos, f32 yPos, f32 zPos, f32 arg3, s32 arg4) { @@ -1103,16 +1103,16 @@ void func_8007B344(f32 xPos, f32 yPos, f32 zPos, f32 arg3, s32 arg4) { } } -void func_8007B3B8(Object_8C* arg0) { +void func_8007B3B8(Object_8C* obj8C) { f32 var_fv0; f32 var_fv1; s32 var_v0; - if (arg0->unk_4C == 6) { + if (obj8C->unk_4C == 6) { var_fv0 = 15.0f; var_fv1 = 0.05f; var_v0 = 4; - } else if ((arg0->unk_4C == 5) && ((gCurrentLevel == 0x10) || (gCurrentLevel == 1))) { + } else if ((obj8C->unk_4C == 5) && ((gCurrentLevel == 0x10) || (gCurrentLevel == 1))) { var_fv0 = 10.0f; var_fv1 = 0.1f; var_v0 = 4; @@ -1121,31 +1121,31 @@ void func_8007B3B8(Object_8C* arg0) { var_fv1 = 0.1f; var_v0 = 8; } - Math_SmoothStepToF(&arg0->unk_70, arg0->unk_6C, var_fv1, var_fv0, 0.0f); - arg0->unk_44 -= var_v0; - if (arg0->unk_44 < 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); + Math_SmoothStepToF(&obj8C->unk_70, obj8C->unk_6C, var_fv1, var_fv0, 0.0f); + obj8C->unk_44 -= var_v0; + if (obj8C->unk_44 < 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } -void func_8007B494(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 arg5) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_385; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = posY; - arg0->obj.pos.z = posZ; - arg0->obj.rot.x = 90.0f; - arg0->unk_6C = arg4; - arg0->unk_44 = arg5; +void func_8007B494(Object_8C* obj8C, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 arg5) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_385; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = posY; + obj8C->obj.pos.z = posZ; + obj8C->obj.rot.x = 90.0f; + obj8C->unk_6C = arg4; + obj8C->unk_44 = arg5; if (arg5 < 60) { - arg0->unk_46 = 1; + obj8C->unk_46 = 1; } else if (arg5 < 90) { - arg0->unk_46 = 2; + obj8C->unk_46 = 2; } else { - arg0->unk_46 = 3; + obj8C->unk_46 = 3; } - func_800612B8(&arg0->unk_1C, arg0->obj.id); + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_8007B550(f32 posX, f32 posY, f32 posZ, f32 arg3, s32 arg4) { @@ -1159,77 +1159,77 @@ void func_8007B550(f32 posX, f32 posY, f32 posZ, f32 arg3, s32 arg4) { } } -void func_8007B5C0(Object_8C* arg0) { - Math_SmoothStepToF(&arg0->unk_70, arg0->unk_6C, 0.1f, 10.0f, 0.1f); - arg0->unk_44 -= arg0->unk_46; - if (arg0->unk_44 < 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); +void func_8007B5C0(Object_8C* obj8C) { + Math_SmoothStepToF(&obj8C->unk_70, obj8C->unk_6C, 0.1f, 10.0f, 0.1f); + obj8C->unk_44 -= obj8C->unk_46; + if (obj8C->unk_44 < 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } -void func_8007B62C(Object_8C* arg0) { - if (arg0->unk_50 == 0) { - arg0->unk_46 -= 4; - if (arg0->unk_46 <= 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); +void func_8007B62C(Object_8C* obj8C) { + if (obj8C->unk_50 == 0) { + obj8C->unk_46 -= 4; + if (obj8C->unk_46 <= 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } } -void func_8007B670(Object_8C* arg0) { +void func_8007B670(Object_8C* obj8C) { } -void func_8007B67C(Object_8C* arg0) { +void func_8007B67C(Object_8C* obj8C) { s32 var_v1; - arg0->unk_46 += 2; - if (arg0->unk_46 >= 10) { - arg0->unk_46 = 10; + obj8C->unk_46 += 2; + if (obj8C->unk_46 >= 10) { + obj8C->unk_46 = 10; } - if (arg0->unk_46 >= 9) { - arg0->unk_48++; - if (arg0->unk_48 >= 10) { - Object_Kill(&arg0->obj, &arg0->unk_80); + if (obj8C->unk_46 >= 9) { + obj8C->unk_48++; + if (obj8C->unk_48 >= 10) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } } - var_v1 = arg0->unk_4A; + var_v1 = obj8C->unk_4A; if (var_v1 != 0) { if (var_v1 > 10) { var_v1 -= 10; } - arg0->unk_54.x = gPlayer[var_v1 - 1].unk_0C0.x; - arg0->unk_54.y = gPlayer[var_v1 - 1].unk_0C0.y; - arg0->unk_54.z = gPlayer[var_v1 - 1].unk_0C0.z; + obj8C->unk_54.x = gPlayer[var_v1 - 1].unk_0C0.x; + obj8C->unk_54.y = gPlayer[var_v1 - 1].unk_0C0.y; + obj8C->unk_54.z = gPlayer[var_v1 - 1].unk_0C0.z; } } -void func_8007B758(Object_8C* arg0) { - Math_SmoothStepToF(&arg0->unk_70, arg0->unk_6C, 0.1f, 10.0f, 0.1f); - arg0->unk_44 -= 2; - if (arg0->unk_44 < 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); +void func_8007B758(Object_8C* obj8C) { + Math_SmoothStepToF(&obj8C->unk_70, obj8C->unk_6C, 0.1f, 10.0f, 0.1f); + obj8C->unk_44 -= 2; + if (obj8C->unk_44 < 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } - func_8007A774(gPlayer, arg0, arg0->unk_70 * 20.0f); + func_8007A774(gPlayer, obj8C, obj8C->unk_70 * 20.0f); } -void func_8007B7E8(Object_8C* arg0, f32 posX, f32 posY, f32 posZ, f32 arg4) { - Object_8C_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_364; - arg0->obj.pos.x = posX; - arg0->obj.pos.y = posY; - arg0->obj.pos.z = posZ; - arg0->unk_54.x = (Rand_ZeroOne() - 0.5f) * 5.0f; - arg0->unk_54.y = (Rand_ZeroOne() - 0.5f) * 3.0f; - arg0->unk_48 = 3; +void func_8007B7E8(Object_8C* obj8C, f32 posX, f32 posY, f32 posZ, f32 arg4) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_364; + obj8C->obj.pos.x = posX; + obj8C->obj.pos.y = posY; + obj8C->obj.pos.z = posZ; + obj8C->unk_54.x = (Rand_ZeroOne() - 0.5f) * 5.0f; + obj8C->unk_54.y = (Rand_ZeroOne() - 0.5f) * 3.0f; + obj8C->unk_48 = 3; if (Rand_ZeroOne() < 0.5f) { - arg0->unk_48 = -arg0->unk_48; + obj8C->unk_48 = -obj8C->unk_48; } - arg0->unk_4A = 50; - arg0->unk_46 = 1; - arg0->unk_70 = arg4 * 0.2f; - arg0->obj.rot.z = Rand_ZeroOne() * 360.0f; - func_800612B8(&arg0->unk_1C, arg0->obj.id); + obj8C->unk_4A = 50; + obj8C->unk_46 = 1; + obj8C->unk_70 = arg4 * 0.2f; + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); } void func_8007B8F8(f32 posX, f32 posY, f32 posZ, f32 arg3) { @@ -1243,14 +1243,14 @@ void func_8007B8F8(f32 posX, f32 posY, f32 posZ, f32 arg3) { } } -void func_8007B960(Object_8C* arg0) { - arg0->unk_70 += 0.07f; - arg0->unk_4A -= arg0->unk_46; - if (arg0->unk_4A < 0) { - Object_Kill(&arg0->obj, &arg0->unk_80); +void func_8007B960(Object_8C* obj8C) { + obj8C->unk_70 += 0.07f; + obj8C->unk_4A -= obj8C->unk_46; + if (obj8C->unk_4A < 0) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } - arg0->obj.rot.z += arg0->unk_48; - arg0->unk_54.y += 0.2f; + obj8C->obj.rot.z += obj8C->unk_48; + obj8C->unk_54.y += 0.2f; } #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_77E40/func_8007B9DC.s") @@ -1441,21 +1441,21 @@ void func_8007B960(Object_8C* arg0) { #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_77E40/func_80083FA8.s") -void func_80084194(Object_8C* arg0) { +void func_80084194(Object_8C* obj8C) { s32 tmp; if (gCurrentLevel != LEVEL_AQUAS) { RCP_SetupDL(&gMasterDisp, 0x31); - Matrix_Scale(gGfxMatrix, arg0->unk_70, arg0->unk_70, arg0->unk_70, 1); + Matrix_Scale(gGfxMatrix, obj8C->unk_70, obj8C->unk_70, obj8C->unk_70, 1); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - tmp = arg0->unk_44 * 4; + tmp = obj8C->unk_44 * 4; gDPSetEnvColor(gMasterDisp++, D_800D18F0[tmp + 0], D_800D18F0[tmp + 1], D_800D18F0[tmp + 2], 255); } else { RCP_SetupDL(&gMasterDisp, 0x31); - Matrix_Scale(gGfxMatrix, arg0->unk_70, arg0->unk_70, arg0->unk_70, 1); + Matrix_Scale(gGfxMatrix, obj8C->unk_70, obj8C->unk_70, obj8C->unk_70, 1); Matrix_SetGfxMtx(&gMasterDisp); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, D_800D1950[arg0->unk_44]); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, D_800D1950[obj8C->unk_44]); gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255); } gSPDisplayList(gMasterDisp++, D_1024AC0); diff --git a/src/main/fox_84F70.c b/src/main/sf_852F0.c similarity index 73% rename from src/main/fox_84F70.c rename to src/main/sf_852F0.c index a8527f8c..f9de5e16 100644 --- a/src/main/fox_84F70.c +++ b/src/main/sf_852F0.c @@ -1,52 +1,5 @@ #include "global.h" -void func_80084370(s32 arg0) { - Graphics_FillRectangle(&gMasterDisp, 0, 0, arg0, SCREEN_HEIGHT, 0, 0, 0, 255); - Graphics_FillRectangle(&gMasterDisp, SCREEN_WIDTH - arg0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255); -} - -void func_800843FC(s32 arg0) { - Graphics_FillRectangle(&gMasterDisp, 0, 0, SCREEN_WIDTH, arg0, 0, 0, 0, 255); - Graphics_FillRectangle(&gMasterDisp, 0, SCREEN_HEIGHT - arg0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255); -} - -void func_80084488(s32 arg0) { - s32 var_s1; - - RCP_SetupDL_12(); - Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -150.0f, 0); - for (var_s1 = 0; var_s1 < MIN(360, arg0 * 15); var_s1 += 15) { - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, MIN((arg0 - (var_s1 / 15)) * 15, 255)); - Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, var_s1 * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 0.53f, 1.0f, 1.0f, 1); - Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_Gfx_800D9688); - Matrix_Pop(&gGfxMatrix); - } - Matrix_Pop(&gGfxMatrix); -} - -void func_80084688(s32 arg0, s32 arg1) { - if (arg1 != 0) { - switch (arg0) { - case 0: - func_80084488(arg1); - break; - case 1: - func_80084370(arg1); - break; - case 2: - func_800843FC(arg1); - break; - default: - (void) "そのような フェード は ない (%d)\n"; // There is no such fade - break; - } - } -} - #ifdef NON_MATCHING // pretty sure this is equivalent, but it's almost certainly not implemented this way. Raw m2c included for those who // want to try. @@ -178,5 +131,5 @@ void func_800846F0(FrameBuffer* arg0) { osWritebackDCacheAll(); } #else -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/fox_84F70/func_800846F0.s") +#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_852F0/func_800846F0.s") #endif diff --git a/src/main/sf_A4B50.c b/src/main/sf_A4B50.c deleted file mode 100644 index 74e74918..00000000 --- a/src/main/sf_A4B50.c +++ /dev/null @@ -1,1615 +0,0 @@ -#include "global.h" - -extern UNK_TYPE D_800D2F50; // type unclear. unused? -extern s32 D_800D2F54; // only gets set to 0. unused? -extern f32 D_800D2F58; -extern f32 D_800D2F5C[3]; // holds float versions of gVolumeSettings. Unused? -extern u8 D_800D2F68; -extern u8 D_800D2F6C[20]; -extern Vec3f D_800D2F80; -extern Vec3f D_800D2F8C; -extern EnvSettings* D_800D2F98[21]; -extern f32 D_800D2FEC[5]; -extern s32 D_800D3000[4][4]; -extern Vec3f D_800D3040[6]; -extern Vec3f D_800D3088[4]; -extern Vec3f D_800D30B8[4]; -extern Vec3f D_800D30E8; -extern f32 D_800D30F4[4]; -extern f32 D_800D3104[4]; -extern f32 D_800D3114[4]; -extern f32 D_800D3124[12]; -extern f32 D_800D3154[4]; -extern s32 D_800D3164[4]; -extern u8 D_800D317C; -extern u8 D_800D3180[30]; -extern s32 D_800D31A0[4]; - -s32 Play_CheckMedalStatus(u16 arg0) { - if ((D_801778B0[2] > 0) && (D_801778B0[3] > 0) && (D_801778B0[1] > 0) && (gHitCount >= arg0)) { - return true; - } - return false; -} - -void func_800A3FB0(void) { - D_800D2F5C[2] = 0.0f; -} - -s32 Play_GetMaxHealth(void) { - if (gGoldRingCount[0] >= 3) { - return 0x17F; - } - return 0xFF; -} - -void func_800A3FEC(void) { - Vec3f spC4; - Vec3f spB8; - Vtx* spB4; - u16* spB0; - s32 i; - s32 spA8; - f32* var_s3; - f32* var_s5; - f32* var_s4; - f32* var_s0; - f32* var_s1; - f32 sp90; - f32 sp8C; - f32 sp88; - f32 sp84; - - D_801782FC++; - switch (gCurrentLevel) { - case LEVEL_SOLAR: - if (gFrameCount & 1) { - spB4 = SEGMENTED_TO_VIRTUAL(D_6001C50); - } else { - spB4 = SEGMENTED_TO_VIRTUAL(D_6004500); - } - spB0 = SEGMENTED_TO_VIRTUAL(D_6022760); - spA8 = 15; - sp90 = 70.0f; - sp8C = 0.1f; - sp88 = 2.2f; - sp84 = 0.5f; - break; - case LEVEL_ZONESS: - if (gFrameCount & 1) { - spB4 = SEGMENTED_TO_VIRTUAL(D_6009ED0); - } else { - spB4 = SEGMENTED_TO_VIRTUAL(D_600C780); - } - spB0 = SEGMENTED_TO_VIRTUAL(D_602AC50); - spA8 = 7; - sp90 = 40.0f; - sp8C = 0.2f; - sp88 = 1.0f; - sp84 = 2.0f; - break; - } - var_s3 = D_801782CC; - var_s5 = D_801782D4; - var_s4 = D_801782DC; - var_s0 = D_801782E4; - var_s1 = D_801782EC; - for (i = 0; i < 17 * 17; i++, var_s3++, var_s5++, var_s4++, var_s0++, var_s1++, spB0++) { - Math_SmoothStepToF(var_s3, *var_s5, sp8C, *var_s4, 0.0f); - Math_SmoothStepToF(var_s4, 100.0f, 1.0f, sp84, 0.0f); - if ((D_801782FC & spA8) == (i & spA8)) { - *var_s5 = Rand_ZeroOne() * sp90; - *var_s4 = 0.0f; - } - *var_s0 += *var_s1; - *var_s1 -= 0.5f; - if (*var_s0 < 0.0f) { - *var_s1 = *var_s0 = 0.0f; - } - spB4[*spB0].n.ob[1] = (s16) *var_s3 + (s16) *var_s0; - Matrix_RotateZ(gCalcMatrix, *var_s3 * sp88 * M_DTOR, 0); - spC4.x = 120.0f; - spC4.y = 0.0f; - spC4.z = 0.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &spC4, &spB8); - spB4[*spB0].n.n[0] = spB8.x; - spB4[*spB0].n.n[1] = spB8.y; - spB4[*spB0].n.n[2] = spB8.z; - } -} - -void func_800A4460(Player* arg0) { - if ((gCurrentLevel == LEVEL_VENOM_2) && (gObjects408[0].obj.status == 2) && (gObjects408[0].unk_04E == 0x11)) { - arg0->unk_060 = __sinf(arg0->unk_0F4 * 0.7f * M_DTOR) * 0.5f; - arg0->unk_088 += 13.0f; - arg0->unk_0F4 += 20.0f; - arg0->unk_080 = -__sinf(arg0->unk_088 * M_DTOR) * 5.0f; - arg0->unk_0F0 = __sinf(arg0->unk_0F4 * M_DTOR) * 10.0f; - return; - } else { - arg0->unk_060 = __sinf(arg0->unk_0F4 * 0.7f * M_DTOR) * 0.5f; - arg0->unk_088 += 10.0f; - arg0->unk_0F4 += 8.0f; - if ((gLevelType == 0) || ((arg0->unk_238 == 1) && (D_80177880 == 0))) { - arg0->unk_080 = -__sinf(arg0->unk_088 * M_DTOR) * 0.5f; - if ((arg0->wings.rightState <= 1) || (arg0->wings.leftState <= 1)) { - arg0->unk_0F0 = __sinf(arg0->unk_0F4 * M_DTOR) * 5.0f; - } else { - arg0->unk_0F0 = __sinf(arg0->unk_0F4 * M_DTOR) * 1.5f; - } - } - } -} - -void func_800A46A0(Player* arg0) { - s32 var_v1; - f32 sp40; - - if ((arg0->unk_238 == 0) || (D_80177880 == 1)) { - if (arg0->wings.rightState <= 1) { - if (!(gFrameCount & 1) && (D_80177D70[arg0->unk_1C4] != 0)) { - func_8007D10C(((Rand_ZeroOne() - 0.5f) * 10.0f) + arg0->unk_2D4.x, - (Rand_ZeroOne() * 5.0f) + arg0->unk_2D4.y, arg0->unk_2D4.z, 1.0f); - } - if (!(gFrameCount & 1) && (Rand_ZeroOne() < 0.5f) && (D_801778E8 == 0)) { - func_8007C484(((Rand_ZeroOne() - 0.5f) * 5.0f) + arg0->unk_2D4.x, - (Rand_ZeroOne() * 5.0f) + arg0->unk_2D4.y, arg0->unk_2D4.z, arg0->unk_0C0.x, - arg0->unk_0C0.y, arg0->unk_0C0.z, (Rand_ZeroOne() * 0.02f) + 0.02f, arg0->unk_1C4 + 1); - } - } - if (arg0->wings.leftState <= 1) { - if (!(gFrameCount & 1) && (D_80177D88[arg0->unk_1C4] != 0)) { - func_8007D10C(((Rand_ZeroOne() - 0.5f) * 10.0f) + arg0->unk_2C8.x, - (Rand_ZeroOne() * 5.0f) + arg0->unk_2C8.y, arg0->unk_2C8.z, 1.0f); - } - if (!(gFrameCount & 1) && (Rand_ZeroOne() < 0.5f) && (D_801778E8 == 0)) { - func_8007C484(((Rand_ZeroOne() - 0.5f) * 5.0f) + arg0->unk_2C8.x, - (Rand_ZeroOne() * 5.0f) + arg0->unk_2C8.y, arg0->unk_2C8.z, arg0->unk_0C0.x, - arg0->unk_0C0.y, arg0->unk_0C0.z, (Rand_ZeroOne() * 0.02f) + 0.02f, arg0->unk_1C4 + 1); - } - } - } - var_v1 = 7; - if (arg0->health < 0x40) { - if (arg0->health > 0x10) { - var_v1 = 0xF; - } - if (arg0->health > 0x20) { - var_v1 = 0x1F; - } - if (arg0->health > 0x30) { - var_v1 = 0x3F; - } - if ((arg0->unk_238 == 0) || (D_80177880 == 1)) { - sp40 = 0.0f; - if (arg0->unk_1CC == 1) { - sp40 = 30.0f; - } - if (!(gFrameCount & var_v1)) { - func_8007D10C(((Rand_ZeroOne() - 0.5f) * 10.0f) + arg0->unk_074, - (Rand_ZeroOne() * 10.0f) + (arg0->unk_078 + sp40), - ((Rand_ZeroOne() - 0.5f) * 10.0f) + arg0->unk_138, 2.2f); - } - if (!((var_v1 >> 2) & gFrameCount) && (Rand_ZeroOne() < 0.5f)) { - func_8007C484(((Rand_ZeroOne() - 0.5f) * 30.0f) + arg0->unk_074, - (Rand_ZeroOne() * 10.0f) + (arg0->unk_078 + sp40), - ((Rand_ZeroOne() - 0.5f) * 30.0f) + arg0->unk_138, arg0->unk_0C0.x, arg0->unk_0C0.y, - arg0->unk_0C0.z, (Rand_ZeroOne() * 0.03f) + 0.04f, arg0->unk_1C4 + 1); - if (arg0->unk_224 == 0) { - arg0->unk_224 = 2; - } - } - } else if (!((var_v1 >> 2) & gFrameCount) && (Rand_ZeroOne() < 0.5f) && (arg0->unk_224 == 0)) { - arg0->unk_224 = 2; - } - } -} - -void func_800A4C40(Player* arg0) { - Vec3f sp54 = D_800D2F80; - Vec3f sp48 = D_800D2F8C; - Vec3f sp3C; - Vec3f sp30; - - if (D_80161A88 == 2) { - Matrix_Translate(gCalcMatrix, arg0->unk_074, arg0->unk_078, arg0->unk_138, 0); - Matrix_RotateY(gCalcMatrix, (arg0->unk_114 + arg0->unk_0E8 + 180.0f) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -((arg0->unk_0E4 + arg0->unk_4D8) * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -(arg0->unk_0F8 * M_DTOR), 1); - Matrix_MultVec3f(gCalcMatrix, &sp54, &sp3C); - Matrix_MultVec3f(gCalcMatrix, &sp48, &sp30); - if (arg0->unk_078 < (D_80177940 + 100.0f)) { - if ((sp3C.y < D_80177940 + 80.0f) && !(gFrameCount & 1)) { - if (D_80161A64) {} - func_8007ACE0(sp3C.x, D_80177940, sp3C.z, 0.1f, 2.0f, arg0->unk_0E8 + arg0->unk_114 + 20.0f); - } - if ((sp30.y < D_80177940 + 80.0f) && !(gFrameCount & 1)) { - func_8007ACE0(sp30.x, D_80177940, sp30.z, 0.1f, 2.0f, (arg0->unk_0E8 + arg0->unk_114) - 20.0f); - } - } - if ((sp30.y < D_80177940 + 80.0f) || (sp3C.y < D_80177940 + 80.0f)) { - if (D_80161A64 == 0) { - D_80161A64 = 1; - func_80019218(0x1100000B, &arg0->unk_460, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - } - } else { - D_80161A64 = 0; - func_8001A55C(&arg0->unk_460, 0x1100000B); - } - } -} - -void func_800A4F4C(Object_58* arg0) { - s32 i; - u8* var_v0 = (u8*) arg0; - - for (i = 0; i < sizeof(Object_58); i++, var_v0++) { - *var_v0 = 0; - } -} - -void func_800A4F7C(void) { - s16 temp_v0; - s16 temp_v0_2; - s32 var_s1; - s32 var_s1_2; - s32 i; - s32 j; - s32 var_s4_2; - - switch (D_8017789C) { - case 0: - D_80178310 = SEGMENTED_TO_VIRTUAL(D_302DE3C); - break; - case 1: - D_80178310 = SEGMENTED_TO_VIRTUAL(D_302E0E4); - break; - case 2: - if (D_801778AC == 2) { - D_80178310 = SEGMENTED_TO_VIRTUAL(D_302E378); - } else { - D_80178310 = SEGMENTED_TO_VIRTUAL(D_302E170); - } - break; - } - for (i = 0, j = 0; i < 199; j++) { - if (D_80178310[j].id <= OBJECT_INVALID) { - break; - } - if (D_80178310[j].id == OBJECT_147) { - func_800A4F4C(&gObjects58[i]); - gObjects58[i].obj.status = 2; - gObjects58[i].obj.id = D_80178310[j].id; - gObjects58[i].obj.pos.x = D_80178310[j].xPos; - gObjects58[i].obj.pos.z = D_80178310[j].zPos1; - gObjects58[i].obj.pos.y = D_80178310[j].yPos; - func_800612B8(&gObjects58[i].unk_1C, gObjects58[i].obj.id); - i++; - } - } - for (i = 5, j = 0; i < 199; j++) { - if (D_80178310[j].id <= OBJECT_INVALID) { - break; - } - if (D_80178310[j].id != OBJECT_147) { - func_800A4F4C(&gObjects58[i]); - gObjects58[i].obj.status = 2; - gObjects58[i].obj.id = D_80178310[j].id; - gObjects58[i].obj.pos.x = D_80178310[j].xPos; - gObjects58[i].obj.pos.z = D_80178310[j].zPos1; - gObjects58[i].obj.pos.y = D_80178310[j].yPos; - gObjects58[i].obj.rot.y = D_80178310[j].unk_C; - func_800612B8(&gObjects58[i].unk_1C, gObjects58[i].obj.id); - i++; - } - } -} - -void func_800A5330(void) { -} - -void func_800A5338(void) { - Object_4C* var_s0_2; - Object_58* var_s0; - s32 i; - s32 j; - - D_80178310 = SEGMENTED_TO_VIRTUAL(D_603B074); - - for (j = 0, var_s0 = gObjects58; j < 200; j++) { - if (D_80178310[j].id <= OBJECT_INVALID) { - break; - } - if (D_80178310[j].id < OBJECT_161) { - func_800A4F4C(var_s0); - var_s0->obj.status = 2; - var_s0->obj.id = D_80178310[j].id; - var_s0->obj.pos.x = D_80178310[j].xPos; - var_s0->obj.pos.z = D_80178310[j].zPos1; - var_s0->obj.pos.y = D_80178310[j].yPos; - var_s0->obj.rot.y = D_80178310[j].unk_C; - func_800612B8(&var_s0->unk_1C, var_s0->obj.id); - if (var_s0->obj.id == OBJECT_1) { - var_s0->unk_1C.dList = D_6020760; - } - var_s0++; - } - } - - for (j = 0, var_s0_2 = gObjects4C; j < ARRAY_COUNT(gObjects4C); j++) { - if (D_80178310[j].id <= OBJECT_INVALID) { - break; - } - if (D_80178310[j].id == OBJECT_162) { - Object_4C_Initialize(var_s0_2); - var_s0_2->obj.status = 1; - var_s0_2->obj.id = D_80178310[j].id; - var_s0_2->obj.pos.x = D_80178310[j].xPos; - var_s0_2->obj.pos.z = D_80178310[j].zPos1; - var_s0_2->obj.pos.y = D_80178310[j].yPos; - func_800612B8(&var_s0_2->unk_1C, var_s0_2->obj.id); - var_s0_2++; - } - } - i = 0; // fake? - Object_408_Initialize(&gObjects408[i]); - gObjects408[i].obj.status = 1; - gObjects408[i].obj.pos.x = 0.0f; - gObjects408[i].obj.pos.y = 0.0f; - gObjects408[i].obj.pos.z = 0.0f; - gObjects408[i].obj.id = OBJECT_292; - func_800612B8(&gObjects408[i].unk_01C, gObjects408[i].obj.id); -} - -void func_800A55B0(void) { - Object_58* var_s0; - s32 i; - s32 j; - - D_80178310 = SEGMENTED_TO_VIRTUAL(D_6030B14); - - for (j = 0, var_s0 = gObjects58; j < 200; j++) { - if (D_80178310[j].id <= OBJECT_INVALID) { - break; - } - if (D_80178310[j].id < OBJECT_161) { - func_800A4F4C(var_s0); - var_s0->obj.status = 2; - var_s0->obj.id = D_80178310[j].id; - var_s0->obj.pos.x = D_80178310[j].xPos; - var_s0->obj.pos.z = D_80178310[j].zPos1; - var_s0->obj.pos.y = D_80178310[j].yPos; - var_s0->obj.rot.y = D_80178310[j].unk_C; - func_800612B8(&var_s0->unk_1C, var_s0->obj.id); - var_s0++; - } - } - i = 0; // fake? - Object_408_Initialize(&gObjects408[i]); - gObjects408[i].obj.status = 1; - gObjects408[i].obj.pos.x = 0.0f; - gObjects408[i].obj.pos.y = 0.0f; - gObjects408[i].obj.pos.z = 0.0f; - gObjects408[i].obj.id = OBJECT_314; - func_800612B8(&gObjects408[i].unk_01C, gObjects408[i].obj.id); - i = 1; - Object_408_Initialize(&gObjects408[i]); - gObjects408[i].obj.status = 1; - gObjects408[i].obj.pos.x = 0.0f; - gObjects408[i].obj.pos.y = 0.0f; - gObjects408[i].obj.pos.z = 0.0f; - gObjects408[i].obj.id = OBJECT_314; - func_800612B8(&gObjects408[i].unk_01C, gObjects408[i].obj.id); - i = 2; - Object_408_Initialize(&gObjects408[i]); - gObjects408[i].obj.status = 1; - gObjects408[i].obj.pos.x = 0.0f; - gObjects408[i].obj.pos.y = 0.0f; - gObjects408[i].obj.pos.z = 0.0f; - gObjects408[i].obj.id = OBJECT_314; - func_800612B8(&gObjects408[i].unk_01C, gObjects408[i].obj.id); -} - -void func_800A57E0(void) { - s32 i = 0; // fake? - - Object_408_Initialize(&gObjects408[i]); - gObjects408[i].obj.status = 1; - gObjects408[i].obj.pos.x = 0.0f; - gObjects408[i].obj.pos.y = 0.0f; - gObjects408[i].obj.pos.z = 0.0f; - gObjects408[i].obj.id = OBJECT_321; - func_800612B8(&gObjects408[i].unk_01C, gObjects408[i].obj.id); -} - -void func_800A5844(void) { - s32 i; - - D_80178410 = 0; - D_8017827C = 0; - D_80161684 = 0; - D_80161A50 = 0; - gOverlayStage = 0; - D_8015F924 = D_80177CA0 = 0; - D_80177CB0 = 0.0f; - D_80161A9C = D_80177A80 = D_80177838 = D_80177840 = D_8017829C = 0; - D_8017782C = 1; - if (((gCurrentLevel != LEVEL_VENOM_SW) || (D_80161A2E != 2)) && (gCurrentLevel != LEVEL_VENOM_2)) { - for (i = 1; i < 4; i++) { - if (D_801778D0[i] < 0) { - if (D_801778D0[i] == -1) { - D_801778D0[i] = 0; - } - } else if (D_801778D0[i] == 0) { - D_801778D0[i] = 0xFF; - } - } - } -} - -void func_800A594C(void) { - if (D_801778E8 != 0) { - switch (D_8017789C) { - case 0: - sEnvSettings = SEGMENTED_TO_VIRTUAL(D_302DD70); - break; - case 1: - sEnvSettings = SEGMENTED_TO_VIRTUAL(D_302DDB4); - break; - case 2: - sEnvSettings = SEGMENTED_TO_VIRTUAL(D_302DDF8); - break; - } - } else { - sEnvSettings = SEGMENTED_TO_VIRTUAL(D_800D2F98[gCurrentLevel]); - } - if (D_8017782C == 0) { - if (gCurrentLevel == LEVEL_SOLAR) { - func_8001D1C8(0xFF, 1); - func_80019218(0x4100C023, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - func_8001A55C(&gPlayer[0].unk_460, 0x3140807E); - } - } else if (gCurrentLevel == LEVEL_AQUAS) { - sEnvSettings = SEGMENTED_TO_VIRTUAL(D_602E584); - } - D_80177C90 = sEnvSettings->unk_0A; - gLevelType = sEnvSettings->type; - D_801784AC = sEnvSettings->unk_04; - gBgColor = sEnvSettings->bgColor; - gFogRed = sEnvSettings->fogR; - gFogGreen = sEnvSettings->fogG; - gFogBlue = sEnvSettings->fogB; - gFogNear = sEnvSettings->fogN; - gFogFar = sEnvSettings->fogF; - gLight1R = gLight2R = D_80161A70 = sEnvSettings->lightR; - gLight1G = gLight2G = D_80161A74 = sEnvSettings->lightG; - gLight1B = gLight2B = D_80161A78 = sEnvSettings->lightB; - gAmbientR = sEnvSettings->ambR; - gAmbientG = sEnvSettings->ambG; - gAmbientB = sEnvSettings->ambB; - D_801784D0 = D_801784F8 = D_80178520 = D_801784B8 = D_801784C4 = sEnvSettings->unk_20.x; - D_801784D4 = D_801784FC = D_80178524 = D_801784BC = D_801784C8 = sEnvSettings->unk_20.y; - D_801784D8 = D_80178500 = D_80178528 = D_801784C0 = D_801784CC = sEnvSettings->unk_20.z; - D_80161A44 = 12800.0f; - D_80178540 = 40; - D_80178544 = 40; - D_80161A3C = 45.0f; -} - -// #define ARRAY_ALLOCATE(arr, count) (arr) = Memory_Allocate((count) * sizeof(*array)) - -void func_800A5D6C(void) { - u16 temp_v0; - u32 i; - - D_80178288 = Memory_Allocate(1000 * sizeof(f32)); - D_80178290 = Memory_Allocate(1000 * sizeof(f32)); - D_80178298 = Memory_Allocate(1000 * sizeof(u32)); - Rand_SetSeed(1, 0x7148, 0x2694); - for (i = 0; i < 1000; i++) { - D_80178288[i] = (Rand_ZeroOneSeeded() * 480.0f) - 80.0f; - D_80178290[i] = (Rand_ZeroOneSeeded() * 360.0f) - 60.0f; - D_80178298[i] = FILL_COLOR(D_800C9C3C[i % ARRAY_COUNT(D_800C9C3C)]); - } -} - -void func_800A5EBC(void) { - func_800A5D6C(); - D_80177940 = -25000.0f; - D_80178410 = 600; - if (gCurrentLevel == LEVEL_AREA_6) { - D_80178410 = 300; - } - if (gCurrentLevel == LEVEL_UNK_15) { - D_80178410 = 400; - } - if (gGameState != GSTATE_PLAY) { - D_80178410 = 800; - } - if (gCurrentLevel == LEVEL_FORTUNA) { - D_80178410 = 500; - } - if (D_801778E8 != 0) { - D_80178410 = 0; - } - if (gCurrentLevel == LEVEL_BOLSE) { - D_80178410 = 300; - D_80177940 = -0.0f; - } - if (gCurrentLevel == LEVEL_TRAINING) { - D_80178410 = 800; - D_80177940 = -0.0f; - } -} - -void func_800A5FA0(Vec3f* arg0, u32 arg1, s32 arg2) { - if (D_801778E8 == 0) { - func_80019218(arg1, arg0, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - } else { - func_80019218(arg1, arg0, arg2, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - } -} - -void func_800A6028(Vec3f* arg0, u32 arg1) { - func_80019218(arg1, arg0, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); -} - -void func_800A6070(Vec3f* arg0, u32 arg1) { - func_80019218(arg1, arg0, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); -} - -void func_800A60B8(UnkEntity1C* arg0) { - s32 i; - u8* var_v0 = (u8*) arg0; - - for (i = 0; i < sizeof(UnkEntity1C); i++, var_v0++) { - *var_v0 = 0; - } -} - -void func_800A60E8(UnkEntity30* arg0) { - s32 i; - u8* var_v0 = (u8*) arg0; - - for (i = 0; i < sizeof(UnkEntity30); i++, var_v0++) { - *var_v0 = 0; - } -} - -void func_800A6118(UnkEntity28* arg0) { - s32 i; - u8* var_v0 = (u8*) arg0; - - for (i = 0; i < sizeof(UnkEntity28); i++, var_v0++) { - *var_v0 = 0; - } -} - -void func_800A6148(void) { - s16 i; - s16 j; - - for (i = 0; i < ARRAY_COUNT(gUnkEntities1C); i++) { - func_800A60B8(&gUnkEntities1C[i]); - } - for (i = 0; i < ARRAY_COUNT(gUnkEntities28); i++) { - func_800A6118(&gUnkEntities28[i]); - } - for (i = 0; i < ARRAY_COUNT(gUnkEntities30); i++) { - func_800A60E8(&gUnkEntities30[i]); - } - for (i = 0; i < ARRAY_COUNT(gObjects80); i++) { - Object_Kill(&gObjects80[i].obj, &gObjects80[i].unk_70); - Object_80_Initialize(&gObjects80[i]); - } - for (i = 0; i < ARRAY_COUNT(gObjects4C); i++) { - Object_4C_Initialize(&gObjects4C[i]); - } - for (i = 0; i < ARRAY_COUNT(gObjects2F4); i++) { - Object_Kill(&gObjects2F4[i].obj, &gObjects2F4[i].unk_100); - Object_2F4_Initialize(&gObjects2F4[i]); - } - for (i = 0; i < ARRAY_COUNT(gObjects408); i++) { - Object_Kill(&gObjects408[i].obj, &gObjects408[i].unk_3FC); - Object_408_Initialize(&gObjects408[i]); - } - for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) { - Object_Kill(&gObjects8C[i].obj, &gObjects8C[i].unk_80); - Object_8C_Initialize(&gObjects8C[i]); - } - for (i = 0; i < ARRAY_COUNT(gObjects6C); i++) { - Object_Kill(&gObjects6C[i].obj, &gObjects6C[i].unk_5C); - Object_6C_Initialize(&gObjects6C[i]); - } - for (i = 0; i < ARRAY_COUNT(gObjects70); i++) { - Object_Kill(&gObjects70[i].obj, &gObjects70[i].unk_38); - func_80035E48(&gObjects70[i]); - } - D_801782B8 = D_801782BC = D_801782C0 = D_801782D0 = D_80178284 = D_8017828C = D_8017812C = D_80177E70 = D_80177E78 = - D_80177E80 = 0; - D_80177F10.x = D_80177F10.y = D_80177F10.z = D_80177E88.x = D_80177E88.y = D_80177E88.z = 0.0f; - for (i = 0; i < ARRAY_COUNT(D_80177E98); i++) { - D_80177E98[i].x = D_80177E98[i].y = D_80177E98[i].z = 100.0f; - } - for (i = 0; i < ARRAY_COUNT(D_80176878); i++) { - D_80176550[i] = 0; - for (j = 0; j < ARRAY_COUNT(*D_80176878); j++) { - D_80176878[i][j] = -5000.0f; - } - } -} - -void func_800A6590(void) { - if (D_80178340 != D_80178358) { - if (D_80178340 < D_80178358) { - D_80178340 += D_8017835C; - if (D_80178340 >= D_80178358) { - D_80178340 = D_80178358; - } - } else { - D_80178340 -= D_8017835C; - if (D_80178358 >= D_80178340) { - D_80178340 = D_80178358; - } - } - } - D_8017835C = 0x10; - Math_SmoothStepToF(&D_8017836C, 0.0f, 1.0f, 0.04f, 0.001f); - if (D_80161A60 != 0) { - D_80161A60--; - if (D_80161A60 & 2) { - D_80178348 = 255; - D_80178350 = 255; - D_80178354 = 255; - D_80178340 = 254; - } else { - D_80178340 = 0; - } - } -} - -void func_800A668C(f32 arg0, f32 arg1, f32 arg2) { - s32 i; - - for (i = 0; i < ARRAY_COUNT(gObjects70); i++) { - if (gObjects70[i].obj.status == 0) { - func_80035E48(&gObjects70[i]); - gObjects70[i].obj.status = 2; - gObjects70[i].unk_60 = 0; - gObjects70[i].obj.pos.x = arg0; - gObjects70[i].obj.pos.y = arg1; - gObjects70[i].obj.pos.z = arg2; - break; - } - } -} - -void func_800A670C(Object_2F4* arg0, s32 arg1, f32 arg2, f32 arg3, f32 arg4) { - Object_2F4_Initialize(arg0); - arg0->obj.status = 1; - arg0->obj.id = OBJECT_189; - arg0->unk_0B8 = arg1; - arg0->obj.pos.x = arg2; - arg0->obj.pos.y = arg3; - arg0->obj.pos.z = arg4; - arg0->unk_10C = 0.5f; - if ((arg1 == 0) || (arg1 == 1)) { - arg0->unk_0E8.y = (Rand_ZeroOne() * 5.0f) + 10.0f; - arg0->unk_0E8.x = 10.0f; - - if (arg1 == 0) { - arg0->unk_0E8.x = -10.0f; - } - arg0->unk_0BC = 15; - } else { - if (gLevelType == 0) { - arg0->unk_0E8.y = (Rand_ZeroOne() * 7.0f) + 7.0f; - arg0->unk_0E8.x = (Rand_ZeroOne() - 0.5f) * 10.0f; - arg0->unk_0E8.z = (Rand_ZeroOne() * 5.0f) + 5.0f; - if (D_80177880 == 1) { - arg0->unk_0E8.z = (Rand_ZeroOne() - 0.5f) * 10.0f; - } - arg0->unk_0BC = (s32) (Rand_ZeroOne() * 10.0f) + 10; - } else { - arg0->unk_0E8.x = (Rand_ZeroOne() - 0.5f) * 10.0f; - arg0->unk_0E8.y = (Rand_ZeroOne() - 0.5f) * 10.0f; - arg0->unk_0E8.z = (Rand_ZeroOne() - 0.5f) * 10.0f; - arg0->unk_0BC = (s32) (Rand_ZeroOne() * 25.0f) + 25; - arg0->unk_10C = 0.0f; - } - if (arg1 == 2) { - arg0->unk_110 = (Rand_ZeroOne() * 1.5f) + 0.75f; - } else if (arg1 == 4) { - arg0->unk_110 = (Rand_ZeroOne() * 0.8f) + 0.3f; - arg0->unk_0BC = (s32) (Rand_ZeroOne() * 50.0f) + 70; - } - arg0->obj.rot.x = Rand_ZeroOne() * 360.0f; - } - func_800612B8(&arg0->unk_01C, arg0->obj.id); -} - -void func_800A69F8(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { - s32 i; - - if (D_801778E8 == 0) { - for (i = ARRAY_COUNT(gObjects2F4) - 1; i >= 10; i--) { - if (gObjects2F4[i].obj.status == 0) { - func_800A670C(&gObjects2F4[i], arg0, arg1, arg2, arg3); - break; - } - } - } -} - -// has to be int. s32 and u32 don't match -int func_800A6A74(void) { - return gGoldRingCount[0] && gGoldRingCount[1] && gGoldRingCount[2] && gGoldRingCount[3]; -} - -void func_800A6AC0(Player* player, s32 side, s32 damage) { - if ((player->unk_1CC == 0) && (D_80177AB8[player->unk_1C4] < 1.0f)) { - if (side == 1) { - D_80177D40[player->unk_1C4] = 30; - if (player->wings.rightState == 2) { - gRightWingHealth[player->unk_1C4] -= damage; - if (gRightWingHealth[player->unk_1C4] <= 0) { - func_800A69F8(1, player->unk_2D4.x, player->unk_2D4.y, player->unk_2D4.z); - player->wings.rightState = 1; - func_8007D0E0(player->unk_2D4.x, player->unk_2D4.y, player->unk_2D4.z, 2.0f); - D_80177D70[player->unk_1C4] = 50; - func_800A5FA0(&player->unk_460, 0x0900A02C, player->unk_1C4); - if (D_8015F90C == 0) { - D_8015F90C = 1000; - } - } - } - } else if (side == 2) { - D_80177D58[player->unk_1C4] = 30; - if (player->wings.leftState == 2) { - gLeftWingHealth[player->unk_1C4] -= damage; - if (gLeftWingHealth[player->unk_1C4] <= 0) { - func_800A69F8(0, player->unk_2C8.x, player->unk_2C8.y, player->unk_2C8.z); - player->wings.leftState = 1; - func_8007D0E0(player->unk_2C8.x, player->unk_2C8.y, player->unk_2C8.z, 2.0f); - D_80177D88[player->unk_1C4] = 50; - func_800A5FA0(&player->unk_460, 0x0900A02C, player->unk_1C4); - if (D_8015F90C == 0) { - D_8015F90C = 1000; - } - } - } - } - } -} - -void func_800A6CD0(Player* arg0, s32 arg1, s32 damage) { - Vec3f sp44; - Vec3f sp38; - f32 sp34 = 20.0f; - - arg0->unk_1A4 = damage; - arg0->unk_21C = arg1; - if ((damage == 39) || (damage == 41) || (damage == 42) || (damage == 43)) { - damage = 40; - } - if (gExpertMode) { - arg0->damage = damage * 2; - } else { - arg0->damage = damage; - } - if (arg0->damage != 0) { - arg0->unk_220 = 4; - } - arg0->unk_284 = 0; - arg0->unk_1F4 = 20; - if (arg0->unk_1A4 > 40) { - sp34 = (arg0->unk_110 * 0.3f) + 20.0f; - arg0->unk_498 = 5; - } else if ((gCurrentLevel == LEVEL_VENOM_2) && (D_80178284 == 0)) { - arg0->unk_498 = 3; - } else if ((gCurrentLevel == LEVEL_VENOM_1) || (gCurrentLevel == LEVEL_AQUAS)) { - arg0->unk_498 = 5; - } else { - arg0->unk_498 = 20; - } - if (D_80177AD0[arg0->unk_1C4] != 0) { - func_800A5FA0(&arg0->unk_460, 0x0903900E, arg0->unk_1C4); - D_80177AE8[arg0->unk_1C4] = 5; - D_80177AB8[arg0->unk_1C4] = 2.0f; - arg0->damage = 0; - } else { - if (arg0->health != 0) { - if (arg0->health < 50) { - func_80019218(0x49008011, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - } else if (arg0->health < 100) { - func_80019218(0x49008010, &D_800C5D28, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - } - } - if (damage < 25) { - func_800A5FA0(&arg0->unk_460, 0x0903900E, arg0->unk_1C4); - } else { - func_800A5FA0(&arg0->unk_460, 0x0903A00F, arg0->unk_1C4); - } - } - Matrix_RotateY(gCalcMatrix, arg0->unk_114 * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, arg0->unk_0F8 * M_DTOR, 1); - sp44.z = 0.0f; - switch (arg0->unk_21C) { - case 0: - arg0->unk_224 = 20; - arg0->unk_0D8.x = 0.f; - arg0->unk_0D8.y = 0.f; - arg0->unk_0D8.z = 0.f; - break; - case 1: - sp44.x = -sp34; - sp44.y = 0.0f; - - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - arg0->unk_0D8.x = sp38.x; - arg0->unk_0D8.y = sp38.y; - arg0->unk_0D8.z = sp38.z; - func_800A668C(arg0->unk_2D4.x - arg0->unk_0C0.x, arg0->unk_2D4.y, arg0->unk_2D4.z - arg0->unk_0C0.z); - func_800A6AC0(arg0, 1, 20); - break; - case 2: - sp44.x = sp34; - sp44.y = 0.0f; - - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - arg0->unk_0D8.x = sp38.x; - arg0->unk_0D8.y = sp38.y; - arg0->unk_0D8.z = sp38.z; - func_800A668C(arg0->unk_2C8.x - arg0->unk_0C0.x, arg0->unk_2C8.y, arg0->unk_2C8.z - arg0->unk_0C0.z); - func_800A6AC0(arg0, 2, 20); - break; - case 3: - arg0->unk_224 = 20; - func_800A668C(arg0->unk_2EC.x - arg0->unk_0C0.x, arg0->unk_2EC.y, arg0->unk_2EC.z - arg0->unk_0C0.z); - if (arg0->unk_1CC != 1) { - sp44.x = 0.0f; - sp44.y = -sp34; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - arg0->unk_0D8.x = sp38.x; - arg0->unk_0D8.y = sp38.y; - arg0->unk_0D8.z = sp38.z; - } - if (Rand_ZeroOne() < 0.5f) { - func_800A6AC0(arg0, 1, 15); - } else { - func_800A6AC0(arg0, 2, 15); - } - break; - case 4: - arg0->unk_224 = 20; - func_800A668C(arg0->unk_2E0.x - arg0->unk_0C0.x, arg0->unk_2E0.y, arg0->unk_2E0.z - arg0->unk_0C0.z); - sp44.x = 0.0f; - sp44.y = sp34; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - arg0->unk_0D8.x = sp38.x; - arg0->unk_0D8.y = sp38.y; - arg0->unk_0D8.z = sp38.z; - if (Rand_ZeroOne() < 0.5f) { - func_800A6AC0(arg0, 1, 15); - } else { - func_800A6AC0(arg0, 2, 15); - } - break; - } - if ((gCurrentLevel == LEVEL_VENOM_1) && (arg0->unk_1A4 == 42)) { - if (arg0->unk_074 > 0.0f) { - arg0->unk_0D8.x = -30.0f; - } else { - arg0->unk_0D8.x = 30.0f; - } - arg0->unk_498 = 10; - } -} - -void func_800A729C(Player* arg0, u32 arg1, f32 arg2, f32 arg3) { - arg0->unk_21C = arg1; - switch (arg1) { - case 1: - case 2: - arg0->unk_074 = arg0->unk_08C.y; - arg0->unk_0D8.x = 0.0f; - arg0->unk_074 += D_800D2FEC[arg0->unk_21C]; - if (arg0->unk_1CC == 1) { - arg0->unk_074 -= D_800D2FEC[arg0->unk_21C]; - } - Math_SmoothStepToF(&arg0->unk_0D0, 2.0f, 1.0f, 2.0f, 0.00001f); - break; - case 3: - case 4: - arg0->unk_07C = arg0->unk_098; - arg0->unk_0D8.z = 0.0f; - arg0->unk_07C += D_800D2FEC[arg0->unk_21C]; - if (arg0->unk_1CC == 1) { - arg0->unk_07C += D_800D2FEC[arg0->unk_21C]; - } - arg0->unk_138 = arg0->unk_07C; - Math_SmoothStepToF(&arg0->unk_0D0, 2.0f, 1.0f, 2.0f, 0.00001f); - break; - case 0: - case 5: - break; - } -} - -s32 func_800A73E4(f32* arg0, s32* arg1, f32 posX, f32 posY, f32 posZ) { - Vtx* spA4; - u16* spA0; - s32 sp9C; - s32 sp98; - f32 sp94; - f32 sp90; - s32 sp8C; - f32 x0; - f32 y0; - f32 z0; - f32 x1; - f32 y1; - f32 z1; - f32 x2; - f32 y2; - f32 z2; - f32 temp1; - f32 dz21; - f32 dx10; - f32 dx21; - f32 dy10; - f32 dy21; - f32 dz10; - f32 sp48; - f32 crz; - f32 cry; - f32 crx; - - switch (gCurrentLevel) { - case LEVEL_SOLAR: - spA4 = SEGMENTED_TO_VIRTUAL(D_6001C50); - spA0 = SEGMENTED_TO_VIRTUAL(D_6022760); - break; - case LEVEL_ZONESS: - spA4 = SEGMENTED_TO_VIRTUAL(D_6009ED0); - spA0 = SEGMENTED_TO_VIRTUAL(D_602AC50); - break; - default: - return 0; - } - - sp9C = (s32) ((posX + 2400.0f) / 300.0f); - sp98 = (s32) ((posZ + D_80177D20 + 1500.0f + 2400.0f) / 300.0f); - if ((sp9C < 0) || (sp9C >= 16) || (sp98 < 0) || (sp98 >= 16)) { - return 0; - } - sp90 = Math_ModF(posX + 2400.0f, 300.0f); - sp94 = Math_ModF(posZ + D_80177D20 + 1500.0f + 2400.0f, 300.0f); - sp8C = (sp98 * 17) + sp9C; - x0 = spA4[spA0[sp8C]].n.ob[0] * 3.0f; - y0 = spA4[spA0[sp8C]].n.ob[1] * 2.0f; - z0 = spA4[spA0[sp8C]].n.ob[2] * 3.0f; - if (sp90 < sp94) { - x1 = spA4[spA0[sp8C + 18]].n.ob[0] * 3.0f; - y1 = spA4[spA0[sp8C + 18]].n.ob[1] * 2.0f; - z1 = spA4[spA0[sp8C + 18]].n.ob[2] * 3.0f; - x2 = spA4[spA0[sp8C + 17]].n.ob[0] * 3.0f; - y2 = spA4[spA0[sp8C + 17]].n.ob[1] * 2.0f; - z2 = spA4[spA0[sp8C + 17]].n.ob[2] * 3.0f; - } else { - x1 = spA4[spA0[sp8C + 1]].n.ob[0] * 3.0f; - y1 = spA4[spA0[sp8C + 1]].n.ob[1] * 2.0f; - z1 = spA4[spA0[sp8C + 1]].n.ob[2] * 3.0f; - x2 = spA4[spA0[sp8C + 18]].n.ob[0] * 3.0f; - y2 = spA4[spA0[sp8C + 18]].n.ob[1] * 2.0f; - z2 = spA4[spA0[sp8C + 18]].n.ob[2] * 3.0f; - } - dx10 = x1 - x0; - dx21 = x2 - x1; - dy10 = y1 - y0; - - dy21 = y2 - y1; - dz10 = z1 - z0; - dz21 = z2 - z1; - - crx = (dy10 * dz21) - (dz10 * dy21); - cry = (dz10 * dx21) - (dx10 * dz21); - crz = (dx10 * dy21) - (dy10 * dx21); - - temp1 = -crx * x0 - cry * y0 - crz * z0; - sp48 = (-temp1 - crx * posX - crz * (posZ + D_80177D20 + 1500.0f)) / cry; - if (posY < sp48) { - *arg0 = sp48; - *arg1 = sp8C; - return true; - } - return false; -} - -s32 func_800A78C4(f32* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { - if ((fabsf(arg0[0] + arg3 - arg6) < (arg0[1] + D_8017853C)) && - (fabsf(arg0[4] + arg1 - arg4) < (arg0[5] + D_8017853C)) && - (fabsf(arg0[2] + arg2 - arg5) < (arg0[3] + D_8017853C))) { - return true; - } - return false; -} - -s32 func_800A7974(Player* arg0, f32* arg1, s32* arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, - f32 arg9, f32 argA, f32 argB) { - s32 spB4; - s32 i; - f32 var_fv0; - f32 var_fv1; - f32 var_fa0; - f32 spA0; - Vec3f sp94; - Vec3f sp88; - - spB4 = *arg1++; - if (spB4 != 0) { - for (i = 0; i < spB4; i++, arg1 += 6) { - spA0 = 0; - if (arg1[0] == 200000.0f) { - Matrix_RotateZ(gCalcMatrix, -arg1[3] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -arg1[1] * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -arg1[2] * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -arg8 * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -arg6 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -arg7 * M_DTOR, 1); - arg1 += 4; - spA0 = 1; - } else { - if (arg1[0] >= 300000.0f) { - arg1++; - } - Matrix_RotateZ(gCalcMatrix, -arg8 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -arg6 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -arg7 * M_DTOR, 1); - } - if (!((arg9 == 0) && (argA == 0) && (argB == 0))) { - Matrix_RotateZ(gCalcMatrix, -argB * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -arg9 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -argA * M_DTOR, 1); - } - if ((arg7 == 0.0f) && (arg8 == 0.0f) && (arg6 == 0.0f) && (spA0 == 0)) { - var_fv0 = arg0->unk_2E0.x; - var_fv1 = arg0->unk_2E0.y; - var_fa0 = arg0->unk_2E0.z; - } else { - sp94.x = arg0->unk_2E0.x - arg3; - sp94.y = arg0->unk_2E0.y - arg4; - sp94.z = arg0->unk_2E0.z - arg5; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp94, &sp88); - var_fv0 = sp88.x + arg3; - var_fv1 = sp88.y + arg4; - var_fa0 = sp88.z + arg5; - } - if (func_800A78C4(arg1, arg3, arg4, arg5, var_fv0, var_fv1, var_fa0)) { - *arg2 = i + 1; - if (arg1[-1] == 300000.0f) { - return -1; - } - if (arg1[-1] == 400000.0f) { - return -2; - } - return 3; - } - if (arg1[-1] < 300000.0f) { - if ((arg7 == 0.0f) && (arg8 == 0.0f) && (arg6 == 0.0f) && (spA0 == 0)) { - var_fv0 = arg0->unk_2EC.x; - var_fv1 = arg0->unk_2EC.y; - var_fa0 = arg0->unk_2EC.z; - } else { - sp94.x = arg0->unk_2EC.x - arg3; - sp94.y = arg0->unk_2EC.y - arg4; - sp94.z = arg0->unk_2EC.z - arg5; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp94, &sp88); - var_fv0 = sp88.x + arg3; - var_fv1 = sp88.y + arg4; - var_fa0 = sp88.z + arg5; - } - if (func_800A78C4(arg1, arg3, arg4, arg5, var_fv0, var_fv1, var_fa0)) { - *arg2 = i + 1; - return 4; - } - if ((arg7 == 0.0f) && (arg8 == 0.0f) && (arg6 == 0.0f) && (spA0 == 0)) { - var_fv0 = arg0->unk_2D4.x; - var_fv1 = arg0->unk_2D4.y; - var_fa0 = arg0->unk_2D4.z; - } else { - sp94.x = arg0->unk_2D4.x - arg3; - sp94.y = arg0->unk_2D4.y - arg4; - sp94.z = arg0->unk_2D4.z - arg5; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp94, &sp88); - var_fv0 = sp88.x + arg3; - var_fv1 = sp88.y + arg4; - var_fa0 = sp88.z + arg5; - } - if (func_800A78C4(arg1, arg3, arg4, arg5, var_fv0, var_fv1, var_fa0)) { - *arg2 = i + 1; - return 1; - } - if ((arg7 == 0.0f) && (arg8 == 0.0f) && (arg6 == 0.0f) && (spA0 == 0)) { - var_fv0 = arg0->unk_2C8.x; - var_fv1 = arg0->unk_2C8.y; - var_fa0 = arg0->unk_2C8.z; - } else { - sp94.x = arg0->unk_2C8.x - arg3; - sp94.y = arg0->unk_2C8.y - arg4; - sp94.z = arg0->unk_2C8.z - arg5; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp94, &sp88); - var_fv0 = sp88.x + arg3; - var_fv1 = sp88.y + arg4; - var_fa0 = sp88.z + arg5; - } - if (func_800A78C4(arg1, arg3, arg4, arg5, var_fv0, var_fv1, var_fa0)) { - *arg2 = i + 1; - return 2; - } - } - } - } - return 0; -} - -bool func_800A8054(s32 objId, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, Vec3f* arg7, Vec3f* arg8) { - Vec3f sp54; - Vec3f sp48; - Vec3f sp3C; - f32 pad1; - f32 sp34; - s32 var_s0; - s32 var_v0; - - sp54.x = arg4; - sp54.y = arg5; - sp54.z = arg6; - sp48.x = arg1; - sp48.y = arg2; - sp48.z = arg3; - - var_v0 = false; - switch (objId) { - case 0xB4: - var_s0 = 0; - break; - case 4: - case 5: - var_s0 = 1; - var_v0 = true; - break; - case 0x95: - var_s0 = 5; - break; - case 0x96: - var_s0 = 6; - break; - case 0x134: - var_s0 = 4; - break; - case 0x138: - var_s0 = 9; - break; - case 0x135: - var_s0 = 7; - break; - case 0x3E8: - var_s0 = 3; - break; - case 0x139: - var_s0 = 8; - break; - case 0x27: - var_s0 = 1; - break; - case 0x78: - var_s0 = 18; - var_v0 = true; - break; - case 0x7C: - var_s0 = 15; - var_v0 = true; - break; - case 0x7E: - var_s0 = 16; - var_v0 = true; - break; - case 0x2F: - var_s0 = 7; - var_v0 = true; - break; - case 2: - var_s0 = 2; - var_v0 = true; - break; - case 3: - case 0x45: - var_s0 = 3; - var_v0 = true; - break; - case 0x8F: - var_s0 = 17; - var_v0 = true; - break; - case 0x8C: - var_s0 = 4; - var_v0 = true; - break; - case 0x8D: - var_s0 = 6; - var_v0 = true; - break; - case 0x75: - var_s0 = 14; - var_v0 = true; - break; - case 0x46: - var_s0 = 8; - var_v0 = true; - break; - case 0x48: - var_s0 = 9; - var_v0 = true; - break; - case 0x47: - var_s0 = 10; - var_v0 = true; - break; - case 0x49: - var_s0 = 11; - var_v0 = true; - break; - case 0x43: - var_s0 = 12; - var_v0 = true; - break; - case 0x4A: - var_s0 = 13; - var_v0 = true; - break; - case 0x76: - case 0x77: - case 0x79: - case 0x7A: - case 0x7B: - case 0x7D: - case 0x7F: - case 0x80: - case 0x81: - case 0x82: - case 0x83: - case 0x84: - case 0x85: - case 0x86: - case 0x87: - case 0x88: - case 0x89: - case 0x8A: - case 0x8B: - case 0x8E: - case 0x90: - case 0x91: - case 0x92: - case 0x93: - case 0x94: - case 0x28: - case 0x29: - case 0x2A: - case 0x2B: - case 0x2C: - case 0x2D: - case 0x2E: - case 0x30: - case 0x31: - case 0x32: - case 0x33: - case 0x34: - case 0x35: - case 0x36: - case 0x37: - case 0x38: - case 0x39: - case 0x3A: - case 0x3B: - case 0x3C: - case 0x3D: - case 0x3E: - case 0x3F: - case 0x40: - case 0x41: - case 0x42: - case 0x44: - default: - var_s0 = 0; - var_v0 = true; - break; - } - - if (!var_v0) { - if (func_800998FC(&sp54, &sp48, arg8, var_s0, &sp3C, &sp34) > 0) { - return true; - } - } else { - if (func_800A3690(&sp54, &sp48, var_s0, arg7) != 0) { - return true; - } - } - return false; -} - -// arg5 could be Vec3f (not Vec3f*) -s32 func_800A8304(Player* arg0, s32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { - Vec3f sp84; - Vec3f sp78; - Vec3f sp6C; - Vec3f sp60; - Vec3f sp54; - - sp84.x = arg2; - sp84.y = arg3; - sp84.z = arg4; - Matrix_RotateY(gCalcMatrix, -arg6 * M_DTOR, 0); - sp78.x = arg0->unk_0C0.x; - sp78.y = arg0->unk_0C0.y; - sp78.z = arg0->unk_0C0.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp54); - if ((arg0->unk_1CC == 1) || (arg0->unk_1CC == 3)) { - sp78.x = arg0->unk_074 - sp84.x; - sp78.y = arg0->unk_078 - sp84.y; - sp78.z = arg0->unk_138 - sp84.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, - &sp54)) { - arg0->unk_078 = sp60.y; - arg0->unk_104 = Math_RadToDeg(sp60.x); - arg0->unk_10C = Math_RadToDeg(sp60.z); - arg0->unk_0C0.y = 0.0f; - if (arg0->unk_1CC == 3) { - arg0->unk_0C0.y = -5.0f; - } - arg0->unk_1D4 = 1; - return 5; - } - return 0; - } - sp78.x = arg0->unk_2E0.x - sp84.x; - sp78.y = arg0->unk_2E0.y - sp84.y; - sp78.z = arg0->unk_2E0.z - sp84.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, &sp54)) { - return 3; - } - sp78.x = arg0->unk_2EC.x - sp84.x; - sp78.y = arg0->unk_2EC.y - sp84.y; - sp78.z = arg0->unk_2EC.z - sp84.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, &sp54)) { - return 4; - } - sp78.x = arg0->unk_2D4.x - sp84.x; - sp78.y = arg0->unk_2D4.y - sp84.y; - sp78.z = arg0->unk_2D4.z - sp84.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, &sp54)) { - return 1; - } - sp78.x = arg0->unk_2C8.x - sp84.x; - sp78.y = arg0->unk_2C8.y - sp84.y; - sp78.z = arg0->unk_2C8.z - sp84.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); - if (func_800A8054(arg1, sp84.x, sp84.y, sp84.z, sp6C.x + sp84.x, sp6C.y + sp84.y, sp6C.z + sp84.z, &sp60, &sp54)) { - return 2; - } - return 0; -} - -void func_800A86E4(Player* arg0) { - s32 i; - Object_6C* var_s0; - s32 sp6C; - - for (i = 0, var_s0 = gObjects6C; i < ARRAY_COUNT(gObjects6C); i++, var_s0++) { - if ((var_s0->obj.status == 2) && ((arg0->unk_1C8 == 3) || (arg0->unk_1C8 == 5)) && (var_s0->unk_4A == 0) && - func_800A7974(arg0, var_s0->unk_1C.unk_0C, &sp6C, var_s0->obj.pos.x, var_s0->obj.pos.y, var_s0->obj.pos.z, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)) { - var_s0->unk_4C = 1; - var_s0->unk_4E = D_801778A0; - } - } -} - -void func_800A8804(Player* arg0, Player* arg1) { - if (arg0->unk_498 == 0) { - func_800A6CD0(arg0, 0, D_800D3000[arg0->unk_1CC][arg1->unk_1CC]); - arg0->unk_288 = arg1->unk_1C4 + 1; - arg1->unk_288 = arg0->unk_1C4 + 1; - } -} - -void func_800A887C(Player* arg0) { - Vec3f sp3C; - - Matrix_Translate(gCalcMatrix, arg0->unk_074, arg0->unk_078, arg0->unk_138, 0); - if (arg0->unk_1CC == 1) { - arg0->unk_10C = 0.0f; - arg0->unk_104 = 0.0f; - - sp3C.x = -40.0f; - sp3C.y = 40.0f; - sp3C.z = 0.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2C8); - sp3C.x = 40.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2D4); - sp3C.x = 0.0f; - sp3C.z = -40.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2E0); - sp3C.z = 40.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2EC); - } - if ((arg0->unk_1CC == 3) || (arg0->unk_1CC == 4)) { - sp3C.x = 20.0f; - sp3C.y = 20.0f; - sp3C.z = 0.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2C8); - sp3C.x = -20.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2D4); - sp3C.x = 0.0f; - sp3C.z = -20.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2E0); - sp3C.z = 20.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2EC); - } - if ((arg0->unk_1CC == 0) || (arg0->unk_1CC == 2)) { - Matrix_RotateY(gCalcMatrix, (arg0->unk_114 + 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -(arg0->unk_0F8 * M_DTOR), 1); - sp3C.y = 0.0f; - sp3C.z = 0.0f; - if (arg0->wings.leftState == 2) { - sp3C.x = 40.0f; - } else { - sp3C.y = -10.0f; - sp3C.x = 30.0f; - } - if (arg0->unk_1CC == 2) { - sp3C.x = 24.0f; - } - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2C8); - if (arg0->wings.rightState == 2) { - sp3C.x = -40.0f; - } else { - sp3C.x = -30.0f; - } - if (arg0->unk_1CC == 2) { - sp3C.x = -24.0f; - } - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2D4); - sp3C.x = 0.0f; - sp3C.y = 24.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2E0); - sp3C.y = -24.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &arg0->unk_2EC); - } -} - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800A8BA4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AA800.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AB2AC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AB304.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AB334.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AB964.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800ABA08.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800ABAB4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AC290.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AC650.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800ACA40.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800ACABC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800ACC7C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800ACDC0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AD094.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AD118.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AD1F4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AD7F0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800ADA28.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800ADD98.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800ADF58.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AE278.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AE4A4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AECAC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AF07C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800AF928.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B00C0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B0194.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B0F50.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B2130.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B22C0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B2574.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B2BE0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B2C00.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B3010.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B3314.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B39E0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B40AC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B415C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B41E0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B41EC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B42B0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B44C4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B46F8.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B48BC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B56BC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B5D30.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B5FBC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B63BC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B6848.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B6BFC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B6F50.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B7184.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B71E4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B73E0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B79B0.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B832C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B852C.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B86A4.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/func_800B86CC.s") - -#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_A4B50/D_800D82F0.s") diff --git a/src/main/sf_hud.c b/src/main/sf_hud.c index ce4ac222..d3f7c432 100644 --- a/src/main/sf_hud.c +++ b/src/main/sf_hud.c @@ -12,7 +12,7 @@ void func_80084930(f32 arg0, f32 arg1, s32 arg2) { D_3000080, D_3000080, }; - Player* temp; + Player* player; s32 var_t0; s32 var_v0; s32 i; @@ -20,10 +20,10 @@ void func_80084930(f32 arg0, f32 arg1, s32 arg2) { RCP_SetupDL(&gMasterDisp, 0x4E); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - temp = gPlayer; + player = gPlayer; var_t0 = 0; - switch (temp->unk_1CC) { + switch (player->unk_1CC) { case 0: var_t0 = 0; break; @@ -79,7 +79,8 @@ void func_80084B94(s32 arg0) { RCP_SetupDL(&gMasterDisp, 0x24); if (arg0 == 0) { for (i = 1; i < 4; i++) { - if (((D_801778B0[i] != 0) || (gPlayer[0].unk_1C8 != 7)) && (D_801778B0[i] <= 0) && (D_801778B0[i] != -2)) { + if (((gTeamHealth[i] != 0) || (gPlayer[0].unk_1C8 != 7)) && (gTeamHealth[i] <= 0) && + (gTeamHealth[i] != -2)) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_800D1A70[i - 1].x, D_800D1A70[i - 1].y, D_800D1A70[i - 1].z, 1); Matrix_Scale(gGfxMatrix, 0.68f, 0.68f, 1.0f, 1); @@ -402,7 +403,7 @@ void func_800884E4(void) { var_v1 = 0xFF0000; for (i = 0; i < 3; i++) { - if (D_801778B0[3 - i] <= 0) { + if (gTeamHealth[3 - i] <= 0) { D_80177B50[D_80177B48] ^= var_v1; } else { D_80177B50[D_80177B48] |= var_v1; @@ -428,7 +429,7 @@ void func_8008865C(void) { s32 func_800886B8(void) { s32 var_v1 = 0; - f32 var_fv1 = D_8017797C->stick_y; // related to the vertical height of the arwing + f32 var_fv1 = gChngInputPtr->stick_y; // related to the vertical height of the arwing if ((var_fv1 != 0.0f) && (D_80161810[4] != 0)) { return 0; @@ -704,26 +705,26 @@ void func_80089E98(s32 arg0) { #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_8008A4DC.s") s32 func_8008AC54(s32 arg0) { - Object_2F4* var_a1; + Object_2F4* obj2F4; s32 i; s32 ret = 0; - for (i = 0, var_a1 = gObjects2F4; i < 60; i++, var_a1++) { + for (i = 0, obj2F4 = gObjects2F4; i < 60; i++, obj2F4++) { switch (arg0) { case 0: - if ((var_a1->obj.status == 2) && (var_a1->obj.id == OBJECT_190)) { + if ((obj2F4->obj.status == 2) && (obj2F4->obj.id == OBJECT_190)) { ret++; } break; case 1: - if ((var_a1->obj.status == 2) && (var_a1->obj.id == OBJECT_191)) { + if ((obj2F4->obj.status == 2) && (obj2F4->obj.id == OBJECT_191)) { ret++; } break; case 2: - if (((var_a1->obj.id == OBJECT_190) || (var_a1->obj.id == OBJECT_191)) && (var_a1->obj.status == 2)) { + if (((obj2F4->obj.id == OBJECT_190) || (obj2F4->obj.id == OBJECT_191)) && (obj2F4->obj.status == 2)) { ret++; } break; @@ -1320,7 +1321,7 @@ void func_8008DE68(void) { f32 temp7; f32 var_fv0; - if ((D_80161734 == 1) && (D_801778B0[2] > 0)) { + if ((D_80161734 == 1) && (gTeamHealth[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; @@ -1597,179 +1598,181 @@ void func_8008F96C(void) { #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_80090200.s") -void func_800907C4(Object_408* arg0) { - switch (arg0->unk_04E) { +void func_800907C4(Object_408* obj408) { + switch (obj408->unk_04E) { case 0: - if ((arg0->unk_0DC == 255.0f) && (arg0->unk_0E0 == 212.0f)) { - arg0->unk_04E = 1; + if ((obj408->unk_0DC == 255.0f) && (obj408->unk_0E0 == 212.0f)) { + obj408->unk_04E = 1; } else { - Math_SmoothStepToF(&arg0->unk_0DC, 255.0f, 0.3f, 6.0f, 6.0f); - Math_SmoothStepToF(&arg0->unk_0E0, 212.0f, 0.3f, 4.98f, 4.98f); + Math_SmoothStepToF(&obj408->unk_0DC, 255.0f, 0.3f, 6.0f, 6.0f); + Math_SmoothStepToF(&obj408->unk_0E0, 212.0f, 0.3f, 4.98f, 4.98f); } break; case 1: - if ((arg0->unk_0DC == 28.0f) && (arg0->unk_0E0 == 23.0f)) { - arg0->unk_04E = 0; + if ((obj408->unk_0DC == 28.0f) && (obj408->unk_0E0 == 23.0f)) { + obj408->unk_04E = 0; } else { - Math_SmoothStepToF(&arg0->unk_0DC, 28.0f, 0.3f, 6.0f, 6.0f); - Math_SmoothStepToF(&arg0->unk_0E0, 23.0f, 0.3f, 4.98f, 4.98f); + Math_SmoothStepToF(&obj408->unk_0DC, 28.0f, 0.3f, 6.0f, 6.0f); + Math_SmoothStepToF(&obj408->unk_0E0, 23.0f, 0.3f, 4.98f, 4.98f); } break; } - func_8008FFF0(arg0, D_8015F928); + func_8008FFF0(obj408, D_8015F928); } -s32 func_8009092C(Object_2F4* arg0) { +s32 func_8009092C(Object_2F4* obj2F4) { bool var_s5 = false; - Object_408* var_s1; + Object_408* obj408; s32 i = 0; - if (arg0->unk_0E6 != 0) { + if (obj2F4->unk_0E6 != 0) { return true; } - var_s1 = &gObjects408[1]; + obj408 = &gObjects408[1]; - for (i = 1; i < 4; i++, var_s1++) { - if (var_s1->obj.status == 2) { + for (i = 1; i < 4; i++, obj408++) { + if (obj408->obj.status == 2) { var_s5 = true; - if (arg0->unk_0E6 == 0) { - arg0->unk_0E6 = i; + if (obj2F4->unk_0E6 == 0) { + obj2F4->unk_0E6 = i; } else if (Rand_ZeroOne() > 0.4f) { - arg0->unk_0E6 = i; + obj2F4->unk_0E6 = i; } - arg0->unk_0B8 = 0; + obj2F4->unk_0B8 = 0; } } return var_s5; } -s32 func_80090A00(Object_2F4* arg0) { - switch (arg0->unk_064) { +s32 func_80090A00(Object_2F4* obj2F4) { + switch (obj2F4->unk_064) { case 0: - arg0->unk_134 = 0.0f; - arg0->unk_130 = 360.0f; - arg0->unk_0BC = 8; - arg0->unk_0F4.y = 100.0f; - arg0->unk_0F4.x = 300.0f; - arg0->unk_060 = 1; - arg0->unk_064 = 1; + obj2F4->unk_134 = 0.0f; + obj2F4->unk_130 = 360.0f; + obj2F4->unk_0BC = 8; + obj2F4->unk_0F4.y = 100.0f; + obj2F4->unk_0F4.x = 300.0f; + obj2F4->unk_060 = 1; + obj2F4->unk_064 = 1; case 1: - if (arg0->unk_0BC == 0.0f) { - arg0->unk_118 = 20.0f; - arg0->unk_120 = 3.6f; - arg0->unk_058 = 0; - arg0->unk_05C = 36; - arg0->unk_064 = 2; + if (obj2F4->unk_0BC == 0.0f) { + obj2F4->unk_118 = 20.0f; + obj2F4->unk_120 = 3.6f; + obj2F4->unk_058 = 0; + obj2F4->unk_05C = 36; + obj2F4->unk_064 = 2; } else { - arg0->obj.pos.y -= 8.0f; + obj2F4->obj.pos.y -= 8.0f; break; } case 2: - arg0->unk_124.x = gObjects408[0].obj.pos.x + 1000.0f; - arg0->unk_124.y = 300.0f; - arg0->unk_124.z = arg0->obj.pos.z - 10000.0f; - arg0->unk_058++; - if (arg0->unk_05C == arg0->unk_058) { - arg0->unk_064 = 3; - arg0->unk_05C = 40; - arg0->unk_058 = 0; - } else if (arg0->unk_058 == 6) { - arg0->unk_054 = 1; + obj2F4->unk_124.x = gObjects408[0].obj.pos.x + 1000.0f; + obj2F4->unk_124.y = 300.0f; + obj2F4->unk_124.z = obj2F4->obj.pos.z - 10000.0f; + obj2F4->unk_058++; + if (obj2F4->unk_05C == obj2F4->unk_058) { + obj2F4->unk_064 = 3; + obj2F4->unk_05C = 40; + obj2F4->unk_058 = 0; + } else if (obj2F4->unk_058 == 6) { + obj2F4->unk_054 = 1; } break; case 3: - arg0->unk_124.x = gObjects408[0].obj.pos.x - 1000.0f; - arg0->unk_124.y = 400.0f; - arg0->unk_124.z = gObjects408[0].obj.pos.z; - arg0->unk_058++; - if (arg0->unk_05C == arg0->unk_058) { - arg0->unk_064 = 4; - } else if (arg0->unk_058 == 20) { - arg0->unk_118 = 30.0f; + obj2F4->unk_124.x = gObjects408[0].obj.pos.x - 1000.0f; + obj2F4->unk_124.y = 400.0f; + obj2F4->unk_124.z = gObjects408[0].obj.pos.z; + obj2F4->unk_058++; + if (obj2F4->unk_05C == obj2F4->unk_058) { + obj2F4->unk_064 = 4; + } else if (obj2F4->unk_058 == 20) { + obj2F4->unk_118 = 30.0f; } break; case 4: - arg0->unk_124.z = gPlayer[0].unk_138; - arg0->unk_124.y = 100.0f; - arg0->unk_124.x = gPlayer[0].unk_074; - if ((fabsf(arg0->obj.pos.x - gPlayer[0].unk_074) < 300.0f) && - (fabsf(arg0->obj.pos.z - gPlayer[0].unk_138) < 300.0f)) { - arg0->unk_064 = 5; - arg0->unk_05C = 20; - arg0->unk_058 = 0; + obj2F4->unk_124.z = gPlayer[0].unk_138; + obj2F4->unk_124.y = 100.0f; + obj2F4->unk_124.x = gPlayer[0].unk_074; + if ((fabsf(obj2F4->obj.pos.x - gPlayer[0].unk_074) < 300.0f) && + (fabsf(obj2F4->obj.pos.z - gPlayer[0].unk_138) < 300.0f)) { + obj2F4->unk_064 = 5; + obj2F4->unk_05C = 20; + obj2F4->unk_058 = 0; } break; case 5: - arg0->unk_124.z = gPlayer[0].unk_138 + 1000.0f; - arg0->unk_124.y = 1000.0f; - arg0->unk_124.x = gPlayer[0].unk_074 - 1000.0f; - arg0->unk_058++; - if (arg0->unk_05C == arg0->unk_058) { - Object_Kill(&arg0->obj, &arg0->unk_100); + obj2F4->unk_124.z = gPlayer[0].unk_138 + 1000.0f; + obj2F4->unk_124.y = 1000.0f; + obj2F4->unk_124.x = gPlayer[0].unk_074 - 1000.0f; + obj2F4->unk_058++; + if (obj2F4->unk_05C == obj2F4->unk_058) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } break; } return false; } -s32 func_80090CCC(Object_2F4* arg0) { +s32 func_80090CCC(Object_2F4* obj2F4) { s32 ret = 0; - if (func_8009092C(arg0) != 0) { - arg0->unk_124.z = gObjects408[arg0->unk_0E6].obj.pos.z; - arg0->unk_124.y = gObjects408[arg0->unk_0E6].obj.pos.y; - arg0->unk_124.x = gObjects408[arg0->unk_0E6].obj.pos.x; + if (func_8009092C(obj2F4) != 0) { + obj2F4->unk_124.z = gObjects408[obj2F4->unk_0E6].obj.pos.z; + obj2F4->unk_124.y = gObjects408[obj2F4->unk_0E6].obj.pos.y; + obj2F4->unk_124.x = gObjects408[obj2F4->unk_0E6].obj.pos.x; } else { - arg0->unk_124.z = gObjects408[0].obj.pos.z; - arg0->unk_124.y = gObjects408[0].obj.pos.y; - arg0->unk_124.x = gObjects408[0].obj.pos.x; + obj2F4->unk_124.z = gObjects408[0].obj.pos.z; + obj2F4->unk_124.y = gObjects408[0].obj.pos.y; + obj2F4->unk_124.x = gObjects408[0].obj.pos.x; } - if ((fabsf(arg0->obj.pos.x - arg0->unk_124.x) < 2000.0f) && (fabsf(arg0->obj.pos.z - arg0->unk_124.z) < 2000.0f)) { - arg0->unk_068++; - if (arg0->unk_068 >= 9) { - arg0->unk_050 = 1; - arg0->unk_068 = 0; + if ((fabsf(obj2F4->obj.pos.x - obj2F4->unk_124.x) < 2000.0f) && + (fabsf(obj2F4->obj.pos.z - obj2F4->unk_124.z) < 2000.0f)) { + obj2F4->unk_068++; + if (obj2F4->unk_068 >= 9) { + obj2F4->unk_050 = 1; + obj2F4->unk_068 = 0; } } - if ((fabsf(arg0->obj.pos.x - arg0->unk_124.x) < 700.0f) && (fabsf(arg0->obj.pos.x - arg0->unk_124.x) < 700.0f)) { - arg0->unk_0B8 = 1; - arg0->unk_068 = 0; + if ((fabsf(obj2F4->obj.pos.x - obj2F4->unk_124.x) < 700.0f) && + (fabsf(obj2F4->obj.pos.x - obj2F4->unk_124.x) < 700.0f)) { + obj2F4->unk_0B8 = 1; + obj2F4->unk_068 = 0; ret = 1; } - if (arg0->unk_0BE == 0) { - arg0->unk_0BE = (s32) (Rand_ZeroOne() * 200.0f) + 200; - arg0->unk_13C = 30.0f; + if (obj2F4->unk_0BE == 0) { + obj2F4->unk_0BE = (s32) (Rand_ZeroOne() * 200.0f) + 200; + obj2F4->unk_13C = 30.0f; } - if (gObjects408[arg0->unk_0E6].obj.status == 0) { - arg0->unk_0B8 = 1; - arg0->unk_0E6 = 0; - arg0->unk_068 = 0; + if (gObjects408[obj2F4->unk_0E6].obj.status == 0) { + obj2F4->unk_0B8 = 1; + obj2F4->unk_0E6 = 0; + obj2F4->unk_068 = 0; ret = 1; } return ret; } -s32 func_80090E8C(Object_2F4* arg0) { +s32 func_80090E8C(Object_2F4* obj2F4) { f32 x; f32 y; f32 z; f32 var_fv1_2; - if (arg0->unk_0BC == 0) { + if (obj2F4->unk_0BC == 0) { if (gLevelType == 1) { x = (Rand_ZeroOne() - 0.5f) * 20000.0f; y = (Rand_ZeroOne() - 0.5f) * 5000.0f; @@ -1780,94 +1783,96 @@ s32 func_80090E8C(Object_2F4* arg0) { z = (Rand_ZeroOne() - 0.5f) * 10000.0f; } - if ((fabsf(arg0->obj.pos.x - x) > 2000.0f) && (fabsf(arg0->obj.pos.z - z) > 2000.0f)) { - arg0->unk_124.x = x; - arg0->unk_124.y = y; - arg0->unk_124.z = z; - arg0->unk_0BC = (s32) (Rand_ZeroOne() * 20.0f) + 10; + if ((fabsf(obj2F4->obj.pos.x - x) > 2000.0f) && (fabsf(obj2F4->obj.pos.z - z) > 2000.0f)) { + obj2F4->unk_124.x = x; + obj2F4->unk_124.y = y; + obj2F4->unk_124.z = z; + obj2F4->unk_0BC = (s32) (Rand_ZeroOne() * 20.0f) + 10; } } - if (arg0->unk_0E4 == 1) { + if (obj2F4->unk_0E4 == 1) { var_fv1_2 = 3000.0f; } else { var_fv1_2 = 5000.0f; } - if ((var_fv1_2 < fabsf(arg0->obj.pos.x - gObjects408->obj.pos.x)) && - (var_fv1_2 < fabsf(arg0->obj.pos.z - gObjects408->obj.pos.z))) { - arg0->unk_0B8 = 0; + if ((var_fv1_2 < fabsf(obj2F4->obj.pos.x - gObjects408->obj.pos.x)) && + (var_fv1_2 < fabsf(obj2F4->obj.pos.z - gObjects408->obj.pos.z))) { + obj2F4->unk_0B8 = 0; } - if (arg0->unk_0BE == 0) { - arg0->unk_0BE = (s32) (Rand_ZeroOne() * 200.0f) + 200; - arg0->unk_13C = 30.0f; + if (obj2F4->unk_0BE == 0) { + obj2F4->unk_0BE = (s32) (Rand_ZeroOne() * 200.0f) + 200; + obj2F4->unk_13C = 30.0f; } return false; } -s32 func_800910C0(Object_2F4* arg0) { +s32 func_800910C0(Object_2F4* obj2F4) { f32 var_fv1; - if (arg0->unk_0BC == 0) { - arg0->unk_2DC.x = (Rand_ZeroOne() - 0.5f) * 2000.0f; - arg0->unk_2DC.y = (Rand_ZeroOne() * 1000.0f) + 200.0f; - arg0->unk_2DC.z = (Rand_ZeroOne() - 0.5f) * 2000.0f; - arg0->unk_0BC = (s32) (Rand_ZeroOne() * 20.0f) + 10; + if (obj2F4->unk_0BC == 0) { + obj2F4->unk_2DC.x = (Rand_ZeroOne() - 0.5f) * 2000.0f; + obj2F4->unk_2DC.y = (Rand_ZeroOne() * 1000.0f) + 200.0f; + obj2F4->unk_2DC.z = (Rand_ZeroOne() - 0.5f) * 2000.0f; + obj2F4->unk_0BC = (s32) (Rand_ZeroOne() * 20.0f) + 10; } - arg0->unk_124.x = arg0->unk_2DC.x + gObjects408->obj.pos.x; - arg0->unk_124.y = arg0->unk_2DC.y; - arg0->unk_124.z = arg0->unk_2DC.z + gObjects408->obj.pos.z; + obj2F4->unk_124.x = obj2F4->unk_2DC.x + gObjects408->obj.pos.x; + obj2F4->unk_124.y = obj2F4->unk_2DC.y; + obj2F4->unk_124.z = obj2F4->unk_2DC.z + gObjects408->obj.pos.z; - if (arg0->unk_0E4 == 1) { + if (obj2F4->unk_0E4 == 1) { var_fv1 = 1500.0f; } else { var_fv1 = 3000.0f; } - if ((var_fv1 < fabsf(arg0->obj.pos.x - arg0->unk_124.x)) && (var_fv1 < fabsf(arg0->obj.pos.z - arg0->unk_124.z))) { - arg0->unk_0B8 = 0; + if ((var_fv1 < fabsf(obj2F4->obj.pos.x - obj2F4->unk_124.x)) && + (var_fv1 < fabsf(obj2F4->obj.pos.z - obj2F4->unk_124.z))) { + obj2F4->unk_0B8 = 0; } - if (arg0->unk_0BE == 0) { - arg0->unk_0BE = (s32) (Rand_ZeroOne() * 200.0f) + 200; - arg0->unk_13C = 30.0f; + if (obj2F4->unk_0BE == 0) { + obj2F4->unk_0BE = (s32) (Rand_ZeroOne() * 200.0f) + 200; + obj2F4->unk_13C = 30.0f; } return false; } -void func_80091254(Object_2F4* arg0) { +void func_80091254(Object_2F4* obj2F4) { if (D_80177880 == 1) { - func_80090E8C(arg0); + func_80090E8C(obj2F4); } else { - func_800910C0(arg0); + func_800910C0(obj2F4); } } -s32 func_80091298(Object_2F4* arg0) { - arg0->unk_118 = gPlayer[0].unk_0D0 + 10.0f; - arg0->unk_120 = 3.6f; - arg0->unk_124.x = gPlayer[0].unk_074 + ((f32) (arg0->unk_0E4 - 2) * 700.0f); - arg0->unk_124.y = gPlayer[0].unk_078; - arg0->unk_124.z = gPlayer[0].unk_138; +s32 func_80091298(Object_2F4* obj2F4) { + obj2F4->unk_118 = gPlayer[0].unk_0D0 + 10.0f; + obj2F4->unk_120 = 3.6f; + obj2F4->unk_124.x = gPlayer[0].unk_074 + ((f32) (obj2F4->unk_0E4 - 2) * 700.0f); + obj2F4->unk_124.y = gPlayer[0].unk_078; + obj2F4->unk_124.z = gPlayer[0].unk_138; - if ((fabsf(arg0->obj.pos.x - arg0->unk_124.x) < 700.0f) || (fabsf(arg0->obj.pos.z - arg0->unk_124.z) < 700.0f)) { - arg0->unk_118 = gPlayer[0].unk_0D0 - 10.0f; - arg0->unk_120 = 1.2f; + if ((fabsf(obj2F4->obj.pos.x - obj2F4->unk_124.x) < 700.0f) || + (fabsf(obj2F4->obj.pos.z - obj2F4->unk_124.z) < 700.0f)) { + obj2F4->unk_118 = gPlayer[0].unk_0D0 - 10.0f; + obj2F4->unk_120 = 1.2f; } return false; } -s32 func_80091368(Object_2F4* arg0) { - switch (arg0->unk_064) { +s32 func_80091368(Object_2F4* obj2F4) { + switch (obj2F4->unk_064) { case 0: - arg0->unk_124.y = 20000.0f; - arg0->unk_054 = 1; - arg0->unk_064 = 1; - D_801778B0[arg0->unk_0E4] = 1; + obj2F4->unk_124.y = 20000.0f; + obj2F4->unk_054 = 1; + obj2F4->unk_064 = 1; + gTeamHealth[obj2F4->unk_0E4] = 1; - switch (arg0->unk_0E4) { + switch (obj2F4->unk_0E4) { case 1: func_800BA808(gMsg_ID_20220, RCID_FALCO); break; @@ -1880,67 +1885,67 @@ s32 func_80091368(Object_2F4* arg0) { func_800BA808(gMsg_ID_20222, RCID_SLIPPY); break; } - D_801778B0[arg0->unk_0E4] = -1; + gTeamHealth[obj2F4->unk_0E4] = -1; break; case 1: - if (arg0->unk_188 < 2.0f) { - arg0->unk_188 = 2.0f; + if (obj2F4->unk_188 < 2.0f) { + obj2F4->unk_188 = 2.0f; } - if (arg0->unk_0BC == 0) { - arg0->unk_0BC = (s32) (Rand_ZeroOne() * 20.0f) + 30; - arg0->unk_130 = 360.0f; - arg0->unk_134 = 0.0f; + if (obj2F4->unk_0BC == 0) { + obj2F4->unk_0BC = (s32) (Rand_ZeroOne() * 20.0f) + 30; + obj2F4->unk_130 = 360.0f; + obj2F4->unk_134 = 0.0f; } - if (arg0->obj.pos.y > 3000.0f) { - Object_Kill(&arg0->obj, &arg0->unk_100); + if (obj2F4->obj.pos.y > 3000.0f) { + Object_Kill(&obj2F4->obj, &obj2F4->sfxPos); } break; } return false; } -void func_800914FC(Object_2F4* arg0) { - switch (arg0->unk_0B8) { +void func_800914FC(Object_2F4* obj2F4) { + switch (obj2F4->unk_0B8) { case 0: - if (func_80090CCC(arg0) == 0) { + if (func_80090CCC(obj2F4) == 0) { break; } case 1: - func_80091254(arg0); + func_80091254(obj2F4); break; case 2: - func_80091298(arg0); + func_80091298(obj2F4); break; case 3: - func_80091368(arg0); + func_80091368(obj2F4); break; case 7: - func_80090A00(arg0); + func_80090A00(obj2F4); break; } - if ((D_801778B0[arg0->unk_0E4] <= 0) && (arg0->unk_0B8 != 3)) { - arg0->unk_064 = 0; - arg0->unk_0B8 = 3; + if ((gTeamHealth[obj2F4->unk_0E4] <= 0) && (obj2F4->unk_0B8 != 3)) { + obj2F4->unk_064 = 0; + obj2F4->unk_0B8 = 3; } if (gPlayer[0].unk_1C8 == 7) { - if ((arg0->unk_0B8 != 2) && (arg0->unk_0B8 != 3)) { - arg0->unk_060 = 1; - arg0->unk_0B8 = 2; + if ((obj2F4->unk_0B8 != 2) && (obj2F4->unk_0B8 != 3)) { + obj2F4->unk_060 = 1; + obj2F4->unk_0B8 = 2; } } } #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_800915FC.s") -s32 func_80091864(Object_2F4* arg0) { +s32 func_80091864(Object_2F4* obj2F4) { f32 sp44; f32 sp40; f32 sp3C; @@ -1950,25 +1955,25 @@ s32 func_80091864(Object_2F4* arg0) { f32 sp2C; f32 sp28; - x = arg0->unk_124.x - arg0->obj.pos.x; - y = arg0->unk_124.y - arg0->obj.pos.y; - z = arg0->unk_124.z - arg0->obj.pos.z; + x = obj2F4->unk_124.x - obj2F4->obj.pos.x; + y = obj2F4->unk_124.y - obj2F4->obj.pos.y; + z = obj2F4->unk_124.z - obj2F4->obj.pos.z; sp40 = Math_RadToDeg(Math_Atan2F(x, z)); sp44 = Math_RadToDeg(Math_Atan2F(y, sqrtf(SQ(x) + SQ(z)))); - if ((func_800915FC(arg0) != 0) && (arg0->unk_060 == 0)) { + if ((func_800915FC(obj2F4) != 0) && (obj2F4->unk_060 == 0)) { sp44 += 40.0f; if (sp44 >= 360.0f) { sp44 -= 360.0f; - } else if ((arg0->obj.pos.y < (D_80177940 + 50.0f)) && (gLevelType == 0) && (sp44 > 180.0f)) { + } else if ((obj2F4->obj.pos.y < (D_80177940 + 50.0f)) && (gLevelType == 0) && (sp44 > 180.0f)) { sp44 = 0.0f; } - arg0->unk_050 = 0; + obj2F4->unk_050 = 0; } - sp3C = Math_SmoothStepToAngle(&arg0->unk_0F4.y, sp40, 0.5f, arg0->unk_11C, 0.001f) * 30.0f; - Math_SmoothStepToAngle(&arg0->unk_0F4.x, sp44, 0.5f, arg0->unk_11C, 0.0001f); + sp3C = Math_SmoothStepToAngle(&obj2F4->unk_0F4.y, sp40, 0.5f, obj2F4->unk_11C, 0.001f) * 30.0f; + Math_SmoothStepToAngle(&obj2F4->unk_0F4.x, sp44, 0.5f, obj2F4->unk_11C, 0.0001f); sp2C = sp28 = 0.0f; if (sp3C < 0.0f) { @@ -1977,10 +1982,10 @@ s32 func_80091864(Object_2F4* arg0) { sp28 = sp3C; } - Math_SmoothStepToF(&arg0->unk_150, sp2C, 0.2f, 30.0f, 0.00f); - Math_SmoothStepToF(&arg0->unk_17C, -sp2C, 0.2f, 30.0f, 0.00f); - Math_SmoothStepToF(&arg0->unk_154, sp28, 0.2f, 30.0f, 0.00f); - Math_SmoothStepToF(&arg0->unk_180, -sp28, 0.2f, 30.0f, 0.00f); + Math_SmoothStepToF(&obj2F4->unk_150, sp2C, 0.2f, 30.0f, 0.00f); + Math_SmoothStepToF(&obj2F4->unk_17C, -sp2C, 0.2f, 30.0f, 0.00f); + Math_SmoothStepToF(&obj2F4->unk_154, sp28, 0.2f, 30.0f, 0.00f); + Math_SmoothStepToF(&obj2F4->unk_180, -sp28, 0.2f, 30.0f, 0.00f); if (sp3C < 0.0f) { sp3C *= -1.0f; @@ -1988,101 +1993,101 @@ s32 func_80091864(Object_2F4* arg0) { sp3C = 360.0f - sp3C; } - Math_SmoothStepToF(&arg0->unk_130, arg0->unk_134, 0.2f, 30.0f, 0.0001f); + Math_SmoothStepToF(&obj2F4->unk_130, obj2F4->unk_134, 0.2f, 30.0f, 0.0001f); - if ((arg0->unk_130 > 0.01f) && (arg0->unk_130 < 359.9f)) { - Math_SmoothStepToAngle(&arg0->obj.rot.z, arg0->unk_130, 0.2f, 100.0f, 0.01f); + if ((obj2F4->unk_130 > 0.01f) && (obj2F4->unk_130 < 359.9f)) { + Math_SmoothStepToAngle(&obj2F4->obj.rot.z, obj2F4->unk_130, 0.2f, 100.0f, 0.01f); } else { - Math_SmoothStepToAngle(&arg0->obj.rot.z, sp3C, 0.1f, 3.0f, 0.01f); + Math_SmoothStepToAngle(&obj2F4->obj.rot.z, sp3C, 0.1f, 3.0f, 0.01f); } return false; } -s32 func_80091B90(Object_2F4* arg0) { +s32 func_80091B90(Object_2F4* obj2F4) { Vec3f vec; - arg0->obj.rot.x = -arg0->unk_0F4.x; - arg0->obj.rot.y = arg0->unk_0F4.y; + obj2F4->obj.rot.x = -obj2F4->unk_0F4.x; + obj2F4->obj.rot.y = obj2F4->unk_0F4.y; - Math_SmoothStepToF(&arg0->unk_114, arg0->unk_118, 0.2f, 1.0f, 0.0f); - Math_SmoothStepToF(&arg0->unk_11C, arg0->unk_120, 1.0f, 1.0f, 0.0f); + Math_SmoothStepToF(&obj2F4->unk_114, obj2F4->unk_118, 0.2f, 1.0f, 0.0f); + Math_SmoothStepToF(&obj2F4->unk_11C, obj2F4->unk_120, 1.0f, 1.0f, 0.0f); - Math_Vec3fFromAngles(&vec, arg0->obj.rot.x, arg0->obj.rot.y, arg0->unk_138 + arg0->unk_114); + Math_Vec3fFromAngles(&vec, obj2F4->obj.rot.x, obj2F4->obj.rot.y, obj2F4->unk_138 + obj2F4->unk_114); - arg0->unk_0E8.y = arg0->unk_14C + vec.y; - arg0->unk_0E8.x = arg0->unk_148 + vec.x; - arg0->unk_0E8.z = arg0->unk_144 + vec.z; + obj2F4->unk_0E8.y = obj2F4->unk_14C + vec.y; + obj2F4->unk_0E8.x = obj2F4->unk_148 + vec.x; + obj2F4->unk_0E8.z = obj2F4->unk_144 + vec.z; - arg0->unk_148 -= arg0->unk_148 * 0.1f; - arg0->unk_14C -= arg0->unk_14C * 0.1f; - arg0->unk_144 -= arg0->unk_144 * 0.1f; + obj2F4->unk_148 -= obj2F4->unk_148 * 0.1f; + obj2F4->unk_14C -= obj2F4->unk_14C * 0.1f; + obj2F4->unk_144 -= obj2F4->unk_144 * 0.1f; - if ((arg0->obj.pos.y < D_80177940 + 40.0f) && (arg0->unk_0E8.y < 0.0f) && (gLevelType == 0)) { - arg0->obj.pos.y = D_80177940 + 40.0f; - arg0->unk_0E8.y = 0.0f; + if ((obj2F4->obj.pos.y < D_80177940 + 40.0f) && (obj2F4->unk_0E8.y < 0.0f) && (gLevelType == 0)) { + obj2F4->obj.pos.y = D_80177940 + 40.0f; + obj2F4->unk_0E8.y = 0.0f; } - arg0->unk_0E8.z -= D_80177D08; + obj2F4->unk_0E8.z -= D_80177D08; return false; } -s32 func_80091CF8(Object_2F4* arg0) { - if (arg0->unk_054 != 0) { - if (arg0->unk_13C < 0.1f) { - arg0->unk_13C = 20.0f; - func_80019218(0x09000002, &arg0->unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - arg0->unk_188 = 5.0f; +s32 func_80091CF8(Object_2F4* obj2F4) { + if (obj2F4->unk_054 != 0) { + if (obj2F4->unk_13C < 0.1f) { + obj2F4->unk_13C = 20.0f; + func_80019218(0x09000002, &obj2F4->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + obj2F4->unk_188 = 5.0f; } - arg0->unk_054 = 0; + obj2F4->unk_054 = 0; } - Math_SmoothStepToF(&arg0->unk_13C, 0.0f, 0.1f, 0.2f, 0.0f); - Math_SmoothStepToF(&arg0->unk_138, arg0->unk_13C, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToF(&obj2F4->unk_13C, 0.0f, 0.1f, 0.2f, 0.0f); + Math_SmoothStepToF(&obj2F4->unk_138, obj2F4->unk_13C, 0.1f, 2.0f, 0.0f); - if (arg0->unk_13C < 0.1f) { - arg0->unk_07C = 1; + if (obj2F4->unk_13C < 0.1f) { + obj2F4->unk_07C = 1; } return false; } -s32 func_80091DF4(Object_2F4* arg0) { +s32 func_80091DF4(Object_2F4* obj2F4) { Vec3f sp44; Vec3f sp38; - if ((arg0->unk_050 != 0) && (D_80177848 > 70)) { - arg0->unk_050 = 0; + if ((obj2F4->unk_050 != 0) && (D_80177848 > 70)) { + obj2F4->unk_050 = 0; sp44.x = 0.0f; sp44.y = 0.0f; sp44.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - func_8006EEFC(arg0->unk_0E4, arg0->obj.pos.x + (sp38.x * 1.5), arg0->obj.pos.y + (sp38.y * 1.5), - arg0->obj.pos.z + (sp38.z * 1.5), sp38.x, sp38.y, sp38.z, arg0->obj.rot.x, arg0->obj.rot.y, - arg0->obj.rot.z); + func_8006EEFC(obj2F4->unk_0E4, obj2F4->obj.pos.x + (sp38.x * 1.5), obj2F4->obj.pos.y + (sp38.y * 1.5), + obj2F4->obj.pos.z + (sp38.z * 1.5), sp38.x, sp38.y, sp38.z, obj2F4->obj.rot.x, obj2F4->obj.rot.y, + obj2F4->obj.rot.z); } return false; } -s32 func_80091F00(Object_2F4* arg0) { - u8 temp_v0 = arg0->unk_0D0; +s32 func_80091F00(Object_2F4* obj2F4) { + u8 temp_v0 = obj2F4->unk_0D0; Vec3f sp40; Vec3f sp34; - arg0->unk_0D0 = 0; + obj2F4->unk_0D0 = 0; - if ((arg0->unk_0B8 == 3) || (temp_v0 == 2)) { + if ((obj2F4->unk_0B8 == 3) || (temp_v0 == 2)) { return false; } - arg0->unk_0CE -= arg0->unk_0D6; - if (arg0->unk_0CE <= 0) { - arg0->unk_0CE = -1; + obj2F4->unk_0CE -= obj2F4->unk_0D6; + if (obj2F4->unk_0CE <= 0) { + obj2F4->unk_0CE = -1; } - arg0->unk_0C6 = 20; + obj2F4->unk_0C6 = 20; - func_80019218(0x2903300E, &arg0->unk_100, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); - func_8007D10C(arg0->obj.pos.x, arg0->obj.pos.y, arg0->obj.pos.z, 1.5f); - Matrix_RotateY(gCalcMatrix, arg0->unk_0F4.y * M_DTOR, 0); + func_80019218(0x2903300E, &obj2F4->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + func_8007D10C(obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 1.5f); + Matrix_RotateY(gCalcMatrix, obj2F4->unk_0F4.y * M_DTOR, 0); if (Rand_ZeroOne() < 0.5f) { sp40.x = -20.0f; @@ -2095,18 +2100,18 @@ s32 func_80091F00(Object_2F4* arg0) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp40, &sp34); - arg0->unk_148 = sp34.x; - arg0->unk_14C = sp34.y; - arg0->unk_144 = sp34.z; + obj2F4->unk_148 = sp34.x; + obj2F4->unk_14C = sp34.y; + obj2F4->unk_144 = sp34.z; - D_801778B0[arg0->unk_0E4] = arg0->unk_0CE; + gTeamHealth[obj2F4->unk_0E4] = obj2F4->unk_0CE; if (D_8017829C != 0) { return false; } - if ((arg0->unk_0D0 == 3) && (arg0->unk_0D4 == 1)) { - switch (arg0->unk_0E4) { + if ((obj2F4->unk_0D0 == 3) && (obj2F4->unk_0D4 == 1)) { + switch (obj2F4->unk_0E4) { case 1: func_800BA808(gMsg_ID_20210, RCID_FALCO); break; @@ -2119,8 +2124,8 @@ s32 func_80091F00(Object_2F4* arg0) { } } - if ((arg0->unk_0D0 != 3) && (arg0->unk_0D4 == 1)) { - switch (arg0->unk_0E4) { + if ((obj2F4->unk_0D0 != 3) && (obj2F4->unk_0D4 == 1)) { + switch (obj2F4->unk_0E4) { case 1: func_800BA808(gMsg_ID_20060, RCID_FALCO); break; @@ -2133,8 +2138,8 @@ s32 func_80091F00(Object_2F4* arg0) { } } - if ((arg0->unk_0D4 == 2) || (arg0->unk_0D4 == 100)) { - switch (arg0->unk_0E4) { + if ((obj2F4->unk_0D4 == 2) || (obj2F4->unk_0D4 == 100)) { + switch (obj2F4->unk_0E4) { case 1: func_800BA808(gMsg_ID_20030, RCID_FALCO); break; @@ -2146,47 +2151,47 @@ s32 func_80091F00(Object_2F4* arg0) { break; } } - arg0->unk_070 = 20; + obj2F4->unk_070 = 20; return false; } -void func_80092244(Object_2F4* arg0) { - gUnkEntities28[arg0->unk_040].unk_00 = 1; - gUnkEntities28[arg0->unk_040].unk_02 = arg0->unk_0E4; - gUnkEntities28[arg0->unk_040].pos.x = arg0->obj.pos.x; - gUnkEntities28[arg0->unk_040].pos.y = arg0->obj.pos.y; - gUnkEntities28[arg0->unk_040].pos.z = arg0->obj.pos.z; - gUnkEntities28[arg0->unk_040].unk_10 = arg0->unk_0F4.y + 180.0f; +void func_80092244(Object_2F4* obj2F4) { + gUnkEntities28[obj2F4->unk_040].unk_00 = 1; + gUnkEntities28[obj2F4->unk_040].unk_02 = obj2F4->unk_0E4; + gUnkEntities28[obj2F4->unk_040].pos.x = obj2F4->obj.pos.x; + gUnkEntities28[obj2F4->unk_040].pos.y = obj2F4->obj.pos.y; + gUnkEntities28[obj2F4->unk_040].pos.z = obj2F4->obj.pos.z; + gUnkEntities28[obj2F4->unk_040].unk_10 = obj2F4->unk_0F4.y + 180.0f; } -void func_800922F4(Object_2F4* arg0) { +void func_800922F4(Object_2F4* obj2F4) { s32 temp; - if ((D_801778B0[arg0->unk_0E4] < 64) && (gPlayer[0].unk_1C8 != 7)) { + if ((gTeamHealth[obj2F4->unk_0E4] < 64) && (gPlayer[0].unk_1C8 != 7)) { temp = 7; - if (D_801778B0[arg0->unk_0E4] > 16) { + if (gTeamHealth[obj2F4->unk_0E4] > 16) { temp = 15; } - if (D_801778B0[arg0->unk_0E4] > 32) { + if (gTeamHealth[obj2F4->unk_0E4] > 32) { temp = 31; } - if (D_801778B0[arg0->unk_0E4] > 48) { + if (gTeamHealth[obj2F4->unk_0E4] > 48) { temp = 63; } if (!(gFrameCount & temp)) { - func_8007D10C(arg0->obj.pos.x + ((Rand_ZeroOne() - 0.5f) * 10.0f), - arg0->obj.pos.y + (Rand_ZeroOne() * 10.0f), - arg0->obj.pos.z + ((Rand_ZeroOne() - 0.5f) * 10.0f), 2.2f); + func_8007D10C(obj2F4->obj.pos.x + ((Rand_ZeroOne() - 0.5f) * 10.0f), + obj2F4->obj.pos.y + (Rand_ZeroOne() * 10.0f), + obj2F4->obj.pos.z + ((Rand_ZeroOne() - 0.5f) * 10.0f), 2.2f); } if (!((temp >> 2) & gFrameCount)) { if (Rand_ZeroOne() < 0.5f) { - func_8007C120(arg0->obj.pos.x + ((Rand_ZeroOne() - 0.5f) * 30.0f), - arg0->obj.pos.y + (Rand_ZeroOne() * 10.0f), - arg0->obj.pos.z + ((Rand_ZeroOne() - 0.5f) * 30.0f), arg0->unk_0E8.x, arg0->unk_0E8.y, - arg0->unk_0E8.z, arg0->unk_110 * 0.07f, 3); + func_8007C120(obj2F4->obj.pos.x + ((Rand_ZeroOne() - 0.5f) * 30.0f), + obj2F4->obj.pos.y + (Rand_ZeroOne() * 10.0f), + obj2F4->obj.pos.z + ((Rand_ZeroOne() - 0.5f) * 30.0f), obj2F4->unk_0E8.x, + obj2F4->unk_0E8.y, obj2F4->unk_0E8.z, obj2F4->unk_110 * 0.07f, 3); } } } @@ -2213,128 +2218,128 @@ void func_80093310(void) { gObjects2F4->unk_0B6 = 1; if (1) {} this->obj.id = OBJECT_195; - func_800612B8(&this->unk_01C, this->obj.id); - func_80019218(0x11030010, &this->unk_100, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); + Object_Set1C(&this->unk_01C, this->obj.id); + func_80019218(0x11030010, &this->sfxPos, 0, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } void func_800933D8(f32 x, f32 y, f32 z, f32 arg3) { s32 i; - Object_8C* var_s0 = &gObjects8C[ARRAY_COUNT(gObjects8C) - 1]; - Player* sp24 = gPlayer; + Object_8C* obj8C = &gObjects8C[ARRAY_COUNT(gObjects8C) - 1]; + Player* player = gPlayer; for (i = 0; i < 100; i++) { - if (var_s0->obj.status == 0) { - Object_8C_Initialize(var_s0); - var_s0->obj.status = 1; - var_s0->obj.id = OBJECT_363; - var_s0->obj.pos.x = x; - var_s0->obj.pos.y = y; - var_s0->obj.pos.z = z; + if (obj8C->obj.status == 0) { + Object_8C_Initialize(obj8C); + obj8C->obj.status = 1; + obj8C->obj.id = OBJECT_363; + obj8C->obj.pos.x = x; + obj8C->obj.pos.y = y; + obj8C->obj.pos.z = z; - if ((sp24->unk_1C8 == 2) && (gCurrentLevel == LEVEL_AQUAS) && (sp24->unk_1D0 < 2)) { - var_s0->unk_6C = 0.4f; - var_s0->unk_44 = 0; - var_s0->unk_46 = 24; - var_s0->unk_48 = Rand_ZeroOne() * 4.0f; + if ((player->unk_1C8 == 2) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 < 2)) { + obj8C->unk_6C = 0.4f; + obj8C->unk_44 = 0; + obj8C->unk_46 = 24; + obj8C->unk_48 = Rand_ZeroOne() * 4.0f; if (Rand_ZeroOne() < 0.5f) { - var_s0->unk_48 = -var_s0->unk_48; + obj8C->unk_48 = -obj8C->unk_48; } } else { - var_s0->unk_54.x = (Rand_ZeroOne() - 0.5f) * 5.0f; - var_s0->unk_54.y = (Rand_ZeroOne() - 0.5f) * 3.0f; - var_s0->unk_48 = 0; + obj8C->unk_54.x = (Rand_ZeroOne() - 0.5f) * 5.0f; + obj8C->unk_54.y = (Rand_ZeroOne() - 0.5f) * 3.0f; + obj8C->unk_48 = 0; if (Rand_ZeroOne() < 0.5f) { - var_s0->unk_48 = -var_s0->unk_48; + obj8C->unk_48 = -obj8C->unk_48; } - if (sp24->unk_1D0 >= 5) { - var_s0->unk_4A = 0x60; - var_s0->unk_46 = 4; + if (player->unk_1D0 >= 5) { + obj8C->unk_4A = 0x60; + obj8C->unk_46 = 4; } else { - var_s0->unk_4A = 0x80; - var_s0->unk_46 = 2; + obj8C->unk_4A = 0x80; + obj8C->unk_46 = 2; } } - var_s0->unk_70 = arg3 * 0.2f; - var_s0->obj.rot.z = Rand_ZeroOne() * 360.0f; - func_800612B8(&var_s0->unk_1C, var_s0->obj.id); + obj8C->unk_70 = arg3 * 0.2f; + obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f; + Object_Set1C(&obj8C->unk_1C, obj8C->obj.id); break; } - var_s0--; + obj8C--; } } #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_800935E8.s") -void func_80094954(Object_8C* arg0) { - Player* temp = gPlayer; +void func_80094954(Object_8C* obj8C) { + Player* player = gPlayer; - if ((temp->unk_1C8 == 2) && (gCurrentLevel == LEVEL_AQUAS) && (temp->unk_1D0 < 2)) { - switch (arg0->unk_4E) { + if ((player->unk_1C8 == 2) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 < 2)) { + switch (obj8C->unk_4E) { case 0: - arg0->unk_44 += arg0->unk_46; - arg0->unk_4A = arg0->unk_44; - arg0->unk_70 += 0.01f; + obj8C->unk_44 += obj8C->unk_46; + obj8C->unk_4A = obj8C->unk_44; + obj8C->unk_70 += 0.01f; - if (arg0->unk_4A >= 200) { - arg0->unk_4E = 1; - arg0->unk_4A = 200; + if (obj8C->unk_4A >= 200) { + obj8C->unk_4E = 1; + obj8C->unk_4A = 200; } break; case 1: - arg0->unk_4A -= arg0->unk_46; - arg0->unk_70 -= 0.1f; + obj8C->unk_4A -= obj8C->unk_46; + obj8C->unk_70 -= 0.1f; break; } - if ((arg0->unk_4E == 1) && (arg0->unk_4A <= 0)) { - Object_Kill(&arg0->obj, &arg0->unk_80); + if ((obj8C->unk_4E == 1) && (obj8C->unk_4A <= 0)) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } - arg0->unk_54.y += arg0->unk_6C; - arg0->unk_6C -= 0.05f; + obj8C->unk_54.y += obj8C->unk_6C; + obj8C->unk_6C -= 0.05f; - if (arg0->unk_6C < -1.0f) { - arg0->unk_6C = -1.0f; + if (obj8C->unk_6C < -1.0f) { + obj8C->unk_6C = -1.0f; } - arg0->obj.rot.z += arg0->unk_48; + obj8C->obj.rot.z += obj8C->unk_48; return; } - if (temp->unk_1C8 == 7) { - arg0->obj.rot.x = temp->unk_05C * 180.0f / M_PI; - arg0->obj.rot.y = -temp->unk_058 * 180.0f / M_PI; + if (player->unk_1C8 == 7) { + obj8C->obj.rot.x = player->unk_05C * 180.0f / M_PI; + obj8C->obj.rot.y = -player->unk_058 * 180.0f / M_PI; } - if (temp->unk_1C8 == 6) { - arg0->unk_46 = 2; - if (temp->unk_1D0 >= 4) { - arg0->unk_54.y -= 0.13f; + if (player->unk_1C8 == 6) { + obj8C->unk_46 = 2; + if (player->unk_1D0 >= 4) { + obj8C->unk_54.y -= 0.13f; } } - arg0->unk_70 += 0.8f; - arg0->unk_4A -= arg0->unk_46; + obj8C->unk_70 += 0.8f; + obj8C->unk_4A -= obj8C->unk_46; - if ((arg0->unk_4A < 0) || ((temp->unk_1C8 == 2) && (gCurrentLevel == LEVEL_AQUAS) && (temp->unk_1D0 == 5))) { - Object_Kill(&arg0->obj, &arg0->unk_80); + if ((obj8C->unk_4A < 0) || ((player->unk_1C8 == 2) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 == 5))) { + Object_Kill(&obj8C->obj, &obj8C->sfxPos); } - arg0->obj.rot.z += arg0->unk_48; + obj8C->obj.rot.z += obj8C->unk_48; } -void func_80094BBC(Object_8C* arg0) { +void func_80094BBC(Object_8C* obj8C) { if ((gPlayer[0].unk_1C8 == 2) && (gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].unk_1D0 < 2)) { RCP_SetupDL(&gMasterDisp, 0x44); - gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, arg0->unk_4A); + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, obj8C->unk_4A); gDPSetEnvColor(gMasterDisp++, 255, 255, 251, 0); - func_8005980C(arg0->unk_70); + func_8005980C(obj8C->unk_70); gSPDisplayList(gMasterDisp++, D_1023750); } else { - func_8005980C(arg0->unk_70); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, arg0->unk_4A); + func_8005980C(obj8C->unk_70); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_4A); gSPDisplayList(gMasterDisp++, D_1023750); } } @@ -2346,16 +2351,16 @@ void stub_80094D18(void) { #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_80094D20.s") -void func_80095350(Object_2F4* arg0) { - Object_2F4_Initialize(arg0); - arg0->obj.status = 2; - arg0->obj.id = OBJECT_195; - arg0->unk_0B6 = 9999; - func_800612B8(&arg0->unk_01C, arg0->obj.id); +void func_80095350(Object_2F4* obj2F4) { + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 2; + obj2F4->obj.id = OBJECT_195; + obj2F4->unk_0B6 = 9999; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); } #ifdef IMPORT_DATA_PENDING -void func_800953A0(Object_2F4* arg0, s32 arg1) { +void func_800953A0(Object_2F4* obj_2F4, s32 arg1) { Vec3f D_800D2510[] = { { 1800.0f, 0.0f, -4000.0f }, { -1000.0f, 0.0f, -4800.0f }, @@ -2363,51 +2368,51 @@ void func_800953A0(Object_2F4* arg0, s32 arg1) { { -200.0f, 0.0f, -7000.0f }, }; - Object_2F4_Initialize(arg0); - arg0->obj.status = 2; - arg0->obj.id = OBJECT_195; - arg0->obj.pos = D_800D2510[arg1]; - arg0->obj.pos.z -= D_80177D20; - arg0->unk_0B6 = 45; - func_800612B8(&arg0->unk_01C, arg0->obj.id); + Object_2F4_Initialize(obj_2F4); + obj_2F4->obj.status = 2; + obj_2F4->obj.id = OBJECT_195; + obj_2F4->obj.pos = D_800D2510[arg1]; + obj_2F4->obj.pos.z -= D_80177D20; + obj_2F4->unk_0B6 = 45; + Object_Set1C(&obj_2F4->unk_01C, obj_2F4->obj.id); } #else #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_800953A0.s") #endif #ifdef IMPORT_DATA_PENDING -void func_8009546C(Object_2F4* arg0, s32 arg1) { +void func_8009546C(Object_2F4* obj2F4, s32 arg1) { Vec3f D_800D2540[] = { { 1300.0f, 0.0f, -2000.0f }, { -1000.0f, 0.0f, -3000.0f }, { 800.0f, 0.0f, 0.0f }, { -1200.0f, 0.0f, -1000.0f }, { -1400.0f, 0.0f, 700.0f }, }; - Object_2F4_Initialize(arg0); - arg0->obj.status = 2; - arg0->obj.id = OBJECT_195; - arg0->obj.pos = D_800D2540[arg1]; - arg0->obj.pos.z -= D_80177D20; - arg0->unk_0B6 = 46; - func_800612B8(&arg0->unk_01C, arg0->obj.id); + Object_2F4_Initialize(obj2F4); + obj2F4->obj.status = 2; + obj2F4->obj.id = OBJECT_195; + obj2F4->obj.pos = D_800D2540[arg1]; + obj2F4->obj.pos.z -= D_80177D20; + obj2F4->unk_0B6 = 46; + Object_Set1C(&obj2F4->unk_01C, obj2F4->obj.id); } #else #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_8009546C.s") #endif #ifdef IMPORT_DATA_PENDING -void func_80095538(Object_2F4* arg0, s32 arg1) { +void func_80095538(Object_2F4* obj_2F4, s32 arg1) { Vec3f D_800D257C[] = { { 0.0f, 0.0f, -200.0f }, { -300.0f, 0.0f, -700.0f }, { 400.0f, 0.0f, -900.0f }, { 300.0f, 0.0f, -1700.0f }, { -260.0f, 0.0f, -2000.0f }, { -200.0f, 0.0f, -2600.0f }, }; - Object_2F4_Initialize(arg0); - arg0->obj.status = 2; - arg0->obj.id = OBJECT_195; - arg0->obj.pos = D_800D257C[arg1]; - arg0->obj.pos.z -= D_80177D20; - arg0->unk_0B6 = 47; - func_800612B8(&arg0->unk_01C, arg0->obj.id); + Object_2F4_Initialize(obj_2F4); + obj_2F4->obj.status = 2; + obj_2F4->obj.id = OBJECT_195; + obj_2F4->obj.pos = D_800D257C[arg1]; + obj_2F4->obj.pos.z -= D_80177D20; + obj_2F4->unk_0B6 = 47; + Object_Set1C(&obj_2F4->unk_01C, obj_2F4->obj.id); } #else #pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_80095538.s") diff --git a/src/overlays/ovl_DF4260/DF4260.c b/src/overlays/ovl_DF4260/DF4260.c index afc87209..6123b698 100644 --- a/src/overlays/ovl_DF4260/DF4260.c +++ b/src/overlays/ovl_DF4260/DF4260.c @@ -4,7 +4,7 @@ void func_DF4260_80187520(s32 arg0, s32 arg1) { } -void func_DF4260_80187530(Object_80* arg0) { +void func_DF4260_80187530(Object_80* obj80) { } #pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_DF4260/DF4260/func_DF4260_8018753C.s") diff --git a/src/overlays/ovl_DF4260/DFEE30.c b/src/overlays/ovl_DF4260/DFEE30.c index fc458cf0..71562a91 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(Object_2F4* arg0) { - arg0->unk_050 = arg0->obj.rot.x; - arg0->obj.rot.x = 0.0f; +void func_DF4260_80192CB0(Object_2F4* obj2F4) { + obj2F4->unk_050 = obj2F4->obj.rot.x; + obj2F4->obj.rot.x = 0.0f; } #pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_DF4260/DFEE30/func_DF4260_80192CD4.s") diff --git a/yamls/us/main.yaml b/yamls/us/main.yaml index 16d9a2b2..e68ee054 100644 --- a/yamls/us/main.yaml +++ b/yamls/us/main.yaml @@ -172,24 +172,26 @@ # Game engine - [0x2EFE0, c, sf_2EFE0] - [0x36930, c, sf_36930] + - [0x3E6F0, c, sf_3E6F0] - [0x43AC0, c, fox_43AC0] - [0x43E80, c, sf_43E80] - [0x496C0, c, sf_496C0] - - [0x52730, c, fox_52730] + - [0x52730, c, fox_display] - [0x59780, c, fox_load] - [0x5A0F0, c, fox_edata] - [0x5A2C0, c, fox_edisplay] - [0x61B30, c, fox_enmy] - [0x6B3B0, c, fox_6B3B0] - [0x77E40, c, sf_77E40] - - [0x84F70, c, fox_84F70] + - [0x84F70, c, fox_fade] + - [0x852F0, c, sf_852F0] - [0x85530, c, sf_hud] - [0x97F80, c, fox_97F80] - [0x9A580, c, fox_std_lib] - - [0xA24B0, c, fox_A24B0] + - [0xA24B0, c, fox_game] - [0xA4290, c, fox_A4290] - [0xA48A0, c, fox_A48A0] - - [0xA4B50, c, sf_A4B50] + - [0xA4B50, c, fox_play] - [0xB99D0, c, fox_rcp] - [0xBB360, c, fox_radio] - [0xBD0B0, c, fox_reset] @@ -264,10 +266,11 @@ - [0xCA690, data, sf_2EFE0] - [0xCA7C0, data, sf_36930] + - [0xCA830, data, sf_3E6F0] - [0xCAA90, .data, fox_43AC0] - [0xCAB00, data, sf_43E80] - [0xCAB60, data, sf_496C0] - - [0xCAE20, .data, fox_52730] + - [0xCAE20, .data, fox_display] - [0xCAFB0, .data, fox_load] - [0xCCA70, .data, fox_edata] - [0xD0570, .data, fox_edisplay] @@ -276,9 +279,9 @@ - [0xD20E0, data, sf_77E40] - [0xD2570, data, sf_hud] - [0xD31D0, .data, fox_std_lib] - - [0xD3460, .data, fox_A24B0] + - [0xD3460, .data, fox_game] - [0xD3520, .data, fox_A4290] - - [0xD3B50, data, sf_A4B50] + - [0xD3B50, data, fox_play] - [0xD3DB0, .data, fox_rcp] - [0xD5670, .data, fox_radio] - [0xD5680, .data, fox_reset] @@ -288,23 +291,24 @@ # RODATA - game engine - [0xD5A10, .rodata, sf_2EFE0] - [0xD5CF0, .rodata, sf_36930] + - [0xD5F90, .rodata, sf_3E6F0] - [0xD61D0, .rodata, fox_43AC0] - [0xD61F0, .rodata, sf_43E80] - [0xD6350, .rodata, sf_496C0] - - [0xD69A0, .rodata, fox_52730] + - [0xD69A0, .rodata, fox_display] - [0xD6BA0, .rodata, fox_load] - [0xD6C20, .rodata, fox_edisplay] - [0xD6FD0, .rodata, fox_enmy] - [0xD7650, .rodata, fox_6B3B0] - [0xD7E30, .rodata, sf_77E40] - - [0xD82F0, .rodata, fox_84F70] + - [0xD82F0, .rodata, fox_fade] - [0xD8320, .rodata, sf_hud] - [0xD8DE0, .rodata, fox_97F80] - [0xD8DF0, .rodata, fox_std_lib] - - [0xD8E50, .rodata, fox_A24B0] + - [0xD8E50, .rodata, fox_game] - [0xD8ED0, .rodata, fox_A4290] - [0xD8EE0, .rodata, fox_A48A0] - - [0xD8EF0, .rodata, sf_A4B50] + - [0xD8EF0, .rodata, fox_play] - [0xD97F0, .rodata, fox_radio] - [0xD9E50, .rodata, sf_versus] - [0xD9F60, .rodata, fox_message] @@ -356,16 +360,17 @@ # Game engine bss - { start: 0xDE480, type: bss, vram: 0x8015F900, name: sf_2EFE0 } - { start: 0xDE480, type: bss, vram: 0x8015F950, name: sf_36930 } + - { start: 0xDE480, type: bss, vram: 0x8015F960, name: sf_3E6F0 } - { start: 0xDE480, type: .bss, vram: 0x801613A0, name: fox_43AC0 } - - { start: 0xDE480, type: .bss, vram: 0x801613B0, name: fox_52730 } + - { start: 0xDE480, type: .bss, vram: 0x801613B0, name: fox_display } - { start: 0xDE480, type: .bss, vram: 0x801615D0, name: fox_edisplay } - { start: 0xDE480, type: .bss, vram: 0x80161670, name: fox_enmy } - { start: 0xDE480, type: .bss, vram: 0x80161690, name: fox_6B3B0 } - { start: 0xDE480, type: bss, vram: 0x801616A0, name: sf_hud } - { start: 0xDE480, type: .bss, vram: 0x80161950, name: fox_97F80 } - { start: 0xDE480, type: .bss, vram: 0x801619A0, name: fox_std_lib } - - { start: 0xDE480, type: .bss, vram: 0x80161A10, name: fox_A24B0 } - - { start: 0xDE480, type: bss, vram: 0x80161A50, name: sf_A4B50 } + - { start: 0xDE480, type: .bss, vram: 0x80161A10, name: fox_game } + - { start: 0xDE480, type: bss, vram: 0x80161A50, name: fox_play } - { start: 0xDE480, type: .bss, vram: 0x80178580, name: fox_rcp } - { start: 0xDE480, type: .bss, vram: 0x80178720, name: fox_radio } - { start: 0xDE480, type: bss, vram: 0x80178750, name: sf_versus }