From 585ce179db165db7d8b1bd60b22bb6d04c3327d0 Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Thu, 25 Jul 2024 17:48:38 -0400 Subject: [PATCH] clean up protos --- src/melee/ft/ftcoll.c | 3 +- src/melee/ft/ftcoll.h | 2 + src/melee/gr/grkongo.c | 122 +++++++++++------------------------------ src/melee/gr/grkongo.h | 50 +++++++++++++++++ src/melee/gr/ground.c | 4 +- src/melee/gr/types.h | 2 +- src/melee/it/it_266F.h | 1 - 7 files changed, 90 insertions(+), 94 deletions(-) diff --git a/src/melee/ft/ftcoll.c b/src/melee/ft/ftcoll.c index 96c90ee8a4..5faf93f470 100644 --- a/src/melee/ft/ftcoll.c +++ b/src/melee/ft/ftcoll.c @@ -725,7 +725,8 @@ void ftColl_80077464(void) NOT_IMPLEMENTED; } -void ftColl_80077688(void) +void ftColl_80077688(Item* item, HitCapsule* hurt, Fighter* fp, Vec3* pos, + f32 val) { NOT_IMPLEMENTED; } diff --git a/src/melee/ft/ftcoll.h b/src/melee/ft/ftcoll.h index 5bb9c27924..a67898c1c7 100644 --- a/src/melee/ft/ftcoll.h +++ b/src/melee/ft/ftcoll.h @@ -4,6 +4,7 @@ #include #include "ft/forward.h" #include "ftCommon/forward.h" +#include "it/forward.h" #include "lb/forward.h" #include @@ -33,6 +34,7 @@ /* 076ED8 */ bool ftColl_80076ED8(Fighter* fp0, HitCapsule* hit0, Fighter* fp1, HitCapsule* hit1); /* 077464 */ UNK_RET ftColl_80077464(UNK_PARAMS); +/* 077688 */ void ftColl_80077688(Item*, HitCapsule*, Fighter*, Vec3*, f32); /* 077970 */ UNK_RET ftColl_80077970(UNK_PARAMS); /* 077C60 */ UNK_RET ftColl_80077C60(UNK_PARAMS); /* 078384 */ void ftColl_80078384(Fighter*, HurtCapsule*, HitCapsule*); diff --git a/src/melee/gr/grkongo.c b/src/melee/gr/grkongo.c index cdceed3361..0f06170bb3 100644 --- a/src/melee/gr/grkongo.c +++ b/src/melee/gr/grkongo.c @@ -1,100 +1,38 @@ +#include "gr/grkongo.h" -#include "lb/lb_00B0.h" - -#include "mp/mplib.h" - -#include "lb/lb_00F9.h" - -#include -#include "gr/inlines.h" -#include "gr/granime.h" - -#include "gr/grzakogenerator.h" +#include "grmaterial.h" +#include "types.h" #include "ft/ftdevice.h" - #include "gm/gm_1601.h" - +#include "gr/granime.h" +#include "gr/grdisplay.h" +#include "gr/ground.h" +#include "gr/grzakogenerator.h" +#include "gr/inlines.h" #include "gr/stage.h" - +#include "lb/lb_00B0.h" +#include "lb/lb_00F9.h" #include "mp/mplib.h" - -#include "gr/ground.h" - #include "MSL/math.h" #include "MSL/math_ppc.h" -#include "grmaterial.h" -#include "types.h" -#include "gr/grdisplay.h" -#include -#include -#include + #include +#include +#include +#include +#include void grAnime_801C78FC(HSD_GObj *, s32, s32); -s32 grAnime_801C84A4(HSD_GObj *, s32, s32); -void grAnime_801C7A04(HSD_GObj *, s32, s32, f32); /* extern */ -void it_802E20D8(Item_GObj *); /* extern */ - +bool grAnime_801C84A4(HSD_GObj*, s32, s32); +void grAnime_801C7A04(HSD_GObj*, s32, s32, f32); +void it_802E20D8(Item_GObj*); void mpLib_800580AC(s32); /* extern */ void mpLib_800580E0(s32); /* extern */ -void grKongo_801D5238(); /* static */ -void grKongo_801D523C(); /* static */ -void grKongo_801D52F8(); /* static */ -void grKongo_801D52FC(); /* static */ - -void grKongo_801D5238(); /* static */ -HSD_GObj *grKongo_801D5340(s32); /* static */ -void grKongo_801D828C(HSD_GObj* gobj); -int fn_801D8134(HSD_GObj *arg0, HSD_GObj *arg1); /* static */ -s32 grKongo_801D5338(); /* static */ - +int fn_801D8134(HSD_GObj* arg0, HSD_GObj* arg1); /* static */ void fn_801D7700(void *arg2, s32 arg4); /* static */ -void fn_801D7E60(void *arg2, s32 arg4); /* static */ -// HSD_GObj *grKongo_801D5340(s32 arg0, ?, u8 *); /* static */ -void grKongo_801D5490(HSD_GObj *arg0); /* static */ -s32 grKongo_801D5574(); /* static */ -void grKongo_801D557C(HSD_GObj *arg0); /* static */ -void grKongo_801D55D4(); /* static */ -void grKongo_801D55D8(HSD_GObj *arg0); /* static */ -s32 grKongo_801D5774(); /* static */ -void grKongo_801D577C(HSD_GObj *arg0); /* static */ -void grKongo_801D5FA4(); /* static */ -void grKongo_801D5FA8(HSD_GObj *arg0); /* static */ -s32 grKongo_801D5FD4(); /* static */ -void grKongo_801D5FDC(); /* static */ -void grKongo_801D5FE0(); /* static */ -void grKongo_801D5FE4(HSD_GObj *arg0); /* static */ -s32 grKongo_801D6028(); /* static */ -void grKongo_801D6030(); /* static */ -void grKongo_801D6034(); /* static */ -void grKongo_801D6038(HSD_GObj *arg0); /* static */ -s32 grKongo_801D6064(); /* static */ -void grKongo_801D606C(); /* static */ -void grKongo_801D6070(); /* static */ -void grKongo_801D6074(HSD_GObj *arg0); /* static */ -s32 grKongo_801D6190(); /* static */ -void grKongo_801D6198(HSD_GObj *arg0); /* static */ -void grKongo_801D6378(); /* static */ -void grKongo_801D637C(HSD_GObj *arg0); /* static */ -s32 grKongo_801D64B4(); /* static */ -void grKongo_801D64BC(HSD_GObj *arg0); /* static */ -void grKongo_801D6518(); /* static */ -void grKongo_801D651C(HSD_GObj *arg0); /* static */ -s32 grKongo_801D6660(); /* static */ -void grKongo_801D6668(HSD_GObj *arg0); /* static */ -void grKongo_801D69AC(); /* static */ -void grKongo_801D69B0(HSD_GObj *arg0); /* static */ -void grKongo_801D7134(HSD_GObj *arg0, s32 arg1); /* static */ -void grKongo_801D77E0(HSD_GObj *arg0, s32 arg1); /* static */ -void grKongo_801D7BBC(HSD_GObj *arg0); /* static */ -s32 grKongo_801D7F78(HSD_GObj *arg0); /* static */ -Item_GObj *grKongo_801D8078(HSD_GObj *); /* static */ -f32 grKongo_801D8314(); /* static */ -s32 grKongo_801D8444(); /* static */ -s32 grKongo_801D844C(void *arg0, HSD_JObj *arg2); /* static */ -void grKongo_801D6AFC(void); +void fn_801D7E60(void* arg2, s32 arg4); /* static */ static StageCallbacks *grKg_803E16E0; @@ -291,7 +229,6 @@ void grKongo_801D5490(HSD_GObj *arg0) { s32 grKongo_801D5574(void) { return 0; } - void grKongo_801D557C(HSD_GObj *arg0) { grKongo_801D7134(arg0, 0); grKongo_801D77E0(arg0, 0); @@ -354,6 +291,7 @@ static inline s32 random_adder(s32 temp_f0, s32 temp_f2) } return var_r29 + var_r3_2; } + return temp_r28_2; #endif } @@ -385,6 +323,7 @@ static inline s32 random_adder_f(f32 temp_f0, f32 temp_f2) } return var_r29 + var_r3_2; } + return temp_r28_2; #else s32 temp_s0 = temp_f0; s32 temp_s2 = temp_f2; @@ -483,6 +422,7 @@ static inline f32 tau_range(f32 a) } else if (a < (f32)-M_TAU) { return (f64)a + M_TAU; } + return 0.0F; } void grKongo_801D577C(HSD_GObj *arg0) { @@ -582,7 +522,7 @@ void grKongo_801D577C(HSD_GObj *arg0) { } break; case 2: - temp_r31->gv.kongo2.xCE =- 1; + temp_r31->gv.kongo2.xCE -= 1; if (temp_r31->gv.kongo2.xCE < 0) { temp_r31->gv.kongo2.xC8 = 3; } @@ -748,7 +688,8 @@ void grKongo_801D6074(HSD_GObj *arg0) { HSD_JObjSetTranslateX(temp_r30, temp_r31->gv.kongo.xCC); } -s32 grKongo_801D6190() { +s32 grKongo_801D6190(void) +{ return 0; } @@ -804,9 +745,11 @@ void grKongo_801D6198(HSD_GObj *arg0) { } void grKongo_801D6378(void) { - + return; } +// @todo: change callsites from s32 * to HSD_GObj * +#if 0 void grKongo_801D828C(HSD_GObj* gobj) { Ground* gp = gobj->user_data; @@ -820,6 +763,7 @@ void grKongo_801D828C(HSD_GObj* gobj) grMaterial_801C95C4(gobj); } } +#endif void grKongo_801D637C(HSD_GObj *arg0) { Ground *temp_r31; @@ -1040,7 +984,7 @@ void grKongo_801D69B0(HSD_GObj *gobj) { mpLib_800580AC(4); } -static inline rad_compare(f32 a, f32 b, f32 *ret) +static inline void rad_compare(f32 a, f32 b, f32* ret) { f32 c = deg_to_rad * b; if (a > c) { @@ -1053,7 +997,7 @@ static inline rad_compare(f32 a, f32 b, f32 *ret) } } -static inline rad_compare_b(f32 a, f32 b, f32 *ret) +static inline void rad_compare_b(f32 a, f32 b, f32* ret) { f32 c = deg_to_rad * b; if (a > c) { @@ -1065,7 +1009,7 @@ static inline rad_compare_b(f32 a, f32 b, f32 *ret) *ret = (f32) (0.99 * (f64) (c + *ret)); } -static inline rad_compare_c(f32 a, f32 b, f32 d, f32 *ret) +static inline void rad_compare_c(f32 a, f32 b, f32 d, f32* ret) { f32 c = deg_to_rad * b; if (a > c) { diff --git a/src/melee/gr/grkongo.h b/src/melee/gr/grkongo.h index b6de26b201..2e1506e390 100644 --- a/src/melee/gr/grkongo.h +++ b/src/melee/gr/grkongo.h @@ -2,8 +2,58 @@ #define GALE01_1D5238 #include +#include "lb/forward.h" +#include +/* 1D5238 */ void grKongo_801D5238(void); +/* 1D523C */ void grKongo_801D523C(void); +/* 1D52F8 */ void grKongo_801D52F8(void); +/* 1D52FC */ void grKongo_801D52FC(void); +/* 1D5338 */ s32 grKongo_801D5338(void); +/* 1D5340 */ HSD_GObj* grKongo_801D5340(s32); +/* 1D542C */ void fn_801D542C(HSD_GObj*); +/* 1D5490 */ void grKongo_801D5490(HSD_GObj*); +/* 1D5574 */ s32 grKongo_801D5574(void); +/* 1D557C */ void grKongo_801D557C(HSD_GObj*); +/* 1D55D4 */ void grKongo_801D55D4(void); +/* 1D55D8 */ void grKongo_801D55D8(HSD_GObj*); +/* 1D5774 */ s32 grKongo_801D5774(void); +/* 1D577C */ void grKongo_801D577C(HSD_GObj*); +/* 1D5FA4 */ void grKongo_801D5FA4(void); +/* 1D5FA8 */ void grKongo_801D5FA8(HSD_GObj*); +/* 1D5FD4 */ s32 grKongo_801D5FD4(void); +/* 1D5FDC */ void grKongo_801D5FDC(void); +/* 1D5FE0 */ void grKongo_801D5FE0(void); +/* 1D5FE4 */ void grKongo_801D5FE4(HSD_GObj*); +/* 1D6028 */ s32 grKongo_801D6028(void); +/* 1D6030 */ void grKongo_801D6030(void); +/* 1D6034 */ void grKongo_801D6034(void); +/* 1D6038 */ void grKongo_801D6038(HSD_GObj*); +/* 1D6064 */ s32 grKongo_801D6064(void); +/* 1D606C */ void grKongo_801D606C(void); +/* 1D6070 */ void grKongo_801D6070(void); +/* 1D6074 */ void grKongo_801D6074(HSD_GObj*); +/* 1D6190 */ s32 grKongo_801D6190(void); +/* 1D6198 */ void grKongo_801D6198(HSD_GObj*); +/* 1D6378 */ void grKongo_801D6378(void); /* 1D8270 */ void grKongo_801D8270(s32); /* 1D828C */ void grKongo_801D828C(s32); +/* 1D637C */ void grKongo_801D637C(HSD_GObj*); +/* 1D64B4 */ s32 grKongo_801D64B4(void); +/* 1D64BC */ void grKongo_801D64BC(HSD_GObj*); +/* 1D6518 */ void grKongo_801D6518(void); +/* 1D651C */ void grKongo_801D651C(HSD_GObj*); +/* 1D6660 */ s32 grKongo_801D6660(void); +/* 1D6668 */ void grKongo_801D6668(HSD_GObj*); +/* 1D69AC */ void grKongo_801D69AC(void); +/* 1D69B0 */ void grKongo_801D69B0(HSD_GObj*); +/* 1D6AFC */ void grKongo_801D6AFC(void); +/* 1D69B0 */ void grKongo_801D69B0(HSD_GObj*); +/* 1D7134 */ void grKongo_801D7134(HSD_GObj*, s32); +/* 1D77E0 */ void grKongo_801D77E0(HSD_GObj*, s32); +/* 1D7BBC */ void grKongo_801D7BBC(HSD_GObj*); +/* 1D7F78 */ bool grKongo_801D7F78(HSD_GObj*); +/* 1D8078 */ HSD_GObj* grKongo_801D8078(HSD_GObj*); +/* 1D8314 */ f32 grKongo_801D8314(void); #endif diff --git a/src/melee/gr/ground.c b/src/melee/gr/ground.c index 78c5c369a0..3f0612d27f 100644 --- a/src/melee/gr/ground.c +++ b/src/melee/gr/ground.c @@ -1167,7 +1167,7 @@ void Ground_801C2374(HSD_LObj* lobj) } } -s32 Ground_801C247C(s32 arg0, s32 arg1) +HSD_Spline* Ground_801C247C(s32 arg0, s32 arg1) { UnkArchiveStruct* archive = grDatFiles_801C6330(arg0); if (archive == NULL) { @@ -1176,7 +1176,7 @@ s32 Ground_801C247C(s32 arg0, s32 arg1) if (archive->unk4 != NULL && arg1 < archive->unk4->unk14) { return archive->unk4->unk10[arg1]; } else { - return 0; + return NULL; } } diff --git a/src/melee/gr/types.h b/src/melee/gr/types.h index b0277a7a80..d1052e6724 100644 --- a/src/melee/gr/types.h +++ b/src/melee/gr/types.h @@ -385,7 +385,7 @@ struct UnkStageDat { struct UnkStageDat_x8_t* unk8; s32 unkC; - s32* unk10; + HSD_Spline** unk10; s32 unk14; u8 x18_fill[0x20 - 0x18]; diff --git a/src/melee/it/it_266F.h b/src/melee/it/it_266F.h index 91779db086..b9cfb52ba9 100644 --- a/src/melee/it/it_266F.h +++ b/src/melee/it/it_266F.h @@ -11,7 +11,6 @@ #include -/* 077688 */ void ftColl_80077688(Item *, HitCapsule *, Fighter *, Vec3 *, f32); /* 26D324 */ bool it_8026D324(bool); /* 26D604 */ s32 it_8026D604(HSD_GObj* gobj); /* 26D62C */ void it_8026D62C(Item_GObj*, HSD_GObjEvent);