Skip to content

Commit

Permalink
add MewVars and match it_802D3C9C
Browse files Browse the repository at this point in the history
  • Loading branch information
wyatt-avilla committed Mar 5, 2024
1 parent 9e976b5 commit 4ee5064
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
7 changes: 7 additions & 0 deletions src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,11 @@ typedef struct {
HSD_JObj* jobj;
} itTargetVars;

typedef struct MewVars {
u8 x0_filler[4];
f32 x4;
f32 x8;
f32 xC;
} MewVars;

#endif
26 changes: 11 additions & 15 deletions src/melee/it/items/itmew.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,20 @@ bool it_802D3C94(Item_GObj* gobj)
return false;
}

void it_802D3C9C(HSD_GObj* arg0)
void it_802D3C9C(Item_GObj* gobj)
{
void* temp_r30;
void* temp_r31;
Item* ip = GET_ITEM(gobj);
MewVars* attr = ip->xC4_article_data->x4_specialAttributes;

temp_r31 = arg0->user_data;
temp_r30 = M2C_FIELD(M2C_FIELD(temp_r31, void**, 0xC4), void**, 4);
Item_80268E5C(arg0, 2, ITEM_ANIM_UPDATE);
M2C_FIELD(temp_r31, s32*, 0xD28) = M2C_ERROR(
/* unknown instruction: subi $r0, $r3, %l(efLib_PauseAll) */);
M2C_FIELD(temp_r31, s32*, 0xD2C) = M2C_ERROR(
/* unknown instruction: subi $r0, $r3, %l(efLib_ResumeAll) */);
Item_80268E5C(gobj, 2, ITEM_ANIM_UPDATE);
ip->entered_hitlag = efLib_PauseAll;
ip->exited_hitlag = efLib_ResumeAll;
if (HSD_Randi(2) != 0) {
M2C_FIELD(temp_r31, f32*, 0x40) = M2C_FIELD(temp_r30, f32*, 4);
ip->x40_vel.x = attr->x4;
} else {
M2C_FIELD(temp_r31, f32*, 0x40) = -M2C_FIELD(temp_r30, f32*, 4);
ip->x40_vel.x = -attr->x4;
}
M2C_FIELD(temp_r31, f32*, 0x44) = M2C_FIELD(temp_r30, f32*, 8);
ip->x40_vel.y = attr->x8;
}

bool it_802D3D28(Item_GObj* gobj)
Expand All @@ -107,8 +103,8 @@ bool it_802D3D28(Item_GObj* gobj)
void it_802D3D6C(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
void* attr = ip->xC4_article_data->x4_specialAttributes;
ip->x40_vel.y += M2C_FIELD(attr, f32*, 0xC);
MewVars* attr = ip->xC4_article_data->x4_specialAttributes;
ip->x40_vel.y += attr->xC;
}

bool it_802D3D8C(Item_GObj* gobj)
Expand Down

0 comments on commit 4ee5064

Please sign in to comment.