From a8e27eabeef02acc515f88e5e0f293ccfa9ccf92 Mon Sep 17 00:00:00 2001 From: Robin Avery Date: Sun, 11 Aug 2024 17:31:15 -0400 Subject: [PATCH] Match 14.73% of `ftCo_0A01` (81.08 KB) (#1424) --- src/melee/ft/chara/ftCommon/ftCo_0A01.c | 451 +++++++++++++++++++++--- src/melee/ft/chara/ftCommon/ftCo_0A01.h | 24 +- src/melee/ft/types.h | 27 +- src/melee/it/it_266F.h | 2 +- src/melee/it/it_26B1.c | 4 +- src/melee/it/it_26B1.h | 2 +- src/melee/it/types.h | 2 +- src/melee/mp/mpisland.c | 2 +- src/melee/mp/mpisland.h | 2 +- src/melee/mp/types.h | 9 +- tools/wiki_tu.py | 6 +- 11 files changed, 449 insertions(+), 82 deletions(-) diff --git a/src/melee/ft/chara/ftCommon/ftCo_0A01.c b/src/melee/ft/chara/ftCommon/ftCo_0A01.c index cc745182b8..62ac05b05b 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_0A01.c +++ b/src/melee/ft/chara/ftCommon/ftCo_0A01.c @@ -3,6 +3,7 @@ #include "ftCommon/forward.h" #include "ftDonkey/forward.h" #include "ftKoopa/forward.h" +#include "ftPopo/forward.h" #include "lb/forward.h" #include @@ -11,6 +12,7 @@ #include "ftCo_0B3E.h" #include "ftCo_ItemGet.h" +#include "ft/chara/ftPopo/ftPp_1211.h" #include "ft/fighter.h" #include "ft/ft_0877.h" #include "ft/ftlib.h" @@ -23,7 +25,9 @@ #include "gr/ground.h" #include "gr/grvenom.h" #include "gr/stage.h" +#include "it/inlines.h" #include "it/item.h" +#include "it/types.h" #include "lb/lbcollision.h" #include "mp/mpisland.h" #include "mp/mplib.h" @@ -46,7 +50,36 @@ extern UNK_T* ftCo_803C6594; /// #ftCo_800A0148 -/// #ftCo_800A0384 +void ftCo_800A0384(ftCo_Fighter* fp) +{ + if (fp->cur_pos.y + fp->x1A88.x558 > Stage_GetBlastZoneTopOffset()) { + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B463C(fp, 0x7F); + return; + } + if (ftCo_800A1CA8(fp)) { + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B46B8(fp, 0x8E, 0xA); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 7); + ftCo_800B46B8(fp, 0x8E, 0xA); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 0x7F); + return; + } + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B46B8(fp, 0x91, 0x7F); + ftCo_800B463C(fp, 7); + ftCo_800B46B8(fp, 0x8E, 0xA); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 0x7F); +} void ftCo_800A0508(ftCo_Fighter* fp) { @@ -69,7 +102,38 @@ void ftCo_800A0508(ftCo_Fighter* fp) ftCo_800B463C(fp, 0x7F); } -/// #ftCo_800A05F4 +void ftCo_800A05F4(ftCo_Fighter* fp) +{ + if (fp->cur_pos.y + fp->x1A88.x558 > Stage_GetBlastZoneTopOffset()) { + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B463C(fp, 0x7F); + return; + } + if (ftCo_800A1CA8(fp)) { + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B46B8(fp, 0x8E, 0xA); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 7); + ftCo_800B46B8(fp, 0x8E, 0xA); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 0x7F); + return; + } + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B46B8(fp, 0x94, 0x7F); + ftCo_800B463C(fp, 7); + ftCo_800B46B8(fp, 0x8E, 0xA); + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 0x7F); +} void ftCo_800A0798(ftCo_Fighter* fp) { @@ -100,7 +164,42 @@ void ftCo_800A0798(ftCo_Fighter* fp) /// #ftCo_800A08F0 -/// #ftCo_800A0AF4 +void ftCo_800A0AF4(ftCo_Fighter* fp) +{ + float rand = HSD_Randf(); + if (rand < 0.6f) { + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0x50); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B463C(fp, 0x7F); + return; + } + if (rand < 0.8f) { + ftCo_800B463C(fp, 0xA); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 9); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 0xA); + ftCo_800B463C(fp, 0x7F); + return; + } + if (rand < 0.9f) { + ftCo_800B463C(fp, 2); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 1); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 2); + ftCo_800B463C(fp, 0x7F); + return; + } + ftCo_800B463C(fp, 8); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 7); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B463C(fp, 8); + ftCo_800B463C(fp, 0x7F); +} void ftCo_800A0C8C(ftCo_Fighter* fp) { @@ -482,9 +581,96 @@ bool ftCo_800A21FC(ftCo_Fighter* fp) /// #ftCo_800A229C -/// #ftCo_800A2718 +static inline bool inlineL0(mp_UnkStruct0* arg0) +{ + Item_GObj* cur; + s32 temp_cr0_eq; + s32 var_r0; + Item* cur_ip; + cur = HSD_GObj_Entities->items; + goto loop_8; +block_3: + cur_ip = GET_ITEM(cur); + if (it_8026C1B4(cur) == 0) { + goto block_7; + } + if (!ftCo_800A5944(cur_ip)) { + goto block_7; + } + if (arg0 != mpIsland_8005AB54(cur_ip->x378_itemColl.floor.index)) { + goto block_7; + } + return 1; +block_7: + cur = cur->next; +loop_8: + if (cur != NULL) { + goto block_3; + } + if (stage_info.internal_stage_id == STORY) { + goto block_15; + } + if (stage_info.internal_stage_id >= 0xA) { + goto block_13; + } + if (stage_info.internal_stage_id == ZEBES) { + goto block_16; + } + goto block_37; +block_13: + temp_cr0_eq = stage_info.internal_stage_id == ONETT; + if (temp_cr0_eq != 0) { + goto block_21; + goto block_37; + block_15: + return mpIsland_8005AC8C(arg0); + block_16: + if (ftCo_800A1F98(0x5A, arg0->x18) != 0) { + return 1; + } + if (ftCo_800A1F98(0x5A, arg0->xC) != 0) { + return 1; + } + return 0; + } +block_21: + if (temp_cr0_eq == 0) { + return 0; + } + if (arg0->x18 <= 5.0 || Ground_801C5794() == 0) { + return 0; + } + return 1; +block_37: + return 0; +} + +static inline bool inlineL1(mp_UnkStruct0* arg0) +{ + if (stage_info.internal_stage_id != ONETT) { + return false; + } + if (!(arg0->xC <= 5.0)) { + if (Ground_801C5794() != 0) { + return true; + } + } + return false; +} + +bool ftCo_800A2718(mp_UnkStruct0* arg0) +{ + PAD_STACK(4 * 4); + if (arg0 == NULL) { + return 0; + } + if (!inlineL0(arg0) && !inlineL1(arg0)) { + return 0; + } + return 1; +} -bool ftCo_800A28D0(Fighter* fp, f32 arg1) +bool ftCo_800A28D0(Fighter* fp, float arg1) { if (fp->ground_or_air == GA_Air) { return false; @@ -773,15 +959,7 @@ void ftCo_800A49B4(ftCo_Fighter* fp) M2C_FIELD((fp + 0x1A88), float*, 0x5C) = var_f4; } -/// #ftCo_800A4A40 - -/// #ftCo_800A4BEC - -/// #ftCo_800A4E8C - -/// #ftCo_800A50D4 - -static inline bool inlineF0(ftCo_Fighter* fp, ftCo_Fighter* fp1) +static inline bool inlineD0(ftCo_Fighter* fp, ftCo_Fighter* fp1) { float y, x; struct Fighter_x1A88_t* data = &fp->x1A88; @@ -798,7 +976,7 @@ static inline bool inlineF0(ftCo_Fighter* fp, ftCo_Fighter* fp1) return false; } -static inline bool inlineF1(ftCo_Fighter* fp) +static inline bool inlineD1(ftCo_Fighter* fp) { Fighter_GObj* gobj = fp->gobj; if (fp->x221F_b3 || fp->x2224_b2 || ftCo_800A0F00(gobj) || @@ -810,6 +988,50 @@ static inline bool inlineF1(ftCo_Fighter* fp) } } +ftCo_Fighter* ftCo_800A4A40(ftCo_Fighter* fp) +{ + if (fp == NULL) { + return NULL; + } + { + ftCo_GObj* cur; + ftCo_Fighter* cur_fp = NULL; + float var_f31; + PAD_STACK(6 * 4); + for (cur = HSD_GObj_Entities->fighters; cur != NULL; cur = cur->next) { + if (fp->gobj != cur) { + ftCo_Fighter* fp1 = GET_FIGHTER(cur); + if (!inlineD0(fp, fp1)) { + if (!inlineD1(fp1)) { + if (cur_fp == NULL) { + float x = fp->cur_pos.x - fp1->cur_pos.x, + y = fp->cur_pos.y - fp1->cur_pos.y; + cur_fp = fp1; + var_f31 = sqrtf__Ff(SQ(x) + SQ(y)); + } else { + ftCo_Fighter* fp1 = cur->user_data; + float x = fp->cur_pos.x - fp1->cur_pos.x, + y = fp->cur_pos.y - fp1->cur_pos.y, + temp_f1_3 = sqrtf__Ff(SQ(x) + SQ(y)); + if (var_f31 > temp_f1_3) { + var_f31 = temp_f1_3; + cur_fp = fp1; + } + } + } + } + } + } + return cur_fp; + } +} + +/// #ftCo_800A4BEC + +/// #ftCo_800A4E8C + +/// #ftCo_800A50D4 + ftCo_Fighter* ftCo_800A5294(ftCo_Fighter* fp, int player_id) { PAD_STACK(2 * 4); @@ -822,8 +1044,8 @@ ftCo_Fighter* ftCo_800A5294(ftCo_Fighter* fp, int player_id) for (cur = HSD_GObj_Entities->fighters; cur != NULL; cur = cur->next) { if (fp->gobj != cur) { cur_fp = GET_FIGHTER(cur); - if (!inlineF0(fp, cur_fp)) { - if (!inlineF1(cur_fp) && cur_fp->player_id == player_id) { + if (!inlineD0(fp, cur_fp)) { + if (!inlineD1(cur_fp) && cur_fp->player_id == player_id) { return cur_fp; } } @@ -871,15 +1093,15 @@ bool ftCo_800A5908(ftCo_Fighter* fp) return false; } -bool ftCo_800A5944(ftCo_Fighter* fp) +bool ftCo_800A5944(Item* ip) { - if (fp->motion_id == ftCo_MS_DeadUpFall) { + if (ip->kind == It_Kind_BombHei) { return true; } - if (fp->motion_id == ftCo_MS_Wait) { + if (ip->kind == It_Kind_G_Shell) { return true; } - if (fp->motion_id == ftCo_MS_WalkSlow) { + if (ip->kind == It_Kind_R_Shell) { return true; } return false; @@ -1032,7 +1254,42 @@ void ftCo_800A8DE4(Fighter* fp) /// #ftCo_800A92CC -/// #ftCo_800A949C +static inline float inlineE0(ftCo_Fighter* fp) +{ + struct Fighter_x1A88_t* data = &fp->x1A88; + if ((data->x54.x - fp->cur_pos.x) < 0.0f) { + return -(data->x54.x - fp->cur_pos.x); + } else { + return data->x54.x - fp->cur_pos.x; + } +} + +void ftCo_800A949C(ftCo_Fighter* fp) +{ + if (inlineE0(fp) > 30.0) { + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B46B8(fp, 0x81, 0x7F); + ftCo_800B46B8(fp, 0x90, 0x7F); + ftCo_800B46B8(fp, 0x88, 0x28); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B463C(fp, 4); + ftCo_800B46B8(fp, 0x8E, 1); + } else { + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B46B8(fp, 0x8E, 1); + ftCo_800B46B8(fp, 0x81, 0x7F); + ftCo_800B46B8(fp, 0x80, 0); + ftCo_800B46B8(fp, 0x88, 0x28); + ftCo_800B46B8(fp, 0x81, 0); + ftCo_800B463C(fp, 4); + ftCo_800B46B8(fp, 0x8E, 1); + } + ftCo_800B463C(fp, 0x7F); +} void ftCo_800A963C(ftCo_Fighter* fp) { @@ -1106,9 +1363,11 @@ void ftCo_800AA320(ftCo_Fighter* fp, int* arg1, int* arg2) /// #ftCo_800AA844 -static inline bool inlineD0(ftCo_Fighter* fp) +static inline bool inlineF0(ftCo_Fighter* fp) { - if (fp->motion_id == 0xF5 || fp->motion_id == 0xF6) { + if (fp->motion_id == ftCo_MS_Ottotto || + fp->motion_id == ftCo_MS_OttottoWait) + { return true; } return false; @@ -1117,7 +1376,7 @@ static inline bool inlineD0(ftCo_Fighter* fp) void ftCo_800AABC8(ftCo_Fighter* fp) { PAD_STACK(2 * 4); - if (inlineD0(fp)) { + if (inlineF0(fp)) { ftCo_800B46B8(fp, 0x81, 0); ftCo_800B46B8(fp, 0x80, 0); ftCo_800B46B8(fp, 0x8E, 1); @@ -1178,7 +1437,7 @@ void ftCo_800ABA34(ftCo_Fighter* fp) /// #ftCo_800ABBA8 -static inline bool inlineE0(ftCo_Fighter* fp) +static inline bool inlineG0(ftCo_Fighter* fp) { enum_t temp_r0 = fp->motion_id; bool ret; @@ -1198,7 +1457,7 @@ void ftCo_800AC30C(Fighter* fp) { struct Fighter_x1A88_t* data = &fp->x1A88; PAD_STACK(4 * 4); - if (!inlineE0(fp)) { + if (!inlineG0(fp)) { data->x18 = data->x1C; ftCo_800B463C(fp, 0x7F); return; @@ -1327,15 +1586,20 @@ void ftCo_800AD42C(ftCo_Fighter* fp) /// #ftCo_800B04DC -/// #ftCo_800B0760 - -/// #ftCo_800B0918 - -/// #ftCo_800B0AF4 - -/// #ftCo_800B0CA8 +static inline void inlineI0(ftCo_Fighter* fp, struct Fighter_x1A88_t* data) +{ + data->xF8_b0 = false; + data->xF9_b2 = true; + data->xF9_b4 = true; + data->xF9_b3 = false; + data->xF9_b5 = false; + data->xF9_b6 = false; + data->xF9_b7 = false; + data->xF9_b1 = false; + fp->x1A88.x44 = ftCo_800A4BEC(fp); +} -static inline bool inlineG0(struct Fighter_x1A88_t* data) +static inline bool inlineI1(struct Fighter_x1A88_t* data) { if (data->x18 != data->x20 && data->x18 != data->x1C) { data->x60 = 0; @@ -1348,15 +1612,110 @@ static inline bool inlineG0(struct Fighter_x1A88_t* data) } } -static inline bool inlineG1(ftCo_Fighter* fp0) +static inline bool inlineI2(Item_GObj* gobj) { - if (fp0->motion_id >= 361 && fp0->motion_id <= 366) { + int temp_r0 = GET_ITEM(gobj)->kind; + switch (temp_r0) { /* irregular */ + case It_Kind_Heart: + case It_Kind_Tomato: + case It_Kind_Foods: return 1; - } else { + default: return 0; } } +static inline void inlineI3(ftCo_Fighter* fp, struct Fighter_x1A88_t* data) +{ + struct Fighter_x1A88_t* fp_data = &fp->x1A88; + if (inlineI1(fp_data) != 0) { + if (data->xFB_b0) { + ftCo_800A8DE4(fp); + } else { + ftCo_800A7AAC(fp); + } + } +} + +void ftCo_800B0760(ftCo_Fighter* fp) +{ + struct Fighter_x1A88_t* data = &fp->x1A88; + PAD_STACK(2 * 4); + inlineI0(fp, data); + if (fp->item_gobj != NULL) { + if (!inlineI2(fp->item_gobj)) { + data->x4C = NULL; + } + } else { + if (fp->x2168 != 0) { + data->x4C = NULL; + } else { + data->x4C = ftCo_800A5F4C(fp, 35); + } + } + fp->x1A88.x50 = ftCo_800A648C(fp); + inlineI3(fp, data); + ftCo_800ADE48(fp); +} + +/// #ftCo_800B0918 + +static inline bool inlineJ0(ftCo_Fighter* fp, ftCo_Fighter* nana_fp) +{ + if (fp->motion_id == ftCo_MS_FireFlowerShoot || + fp->motion_id == ftCo_MS_FireFlowerShootAir) + { + return false; + } + if (nana_fp->motion_id == ftPp_MS_SpecialLw && + fp->motion_id < ftCo_MS_Count) + { + return true; + } else { + return false; + } +} + +void ftCo_800B0AF4(ftCo_Fighter* fp) +{ + struct Fighter_x1A88_t* data = &fp->x1A88; + Fighter* nana_fp = ftCo_800A589C(fp); + if (nana_fp != NULL && data->xFA_b7) { + if (inlineJ0(fp, nana_fp)) { + fp->facing_dir = -nana_fp->facing_dir; + ftPp_SpecialLw_Enter(fp->gobj); + return; + } + data->x4 = data->x448->x6; + data->x5 = data->x448->x7; + data->x6 = data->x448->x8; + data->x7 = data->x448->x9; + data->x0 = data->x448->x0; + data->x8 = data->x448->x4; + data->x9 = data->x448->x5; + if (fp->x2225_b3) { + fp->cur_pos.x = 0.95 * fp->cur_pos.x + 0.05 * data->x448->offset.x; + fp->cur_pos.y = 0.95 * fp->cur_pos.y + 0.05 * data->x448->offset.y; + if (fp->motion_id != ftPp_MS_SpecialLw && + fp->motion_id != ftPp_MS_SpecialAirLw) + { + fp->facing_dir = data->x448->facing_dir; + } + } + } +} + +/// #ftCo_800B0CA8 + +static inline bool inlineK0(ftCo_Fighter* fp0) +{ + if (fp0->motion_id >= 361 && fp0->motion_id <= 366) { + return true; + } else { + return false; + } +} + bool ftCo_800B0E98(Fighter* fp0, Fighter* fp1) { s32 temp_r0; @@ -1373,8 +1732,8 @@ bool ftCo_800B0E98(Fighter* fp0, Fighter* fp1) } if (!data->xFB_b0) { struct Fighter_x1A88_t* data = &fp0->x1A88; - if (inlineG1(fp0)) { - if (!inlineG0(data) && fp0->motion_id != ftCo_MS_Wait) { + if (inlineK0(fp0)) { + if (!inlineI1(data) && fp0->motion_id != ftCo_MS_Wait) { return false; } { @@ -1412,16 +1771,8 @@ void ftCo_800B1DA0(Fighter* fp) { struct Fighter_x1A88_t* data = &fp->x1A88; PAD_STACK(6 * 4); - data->xF8_b0 = false; - data->xF9_b2 = true; - data->xF9_b4 = true; - data->xF9_b3 = false; - data->xF9_b5 = false; - data->xF9_b6 = false; - data->xF9_b7 = false; - data->xF9_b1 = false; - fp->x1A88.x44 = ftCo_800A4BEC(fp); - if (inlineG0(data) && data->x7C % 60 * 5 == 0 && HSD_Randf() < 0.5) { + inlineI0(fp, data); + if (inlineI1(data) && data->x7C % 60 * 5 == 0 && HSD_Randf() < 0.5) { ftCo_800A8940(fp); } ftCo_800ADE48(fp); diff --git a/src/melee/ft/chara/ftCommon/ftCo_0A01.h b/src/melee/ft/chara/ftCommon/ftCo_0A01.h index 2f33ea6bcd..25bb9c00ac 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_0A01.h +++ b/src/melee/ft/chara/ftCommon/ftCo_0A01.h @@ -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 #include @@ -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); @@ -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); @@ -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); @@ -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); @@ -115,22 +118,23 @@ // /* 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); @@ -138,7 +142,7 @@ /* 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); diff --git a/src/melee/ft/types.h b/src/melee/ft/types.h index c3a5fb770e..86059e350a 100644 --- a/src/melee/ft/types.h +++ b/src/melee/ft/types.h @@ -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; @@ -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 { @@ -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; diff --git a/src/melee/it/it_266F.h b/src/melee/it/it_266F.h index 2ad4e6293c..aa38003f02 100644 --- a/src/melee/it/it_266F.h +++ b/src/melee/it/it_266F.h @@ -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*); diff --git a/src/melee/it/it_26B1.c b/src/melee/it/it_26B1.c index 16453f1115..6d4ddc1b9c 100644 --- a/src/melee/it/it_26B1.c +++ b/src/melee/it/it_26B1.c @@ -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) diff --git a/src/melee/it/it_26B1.h b/src/melee/it/it_26B1.h index 4ace5f1e46..a16a276bb9 100644 --- a/src/melee/it/it_26B1.h +++ b/src/melee/it/it_26B1.h @@ -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); diff --git a/src/melee/it/types.h b/src/melee/it/types.h index b31c3d7bc2..07add96b0b 100644 --- a/src/melee/it/types.h +++ b/src/melee/it/types.h @@ -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} diff --git a/src/melee/mp/mpisland.c b/src/melee/mp/mpisland.c index b2868b3440..989c5d0417 100644 --- a/src/melee/mp/mpisland.c +++ b/src/melee/mp/mpisland.c @@ -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; diff --git a/src/melee/mp/mpisland.h b/src/melee/mp/mpisland.h index 0ef0f7089b..04c420a209 100644 --- a/src/melee/mp/mpisland.h +++ b/src/melee/mp/mpisland.h @@ -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; diff --git a/src/melee/mp/types.h b/src/melee/mp/types.h index 301a471137..8b017a0148 100644 --- a/src/melee/mp/types.h +++ b/src/melee/mp/types.h @@ -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 { @@ -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; diff --git a/tools/wiki_tu.py b/tools/wiki_tu.py index 529c7d6d65..dadc2bf9bf 100755 --- a/tools/wiki_tu.py +++ b/tools/wiki_tu.py @@ -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')}"