Skip to content

Commit 46a11f2

Browse files
authored
Several more TUs matching (#2601)
1 parent 0abe859 commit 46a11f2

17 files changed

+202
-277
lines changed

configure.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,7 @@ def MatchingFor(*versions) -> bool:
15791579
ActorRel(MatchingFor("GZ2E01"), "d_a_npc_besu"),
15801580
ActorRel(MatchingFor("GZ2E01"), "d_a_npc_fairy_seirei"),
15811581
ActorRel(MatchingFor("GZ2E01"), "d_a_npc_fish"),
1582-
ActorRel(Equivalent, "d_a_npc_henna"), # weak func order
1582+
ActorRel(MatchingFor("GZ2E01"), "d_a_npc_henna"),
15831583
ActorRel(NonMatching, "d_a_npc_kakashi"),
15841584
ActorRel(NonMatching, "d_a_npc_kkri"),
15851585
ActorRel(MatchingFor("GZ2E01"), "d_a_npc_kolin"),
@@ -1785,7 +1785,7 @@ def MatchingFor(*versions) -> bool:
17851785
ActorRel(NonMatching, "d_a_npc_ashB", extra_cflags=[DANPCF_C_HACK]),
17861786
ActorRel(NonMatching, "d_a_npc_bans"),
17871787
ActorRel(NonMatching, "d_a_npc_blue_ns"),
1788-
ActorRel(Equivalent, "d_a_npc_bou"), # weak func order
1788+
ActorRel(MatchingFor("GZ2E01"), "d_a_npc_bou"),
17891789
ActorRel(NonMatching, "d_a_npc_bouS"),
17901790
ActorRel(NonMatching, "d_a_npc_cdn3"),
17911791
ActorRel(NonMatching, "d_a_npc_chat"),
@@ -1886,7 +1886,7 @@ def MatchingFor(*versions) -> bool:
18861886
ActorRel(MatchingFor("GZ2E01"), "d_a_npc_zant"),
18871887
ActorRel(NonMatching, "d_a_npc_zelR"),
18881888
ActorRel(NonMatching, "d_a_npc_zelRo"),
1889-
ActorRel(Equivalent, "d_a_npc_zelda"), # weak function order
1889+
ActorRel(MatchingFor("GZ2E01"), "d_a_npc_zelda"),
18901890
ActorRel(NonMatching, "d_a_npc_zra", extra_cflags=[DANPCF_C_HACK]),
18911891
ActorRel(NonMatching, "d_a_npc_zrc", extra_cflags=[DANPCF_C_HACK]),
18921892
ActorRel(NonMatching, "d_a_npc_zrz", extra_cflags=[DANPCF_C_HACK]),
@@ -1904,7 +1904,7 @@ def MatchingFor(*versions) -> bool:
19041904
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_bbox"),
19051905
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_bed"),
19061906
ActorRel(NonMatching, "d_a_obj_bemos"),
1907-
ActorRel(Equivalent, "d_a_obj_bhbridge"), # vtable order
1907+
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_bhbridge"), # vtable order
19081908
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_bk_leaf"),
19091909
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_bky_rock"),
19101910
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_bmWindow"),
@@ -1916,7 +1916,7 @@ def MatchingFor(*versions) -> bool:
19161916
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_bubblePilar"),
19171917
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_catdoor"),
19181918
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_cb"),
1919-
ActorRel(Equivalent, "d_a_obj_cblock"), # unsure why this doesn't match, .rel files seem to be identical
1919+
ActorRel(Equivalent, "d_a_obj_cblock"), # weird weak data issue
19201920
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_cdoor"),
19211921
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_chandelier"),
19221922
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_chest"),
@@ -2117,7 +2117,7 @@ def MatchingFor(*versions) -> bool:
21172117
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_sekizo"),
21182118
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_sekizoa"),
21192119
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_shield"),
2120-
ActorRel(Equivalent, "d_a_obj_sm_door"), # vtable order
2120+
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_sm_door"),
21212121
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_smallkey"),
21222122
ActorRel(NonMatching, "d_a_obj_smgdoor"),
21232123
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_smoke"),
@@ -2140,7 +2140,7 @@ def MatchingFor(*versions) -> bool:
21402140
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_swBallC"),
21412141
ActorRel(NonMatching, "d_a_obj_swLight"),
21422142
ActorRel(NonMatching, "d_a_obj_swchain"),
2143-
ActorRel(Equivalent, "d_a_obj_swhang"), # weak func + vtable order
2143+
ActorRel(Equivalent, "d_a_obj_swhang"), # vtable order
21442144
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_sword"),
21452145
ActorRel(NonMatching, "d_a_obj_swpush2"),
21462146
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_swspinner"),

include/d/actor/d_a_npc_bou.h

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ class daNpc_Bou_c : public daNpcT_c {
112112
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8)
113113
{}
114114

115-
/* 809727D4 */ virtual int checkChangeJoint(int);
116-
/* 809727E4 */ virtual int checkRemoveJoint(int);
117-
/* 809727CC */ virtual s32 getBackboneJointNo();
118-
/* 809727C4 */ virtual s32 getNeckJointNo();
119-
/* 809727BC */ virtual s32 getHeadJointNo();
120-
/* 809727B4 */ virtual u16 getEyeballMaterialNo();
115+
/* 809727D4 */ virtual int checkChangeJoint(int param_0) { return param_0 == 4; }
116+
/* 809727E4 */ virtual int checkRemoveJoint(int param_0) { return param_0 == 8; }
117+
/* 809727CC */ virtual s32 getBackboneJointNo() { return 1; }
118+
/* 809727C4 */ virtual s32 getNeckJointNo() { return 3; }
119+
/* 809727BC */ virtual s32 getHeadJointNo() { return 4; }
120+
/* 809727B4 */ virtual u16 getEyeballMaterialNo() { return 1; }
121121
/* 8096DD44 */ virtual void afterJntAnm(int);
122122
/* 8096DDC8 */ virtual void setParam();
123123
/* 8096DF9C */ virtual BOOL checkChangeEvt();
@@ -205,38 +205,5 @@ class daNpc_Bou_c : public daNpcT_c {
205205

206206
STATIC_ASSERT(sizeof(daNpc_Bou_c) == 0xffc);
207207

208-
/* 809727B4-809727BC 005914 0008+00 1/0 0/0 0/0 .text getEyeballMaterialNo__11daNpc_Bou_cFv */
209-
u16 daNpc_Bou_c::getEyeballMaterialNo() {
210-
return 1;
211-
}
212-
213-
/* 809727BC-809727C4 00591C 0008+00 1/0 0/0 0/0 .text getHeadJointNo__11daNpc_Bou_cFv */
214-
s32 daNpc_Bou_c::getHeadJointNo() {
215-
return 4;
216-
}
217-
218-
/* 809727C4-809727CC 005924 0008+00 1/0 0/0 0/0 .text getNeckJointNo__11daNpc_Bou_cFv */
219-
s32 daNpc_Bou_c::getNeckJointNo() {
220-
return 3;
221-
}
222-
223-
/* 809727CC-809727D4 00592C 0008+00 1/0 0/0 0/0 .text getBackboneJointNo__11daNpc_Bou_cFv
224-
*/
225-
s32 daNpc_Bou_c::getBackboneJointNo() {
226-
return 1;
227-
}
228-
229-
/* 809727D4-809727E4 005934 0010+00 1/0 0/0 0/0 .text checkChangeJoint__11daNpc_Bou_cFi
230-
*/
231-
int daNpc_Bou_c::checkChangeJoint(int param_0) {
232-
return param_0 == 4;
233-
}
234-
235-
/* 809727E4-809727F4 005944 0010+00 1/0 0/0 0/0 .text checkRemoveJoint__11daNpc_Bou_cFi
236-
*/
237-
int daNpc_Bou_c::checkRemoveJoint(int param_0) {
238-
return param_0 == 8;
239-
}
240-
241208

242209
#endif /* D_A_NPC_BOU_H */

include/d/actor/d_a_npc_shad.h

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,23 @@
1010
*
1111
* @details
1212
*
13-
*/
13+
*/
14+
15+
struct daNpcShad_HIOParam {
16+
/* 0x00 */ daNpcF_HIOParam common;
17+
/* 0x6C */ f32 traveling_speed; // 走行速度 (Traveling Speed)
18+
};
19+
20+
class daNpcShad_Param_c: public JORReflexible {
21+
public:
22+
/* 80AE1F70 */ virtual ~daNpcShad_Param_c() {}
23+
24+
#ifdef DEBUG
25+
void genMessage(JORMContext*);
26+
#endif
27+
28+
static const daNpcShad_HIOParam m;
29+
};
1430

1531
class daNpcShad_c : public daNpcF_c {
1632
public:
@@ -113,7 +129,7 @@ class daNpcShad_c : public daNpcF_c {
113129
};
114130

115131
/* 80AD820C */ daNpcShad_c();
116-
/* 80AD8420 */ ~daNpcShad_c();
132+
/* 80AD8420 */ virtual ~daNpcShad_c();
117133
/* 80AD8620 */ cPhs__Step Create();
118134
/* 80AD8B60 */ int CreateHeap();
119135
/* 80AD90E0 */ int Delete();
@@ -163,7 +179,7 @@ class daNpcShad_c : public daNpcF_c {
163179
u8 getPathID() { return (fopAcM_GetParam(this) >> 8) & 0xFF; }
164180
s16 getMessageNo() { return shape_angle.x; }
165181

166-
inline void setAction(ActionFn action) {
182+
void setAction(ActionFn action) {
167183
field_0xe1a = 3;
168184

169185
if (mActionFn) {
@@ -178,14 +194,14 @@ class daNpcShad_c : public daNpcF_c {
178194
}
179195
}
180196

181-
inline csXyz* unk_inline();
182-
inline BOOL chkFindPlayer();
183-
inline void setLookMode(int, fopAc_ac_c*, cXyz*);
184-
inline BOOL step(s16, int, f32);
185-
inline void setExpressionTalkAfter();
186-
inline void setLookObliquenessUp();
197+
csXyz* unk_inline();
198+
BOOL chkFindPlayer();
199+
void setLookMode(int, fopAc_ac_c*, cXyz*);
200+
BOOL step(s16, int, f32);
201+
void setExpressionTalkAfter();
202+
void setLookObliquenessUp();
187203

188-
inline void searchActors() {
204+
void searchActors() {
189205
if (mMode == 0) {
190206
if (mActorMngr[1].getActorP() == NULL) {
191207
mActorMngr[1].entry(fopAcM_SearchByName(PROC_NPC_ASH));

include/d/actor/d_a_npc_zelda.h

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,9 @@
33

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

6-
class daNpc_Zelda_HIOParam {
7-
public:
8-
/* 0x00 */ daNpcT_HIOParam common;
9-
};
10-
11-
STATIC_ASSERT(sizeof(daNpc_Zelda_HIOParam) == 0x8c);
12-
13-
class daNpc_Zelda_Param_c {
14-
public:
15-
/* 80B77F5C */ virtual ~daNpc_Zelda_Param_c();
16-
17-
static const daNpc_Zelda_HIOParam m;
18-
};
19-
20-
class daNpc_Zelda_HIO_c
21-
#if DEBUG
22-
: public mDoHIO_entry_c
23-
#endif
24-
{
25-
public:
26-
daNpc_Zelda_HIO_c();
27-
28-
void genMessage(JORMContext* ctx);
29-
void listenPropertyEvent(const JORPropertyEvent*);
30-
31-
#if DEBUG
32-
daNpc_Zelda_HIOParam param;
33-
#endif
34-
};
35-
6+
class daNpc_Zelda_HIO_c;
367
class daNpc_Zelda_c;
378

38-
typedef int (daNpc_Zelda_c::*cutFunc)(int);
39-
typedef int (daNpc_Zelda_c::*actionFunc)(void*);
40-
419
/**
4210
* @ingroup actors-npcs
4311
* @class daNpc_Zelda_c
@@ -48,6 +16,9 @@ typedef int (daNpc_Zelda_c::*actionFunc)(void*);
4816
*/
4917
class daNpc_Zelda_c : public daNpcT_c {
5018
public:
19+
typedef int (daNpc_Zelda_c::*cutFunc)(int);
20+
typedef int (daNpc_Zelda_c::*actionFunc)(void*);
21+
5122
/* 80B7512C */ virtual ~daNpc_Zelda_c();
5223
u8 getPathID() {
5324
return (fopAcM_GetParam(this) & 0xff00) >> 8;
@@ -84,17 +55,22 @@ class daNpc_Zelda_c : public daNpcT_c {
8455
/* 80B767F0 */ BOOL setAction(actionFunc);
8556
/* 80B76898 */ int wait(void*);
8657
/* 80B76B74 */ int talk(void*);
87-
/* 80B77DD8 */ daNpc_Zelda_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
88-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
89-
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
90-
daNpcT_evtData_c const*, char**);
91-
/* 80B77F14 */ u16 getEyeballRMaterialNo();
92-
/* 80B77F1C */ u16 getEyeballLMaterialNo();
93-
/* 80B77F24 */ s32 getHeadJointNo();
94-
/* 80B77F2C */ s32 getNeckJointNo();
95-
/* 80B77F34 */ s32 getBackboneJointNo();
96-
/* 80B77F3C */ int checkChangeJoint(int);
97-
/* 80B77F4C */ int checkRemoveJoint(int);
58+
/* 80B77DD8 */ daNpc_Zelda_c(daNpcT_faceMotionAnmData_c const* param_0,
59+
daNpcT_motionAnmData_c const* param_1,
60+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_2,
61+
int param_3,
62+
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_4,
63+
int param_5, daNpcT_evtData_c const* param_6, char** param_7) :
64+
daNpcT_c(param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7) {
65+
OS_REPORT("|%06d:%x|daNpc_Zelda_c -> コンストラクト\n", g_Counter.mCounter0, this);
66+
}
67+
/* 80B77F14 */ u16 getEyeballRMaterialNo() { return 5; }
68+
/* 80B77F1C */ u16 getEyeballLMaterialNo() { return 4; }
69+
/* 80B77F24 */ s32 getHeadJointNo() { return 4; }
70+
/* 80B77F2C */ s32 getNeckJointNo() { return 3; }
71+
/* 80B77F34 */ s32 getBackboneJointNo() { return 1; }
72+
/* 80B77F3C */ int checkChangeJoint(int param_0) { return param_0 == 4; }
73+
/* 80B77F4C */ int checkRemoveJoint(int param_0) { return param_0 == 17; }
9874

9975
static const char* mCutNameList;
10076
static cutFunc mCutList[1];
@@ -110,4 +86,34 @@ class daNpc_Zelda_c : public daNpcT_c {
11086

11187
STATIC_ASSERT(sizeof(daNpc_Zelda_c) == 0xfa0);
11288

89+
class daNpc_Zelda_HIOParam {
90+
public:
91+
/* 0x00 */ daNpcT_HIOParam common;
92+
};
93+
94+
STATIC_ASSERT(sizeof(daNpc_Zelda_HIOParam) == 0x8c);
95+
96+
class daNpc_Zelda_Param_c {
97+
public:
98+
/* 80B77F5C */ virtual ~daNpc_Zelda_Param_c() {}
99+
100+
static const daNpc_Zelda_HIOParam m;
101+
};
102+
103+
class daNpc_Zelda_HIO_c
104+
#if DEBUG
105+
: public mDoHIO_entry_c
106+
#endif
107+
{
108+
public:
109+
daNpc_Zelda_HIO_c();
110+
111+
void genMessage(JORMContext* ctx);
112+
void listenPropertyEvent(const JORPropertyEvent*);
113+
114+
#if DEBUG
115+
daNpc_Zelda_HIOParam param;
116+
#endif
117+
};
118+
113119
#endif /* D_A_NPC_ZELDA_H */

include/d/dolzel_base.pch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
#include "Z2AudioLib/Z2Calc.h" // IWYU pragma: export
1111

1212
// Fixes weak function ordering
13+
#include "cmath.h"
1314
#include "string.h"
1415
#include "d/d_com_inf_game.h" // IWYU pragma: export
1516
#include "d/d_bg_w.h" // IWYU pragma: export
17+
#include "m_Do/m_Do_graphic.h" // IWYU pragma: export
1618
#include "JSystem/J2DGraph/J2DOrthograph.h" // IWYU pragma: export
1719
#include "JSystem/J2DGraph/J2DPane.h" // IWYU pragma: export
1820
#include "JSystem/J2DGraph/J2DPictureEx.h" // IWYU pragma: export

include/d/dolzel_rel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define DOLZEL_REL_H
33

44
// PCH breaks debug build for RELs right now
5-
#if __MWERKS__ && !DEBUG
5+
#if __MWERKS__
66
#include "d/dolzel_rel.mch"
77
#else
88
#include "d/dolzel_rel.pch"

src/d/actor/d_a_e_wb.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
#include "dol2asm.h"
1212
#include "m_Do/m_Do_graphic.h"
1313

14-
namespace std {
15-
/* 807E2350 */ void fabsf(f32);
16-
};
17-
18-
19-
20-
21-
2214
//
2315
// Forward References:
2416
//

src/d/actor/d_a_npc_henna.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ static int daNpc_Henna_Draw(npc_henna_class* i_this) {
170170
return 1;
171171
}
172172

173-
// needed for matching .rodata, maybe from a stripped method?
173+
// needed for matching .rodata + weak func order, probably from a stripped method?
174+
175+
static f32 dummy_dt_cxyz() {
176+
cXyz xyz(0.0f, 0.0f, 0.0f);
177+
return xyz.x;
178+
}
174179

175180
static f32 dummy_100() {
176181
return 100.0f;
@@ -180,32 +185,32 @@ static f32 dummy_30() {
180185
return 30.0f;
181186
}
182187

183-
static f32 dummy__30() {
188+
static f32 dummy_m30() {
184189
return -30.0f;
185190
}
186191

187-
static f32 dummy__100() {
192+
static f32 dummy_m100() {
188193
return -100.0f;
189194
}
190195

191196
static f32 dummy_300() {
192197
return 300.0f;
193198
}
194199

195-
static f32 dummy__450() {
200+
static f32 dummy_m450() {
196201
return -450.0f;
197202
}
198203

199204
static f32 dummy_0_8() {
200205
return 0.8f;
201206
}
202207

203-
static f32 dummy__300() {
208+
static f32 dummy_m300() {
204209
return -300.0f;
205210
}
206211

207-
static cM3dGPla dummy_cM3dGPla() {
208-
return cM3dGPla();
212+
static void dummy_dt_cm3dgpla() {
213+
delete (cM3dGPla*)NULL;
209214
}
210215

211216
/* 80543544-805436CC 000724 0188+00 1/1 0/0 0/0 .text s_npc_sub__FPvPv */

0 commit comments

Comments
 (0)