Skip to content

Commit 3318b5e

Browse files
authored
Continued monkey work (monkey business if you will) - Monkey-related TUs (#2469)
* Initial work * Work on ori2 and others * Work on npc_ks_home * Work on npc_ks_demo_022 * Chugging through * Started on demo_camera * More demo_camera work * 51% equivalent * General cleanup * Fixed compile error in d_a_e_mk * Small d_a_e_mk fix * d_a_e_fs fix * PR cleanup * Started work on d_a_obj_sw * d_a_obj_sw work * Small fixes * d_a_obj_so work * d_a_obj_so almost equivalent and small work on d_a_npc_ks * Work on npc_ks_guide_00 * Work on guide functions * 80% matching * Almost have all functions worked on * All functions worked on * Initial d_a_npc_saru work * Tiny bit more work * daNpc_Saru almost matching * fixed array issue * obj_kago work * d_a_obj_kago almost matching * sare_npc brief fix * PR cleanup
1 parent 372d782 commit 3318b5e

File tree

11 files changed

+6376
-4633
lines changed

11 files changed

+6376
-4633
lines changed

include/d/actor/d_a_e_ym.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class daE_YM_c : public fopEn_enemy_c {
134134
void setFriendFlag(u8 i_flag) { mFriendFlag |= i_flag; }
135135
u8 getFriendFlag() { return mFriendFlag; }
136136
u8 getSwitchBit() { return mSwitchBit; }
137+
u8 isHide() { return mIsHide; }
137138

138139
private:
139140
/* 0x5AC */ request_of_phase_process_class mPhase;

include/d/actor/d_a_npc_ks.h

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "d/actor/d_a_npc.h"
55
#include "d/actor/d_a_obj_so.h"
66
#include "d/actor/d_a_obj_sw.h"
7+
#include "f_op/f_op_actor_mng.h"
78

89
/**
910
* @ingroup actors-npcs
@@ -15,16 +16,14 @@
1516
*/
1617
class npc_ks_class {
1718
public:
18-
/* 0x000 */ fopAc_ac_c actor;
19-
/* 0x568 */ u8 field_0x568[0x570 - 0x568];
20-
/* 0x570 */ u8 field_0x570;
21-
/* 0x571 */ u8 field_0x571[0x5b4 - 0x571];
19+
/* 0x000 */ fopEn_enemy_c actor;
20+
/* 0x5AC */ request_of_phase_process_class mPhase;
2221
/* 0x5B4 */ u8 mRoomMonkeyID;
2322
/* 0x5B5 */ u8 field_0x5b5;
2423
/* 0x5B6 */ u8 field_0x5b6;
2524
/* 0x5B7 */ u8 field_0x5b7;
2625
/* 0x5B8 */ int field_0x5b8;
27-
/* 0x5BC */ int field_0x5bc;
26+
/* 0x5BC */ int bitTRB;
2827
/* 0x5C0 */ char* mResName;
2928
/* 0x5C4 */ f32 field_0x5c4;
3029
/* 0x5C8 */ s16 field_0x5c8;
@@ -34,7 +33,7 @@ class npc_ks_class {
3433
/* 0x5D8 */ mDoExt_btpAnm* mBtp1;
3534
/* 0x5DC */ mDoExt_btpAnm* mBtp2;
3635
/* 0x5E0 */ s16 field_0x5e0;
37-
/* 0x5E2 */ u8 field_0x5e2[2];
36+
/* 0x5E2 */ s16 field_0x5e2;
3837
/* 0x5E4 */ s8 field_0x5e4;
3938
/* 0x5E5 */ u8 field_0x5e5;
4039
/* 0x5E6 */ s16 field_0x5e6;
@@ -56,7 +55,7 @@ class npc_ks_class {
5655
/* 0x610 */ s16 field_0x610;
5756
/* 0x614 */ cXyz field_0x614;
5857
/* 0x620 */ s8 field_0x620;
59-
/* 0x621 */ u8 field_0x621;
58+
/* 0x621 */ s8 field_0x621;
6059
/* 0x622 */ u8 field_0x622;
6160
/* 0x623 */ u8 field_0x623;
6261
/* 0x624 */ cXyz field_0x624;
@@ -89,7 +88,9 @@ class npc_ks_class {
8988
/* 0x98C */ dCcD_Cyl field_0x98c;
9089
/* 0xAC8 */ u8 field_0xac8[0xaec - 0xac8];
9190
/* 0xAEC */ s8 field_0xaec;
92-
/* 0xAED */ u8 field_0xaed[0xaf4 - 0xaed];
91+
/* 0xAED */ u8 field_0xaed;
92+
/* 0xAEE */ s16 field_0xaee;
93+
/* 0xAF0 */ s16 field_0xaf0;
9394
/* 0xAF4 */ dMsgFlow_c mMsgFlow;
9495
/* 0xB40 */ u8 field_0xb40;
9596
/* 0xB41 */ u8 field_0xb41;
@@ -126,9 +127,16 @@ class npc_ks_class {
126127
/* 0xBFC */ J3DModel* field_0xbfc;
127128
/* 0xC00 */ J3DModel* field_0xc00;
128129
/* 0xC04 */ cXyz field_0xc04;
129-
/* 0xC10 */ u8 field_0xc10[0xc17 - 0xc10];
130+
/* 0xC10 */ f32 field_0xc10;
131+
/* 0xC14 */ s16 field_0xc14;
132+
/* 0xC16 */ s8 field_0xc16;
130133
/* 0xC17 */ s8 field_0xc17;
131-
/* 0xC18 */ u8 field_0xc18[0xc20 - 0xc18];
134+
/* 0xC18 */ dPath* field_0xc18;
135+
/* 0xC1C */ u8 field_0xc1c;
136+
137+
u32 fopAcM_checkHawkCarryNow(fopAc_ac_c* param_1) {
138+
return fopAcM_checkStatus(param_1, 0x80000000);
139+
}
132140
};
133141

134142
STATIC_ASSERT(sizeof(npc_ks_class) == 0xc20);

include/d/actor/d_a_npc_saru.h

Lines changed: 126 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,70 +6,156 @@
66
/**
77
* @ingroup actors-npcs
88
* @class daNpc_Saru_c
9-
* @brief Monkey (Ook?)
9+
* @brief Monkey NPC
1010
*
1111
* @details
1212
*
1313
*/
14-
class daNpc_Saru_c : public fopAc_ac_c {
14+
15+
#ifdef DEBUG
16+
class daNpc_Saru_HIO_c : public mDoHIO_entry_c {
17+
18+
};
19+
#endif
20+
21+
class daNpc_Saru_Param_c {
22+
public:
23+
/* 80AC448C */ virtual ~daNpc_Saru_Param_c() {};
24+
25+
struct Data {
26+
/* 0x00 */ f32 field_0x00;
27+
/* 0x04 */ f32 mGravity;
28+
/* 0x08 */ f32 field_0x08;
29+
/* 0x0C */ f32 field_0x0c;
30+
/* 0x10 */ f32 mWeight;
31+
/* 0x14 */ f32 mCylH;
32+
/* 0x18 */ f32 mWallH;
33+
/* 0x1C */ f32 mWallR;
34+
/* 0x20 */ f32 mBodyDownAngle;
35+
/* 0x24 */ f32 mBodyUpAngle;
36+
/* 0x28 */ f32 mBodyRightAngle;
37+
/* 0x2C */ f32 mBodyLeftAngle;
38+
/* 0x30 */ f32 mHeadDownAngle;
39+
/* 0x34 */ f32 mHeadUpAngle;
40+
/* 0x38 */ f32 mHeadRightAngle;
41+
/* 0x3C */ f32 mHeadLeftAngle;
42+
/* 0x40 */ f32 field_0x40;
43+
/* 0x44 */ f32 mMorfFrames;
44+
/* 0x48 */ s16 field_0x48;
45+
/* 0x4A */ s16 field_0x4a;
46+
/* 0x4C */ s16 field_0x4c;
47+
/* 0x4E */ s16 field_0x4e;
48+
/* 0x50 */ f32 mAttnFovy;
49+
/* 0x54 */ f32 field_0x54;
50+
/* 0x58 */ f32 field_0x58;
51+
/* 0x5C */ f32 field_0x5c;
52+
/* 0x60 */ s16 field_0x60;
53+
/* 0x62 */ s16 field_0x62;
54+
/* 0x64 */ f32 field_0x64;
55+
/* 0x68 */ f32 field_0x68;
56+
/* 0x6C */ f32 field_0x6c;
57+
/* 0x70 */ f32 field_0x70;
58+
/* 0x74 */ f32 field_0x74;
59+
/* 0x78 */ f32 field_0x78;
60+
/* 0x7C */ f32 field_0x7c;
61+
/* 0x80 */ f32 field_0x80;
62+
/* 0x84 */ f32 field_0x84;
63+
/* 0x88 */ f32 field_0x88;
64+
/* 0x8C */ s16 field_0x8c;
65+
/* 0x8E */ s16 field_0x8e;
66+
};
67+
68+
static const Data m;
69+
};
70+
71+
class daNpc_Saru_c : public daNpcT_c {
1572
public:
73+
typedef int (daNpc_Saru_c::*cutFunc)(int);
74+
typedef int (daNpc_Saru_c::*actionFunc)(void*);
75+
76+
enum Type {
77+
TYPE_0,
78+
TYPE_1,
79+
TYPE_2,
80+
TYPE_3,
81+
};
82+
1683
/* 80AC042C */ ~daNpc_Saru_c();
17-
/* 80AC0578 */ void create();
18-
/* 80AC082C */ void CreateHeap();
19-
/* 80AC0A54 */ void Delete();
20-
/* 80AC0A88 */ void Execute();
21-
/* 80AC0AA8 */ void Draw();
22-
/* 80AC0AEC */ void createHeapCallBack(fopAc_ac_c*);
23-
/* 80AC0B0C */ void ctrlJointCallBack(J3DJoint*, int);
24-
/* 80AC0B64 */ void srchYm(void*, void*);
25-
/* 80AC0C0C */ void getType();
26-
/* 80AC0C58 */ void isDelete();
84+
/* 80AC0578 */ int create();
85+
/* 80AC082C */ int CreateHeap();
86+
/* 80AC0A54 */ int Delete();
87+
/* 80AC0A88 */ int Execute();
88+
/* 80AC0AA8 */ int Draw();
89+
/* 80AC0AEC */ static int createHeapCallBack(fopAc_ac_c*);
90+
/* 80AC0B0C */ static int ctrlJointCallBack(J3DJoint*, int);
91+
/* 80AC0B64 */ static void* srchYm(void*, void*);
92+
/* 80AC0C0C */ u8 getType();
93+
/* 80AC0C58 */ int isDelete();
2794
/* 80AC0CE8 */ void reset();
2895
/* 80AC0EA4 */ void afterJntAnm(int);
29-
/* 80AC0F28 */ void checkChangeEvt();
96+
/* 80AC0F28 */ BOOL checkChangeEvt();
3097
/* 80AC0FDC */ void setParam();
3198
/* 80AC1110 */ void setAfterTalkMotion();
3299
/* 80AC1170 */ void srchActors();
33-
/* 80AC11D4 */ void evtTalk();
34-
/* 80AC1274 */ void evtCutProc();
100+
/* 80AC11D4 */ BOOL evtTalk();
101+
/* 80AC1274 */ BOOL evtCutProc();
35102
/* 80AC133C */ void action();
36103
/* 80AC14E4 */ void beforeMove();
37104
/* 80AC15B4 */ void setAttnPos();
38105
/* 80AC18A0 */ void setCollision();
39-
/* 80AC1A20 */ bool drawDbgInfo();
106+
/* 80AC1A20 */ int drawDbgInfo();
40107
/* 80AC1A28 */ void drawOtherMdl();
41-
/* 80AC1B30 */ void selectAction();
42-
/* 80AC1B78 */ void chkAction(int (daNpc_Saru_c::*)(void*));
43-
/* 80AC1BA4 */ void setAction(int (daNpc_Saru_c::*)(void*));
108+
/* 80AC1B30 */ int selectAction();
109+
/* 80AC1B78 */ BOOL chkAction(int (daNpc_Saru_c::*)(void*));
110+
/* 80AC1BA4 */ int setAction(int (daNpc_Saru_c::*)(void*));
44111
/* 80AC1C4C */ void setSe();
45-
/* 80AC216C */ void cutFindMonkey(int);
46-
/* 80AC2368 */ void cutHelpMe(int);
47-
/* 80AC2598 */ void cutYmLook(int);
48-
/* 80AC28A4 */ void wait(void*);
49-
/* 80AC2FD8 */ void talk(void*);
50-
/* 80AC4394 */ daNpc_Saru_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
51-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
52-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
53-
daNpcT_evtData_c const*, char**);
112+
/* 80AC216C */ int cutFindMonkey(int);
113+
/* 80AC2368 */ int cutHelpMe(int);
114+
/* 80AC2598 */ int cutYmLook(int);
115+
/* 80AC28A4 */ int wait(void*);
116+
/* 80AC2FD8 */ int talk(void*);
117+
/* 80AC4394 */ daNpc_Saru_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2,
118+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
119+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
120+
daNpcT_evtData_c const* param_7, char** param_8) :
121+
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8)
122+
{}
54123
/* 80AC4474 */ s32 getHeadJointNo();
55124
/* 80AC447C */ s32 getNeckJointNo();
56-
/* 80AC4484 */ bool getBackboneJointNo();
57-
58-
static void* mCutNameList[4];
59-
static u8 mCutList[48];
125+
/* 80AC4484 */ s32 getBackboneJointNo();
60126

61-
private:
62-
/* 0x568 */ u8 field_0x568[0xfe0 - 0x568];
63-
};
127+
u32 getFlowNodeNo() {
128+
u16 rv = home.angle.x;
129+
if (rv == 0xffff) {
130+
return -1;
131+
}
132+
return rv;
133+
}
64134

65-
STATIC_ASSERT(sizeof(daNpc_Saru_c) == 0xfe0);
135+
u8 getPathID() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; }
136+
u8 getBitSW() { return (fopAcM_GetParam(this) & 0xff00) >> 8; }
66137

67-
class daNpc_Saru_Param_c {
68-
public:
69-
/* 80AC448C */ ~daNpc_Saru_Param_c();
138+
static char* mCutNameList[4];
139+
static cutFunc mCutList[4];
70140

71-
static u8 const m[144];
141+
private:
142+
#ifdef DEBUG
143+
/* 0xE90 */ daNpc_Saru_HIO_c* field_0xe90;
144+
#endif
145+
/* 0xE40 */ u8 field_0xe40[0xe44 - 0xe40];
146+
/* 0xE44 */ J3DModel* field_0xe44[2];
147+
/* 0xE4C */ dCcD_Cyl field_0xe4c;
148+
/* 0xF88 */ u8 mType;
149+
/* 0xF8C */ daNpcT_ActorMngr_c mActrMngr[1];
150+
/* 0xF94 */ daNpcT_Path_c mPath;
151+
/* 0xFBC */ actionFunc field_0xfbc;
152+
/* 0xFC8 */ actionFunc field_0xfc8;
153+
/* 0xFD4 */ int field_0xfd4;
154+
/* 0xFD8 */ u8 field_0xfd8;
155+
/* 0xFD9 */ u8 field_0xfd9;
156+
/* 0xFDC */ int field_0xfdc;
72157
};
73158

159+
STATIC_ASSERT(sizeof(daNpc_Saru_c) == 0xfe0);
74160

75161
#endif /* D_A_NPC_SARU_H */

0 commit comments

Comments
 (0)