Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 92 additions & 4 deletions src/melee/ft/ft_0892.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ft/chara/ftFox/ftFx_AppealS.h"
#include "ft/fighter.h"
#include "ft/ftlib.h"
#include "ft/ftparts.h"
#include "ft/inlines.h"
#include "ftCLink/ftCl_Init.h"
#include "ftCommon/ftCo_DownSpot.h"
Expand All @@ -26,7 +27,51 @@

/// #ft_800895E0

/// #ft_80089768
// Local struct with bitfields - reversed order for MWCC big-endian
typedef struct {
s32 x0;
s32 x4;
float x8;
s32 xC;
u8 x10_b7 : 1; // bit 7 (MSB)
u8 x10_b6 : 1;
u8 x10_b5 : 1;
u8 x10_b4 : 1;
u8 x10_b3 : 1;
u8 x10_b2 : 1;
u8 x10_b1 : 1;
u8 x10_b0 : 1; // bit 0 (LSB)
u8 x11_b7 : 1;
u8 x11_b6 : 1;
u8 x11_b5 : 1;
u8 x11_b4 : 1;
u8 x11_b3 : 1;
u8 x11_b2 : 1;
u8 x11_b1 : 1;
u8 x11_b0 : 1;
} UnkStruct89768;

void ft_80089768(Vec2* ptr)
{
UnkStruct89768* s = (UnkStruct89768*)ptr;
s->x0 = 0;
s->x4 = 0;
s->x8 = 1.0f;
s->xC = 6;
s->x10_b7 = 0;
s->x11_b4 = 0;
s->x10_b6 = 0;
s->x10_b5 = 0;
s->x10_b4 = 0;
s->x10_b3 = 0;
s->x10_b2 = 0;
s->x10_b1 = 0;
s->x10_b0 = 0;
s->x11_b7 = 0;
s->x11_b6 = 0;
s->x11_b5 = 0;
s->x11_b3 = 0;
}

/// #ft_80089824

Expand Down Expand Up @@ -67,15 +112,58 @@ bool ft_800898C0(HSD_GObj* gobj)
return false;
}

/// #ft_80089914
s32 ft_80089914(HSD_GObj* gobj, int msid)
{
Fighter* fp = gobj->user_data;

if (msid < ftCo_MS_AttackS3Hi || msid > ftCo_MS_AttackS4LwS) {
return false;
}

if (fp->kind == FTKIND_FOX) {
if ((u32)(msid - ftCo_MS_AttackS3LwS) <= 2) {
return false;
}
}

if (fp->kind == FTKIND_FALCO) {
if ((u32)(msid - ftCo_MS_AttackS3LwS) <= 2) {
return false;
}
}

if (fp->kind == FTKIND_MEWTWO) {
if (msid == ftCo_MS_AttackS3S) {
return false;
}
}

return true;
}
/// #fn_8008998C

/// #ft_80089B08

/// #ft_8008A1B8
void ft_8008A1B8(Fighter_GObj* gobj, int flags)
{
Fighter* fp = GET_FIGHTER(gobj);
fp->x221C_u16_y = flags;
if (!(flags & 0x4)) {
ftParts_8007592C(fp, 0, 0.0f);
}
}

bool ft_8008A1FC(Fighter_GObj* gobj)
{
Fighter* fp = GET_FIGHTER(gobj);

/// #ft_8008A1FC
if ((fp->input.lstick.x * fp->facing_dir < 0.0F) ||
(ABS(fp->input.lstick.x) < p_ftCommonData->x24))
{
return true;
}
return false;
}

static inline bool ft_8008A244_inline(Fighter_GObj* gobj)
{
Expand Down
2 changes: 1 addition & 1 deletion src/melee/ft/ft_0892.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/* 0898A8 */ struct Struct2074* ft_800898A8(Fighter_GObj* gobj);
/* 0898B4 */ ft_800898B4_t* ft_800898B4(Fighter_GObj* gobj);
/* 0898C0 */ bool ft_800898C0(HSD_GObj*);
/* 089914 */ UNK_RET ft_80089914(UNK_PARAMS);
/* 089914 */ s32 ft_80089914(HSD_GObj* gobj, int msid);
/* 08998C */ UNK_RET fn_8008998C(UNK_PARAMS);
/* 089B08 */ void ft_80089B08(Fighter_GObj* gobj);
/* 08A1B8 */ void ft_8008A1B8(Fighter_GObj* gobj, int);
Expand Down
20 changes: 16 additions & 4 deletions src/melee/ft/ft_0D31.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#include "ft/forward.h"

#include "ft/ft_081B.h"
#include "ft/ft_0892.h"
#include "ft/ft_0C88.h"
#include "ft/ftcoll.h"
#include "ft/ftcommon.h"
#include "ft/inlines.h"
#include "ft/types.h"
Expand Down Expand Up @@ -476,8 +478,15 @@ void ftCo_Rebirth_Coll(HSD_GObj* gobj)
}
/// #fn_800D54A4

/// #fn_800D55B4

void fn_800D55B4(Fighter_GObj* gobj)
{
Fighter* fp = gobj->user_data;
HSD_GObj* other_gobj = Player_GetEntityAtIndex(fp->player_id, 0);
Fighter* other_fp = other_gobj->user_data;
if (other_fp->cur_pos.y > fp->cur_pos.y) {
fp->cur_pos.y = other_fp->cur_pos.y;
}
}
/// #ftCo_800D5600

/// #ftCo_RebirthWait_Anim
Expand All @@ -488,6 +497,9 @@ void ftCo_Rebirth_Coll(HSD_GObj* gobj)

/// #ftCo_RebirthWait_Coll

/// #fn_800D5A30

void fn_800D5A30(Fighter_GObj* gobj)
{
ftColl_8007B7A4(gobj, p_ftCommonData->x5D8);
ft_8008A2BC(gobj);
}
/// #ftCo_Rebirth_Cam
2 changes: 2 additions & 0 deletions src/melee/ft/ft_0D31.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
/* 0D5358 */ void ftCo_Rebirth_IASA(Fighter_GObj* gobj);
/* 0D535C */ void ftCo_Rebirth_Phys(Fighter_GObj* gobj);
/* 0D5470 */ void ftCo_Rebirth_Coll(Fighter_GObj* gobj);
/* 0D55B4 */ void fn_800D55B4(Fighter_GObj* gobj);
/* 0D5600 */ UNK_RET ftCo_800D5600(UNK_PARAMS);
/* 0D56EC */ void ftCo_RebirthWait_Anim(Fighter_GObj* gobj);
/* 0D575C */ void ftCo_RebirthWait_IASA(Fighter_GObj* gobj);
/* 0D58F4 */ void ftCo_RebirthWait_Phys(Fighter_GObj* gobj);
/* 0D5A08 */ void ftCo_RebirthWait_Coll(Fighter_GObj* gobj);
/* 0D5A30 */ void fn_800D5A30(Fighter_GObj* gobj);
/* 0D5A6C */ void ftCo_Rebirth_Cam(Fighter_GObj* gobj);

#endif
3 changes: 1 addition & 2 deletions src/melee/ft/ftcoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@
#include "it/types.h"

#include "it/it_26B1.h"
#include "it/itcoll.h"
#include "lb/lb_00B0.h"
#include "lb/lbcollision.h"
#include "lb/types.h"
#include "pl/plbonuslib.h"
#include "pl/plstale.h"

#include "it/itcoll.h"

#include <common_structs.h>
#include <Runtime/runtime.h>
#include <math.h>
Expand Down
2 changes: 1 addition & 1 deletion src/melee/ft/ftcoll.dox
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ UNK_RET ftColl_8007AF60(UNK_PARAMS);
void ftColl_8007AFC8(Fighter_GObj* gobj, int);
void ftColl_8007B064(Fighter_GObj* gobj, enum_t arg1);
void ftColl_8007B128(s8, int);
UNK_RET ftColl_80077464(UNK_PARAMS);
void ftColl_80077464(Item*, HitCapsule*, Fighter*);
/* 07B6A0 */ void ftColl_8007B6A0(Fighter_GObj* gobj);
/* 07B7A4 */ void ftColl_8007B7A4(Fighter_GObj* gobj, int);
void ftColl_80078710(Fighter_GObj* gobj);
Expand Down
2 changes: 1 addition & 1 deletion src/melee/ft/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ struct ftCommonData {
/* +5CC */ float x5CC;
/* +5D0 */ UNK_T x5D0;
/* +5D4 */ UNK_T x5D4;
/* +5D8 */ UNK_T x5D8;
/* +5D8 */ int x5D8;
/* +5DC */ u32 bury_timer_unk1;
/* +5E0 */ u32 bury_timer_unk2;
/* +5E4 */ u32 bury_timer_unk3;
Expand Down