Skip to content

Commit

Permalink
Match 14.73% of ftCo_0A01 (81.08 KB) (#1424)
Browse files Browse the repository at this point in the history
  • Loading branch information
ribbanya authored Aug 11, 2024
1 parent 0dcfffc commit a8e27ea
Show file tree
Hide file tree
Showing 11 changed files with 449 additions and 82 deletions.
451 changes: 401 additions & 50 deletions src/melee/ft/chara/ftCommon/ftCo_0A01.c

Large diffs are not rendered by default.

24 changes: 14 additions & 10 deletions src/melee/ft/chara/ftCommon/ftCo_0A01.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include "ft/forward.h"
#include "ftCommon/forward.h"
#include "gr/forward.h"
#include "mp/forward.h"

#include "ft/types.h"

#include <common_structs.h>
#include <placeholder.h>
Expand Down Expand Up @@ -35,7 +38,7 @@
/* 0A007C */ bool ftCo_IsGrabbing(ftCo_Fighter* fp);
/* 0A00FC */ bool ftCo_800A3200(ftCo_Fighter* fp);
/* 0A0740 */ bool ftCo_IsAlly(ftCo_Fighter* fp0, ftCo_Fighter* fp1);
/* 0A193C */ UNK_RET ftCo_800A4A40(UNK_PARAMS);
/* 0A193C */ ftCo_Fighter* ftCo_800A4A40(ftCo_Fighter* fp);
/* 0A1AB4 */ float ftCo_800A1AB4(ftCo_Fighter* fp0, ftCo_Fighter* fp1);
/* 0A1BA8 */ bool ftCo_800A1BA8(ftCo_Fighter* fp);
/* 0A1C44 */ bool ftCo_800A1C44(ftCo_Fighter* fp);
Expand All @@ -56,12 +59,12 @@
/// @todo Static functions belong in #ftCo_0A01.c
/* 09D044 */ static UNK_RET ftCo_800A0148(UNK_PARAMS);
/* 09D06C */ static UNK_RET ftCo_800AC7D4(UNK_PARAMS);
/* 09D280 */ static UNK_RET ftCo_800A0384(UNK_PARAMS);
/* 09D280 */ static void ftCo_800A0384(ftCo_Fighter* fp);
/* 09D3DC */ static UNK_RET ftCo_800ACB44(UNK_PARAMS);
/* 09D404 */ static void ftCo_800A0508(ftCo_Fighter* fp);
/* 09D5F4 */ static UNK_RET ftCo_800ACD5C(UNK_PARAMS);
/* 09D7EC */ static void ftCo_800A08F0(ftCo_Fighter* fp);
/* 09D9F0 */ static UNK_RET ftCo_800A0AF4(UNK_PARAMS);
/* 09D9F0 */ static void ftCo_800A0AF4(ftCo_Fighter* fp);
/* 09DBAC */ static void ftCo_800A0CB0(ftCo_Fighter* fp);
/* 09DCC4 */ static void ftCo_800AD42C(ftCo_Fighter* fp);
/* 09DDE4 */ static UNK_RET ftCo_800AD54C(UNK_PARAMS);
Expand All @@ -79,7 +82,7 @@
/* 09F198 */ static UNK_RET ftCo_800A229C(UNK_PARAMS);
/* 09F324 */ static UNK_RET ftCo_800AEA8C(UNK_PARAMS);
/* 09F588 */ static UNK_RET ftCo_800AECF0(UNK_PARAMS);
/* 09F614 */ static UNK_RET ftCo_800A2718(UNK_PARAMS);
/* 09F614 */ static bool ftCo_800A2718(mp_UnkStruct0*);
/* 09F850 */ static UNK_RET ftCo_800AEFB8(UNK_PARAMS);
/* 09FB28 */ static UNK_RET ftCo_800AF290(UNK_PARAMS);
/* 09FB7C */ static UNK_RET ftCo_800A2C80(UNK_PARAMS);
Expand All @@ -94,7 +97,7 @@
/* 0A0990 */ static UNK_RET ftCo_800B00F8(UNK_PARAMS);
/* 0A0D74 */ static UNK_RET ftCo_800B04DC(UNK_PARAMS);
/* 0A0F34 */ static bool ftCo_800A4038(ftCo_Fighter* fp, bool);
/* 0A0FF8 */ static UNK_RET ftCo_800B0760(UNK_PARAMS);
/* 0A0FF8 */ static void ftCo_800B0760(ftCo_Fighter* fp);
/* 0A11B0 */ static UNK_RET ftCo_800B0918(UNK_PARAMS);
/* 0A138C */ static void ftCo_800B0AF4(ftCo_Fighter* fp);
/* 0A1540 */ static bool ftCo_800B0CA8(ftCo_Fighter* fp);
Expand All @@ -115,30 +118,31 @@
// /* 0A2638 */ static void ftCo_800B1DA0(ftCo_Fighter* fp);
/* 0A2788 */ static UNK_RET ftCo_800B1EF0(UNK_PARAMS);
/* 0A2798 */ static ftCo_Fighter* ftCo_800A589C(ftCo_Fighter* fp);
/* 0A2840 */ static bool ftCo_800A5944(ftCo_Fighter* fp);
/* 0A2840 */ static bool ftCo_800A5944(Item* ip);
/* 0A2A60 */ static UNK_RET ftCo_800B21C8(UNK_PARAMS);
/* 0A2D50 */ static UNK_RET ftCo_800B24B8(UNK_PARAMS);
/* 0A3028 */ static void ftCo_800B2790(ftCo_Fighter* fp);
/* 0A3C48 */ static void ftCo_800B33B0(ftCo_Fighter* fp);
/* 0A5ACC */ static UNK_RET ftCo_800A5ACC(UNK_PARAMS);
/* 0A5CE0 */ static UNK_T ftCo_800A5CE0(ftCo_Fighter* fp);
/* 0A5F4C */ static UNK_RET ftCo_800A5F4C(UNK_PARAMS);
/* 0A5F4C */ static struct Fighter_x1A88_t* ftCo_800A5F4C(ftCo_Fighter* fp,
int);
/* 0A61D8 */ static UNK_RET ftCo_800A61D8(UNK_PARAMS);
/* 0A648C */ static UNK_RET ftCo_800A648C(UNK_PARAMS);
/* 0A648C */ static int ftCo_800A648C(ftCo_Fighter* fp);
/* 0A6700 */ static bool ftCo_800A6700(ftCo_Fighter* fp, Vec3*, Vec3*);
/* 0A6A98 */ static UNK_RET ftCo_800A6A98(UNK_PARAMS);
/* 0A6D2C */ static UNK_RET ftCo_800A6D2C(UNK_PARAMS);
/* 0A6FC4 */ static UNK_RET ftCo_800A6FC4(UNK_PARAMS);
/* 0A75DC */ static UNK_RET ftCo_800A75DC(UNK_PARAMS);
/* 0A7AAC */ static UNK_RET ftCo_800A7AAC(UNK_PARAMS);
/* 0A7AAC */ static void ftCo_800A7AAC(ftCo_Fighter* fp);
/* 0A80E4 */ static void ftCo_800A80E4(ftCo_Fighter* fp);
/* 0A8210 */ static UNK_RET ftCo_800A8210(UNK_PARAMS);
/* 0A866C */ static UNK_RET ftCo_800A866C(UNK_PARAMS);
/* 0A8940 */ static void ftCo_800A8940(ftCo_Fighter* fp);
/* 0A8DE4 */ static void ftCo_800A8DE4(ftCo_Fighter* fp);
/* 0A8EB0 */ static UNK_RET ftCo_800A8EB0(UNK_PARAMS);
/* 0A92CC */ static UNK_RET ftCo_800A92CC(UNK_PARAMS);
/* 0A949C */ static UNK_RET ftCo_800A949C(UNK_PARAMS);
/* 0A949C */ static void ftCo_800A949C(ftCo_Fighter* fp);
/* 0A963C */ static void ftCo_800A963C(ftCo_Fighter* fp);
/* 0A96B8 */ static UNK_RET ftCo_800A96B8(UNK_PARAMS);
/* 0A9904 */ static UNK_RET ftCo_800A9904(UNK_PARAMS);
Expand Down
27 changes: 21 additions & 6 deletions src/melee/ft/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,8 @@ struct Fighter_x1A88_t {
/* +40 */ UNK_T x40;
/* +44 */ Fighter* x44;
/* +48 */ UNK_T x48;
/* +4C */ UNK_T x4C;
/* +50 */ UNK_T x50;
/* +4C */ void* x4C;
/* +50 */ int x50;
/* +54 */ Vec2 x54;
/* +5C */ float x5C;
/* +60 */ int x60;
Expand Down Expand Up @@ -1020,9 +1020,23 @@ struct Fighter_x1A88_t {
/* +FB:5 */ u8 xFB_b5 : 1;
/* +FB:6 */ u8 xFB_b6 : 1;
/* +FB:7 */ u8 xFB_b7 : 1;
/* +80 */ u8 xFC[0x44C - 0xFC];
/* +454 */ UNK_T x44C;
/* +454 */ UNK_T x450;
/* +80 */ u8 xFC[0x448 - 0xFC];
/* +448 */ struct {
/* +0 */ HSD_Pad x0;
/* +4 */ u8 x4;
/* +5 */ u8 x5;
/* +6 */ u8 x6;
/* +7 */ u8 x7;
/* +8 */ u8 x8;
/* +9 */ u8 x9;
/* +A */ u8 xA;
/* +B */ u8 xB;
/* +C */ Vec2 offset;
/* +14 */ UNK_T x14;
/* +18 */ float facing_dir;
}* x448;
/* +44C */ UNK_T x44C;
/* +450 */ UNK_T x450;
/* +454 */ uint x454;
/* +458 */ u8 x458[0x554 - 0x458];
/* +554 */ union Fighter_x1A88_x544_t {
Expand All @@ -1032,7 +1046,8 @@ struct Fighter_x1A88_t {
uint x0_u32;
void* x0_p;
} x554;
/* +558 */ u8 x558[0x568 - 0x558];
/* +558 */ float x558;
/* +558 */ u8 x55C[0x568 - 0x55C];
/* +568 */ float x568;
/* +56C */ float x56C;
/* +570 */ UNK_T x570;
Expand Down
2 changes: 1 addition & 1 deletion src/melee/it/it_266F.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ typedef void (*ItCallback)(HSD_GObj*);
/* 2756D0 */ void it_802756D0(HSD_GObj* gobj);
/* 2756E0 */ void it_802756E0(HSD_GObj* gobj);
/* 27574C */ void it_8027574C(HSD_GObj* gobj);
/* 275870 */ void it_80275870(HSD_GObj* gobj);
/* 275870 */ bool it_80275870(HSD_GObj* gobj);
/* 275E98 */ void it_80275E98(HSD_GObj*, SpawnItem*);
/* 2762B0 */ void it_802762B0(Item*);
/* 2762BC */ void it_802762BC(Item*);
Expand Down
4 changes: 2 additions & 2 deletions src/melee/it/it_26B1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,9 +1098,9 @@ void it_8026C16C(HSD_GObj* gobj, bool is_headless)
}

/// Check if item has a hitbox
void it_8026C1B4(HSD_GObj* gobj)
bool it_8026C1B4(HSD_GObj* gobj)
{
it_80275870(gobj);
return it_80275870(gobj);
}

u32 it_8026C1D4(void)
Expand Down
2 changes: 1 addition & 1 deletion src/melee/it/it_26B1.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
/* 26BE84 */ HSD_GObj* it_8026BE84(BobOmbRain* bobOmbRain);
/* 26C100 */ CollData* it_8026C100(Item_GObj* gobj);
/* 26C16C */ void it_8026C16C(Item_GObj* gobj, bool isHeadless);
/* 26C1B4 */ void it_8026C1B4(Item_GObj* gobj);
/* 26C1B4 */ bool it_8026C1B4(Item_GObj* gobj);
/* 26C1D4 */ u32 it_8026C1D4(void);
/* 26C1E8 */ bool it_8026C1E8(Item_GObj* gobj);
/* 26C220 */ void it_8026C220(Item_GObj* gobj, HSD_GObj* arg1);
Expand Down
2 changes: 1 addition & 1 deletion src/melee/it/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ struct Item {
ItemStateDesc* xD0_itemStateDesc;
Item_DynamicBones xD4_dynamicBones[24];
s32 x374_dynamicBonesNum;
CollData x378_itemColl;
/* ip+378 */ CollData x378_itemColl;
s32 ecb_lock;

/// @at{518} @sz{4}
Expand Down
2 changes: 1 addition & 1 deletion src/melee/mp/mpisland.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ mp_UnkStruct0* mpIsland_8005AC14(Vec3* arg0, float arg1)
return NULL;
}

bool mpIsland_8005AC8C(mp_UnkStruct4* arg0)
bool mpIsland_8005AC8C(mp_UnkStruct0* arg0)
{
int temp_cr0_eq;
temp_cr0_eq = mpLib_8004D17C() + 8 + 0x34 * arg0->x28;
Expand Down
2 changes: 1 addition & 1 deletion src/melee/mp/mpisland.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* 05AC14 */ mp_UnkStruct0* mpIsland_8005AC14(Vec3*, float);
/* 05AB54 */ mp_UnkStruct0* mpIsland_8005AB54(int surface_idx);
/* 05AC8C */ bool mpIsland_8005AC8C(mp_UnkStruct4* arg0);
/* 05AC8C */ bool mpIsland_8005AC8C(mp_UnkStruct0* arg0);
/* 05ACE8 */ void mpIsland_8005ACE8(mp_UnkStruct5*, Vec3*, Vec3*);
/* 458E88 */ extern mp_UnkStruct0 mpIsland_80458E88;

Expand Down
9 changes: 2 additions & 7 deletions src/melee/mp/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ struct mp_UnkStruct0 {
/* +24 */ short x24;
/* +26 */ short x26;
/* +28 */ short x28;
/* +2A */ short x2A;
/* +2C */ mp_UnkStruct3* ptr;
};

struct mp_UnkStruct1 {
Expand All @@ -42,13 +44,6 @@ struct mp_UnkStruct3 {
int xC;
};

struct mp_UnkStruct4 {
/* +0 */ u8 x0[0x28];
/* +28 */ short x28;
/* +2A */ short x2A;
/* +2C */ mp_UnkStruct3* ptr;
};

struct mp_UnkStruct5 {
/* +0 */ u8 x0[0x4];
/* +4 */ ushort x4;
Expand Down
6 changes: 4 additions & 2 deletions tools/wiki_tu.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ def write(args):
for unit in data["units"] or []:

def friendly_size(key: str) -> str:
return f"`{humanfriendly.format_number(unit[key] or 0)}`"
return (
f"`{humanfriendly.format_size(unit[key] or 0).replace('bytes', 'B')}`"
)

# Strip "main/" by splitting on "/" and recombining
file = "/".join((unit["name"] or "/").split("/")[1:])
# Link to source file
file = f"[`{file}`](../../tree/master/src/{file}.c)"
file = f"[`{file}`](../blob/master/src/{file}.c)"

matched = f"{friendly_size('matched_code')}"
total = f"{friendly_size('total_code')}"
Expand Down

0 comments on commit a8e27ea

Please sign in to comment.