Skip to content

Commit

Permalink
fix headers
Browse files Browse the repository at this point in the history
  • Loading branch information
thefoxcam committed Jul 26, 2024
1 parent 306fa46 commit f81ef52
Show file tree
Hide file tree
Showing 13 changed files with 182 additions and 96 deletions.
2 changes: 2 additions & 0 deletions src/melee/db/db_2253.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
/* 225D64 */ void db_80225D64(Item_GObj* item, Fighter_GObj* owner);
/* 225DD8 */ void db_80225DD8(Item_GObj* item, Fighter_GObj* owner);
/* 22886C */ void db_8022886C(void);
/* 225D54 */ UNK_T db_80225D54(HSD_ObjAllocUnk4*);
/* 4A0E30 */ extern HSD_ObjAllocUnk4 it_804A0E30;
/* 228A64 */ void db_80228A64(void);
/* 228C4C */ void db_80228C4C(void);
/* 4D4A08 */ extern enum_t g_debugLevel;
Expand Down
3 changes: 3 additions & 0 deletions src/melee/gm/gm_1601.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
/* 16AE44 */ bool gm_8016AE44(void);
/* 16AE50 */ Placeholder_8016AE50_ret_val* gm_8016AE50(void);
/* 16AE80 */ bool gm_8016AE80(void);
/* 16AE94 */ f32 gm_8016AE94(void);
/* 16AEA4 */ u64 gm_8016AEA4(void);
/* 16AE80 */ bool gm_8016AE80(void);
/* 16AEDC */ bool gm_8016AEDC(void);
/* 16B014 */ bool gm_8016B014(void);
/* 16B0B4 */ bool gm_8016B0B4(void);
Expand Down
146 changes: 106 additions & 40 deletions src/melee/it/it_266F.c
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
#include "it/it_266F.h"
#include "lb/lbcollision.h"

#include "gm/gm_1601.h"
#include "gr/ground.h"
#include "it/it_26B1.h"

#include "it/item.h"

#include <platform.h>

#include "it/it_266F.h"

#include "inlines.h"
#include "it_2725.h"
#include "types.h"

#include "cm/camera.h"
#include "db/db_2253.h"
#include "ef/efsync.h"
#include "ft/ftlib.h"
#include "gm/gm_1601.h"
#include "gr/ground.h"
#include "gr/stage.h"
#include "it/it_26B1.h"
#include "it/it_2725.h"
#include "it/item.h"
#include "lb/lbcollision.h"
#include "lb/lbgx.h"
#include "mp/mpcoll.h"
#include "mp/mplib.h"

#include <baselib/jobj.h>
#include <math.h>
#include <baselib/cobj.h>
#include <baselib/gobj.h>
#include <math.h>

// @todo move these
/* 26DC24 */ s32 it_8026DC24(HSD_GObj *arg0);
s32 it_8026DD5C(Item_GObj *gobj);
s32 it_8026CB3C(Vec3 *arg0);
f32 gm_8016AE94();
u64 gm_8016AEA4();
bool gm_8016AE80();
s32 it_80272828(s32);

s32 it_8026DDFC(Item_GObj *arg0);
s32 it_8026DBC8(HSD_GObj *gobj);
#include <baselib/gobjproc.h>
#include <baselib/jobj.h>
#include <baselib/memory.h>
#include <baselib/random.h>
#include <baselib/state.h>
#include <baselib/tev.h>

extern ItemCommonData *it_804D6D28;
extern HSD_ObjAllocUnk Item_804A0C64;

/* 4A0E30 */ extern HSD_ObjAllocUnk4 it_804A0E30;
/* 4A0E50 */ extern HSD_ObjAllocUnk6 it_804A0E50;

// @todo: what is this?
typedef struct test_struct {
s32 unk0;
s32 unk4;
Expand Down Expand Up @@ -81,7 +79,7 @@ void it_8026C47C(test_struct *arg0) {
}
}

// definitely size 0x10
// argument is definitely size 0x10
u8 it_8026C65C(HSD_ObjAllocUnk6 *arg0) {
s32 temp_r3;
s32 temp_r4;
Expand Down Expand Up @@ -171,7 +169,7 @@ void fn_8026C88C(HSD_GObj *gobj) {
it_804A0E30.x0 -= 1;
if ((s32) it_804A0E30.x0 == 0) {
spawn.kind = it_8026C75C(&it_804A0E30.x4);
if (spawn.kind != -1) {
if ((s32) spawn.kind != -1) {
if (it_8026CB3C(&spawn.prev_pos) != 0) {
spawn.pos = spawn.prev_pos;
spawn.facing_dir = it_8026B684(&spawn.prev_pos);
Expand All @@ -180,6 +178,7 @@ void fn_8026C88C(HSD_GObj *gobj) {
spawn.x4_parent_gobj2 = spawn.x0_parent_gobj = NULL;
spawn.x44_flag.bits.b0 = 1;
spawn.x40 = 0;
var_r4 = 1;
} else {
var_r4 = 0;
}
Expand Down Expand Up @@ -593,7 +592,8 @@ void it_8026D938(Item_GObj *gobj, ItCallback arg1) {
}
}

void it_8026DA08(Item_GObj *gobj) {
bool it_8026DA08(Item_GObj* gobj)
{
Item *ip;
CollData *coll;
bool test;
Expand All @@ -610,6 +610,7 @@ void it_8026DA08(Item_GObj *gobj) {
if (test != 0) {
ip->xC30 = coll->floor.index;
}
return test;
}

bool it_8026D9A0(Item_GObj* gobj)
Expand Down Expand Up @@ -722,10 +723,6 @@ s32 it_8026DD5C(Item_GObj *gobj) {
return 1;
}

static inline MtxPtr vec3_mtx_copy()
{
}

void it_8026EB18(HSD_GObj *arg0, s32 arg1, Vec3 *arg2) {
Mtx m2;
MtxPtr var_r30;
Expand Down Expand Up @@ -896,25 +893,34 @@ void it_8026E248(Item_GObj *gobj, ItCallback arg1) {
}
}

s32 it_8026E9A4(Item_GObj *arg0, Vec3 *arg1, Vec3 *arg2, s32 arg3) {
s32 it_8026E9A4(Item_GObj* arg0, Vec3* arg1, Vec3* arg2, Vec3* arg3)
{
Vec3 p;
if (mpLib_800524DC(&p, 0, 0, arg3, -1, -1, arg1->x, arg1->y, arg2->x, arg2->y) == 1) {
if (mpLib_800524DC(&p, 0, NULL, arg3, -1, -1, arg1->x, arg1->y, arg2->x,
arg2->y) == 1)
{
*arg2 = p;
return 1;
}
return 0;
}

s32 it_8026EA20(Item_GObj *arg0, Vec3 *arg1, Vec3 *arg2, Vec3 *arg3, s32 *arg4, s32 arg5) {
s32 it_8026EA20(Item_GObj* arg0, Vec3* arg1, Vec3* arg2, Vec3* arg3, s32* arg4,
Vec3* arg5)
{
Vec3 p;
if (mpLib_800524DC(&p, arg4, arg5, arg3, -1, -1, arg1->x, arg1->y, arg2->x, arg2->y) == 1) {
if (mpLib_800524DC(&p, *arg4, arg5, arg3, -1, -1, arg1->x, arg1->y,
arg2->x, arg2->y) == 1)
{
*arg2 = p;
return 1;
}
return 0;
}

s32 it_8026EA9C(Item_GObj *arg0, Vec3 *arg1, Vec3 *arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
s32 it_8026EA9C(Item_GObj* arg0, Vec3* arg1, Vec3* arg2, Vec3* arg3, s32 arg4,
Vec3* arg5, s32 arg6)
{
Vec3 p;
if (mpLib_800524DC(&p, arg4, arg5, arg3, -1, arg6, arg1->x, arg1->y, arg2->x, arg2->y) == 1) {
*arg2 = p;
Expand Down Expand Up @@ -954,8 +960,11 @@ u32 it_8026ECE0(Item_GObj *gobj, u32 arg1) {
var_r30 = 0;
ip = GET_ITEM(gobj);
if ((enum ItemKind) ip->kind == It_Kind_Unk4) {
if ((ip->xDAA_flag.bits.b7) && (ip->xDD4_itemVar.unk.x18.bits.b7 == 0) ||
(ip->xDD4_itemVar.unk.x18.bits.b6 && (lbColl_8000A10C(&ip->xDD4_itemVar.unk.x1C, arg1, ip->scl) != 0))) {
if (((ip->xDAA_flag.bits.b7) &&
(ip->xDD4_itemVar.unk.x18.bits.b7 == 0)) ||
(ip->xDD4_itemVar.unk.x18.bits.b6 &&
(lbColl_8000A10C(&ip->xDD4_itemVar.unk.x1C, arg1, ip->scl) != 0)))
{
var_r30 = 1;
}
} else {
Expand Down Expand Up @@ -1059,7 +1068,8 @@ static inline void it_8026EECC_inline_3(HSD_GObj *gobj, s32 arg1, Vec3 *pos)
it_8026EC54_inline(gobj, ip);
}

void it_8026EECC(HSD_GObj *gobj, s32 arg1) {
void it_8026EECC(HSD_GObj* gobj, int arg1)
{
Item *ip = gobj->user_data;
Vec3 pos;
if (ip->xDAA_flag.bits.b0) {
Expand Down Expand Up @@ -1128,3 +1138,59 @@ void it_8026EECC(HSD_GObj *gobj, s32 arg1) {
void it_8026F3AC(void) {
it_8026C75C(&it_804A0E50);
}

#if 0
s32 it_8026C530(s32 arg0, void *arg1, s32 arg2, s32 arg3) {
s32 temp_r10;
s32 temp_r5;
s32 temp_r6;
s32 temp_r7;
s32 temp_r7_2;
s32 temp_r7_3;
s32 temp_r8;
s32 temp_r9;
s32 temp_r9_2;
s32 var_r5;

var_r5 = arg2;
temp_r8 = arg3 - 1;
if (var_r5 == temp_r8) {
return var_r5;
}
temp_r10 = arg1->unkC;
temp_r9 = (s32) (var_r5 + arg3) / 2;
temp_r7_2 = temp_r9 * 2;
if ((s32) *(temp_r10 + temp_r7_2) > arg0) {
if (var_r5 == (s32) (temp_r9 - 1)) {

} else {
temp_r6 = (s32) (var_r5 + temp_r9) / 2;
temp_r7_3 = temp_r6 * 2;
if ((s32) *(temp_r10 + temp_r7_3) > arg0) {
var_r5 = it_8026C530();
} else if ((s32) (temp_r10 + temp_r7_3)->unk2 > arg0) {
var_r5 = temp_r6;
} else {
var_r5 = it_8026C530(temp_r6, temp_r9);
}
}
return var_r5;
}
temp_r9_2 = temp_r10 + 2;
if ((s32) *(temp_r9_2 + temp_r7_2) > arg0) {
return temp_r9;
}
if (temp_r9 == temp_r8) {
return temp_r9;
}
temp_r7 = (s32) (temp_r9 + arg3) / 2;
temp_r5 = temp_r7 * 2;
if ((s32) *(temp_r10 + temp_r5) > arg0) {
return it_8026C530(temp_r9, temp_r7);
}
if ((s32) *(temp_r9_2 + temp_r5) > arg0) {
return temp_r7;
}
return it_8026C530(temp_r7);
}
#endif
90 changes: 49 additions & 41 deletions src/melee/it/it_266F.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,61 @@

typedef void (*ItCallback)(HSD_GObj *);

/* 077688 */ UNK_RET ftColl_80077688(UNK_PARAMS);
/* 26C75C */ s8 it_8026C75C(HSD_ObjAllocUnk6 *arg0);
/* 26C88C */ void fn_8026C88C(HSD_GObj *gobj);
/* 26CA4C */ void it_8026CA4C(u16 *arg0, s32 *arg1, u64 arg2, s32 arg4, f32 arg8);
/* 26CB3C */ s32 it_8026CB3C(Vec3 *arg0);
/* 26CB9C */ void it_8026CB9C(s32 *arg0, u64 arg2, u32 arg3, f32 arg8);
/* 26C530 */ s32 it_8026C530(s32, void*, s32, s32);
/* 26C65C */ u8 it_8026C65C(HSD_ObjAllocUnk6*);
/* 26C704 */ s32 it_8026C704(void);
/* 26C75C */ s8 it_8026C75C(HSD_ObjAllocUnk6*);
/* 26C88C */ void fn_8026C88C(HSD_GObj*);
/* 26CA4C */ void it_8026CA4C(u16*, s32*, u64, s32, f32);
/* 26CB3C */ s32 it_8026CB3C(Vec3*);
/* 26CB9C */ void it_8026CB9C(s32*, u64, u32, f32);
/* 26CD50 */ void it_8026CD50(s32*, u64, f32);
/* 26CF04 */ void it_8026CF04(void);
/* 26D018 */ void it_8026D018(void);
/* 26D258 */ s32 it_8026D258(void *arg0, s32 arg1);
/* 26D258 */ s32 it_8026D258(void*, s32);
/* 26D324 */ bool it_8026D324(s32);
/* 26D324 */ bool it_8026D324(s32 arg0);
/* 26D3CC */ s32 it_8026D3CC(void);
/* 26D564 */ void it_8026D564(Item_GObj *gobj);
/* 26D5CC */ void it_8026D5CC(Item_GObj *gobj);
/* 26D604 */ s32 it_8026D604(HSD_GObj *gobj);
/* 26D62C */ void it_8026D62C(Item_GObj *gobj, ItCallback arg1);
/* 26D6F4 */ void it_8026D6F4(Item_GObj *gobj, ItCallback arg1);
/* 26D78C */ void it_8026D78C(Item_GObj *gobj, ItCallback arg1);
/* 26D82C */ void it_8026D82C(Item_GObj *gobj);
/* 26D8A4 */ s32 it_8026D8A4(Item_GObj *gobj, ItCallback arg1);
/* 26D938 */ void it_8026D938(Item_GObj *gobj, ItCallback arg1);
/* 26D564 */ void it_8026D564(Item_GObj*);
/* 26D5CC */ void it_8026D5CC(Item_GObj*);
/* 26D604 */ s32 it_8026D604(HSD_GObj* gobj);
/* 26D604 */ s32 it_8026D604(HSD_GObj*);
/* 26D62C */ void it_8026D62C(Item_GObj*, HSD_GObjEvent);
/* 26D62C */ void it_8026D62C(Item_GObj*, ItCallback);
/* 26D6F4 */ void it_8026D6F4(Item_GObj*, ItCallback);
/* 26D78C */ void it_8026D78C(Item_GObj*, ItCallback);
/* 26D82C */ void it_8026D82C(Item_GObj*);
/* 26D8A4 */ s32 it_8026D8A4(Item_GObj*, ItCallback);
/* 26D938 */ void it_8026D938(Item_GObj*, ItCallback);
/* 26D9A0 */ bool it_8026D9A0(Item_GObj*);
/* 26DA08 */ void it_8026DA08(Item_GObj *gobj);
/* 26DA70 */ bool it_8026DA70(Item_GObj *gobj);
/* 26DAA8 */ s32 it_8026DAA8(Item_GObj *gobj);
/* 26DB40 */ s32 it_8026DB40(Item_GObj *gobj);
/* 26DBC8 */ s32 it_8026DBC8(HSD_GObj *gobj);
/* 26DC24 */ s32 it_8026DC24(HSD_GObj *gobj);
/* 26DD5C */ s32 it_8026DD5C(Item_GObj *gobj);
/* 26DDFC */ s32 it_8026DDFC(Item_GObj *gobj);
/* 26DE98 */ s32 it_8026DE98(Item_GObj *arg0);
/* 26DF34 */ s32 it_8026DF34(Item_GObj *gobj);
/* 26DFB0 */ s32 it_8026DFB0(Item_GObj *gobj);
/* 26E058 */ s32 it_8026E058(Item_GObj *gobj);
/* 26E0F4 */ void it_8026E0F4(Item_GObj *gobj);
/* 26E15C */ void it_8026E15C(Item_GObj *gobj, ItCallback arg1);
/* 26E248 */ void it_8026E248(Item_GObj *gobj, ItCallback arg1);
/* 26DA08 */ bool it_8026DA08(Item_GObj*);
/* 26DA70 */ bool it_8026DA70(Item_GObj*);
/* 26DAA8 */ s32 it_8026DAA8(Item_GObj*);
/* 26DB40 */ s32 it_8026DB40(Item_GObj*);
/* 26DBC8 */ s32 it_8026DBC8(HSD_GObj*);
/* 26DC24 */ s32 it_8026DC24(HSD_GObj*);
/* 26DD5C */ s32 it_8026DD5C(Item_GObj*);
/* 26DDFC */ s32 it_8026DDFC(Item_GObj*);
/* 26DE98 */ s32 it_8026DE98(Item_GObj*);
/* 26DF34 */ s32 it_8026DF34(Item_GObj*);
/* 26DFB0 */ s32 it_8026DFB0(Item_GObj*);
/* 26E058 */ s32 it_8026E058(Item_GObj*);
/* 26E0F4 */ void it_8026E0F4(Item_GObj*);
/* 26E15C */ void it_8026E15C(Item_GObj*, ItCallback);
/* 26E248 */ void it_8026E248(Item_GObj*, ItCallback);
/* 26E0F4 */ void it_8026E0F4(Item_GObj*);
/* 26E15C */ void it_8026E15C(Item_GObj*, HSD_GObjEvent);
/* 26E248 */ void it_8026E248(Item_GObj*, HSD_GObjEvent);
/* 26E414 */ void it_8026E414(Item_GObj*, HSD_GObjEvent);
/* 26E71C */ void it_8026E71C(Item_GObj*, HSD_GObjEvent);
/* 26E8C4 */ void it_8026E8C4(Item_GObj*, HSD_GObjEvent, HSD_GObjEvent);
/* 26E9A4 */ s32 it_8026E9A4(Item_GObj *arg0, Vec3 *arg1, Vec3 *arg2, s32 arg3);
/* 26EA20 */ s32 it_8026EA20(Item_GObj *arg0, Vec3 *arg1, Vec3 *arg2, Vec3 *arg3, s32 *arg4, s32 arg5);
/* 26EA9C */ s32 it_8026EA9C(Item_GObj *arg0, Vec3 *arg1, Vec3 *arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6);
/* 26EB18 */ void it_8026EB18(HSD_GObj *arg0, s32 arg1, Vec3 *arg2);
/* 26EBC8 */ void it_8026EBC8(HSD_GObj *gobj, u16 arg1, u8 *arg2);
/* 26EC54 */ void it_8026EC54(HSD_GObj *gobj, u16 arg1, u8 *arg2);
/* 26ECE0 */ u32 it_8026ECE0(Item_GObj *gobj, u32 arg1);
/* 26EECC */ void it_8026EECC(HSD_GObj *gobj, s32 arg1);
/* 26E9A4 */ s32 it_8026E9A4(Item_GObj*, Vec3*, Vec3*, Vec3*);
/* 26EA20 */ s32 it_8026EA20(Item_GObj*, Vec3*, Vec3*, Vec3*, s32*, Vec3*);
/* 26EA9C */ s32 it_8026EA9C(Item_GObj*, Vec3*, Vec3*, Vec3*, s32, Vec3*, s32);
/* 26EB18 */ void it_8026EB18(HSD_GObj*, s32, Vec3*);
/* 26EBC8 */ void it_8026EBC8(HSD_GObj*, u16, u8*);
/* 26EC54 */ void it_8026EC54(HSD_GObj*, u16, u8*);
/* 26ECE0 */ u32 it_8026ECE0(Item_GObj*, u32);
/* 26EECC */ void it_8026EECC(HSD_GObj*, int);
/* 26F3AC */ void it_8026F3AC(void);
/* 26F3D4 */ void it_8026F3D4(Item_GObj*, int, bool, int);
/* 26F8B4 */ bool it_8026F8B4(Item_GObj*, Vec3*, Vec3*, int);
Expand Down Expand Up @@ -96,8 +103,8 @@ typedef void (*ItCallback)(HSD_GObj *);
/* 272C90 */ HSD_JObj* it_80272C90(Item_GObj* gobj);
/* 272D1C */ bool it_80272D1C(HSD_GObj* gobj);
/* 272D40 */ s32 it_80272D40(HSD_GObj* gobj);
/* 272F7C */ void it_80272F7C(HSD_JObj*, f32);
/* 272db0 */ bool itColl_BounceOffVictim(Item_GObj*);
/* 272F7C */ void it_80272F7C(HSD_JObj*, f32);
/* 273030 */ bool it_80273030(Item_GObj*);
/* 273078 */ bool itColl_BounceOffShield(Item_GObj*);
/* 273130 */ bool it_80273130(Item_GObj*);
Expand Down Expand Up @@ -156,6 +163,7 @@ typedef void (*ItCallback)(HSD_GObj *);
/* 27B0C4 */ void it_8027B0C4(HSD_GObj*, SpawnItem*);
/* 27B4A4 */ void it_8027B4A4(Fighter_GObj*, Item_GObj*);
/* 27B5B0 */ Item_GObj* it_8027B5B0(s32, s32, HSD_JObj*, Vec3*, s32);

/* 4A0E30 */ extern HSD_ObjAllocUnk4 it_804A0E30;
/* 4A0E50 */ extern HSD_ObjAllocUnk6 it_804A0E50;
/* 4A0E60 */ extern HSD_ObjAllocUnk6 it_804A0E60;
Expand Down
Loading

0 comments on commit f81ef52

Please sign in to comment.