Skip to content

Commit bb43d0f

Browse files
authored
Foxblaster demystification and Lgun decomp (#1438)
* Foxblaster decomp work * Update .pre-commit-config.yaml * formatting * More formatting * Fix newline * Fox blaster demystification work * formatting previous commit * Update itCharItems.h * clarifying fox blaster vars' uses * Update itfoxblaster.c * Demystified blaster subaction flags * Fixed * Lgun ray decomp * Formatting * Rolling back some function type changes so that I can make that all in a separate pull request
1 parent 9ca8391 commit bb43d0f

File tree

8 files changed

+580
-199
lines changed

8 files changed

+580
-199
lines changed

src/melee/it/itCharItems.h

+83-31
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,89 @@
1111
#include <baselib/jobj.h>
1212

1313
typedef struct {
14-
/* x0 */ s32 xDD4;
15-
/* x4 */ s32 xDD8;
16-
/* x8 */ s32 xDDC;
17-
/* xC */ s32 xDE0;
18-
/* x10 */ s32 xDE4;
19-
/* x14 */ s32 xDE8;
20-
/* x18 */ s32 xDEC;
21-
/* x1C */ s32 xDF0;
22-
/* x20 */ s32 xDF4;
23-
/* x24 */ s32 xDF8;
24-
/* x28 */ s32 xDFC;
25-
/* x2C */ s32 xE00;
26-
/* x30 */ s32 xE04;
27-
/* x34 */ s32 xE08;
28-
/* x38 */ s32 xE0C;
29-
/* x3C */ s32 xE10;
30-
/* x40 */ Vec3 xE14;
31-
/* x4C */ Vec3 xE20;
32-
/* x58 */ Vec3 xE2C;
33-
/* x64 */ Vec3 xE38;
34-
/* x70 */ Vec3 xE44;
35-
/* x7C */ Vec3 xE50;
36-
/* x88 */ f32 xE5C;
37-
/* x8C */ f32 xE60;
38-
/* x90 */ f32 xE64;
39-
/* x94 */ f32 xE68;
40-
/* x98 */ f32 xE6C;
41-
/* x9C */ f32 xE70;
42-
/* x100 */ s32 xE74;
43-
/* x104 */ s32 xE78;
44-
/* x108 */ HSD_GObj* xE7C;
14+
/* x0 */ s32 xDD4; // gets iterated from 0 to 14 in function (it_802AE200)
15+
// that transforms the item model (possibly frame number
16+
// of animation?)
17+
/* x4 */ s32 xDD8; // {0-4} Used to index into array (it_803F6E28) that has
18+
// floats to translate item model by
19+
// 1->4 when blaster shooting starting (at cmd_var3 = 1)
20+
// 3->0 when blaster getting put away (at cmd_var3 = 2)
21+
/* x8 */ s32 xDDC; // {-1, 0, 1} Value gets added to xDD8 to iterate it
22+
// during blaster collision callback
23+
// -1: when cmd_var3 = 2 (when gun is getting put away,
24+
// ____but not yet invisible)
25+
// 0: when xDD8 <= 0 or xDD8 >= 5
26+
// 1: when cmd_var3 = 1 (when gun shooting sfx starts)
27+
/* xC */ s32 xDE0; // 0 when never shot yet; 1 when has been shot (in this
28+
// spawn instance of the blaster - not put away)
29+
/* x10 */ s32 xDE4; // group 1; gets set to 0 in func (it_802ADF10) that
30+
// sets item joint locations from corresponding fighter
31+
// joint locations
32+
/* x14 */ s32 xDE8; // group 1
33+
/* x18 */ s32 xDEC; // group 1
34+
/* x1C */ s32 xDF0; // group 1
35+
/* x20 */ s32 xDF4; // group 1
36+
/* x24 */ s32 xDF8; // group 1
37+
/* x28 */ s32 xDFC; // group 2; gets set to 0 in func (it_802ADF10) that
38+
// sets item joint locations from corresponding fighter
39+
// joint locations
40+
/* x2C */ s32 xE00; // group 2
41+
/* x30 */ s32 xE04; // group 2
42+
/* x34 */ s32 xE08; // group 2
43+
/* x38 */ s32 xE0C; // group 2
44+
/* x3C */ s32 xE10; // group 2
45+
/* x40 */ Vec3 xE14; // group 3; gets set as the vector from fighter's
46+
// current position to the joint holding the blaster
47+
// on the frame blaster its shot
48+
/* x4C */ Vec3 xE20; // group 3
49+
/* x58 */ Vec3 xE2C; // group 3
50+
/* x64 */ Vec3 xE38; // group 3
51+
/* x70 */ Vec3 xE44; // group 3
52+
/* x7C */ Vec3 xE50; // group 3
53+
/* x88 */ f32 angle; // xE5C group 4; gets set to an angle value in func
54+
// (it_802ADF10) that sets item joint locations from
55+
// corresponding fighter joint locations
56+
/* x8C */ f32 xE60; // group 4
57+
/* x90 */ f32 xE64; // group 4
58+
/* x94 */ f32 xE68; // group 4
59+
/* x98 */ f32 xE6C; // group 4
60+
/* x9C */ f32 xE70; // group 4
61+
/* x100 */ s32 gfx_spawn_var; // xE74 Signals to spawn shoot gfx from
62+
// blaster when set to '1', which is done
63+
// from subaction funcs on frame of shot
64+
/* x104 */ s32 set_sfx_var2; // xE78 Sets blaster destroy sfx func when
65+
// Flag 1 = 2
66+
// ---------------
67+
// Blaster/Throw Subaction cmd Flags
68+
// .
69+
// Flag 0 is ??? (multipurpose?)
70+
// 0: ?
71+
// 1: ?
72+
// .
73+
// Flag 1 is for if blaster is present?
74+
// 0: Default (invisible)
75+
// ___Initial value for blaster actions and
76+
// ___set on 1st frame of throw actions
77+
// 1: Present (visible)
78+
// ___Set 1st frame of SpecialAirNStart
79+
// ___action and upon blaster spawn in
80+
// ___throw actions
81+
// 2: Put away (invisible again)
82+
// ___Set frame of putting away blaster in
83+
// ___all blaster and throw actions
84+
// .
85+
// Flag 2 is for spawning laser shots
86+
// 0: Default (don't spawn)
87+
// 1: Spawn
88+
// ___Set on shoot frame, then immediately
89+
// ___reset to 0 after triggering those
90+
// ___functions
91+
// .
92+
// Flag 3 is for blaster action
93+
// 0: Default
94+
// 1: Starting to shoot
95+
// 2: Being put away
96+
/* x108 */ HSD_GObj* owner; // xE7C
4597
} FoxBlasterVars;
4698

4799
typedef struct {

src/melee/it/itCommonItems.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,14 @@ typedef struct FoodVars {
120120
s32 xDD8_heal;
121121
} FoodVars;
122122

123-
typedef struct {
123+
typedef struct ItLGunAttr {
124+
int x0;
125+
float x4;
126+
float x8;
127+
float xC;
128+
} ItLGunAttr; // Not sure if this struct size is correct or type of vars
129+
130+
typedef struct ItLGunVars {
124131
u32 x0;
125132
} ItLGunVars;
126133

src/melee/it/item.c

+2
Original file line numberDiff line numberDiff line change
@@ -2027,6 +2027,8 @@ void Item_8026A8EC(Item_GObj* gobj)
20272027
HSD_GObjPLink_80390228(gobj);
20282028
}
20292029

2030+
// These param names do no match up with those in function declaration
2031+
// (Item_GObj* gobj, HSD_GObj* owner_gobj, Fighter_Part part)
20302032
void Item_8026AB54(HSD_GObj* gobj, HSD_GObj* pickup_gfx,
20312033
Fighter_Part pickup_sfx)
20322034
{

src/melee/it/items/it_27CF.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
/* 2AE1D0 */ void it_802AE1D0(Item_GObj*);
5151
/* 2AE538 */ void it_802AE538(Item_GObj*);
5252
/* 2AE608 */ void it_802AE608(Item_GObj*);
53-
/* 2AE8A8 */ HSD_GObj* it_802AE8A8(float, HSD_GObj*, Vec3*, s32, s32);
53+
/* 2AE8A8 */ Item_GObj* it_802AE8A8(float, Fighter_GObj*, Vec3*, Fighter_Part,
54+
ItemKind);
5455
/* 2AEAB4 */ void it_802AEAB4(Item_GObj*);
5556
/* 2B1DEC */ s32 it_802B1DEC(u32);
5657
/* 2B1DF8 */ u32 it_802B1DF8(Item_GObj*, Vec3*, Vec3*, s32, s32, s32);

0 commit comments

Comments
 (0)