Skip to content

Commit

Permalink
lgun variable documentation (#1455)
Browse files Browse the repository at this point in the history
Co-authored-by: Robin Avery <[email protected]>
  • Loading branch information
AaronB-Hub and ribbanya authored Sep 22, 2024
1 parent 73375ea commit 8b25a8c
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 141 deletions.
28 changes: 14 additions & 14 deletions config/GALE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14034,31 +14034,31 @@ it_8028E738 = .text:0x8028E738; // type:function size:0x3C scope:global
it_8028E774 = .text:0x8028E774; // type:function size:0x28 scope:global
it_8028E79C = .text:0x8028E79C; // type:function size:0x3C scope:global
it_8028E7D8 = .text:0x8028E7D8; // type:function size:0x50 scope:global
it_8028E828 = .text:0x8028E828; // type:function size:0x8 scope:local
it_8028E830 = .text:0x8028E830; // type:function size:0x4 scope:local
it_8028E834 = .text:0x8028E834; // type:function size:0x2C scope:local
motion0_Anim = .text:0x8028E828; // type:function size:0x8 scope:local
motion0_Phys = .text:0x8028E830; // type:function size:0x4 scope:local
motion0_Coll = .text:0x8028E834; // type:function size:0x2C scope:local
it_8028E860 = .text:0x8028E860; // type:function size:0x28 scope:local
it_8028E888 = .text:0x8028E888; // type:function size:0x8 scope:local
it_8028E890 = .text:0x8028E890; // type:function size:0x30 scope:local
it_8028E8C0 = .text:0x8028E8C0; // type:function size:0x44 scope:local
motion1_Anim = .text:0x8028E888; // type:function size:0x8 scope:local
motion1_Phys = .text:0x8028E890; // type:function size:0x30 scope:local
motion1_Coll = .text:0x8028E8C0; // type:function size:0x44 scope:local
it_8028E904 = .text:0x8028E904; // type:function size:0x28 scope:global
it_8028E92C = .text:0x8028E92C; // type:function size:0x8 scope:local
it_8028E934 = .text:0x8028E934; // type:function size:0x4 scope:local
motion2_Anim = .text:0x8028E92C; // type:function size:0x8 scope:local
motion2_Phys = .text:0x8028E934; // type:function size:0x4 scope:local
it_8028E938 = .text:0x8028E938; // type:function size:0x34 scope:global
it_8028E96C = .text:0x8028E96C; // type:function size:0x48 scope:local
it_8028E9B4 = .text:0x8028E9B4; // type:function size:0x4 scope:local
motion3_Anim = .text:0x8028E96C; // type:function size:0x48 scope:local
motion3_Phys = .text:0x8028E9B4; // type:function size:0x4 scope:local
it_8028E9B8 = .text:0x8028E9B8; // type:function size:0x28 scope:global
it_8028E9E0 = .text:0x8028E9E0; // type:function size:0x28 scope:global
it_8028EA08 = .text:0x8028EA08; // type:function size:0x4C scope:local
motion4_Phys = .text:0x8028EA08; // type:function size:0x4C scope:local
it_8028EA54 = .text:0x8028EA54; // type:function size:0x24 scope:global
it_8028EA78 = .text:0x8028EA78; // type:function size:0x24 scope:global
it_8028EA9C = .text:0x8028EA9C; // type:function size:0x24 scope:global
it_8028EAC0 = .text:0x8028EAC0; // type:function size:0x20 scope:global
it_8028EAE0 = .text:0x8028EAE0; // type:function size:0x20 scope:global
it_8028EB00 = .text:0x8028EB00; // type:function size:0x28 scope:global
it_8028EB28 = .text:0x8028EB28; // type:function size:0x8 scope:local
it_8028EB30 = .text:0x8028EB30; // type:function size:0x4 scope:local
it_8028EB34 = .text:0x8028EB34; // type:function size:0x34 scope:local
motion5_Anim = .text:0x8028EB28; // type:function size:0x8 scope:local
motion5_Phys = .text:0x8028EB30; // type:function size:0x4 scope:local
motion5_Coll = .text:0x8028EB34; // type:function size:0x34 scope:local
it_8028EB68 = .text:0x8028EB68; // type:function size:0x20 scope:global
it_8028EB88 = .text:0x8028EB88; // type:function size:0x110 scope:global
it_8028EC98 = .text:0x8028EC98; // type:function size:0x48 scope:global
Expand Down
43 changes: 20 additions & 23 deletions src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,45 +122,42 @@ typedef struct FoodVars {

typedef struct ItLGunAttr {
int x0;
float x4;
float x8;
float xC;
} ItLGunAttr; // Not sure if this struct size is correct or type of vars
Vec3 pos;
} ItLGunAttr;

typedef struct ItLGunVars {
int x0;
int timer;
} ItLGunVars;

typedef struct ItLGunBeamAttr {
float x0;
float x4;
float x8;
float xC;
float x10;
} ItLGunBeamAttr; // Not sure if this struct size is correct or type of vars
float x0; // lifetime
float x4; // related to position calcs for var xDFC
float x8; // related to position calcs for var xDFC
float xC; // related to position calcs for var xDF8
float x10; // related to position calcs for var xDF8
} ItLGunBeamAttr;

typedef struct ItLGunBeamVars {
/* x0 */ Vec3 xDD4; //
/* xC */ Vec3 xDE0; //
/* x18 */ Vec3 xDEC; //
/* x24 */ f32 xDF8; //
/* x28 */ f32 xDFC; //
/* x2C */ f32 xE00; //
/* x30 */ f32 xE04; //
/* +0 ip+DD4 */ Vec3 position0;
/* +C ip+DE0 */ Vec3 position1;
/* +18 ip+DEC */ Vec3 position2;
/* +24 ip+DF8 */ f32 angle0;
/* +28 ip+DFC */ f32 angle1;
/* +2C ip+E00 */ f32 lifetime;
/* +30 ip+E04 */ f32 xE04;
} ItLGunBeamVars;

typedef struct ItLGunRayAttr {
float speed;
float lifetime;
float x8;
float xC;
/* +0 */ float speed;
/* +4 */ float lifetime;
/* +8 */ float max_scale;
} ItLGunRayAttr;

typedef struct ItLGunRayVars {
/* ip+DD4 */ float scale;
/* ip+DD8 */ float angle;
/* ip+DDC */ float speed;
/* ip+DE0 */ Vec3 xC;
/* ip+DE0 */ Vec3 pos;
} ItLGunRayVars;

/// Eggs spawned on Yoshi stages / by Chansey
Expand Down
2 changes: 1 addition & 1 deletion src/melee/it/it_26B1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ bool it_8026C1B4(HSD_GObj* gobj)
u32 it_8026C1D4(void)
{
ItLGunVars* lgun = it_804D6D24[It_Kind_L_Gun]->x4_specialAttributes;
return lgun->x0;
return lgun->timer;
}

/// Check if item has grabbed a GObj?
Expand Down
82 changes: 41 additions & 41 deletions src/melee/it/items/itlgun.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,46 @@
#include <melee/it/item.h>

/* 28E7D8 */ static void it_8028E7D8(Item_GObj*);
/* 28E828 */ static bool it_8028E828(Item_GObj*);
/* 28E830 */ static void it_8028E830(Item_GObj*);
/* 28E834 */ static bool it_8028E834(Item_GObj*);
/* 28E828 */ static bool motion0_Anim(Item_GObj*);
/* 28E830 */ static void motion0_Phys(Item_GObj*);
/* 28E834 */ static bool motion0_Coll(Item_GObj*);
/* 28E860 */ static void it_8028E860(Item_GObj*);
/* 28E888 */ static bool it_8028E888(Item_GObj*);
/* 28E890 */ static void it_8028E890(Item_GObj*);
/* 28E8C0 */ static bool it_8028E8C0(Item_GObj*);
/* 28E92C */ static bool it_8028E92C(Item_GObj*);
/* 28E934 */ static void it_8028E934(Item_GObj*);
/* 28E96C */ static bool it_8028E96C(Item_GObj*);
/* 28E9B4 */ static void it_8028E9B4(Item_GObj*);
/* 28EA08 */ static void it_8028EA08(Item_GObj*);
/* 28EB28 */ static bool it_8028EB28(Item_GObj*);
/* 28EB30 */ static void it_8028EB30(Item_GObj*);
/* 28EB34 */ static bool it_8028EB34(Item_GObj*);
/* 28E888 */ static bool motion1_Anim(Item_GObj*);
/* 28E890 */ static void motion1_Phys(Item_GObj*);
/* 28E8C0 */ static bool motion1_Coll(Item_GObj*);
/* 28E92C */ static bool motion2_Anim(Item_GObj*);
/* 28E934 */ static void motion2_Phys(Item_GObj*);
/* 28E96C */ static bool motion3_Anim(Item_GObj*);
/* 28E9B4 */ static void motion3_Phys(Item_GObj*);
/* 28EA08 */ static void motion4_Phys(Item_GObj*);
/* 28EB28 */ static bool motion5_Anim(Item_GObj*);
/* 28EB30 */ static void motion5_Phys(Item_GObj*);
/* 28EB34 */ static bool motion5_Coll(Item_GObj*);

ItemStateTable it_803F5CC8[] = {
{ -1, it_8028E828, it_8028E830, it_8028E834 },
{ -1, it_8028E888, it_8028E890, it_8028E8C0 },
{ -1, it_8028E92C, it_8028E934, NULL },
{ 0, it_8028E96C, it_8028E9B4, NULL },
{ +1, it_8028E888, it_8028EA08, it_8028E8C0 },
{ -1, it_8028EB28, it_8028EB30, it_8028EB34 },
{ -1, motion0_Anim, motion0_Phys, motion0_Coll },
{ -1, motion1_Anim, motion1_Phys, motion1_Coll },
{ -1, motion2_Anim, motion2_Phys, NULL },
{ 0, motion3_Anim, motion3_Phys, NULL },
{ +1, motion1_Anim, motion4_Phys, motion1_Coll },
{ -1, motion5_Anim, motion5_Phys, motion5_Coll },
};

void it_8028E738(Item_GObj* gobj)
{
Item* ip = gobj->user_data;
ItLGunAttr* item_spec_attr = ip->xC4_article_data->x4_specialAttributes;
ip->xD4C = item_spec_attr->x0;
ip->xDD4_itemVar.capsule.x0 = false;
ip->xDD4_itemVar.lgun.timer = 0;
it_8028E860(gobj);
}

void it_8028E774(Item_GObj* gobj, Vec3* arg1)
{
ItLGunAttr* da = GET_ITEM(gobj)->xC4_article_data->x4_specialAttributes;
arg1->x = da->x4;
arg1->y = da->x8;
arg1->z = da->xC;
arg1->x = da->pos.x;
arg1->y = da->pos.y;
arg1->z = da->pos.z;
}

void it_8028E79C(Item_GObj* gobj, Vec3* pos, f32 facing_dir)
Expand All @@ -72,14 +72,14 @@ void it_8028E7D8(Item_GObj* gobj)
Item_80268E5C(gobj, 0, ITEM_ANIM_UPDATE);
}

bool it_8028E828(Item_GObj* gobj)
bool motion0_Anim(Item_GObj* gobj)
{
return false;
}

void it_8028E830(Item_GObj* gobj) {}
void motion0_Phys(Item_GObj* gobj) {}

bool it_8028E834(Item_GObj* gobj)
bool motion0_Coll(Item_GObj* gobj)
{
it_8026D62C(gobj, it_8028E860);
return false;
Expand All @@ -90,19 +90,19 @@ void it_8028E860(Item_GObj* gobj)
Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE);
}

bool it_8028E888(HSD_GObj* gobj)
bool motion1_Anim(HSD_GObj* gobj)
{
return false;
}

void it_8028E890(Item_GObj* gobj)
void motion1_Phys(Item_GObj* gobj)
{
ItemAttr* item_comm_attr = GET_ITEM(gobj)->xCC_item_attr;
it_80272860(gobj, item_comm_attr->x10_fall_speed,
item_comm_attr->x14_fall_speed_max);
}

bool it_8028E8C0(HSD_GObj* gobj)
bool motion1_Coll(HSD_GObj* gobj)
{
if (GET_ITEM(gobj)->xD4C != 0) {
it_8026E15C(gobj, it_8028E7D8);
Expand All @@ -116,30 +116,30 @@ void it_8028E904(Item_GObj* gobj)
Item_80268E5C(gobj, 2, ITEM_ANIM_UPDATE);
}

bool it_8028E92C(HSD_GObj* gobj)
bool motion2_Anim(HSD_GObj* gobj)
{
return false;
}

void it_8028E934(HSD_GObj* gobj) {}
void motion2_Phys(HSD_GObj* gobj) {}

void it_8028E938(Item_GObj* gobj)
{
GET_ITEM(gobj)->xDD4_itemVar.lgun.x0 = 40;
GET_ITEM(gobj)->xDD4_itemVar.lgun.timer = 40;
Item_80268E5C(gobj, 3, ITEM_ANIM_UPDATE);
}

bool it_8028E96C(Item_GObj* gobj)
bool motion3_Anim(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
--ip->xDD4_itemVar.lgun.x0;
if (ip->xDD4_itemVar.lgun.x0 <= 0) {
--ip->xDD4_itemVar.lgun.timer;
if (ip->xDD4_itemVar.lgun.timer <= 0) {
Item_80268E5C(gobj, 2, ITEM_ANIM_UPDATE);
}
return false;
}

void it_8028E9B4(Item_GObj* gobj) {}
void motion3_Phys(Item_GObj* gobj) {}

void it_8028E9B8(Item_GObj* gobj)
{
Expand All @@ -151,7 +151,7 @@ void it_8028E9E0(Item_GObj* gobj)
Item_80268E5C(gobj, 4, 6);
}

void it_8028EA08(Item_GObj* gobj)
void motion4_Phys(Item_GObj* gobj)
{
ItemAttr* item_comm_attr = GET_ITEM(gobj)->xCC_item_attr;
it_80272860(gobj, item_comm_attr->x10_fall_speed,
Expand Down Expand Up @@ -192,14 +192,14 @@ void it_8028EB00(Item_GObj* gobj)
Item_80268E5C(gobj, 5, ITEM_ANIM_UPDATE);
}

bool it_8028EB28(Item_GObj* gobj)
bool motion5_Anim(Item_GObj* gobj)
{
return false;
}

void it_8028EB30(Item_GObj* gobj) {}
void motion5_Phys(Item_GObj* gobj) {}

bool it_8028EB34(Item_GObj* gobj)
bool motion5_Coll(Item_GObj* gobj)
{
it_8026E8C4(gobj, it_8028E7D8, it_8028E860);
return false;
Expand Down
Loading

0 comments on commit 8b25a8c

Please sign in to comment.