fox_effects decompiled (#77)

* Match 5 funcs

* Match func_8007E93C

* Match func_8007EBB8

* Match func_8007ED54

* Match func_8007EE68

* 0.017453292f to M_DTOR

* format

* 3 more matches

* Match 2 more

* 2 more matches

* Match func_8007F958

* Match func_8007FBE0

* Match func_8007FD84

* Match func_8007FE88

* 5 new matches

* Match func_80080D04

* Match func_800815DC and func_8008165C

* Match func_80081BEC

* MAtch func_80081B24

* Match 2 more

* 3 more matches

* Small tweaks

* Give names to function params

* Match func_80080ACC

* MAtch func_80083D2C

* Match func_800837EC

* WIP func_80081C5C

* Add view of rodata that needs to be migrated somewhere

* Match func_80081C5C!

* Fix bss reordering, and formatting.

* Add a submodule of m2c, and a new script for generating the context for a file, and a m2c output to an ignored folder.

* Migrate rodata

* Start importing data for sf_77E40.c

* Successful data migration for sf_77E40.c

* make format

* Reorganzie data for sf_77E40.c

* Try stubbing a PRINTF, to help with RODATA strings.

* Rename sf_77E40 to fox_effect

* Rename Object_8C to Effect

* make format...

* Rename gObjects8C to gEffects
This commit is contained in:
Ryan Myers 2024-01-13 08:43:04 -05:00 committed by GitHub
parent abfeeee15b
commit 8e808803e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 4988 additions and 3024 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ ctx.c.m2c
tools/mio0
tools/ido-recomp
.venv/
m2cfiles/

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "tools/asm-differ"]
path = tools/asm-differ
url = https://github.com/simonlindholm/asm-differ
[submodule "tools/m2c"]
path = tools/m2c
url = https://github.com/matt-kempster/m2c

View File

@ -215,13 +215,13 @@ void func_80060D94(s32);
void func_80060F30(Vec3f* , u32 , s32 );
void Object_Kill(Object*, Vec3f*);
s32 func_80060FE4(Vec3f*, f32);
void Object_SetInfo(ObjectInfo*, u32);
void Object_SetInfo(ObjectInfo* info, u32 objId);
void Object_80_Initialize(Object_80*);
void Object_4C_Initialize(Object_4C*);
void Object_2F4_Initialize(Object_2F4*);
void Boss_Initialize(Boss*);
void Item_Initialize(Item*);
void Object_8C_Initialize(Object_8C*);
void Effect_Initialize(Effect*);
void func_80061B68(void);
void func_80061CD0(void);
void func_80061E48(Object_2F4* , f32 , f32 , f32 );
@ -233,6 +233,7 @@ void func_80062C38(f32, f32);
s32 func_800631A8(Vec3f*, f32*, Vec3f*);
s32 func_8006326C(Vec3f* , Vec3f* , ObjectId , Object* );
s32 func_8006351C(s32 , Vec3f* , Vec3f* , s32 );
s32 func_801A55D4(s32 , Vec3f* , Vec3f* , s32 );
void func_800652CC(Object_80*);
void func_800654E4(Object *);
void func_800656D4(Object_2F4*);
@ -265,7 +266,7 @@ void func_80068C48(Item*);
void func_80068C88(Item*);
void func_80068FE0(Object_4C*);
void func_800690D0(s32, ObjectId);
void func_80069924(Object_8C *);
void func_80069924(Effect *);
void func_800693E8(Object_2F4 *);
void func_80069658(Boss *);
void func_800696F8(Object_80 *);
@ -276,7 +277,7 @@ void Boss_Update(Boss *);
void Object_80_Update(Object_80 *);
void Object_4C_Update(Object_4C *);
void Item_Update(Item *);
void Object_8C_Update(Object_8C *);
void Effect_Update(Effect *);
void func_8006A06C(UnkEntity30*);
void func_8006A38C(void);
void Object_UpdateAll(void);
@ -295,6 +296,7 @@ void func_8006BB78(Object_2F4*);
void func_8006C008(Object_2F4*);
void func_8006D350(Object_80*);
void func_8006EEFC(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32);
void func_8006F0D8(f32 xPos, f32 yPos, f32 zPos, f32 arg3);
void func_80072594(Object_2F4*);
s32 func_80074F90(Object_80*);
void func_80074FF0(Object_2F4*);
@ -303,134 +305,139 @@ void func_8007717C(Object_2F4 *);
void func_800771CC(Object_2F4*);
void func_80077218(Object_2F4*);
// sf_77E40
void func_80077240(f32 posX, f32 posY, f32 posZ, s32 );
// fox_effect
void func_80077240(f32 posX, f32 posY, f32 posZ, s32 hits);
void func_8007729C(void);
void func_80077790(void);
Object_8C* func_8007783C(ObjectId objId);
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 *);
Effect* func_8007783C(ObjectId objId);
void func_8007797C(f32 posX, f32 posY, f32 posZ, f32 velX, f32 velY, f32 velZ, f32 scale2);
void func_80077A00(Effect* );
void func_80077A7C(Effect* );
void func_80077B78(Effect* );
void func_80077B84(Effect* );
void func_80078038(Effect* );
void func_800780F8(Effect* );
void func_800783C0(Effect* );
void func_80078438(Effect* );
void func_800784B4(Effect* );
void func_80078550(Effect* );
void func_80078604(Effect* );
void func_8007868C(Effect* );
void func_8007879C(Effect* );
void func_800788B0(Effect* );
void func_80078A64(Effect* );
void func_80078AEC(Effect* );
void func_80078B8C(Effect *);
void func_80078BE0(Effect* );
void func_80078C84(Effect* );
void func_80078CE8(Effect* );
void func_80078E50(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_80078EBC(Effect* );
void func_80078F78(Effect* );
void func_800794CC(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007953C(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_800795AC(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_80079618(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007968C(Effect *);
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 *, s32);
void func_8007A748(Object_8C*);
s32 func_8007A774(Player*, Object_8C*, f32);
void func_8007A818(Object_8C*, f32 posX, f32 posY, f32 posZ, f32, u8, u8, u16);
void func_8007A900(f32 posX, f32 posY, f32 posZ, f32, u8, u8, u16);
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 , 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 );
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 , 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 );
void func_8007B960(Object_8C*);
void func_8007BC7C(f32 posX, f32 posY, f32 posZ, f32);
void func_8007BCE8(Object_8C*);
void func_8007B9DC(Object_8C*);
void func_8007BDE0(Object_8C*);
void func_8007BE54(Object_8C*);
void func_8007BEE8(Object_8C*);
void func_8007BFFC(f32 posX, f32 posY, f32 posZ, f32 x, f32 y, f32 z, f32 arg6, s32 arg7);
void func_8007C120(f32 posX, f32 posY, f32 posZ, f32 x, f32 y, f32 z, f32 arg6, s32 arg7);
void func_8007C250(Object_8C*);
void func_8007C484(f32 posX, f32 posY, f32 posZ, f32 x, f32 y, f32 z, f32 arg6, s32 arg7);
void func_8007C50C(Object_8C*);
void func_8007C688(f32 posX, f32 posY, f32 posZ, f32 arg3, s32 arg4);
void func_8007C8C4(Object_8C*);
void func_8007C85C(f32 posX, f32 posY, f32 posZ, f32 arg3);
void func_8007C9E0(Object_8C*);
void func_8007CAF0(Object_8C*);
void func_800798F0(Effect* );
void func_8007A28C(Effect* );
void func_8007A3C0(Effect* );
void func_8007A568(f32 xPos, f32 yPos, f32 zPos, f32 scale1);
void func_8007A5F8(Effect* , Vec3f* pos, u32 sfxId);
void func_8007A6F0(Vec3f* pos, s32 sfxId);
void func_8007A748(Effect*);
s32 func_8007A774(Player*, Effect*, f32);
void func_8007A900(f32 posX, f32 posY, f32 posZ, f32 scale1, u8, u8, u16);
void func_8007A994(Effect*);
void func_8007AA60(Effect*);
void func_8007AB50(Effect*);
void func_8007ACE0(f32 posX, f32 posY, f32 posZ, f32 scale2, f32 scale1, f32 rotY);
void func_8007ADF4(f32 posX, f32 posY, f32 posZ, f32 scale2, f32 scale1);
void func_8007AFD0(f32 posX, f32 posZ, f32 velX, f32 velZ, f32 scale1);
void func_8007B040(Effect*);
void func_8007B0F4(Effect*);
void func_8007B228(f32 posX, f32 posY, f32 posZ, f32 scale1);
void func_8007B344(f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 );
void func_8007B3B8(Effect*);
void func_8007B550(f32 posX, f32 posY, f32 posZ, f32 scale1, s32 );
void func_8007B5C0(Effect*);
void func_8007B62C(Effect*);
void func_8007B670(Effect*);
void func_8007B67C(Effect*);
void func_8007B758(Effect*);
void func_8007B8F8(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007B960(Effect*);
void func_8007BC7C(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007BCE8(Effect*);
void func_8007B9DC(Effect*);
void func_8007BDE0(Effect*);
void func_8007BE54(Effect*);
void func_8007BEE8(Effect*);
void func_8007BFFC(f32 posX, f32 posY, f32 posZ, f32 velX, f32 velY, f32 velZ, f32 scale2, s32 timer50);
void func_8007C120(f32 posX, f32 posY, f32 posZ, f32 velX, f32 velY, f32 velZ, f32 scale2, s32 timer50);
void func_8007C250(Effect*);
void func_8007C484(f32 posX, f32 posY, f32 posZ, f32 velX, f32 velY, f32 velZ, f32 scale2, s32 arg7);
void func_8007C50C(Effect*);
void func_8007C688(f32 posX, f32 posY, f32 posZ, f32 scale2, s32 timer50);
void func_8007C8C4(Effect*);
void func_8007C85C(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007C9E0(Effect*);
void func_8007CAF0(Effect*);
void func_8007CF30(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007D074(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007D0E0(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007D10C(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007D1E0(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007D24C(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007D2C8(f32, f32, f32, f32);
void func_8007D2F4(Object_8C*);
void func_8007D55C(Object_8C*);
void func_8007D748(Object_8C*);
void func_8007D8A8(Object_8C*);
void func_8007D9DC(f32, f32, f32, f32, f32, s32);
void func_8007DA58(Object_8C*);
void func_8007DAE4(Object_8C*);
void func_8007DB70(Object_8C*);
void func_8007DED4(Object_8C*);
void func_8007E014(Object_8C*);
void func_8007E258(Object_8C*);
void func_8007E298(Object_8C*);
void func_8007E330(Object_8C*);
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 *, 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*);
void func_8007FBE0(Object_8C*);
void func_8007FE88(Object_8C*);
void func_800802B8(Object_8C*);
void func_800802D8(Object_8C*);
void func_800802F8(Object_8C*);
void func_80080360(Object_8C*);
void func_8008040C(Object_8C*);
void func_8008092C(Object_8C*);
void func_80080ACC(Object_8C*);
void func_80080D04(Object_8C*);
void func_80081C5C(Object_8C*);
void func_80082F78(Object_8C*);
void func_800837EC(Object_8C*);
void func_80083B8C(Object_8C*);
void func_80083D2C(f32 , f32 , f32 , f32 );
void func_80083FA8(Object_8C*);
void func_80084194(Object_8C*);
void func_8007D2C8(f32 posX, f32 posY, f32 posZ, f32 scale2);
void func_8007D2F4(Effect*);
void func_8007D55C(Effect*);
void func_8007D748(Effect*);
void func_8007D8A8(Effect*);
void func_8007D9DC(f32 posX, f32 posY, f32 posZ, f32 scale2, f32 scale1, s32 timer50);
void func_8007DA58(Effect*);
void func_8007DAE4(Effect*);
void func_8007DB70(Effect*);
void func_8007DED4(Effect*);
void func_8007E014(Effect*);
void func_8007E258(Effect*);
void func_8007E298(Effect*);
void func_8007E330(Effect*);
void func_8007E3E4(Effect*);
void func_8007E45C(Effect*);
void func_8007E5CC(Effect*);
void func_8007E648(Effect*);
void func_8007E93C(Effect* effect, u32 objId, f32 posX, f32 posY, f32 posZ, f32 arg5);
void func_8007EE68(s32 objId, Vec3f* pos, Vec3f* rot, Vec3f* arg3, Vec3f* arg4, f32 scale2);
void func_8007F04C(s32 objId, f32 posX, f32 posY, f32 posZ, f32 rotX, f32 rotY, f32 rotZ, f32 unkX, f32 unkY, f32 unkZ, f32 velX, f32 velY, f32 velZ, f32 scale2);
void func_8007F11C(s32 objId, f32 posX, f32 posY, f32 posZ, f32 arg4);
void func_8007F20C(s32 objId, f32 posX, f32 posY, f32 posZ, f32 arg4);
void func_8007F438(Effect*);
void func_8007F6B0(Effect*);
void func_8007F958(Effect*);
void func_8007FBE0(Effect*);
void func_8007FE88(Effect*);
s32 func_8007FD84(Effect*);
void func_800802B8(Effect*);
void func_800802D8(Effect*);
void func_800802F8(Effect*);
void func_80080360(Effect*);
void func_8008040C(Effect*);
void func_8008092C(Effect*);
void func_80080ACC(Effect*);
void func_80080D04(Effect*);
void func_800815DC(void);
void func_80081A8C(f32 posX, f32 posY, f32 posZ, f32 scale2, s32 arg4);
void func_80081BEC(f32 posX, f32 posY, f32 posZ, f32 scale2, s32 arg4);
void func_80081C5C(Effect*);
void func_80082F78(Effect*);
void func_800837EC(Effect*);
void func_80083B8C(Effect*);
void func_80083C70(Effect* effect, f32 posX, f32 posY, f32 posZ, f32 velX, f32 velY, f32 velZ, f32 arg7, s32 arg8);
void func_80083D2C(f32 posX, f32 posY, f32 posZ, f32 srcZ);
void func_80083FA8(Effect*);
void func_80084194(Effect*);
// fox_fade
void func_80084370(s32);
@ -476,8 +483,8 @@ void func_80092EC0(Object_2F4*);
void func_80093164(Object_2F4*);
void func_800935E8(Player*);
void func_80095604(Player*);
void func_80094954(Object_8C*);
void func_80094BBC(Object_8C*);
void func_80094954(Effect*);
void func_80094BBC(Effect*);
void func_80094D20(f32, f32);
// fox_97F80
@ -514,7 +521,7 @@ void func_800A5FA0(Vec3f* , u32 , s32 );
void func_800A6070(Vec3f* arg0, u32 arg1);
void func_800A6148(void);
void func_800A69F8(s32 , f32 , f32 , f32 );
void Player_ApplyDamage(Player *, s32, s32);
void Player_ApplyDamage(Player* player, s32 direction, s32 damage);
bool func_800A73E4(f32* , s32* , f32 posX, f32 posY, f32 posZ);
s32 func_800A78C4(Hitbox* hitbox, f32 , f32 , f32 , f32 , f32 , f32 );
void func_800A8BA4(Player* player);
@ -660,8 +667,8 @@ void func_E16C50_8019EA7C(Object_2F4*);
void func_E16C50_8019F20C(Object_2F4*);
void func_E16C50_8019F7AC(Object_2F4*);
void func_E16C50_801A003C(Object_2F4*);
void func_E16C50_801A0120(Object_8C*);
void func_E16C50_801A0AF0(Object_8C*);
void func_E16C50_801A0120(Effect*);
void func_E16C50_801A0AF0(Effect*);
void func_E16C50_801A10F4(Player* player);
void func_E16C50_801A5B3C(Boss*);
void func_E16C50_801A71B8(Boss*);
@ -676,7 +683,7 @@ void func_E16C50_801ABA40(PlayerShot*);
void func_E16C50_801AC274(Player*);
void func_E16C50_801AC8A8(f32, f32, f32, f32, s32);
void func_E16C50_801AC8A8(f32, f32, f32, f32, s32);
void func_E16C50_801AC918(Object_8C*);
void func_E16C50_801AC918(Effect*);
void func_E16C50_801ACBB4(void);
void func_E16C50_801ACE50(Player*);
void func_E16C50_801AD328(Player*);

View File

@ -19,4 +19,10 @@
#define CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(osClockRate/15625LL))
#define CYCLES_TO_MSEC(c) ((s32)CYCLES_TO_USEC(c)/1000)
#if defined(__sgi)
#define PRINTF
#else
#define PRINTF(...)
#endif
#endif // MACROS_H

View File

@ -70,8 +70,8 @@ void Matrix_RotateZ(Matrix*, f32, u8);
void Matrix_RotateAxis(Matrix*, f32, f32, f32, f32, u8);
void Matrix_ToMtx(Mtx *dest);
void Matrix_FromMtx(Mtx *src, Matrix *dest);
void Matrix_MultVec3f(Matrix*, Vec3f*, Vec3f*);
void Matrix_MultVec3fNoTranslate(Matrix*, Vec3f*, Vec3f*);
void Matrix_MultVec3f(Matrix* mtx, Vec3f* src, Vec3f* dest);
void Matrix_MultVec3fNoTranslate(Matrix* mtx, Vec3f* src, Vec3f* dest);
void Matrix_GetYRPAngles(Matrix*, Vec3f*);
void Matrix_GetXYZAngles(Matrix*, Vec3f*);
void Matrix_LookAt(Matrix*, f32, f32, f32, f32, f32, f32, f32, f32, f32, u8);

View File

@ -201,7 +201,7 @@ typedef struct {
/* 0x7A */ s16 unk_7A;
/* 0x7C */ char pad7C[4];
/* 0x80 */ Vec3f sfxPos;
} Object_8C; // size 0x8C
} Effect; // size 0x8C
typedef struct {
/* 0x000 */ Object obj;
@ -666,67 +666,67 @@ typedef enum{
/* 336 */ OBJ_ITEM_GOLD_RING,
/* 337 */ OBJ_ITEM_WING_REPAIR,
/* 338 */ OBJ_ITEM_TRAINING_RING,
/* 339 */ OBJ_8C_339,
/* 340 */ OBJ_8C_340,
/* 341 */ OBJ_8C_341,
/* 342 */ OBJ_8C_342,
/* 343 */ OBJ_8C_343,
/* 344 */ OBJ_8C_344,
/* 345 */ OBJ_8C_345,
/* 346 */ OBJ_8C_346,
/* 347 */ OBJ_8C_347,
/* 348 */ OBJ_8C_348,
/* 349 */ OBJ_8C_349,
/* 350 */ OBJ_8C_350,
/* 351 */ OBJ_8C_351,
/* 352 */ OBJ_8C_352,
/* 353 */ OBJ_8C_353,
/* 354 */ OBJ_8C_354,
/* 355 */ OBJ_8C_355,
/* 356 */ OBJ_8C_356,
/* 357 */ OBJ_8C_357,
/* 358 */ OBJ_8C_358,
/* 359 */ OBJ_8C_359,
/* 360 */ OBJ_8C_360,
/* 361 */ OBJ_8C_361,
/* 362 */ OBJ_8C_362,
/* 363 */ OBJ_8C_363,
/* 364 */ OBJ_8C_364,
/* 365 */ OBJ_8C_365,
/* 366 */ OBJ_8C_366,
/* 367 */ OBJ_8C_367,
/* 368 */ OBJ_8C_368,
/* 369 */ OBJ_8C_369,
/* 370 */ OBJ_8C_370,
/* 371 */ OBJ_8C_371,
/* 372 */ OBJ_8C_372,
/* 373 */ OBJ_8C_373,
/* 374 */ OBJ_8C_374,
/* 375 */ OBJ_8C_375,
/* 376 */ OBJ_8C_376,
/* 377 */ OBJ_8C_377,
/* 378 */ OBJ_8C_378,
/* 379 */ OBJ_8C_379,
/* 380 */ OBJ_8C_380,
/* 381 */ OBJ_8C_381,
/* 382 */ OBJ_8C_382,
/* 383 */ OBJ_8C_383,
/* 384 */ OBJ_8C_384,
/* 385 */ OBJ_8C_385,
/* 386 */ OBJ_8C_386,
/* 387 */ OBJ_8C_387,
/* 388 */ OBJ_8C_388,
/* 389 */ OBJ_8C_389,
/* 390 */ OBJ_8C_390,
/* 391 */ OBJ_8C_391,
/* 392 */ OBJ_8C_392,
/* 393 */ OBJ_8C_393,
/* 394 */ OBJ_8C_394,
/* 395 */ OBJ_8C_395,
/* 396 */ OBJ_8C_396,
/* 397 */ OBJ_8C_397,
/* 398 */ OBJ_8C_398,
/* 399 */ OBJ_8C_399,
/* 339 */ OBJ_EFFECT_339,
/* 340 */ OBJ_EFFECT_340,
/* 341 */ OBJ_EFFECT_341,
/* 342 */ OBJ_EFFECT_342,
/* 343 */ OBJ_EFFECT_343,
/* 344 */ OBJ_EFFECT_344,
/* 345 */ OBJ_EFFECT_345,
/* 346 */ OBJ_EFFECT_346,
/* 347 */ OBJ_EFFECT_347,
/* 348 */ OBJ_EFFECT_348,
/* 349 */ OBJ_EFFECT_349,
/* 350 */ OBJ_EFFECT_350,
/* 351 */ OBJ_EFFECT_351,
/* 352 */ OBJ_EFFECT_352,
/* 353 */ OBJ_EFFECT_353,
/* 354 */ OBJ_EFFECT_354,
/* 355 */ OBJ_EFFECT_355,
/* 356 */ OBJ_EFFECT_356,
/* 357 */ OBJ_EFFECT_357,
/* 358 */ OBJ_EFFECT_358,
/* 359 */ OBJ_EFFECT_359,
/* 360 */ OBJ_EFFECT_360,
/* 361 */ OBJ_EFFECT_361,
/* 362 */ OBJ_EFFECT_362,
/* 363 */ OBJ_EFFECT_363,
/* 364 */ OBJ_EFFECT_364,
/* 365 */ OBJ_EFFECT_365,
/* 366 */ OBJ_EFFECT_366,
/* 367 */ OBJ_EFFECT_367,
/* 368 */ OBJ_EFFECT_368,
/* 369 */ OBJ_EFFECT_369,
/* 370 */ OBJ_EFFECT_370,
/* 371 */ OBJ_EFFECT_371,
/* 372 */ OBJ_EFFECT_372,
/* 373 */ OBJ_EFFECT_373,
/* 374 */ OBJ_EFFECT_374,
/* 375 */ OBJ_EFFECT_375,
/* 376 */ OBJ_EFFECT_376,
/* 377 */ OBJ_EFFECT_377,
/* 378 */ OBJ_EFFECT_378,
/* 379 */ OBJ_EFFECT_379,
/* 380 */ OBJ_EFFECT_380,
/* 381 */ OBJ_EFFECT_381,
/* 382 */ OBJ_EFFECT_382,
/* 383 */ OBJ_EFFECT_383,
/* 384 */ OBJ_EFFECT_384,
/* 385 */ OBJ_EFFECT_385,
/* 386 */ OBJ_EFFECT_386,
/* 387 */ OBJ_EFFECT_387,
/* 388 */ OBJ_EFFECT_388,
/* 389 */ OBJ_EFFECT_389,
/* 390 */ OBJ_EFFECT_390,
/* 391 */ OBJ_EFFECT_391,
/* 392 */ OBJ_EFFECT_392,
/* 393 */ OBJ_EFFECT_393,
/* 394 */ OBJ_EFFECT_394,
/* 395 */ OBJ_EFFECT_395,
/* 396 */ OBJ_EFFECT_396,
/* 397 */ OBJ_EFFECT_397,
/* 398 */ OBJ_EFFECT_398,
/* 399 */ OBJ_EFFECT_399,
/* 400 */ OBJ_ID_MAX,
} ObjectId;

View File

@ -207,20 +207,7 @@ extern s16 D_800CFF94[];
extern u8 D_800CFFB4[];
extern f32 D_800CFFC4[];
// sf_77E40
extern Gfx* D_800D14E0[][2];
extern Gfx* D_800D14FC[];
extern Vec3f D_800D1528;
extern f32 D_800D1534[10][10];
extern s32 D_800D173C[];
extern Gfx* D_800D178C[6];
extern s32 D_800D18F0[]; //[6][4]?
extern s32 D_800D1950[];
extern Gfx* D_800D17A4[];
extern f32 D_800D17F8[];
extern u8 D_800D184C[][4];
extern Gfx* D_800D18A0[];
extern Gfx D_6004900[];
// fox_effect
// sf_hud
extern s16 D_800D1970;
@ -402,7 +389,7 @@ extern Object_80 gObjects80[50];
extern Object_4C gObjects4C[40];
extern Object_2F4 gObjects2F4[60];
extern Boss gBosses[4];
extern Object_8C gObjects8C[100];
extern Effect gEffects[100];
extern Item gItems[20];
extern PlayerShot gPlayerShots[16];
extern UnkEntity30 gUnkEntities30[100];

View File

@ -204,8 +204,8 @@ Object_4C_Draw = 0x8005D8B8;
Object_2F4_Draw2 = 0x8005D954;
Object_2F4_Draw1 = 0x8005DBC0;
Boss_Draw = 0x8005E1B8;
Object_8C_Draw1 = 0x8005E454;
Object_8C_Draw2 = 0x8005E538;
Effect_Draw1 = 0x8005E454;
Effect_Draw2 = 0x8005E538;
Item_Draw = 0x8005E7B8;
func_8005EA24 = 0x8005EA24;
func_8005ECD8 = 0x8005ECD8;
@ -234,7 +234,7 @@ Object_4C_Initialize = 0x80061394;
Object_2F4_Initialize = 0x800613C4;
Boss_Initialize = 0x80061404;
Item_Initialize = 0x80061444;
Object_8C_Initialize = 0x80061474;
Effect_Initialize = 0x80061474;
Object_80_Load = 0x800614B4;
Object_4C_Load = 0x800615A0;
Object_2F4_Load = 0x8006168C;
@ -314,7 +314,7 @@ Boss_Update = 0x80069CBC;
Object_80_Update = 0x80069DF4;
Object_4C_Update = 0x80069E88;
Item_Update = 0x80069F30;
Object_8C_Update = 0x80069FD4;
Effect_Update = 0x80069FD4;
func_8006A06C = 0x8006A06C;
func_8006A38C = 0x8006A38C;
Object_UpdateAll = 0x8006A3E8;
@ -387,7 +387,7 @@ gObjects80 = 0x80161B00; //size:0x1900
gObjects4C = 0x80163400; //size:0xBE0
gObjects2F4 = 0x80163FE0; //size:0xB130
gBosses = 0x8016F110; //size:0x1020
gObjects8C = 0x80170130; //size:0x36B0
gEffects = 0x80170130; //size:0x36B0
gItems = 0x801737E0; //size:0x870
gPlayerShots = 0x80174050; //size:0x700
gUnkEntities30 = 0x80174750; //size:0x12C0

View File

@ -272,6 +272,20 @@ D_1024410 = 0x01024410;
D_1024570 = 0x01024570;
D_10246D0 = 0x010246D0;
D_1016410 = 0x01016410;
D_1003130 = 0x01003130;
D_10162A0 = 0x010162A0;
D_1016130 = 0x01016130;
D_1015FC0 = 0x01015FC0;
D_1015810 = 0x01015810;
D_1015E50 = 0x01015E50;
D_10156A0 = 0x010156A0;
D_1015CE0 = 0x01015CE0;
D_1015B70 = 0x01015B70;
D_1015320 = 0x01015320;
D_2000000 = 0x02000000;
D_2000890 = 0x02000890;
D_2001090 = 0x02001090;
@ -704,6 +718,11 @@ D_604A190 = 0x0604A190;
D_604A400 = 0x0604A400;
D_604A710 = 0x0604A710;
D_6049F80 = 0x06049F80;
D_6003440 = 0x06003440;
D_60034E0 = 0x060034E0;
D_6003580 = 0x06003580;
D_6003620 = 0x06003620;
D_60036C0 = 0x060036C0;
D_700AB70 = 0x0700AB70;
D_700BE00 = 0x0700BE00;

29
mips_to_c.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
if [ $# -lt 2 ]; then
echo 1>&2 "$0: not enough arguments"
echo 1>&2 "Usage: $0 path/to/sourcefile.c func_name"
exit 2
elif [ $# -gt 2 ]; then
echo 1>&2 "$0: too many arguments"
exit 2
fi
PYTHON=python3
SOURCEFILE=$1
FUNCNAME=$2
M2CFILE=m2cfiles/$FUNCNAME.c
ASMFILE=$(find . -type f -name "*$FUNCNAME.s")
# Support python venv's if one is installed.
PYTHON_VENV=.venv/bin/python3
if test -f $PYTHON_VENV; then
PYTHON=$PYTHON_VENV
fi
echo "Generating ctx.c from $SOURCEFILE..."
$PYTHON ./tools/m2ctx.py $SOURCEFILE
echo "Generating $M2CFILE..."
echo '#include "../ctx.c"\n' > $M2CFILE
$PYTHON ./tools/m2c/m2c.py --target mips-ido-c --pointer-style left --context ctx.c -f $FUNCNAME $ASMFILE >> $M2CFILE

View File

@ -2,30 +2,30 @@
static Vec3f D_8015F950;
void func_80035D30(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos) {
Object_8C_Initialize(obj8C);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_351;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
obj8C->vel.z = 0.0f;
obj8C->scale2 = 0.3f;
obj8C->unk_4A = 100;
obj8C->unk_48 = 3;
void func_80035D30(Effect* effect, f32 xPos, f32 yPos, f32 zPos) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_351;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
effect->vel.z = 0.0f;
effect->scale2 = 0.3f;
effect->unk_4A = 100;
effect->unk_48 = 3;
if (Rand_ZeroOne() < 0.5f) {
obj8C->unk_48 = -obj8C->unk_48;
effect->unk_48 = -effect->unk_48;
}
Object_SetInfo(&obj8C->info, obj8C->obj.id);
Object_SetInfo(&effect->info, effect->obj.id);
}
void func_80035DEC(f32 xPos, f32 yPos, f32 zPos) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (gObjects8C[i].obj.status == 0) {
func_80035D30(&gObjects8C[i], xPos, yPos, zPos);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
func_80035D30(&gEffects[i], xPos, yPos, zPos);
break;
}
}
@ -157,21 +157,21 @@ void func_80036318(PlayerShot* shot) {
}
}
void func_80036528(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 xRot, f32 scale, s32 unk44, s32 time) {
Object_8C_Initialize(obj8C);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_344;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
obj8C->obj.rot.y = yRot;
obj8C->obj.rot.x = xRot;
obj8C->scale2 = scale * 0.5f;
obj8C->unk_44 = unk44;
obj8C->unk_46 = 80;
obj8C->timer_50 = time;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
func_800A6070(&obj8C->sfxPos, 0x29000000);
void func_80036528(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 xRot, f32 scale, s32 unk44, s32 time) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_344;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
effect->obj.rot.y = yRot;
effect->obj.rot.x = xRot;
effect->scale2 = scale * 0.5f;
effect->unk_44 = unk44;
effect->unk_46 = 80;
effect->timer_50 = time;
Object_SetInfo(&effect->info, effect->obj.id);
func_800A6070(&effect->sfxPos, 0x29000000);
}
void func_800365E4(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 arg4, f32 arg5, f32 yRot, f32 xRot, f32 scale, s32 unk44,
@ -181,26 +181,26 @@ void func_800365E4(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 arg4, f32 arg5, f
if ((D_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_80161A88 != 2) && (gCurrentLevel != LEVEL_SOLAR) &&
(gCurrentLevel != LEVEL_BOLSE) && (gCurrentLevel != LEVEL_TRAINING) && (gCurrentLevel != LEVEL_ZONESS)) {
for (i = 0; i < 50; i++) {
if (gObjects8C[i].obj.status == 0) {
func_80036528(&gObjects8C[i], xPos, yPos, zPos, yRot, xRot, scale, unk44, time);
if (gEffects[i].obj.status == 0) {
func_80036528(&gEffects[i], xPos, yPos, zPos, yRot, xRot, scale, unk44, time);
break;
}
}
}
}
void func_800366CC(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 scale) {
Object_8C_Initialize(obj8C);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_345;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
obj8C->obj.rot.y = yRot;
obj8C->scale2 = scale * 0.5f;
obj8C->timer_50 = 80;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
func_800A6070(&obj8C->sfxPos, 0x29000000);
void func_800366CC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 scale) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_345;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
effect->obj.rot.y = yRot;
effect->scale2 = scale * 0.5f;
effect->timer_50 = 80;
Object_SetInfo(&effect->info, effect->obj.id);
func_800A6070(&effect->sfxPos, 0x29000000);
}
void func_80036770(f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 scale) {
@ -209,8 +209,8 @@ void func_80036770(f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 scale) {
if ((D_801784AC != 4) && (gLevelType == LEVELTYPE_PLANET) && (D_80161A88 <= 0) &&
(gCurrentLevel != LEVEL_TRAINING) && (gCurrentLevel != LEVEL_SOLAR) && (gCurrentLevel != LEVEL_ZONESS)) {
for (i = 0; i < 50; i++) {
if (gObjects8C[i].obj.status == 0) {
func_800366CC(&gObjects8C[i], xPos, yPos, zPos, yRot, scale);
if (gEffects[i].obj.status == 0) {
func_800366CC(&gEffects[i], xPos, yPos, zPos, yRot, scale);
func_8007D10C(xPos, yPos, zPos, 2.0f);
break;
}
@ -727,7 +727,7 @@ void func_80038140(PlayerShot* shot) {
Object_58* obj58;
Object_4C* obj4C;
Object_80* obj80;
Object_8C* obj8C;
Effect* effect;
bool sp60;
Player* player;
@ -736,15 +736,15 @@ void func_80038140(PlayerShot* shot) {
sp60 = false;
}
if (sp60) {
for (i = 0, obj8C = gObjects8C; i < 100; i++, obj8C++) {
if ((obj8C->obj.status >= 2) && (obj8C->info.unk_19 != 0) &&
(fabsf(shot->obj.pos.z - obj8C->obj.pos.z) < 200.0f) &&
(fabsf(shot->obj.pos.x - obj8C->obj.pos.x) < 100.0f) &&
(fabsf(shot->obj.pos.y - obj8C->obj.pos.y) < 100.0f)) {
if (obj8C->info.unk_19 == 2) {
obj8C->unk_44 = 1;
for (i = 0, effect = gEffects; i < 100; i++, effect++) {
if ((effect->obj.status >= 2) && (effect->info.unk_19 != 0) &&
(fabsf(shot->obj.pos.z - effect->obj.pos.z) < 200.0f) &&
(fabsf(shot->obj.pos.x - effect->obj.pos.x) < 100.0f) &&
(fabsf(shot->obj.pos.y - effect->obj.pos.y) < 100.0f)) {
if (effect->info.unk_19 == 2) {
effect->unk_44 = 1;
} else {
Object_Kill(&obj8C->obj, &obj8C->sfxPos);
Object_Kill(&effect->obj, &effect->sfxPos);
}
}
}
@ -1835,7 +1835,7 @@ void func_8003C4D0(PlayerShot* shot, s32 unkD6) {
Object_2F4* obj2F4;
Object_4C* obj4C;
Object_80* obj80;
Object_8C* obj8C;
Effect* effect;
Player* player;
f32 temp_fs2 = shot->unk_44 * 60.0f;
@ -1922,28 +1922,28 @@ void func_8003C4D0(PlayerShot* shot, s32 unkD6) {
} else {
func_8003C008(shot);
}
obj8C = gObjects8C;
for (i = 0; i < 100; i++, obj8C++) {
if (obj8C->obj.status == 2) {
sp68 = obj8C->obj.pos.x - shot->obj.pos.x;
sp64 = obj8C->obj.pos.y - shot->obj.pos.y;
sp60 = obj8C->obj.pos.z - shot->obj.pos.z;
effect = gEffects;
for (i = 0; i < 100; i++, effect++) {
if (effect->obj.status == 2) {
sp68 = effect->obj.pos.x - shot->obj.pos.x;
sp64 = effect->obj.pos.y - shot->obj.pos.y;
sp60 = effect->obj.pos.z - shot->obj.pos.z;
if (sqrtf(SQ(sp68) + SQ(sp64) + SQ(sp60)) < temp_fs2) {
if (obj8C->info.unk_16 == 0) {
Object_Kill(&obj8C->obj, &obj8C->sfxPos);
if (effect->info.unk_16 == 0) {
Object_Kill(&effect->obj, &effect->sfxPos);
}
if (obj8C->info.unk_16 == 2) {
obj8C->obj.pos.x += sp68 * 0.03f;
if (!((gLevelType == LEVELTYPE_PLANET) && (obj8C->obj.pos.y < 100.0f))) {
obj8C->obj.pos.y += sp64 * 0.03f;
if (effect->info.unk_16 == 2) {
effect->obj.pos.x += sp68 * 0.03f;
if (!((gLevelType == LEVELTYPE_PLANET) && (effect->obj.pos.y < 100.0f))) {
effect->obj.pos.y += sp64 * 0.03f;
}
obj8C->obj.pos.z += sp60 * 0.03f;
if ((obj8C->obj.id == OBJ_8C_392) && (obj8C->unk_4E == 0)) {
obj8C->unk_4E = 1;
obj8C->unk_44 = 176;
obj8C->unk_4C = 0;
obj8C->vel.x = obj8C->vel.y = obj8C->vel.z = 0.0f;
obj8C->scale2 = 20.0f;
effect->obj.pos.z += sp60 * 0.03f;
if ((effect->obj.id == OBJ_EFFECT_392) && (effect->unk_4E == 0)) {
effect->unk_4E = 1;
effect->unk_44 = 176;
effect->unk_4C = 0;
effect->vel.x = effect->vel.y = effect->vel.z = 0.0f;
effect->scale2 = 20.0f;
}
}
}
@ -2132,8 +2132,8 @@ void func_8003CF90(PlayerShot* shot) {
shot->obj.rot.y = shot->unk_30;
shot->obj.rot.x = shot->unk_2C;
Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * 0.017453292f, 0);
Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * 0.017453292f, 1);
Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, 0);
Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, 1);
sp44.x = sp44.y = 0.0f;
sp44.z = -(shot->unk_54 + 40.0f);
Matrix_MultVec3f(gCalcMatrix, &sp44, &sp38);

View File

@ -470,18 +470,18 @@ void func_80049968(Object_2F4* obj2F4, s32 arg1) {
Audio_PlaySfx(0x3100000CU, &obj2F4->sfxPos, 4U, &D_800C5D34, &D_800C5D34, &D_800C5D3C);
}
void func_80049A9C(Object_8C* obj8c, f32 x, f32 y, f32 z) {
Object_8C_Initialize(obj8c);
obj8c->obj.status = 1;
obj8c->obj.id = OBJ_8C_346;
obj8c->timer_50 = 100;
obj8c->scale2 = 0.2f;
obj8c->obj.pos.x = x;
obj8c->obj.pos.y = y;
obj8c->obj.pos.z = z;
obj8c->vel.z = 40.0f;
obj8c->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&obj8c->info, obj8c->obj.id);
void func_80049A9C(Effect* effect, f32 x, f32 y, f32 z) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_346;
effect->timer_50 = 100;
effect->scale2 = 0.2f;
effect->obj.pos.x = x;
effect->obj.pos.y = y;
effect->obj.pos.z = z;
effect->vel.z = 40.0f;
effect->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&effect->info, effect->obj.id);
}
void func_80049B44(void) {
@ -490,12 +490,12 @@ void func_80049B44(void) {
f32 y;
f32 z;
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (!gObjects8C[i].obj.status) {
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (!gEffects[i].obj.status) {
x = (Rand_ZeroOne() - 0.5f) * 400.0f;
y = (Rand_ZeroOne() - 0.5f) * 400.0f;
z = (-D_80177D20 - 500.0f) - Rand_ZeroOne() * 500.0f;
func_80049A9C(&gObjects8C[i], x, y, z);
func_80049A9C(&gEffects[i], x, y, z);
break;
}
}
@ -800,51 +800,51 @@ void func_8004A840(s32 obj2F4) {
func_8004A700(&gObjects2F4[obj2F4], obj2F4);
}
void func_8004A888(Object_8C* obj8C) {
void func_8004A888(Effect* effect) {
Vec3f sp2C;
Vec3f sp20;
Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_0E8 + 180.0f) * M_DTOR, 0);
Matrix_RotateX(gCalcMatrix, -(gPlayer[0].unk_0E4 * M_DTOR), 1);
Object_8C_Initialize(obj8C);
Effect_Initialize(effect);
obj8C->obj.status = 1;
effect->obj.status = 1;
sp2C.x = (Rand_ZeroOne() - 0.5f) * 1500.0f;
sp2C.y = (Rand_ZeroOne() - 0.5f) * 800.0f;
sp2C.z = 3000.0f;
Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20);
obj8C->obj.pos.x = gPlayer[0].pos.x + sp20.x;
obj8C->obj.pos.y = gPlayer[0].pos.y + sp20.y;
obj8C->obj.pos.z = gPlayer[0].pos.z + sp20.z;
effect->obj.pos.x = gPlayer[0].pos.x + sp20.x;
effect->obj.pos.y = gPlayer[0].pos.y + sp20.y;
effect->obj.pos.z = gPlayer[0].pos.z + sp20.z;
sp2C.x = 0.0f;
sp2C.y = 0.0f;
sp2C.z = -80.0f;
Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20);
obj8C->vel.x = sp20.x;
obj8C->vel.y = sp20.y;
obj8C->vel.z = sp20.z;
obj8C->obj.id = OBJ_8C_352;
obj8C->timer_50 = 0x28;
obj8C->unk_46 = 0x90;
obj8C->scale2 = (Rand_ZeroOne() * 30.0f) + 10.0f;
effect->vel.x = sp20.x;
effect->vel.y = sp20.y;
effect->vel.z = sp20.z;
effect->obj.id = OBJ_EFFECT_352;
effect->timer_50 = 0x28;
effect->unk_46 = 0x90;
effect->scale2 = (Rand_ZeroOne() * 30.0f) + 10.0f;
if (Rand_ZeroOne() < 0.5f) {
obj8C->obj.rot.z = 180.0f;
effect->obj.rot.z = 180.0f;
}
Object_SetInfo(&obj8C->info, obj8C->obj.id);
Object_SetInfo(&effect->info, effect->obj.id);
}
void func_8004AA84(void) {
s32 i;
if (!(gFrameCount & 7) && (gLevelType == LEVEL_CORNERIA)) {
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (!gObjects8C[i].obj.status) {
func_8004A888(&gObjects8C[i]);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (!gEffects[i].obj.status) {
func_8004A888(&gEffects[i]);
break;
}
}

View File

@ -763,66 +763,66 @@ ObjectInfo D_800CC124[0x190] = {
/* OBJ_ITEM_GOLD_RING */ {(void*) func_8005CA80, 1, (ObjectFunc) func_800685F8, D_800CBF54, 700.0f, 0, 0, 0, 0, 0.0f, 0 },
/* OBJ_ITEM_WING_REPAIR */ {(void*) D_3007650, 0, (ObjectFunc) func_80068618, D_800CBFA8, 700.0f, 0, 0, 0, 0, 0.0f, 0 },
/* OBJ_ITEM_TRAINING_RING */ {(void*) D_6006140, 0, (ObjectFunc) func_80198968, D_6009CFC, 700.0f, 0, 0, 0, 0, 0.0f, 0 },
/* OBJ_8C_339 */ {(void*) func_8007D55C, 1, (ObjectFunc) func_8007D2F4, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_340 */ {(void*) func_8007D55C, 1, (ObjectFunc) func_8007D748, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_341 */ {(void*) func_8007D55C, 1, (ObjectFunc) func_8007D8A8, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_342 */ {(void*) func_8007E330, 1, (ObjectFunc) func_8007E298, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_343 */ {(void*) func_8007CAF0, 1, (ObjectFunc) func_8007C9E0, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_344 */ {(void*) func_8007868C, 1, (ObjectFunc) func_8007E014, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_345 */ {(void*) func_8007879C, 1, (ObjectFunc) func_8007E258, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_346 */ {(void*) func_800788B0, 1, (ObjectFunc) func_8007F438, NULL, -200.0f, 1, 0, 0, 0, 0.0f, 0 },
/* OBJ_8C_347 */ {(void*) func_800783C0, 1, (ObjectFunc) func_8007B758, NULL, 100.0f, 1, 0, 40, 0, 0.0f, 0 },
/* OBJ_8C_348 */ {(void*) func_80078A64, 1, (ObjectFunc) func_8007F6B0, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_349 */ {(void*) NULL, 1, (ObjectFunc) func_8007F958, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_350 */ {(void*) NULL, 1, (ObjectFunc) func_8007FBE0, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_351 */ {(void*) func_80078438, 1, (ObjectFunc) func_8007E3E4, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_352 */ {(void*) func_800784B4, 1, (ObjectFunc) func_8007B62C, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_353 */ {(void*) func_80078B8C, 1, (ObjectFunc) func_8007FE88, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 },
/* OBJ_8C_354 */ {(void*) func_80197C64, 1, (ObjectFunc) func_8007FE88, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 },
/* OBJ_8C_355 */ {(void*) func_80078AEC, 1, (ObjectFunc) func_800802B8, NULL, 100.0f, 1, 0, 20, 1, 0.0f, 0 },
/* OBJ_8C_356 */ {(void*) func_80078C84, 1, (ObjectFunc) func_800802F8, NULL, 100.0f, 1, 0, 20, 0, 0.0f, 0 },
/* OBJ_8C_357 */ {(void*) func_800798F0, 1, (ObjectFunc) func_8007968C, NULL, 100.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_358 */ {(void*) func_80192A68, 1, (ObjectFunc) func_80192984, NULL, 100.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_359 */ {(void*) func_8007AA60, 1, (ObjectFunc) func_8007A994, NULL, -100.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_360 */ {(void*) func_8007BEE8, 1, (ObjectFunc) func_8007BE54, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_361 */ {(void*) func_8007BEE8, 1, (ObjectFunc) func_8007BDE0, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_362 */ {(void*) func_8007BEE8, 1, (ObjectFunc) func_8007BCE8, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_363 */ {(void*) func_80094BBC, 1, (ObjectFunc) func_80094954, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_364 */ {(void*) func_8007B9DC, 1, (ObjectFunc) func_8007B960, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_365 */ {(void*) func_8007E5CC, 1, (ObjectFunc) func_8007E45C, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_366 */ {(void*) func_80078550, 1, (ObjectFunc) func_E16C50_801AC918, NULL, 100.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_8C_367 */ {(void*) func_80078604, 1, (ObjectFunc) func_8007E648, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_368 */ {(void*) func_80188FA8, 1, (ObjectFunc) func_80188F60, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_369 */ {(void*) func_8018DCE4, 1, (ObjectFunc) func_80188CAC, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_8C_370 */ {(void*) func_8018DBEC, 1, (ObjectFunc) func_80188FAC, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_8C_371 */ {(void*) func_8018DE14, 1, (ObjectFunc) func_80189114, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_8C_372 */ {(void*) func_80077A00, 1, (ObjectFunc) func_8007AB50, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_373 */ {(void*) NULL, 1, (ObjectFunc) func_8007A748, NULL, 500.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_374 */ {(void*) func_8007DED4, 1, (ObjectFunc) func_8007DB70, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_8C_375 */ {(void*) func_8007DAE4, 1, (ObjectFunc) func_8007DA58, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_376 */ {(void*) func_80078CE8, 1, (ObjectFunc) func_80080360, NULL, -200.0f, 1, 0, 0, 0, 0.0f, 0 },
/* OBJ_8C_377 */ {(void*) func_80078BE0, 1, (ObjectFunc) func_800802D8, NULL, 100.0f, 1, 0, 20, 0, 0.0f, 0 },
/* OBJ_8C_378 */ {(void*) func_801A5AF0, 1, (ObjectFunc) func_801A57D0, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 },
/* OBJ_8C_379 */ {(void*) func_801AEAA0, 1, (ObjectFunc) func_801AE87C, NULL, 100.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_380 */ {(void*) func_801A5D68, 1, (ObjectFunc) func_801A5B4C, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 },
/* OBJ_8C_381 */ {(void*) func_80077A7C, 1, (ObjectFunc) func_8007B0F4, NULL, 500.0f, 0, 0, 0, 0, 0.0f, 0 },
/* OBJ_8C_382 */ {(void*) NULL, 1, (ObjectFunc) func_8007B040, NULL, 200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_383 */ {(void*) func_8007A3C0, 1, (ObjectFunc) func_8007A28C, NULL, 10000.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_384 */ {(void*) func_80077B84, 1, (ObjectFunc) func_8007B3B8, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_385 */ {(void*) func_80078038, 1, (ObjectFunc) func_8007B5C0, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_386 */ {(void*) NULL, 1, (ObjectFunc) func_8007C250, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_387 */ {(void*) NULL, 1, (ObjectFunc) func_8007C8C4, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_388 */ {(void*) func_80077B78, 1, (ObjectFunc) func_8007B670, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_389 */ {(void*) func_800780F8, 1, (ObjectFunc) func_8007B67C, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_390 */ {(void*) NULL, 1, (ObjectFunc) func_8007C50C, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_391 */ {(void*) func_80083B8C, 1, (ObjectFunc) func_800837EC, NULL, 500.0f, 0, 0, 0, 0, 0.0f, 0 },
/* OBJ_8C_392 */ {(void*) func_E16C50_801A0AF0, 1, (ObjectFunc) func_E16C50_801A0120, NULL, 300.0f, 1, 2, 10, 0, 0.0f, 0 },
/* OBJ_8C_393 */ {(void*) func_80078F78, 1, (ObjectFunc) func_80078EBC, NULL, 300.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_394 */ {(void*) func_80080D04, 1, (ObjectFunc) func_80080ACC, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_8C_395 */ {(void*) func_80082F78, 1, (ObjectFunc) func_80081C5C, NULL, 300.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_8C_396 */ {(void*) func_8018CF98, 1, (ObjectFunc) func_8018CAD4, NULL, 2000.0f, 0, 1, 40, 2, 0.0f, 0 },
/* OBJ_8C_397 */ {(void*) func_80191180, 1, (ObjectFunc) func_80191054, NULL, 2000.0f, 0, 1, 20, 0, 0.0f, 0 },
/* OBJ_8C_398 */ {(void*) func_8008092C, 1, (ObjectFunc) func_8008040C, NULL, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_8C_399 */ {(void*) func_80084194, 1, (ObjectFunc) func_80083FA8, NULL, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_EFFECT_339 */ {(void*) func_8007D55C, 1, (ObjectFunc) func_8007D2F4, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_340 */ {(void*) func_8007D55C, 1, (ObjectFunc) func_8007D748, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_341 */ {(void*) func_8007D55C, 1, (ObjectFunc) func_8007D8A8, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_342 */ {(void*) func_8007E330, 1, (ObjectFunc) func_8007E298, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_343 */ {(void*) func_8007CAF0, 1, (ObjectFunc) func_8007C9E0, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_344 */ {(void*) func_8007868C, 1, (ObjectFunc) func_8007E014, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_345 */ {(void*) func_8007879C, 1, (ObjectFunc) func_8007E258, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_346 */ {(void*) func_800788B0, 1, (ObjectFunc) func_8007F438, NULL, -200.0f, 1, 0, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_347 */ {(void*) func_800783C0, 1, (ObjectFunc) func_8007B758, NULL, 100.0f, 1, 0, 40, 0, 0.0f, 0 },
/* OBJ_EFFECT_348 */ {(void*) func_80078A64, 1, (ObjectFunc) func_8007F6B0, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_349 */ {(void*) NULL, 1, (ObjectFunc) func_8007F958, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_350 */ {(void*) NULL, 1, (ObjectFunc) func_8007FBE0, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_351 */ {(void*) func_80078438, 1, (ObjectFunc) func_8007E3E4, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_352 */ {(void*) func_800784B4, 1, (ObjectFunc) func_8007B62C, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_353 */ {(void*) func_80078B8C, 1, (ObjectFunc) func_8007FE88, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 },
/* OBJ_EFFECT_354 */ {(void*) func_80197C64, 1, (ObjectFunc) func_8007FE88, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 },
/* OBJ_EFFECT_355 */ {(void*) func_80078AEC, 1, (ObjectFunc) func_800802B8, NULL, 100.0f, 1, 0, 20, 1, 0.0f, 0 },
/* OBJ_EFFECT_356 */ {(void*) func_80078C84, 1, (ObjectFunc) func_800802F8, NULL, 100.0f, 1, 0, 20, 0, 0.0f, 0 },
/* OBJ_EFFECT_357 */ {(void*) func_800798F0, 1, (ObjectFunc) func_8007968C, NULL, 100.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_358 */ {(void*) func_80192A68, 1, (ObjectFunc) func_80192984, NULL, 100.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_359 */ {(void*) func_8007AA60, 1, (ObjectFunc) func_8007A994, NULL, -100.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_360 */ {(void*) func_8007BEE8, 1, (ObjectFunc) func_8007BE54, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_361 */ {(void*) func_8007BEE8, 1, (ObjectFunc) func_8007BDE0, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_362 */ {(void*) func_8007BEE8, 1, (ObjectFunc) func_8007BCE8, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_363 */ {(void*) func_80094BBC, 1, (ObjectFunc) func_80094954, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_364 */ {(void*) func_8007B9DC, 1, (ObjectFunc) func_8007B960, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_365 */ {(void*) func_8007E5CC, 1, (ObjectFunc) func_8007E45C, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_366 */ {(void*) func_80078550, 1, (ObjectFunc) func_E16C50_801AC918, NULL, 100.0f, 1, 2, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_367 */ {(void*) func_80078604, 1, (ObjectFunc) func_8007E648, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_368 */ {(void*) func_80188FA8, 1, (ObjectFunc) func_80188F60, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_369 */ {(void*) func_8018DCE4, 1, (ObjectFunc) func_80188CAC, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_EFFECT_370 */ {(void*) func_8018DBEC, 1, (ObjectFunc) func_80188FAC, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_EFFECT_371 */ {(void*) func_8018DE14, 1, (ObjectFunc) func_80189114, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_EFFECT_372 */ {(void*) func_80077A00, 1, (ObjectFunc) func_8007AB50, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_373 */ {(void*) NULL, 1, (ObjectFunc) func_8007A748, NULL, 500.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_374 */ {(void*) func_8007DED4, 1, (ObjectFunc) func_8007DB70, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_EFFECT_375 */ {(void*) func_8007DAE4, 1, (ObjectFunc) func_8007DA58, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_376 */ {(void*) func_80078CE8, 1, (ObjectFunc) func_80080360, NULL, -200.0f, 1, 0, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_377 */ {(void*) func_80078BE0, 1, (ObjectFunc) func_800802D8, NULL, 100.0f, 1, 0, 20, 0, 0.0f, 0 },
/* OBJ_EFFECT_378 */ {(void*) func_801A5AF0, 1, (ObjectFunc) func_801A57D0, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 },
/* OBJ_EFFECT_379 */ {(void*) func_801AEAA0, 1, (ObjectFunc) func_801AE87C, NULL, 100.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_380 */ {(void*) func_801A5D68, 1, (ObjectFunc) func_801A5B4C, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 },
/* OBJ_EFFECT_381 */ {(void*) func_80077A7C, 1, (ObjectFunc) func_8007B0F4, NULL, 500.0f, 0, 0, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_382 */ {(void*) NULL, 1, (ObjectFunc) func_8007B040, NULL, 200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_383 */ {(void*) func_8007A3C0, 1, (ObjectFunc) func_8007A28C, NULL, 10000.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_384 */ {(void*) func_80077B84, 1, (ObjectFunc) func_8007B3B8, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_385 */ {(void*) func_80078038, 1, (ObjectFunc) func_8007B5C0, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_386 */ {(void*) NULL, 1, (ObjectFunc) func_8007C250, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_387 */ {(void*) NULL, 1, (ObjectFunc) func_8007C8C4, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_388 */ {(void*) func_80077B78, 1, (ObjectFunc) func_8007B670, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_389 */ {(void*) func_800780F8, 1, (ObjectFunc) func_8007B67C, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_390 */ {(void*) NULL, 1, (ObjectFunc) func_8007C50C, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_391 */ {(void*) func_80083B8C, 1, (ObjectFunc) func_800837EC, NULL, 500.0f, 0, 0, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_392 */ {(void*) func_E16C50_801A0AF0, 1, (ObjectFunc) func_E16C50_801A0120, NULL, 300.0f, 1, 2, 10, 0, 0.0f, 0 },
/* OBJ_EFFECT_393 */ {(void*) func_80078F78, 1, (ObjectFunc) func_80078EBC, NULL, 300.0f, 1, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_394 */ {(void*) func_80080D04, 1, (ObjectFunc) func_80080ACC, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 },
/* OBJ_EFFECT_395 */ {(void*) func_80082F78, 1, (ObjectFunc) func_80081C5C, NULL, 300.0f, 0, 1, 40, 0, 0.0f, 0 },
/* OBJ_EFFECT_396 */ {(void*) func_8018CF98, 1, (ObjectFunc) func_8018CAD4, NULL, 2000.0f, 0, 1, 40, 2, 0.0f, 0 },
/* OBJ_EFFECT_397 */ {(void*) func_80191180, 1, (ObjectFunc) func_80191054, NULL, 2000.0f, 0, 1, 20, 0, 0.0f, 0 },
/* OBJ_EFFECT_398 */ {(void*) func_8008092C, 1, (ObjectFunc) func_8008040C, NULL, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
/* OBJ_EFFECT_399 */ {(void*) func_80084194, 1, (ObjectFunc) func_80083FA8, NULL, 100.0f, 0, 0, 40, 0, 0.0f, 0 },
};
// clang-format on

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "prevent_bss_reordering.h"
Vec3f D_801615D0;
Vec3f D_801615E0;
@ -621,8 +620,8 @@ void func_8005BAB4(ObjectId objId, s32 index) {
f32 temp2;
switch (objId) {
case OBJ_8C_374:
if (gObjects8C[index].unk_4E == 0) {
case OBJ_EFFECT_374:
if (gEffects[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);
@ -1186,34 +1185,35 @@ void Boss_Draw(Boss* boss, s32 arg1) {
}
}
void Object_8C_Draw1(Object_8C* obj8C, s32 arg1) {
if ((arg1 < 0) && (obj8C->obj.pos.y < 7.0f)) {
void Effect_Draw1(Effect* effect, s32 arg1) {
if ((arg1 < 0) && (effect->obj.pos.y < 7.0f)) {
return;
}
if ((obj8C->obj.id == OBJ_8C_353) || (obj8C->obj.id == OBJ_8C_369)) {
func_8005D3CC(&obj8C->obj, obj8C->unk_60.x, obj8C->unk_60.y, obj8C->unk_60.z, 0);
} else if (obj8C->info.unk_14 == -1) {
obj8C->obj.pos.y += D_8017847C;
func_8005D008(&obj8C->obj, 0);
obj8C->obj.pos.y -= D_8017847C;
if ((effect->obj.id == OBJ_EFFECT_353) || (effect->obj.id == OBJ_EFFECT_369)) {
func_8005D3CC(&effect->obj, effect->unk_60.x, effect->unk_60.y, effect->unk_60.z, 0);
} else if (effect->info.unk_14 == -1) {
effect->obj.pos.y += D_8017847C;
func_8005D008(&effect->obj, 0);
effect->obj.pos.y -= D_8017847C;
} else {
func_8005D008(&obj8C->obj, 0);
func_8005D008(&effect->obj, 0);
}
if (obj8C->info.draw != NULL) {
obj8C->info.draw(&obj8C->obj);
if (effect->info.draw != NULL) {
effect->info.draw(&effect->obj);
}
}
void Object_8C_Draw2(Object_8C* obj8C) {
void Effect_Draw2(Effect* effect) {
Vec3f sp4C = { 0.0f, 0.0f, 0.0f };
Vec3f sp40;
f32 var_fv0;
u8 sp3B = 0;
if (obj8C->info.unk_14 == -1) {
Matrix_Translate(gGfxMatrix, obj8C->obj.pos.x, obj8C->obj.pos.y + D_8017847C, obj8C->obj.pos.z + D_80177D20, 1);
if (effect->info.unk_14 == -1) {
Matrix_Translate(gGfxMatrix, effect->obj.pos.x, effect->obj.pos.y + D_8017847C, effect->obj.pos.z + D_80177D20,
1);
} else {
Matrix_Translate(gGfxMatrix, obj8C->obj.pos.x, obj8C->obj.pos.y, obj8C->obj.pos.z + D_80177D20, 1);
Matrix_Translate(gGfxMatrix, effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + D_80177D20, 1);
}
Matrix_MultVec3f(gGfxMatrix, &sp4C, &sp40);
if ((gCurrentLevel == LEVEL_SECTOR_Z) || (gCurrentLevel == LEVEL_BOLSE)) {
@ -1224,20 +1224,20 @@ void Object_8C_Draw2(Object_8C* obj8C) {
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 (obj8C->info.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);
if (effect->info.draw != NULL) {
Matrix_RotateY(gGfxMatrix, effect->obj.rot.y * M_DTOR, 1);
Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, 1);
Matrix_RotateZ(gGfxMatrix, effect->obj.rot.z * M_DTOR, 1);
Matrix_SetGfxMtx(&gMasterDisp);
obj8C->info.draw(&obj8C->obj);
effect->info.draw(&effect->obj);
}
sp3B = 1;
}
}
}
func_8005F290(&obj8C->sfxPos, &sp40);
if ((sp3B == 0) && (obj8C->obj.id != OBJ_8C_352) && (obj8C->obj.id != OBJ_8C_373) && (!gVersusMode)) {
Object_Kill(&obj8C->obj, &obj8C->sfxPos);
func_8005F290(&effect->sfxPos, &sp40);
if ((sp3B == 0) && (effect->obj.id != OBJ_EFFECT_352) && (effect->obj.id != OBJ_EFFECT_373) && (!gVersusMode)) {
Object_Kill(&effect->obj, &effect->sfxPos);
}
}
@ -1675,27 +1675,27 @@ void Object_DrawAll(s32 arg0) {
void func_8006046C(s32 arg0) {
s32 i;
Boss* boss;
Object_8C* obj8C;
Effect* effect;
RCP_SetupDL(&gMasterDisp, 0x40);
for (i = 0, obj8C = gObjects8C; i < ARRAY_COUNT(gObjects8C); i++, obj8C++) {
if (obj8C->obj.status >= 2) {
if (obj8C->info.unk_14 == 1) {
obj8C->obj.rot.y = (-gPlayer[gPlayerNum].unk_058 * 180.0f) / M_PI;
obj8C->obj.rot.x = (gPlayer[gPlayerNum].unk_05C * 180.0f) / M_PI;
for (i = 0, effect = gEffects; i < ARRAY_COUNT(gEffects); i++, effect++) {
if (effect->obj.status >= 2) {
if (effect->info.unk_14 == 1) {
effect->obj.rot.y = (-gPlayer[gPlayerNum].unk_058 * 180.0f) / M_PI;
effect->obj.rot.x = (gPlayer[gPlayerNum].unk_05C * 180.0f) / M_PI;
}
if (gLevelMode == LEVELMODE_ALL_RANGE) {
Matrix_Push(&gGfxMatrix);
Object_8C_Draw2(obj8C);
Effect_Draw2(effect);
Matrix_Pop(&gGfxMatrix);
} else {
Matrix_Push(&gGfxMatrix);
Object_8C_Draw1(obj8C, arg0);
Effect_Draw1(effect, arg0);
Matrix_Pop(&gGfxMatrix);
func_8005F1EC(&obj8C->sfxPos);
if (obj8C->obj.id == OBJ_8C_374) {
func_8005F1EC(&effect->sfxPos);
if (effect->obj.id == OBJ_EFFECT_374) {
Matrix_Push(&gGfxMatrix);
func_8005ECD8(i, &obj8C->obj);
func_8005ECD8(i, &effect->obj);
Matrix_Pop(&gGfxMatrix);
}
}

3932
src/main/fox_effect.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -167,14 +167,14 @@ void Item_Initialize(Item* item) {
}
}
void Object_8C_Initialize(Object_8C* obj8C) {
void Effect_Initialize(Effect* effect) {
s32 i;
u8* ptr = (u8*) obj8C;
u8* ptr = (u8*) effect;
for (i = 0; i < sizeof(Object_8C); i++, ptr++) {
for (i = 0; i < sizeof(Effect); i++, ptr++) {
*ptr = 0;
}
obj8C->scale2 = 1.0f;
effect->scale2 = 1.0f;
}
void Object_80_Load(Object_80* obj80, ObjectInit* objInit) {
@ -248,24 +248,24 @@ void Item_Load(Item* item, ObjectInit* objInit) {
Object_SetInfo(&item->info, item->obj.id);
}
void func_80061958(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos) {
Object_8C_Initialize(obj8C);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_346;
obj8C->timer_50 = 50;
obj8C->scale2 = 0.2f;
void func_80061958(Effect* effect, f32 xPos, f32 yPos, f32 zPos) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_346;
effect->timer_50 = 50;
effect->scale2 = 0.2f;
if (gCurrentLevel == LEVEL_AQUAS) {
obj8C->timer_50 = 200;
obj8C->scale2 = 0.3f;
obj8C->scale1 = Rand_ZeroOne() * 255.0f;
effect->timer_50 = 200;
effect->scale2 = 0.3f;
effect->scale1 = Rand_ZeroOne() * 255.0f;
}
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
effect->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&effect->info, effect->obj.id);
if (gLevelType == LEVELTYPE_PLANET) {
obj8C->info.unk_10 = 100.0f;
effect->info.unk_10 = 100.0f;
}
}
@ -276,8 +276,8 @@ void func_80061A4C(void) {
f32 z;
f32 sp1C;
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (gObjects8C[i].obj.status == 0) {
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
sp1C = (Rand_ZeroOne() - 0.5f);
x = gPlayer[0].pos.x + (sp1C * 400.0f) + (5.0f * gPlayer[0].vel.x);
sp1C = (Rand_ZeroOne() - 0.5f);
@ -286,7 +286,7 @@ void func_80061A4C(void) {
if (D_80177D08 < 0.0f) {
z = -D_80177D20 + 500.0f;
}
func_80061958(&gObjects8C[i], x, y, z);
func_80061958(&gEffects[i], x, y, z);
break;
}
}
@ -299,8 +299,8 @@ void func_80061B68(void) {
f32 z;
f32 sp1C;
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (gObjects8C[i].obj.status == 0) {
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
sp1C = (Rand_ZeroOne() - 0.5f);
x = gPlayer[0].pos.x + (sp1C * 2000.0f) + (5.0f * gPlayer[0].vel.x);
@ -313,7 +313,7 @@ void func_80061B68(void) {
if (D_80177D08 < 0.0f) {
z = -D_80177D20 + 1000.0f;
}
func_80061958(&gObjects8C[i], x, y, z);
func_80061958(&gEffects[i], x, y, z);
break;
}
}
@ -326,8 +326,8 @@ void func_80061CD0(void) {
f32 z;
f32 sp1C;
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (gObjects8C[i].obj.status == 0) {
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
sp1C = (Rand_ZeroOne() - 0.5f);
x = gPlayer[gPlayerNum].pos.x + (sp1C * 3000.0f) + (5.0f * gPlayer[gPlayerNum].vel.x);
sp1C = (Rand_ZeroOne() - 0.5f);
@ -336,7 +336,7 @@ void func_80061CD0(void) {
if (D_80177D08 < 0.0f) {
z = -D_80177D20 + 1000.0f;
}
func_80061958(&gObjects8C[i], x, y, z);
func_80061958(&gEffects[i], x, y, z);
break;
}
}
@ -448,7 +448,7 @@ void Object_Load(ObjectInit* objInit, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
}
}
}
if ((objInit->id >= OBJ_ITEM_LASERS) && (objInit->id < OBJ_8C_339)) {
if ((objInit->id >= OBJ_ITEM_LASERS) && (objInit->id < OBJ_EFFECT_339)) {
for (i = 0; i < ARRAY_COUNT(gItems); i++) {
if (gItems[i].obj.status == 0) {
Item_Load(&gItems[i], objInit);
@ -456,7 +456,7 @@ void Object_Load(ObjectInit* objInit, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
}
}
}
if (objInit->id >= OBJ_8C_339 && objInit->id <= OBJ_UNK_406) {
if (objInit->id >= OBJ_EFFECT_339 && objInit->id <= OBJ_UNK_406) {
switch (objInit->id) {
case OBJ_UNK_403:
D_E6A810_801BA1E8 = 99;
@ -578,19 +578,19 @@ void func_80062B60(f32 xPos, f32 zPos, s32 arg2, f32 arg3) {
s32 i;
if (gLevelType == LEVELTYPE_PLANET) {
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (gObjects8C[i].obj.status == 0) {
Object_8C_Initialize(&gObjects8C[i]);
gObjects8C[i].obj.status = 1;
gObjects8C[i].obj.id = OBJ_8C_348;
gObjects8C[i].obj.pos.x = xPos;
gObjects8C[i].obj.pos.y = D_80177940 + 3.0f;
gObjects8C[i].obj.pos.z = zPos;
gObjects8C[i].scale2 = 10.0f;
gObjects8C[i].scale1 = arg3;
gObjects8C[i].unk_44 = 80;
gObjects8C[i].unk_4E = arg2;
Object_SetInfo(&gObjects8C[i].info, gObjects8C[i].obj.id);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
Effect_Initialize(&gEffects[i]);
gEffects[i].obj.status = 1;
gEffects[i].obj.id = OBJ_EFFECT_348;
gEffects[i].obj.pos.x = xPos;
gEffects[i].obj.pos.y = D_80177940 + 3.0f;
gEffects[i].obj.pos.z = zPos;
gEffects[i].scale2 = 10.0f;
gEffects[i].scale1 = arg3;
gEffects[i].unk_44 = 80;
gEffects[i].unk_4E = arg2;
Object_SetInfo(&gEffects[i].info, gEffects[i].obj.id);
break;
}
}
@ -601,18 +601,18 @@ void func_80062C38(f32 xPos, f32 yPos) {
s32 i;
if (gLevelType == LEVELTYPE_PLANET) {
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (gObjects8C[i].obj.status == 0) {
Object_8C_Initialize(&gObjects8C[i]);
gObjects8C[i].obj.status = 1;
gObjects8C[i].obj.id = OBJ_8C_349;
gObjects8C[i].obj.pos.x = xPos;
gObjects8C[i].obj.pos.y = D_80177940 + 3.0f;
gObjects8C[i].obj.pos.z = yPos;
gObjects8C[i].scale2 = 1.0f;
gObjects8C[i].scale1 = 1.3f;
gObjects8C[i].unk_44 = 120;
Object_SetInfo(&gObjects8C[i].info, gObjects8C[i].obj.id);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
Effect_Initialize(&gEffects[i]);
gEffects[i].obj.status = 1;
gEffects[i].obj.id = OBJ_EFFECT_349;
gEffects[i].obj.pos.x = xPos;
gEffects[i].obj.pos.y = D_80177940 + 3.0f;
gEffects[i].obj.pos.z = yPos;
gEffects[i].scale2 = 1.0f;
gEffects[i].scale1 = 1.3f;
gEffects[i].unk_44 = 120;
Object_SetInfo(&gEffects[i].info, gEffects[i].obj.id);
break;
}
}
@ -622,18 +622,18 @@ void func_80062C38(f32 xPos, f32 yPos) {
void func_80062D04(f32 xPos, f32 yPos) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (gObjects8C[i].obj.status == 0) {
Object_8C_Initialize(&gObjects8C[i]);
gObjects8C[i].obj.status = 1;
gObjects8C[i].obj.id = OBJ_8C_350;
gObjects8C[i].obj.pos.x = xPos;
gObjects8C[i].obj.pos.y = D_80177940 + 3.0f;
gObjects8C[i].obj.pos.z = yPos;
gObjects8C[i].scale2 = 3.0f;
gObjects8C[i].scale1 = 2.0f;
gObjects8C[i].unk_44 = 120;
Object_SetInfo(&gObjects8C[i].info, gObjects8C[i].obj.id);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
Effect_Initialize(&gEffects[i]);
gEffects[i].obj.status = 1;
gEffects[i].obj.id = OBJ_EFFECT_350;
gEffects[i].obj.pos.x = xPos;
gEffects[i].obj.pos.y = D_80177940 + 3.0f;
gEffects[i].obj.pos.z = yPos;
gEffects[i].scale2 = 3.0f;
gEffects[i].scale1 = 2.0f;
gEffects[i].unk_44 = 120;
Object_SetInfo(&gEffects[i].info, gEffects[i].obj.id);
break;
}
}
@ -1016,15 +1016,15 @@ void Object_Init(s32 index, ObjectId objId) {
case OBJ_2F4_247:
func_E16C50_8019D060(&gObjects2F4[index]);
break;
case OBJ_8C_368:
case OBJ_EFFECT_368:
if (gCurrentLevel == LEVEL_TITANIA) {
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;
func_E6A810_801B6E20(gEffects[index].obj.pos.x, gEffects[index].obj.pos.z + D_80177D20, &sp54, &sp4C,
&sp50);
gEffects[index].obj.pos.y = sp4C + 3.0f;
gEffects[index].obj.rot.x = (sp54 * 180.0f) / M_PI;
gEffects[index].obj.rot.z = (sp50 * 180.0f) / M_PI;
} else if (gCurrentLevel == LEVEL_MACBETH) {
gObjects8C[index].obj.status = 0;
gEffects[index].obj.status = 0;
}
break;
case OBJ_80_30:
@ -2573,16 +2573,16 @@ void func_80069858(Object_4C* obj4C) {
}
}
void func_80069924(Object_8C* obj8C) {
obj8C->obj.pos.x += obj8C->vel.x;
obj8C->obj.pos.y += obj8C->vel.y;
obj8C->obj.pos.z += obj8C->vel.z;
void func_80069924(Effect* effect) {
effect->obj.pos.x += effect->vel.x;
effect->obj.pos.y += effect->vel.y;
effect->obj.pos.z += effect->vel.z;
if (D_80161AB8 != 0) {
if ((gPlayer[0].camEye.z + obj8C->info.unk_10) < (obj8C->obj.pos.z + D_80177D20)) {
Object_Kill(&obj8C->obj, &obj8C->sfxPos);
} else if ((fabsf(obj8C->obj.pos.y - gPlayer[0].camEye.y) > 25000.0f) ||
(fabsf(obj8C->obj.pos.x - gPlayer[0].camEye.x) > 25000.0f)) {
Object_Kill(&obj8C->obj, &obj8C->sfxPos);
if ((gPlayer[0].camEye.z + effect->info.unk_10) < (effect->obj.pos.z + D_80177D20)) {
Object_Kill(&effect->obj, &effect->sfxPos);
} else if ((fabsf(effect->obj.pos.y - gPlayer[0].camEye.y) > 25000.0f) ||
(fabsf(effect->obj.pos.x - gPlayer[0].camEye.x) > 25000.0f)) {
Object_Kill(&effect->obj, &effect->sfxPos);
}
}
}
@ -2763,19 +2763,19 @@ void Item_Update(Item* item) {
}
}
void Object_8C_Update(Object_8C* obj8C) {
if (obj8C->timer_50 != 0) {
obj8C->timer_50--;
void Effect_Update(Effect* effect) {
if (effect->timer_50 != 0) {
effect->timer_50--;
}
switch (obj8C->obj.status) {
switch (effect->obj.status) {
case 1:
obj8C->obj.status = 2;
Object_Init(obj8C->index, obj8C->obj.id);
effect->obj.status = 2;
Object_Init(effect->index, effect->obj.id);
/* fallthrough */
case 2:
func_80069924(obj8C);
if ((obj8C->obj.status != 0) && (obj8C->info.action != NULL)) {
obj8C->info.action(&obj8C->obj);
func_80069924(effect);
if ((effect->obj.status != 0) && (effect->info.action != NULL)) {
effect->info.action(&effect->obj);
}
break;
}
@ -2852,7 +2852,7 @@ void Object_UpdateAll(void) {
Object_4C* obj4C;
Object_80* obj80;
Item* item;
Object_8C* obj8C;
Effect* effect;
D_80161AB8 = 0;
if ((gLevelMode == LEVELMODE_ON_RAILS) &&
@ -2906,10 +2906,10 @@ void Object_UpdateAll(void) {
Item_Update(item);
}
}
for (i = 0, obj8C = gObjects8C; i < ARRAY_COUNT(gObjects8C); i++, obj8C++) {
if (obj8C->obj.status != 0) {
obj8C->index = i;
Object_8C_Update(obj8C);
for (i = 0, effect = gEffects; i < ARRAY_COUNT(gEffects); i++, effect++) {
if (effect->obj.status != 0) {
effect->index = i;
Effect_Update(effect);
}
}
func_8006A38C();

View File

@ -4,7 +4,6 @@ s32 D_800CFF80[4] = { 0, 0, 0, 0 };
s32 D_800CFF90 = 0;
s32 D_80161690;
void func_8007F11C(s32, f32, f32, f32, f32);
void func_80187530(Object_2F4*); // figure out which one later
void func_8006A7B0(u16* msg, s32 character) {
@ -14,38 +13,38 @@ void func_8006A7B0(u16* msg, s32 character) {
}
}
void func_8006A800(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 arg4) {
Object_8C_Initialize(obj8C);
void func_8006A800(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) {
Effect_Initialize(effect);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_361;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
obj8C->unk_48 = 3;
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_361;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
effect->unk_48 = 3;
if (Rand_ZeroOne() < 0.5f) {
obj8C->unk_48 = -obj8C->unk_48;
effect->unk_48 = -effect->unk_48;
}
obj8C->unk_4A = 100;
obj8C->scale2 = arg4 * 0.25f;
obj8C->scale1 = 0.3f;
effect->unk_4A = 100;
effect->scale2 = arg4 * 0.25f;
effect->scale1 = 0.3f;
if (arg4 < 10.0f) {
obj8C->scale1 = 0.1f;
effect->scale1 = 0.1f;
}
obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
effect->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&effect->info, effect->obj.id);
}
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], xPos, yPos, zPos, arg3);
for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) {
if (gEffects[i].obj.status == 0) {
func_8006A800(&gEffects[i], xPos, yPos, zPos, arg3);
break;
}
}
@ -57,29 +56,29 @@ void func_8006A96C(Object_2F4* obj2F4) {
void func_8006A978(Object_2F4* obj2F4) {
}
void func_8006A984(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos) {
Object_8C_Initialize(obj8C);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_365;
void func_8006A984(Effect* effect, f32 xPos, f32 yPos, f32 zPos) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_365;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
obj8C->unk_44 = 40;
obj8C->scale2 = 5.0f;
obj8C->scale1 = 2.0f * (Rand_ZeroOne() - 0.5f);
obj8C->vel.y = 10.0f;
obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
effect->unk_44 = 40;
effect->scale2 = 5.0f;
effect->scale1 = 2.0f * (Rand_ZeroOne() - 0.5f);
effect->vel.y = 10.0f;
effect->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&effect->info, effect->obj.id);
}
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], xPos, yPos, zPos);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
func_8006A984(&gEffects[i], xPos, yPos, zPos);
break;
}
}
@ -114,7 +113,7 @@ void func_8006AC08(Object_2F4* obj2F4) {
f32 sp2C;
if (func_8006ABA4(obj2F4) && (obj2F4->timer_0BC == 0)) {
func_8007F11C(OBJ_8C_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
func_8007F11C(OBJ_EFFECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
obj2F4->timer_0BC = 20;
}
sp2C = obj2F4->obj.pos.z + D_80177D20;
@ -141,7 +140,7 @@ void func_8006AD18(Object_2F4* obj2F4) {
}
if (!(gFrameCount & 0x1F)) {
func_8007F11C(OBJ_8C_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y + 180.0f, obj2F4->obj.pos.z, D_80177828);
func_8007F11C(OBJ_EFFECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y + 180.0f, obj2F4->obj.pos.z, D_80177828);
}
switch (obj2F4->unk_0B8) {
@ -349,28 +348,28 @@ void func_8006B95C(Object_80* obj80) {
}
}
void func_8006BA64(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos) {
Object_8C_Initialize(obj8C);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_375;
void func_8006BA64(Effect* effect, f32 xPos, f32 yPos, f32 zPos) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_375;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
obj8C->scale2 = 0.0f;
obj8C->scale1 = 0.12f;
obj8C->obj.rot.y = Rand_ZeroOne() * 360.0f;
obj8C->unk_60.y = (Rand_ZeroOne() - 0.5f) * 3.0f;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
effect->scale2 = 0.0f;
effect->scale1 = 0.12f;
effect->obj.rot.y = Rand_ZeroOne() * 360.0f;
effect->unk_60.y = (Rand_ZeroOne() - 0.5f) * 3.0f;
Object_SetInfo(&effect->info, effect->obj.id);
}
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], xPos, yPos, zPos);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
func_8006BA64(&gEffects[i], xPos, yPos, zPos);
break;
}
}
@ -427,7 +426,7 @@ void func_8006BB78(Object_2F4* obj2F4) {
case 3:
if (obj2F4->timer_0BC == 1) {
func_8007F11C(OBJ_8C_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
func_8007F11C(OBJ_EFFECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
}
if (obj2F4->vel.y < 12.0f) {
Math_SmoothStepToF(&obj2F4->obj.rot.x, 180.0f, 0.1f, 7.0f, 0.01f);
@ -1545,26 +1544,26 @@ void func_8006EA50(Object_2F4* obj2F4) {
}
}
void func_8006EAC4(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos) {
Object_8C_Initialize(obj8C);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_374;
void func_8006EAC4(Effect* effect, f32 xPos, f32 yPos, f32 zPos) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_374;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
obj8C->timer_50 = 20;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
Audio_PlaySfx(0x2900201D, &obj8C->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C);
effect->timer_50 = 20;
Object_SetInfo(&effect->info, effect->obj.id);
Audio_PlaySfx(0x2900201D, &effect->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C);
}
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], xPos, yPos, zPos);
for (i = 50; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
func_8006EAC4(&gEffects[i], xPos, yPos, zPos);
break;
}
}
@ -1663,56 +1662,56 @@ void func_8006EFA0(s32 unk0E4, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 arg5,
}
}
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 = OBJ_8C_347;
void func_8006F044(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_347;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
obj8C->scale1 = arg4;
obj8C->unk_44 = 100;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
func_8007A6F0(&obj8C->obj.pos, 0x2903B009);
effect->scale1 = arg4;
effect->unk_44 = 100;
Object_SetInfo(&effect->info, effect->obj.id);
func_8007A6F0(&effect->obj.pos, 0x2903B009);
}
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], xPos, yPos, zPos, arg3);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
func_8006F044(&gEffects[i], xPos, yPos, zPos, arg3);
break;
}
}
}
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 = OBJ_8C_394;
void func_8006F140(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_394;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
obj8C->scale1 = arg4;
obj8C->unk_44 = 100;
obj8C->unk_78 = 102;
obj8C->unk_7A = 18;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
obj8C->info.damage = 40;
func_8007A6F0(&obj8C->obj.pos, 0x2903B009);
effect->scale1 = arg4;
effect->unk_44 = 100;
effect->unk_78 = 102;
effect->unk_7A = 18;
Object_SetInfo(&effect->info, effect->obj.id);
effect->info.damage = 40;
func_8007A6F0(&effect->obj.pos, 0x2903B009);
}
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], xPos, yPos, zPos, arg3);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
func_8006F140(&gEffects[i], xPos, yPos, zPos, arg3);
break;
}
}
@ -1733,7 +1732,7 @@ void func_8006F254(Object_2F4* obj2F4) {
sp54.z = D_80177828;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48);
func_8007F04C(OBJ_8C_353, obj2F4->obj.pos.x + sp48.x, obj2F4->obj.pos.y + sp48.y, obj2F4->obj.pos.z + sp48.z,
func_8007F04C(OBJ_EFFECT_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);
}
@ -1758,7 +1757,7 @@ void func_8006F40C(Object_2F4* obj2F4) {
case 2:
if (obj2F4->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) {
func_8007F11C(OBJ_8C_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
func_8007F11C(OBJ_EFFECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
}
obj2F4->unk_048 = 0;
break;
@ -1798,7 +1797,7 @@ void func_8006F40C(Object_2F4* obj2F4) {
sp78.z = D_80177828;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C);
func_8007F04C(OBJ_8C_355, obj2F4->obj.pos.x + sp6C.x, obj2F4->obj.pos.y + sp6C.y,
func_8007F04C(OBJ_EFFECT_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);
@ -1807,14 +1806,14 @@ void func_8006F40C(Object_2F4* obj2F4) {
case 6:
if (obj2F4->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) {
func_8007F11C(OBJ_8C_355, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
func_8007F11C(OBJ_EFFECT_355, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
}
obj2F4->unk_048 = 0;
break;
case 7:
if (obj2F4->obj.pos.z < (gPlayer[0].unk_138 - 600.0f)) {
func_8007F11C(OBJ_8C_356, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 60.0f);
func_8007F11C(OBJ_EFFECT_356, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, 60.0f);
}
obj2F4->unk_048 = 0;
break;
@ -1824,7 +1823,7 @@ void func_8006F40C(Object_2F4* obj2F4) {
sp6C.y = gPlayer[0].pos.y;
gPlayer[0].pos.x += (Rand_ZeroOne() - 0.5f) * 300.0f;
gPlayer[0].pos.y += (Rand_ZeroOne() - 0.5f) * 300.0f;
func_8007F11C(OBJ_8C_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
func_8007F11C(OBJ_EFFECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
gPlayer[0].pos.x = sp6C.x;
gPlayer[0].pos.y = sp6C.y;
obj2F4->unk_048 = 0;
@ -1877,16 +1876,16 @@ void func_8006F40C(Object_2F4* obj2F4) {
break;
case 16:
func_8007F11C(OBJ_8C_353, obj2F4->obj.pos.x + 190.0f, obj2F4->obj.pos.y + 90.0f,
func_8007F11C(OBJ_EFFECT_353, obj2F4->obj.pos.x + 190.0f, obj2F4->obj.pos.y + 90.0f,
obj2F4->obj.pos.z + 220.0f, D_80177828);
func_8007F11C(OBJ_8C_353, obj2F4->obj.pos.x - 190.0f, obj2F4->obj.pos.y + 90.0f,
func_8007F11C(OBJ_EFFECT_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 (obj2F4->obj.pos.z < (gPlayer[0].camEye.z - 600.0f)) {
func_8007F20C(OBJ_8C_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
func_8007F20C(OBJ_EFFECT_353, obj2F4->obj.pos.x, obj2F4->obj.pos.y, obj2F4->obj.pos.z, D_80177828);
}
obj2F4->unk_048 = 0;
break;
@ -2859,36 +2858,36 @@ void func_800720E8(Object_2F4* obj2F4) {
}
}
void func_800722EC(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 yRot) {
void func_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) {
Vec3f sp2C;
Vec3f sp20;
Object_8C_Initialize(obj8C);
Effect_Initialize(effect);
Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, 0);
sp2C.x = 0.0f;
sp2C.y = 0.0f;
sp2C.z = 20.0f;
Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20);
obj8C->vel.x = sp20.x;
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_365;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
obj8C->unk_44 = 250;
obj8C->scale2 = 2.0f;
obj8C->scale1 = (Rand_ZeroOne() - 0.5f) * 200.0f;
obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f;
obj8C->unk_4C = obj8C->unk_4E = 1;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
effect->vel.x = sp20.x;
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_365;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
effect->unk_44 = 250;
effect->scale2 = 2.0f;
effect->scale1 = (Rand_ZeroOne() - 0.5f) * 200.0f;
effect->obj.rot.z = Rand_ZeroOne() * 360.0f;
effect->unk_4C = effect->unk_4E = 1;
Object_SetInfo(&effect->info, effect->obj.id);
}
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], xPos, yPos, zPos, yRot);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
func_800722EC(&gEffects[i], xPos, yPos, zPos, yRot);
break;
}
}
@ -3088,7 +3087,7 @@ void func_80072594(Object_2F4* obj2F4) {
var_fv0 = 0.0f;
}
func_8007F04C(OBJ_8C_353, obj2F4->obj.pos.x + spAC.x + spA0.x,
func_8007F04C(OBJ_EFFECT_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,
@ -3507,7 +3506,7 @@ void func_80072594(Object_2F4* obj2F4) {
break;
case 80: {
Object_8C* obj8C;
Effect* effect;
Vec3f sp90;
Vec3f sp84;
Vec3f sp78;
@ -3523,30 +3522,30 @@ void func_80072594(Object_2F4* obj2F4) {
if ((obj2F4->obj.pos.y + sp90.y) > -30.0f) {
for (sp74 = 0; sp74 < 7; sp74++) {
obj8C = func_8007783C(OBJ_8C_394);
effect = func_8007783C(OBJ_EFFECT_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;
if (effect != NULL) {
effect->unk_78 = effect->unk_7A = 12;
effect->obj.status = 2;
effect->obj.pos.x = obj2F4->obj.pos.x + sp90.x;
effect->obj.pos.y = obj2F4->obj.pos.y + sp90.y;
effect->obj.pos.z = obj2F4->obj.pos.z;
effect->obj.rot.x = Rand_ZeroOne() * 360.0f;
effect->obj.rot.y = Rand_ZeroOne() * 360.0f;
effect->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;
obj8C->unk_44 = 10;
obj8C->scale2 = 1.0f;
effect->unk_44 = 10;
effect->scale2 = 1.0f;
Matrix_RotateY(gCalcMatrix, ((Rand_ZeroOne() * 180.0f) + 180.0f) * M_DTOR, 0);
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp84, &sp78);
obj8C->vel.x = sp78.x;
obj8C->vel.y = sp78.y;
obj8C->vel.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;
effect->vel.x = sp78.x;
effect->vel.y = sp78.y;
effect->vel.z = sp78.z;
effect->unk_60.x = (Rand_ZeroOne() - 0.5f) + 5.0f;
effect->unk_60.y = (Rand_ZeroOne() - 0.5f) + 5.0f;
effect->unk_60.z = (Rand_ZeroOne() - 0.5f) + 5.0f;
}
}
obj2F4->unk_046++;
@ -3555,58 +3554,58 @@ void func_80072594(Object_2F4* obj2F4) {
}
if ((fabsf(obj2F4->unk_114) > 10.0f) && !(gFrameCount & 1)) {
obj8C = func_8007783C(OBJ_8C_394);
if (obj8C != NULL) {
effect = func_8007783C(OBJ_EFFECT_394);
if (effect != NULL) {
Matrix_RotateZ(gCalcMatrix, obj2F4->unk_0F4.z * M_DTOR, 0);
Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90);
obj8C->unk_78 = obj8C->unk_7A = 0xB;
effect->unk_78 = effect->unk_7A = 0xB;
obj8C->obj.status = 2;
effect->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;
effect->obj.pos.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.x + sp90.x;
effect->obj.pos.y = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.y + sp90.y;
effect->obj.pos.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.z + 180.0f;
obj8C->scale2 = 9.0f;
obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f;
obj8C->vel.x = (Rand_ZeroOne() - 0.5f) * 5.0f;
obj8C->vel.y = (Rand_ZeroOne() - 0.5f) * 3.0f + 30.0f;
obj8C->unk_44 = 100;
obj8C->unk_46 = -8;
obj8C->unk_60.z = 3;
effect->scale2 = 9.0f;
effect->obj.rot.z = Rand_ZeroOne() * 360.0f;
effect->vel.x = (Rand_ZeroOne() - 0.5f) * 5.0f;
effect->vel.y = (Rand_ZeroOne() - 0.5f) * 3.0f + 30.0f;
effect->unk_44 = 100;
effect->unk_46 = -8;
effect->unk_60.z = 3;
if (Rand_ZeroOne() < 0.5f) {
obj8C->unk_60.z = -obj8C->unk_60.z;
effect->unk_60.z = -effect->unk_60.z;
}
if (gFrameCount & 2) {
obj8C->vel.y = -obj8C->vel.y;
effect->vel.y = -effect->vel.y;
}
}
if (!(gFrameCount & 3)) {
obj8C = func_8007783C(OBJ_8C_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->scale2 = 9.0f;
obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f;
obj8C->vel.x = (Rand_ZeroOne() - 0.5f) * 5.0f;
obj8C->vel.y = (Rand_ZeroOne() - 0.5f) * 3.0f + 10.0f;
obj8C->unk_44 = 100;
obj8C->unk_46 = -8;
obj8C->unk_60.z = 3;
effect = func_8007783C(OBJ_EFFECT_394);
if (effect != NULL) {
effect->unk_78 = effect->unk_7A = 0xB;
effect->obj.status = 2;
effect->obj.pos.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.x;
effect->obj.pos.y = ((Rand_ZeroOne() - 0.5f) * 5.0f) + obj2F4->obj.pos.y + 50.0f;
effect->obj.pos.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + obj2F4->obj.pos.z + 200.0f;
effect->scale2 = 9.0f;
effect->obj.rot.z = Rand_ZeroOne() * 360.0f;
effect->vel.x = (Rand_ZeroOne() - 0.5f) * 5.0f;
effect->vel.y = (Rand_ZeroOne() - 0.5f) * 3.0f + 10.0f;
effect->unk_44 = 100;
effect->unk_46 = -8;
effect->unk_60.z = 3;
if (Rand_ZeroOne() < 0.5f) {
obj8C->unk_60.z = -obj8C->unk_60.z;
effect->unk_60.z = -effect->unk_60.z;
}
if (gFrameCount & 4) {
obj8C->vel.y = -obj8C->vel.y;
effect->vel.y = -effect->vel.y;
}
}
}

View File

@ -617,9 +617,9 @@ void func_800A6148(void) {
Object_Kill(&gBosses[i].obj, &gBosses[i].sfxPos);
Boss_Initialize(&gBosses[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(gEffects); i++) {
Object_Kill(&gEffects[i].obj, &gEffects[i].sfxPos);
Effect_Initialize(&gEffects[i]);
}
for (i = 0; i < ARRAY_COUNT(gItems); i++) {
Object_Kill(&gItems[i].obj, &gItems[i].sfxPos);

View File

@ -133,33 +133,33 @@ void func_80043468(Player* player) {
Math_SmoothStepToF(&player->unk_014, 1.0f, 1.0f, 0.1f, 0.0f);
}
void func_800438E0(Object_8C* obj8C, f32 xPos, f32 yPos, f32 zPos, f32 scale) {
void func_800438E0(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale) {
f32 pad[12];
Object_8C_Initialize(obj8C);
obj8C->obj.status = 2;
obj8C->obj.id = OBJ_8C_357;
obj8C->obj.pos.x = xPos;
obj8C->obj.pos.y = yPos;
obj8C->obj.pos.z = zPos;
obj8C->vel.x = Rand_ZeroOne() - (2.0f * Rand_ZeroOne());
obj8C->vel.y = ((Rand_ZeroOne() * 3.0f) - (gPlayer[0].vel.z / 5.0f)) + 3.0f;
obj8C->vel.z = ((Rand_ZeroOne() * 3.0f) - (gPlayer[0].vel.z / 5.0f)) + 2.0f;
obj8C->scale2 = ((Rand_ZeroOne() * 0.8f) + 0.3f) * scale;
obj8C->timer_50 = (s32) (Rand_ZeroOne() * 5.0f) + 8;
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_SetInfo(&obj8C->info, obj8C->obj.id);
Effect_Initialize(effect);
effect->obj.status = 2;
effect->obj.id = OBJ_EFFECT_357;
effect->obj.pos.x = xPos;
effect->obj.pos.y = yPos;
effect->obj.pos.z = zPos;
effect->vel.x = Rand_ZeroOne() - (2.0f * Rand_ZeroOne());
effect->vel.y = ((Rand_ZeroOne() * 3.0f) - (gPlayer[0].vel.z / 5.0f)) + 3.0f;
effect->vel.z = ((Rand_ZeroOne() * 3.0f) - (gPlayer[0].vel.z / 5.0f)) + 2.0f;
effect->scale2 = ((Rand_ZeroOne() * 0.8f) + 0.3f) * scale;
effect->timer_50 = (s32) (Rand_ZeroOne() * 5.0f) + 8;
effect->obj.rot.x = Rand_ZeroOne() * 360.0f;
effect->unk_60.x = (Rand_ZeroOne() - 0.5f) * 30.0f;
effect->unk_60.y = (Rand_ZeroOne() - 0.5f) * 30.0f;
effect->unk_60.z = (Rand_ZeroOne() - 0.5f) * 30.0f;
Object_SetInfo(&effect->info, effect->obj.id);
}
void func_80043AA0(f32 xPos, f32 yPos, f32 zPos, f32 scale) {
s32 i;
for (i = 50; i >= 0; i--) {
if (gObjects8C[i].obj.status == 0) {
func_800438E0(&gObjects8C[i], xPos, yPos, zPos, scale);
if (gEffects[i].obj.status == 0) {
func_800438E0(&gEffects[i], xPos, yPos, zPos, scale);
break;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -2224,123 +2224,123 @@ void func_80093310(void) {
void func_800933D8(f32 x, f32 y, f32 z, f32 arg3) {
s32 i;
Object_8C* obj8C = &gObjects8C[ARRAY_COUNT(gObjects8C) - 1];
Effect* effect = &gEffects[ARRAY_COUNT(gEffects) - 1];
Player* player = gPlayer;
for (i = 0; i < 100; i++) {
if (obj8C->obj.status == 0) {
Object_8C_Initialize(obj8C);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_363;
obj8C->obj.pos.x = x;
obj8C->obj.pos.y = y;
obj8C->obj.pos.z = z;
if (effect->obj.status == 0) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_363;
effect->obj.pos.x = x;
effect->obj.pos.y = y;
effect->obj.pos.z = z;
if ((player->state_1C8 == PLAYERSTATE_1C8_2) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 < 2)) {
obj8C->scale1 = 0.4f;
obj8C->unk_44 = 0;
obj8C->unk_46 = 24;
obj8C->unk_48 = Rand_ZeroOne() * 4.0f;
effect->scale1 = 0.4f;
effect->unk_44 = 0;
effect->unk_46 = 24;
effect->unk_48 = Rand_ZeroOne() * 4.0f;
if (Rand_ZeroOne() < 0.5f) {
obj8C->unk_48 = -obj8C->unk_48;
effect->unk_48 = -effect->unk_48;
}
} else {
obj8C->vel.x = (Rand_ZeroOne() - 0.5f) * 5.0f;
obj8C->vel.y = (Rand_ZeroOne() - 0.5f) * 3.0f;
obj8C->unk_48 = 0;
effect->vel.x = (Rand_ZeroOne() - 0.5f) * 5.0f;
effect->vel.y = (Rand_ZeroOne() - 0.5f) * 3.0f;
effect->unk_48 = 0;
if (Rand_ZeroOne() < 0.5f) {
obj8C->unk_48 = -obj8C->unk_48;
effect->unk_48 = -effect->unk_48;
}
if (player->unk_1D0 >= 5) {
obj8C->unk_4A = 0x60;
obj8C->unk_46 = 4;
effect->unk_4A = 0x60;
effect->unk_46 = 4;
} else {
obj8C->unk_4A = 0x80;
obj8C->unk_46 = 2;
effect->unk_4A = 0x80;
effect->unk_46 = 2;
}
}
obj8C->scale2 = arg3 * 0.2f;
obj8C->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
effect->scale2 = arg3 * 0.2f;
effect->obj.rot.z = Rand_ZeroOne() * 360.0f;
Object_SetInfo(&effect->info, effect->obj.id);
break;
}
obj8C--;
effect--;
}
}
#pragma GLOBAL_ASM("asm/us/nonmatchings/main/sf_hud/func_800935E8.s")
void func_80094954(Object_8C* obj8C) {
void func_80094954(Effect* effect) {
Player* player = gPlayer;
if ((player->state_1C8 == PLAYERSTATE_1C8_2) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 < 2)) {
switch (obj8C->unk_4E) {
switch (effect->unk_4E) {
case 0:
obj8C->unk_44 += obj8C->unk_46;
obj8C->unk_4A = obj8C->unk_44;
obj8C->scale2 += 0.01f;
effect->unk_44 += effect->unk_46;
effect->unk_4A = effect->unk_44;
effect->scale2 += 0.01f;
if (obj8C->unk_4A >= 200) {
obj8C->unk_4E = 1;
obj8C->unk_4A = 200;
if (effect->unk_4A >= 200) {
effect->unk_4E = 1;
effect->unk_4A = 200;
}
break;
case 1:
obj8C->unk_4A -= obj8C->unk_46;
obj8C->scale2 -= 0.1f;
effect->unk_4A -= effect->unk_46;
effect->scale2 -= 0.1f;
break;
}
if ((obj8C->unk_4E == 1) && (obj8C->unk_4A <= 0)) {
Object_Kill(&obj8C->obj, &obj8C->sfxPos);
if ((effect->unk_4E == 1) && (effect->unk_4A <= 0)) {
Object_Kill(&effect->obj, &effect->sfxPos);
}
obj8C->vel.y += obj8C->scale1;
obj8C->scale1 -= 0.05f;
effect->vel.y += effect->scale1;
effect->scale1 -= 0.05f;
if (obj8C->scale1 < -1.0f) {
obj8C->scale1 = -1.0f;
if (effect->scale1 < -1.0f) {
effect->scale1 = -1.0f;
}
obj8C->obj.rot.z += obj8C->unk_48;
effect->obj.rot.z += effect->unk_48;
return;
}
if (player->state_1C8 == PLAYERSTATE_1C8_7) {
obj8C->obj.rot.x = player->unk_05C * 180.0f / M_PI;
obj8C->obj.rot.y = -player->unk_058 * 180.0f / M_PI;
effect->obj.rot.x = player->unk_05C * 180.0f / M_PI;
effect->obj.rot.y = -player->unk_058 * 180.0f / M_PI;
}
if (player->state_1C8 == PLAYERSTATE_1C8_6) {
obj8C->unk_46 = 2;
effect->unk_46 = 2;
if (player->unk_1D0 >= 4) {
obj8C->vel.y -= 0.13f;
effect->vel.y -= 0.13f;
}
}
obj8C->scale2 += 0.8f;
obj8C->unk_4A -= obj8C->unk_46;
effect->scale2 += 0.8f;
effect->unk_4A -= effect->unk_46;
if ((obj8C->unk_4A < 0) ||
if ((effect->unk_4A < 0) ||
((player->state_1C8 == PLAYERSTATE_1C8_2) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 == 5))) {
Object_Kill(&obj8C->obj, &obj8C->sfxPos);
Object_Kill(&effect->obj, &effect->sfxPos);
}
obj8C->obj.rot.z += obj8C->unk_48;
effect->obj.rot.z += effect->unk_48;
}
void func_80094BBC(Object_8C* obj8C) {
void func_80094BBC(Effect* effect) {
if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) && (gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].unk_1D0 < 2)) {
RCP_SetupDL(&gMasterDisp, 0x44);
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, obj8C->unk_4A);
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, effect->unk_4A);
gDPSetEnvColor(gMasterDisp++, 255, 255, 251, 0);
Graphics_SetScaleMtx(obj8C->scale2);
Graphics_SetScaleMtx(effect->scale2);
gSPDisplayList(gMasterDisp++, D_1023750);
} else {
Graphics_SetScaleMtx(obj8C->scale2);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, obj8C->unk_4A);
Graphics_SetScaleMtx(effect->scale2);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_4A);
gSPDisplayList(gMasterDisp++, D_1023750);
}
}

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "prevent_bss_reordering.h"
s32 sSeededRandSeed3;
s32 sRandSeed1;

View File

@ -183,24 +183,24 @@ void func_E16C50_801875E4(f32 xPos, f32 yPos, f32 zPos, f32 unk124y, f32 xRot, f
}
}
void func_E16C50_8018767C(Object_8C* obj8C) {
Object_8C_Initialize(obj8C);
obj8C->obj.status = 1;
obj8C->obj.id = OBJ_8C_395;
obj8C->obj.pos.x = gBosses[0].obj.pos.x;
obj8C->obj.pos.y = gBosses[0].obj.pos.y;
obj8C->obj.pos.z = gBosses[0].obj.pos.z + 250.0f;
obj8C->unk_4E = 8;
obj8C->scale2 = 1.0f;
Object_SetInfo(&obj8C->info, obj8C->obj.id);
void func_E16C50_8018767C(Effect* effect) {
Effect_Initialize(effect);
effect->obj.status = 1;
effect->obj.id = OBJ_EFFECT_395;
effect->obj.pos.x = gBosses[0].obj.pos.x;
effect->obj.pos.y = gBosses[0].obj.pos.y;
effect->obj.pos.z = gBosses[0].obj.pos.z + 250.0f;
effect->unk_4E = 8;
effect->scale2 = 1.0f;
Object_SetInfo(&effect->info, effect->obj.id);
}
void func_E16C50_80187704(void) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gObjects8C); i++) {
if (gObjects8C[i].obj.status == 0) {
func_E16C50_8018767C(&gObjects8C[i]);
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == 0) {
func_E16C50_8018767C(&gEffects[i]);
break;
}
}
@ -257,7 +257,7 @@ void func_E16C50_80187944(Boss* bossA6) {
f32 sp114;
f32 sp110;
f32 sp10C;
Object_8C* temp_s0_3;
Effect* temp_s0_3;
f32 sp104;
Vec3f spC8[5];
Vec3f spA4[3];
@ -744,7 +744,7 @@ void func_E16C50_80187944(Boss* bossA6) {
}
break;
case 7:
temp_s0_3 = &gObjects8C[bossA6->swork[39]];
temp_s0_3 = &gEffects[bossA6->swork[39]];
Math_SmoothStepToF(&D_E16C50_801C22F0.unk_28[0], 255.0f, 1.0f, 100.0f, 0.00001f);
Math_SmoothStepToF(&D_E16C50_801C22F0.unk_28[2], 255.0f, 1.0f, 100.0f, 0.00001f);
Math_SmoothStepToF(&D_E16C50_801C22F0.unk_28[1], 255.0f, 1.0f, 100.0f, 0.00001f);
@ -1392,9 +1392,9 @@ void func_E16C50_8018BCD4(Vec3f* arg0, f32 arg1, f32 arg2, Vec3f* arg3, s32 arg4
Matrix_Push(&gGfxMatrix);
Matrix_Push(&gCalcMatrix);
Matrix_Copy(gCalcMatrix, &gIdentityMatrix);
Matrix_RotateZ(gCalcMatrix, 0.017453292f * arg1, 1);
Matrix_RotateZ(gCalcMatrix, M_DTOR * arg1, 1);
Matrix_Translate(gCalcMatrix, 0.0f, 100.0f, -223.0f, 1);
Matrix_RotateX(gCalcMatrix, 0.017453292f * arg2, 1);
Matrix_RotateX(gCalcMatrix, M_DTOR * arg2, 1);
for (i = 0; i < arg6; i++) {
Matrix_Push(&gGfxMatrix);
Matrix_Push(&gCalcMatrix);
@ -1417,8 +1417,8 @@ void func_E16C50_8018BCD4(Vec3f* arg0, f32 arg1, f32 arg2, Vec3f* arg3, s32 arg4
}
Matrix_Pop(&gGfxMatrix);
Matrix_Pop(&gCalcMatrix);
Matrix_RotateY(gCalcMatrix, arg0[i].y * 0.017453292f, 1);
Matrix_RotateX(gCalcMatrix, arg0[i].x * 0.017453292f, 1);
Matrix_RotateY(gCalcMatrix, arg0[i].y * M_DTOR, 1);
Matrix_RotateX(gCalcMatrix, arg0[i].x * M_DTOR, 1);
Matrix_Translate(gCalcMatrix, 0.0f, 0.0f, arg5, 1);
}
Matrix_Pop(&gGfxMatrix);
@ -1441,9 +1441,9 @@ void func_E16C50_8018C0D0(f32* arg0, f32 arg1, Vec3f* arg2, f32 arg3, s32 arg4)
Matrix_Push(&gCalcMatrix);
Matrix_Copy(gCalcMatrix, &gIdentityMatrix);
GCGM_BACK();
Matrix_RotateZ(gCalcMatrix, (D_E16C50_801C22F0.unk_34 + arg1) * 0.017453292f, 1);
Matrix_RotateZ(gCalcMatrix, (D_E16C50_801C22F0.unk_34 + arg1) * M_DTOR, 1);
Matrix_Translate(gCalcMatrix, 0.0f, -360.0f, 120.0f, 1);
Matrix_RotateX(gCalcMatrix, -(90.0f - arg3) * 0.017453292f, 1);
Matrix_RotateX(gCalcMatrix, -(90.0f - arg3) * M_DTOR, 1);
Matrix_Scale(gCalcMatrix, 0.7f, 0.7f, 0.7f, 1);
Matrix_SetGfxMtx(&gMasterDisp);
for (i = 0; i < 5; i++) {
@ -1451,7 +1451,7 @@ void func_E16C50_8018C0D0(f32* arg0, f32 arg1, Vec3f* arg2, f32 arg3, s32 arg4)
Matrix_Push(&gCalcMatrix);
if (i == 4) {
Matrix_RotateX(gCalcMatrix, 1.3962634f, 1);
Matrix_RotateX(gCalcMatrix, (90.0f - arg3) * 0.017453292f, 1);
Matrix_RotateX(gCalcMatrix, (90.0f - arg3) * M_DTOR, 1);
Matrix_Scale(gCalcMatrix, var_fs3, var_fs3, 1.0f, 1);
Matrix_Mult(gGfxMatrix, gCalcMatrix, 1);
Matrix_SetGfxMtx(&gMasterDisp);
@ -1466,7 +1466,7 @@ void func_E16C50_8018C0D0(f32* arg0, f32 arg1, Vec3f* arg2, f32 arg3, s32 arg4)
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 64, 64, 192);
Matrix_Translate(gCalcMatrix, 0.0f, -60.0f, 0.0f, 1);
Matrix_Scale(gCalcMatrix, 2.0f, 3.0f, 1.0f, 1);
Matrix_RotateY(gCalcMatrix, 0.017453292f * spAC, 1);
Matrix_RotateY(gCalcMatrix, M_DTOR * spAC, 1);
Matrix_Mult(gGfxMatrix, gCalcMatrix, 1);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_102F5E0);
@ -1475,7 +1475,7 @@ void func_E16C50_8018C0D0(f32* arg0, f32 arg1, Vec3f* arg2, f32 arg3, s32 arg4)
Matrix_Pop(&gGfxMatrix);
Matrix_Translate(gCalcMatrix, 0.0f, -120.0f, 0.0f, 1);
Matrix_RotateX(gCalcMatrix, -0.34906584f, 1);
Matrix_RotateZ(gCalcMatrix, arg0[i] * 0.017453292f, 1);
Matrix_RotateZ(gCalcMatrix, arg0[i] * M_DTOR, 1);
}
Matrix_Pop(&gCalcMatrix);
Matrix_Pop(&gGfxMatrix);
@ -1495,7 +1495,7 @@ void func_E16C50_8018C54C(Boss* bossA6) {
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) D_E16C50_801C22F0.unk_24);
gDPSetEnvColor(gMasterDisp++, 255, 255, 0, 255);
Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, 1);
Matrix_RotateZ(gGfxMatrix, bossA6->fwork[0x21] * 0.017453292f, 1);
Matrix_RotateZ(gGfxMatrix, bossA6->fwork[0x21] * M_DTOR, 1);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_101C2E0);
} else if (D_E16C50_801C22F0.unk_24 != 0.0f) {
@ -1508,13 +1508,13 @@ void func_E16C50_8018C54C(Boss* bossA6) {
spAC.x = 0.0f;
}
spAC.y = spAC.z = 0.0f;
Matrix_RotateZ(gCalcMatrix, gFrameCount * 6.0f * 0.017453292f, 0);
Matrix_RotateZ(gCalcMatrix, gFrameCount * 6.0f * M_DTOR, 0);
Matrix_MultVec3f(gCalcMatrix, &spAC, &spB8);
Matrix_Translate(gGfxMatrix, spB8.x, spB8.y, 0.0f, 1);
Matrix_Scale(gGfxMatrix, bossA6->unk_3F8, bossA6->unk_3F8, bossA6->unk_3F8, 1);
Matrix_RotateZ(gGfxMatrix, gFrameCount * 10.0f * 0.017453292f, 1);
Matrix_RotateZ(gGfxMatrix, gFrameCount * 10.0f * M_DTOR, 1);
Matrix_Scale(gGfxMatrix, bossA6->fwork[0x22], bossA6->fwork[0x23], 1.0f, 1);
Matrix_RotateZ(gGfxMatrix, -(f32) gFrameCount * 10.0f * 0.017453292f, 1);
Matrix_RotateZ(gGfxMatrix, -(f32) gFrameCount * 10.0f * M_DTOR, 1);
Matrix_Scale(gGfxMatrix, bossA6->fwork[0x22], bossA6->fwork[0x23], 1.0f, 1);
} else {
RCP_SetupDL(&gMasterDisp, 0x1B);
@ -1533,9 +1533,9 @@ void func_E16C50_8018C54C(Boss* bossA6) {
for (i = 0; i < 3; i++) {
if ((bossA6->swork[33 + i] == 0) && (bossA6->unk_04E != 3) && (D_E16C50_801C2250.unk_00[2 + i] == 0) &&
!(gFrameCount & 3) && (bossA6->swork[0x1B + i] != 0) && (D_80177854 != 0x64)) {
Matrix_RotateY(gCalcMatrix, bossA6->obj.rot.y * 0.017453292f, 0);
Matrix_RotateX(gCalcMatrix, bossA6->obj.rot.x * 0.017453292f, 1);
Matrix_RotateZ(gCalcMatrix, bossA6->obj.rot.z * 0.017453292f, 1);
Matrix_RotateY(gCalcMatrix, bossA6->obj.rot.y * M_DTOR, 0);
Matrix_RotateX(gCalcMatrix, bossA6->obj.rot.x * M_DTOR, 1);
Matrix_RotateZ(gCalcMatrix, bossA6->obj.rot.z * M_DTOR, 1);
Matrix_MultVec3f(gCalcMatrix, &bossA6->vwork[1 + i], &spC4);
func_8007D0E0(bossA6->obj.pos.x + spC4.x, bossA6->obj.pos.y + spC4.y, bossA6->obj.pos.z + spC4.z,
20.0f);
@ -1789,8 +1789,8 @@ void func_E16C50_8018D920(Vec3f* arg0) {
Vec3f sp50;
Vec3f sp44;
Matrix_RotateY(gCalcMatrix, 0.017453292f * sp60, 0);
Matrix_RotateX(gCalcMatrix, 0.017453292f * sp5C, 1);
Matrix_RotateY(gCalcMatrix, M_DTOR * sp60, 0);
Matrix_RotateX(gCalcMatrix, M_DTOR * sp5C, 1);
sp50.x = 0.0f;
sp50.y = 0.0f;
sp50.z = 100.0f;
@ -1811,11 +1811,11 @@ void func_E16C50_8018DA58(Object_2F4* obj2F4) {
switch (obj2F4->unk_0B8) { /* irregular */
case 1:
obj2F4->unk_130 += 2.5f;
obj2F4->unk_0F4.z = __sinf(obj2F4->unk_130 * 0.017453292f) * 10.0f;
obj2F4->unk_0F4.z = __sinf(obj2F4->unk_130 * M_DTOR) * 10.0f;
obj2F4->unk_134 += 1.0f;
obj2F4->obj.pos.y += __sinf(obj2F4->unk_134 * 0.017453292f) * 1.5f;
obj2F4->obj.pos.y += __sinf(obj2F4->unk_134 * M_DTOR) * 1.5f;
obj2F4->unk_138 += 1.0f;
obj2F4->obj.pos.z += __cosf(obj2F4->unk_138 * 0.017453292f) * 1.5f;
obj2F4->obj.pos.z += __cosf(obj2F4->unk_138 * M_DTOR) * 1.5f;
break;
case 2:
Math_SmoothStepToF(&obj2F4->unk_0F4.z, -180.0f, 0.1f, 3.0f, 0.0f);
@ -1874,8 +1874,8 @@ void func_E16C50_8018DA58(Object_2F4* obj2F4) {
case 90:
break;
}
Matrix_RotateY(gCalcMatrix, (obj2F4->unk_0F4.y + 180.0f) * 0.017453292f, 0);
Matrix_RotateX(gCalcMatrix, -(obj2F4->unk_0F4.x * 0.017453292f), 1);
Matrix_RotateY(gCalcMatrix, (obj2F4->unk_0F4.y + 180.0f) * M_DTOR, 0);
Matrix_RotateX(gCalcMatrix, -(obj2F4->unk_0F4.x * M_DTOR), 1);
sp5C.x = 0.0f;
sp5C.y = 0.0f;
sp5C.z = obj2F4->unk_114;
@ -1937,7 +1937,7 @@ void func_E16C50_8018DF74(Player* player) {
sp74.y = 0.0f;
sp74.z = D_80177A48[5];
Matrix_Translate(gCalcMatrix, 0.0f, 350.0f, D_80177A48[6], 0);
Matrix_RotateY(gCalcMatrix, -(D_80177A48[4] * 0.017453292f), 1);
Matrix_RotateY(gCalcMatrix, -(D_80177A48[4] * M_DTOR), 1);
Matrix_MultVec3f(gCalcMatrix, &sp74, &sp68);
D_80177978 = sp68.x;
D_80177980 = sp68.y;
@ -2063,8 +2063,8 @@ void func_E16C50_8018DF74(Player* player) {
func_800A6148();
break;
}
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * 0.017453292f, 0);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * 0.017453292f), 1);
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, 0);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1);
if (player->state_1C8 != PLAYERSTATE_1C8_3) {
sp74.x = 0.0f;
sp74.y = 0.0f;
@ -2326,7 +2326,7 @@ void func_E16C50_8018ED78(Player* player) {
sp78.y = 0.0f;
sp78.z = D_80177A48[5];
Matrix_Translate(gCalcMatrix, D_80177A48[1], 0.0f, D_80177A48[3] + D_80177D20, 0);
Matrix_RotateY(gCalcMatrix, -(D_80177A48[4] * 0.017453292f), 1);
Matrix_RotateY(gCalcMatrix, -(D_80177A48[4] * M_DTOR), 1);
Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C);
player->camEye.x = D_80177978 = sp6C.x;
player->camEye.y = D_80177980 = sp6C.y;
@ -2410,8 +2410,8 @@ void func_E16C50_8018ED78(Player* player) {
if (D_80177A80 >= 1076) {
Math_SmoothStepToF(&player->unk_0D0, 50.0f, 0.1f, 1000.0f, 0.001f);
}
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * 0.017453292f, 0);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * 0.017453292f), 1);
Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, 0);
Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1);
sp78.x = 0.0f;
sp78.y = 0.0f;
sp78.z = player->unk_0D0;

View File

@ -1,6 +1,6 @@
#include "global.h"
void func_E16C50_801AC918(Object_8C*);
void func_E16C50_801AC918(Effect*);
void func_E16C50_801AD6C0(Object_2F4*);
void func_E16C50_801AE168(Object_2F4*);
void func_E16C50_801AE3D8(Object_2F4*);
@ -293,7 +293,7 @@ f32 D_E16C50_801C445C;
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_E16C50/sf_aq/func_E16C50_801AC8A8.s")
// OBJ_8C_366 action
// OBJ_EFFECT_366 action
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_E16C50/sf_aq/func_E16C50_801AC918.s")
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_E16C50/sf_aq/func_E16C50_801ACBB4.s")

View File

@ -6,8 +6,8 @@ void func_E16C50_8019EA7C(Object_2F4*);
void func_E16C50_8019F20C(Object_2F4*);
void func_E16C50_8019F7AC(Object_2F4*);
void func_E16C50_801A003C(Object_2F4*);
void func_E16C50_801A0120(Object_8C*);
void func_E16C50_801A0AF0(Object_8C*);
void func_E16C50_801A0120(Effect*);
void func_E16C50_801A0AF0(Effect*);
void func_E16C50_801A1F80(Boss* bossSO);
void func_E16C50_801A23F4(Boss* bossSO);
@ -125,10 +125,10 @@ s32 D_E16C50_801C27A0[8]; // unused? part of previous?
// OBJ_2F4_279 action
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_E16C50/sf_so/func_E16C50_801A003C.s")
// OBJ_8C_392 action
// OBJ_EFFECT_392 action
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_E16C50/sf_so/func_E16C50_801A0120.s")
// OBJ_8C_392 draw
// OBJ_EFFECT_392 draw
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_E16C50/sf_so/func_E16C50_801A0AF0.s")
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_E16C50/sf_so/func_E16C50_801A0CEC.s")

177
tools/fixfloats.py Executable file
View File

@ -0,0 +1,177 @@
#!/usr/bin/env python3
import os
import re
import struct
import math
from collections import Counter
import argparse
def removepower(f, n):
if(n <= 1):
return f
t = f
while t % n == 0:
t /= n
return t
def rationalcheck(f, dmax, tol=23):
for den in range(1, dmax+1):
num = f * den
if round(num,0) > 0:
error = abs(math.log(num/round(num,0)))
else:
error = 1
if(error == 0 or -math.log2(error) > tol): #and (den % 10 == 0 or den % 0x10 == 0)):
if(removepower(den, 10) < 20 or removepower(den, 16) < 20):
print(f, int(round(num,0)), den, hex(den), math.floor(-math.log2(error)) if error != 0 else 0)
break
return 0
def findallfloats(path, odd=True, off=True):
numfilesodd = 0
numfilesoff = 0
for subdir, dirs, files in os.walk(path):
for filename in files:
filepath = subdir + os.sep + filename
if(filename.endswith('.c')): # and 'data' not in filename):
numodd, allodd, numoff, alloff = findoddfloats(filepath)
if(odd and numodd > 0):
print(filepath,'has', ('an ' if numodd == 1 else '') + 'odd float' + ('' if numodd == 1 else 's') + ':')
# print(set(allodd))
# breakpoint()
[rationalcheck(float(x.strip('f')), 1000) for x in set(allodd)]
numfilesodd += 1
if(off and numoff > 0):
print(filepath,'has', ('an ' if numoff == 1 else '') + 'off float' + ('' if numoff == 1 else 's') + ':')
print(set(alloff))
[rationalcheck(float(x[0].strip('f')), 1000, 22) for x in set(alloff)]
numfilesoff += 1
return numfilesodd, numfilesoff
def roundallfloats(path):
for subdir, dirs, files in os.walk(path):
for filename in files:
filepath = subdir + os.sep + filename
if filename.endswith('.c'):
numodd, numob1 = roundfloats(filepath)
if(numodd > 0):
print(filepath,'has', ('a ' if numodd == 1 else '') + 'fixable float' + ('' if numodd == 1 else 's'))
# print(allodd)
if(numob1 > 0):
print(filepath,'has', ('a ' if numob1 == 1 else '') + 'off-by-1 float' + ('' if numob1 == 1 else 's'))
return 0
def roundfloats(src):
floatmatch = re.compile('[0-9][0-9]*\.[0-9][0-9]*f')
numfix = 0
numob1 = 0
with open(src,'r',encoding='utf-8',newline='\n') as srcfile:
srcdata = srcfile.readlines()
for i, line in enumerate(srcdata):
floats = floatmatch.findall(line)
fixline = line
for f in floats:
fn = float(f.strip('f'))
rfn, ob1 = roundfloat(fn)
rf = str(rfn) + 'f'
if(fn != rfn):
numfix += 1
if('data' not in src):
print(src, 'line', i, ':', f, 'to', rf)
fixline = fixline.replace(f, rf)
# if(ob1):
# numob1 += 1
# print(src, 'line', i, ':', f, 'off-by-1')
srcdata[i] = fixline
if(numfix > 0):
with open(src, 'w', encoding='utf-8',newline='\n') as outfile:
outfile.writelines(srcdata)
return numfix, numob1
def findoddfloats(src):
floatmatch = re.compile('[0-9]*\.[0-9]*f')
numodd = 0
numoff = 0
allodd = []
alloff = []
with open(src,'r',encoding='utf-8') as srcfile:
for i, line in enumerate(srcfile):
floats = floatmatch.findall(line)
print("all")
print(floats)
oddfloats = [x for x in floats if (isoddfloat(x) and offby(x) >= 10)]
print("odd")
print(oddfloats)
offfloats = [(x, offby(x)) for x in floats if (isoddfloat(x) and offby(x) < 10)]
print("offfloats")
print(offfloats)
numodd += len(oddfloats)
numoff += len(offfloats)
alloff += offfloats
allodd += oddfloats
return numodd, allodd, numoff, alloff
def isoddfloat(floatstr):
return len(floatstr.strip('f').replace('.','').strip('0')) >= 7
def offby(floatstr):
val = float(floatstr.strip('f'))
fbytes = struct.pack(">f", val)
i = -math.floor(math.log10(val))
offvals = []
while(struct.pack(">f",round(val,i)) != fbytes):
fi = struct.unpack(">i",fbytes)[0]
rfi = struct.unpack(">i",struct.pack(">f",round(val,i-1)))[0]
offvals += [abs(fi - rfi)]
i += 1
if(offvals[-1] <= 2 and offvals[-2] <= 2):
return offvals[-1]
counter = Counter(offvals)
if(not counter.values()):
return 1000000
if(max(counter.values()) >= 3):
mode = min([item for item, count in counter.items() if count == max(counter.values())])
return mode
else:
return 1000000
def roundfloat(val):
fbytes = struct.pack(">f", val)
i = 0
offby1 = False
while(struct.pack(">f",round(val,i)) != fbytes):
fi = struct.unpack(">i",fbytes)[0]
rfi = struct.unpack(">i",struct.pack(">f",round(val,i)))[0]
if(fi - rfi == 1 or fi - rfi == -1):
offby1 = True
i += 1
return round(val, i), offby1
parser = argparse.ArgumentParser(description='Analyze floats in a project\'s source')
parser.add_argument('src', help="source file or directory to analyze")
parser.add_argument('-r', action='store_true',help='round all floats to minimum precision')
parser.add_argument('-d', action="store_true",help='Apply to a directory')
# parser.add_argument('-v', action='store_true',help='show what changes are made')
if __name__ == '__main__':
args = parser.parse_args()
if(args.r):
if(args.d):
roundallfloats(args.src)
else:
roundfloats(args.src)
if(args.d):
findallfloats(args.src)
else:
findoddfloats(args.src)

1
tools/m2c Submodule

@ -0,0 +1 @@
Subproject commit 0514701ef53ce46e91e4e675455c44647714d014

View File

@ -182,7 +182,7 @@
- [0x5A2C0, c, fox_edisplay]
- [0x61B30, c, fox_enmy]
- [0x6B3B0, c, fox_enmy2]
- [0x77E40, c, sf_77E40]
- [0x77E40, c, fox_effect]
- [0x84F70, c, fox_fade]
- [0x852F0, c, fox_852F0]
- [0x85530, c, sf_hud]
@ -275,7 +275,7 @@
- [0xD0570, .data, fox_edisplay]
- [0xD09A0, .data, fox_enmy]
- [0xD0B80, .data, fox_enmy2]
- [0xD20E0, data, sf_77E40]
- [0xD20E0, .data, fox_effect]
- [0xD2570, data, sf_hud]
- [0xD31D0, .data, fox_std_lib]
- [0xD3460, .data, fox_game]
@ -299,7 +299,7 @@
- [0xD6C20, .rodata, fox_edisplay]
- [0xD6FD0, .rodata, fox_enmy]
- [0xD7650, .rodata, fox_enmy2]
- [0xD7E30, .rodata, sf_77E40]
- [0xD7E30, .rodata, fox_effect]
- [0xD82F0, .rodata, fox_fade]
- [0xD8320, .rodata, sf_hud]
- [0xD8DE0, .rodata, fox_97F80]