Skip to content

Commit

Permalink
match 70% of it_802CDF28. needs -4 stack
Browse files Browse the repository at this point in the history
  • Loading branch information
wyatt-avilla committed Mar 27, 2024
1 parent 6037f04 commit 79801ba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
4 changes: 3 additions & 1 deletion src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ typedef struct CoinVars {
typedef struct HassamVars {
f32 x0;
f32 x4;
u8 padding[0x5C - 0x4];
f32 x8;
f32 xC;
u8 padding[0x5C - 0xC];
f32 x5C;
f32 x60;
f32 x64;
Expand Down
47 changes: 21 additions & 26 deletions src/melee/it/items/ithassam.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,40 +166,35 @@ Item_GObj* it_802CDE1C(Vec3* arg0, Item_GObj* arg1)
return var_r28;
}

void it_802CDF28(void* arg0)
void it_802CDF28(Item_GObj* gobj)
{
Vec3 sp1C;
Vec3 sp10;
Item_GObj* var_r3;
f32 temp_f1;
void* temp_r30;
void* temp_r31;
void* temp_r5;

temp_r31 = M2C_FIELD(arg0, void**, 0x2C);
temp_r5 = M2C_FIELD(temp_r31, void**, 0xC4);
temp_r30 = M2C_FIELD(temp_r5, void**, 4);
// var_r3 =
// it_802CDE1C(temp_r31 + 0x4C, M2C_FIELD(temp_r31, Item_GObj**,
// 0x518));
var_r3 = NULL;

Item* ip = GET_ITEM(gobj);
Article* ap = ip->xC4_article_data;
HassamVars* attr = ap->x4_specialAttributes;

var_r3 = it_802CDE1C(&ip->pos, ip->owner);
if (var_r3 == NULL) {
var_r3 = M2C_FIELD(temp_r31, Item_GObj**, 0x518);
var_r3 = ip->owner;
}
ftLib_800866DC(var_r3, &sp1C);
sp1C.y += M2C_FIELD(temp_r30, f32*, 8);
// lbVector_Diff(&sp1C, temp_r31 + 0x4C, &sp10);
M2C_FIELD(temp_r31, f32*, 0xE34) = M2C_FIELD(temp_r30, f32*, 4);
M2C_FIELD(temp_r31, f32*, 0xE38) = it_804DD3E4;
M2C_FIELD(temp_r31, f32*, 0xE3C) = it_804DD3E4;
// lbVector_Rotate(temp_r31 + 0xE34, 4, atan2f(sp10.y, (sp10.x)));
temp_f1 = M2C_FIELD(temp_r31, f32*, 0xE38);
M2C_FIELD(temp_r31, f32*, 0xE38) =
temp_f1 + M2C_FIELD(temp_r30, f32*, 0xC);
M2C_FIELD(temp_r31, f32*, 0x40) = M2C_FIELD(temp_r31, f32*, 0xE34);
M2C_FIELD(temp_r31, f32*, 0x44) = M2C_FIELD(temp_r31, f32*, 0xE38);
M2C_FIELD(temp_r31, f32*, 0x48) = M2C_FIELD(temp_r31, f32*, 0xE3C);
it_80272980(arg0, temp_f1);
sp1C.y += attr->x8;
lbVector_Diff(&sp1C, &ip->pos, &sp10);
ip->xDD4_itemVar.hassam.x5C = attr->x4;
ip->xDD4_itemVar.hassam.x60 = 0.0F;
ip->xDD4_itemVar.hassam.x64 = 0.0F;
lbVector_Rotate((Vec3*) &ip->xDD4_itemVar.hassam.x5C, 4,
atan2f(sp10.y, sp10.x));
temp_f1 = ip->xDD4_itemVar.hassam.x60;
ip->xDD4_itemVar.hassam.x60 = temp_f1 + attr->xC;
ip->x40_vel.x = ip->xDD4_itemVar.hassam.x5C;
ip->x40_vel.y = ip->xDD4_itemVar.hassam.x60;
ip->x40_vel.z = ip->xDD4_itemVar.hassam.x64;
it_80272980(gobj, temp_f1);
}

void it_802CE008(Item_GObj* gobj)
Expand Down

0 comments on commit 79801ba

Please sign in to comment.