Skip to content

Commit 245780f

Browse files
committed
d_a_npc_pouya matching
1 parent a0df17d commit 245780f

File tree

9 files changed

+1230
-1478
lines changed

9 files changed

+1230
-1478
lines changed

config/GZ2E01/rels/d_a_npc_pouya/symbols.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ jointNo$5024 = .rodata:0x00000110; // type:object size:0x4 scope:local data:4byt
134134
...data.0 = .data:0x00000000; // type:label scope:local
135135
cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global
136136
@1787 = .data:0x0000000C; // type:object size:0x4 scope:local
137-
lbl_348_data_10 = .data:0x00000010; // type:object size:0x10
137+
_three$localstatic4$sqrtf = .data:0x00000010; // type:object size:0x8
138+
_half$localstatic3$sqrtf = .data:0x00000018; // type:object size:0x8
138139
l_bmdData = .data:0x00000020; // type:object size:0x18 scope:global data:4byte
139140
l_evtList = .data:0x00000038; // type:object size:0x48 scope:global
140141
l_resNameList = .data:0x00000080; // type:object size:0xC scope:global

config/GZ2J01/rels/d_a_npc_pouya/symbols.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ jointNo$5024 = .rodata:0x00000110; // type:object size:0x4 scope:local data:4byt
133133
@stringBase0 = .rodata:0x00000120; // type:object size:0xD0 scope:local data:string_table
134134
cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global
135135
@1787 = .data:0x0000000C; // type:object size:0x4 scope:local
136-
lbl_348_data_10 = .data:0x00000010; // type:object size:0x10
136+
_three$localstatic4$sqrtf = .data:0x00000010; // type:object size:0x8
137+
_half$localstatic3$sqrtf = .data:0x00000018; // type:object size:0x8
137138
l_bmdData = .data:0x00000020; // type:object size:0x18 scope:global data:4byte
138139
l_evtList = .data:0x00000038; // type:object size:0x48 scope:global
139140
l_resNameList = .data:0x00000080; // type:object size:0xC scope:global

config/GZ2P01/rels/d_a_npc_pouya/symbols.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ jointNo$5024 = .rodata:0x00000110; // type:object size:0x4 scope:local data:4byt
133133
@stringBase0 = .rodata:0x00000120; // type:object size:0xD0 scope:local data:string_table
134134
cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global
135135
@1787 = .data:0x0000000C; // type:object size:0x4 scope:local
136-
lbl_348_data_10 = .data:0x00000010; // type:object size:0x10
136+
_three$localstatic4$sqrtf = .data:0x00000010; // type:object size:0x8
137+
_half$localstatic3$sqrtf = .data:0x00000018; // type:object size:0x8
137138
l_bmdData = .data:0x00000020; // type:object size:0x18 scope:global data:4byte
138139
l_evtList = .data:0x00000038; // type:object size:0x48 scope:global
139140
l_resNameList = .data:0x00000080; // type:object size:0xC scope:global

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ def MatchingFor(*versions) -> bool:
19041904
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_passer"),
19051905
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_passer2"),
19061906
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_post"),
1907-
ActorRel(NonMatching, "d_a_npc_pouya"),
1907+
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_pouya"),
19081908
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_prayer", extra_cflags=[DANPCF_C_HACK]),
19091909
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_raca"),
19101910
ActorRel(Equivalent, "d_a_npc_rafrel", extra_cflags=[DANPCF_C_HACK]), # weak func order

include/d/actor/d_a_npc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class daNpcT_MotionSeqMngr_c {
100100
}
101101
}
102102
}
103+
void setOffset(int i_offset) { mOffset = i_offset; }
103104

104105
private:
105106
/* 0x00 */ sequenceStepData_c const* mpSeqData;

include/d/actor/d_a_npc_pouya.h

Lines changed: 133 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33

44
#include "d/actor/d_a_npc.h"
55

6+
struct daNpc_Pouya_HIOParam {
7+
/* 0x00 */ daNpcT_HIOParam common;
8+
};
9+
10+
class daNpc_Pouya_Param_c {
11+
public:
12+
/* 80B24978 */ virtual ~daNpc_Pouya_Param_c() {}
13+
14+
static const daNpc_Pouya_HIOParam m;
15+
};
16+
17+
#if DEBUG
18+
class daNpc_Pouya_HIO_c : public mDoHIO_entry_c {
19+
public:
20+
daNpc_Pouya_HIO_c();
21+
22+
void listenPropertyEvent(const JORPropertyEvent*);
23+
void genMessage(JORMContext*);
24+
25+
daNpc_Pouya_HIOParam m;
26+
};
27+
28+
#define NPC_POUYA_HIO_CLASS daNpc_Pouya_HIO_c
29+
#else
30+
#define NPC_POUYA_HIO_CLASS daNpc_Pouya_Param_c
31+
#endif
32+
633
/**
734
* @ingroup actors-npcs
835
* @class daNpc_Pouya_c
@@ -11,71 +38,133 @@
1138
* @details
1239
*
1340
*/
14-
class daNpc_Pouya_c : public fopAc_ac_c {
41+
class daNpc_Pouya_c : public daNpcT_c {
1542
public:
43+
typedef int (daNpc_Pouya_c::*cutFunc)(int);
44+
typedef int (daNpc_Pouya_c::*actionFunc)(void*);
45+
46+
enum Type {
47+
TYPE_0,
48+
TYPE_1,
49+
TYPE_2,
50+
TYPE_3,
51+
TYPE_4,
52+
TYPE_5,
53+
};
54+
55+
enum FaceMotion {
56+
/* 0x00 */ FACE_MOT_UNK_0 = 0,
57+
/* 0x01 */ FACE_MOT_UNK_1 = 1,
58+
/* 0x02 */ FACE_MOT_UNK_2 = 2,
59+
/* 0x03 */ FACE_MOT_UNK_3 = 3,
60+
/* 0x04 */ FACE_MOT_UNK_4 = 4,
61+
/* 0x05 */ FACE_MOT_UNK_5 = 5,
62+
/* 0x06 */ FACE_MOT_UNK_6 = 6,
63+
/* 0x07 */ FACE_MOT_UNK_7 = 7,
64+
/* 0x08 */ FACE_MOT_UNK_8 = 8,
65+
/* 0x09 */ FACE_MOT_UNK_9 = 9,
66+
/* 0x0A */ FACE_MOT_UNK_10 = 10,
67+
/* 0x0B */ FACE_MOT_UNK_11 = 11,
68+
/* 0x0C */ FACE_MOT_UNK_12 = 12,
69+
/* 0x0D */ FACE_MOT_UNK_13 = 13,
70+
/* 0x0E */ FACE_MOT_UNK_14 = 14,
71+
/* 0x0F */ FACE_MOT_UNK_15 = 15,
72+
/* 0x10 */ FACE_MOT_UNK_16 = 16,
73+
/* 0x11 */ FACE_MOT_UNK_17 = 17,
74+
};
75+
76+
enum Motion {
77+
/* 0x00 */ MOT_UNK_0 = 0,
78+
/* 0x01 */ MOT_UNK_1 = 1,
79+
/* 0x04 */ MOT_UNK_4 = 4,
80+
/* 0x08 */ MOT_UNK_8 = 8,
81+
/* 0x0A */ MOT_UNK_10 = 10,
82+
/* 0x0F */ MOT_UNK_15 = 15,
83+
};
84+
1685
/* 80AADDAC */ ~daNpc_Pouya_c();
17-
/* 80AADEE0 */ void create();
18-
/* 80AAE1AC */ void CreateHeap();
19-
/* 80AAE788 */ void Delete();
20-
/* 80AAE7BC */ void Execute();
21-
/* 80AAE7DC */ void Draw();
22-
/* 80AAE870 */ void createHeapCallBack(fopAc_ac_c*);
23-
/* 80AAE890 */ void ctrlJointCallBack(J3DJoint*, int);
86+
/* 80AADEE0 */ int create();
87+
/* 80AAE1AC */ int CreateHeap();
88+
/* 80AAE788 */ int Delete();
89+
/* 80AAE7BC */ int Execute();
90+
/* 80AAE7DC */ int Draw();
91+
/* 80AAE870 */ static int createHeapCallBack(fopAc_ac_c*);
92+
/* 80AAE890 */ static int ctrlJointCallBack(J3DJoint*, int);
2493
/* 80AAE8E8 */ u8 getType();
25-
/* 80AAE94C */ void isDelete();
94+
/* 80AAE94C */ BOOL isDelete();
2695
/* 80AAE9D8 */ void reset();
2796
/* 80AAEBCC */ void ctrlSubFaceMotion(int);
2897
/* 80AAEDB8 */ void afterJntAnm(int);
2998
/* 80AAEE44 */ void setParam();
30-
/* 80AAEFB4 */ void checkChangeEvt();
99+
/* 80AAEFB4 */ BOOL checkChangeEvt();
31100
/* 80AAF148 */ void setAfterTalkMotion();
32101
/* 80AAF1F0 */ void srchActors();
33-
/* 80AAF1F4 */ void evtTalk();
34-
/* 80AAF294 */ void evtCutProc();
102+
/* 80AAF1F4 */ BOOL evtTalk();
103+
/* 80AAF294 */ BOOL evtCutProc();
35104
/* 80AAF35C */ void action();
36105
/* 80AAF4F8 */ void beforeMove();
37106
/* 80AAF5BC */ void setAttnPos();
38107
/* 80AAF8E4 */ void setCollision();
39-
/* 80AAFA5C */ bool drawDbgInfo();
108+
/* 80AAFA5C */ int drawDbgInfo();
40109
/* 80AAFA64 */ void drawOtherMdl();
41-
/* 80AAFB4C */ void afterSetMotionAnm(int, int, f32, int);
42-
/* 80AAFBDC */ void selectAction();
43-
/* 80AAFC24 */ void chkAction(int (daNpc_Pouya_c::*)(void*));
44-
/* 80AAFC50 */ void setAction(int (daNpc_Pouya_c::*)(void*));
110+
/* 80AAFB4C */ bool afterSetMotionAnm(int, int, f32, int);
111+
/* 80AAFBDC */ int selectAction();
112+
/* 80AAFC24 */ BOOL chkAction(int (daNpc_Pouya_c::*)(void*));
113+
/* 80AAFC50 */ int setAction(int (daNpc_Pouya_c::*)(void*));
45114
/* 80AAFCF8 */ void setPrtcls();
46-
/* 80AAFE08 */ void cutHaveFavorToAsk(int);
47-
/* 80AB04A8 */ void wait(void*);
48-
/* 80AB0A7C */ void talk(void*);
49-
/* 80AB1E94 */ daNpc_Pouya_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
50-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
51-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
52-
daNpcT_evtData_c const*, char**);
53-
/* 80AB1F54 */ u16 getEyeballMaterialNo();
54-
/* 80AB1F5C */ s32 getHeadJointNo();
55-
/* 80AB1F64 */ s32 getNeckJointNo();
56-
/* 80AB1F6C */ bool getBackboneJointNo();
57-
/* 80AB1F74 */ void checkChangeJoint(int);
58-
/* 80AB1F84 */ void checkRemoveJoint(int);
59-
60-
MtxP getHeadMtx() { return mpMorf->getModel()->getAnmMtx(4); }
115+
/* 80AAFE08 */ int cutHaveFavorToAsk(int);
116+
/* 80AB04A8 */ int wait(void*);
117+
/* 80AB0A7C */ int talk(void*);
118+
/* 80AB1E94 */ daNpc_Pouya_c(
119+
daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
120+
daNpcT_motionAnmData_c const* i_motionAnmData,
121+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
122+
int i_faceMotionStepNum,
123+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
124+
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
125+
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
126+
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
127+
i_arcNames) {}
128+
/* 80AB1F54 */ u16 getEyeballMaterialNo() { return 1; }
129+
/* 80AB1F5C */ s32 getHeadJointNo() { return 4; }
130+
/* 80AB1F64 */ s32 getNeckJointNo() { return 3; }
131+
/* 80AB1F6C */ s32 getBackboneJointNo() { return 1; }
132+
/* 80AB1F74 */ BOOL checkChangeJoint(int i_joint) { return i_joint == 4; }
133+
/* 80AB1F84 */ BOOL checkRemoveJoint(int i_joint) { return i_joint == 8; }
61134

62-
static char* mCutNameList[3];
63-
static u8 mCutList[36];
135+
u8 getBitSW() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }
64136

65-
private:
66-
/* 0x568 */ u8 field_0x568[0x578 - 0x568];
67-
/* 0x578 */ mDoExt_McaMorfSO* mpMorf;
68-
/* 0x57C */ u8 field_0x57c[0xfd4 - 0x57c];
69-
};
137+
int getFlowNodeNo() {
138+
u16 nodeNo = home.angle.x;
139+
if (nodeNo == 0xffff) {
140+
return -1;
141+
}
142+
return nodeNo;
143+
}
70144

71-
STATIC_ASSERT(sizeof(daNpc_Pouya_c) == 0xfd4);
145+
BOOL chkPouyaB() { return (mType == TYPE_2 || mType == TYPE_3 || mType == TYPE_4); }
72146

73-
class daNpc_Pouya_Param_c {
74-
public:
75-
/* 80AB1F94 */ ~daNpc_Pouya_Param_c();
147+
MtxP getHeadMtx() { return mpMorf[0]->getModel()->getAnmMtx(4); }
148+
149+
static char* mCutNameList[3];
150+
static cutFunc mCutList[3];
76151

77-
static u8 const m[140];
152+
private:
153+
/* 0xE40 */ NPC_POUYA_HIO_CLASS* mpHIO;
154+
/* 0xE44 */ J3DModel* mpModel[1];
155+
/* 0xE48 */ dCcD_Cyl mCyl;
156+
/* 0xF84 */ u8 mType;
157+
/* 0xF88 */ daNpcT_Path_c mPath;
158+
/* 0xFB0 */ actionFunc field_0xfb0;
159+
/* 0xFBC */ actionFunc mAction;
160+
/* 0xFC8 */ u32 field_0xfc8;
161+
/* 0xFCC */ s8 field_0xfcc;
162+
/* 0xFCD */ s8 field_0xfcd;
163+
/* 0xFCE */ u8 field_0xfce;
164+
/* 0xFCF */ u8 field_0xfcf;
165+
/* 0xFD0 */ u8 field_0xfd0;
78166
};
79167

168+
STATIC_ASSERT(sizeof(daNpc_Pouya_c) == 0xfd4);
80169

81170
#endif /* D_A_NPC_POUYA_H */

include/m_Do/m_Do_graphic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class mDoGph_gInf_c {
6969
static void endFrame() { JFWDisplay::getManager()->endFrame(); }
7070
static void offFade() { mFade = 0; }
7171
static u8 isFade() { return mFade; }
72+
static void fadeIn_f(f32 i_fadeSpeed, _GXColor& i_fadeColor) { fadeOut_f(-i_fadeSpeed, i_fadeColor); }
7273
static void offBlure() { mBlureFlag = false; }
7374
static bool isBlure() { return mBlureFlag; }
7475
static void setBlureRate(u8 i_rate) { mBlureRate = i_rate; }

src/d/actor/d_a_npc_lud.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ enum FaceMotion {
9090
/* 0x07 */ FACE_MOT_UNK_7 = 7,
9191
/* 0x08 */ FACE_MOT_UNK_8 = 8,
9292
/* 0x09 */ FACE_MOT_UNK_9 = 9,
93+
/* 0x0A */ FACE_MOT_UNK_10 = 10,
9394
/* 0x0B */ FACE_MOT_UNK_11 = 11,
9495
/* 0x0C */ FACE_MOT_UNK_12 = 12,
9596
/* 0x0D */ FACE_MOT_UNK_13 = 13,
@@ -629,10 +630,10 @@ BOOL daNpc_Lud_c::checkChangeEvt() {
629630
/* 80A6BE6C-80A6BEE4 0013AC 0078+00 1/0 0/0 0/0 .text setAfterTalkMotion__11daNpc_Lud_cFv
630631
*/
631632
void daNpc_Lud_c::setAfterTalkMotion() {
632-
int iVar2 = MOT_UNK_18;
633+
int iVar2 = FACE_MOT_UNK_18;
633634
switch (mFaceMotionSeqMngr.getNo()) {
634-
case MOT_UNK_1:
635-
iVar2 = MOT_UNK_10;
635+
case FACE_MOT_UNK_1:
636+
iVar2 = FACE_MOT_UNK_10;
636637
break;
637638
}
638639
mFaceMotionSeqMngr.setNo(iVar2, -1.0f, 0, 0);

0 commit comments

Comments
 (0)