Skip to content

Commit 58ba86b

Browse files
authored
d_a_b_gnd ~86% equivalent (#2329)
* Remade fresh fork with clean main branch * d_a_b_gnd functions are 40% matching * Some data work * daB_GND_Execute 26% matching * daB_GND_Execute 59% matching * Create and useHeapInit work * Cleanup work and demo_camera at 50% matching * h_damage_check 91% matching * eff_set_h 76% matching * b_gnd_g_down 82% matching * general work * a little bit of improvement on himo_control1 * General work * Draw at 96% * Small gake_check work * Small data cleanup * NodeCallBack matching and data cleanup
1 parent 556f5ca commit 58ba86b

File tree

7 files changed

+6118
-3494
lines changed

7 files changed

+6118
-3494
lines changed

include/d/actor/d_a_b_gnd.h

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
#include "d/d_cc_uty.h"
99
#include "d/d_bg_s_acch.h"
1010

11-
struct g_himo_s {
12-
/* 80601D40 */ ~g_himo_s();
13-
/* 80601DA0 */ g_himo_s();
14-
15-
/* 0x0 */ cXyz field_0x0[16];
16-
};
17-
1811
/**
1912
* @ingroup actors-enemies
2013
* @class b_gnd_class
@@ -23,13 +16,20 @@ struct g_himo_s {
2316
* @details Hyrule Castle dungeon boss.
2417
*
2518
*/
19+
20+
struct g_himo_s {
21+
/* 80601D40 */ ~g_himo_s();
22+
/* 80601DA0 */ g_himo_s();
23+
24+
/* 0x0 */ cXyz field_0x0[16];
25+
};
26+
2627
class b_gnd_class : public fopEn_enemy_c {
2728
public:
2829
/* 80601960 */ b_gnd_class();
2930

3031
bool checkAttackChance() { return field_0x2740 != 0; }
3132

32-
private:
3333
/* 0x05AC */ request_of_phase_process_class mPhaseReq;
3434
/* 0x05B4 */ request_of_phase_process_class mHorsePhaseReq;
3535
/* 0x05BC */ s16 field_0x05bc;
@@ -38,7 +38,7 @@ class b_gnd_class : public fopEn_enemy_c {
3838
/* 0x05C0 */ cXyz field_0x05c0;
3939
/* 0x05CC */ s16 field_0x05cc;
4040
/* 0x05CE */ u8 field_0x05CE[0x05D0 - 0x05CE];
41-
/* 0x05D0 */ mDoExt_McaMorfSO* mpMorf;
41+
/* 0x05D0 */ mDoExt_McaMorfSO* mpModelMorf;
4242
/* 0x05D4 */ mDoExt_McaMorfSO* mpHorseMorf;
4343
/* 0x05D8 */ mDoExt_McaMorf* field_0x05d8;
4444
/* 0x05DC */ Z2CreatureEnemy mZ2Creature;
@@ -50,14 +50,16 @@ class b_gnd_class : public fopEn_enemy_c {
5050
/* 0x0748 */ int field_0x0748;
5151
/* 0x074C */ mDoExt_btpAnm* field_0x074c;
5252
/* 0x0750 */ mDoExt_btkAnm* field_0x0750;
53-
/* 0x0754 */ u8 field_0x0754[0x0758 - 0x0754];
53+
/* 0x0754 */ u8 field_0x0754;
54+
/* 0x0755 */ u8 field_0x0755[0x0758 - 0x0755];
5455
/* 0x0758 */ int mAnmID;
5556
/* 0x075C */ int mHorseAnmID;
56-
/* 0x0760 */ f32 field_0x0760;
57+
/* 0x0760 */ f32 mPlaySpeed;
5758
/* 0x0764 */ u8 field_0x0764[0x0768 - 0x0764];
5859
/* 0x0768 */ J3DModel* field_0x0768;
5960
/* 0x076C */ J3DModel* field_0x076c;
60-
/* 0x0770 */ u8 field_0x0770[0x0772 - 0x0770];
61+
/* 0x0770 */ u8 field_0x0770;
62+
/* 0x0771 */ u8 field_0x0771;
6163
/* 0x0772 */ s16 field_0x0772;
6264
/* 0x0774 */ dKy_tevstr_c field_0x0774;
6365
/* 0x0AFC */ s16 field_0x0afc;
@@ -74,11 +76,12 @@ class b_gnd_class : public fopEn_enemy_c {
7476
/* 0x0C38 */ f32 field_0x0c38;
7577
/* 0x0C3C */ s16 field_0x0c3c;
7678
/* 0x0C3E */ u8 field_0x0C3E[0x0C40 - 0x0C3E];
77-
/* 0x0C40 */ u32 field_0x0c40;
79+
/* 0x0C40 */ u32 mShadowID;
7880
/* 0x0C44 */ s16 field_0x0c44[10];
7981
/* 0x0C58 */ s16 field_0x0c58;
8082
/* 0x0C5A */ s16 field_0x0c5a;
81-
/* 0x0C5C */ u8 field_0x0C5C[0x0C60 - 0x0C5C];
83+
/* 0x0C5C */ s16 field_0x0c5c;
84+
/* 0x0C5D */ u8 field_0x0C5E[0x0C60 - 0x0C5E];
8285
/* 0x0C60 */ int field_0x0c60;
8386
/* 0x0C64 */ int field_0x0c64;
8487
/* 0x0C68 */ s16 field_0x0c68;
@@ -87,15 +90,21 @@ class b_gnd_class : public fopEn_enemy_c {
8790
/* 0x0C70 */ s16 field_0x0c70;
8891
/* 0x0C72 */ s16 field_0x0c72;
8992
/* 0x0C74 */ s16 field_0x0c74;
90-
/* 0x0C76 */ u8 field_0x0C76[0x0C7D - 0x0C76];
93+
/* 0x0C76 */ u8 field_0x0c76;
94+
/* 0x0C77 */ u8 field_0x0c77;
95+
/* 0x0C78 */ u8 field_0x0c78;
96+
/* 0x0C79 */ u8 field_0x0c79;
97+
/* 0x0C7A */ u8 field_0x0c7a;
98+
/* 0x0C7B */ u8 field_0x0c7b;
99+
/* 0x0C7C */ u8 field_0x0c7c;
91100
/* 0x0C7D */ u8 field_0x0c7d;
92101
/* 0x0C7E */ u8 field_0x0C7E[0x0C80 - 0x0C7E];
93102
/* 0x0C80 */ cXyz field_0x0c80;
94103
/* 0x0C8C */ s16 field_0x0c8c;
95104
/* 0x0C8E */ s16 field_0x0c8e;
96105
/* 0x0C90 */ s16 field_0x0c90;
97106
/* 0x0C92 */ s16 field_0x0c92;
98-
/* 0x0C94 */ dBgS_AcchCir field_0x0c94;
107+
/* 0x0C94 */ dBgS_AcchCir mWall;
99108
/* 0x0CD4 */ dBgS_ObjAcch field_0x0cd4;
100109
/* 0x0EAC */ s16 field_0x0eac;
101110
/* 0x0EAE */ u8 field_0x0EAE[0x0EB0 - 0x0EAE];
@@ -104,18 +113,19 @@ class b_gnd_class : public fopEn_enemy_c {
104113
/* 0x0EC0 */ csXyz field_0x0ec0;
105114
/* 0x0EC6 */ u8 field_0x0EC6[0x0EC8 - 0x0EC6];
106115
/* 0x0EC8 */ dCcD_Stts field_0x0ec8;
107-
/* 0x0F04 */ dCcD_Sph field_0x0f04[2];
108-
/* 0x1174 */ dCcD_Sph field_0x1174[4];
116+
/* 0x0F04 */ dCcD_Sph mHorseSpheres1[2];
117+
/* 0x1174 */ dCcD_Sph mHorseSpheres2[4];
109118
/* 0x1654 */ dCcD_Stts field_0x1654;
110119
/* 0x1690 */ dCcD_Sph field_0x1690[3];
111120
/* 0x1A38 */ dCcD_Sph field_0x1a38;
112121
/* 0x1B70 */ dCcD_Sph field_0x1b70;
113122
/* 0x1CA8 */ dCcD_Cyl field_0x1ca8;
114123
/* 0x1DE4 */ dCcU_AtInfo mAtInfo;
115-
/* 0x1E08 */ u8 field_0x1E08[0x1E0A - 0x1E08];
124+
/* 0x1E08 */ u8 field_0x1e08;
125+
/* 0x1E09 */ u8 field_0x1e09;
116126
/* 0x1E0A */ u16 field_0x1e0a;
117127
/* 0x1E0C */ u16 field_0x1e0c;
118-
/* 0x1E0E */ u8 field_0x1E0E[0x1E0F - 0x1E0E];
128+
/* 0x1E0E */ u8 field_0x1e0e;
119129
/* 0x1E0F */ s8 field_0x1e0f;
120130
/* 0x1E10 */ f32 field_0x1e10;
121131
/* 0x1E14 */ cXyz field_0x1e14;
@@ -129,8 +139,9 @@ class b_gnd_class : public fopEn_enemy_c {
129139
/* 0x1E98 */ cXyz field_0x1e98[5];
130140
/* 0x1ED4 */ cXyz field_0x1ed4[5];
131141
/* 0x1F10 */ Z2SoundObjSimple field_0x1f10[5];
132-
/* 0x1FB0 */ u8 field_0x1FB0[0x1FB4 - 0x1FB0];
133-
/* 0x1FB4 */ fopAc_ac_c* mMantChild;
142+
/* 0x1FB0 */ u8 mInitHIO;
143+
/* 0x1FB0 */ u8 field_0x1FB1[0x1FB4 - 0x1FB1];
144+
/* 0x1FB4 */ fpc_ProcID mMantChildID;
134145
/* 0x1FB8 */ cXyz field_0x1fb8;
135146
/* 0x1FC4 */ int field_0x1fc4;
136147
/* 0x1FC8 */ s16 field_0x1fc8;
@@ -145,25 +156,12 @@ class b_gnd_class : public fopEn_enemy_c {
145156
/* 0x2170 */ mDoExt_3DlineMat1_c field_0x2170[2];
146157
/* 0x21E8 */ mDoExt_3DlineMat1_c field_0x21e8;
147158
/* 0x2224 */ dKy_tevstr_c field_0x2224;
148-
/* 0x25AC */ u32 field_0x25ac;
149-
/* 0x25B0 */ u32 field_0x25b0;
150-
/* 0x25B4 */ u32 field_0x25b4;
151-
/* 0x25B8 */ u32 field_0x25b8;
152-
/* 0x25BC */ u32 field_0x25bc;
153-
/* 0x25C0 */ u32 field_0x25c0;
154-
/* 0x25C4 */ u32 field_0x25c4;
155-
/* 0x25C8 */ u32 field_0x25c8;
156-
/* 0x25CC */ u32 field_0x25cc;
157-
/* 0x25D0 */ u32 field_0x25d0;
158-
/* 0x25D4 */ u8 field_0x25D4[0x25D8 - 0x25D4];
159-
/* 0x25D8 */ u32 field_0x25d8;
160-
/* 0x25DC */ u32 field_0x25dc;
161-
/* 0x25E0 */ u32 field_0x25e0;
162-
/* 0x25E4 */ u32 field_0x25e4[3];
159+
/* 0x25AC */ u32 field_0x25ac[17];
163160
/* 0x25F0 */ u8 field_0x25F0[0x2688 - 0x25F0];
164161
/* 0x2688 */ u32 field_0x2688;
165162
/* 0x268C */ u32 field_0x268c[3];
166-
/* 0x2698 */ u8 field_0x2698[0x269C - 0x2698];
163+
/* 0x2698 */ u8 field_0x2698;
164+
/* 0x2699 */ u8 field_0x2699;
167165
/* 0x269C */ cXyz field_0x269c;
168166
/* 0x26A8 */ cXyz field_0x26a8[2];
169167
/* 0x26C0 */ s16 field_0x26c0;
@@ -178,13 +176,15 @@ class b_gnd_class : public fopEn_enemy_c {
178176
/* 0x2704 */ cXyz field_0x2704;
179177
/* 0x2710 */ cXyz field_0x2710;
180178
/* 0x271C */ s16 field_0x271c;
181-
/* 0x271E */ u8 field_0x271E[0x272C - 0x271E];
179+
/* 0x271E */ u8 field_0x271E[0x2720 - 0x271E];
180+
/* ox2720 */ cXyz field_0x2720;
182181
/* 0x272C */ s16 field_0x272c;
183182
/* 0x272E */ u8 field_0x272E[0x2730 - 0x272E];
184183
/* 0x2730 */ f32 field_0x2730;
185184
/* 0x2734 */ f32 field_0x2734;
186185
/* 0x2738 */ u8 field_0x2738;
187-
/* 0x2739 */ u8 field_0x2739[0x273C - 0x2739];
186+
/* 0x2739 */ u8 field_0x2739;
187+
/* 0x273A */ u8 field_0x273A[0x273C - 0x273A];
188188
/* 0x273C */ f32 field_0x273c;
189189
/* 0x2740 */ u8 field_0x2740;
190190
/* 0x2741 */ u8 field_0x2741[0x2744 - 0x2741];
@@ -197,6 +197,14 @@ class daB_GND_HIO_c {
197197
public:
198198
/* 805F4A4C */ daB_GND_HIO_c();
199199
/* 80602230 */ ~daB_GND_HIO_c();
200+
201+
/* 0x00 */ f32 field_0x0;
202+
/* 0x04 */ s8 field_0x4;
203+
/* 0x08 */ f32 model_size;
204+
/* 0x0C */ f32 field_0xc;
205+
/* 0x10 */ f32 field_0x10;
206+
/* 0x14 */ f32 field_0x14;
207+
/* 0x18 */ f32 field_0x18;
200208
};
201209

202210
#endif /* D_A_B_GND_H */

include/d/actor/d_a_mant.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,18 @@
1212
*
1313
*/
1414
class mant_class : public fopAc_ac_c {
15-
private:
16-
/* 0x568 */ u8 field_0x568[0x39a4 - 0x568];
15+
public:
16+
/* 0x0568 */ u8 field_0x568[0x395c - 0x568];
17+
/* 0x395C */ f32 field_0x395c;
18+
/* 0x3960 */ f32 field_0x3960;
19+
/* 0x3964 */ u8 field_0x3964;
20+
/* 0x3965 */ u8 field_0x3965;
21+
/* 0x3966 */ u8 field_0x3966;
22+
/* 0x3967 */ u8 field_0x3967;
23+
/* 0x3968 */ u8 field_0x3968;
24+
/* 0x3969 */ u8 field_0x3969;
25+
/* 0x396A */ u8 field_0x396A[0x39a4 - 0x396A];
26+
1727
};
1828

1929
STATIC_ASSERT(sizeof(mant_class) == 0x39a4);

include/d/actor/d_a_mg_rod.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class dmg_rod_class : public fopAc_ac_c {
6767
/* 0x0F80 */ u8 field_0xf80[0xFAC - 0xF80];
6868
/* 0x0FAC */ mg_hook_s field_0xfac[2];
6969
/* 0x0FEC */ u8 field_0xfec[0x1060 - 0xFEC];
70-
/* 0x1060 */ cXyz field_0x1060;
70+
/* 0x1060 */ cXyz mHookPosition;
7171
/* 0x106C */ cXyz field_0x106c;
7272
/* 0x1078 */ cXyz field_0x1078;
7373
/* 0x1084 */ csXyz field_0x1084;

include/d/actor/d_a_npc_gnd.h

Lines changed: 77 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,53 +11,64 @@
1111
* @details
1212
*
1313
*/
14-
class daNpc_Gnd_c : public fopAc_ac_c {
14+
class daNpc_Gnd_c : public daNpcT_c {
1515
public:
16+
typedef int (daNpc_Gnd_c::*cutFunc)(int);
17+
18+
enum Type {
19+
TYPE_0,
20+
TYPE_1,
21+
};
22+
1623
/* 809BB60C */ ~daNpc_Gnd_c();
17-
/* 809BB730 */ void create();
18-
/* 809BB9D4 */ void CreateHeap();
19-
/* 809BBE2C */ void Delete();
20-
/* 809BBE60 */ void Execute();
21-
/* 809BBE80 */ void Draw();
22-
/* 809BBF44 */ void createHeapCallBack(fopAc_ac_c*);
23-
/* 809BBF64 */ void ctrlJointCallBack(J3DJoint*, int);
24-
/* 809BBFBC */ void getType();
25-
/* 809BBFDC */ void getFlowNodeNo();
26-
/* 809BBFF8 */ void isDelete();
24+
/* 809BB730 */ int create();
25+
/* 809BB9D4 */ int CreateHeap();
26+
/* 809BBE2C */ int Delete();
27+
/* 809BBE60 */ int Execute();
28+
/* 809BBE80 */ int Draw();
29+
/* 809BBF44 */ static int createHeapCallBack(fopAc_ac_c*);
30+
/* 809BBF64 */ int ctrlJointCallBack(J3DJoint*, int);
31+
/* 809BBFBC */ u8 getType();
32+
/* 809BBFDC */ int getFlowNodeNo();
33+
/* 809BBFF8 */ int isDelete();
2734
/* 809BC028 */ void reset();
2835
/* 809BC168 */ void afterJntAnm(int);
29-
/* 809BC1F4 */ void ctrlBtk();
36+
/* 809BC1F4 */ BOOL ctrlBtk();
3037
/* 809BC328 */ void setParam();
3138
/* 809BC448 */ void setAfterTalkMotion();
3239
/* 809BC4A8 */ void srchActors();
33-
/* 809BC4AC */ void evtTalk();
34-
/* 809BC5AC */ void evtCutProc();
40+
/* 809BC4AC */ BOOL evtTalk();
41+
/* 809BC5AC */ BOOL evtCutProc();
3542
/* 809BC674 */ void action();
3643
/* 809BC760 */ void beforeMove();
3744
/* 809BC7D8 */ void setAttnPos();
3845
/* 809BCA14 */ void setCollision();
39-
/* 809BCB48 */ bool drawDbgInfo();
40-
/* 809BCB50 */ void afterSetMotionAnm(int, int, f32, int);
46+
/* 809BCB48 */ int drawDbgInfo();
47+
/* 809BCB50 */ bool afterSetMotionAnm(int, int, f32, int);
4148
/* 809BCCE8 */ void selectAction();
4249
/* 809BCD30 */ void chkAction(int (daNpc_Gnd_c::*)(void*));
4350
/* 809BCD5C */ void setAction(int (daNpc_Gnd_c::*)(void*));
4451
/* 809BCE04 */ void wait(void*);
4552
/* 809BD050 */ void talk(void*);
46-
/* 809BE2D0 */ daNpc_Gnd_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
47-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
48-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
49-
daNpcT_evtData_c const*, char**);
53+
/* 809BE2D0 */ daNpc_Gnd_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2,
54+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
55+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
56+
daNpcT_evtData_c const* param_7, char** param_8) :
57+
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8)
58+
{}
5059
/* 809BE40C */ s32 getEyeballRMaterialNo();
5160
/* 809BE414 */ s32 getEyeballLMaterialNo();
5261
/* 809BE41C */ s32 getHeadJointNo();
5362
/* 809BE424 */ s32 getNeckJointNo();
54-
/* 809BE42C */ bool getBackboneJointNo();
63+
/* 809BE42C */ s32 getBackboneJointNo();
5564

56-
static void* mCutNameList;
57-
static u8 mCutList[12];
65+
static char* mCutNameList;
66+
static cutFunc mCutList[1];
5867

5968
private:
60-
/* 0x568 */ u8 field_0x568[0xfa0 - 0x568];
69+
/* 0xE40 */ u8 field_0xe40[0xf80 - 0xe40];
70+
/* 0xF80 */ u8 mType;
71+
/* 0xF81 */ u8 field_0xf81[0xfa0 - 0xf81];
6172
};
6273

6374
STATIC_ASSERT(sizeof(daNpc_Gnd_c) == 0xfa0);
@@ -66,7 +77,48 @@ class daNpc_Gnd_Param_c {
6677
public:
6778
/* 809BE434 */ ~daNpc_Gnd_Param_c();
6879

69-
static u8 const m[140];
80+
struct Data {
81+
/* 0x00 */ f32 field_0x00;
82+
/* 0x04 */ f32 field_0x04;
83+
/* 0x08 */ f32 field_0x08;
84+
/* 0x0C */ f32 field_0x0c;
85+
/* 0x10 */ f32 field_0x10;
86+
/* 0x14 */ f32 field_0x14;
87+
/* 0x18 */ f32 field_0x18;
88+
/* 0x1C */ f32 field_0x1c;
89+
/* 0x20 */ f32 field_0x20;
90+
/* 0x24 */ f32 field_0x24;
91+
/* 0x28 */ f32 field_0x28;
92+
/* 0x2C */ f32 field_0x2c;
93+
/* 0x30 */ f32 field_0x30;
94+
/* 0x34 */ f32 field_0x34;
95+
/* 0x38 */ f32 field_0x38;
96+
/* 0x3C */ f32 field_0x3c;
97+
/* 0x40 */ f32 field_0x40;
98+
/* 0x44 */ f32 field_0x44;
99+
/* 0x48 */ s16 field_0x48;
100+
/* 0x4A */ s16 field_0x4a;
101+
/* 0x4C */ s16 field_0x4c;
102+
/* 0x4E */ s16 field_0x4e;
103+
/* 0x50 */ f32 field_0x50;
104+
/* 0x54 */ f32 field_0x54;
105+
/* 0x58 */ f32 field_0x58;
106+
/* 0x5C */ f32 field_0x5c;
107+
/* 0x60 */ s16 field_0x60;
108+
/* 0x62 */ s16 field_0x62;
109+
/* 0x64 */ f32 field_0x64;
110+
/* 0x68 */ f32 field_0x68;
111+
/* 0x6C */ f32 field_0x6c;
112+
/* 0x70 */ f32 field_0x70;
113+
/* 0x74 */ f32 field_0x74;
114+
/* 0x78 */ f32 field_0x78;
115+
/* 0x7C */ f32 field_0x7c;
116+
/* 0x80 */ f32 field_0x80;
117+
/* 0x84 */ f32 field_0x84;
118+
/* 0x88 */ f32 field_0x88;
119+
};
120+
121+
static const Data m;
70122
};
71123

72124

include/d/actor/d_a_player.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,10 @@ class daPy_py_c : public fopAc_ac_c {
11081108

11091109
BOOL checkClimbEndHang() { return checkResetFlg0(RFLG0_UNK_40000); }
11101110

1111+
void onForceHorseGetOff() {
1112+
onEndResetFlg2(ERFLG2_UNK_2);
1113+
}
1114+
11111115
static daMidna_c* m_midnaActor;
11121116
};
11131117

0 commit comments

Comments
 (0)