Skip to content

Commit ddf4fc0

Browse files
authored
Misc framework fixes (#2578)
1 parent 8785882 commit ddf4fc0

File tree

15 files changed

+369
-257
lines changed

15 files changed

+369
-257
lines changed

configure.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ def MatchingFor(*versions) -> bool:
432432
Object(MatchingFor("GZ2E01", "GZ2J01"), "m_Do/m_Do_audio.cpp"),
433433
Object(MatchingFor("GZ2E01", "GZ2J01"), "m_Do/m_Do_controller_pad.cpp"),
434434
Object(NonMatching, "m_Do/m_Re_controller_pad.cpp"),
435-
Object(Equivalent, "m_Do/m_Do_graphic.cpp"), # weak func order
435+
Object(MatchingFor("GZ2E01"), "m_Do/m_Do_graphic.cpp"),
436436
Object(NonMatching, "m_Do/m_Do_machine.cpp"),
437-
Object(MatchingFor("GZ2E01", "GZ2J01"), "m_Do/m_Do_mtx.cpp", extra_cflags=["-sym off"]),
437+
Object(MatchingFor("GZ2E01", "GZ2J01"), "m_Do/m_Do_mtx.cpp"),
438438
Object(NonMatching, "m_Do/m_Do_ext.cpp"),
439439
Object(MatchingFor("GZ2E01", "GZ2J01"), "m_Do/m_Do_lib.cpp"),
440440
Object(MatchingFor("GZ2E01", "GZ2J01"), "m_Do/m_Do_Reset.cpp"),
@@ -564,7 +564,7 @@ def MatchingFor(*versions) -> bool:
564564
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_particle_name.cpp"),
565565
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_particle_copoly.cpp"),
566566
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_path.cpp"),
567-
Object(NonMatching, "d/d_drawlist.cpp"),
567+
Object(Equivalent, "d/d_drawlist.cpp", extra_cflags=['-pragma "nosyminline on"']),
568568
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_kankyo_data.cpp"),
569569
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_kankyo_wether.cpp"),
570570
Object(NonMatching, "d/d_kankyo_rain.cpp"),
@@ -591,7 +591,7 @@ def MatchingFor(*versions) -> bool:
591591
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_bg_w_base.cpp", extra_cflags=['-pragma "nosyminline on"']),
592592
Object(NonMatching, "d/d_bg_w_kcol.cpp"),
593593
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_bg_w_sv.cpp"),
594-
Object(Equivalent, "d/d_cc_d.cpp"), # weak func order
594+
Object(Equivalent, "d/d_cc_d.cpp", extra_cflags=['-sym off']), # weak func order
595595
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_cc_mass_s.cpp", extra_cflags=['-pragma "nosyminline on"']),
596596
Object(NonMatching, "d/d_cc_s.cpp"),
597597
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_cc_uty.cpp"),
@@ -658,7 +658,7 @@ def MatchingFor(*versions) -> bool:
658658
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_meter_map.cpp"),
659659
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_meter_string.cpp"),
660660
Object(MatchingFor("GZ2E01"), "d/d_meter2_draw.cpp"),
661-
Object(Equivalent, "d/d_meter2_info.cpp"),
661+
Object(MatchingFor("GZ2E01"), "d/d_meter2_info.cpp", extra_cflags=['-pragma "nosyminline on"']),
662662
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_meter2.cpp"),
663663
Object(MatchingFor("GZ2E01"), "d/d_msg_out_font.cpp"),
664664
Object(NonMatching, "d/d_msg_class.cpp"),

include/JSystem/J2DGraph/J2DAnimation.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class J2DAnmBase {
3131
mFrameMax = 0;
3232
}
3333
/* 80053C94 */ virtual ~J2DAnmBase() {}
34+
// this is supposed to be inline, but doing so causes problems
35+
// with where the vtable is placed in the final framework.dol
3436
/* 800569B0 */ virtual void searchUpdateMaterialID(J2DScreen*);
3537

3638
s16 getFrameMax() const { return mFrameMax; }

include/SSystem/SComponent/c_cc_d.h

Lines changed: 202 additions & 174 deletions
Large diffs are not rendered by default.

include/SSystem/SComponent/c_m3d_g_sph.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class cM3dGSph {
3333
void GetMinMaxCube(cXyz&, cXyz&) const;
3434
const cXyz& GetC(void) const { return mCenter; }
3535
const cXyz* GetCP() const { return &mCenter; }
36+
cXyz* GetCP() { return &mCenter; }
3637
const f32 GetR(void) const { return mRadius; }
3738
f32 GetCX(void) const { return mCenter.x; }
3839
f32 GetCY(void) const { return mCenter.y; }
@@ -50,4 +51,4 @@ extern "C" {
5051
void Set__8cM3dGSphFRC4cXyzf(void);
5152
}
5253

53-
#endif
54+
#endif

include/d/actor/d_a_npc_kolin.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ class daNpc_Kolin_c : public daNpcT_c {
6767
/* 80558AF8 */ int follow(void*);
6868
/* 80558C4C */ int clothWait(void*);
6969
/* 80558E90 */ int talk(void*);
70+
#if DEBUG
71+
int test(void*);
72+
#endif
7073
/* 8055A3B8 */ daNpc_Kolin_c(
7174
daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
7275
daNpcT_motionAnmData_c const* i_motionAnmData,

include/d/actor/d_a_npc_kolinb.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ class daNpc_Kolinb_c : public daNpcT_c {
115115
/* 80A4738C */ int cutThankYou(int);
116116
/* 80A4742C */ int wait(void*);
117117
/* 80A475D4 */ int talk(void*);
118+
#if DEBUG
119+
int test(void*);
120+
#endif
118121
/* 80A4854C */ daNpc_Kolinb_c(
119122
daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
120123
daNpcT_motionAnmData_c const* i_motionAnmData,

include/d/actor/d_a_npc_saru.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@
1212
*
1313
*/
1414

15-
struct daNpc_Saru_HIO_c
16-
#ifdef DEBUG
17-
: public mDoHIO_entry_c
18-
#endif
15+
struct daNpc_Saru_HIOParam
1916
{
20-
public:
17+
2118
/* 0x00 */ daNpcT_HIOParam common;
2219
/* 0x8C */ s16 scared_time; // 怯える時間 - Scared Time
2320
/* 0x8E */ s16 field_0x8e;
@@ -31,7 +28,12 @@ class daNpc_Saru_Param_c : public JORReflexible {
3128
void genMessage(JORMContext*);
3229
#endif
3330

34-
static const daNpc_Saru_HIO_c m;
31+
static const daNpc_Saru_HIOParam m;
32+
};
33+
34+
class daNpc_Saru_HIO_c : public mDoHIO_entry_c {
35+
public:
36+
daNpc_Saru_HIOParam param;
3537
};
3638

3739
class daNpc_Saru_c : public daNpcT_c {

include/d/actor/d_a_npc_ykm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ struct daNpc_ykM_HIOParam {
3838

3939
class daNpc_ykM_Param_c : public JORReflexible {
4040
public:
41+
#if DEBUG
42+
virtual void genMessage(JORMContext*);
43+
#endif
44+
4145
/* 80B5D6C8 */ virtual ~daNpc_ykM_Param_c() {}
4246

4347
void genMessage(JORMContext*);

include/d/d_cc_d.h

Lines changed: 79 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -109,56 +109,13 @@ struct dCcD_SrcCps {
109109
/* 0x30 */ cCcD_SrcCpsAttr mCpsAttr;
110110
}; // Size: 0x4C
111111

112-
class dCcD_GStts : public cCcD_GStts {
113-
public:
114-
/* 80083760 */ dCcD_GStts();
115-
/* 800837F8 */ void Ct();
116-
/* 80083830 */ void Move();
117-
/* 8008523C */ virtual ~dCcD_GStts() {}
118-
void ClrAt() { mAt = 0; }
119-
void ClrTg() { mTg = 0; }
120-
void SetAtApid(fpc_ProcID id) { mAtApid = id; }
121-
void SetTgApid(fpc_ProcID id) { mTgApid = id; }
122-
u8 GetRoomId() { return mRoomId; }
123-
void SetRoomId(int id) { mRoomId = id; }
124-
fpc_ProcID GetAtOldApid() { return mAtOldApid; }
125-
fpc_ProcID GetTgOldApid() { return mTgOldApid; }
126-
bool ChkNoActor() { return field_0x1C & 1;}
127-
bool ChkNoneActorPerfTblId() { return field_0x08 == 0xFFFF; }
128-
dCcG_At_Spl GetAtSpl() { return (dCcG_At_Spl)mAt; }
129-
void SetAtSpl(dCcG_At_Spl spl) { mAt = spl; }
130-
dCcG_Tg_Spl GetTgSpl() { return (dCcG_Tg_Spl)mTg; }
131-
void SetTgSpl(dCcG_Tg_Spl spl) { mTg = spl; }
132-
void OnNoActor() { field_0x1C |= 1; }
133-
134-
// private:
135-
/* 0x04 */ u8 mAt;
136-
/* 0x05 */ u8 mTg;
137-
/* 0x06 */ u8 mRoomId;
138-
/* 0x08 */ u16 field_0x08;
139-
/* 0x0C */ int mAtApid;
140-
/* 0x10 */ int mAtOldApid;
141-
/* 0x14 */ int mTgApid;
142-
/* 0x18 */ int mTgOldApid;
143-
/* 0x1C */ int field_0x1C;
144-
}; // Size = 0x20
145-
146-
class dCcD_Stts : public cCcD_Stts, public dCcD_GStts {
147-
public:
148-
dCcD_Stts() {}
149-
/* 80083850 */ virtual cCcD_GStts* GetGStts();
150-
/* 80083860 */ void Init(int weight, int, fopAc_ac_c* pactor);
151-
/* 800838F4 */ virtual void Ct();
152-
/* 80083928 */ virtual void ClrAt();
153-
/* 80083934 */ virtual void ClrTg();
154-
/* 800851AC */ virtual ~dCcD_Stts() {}
155-
156-
}; // Size = 0x3C
112+
// unused, existence is inferred
113+
struct dCcD_SrcPnt {
114+
};
157115

158116
class dCcD_GObjInf;
159117
typedef void (*dCcD_HitCallback)(fopAc_ac_c* i_actorA, dCcD_GObjInf* i_objInfA, fopAc_ac_c* i_actorB, dCcD_GObjInf* i_objInfB);
160118

161-
162119
// Attack/Defense/Correction Collider Common Base
163120
class dCcD_GAtTgCoCommonBase {
164121
public:
@@ -272,6 +229,52 @@ class dCcD_GObjCo : public dCcD_GAtTgCoCommonBase {
272229
void Set(dCcD_SrcGObjCo const& pSrc) { dCcD_GAtTgCoCommonBase::Set(pSrc.mBase); }
273230
}; // Size = 0x1C ?
274231

232+
class dCcD_GStts : public cCcD_GStts {
233+
public:
234+
/* 80083760 */ dCcD_GStts();
235+
/* 800837F8 */ void Ct();
236+
/* 80083830 */ void Move();
237+
/* 8008523C */ virtual ~dCcD_GStts() {}
238+
void ClrAt() { mAt = 0; }
239+
void ClrTg() { mTg = 0; }
240+
void SetAtApid(fpc_ProcID id) { mAtApid = id; }
241+
void SetTgApid(fpc_ProcID id) { mTgApid = id; }
242+
u8 GetRoomId() { return mRoomId; }
243+
void SetRoomId(int id) { mRoomId = id; }
244+
fpc_ProcID GetAtOldApid() { return mAtOldApid; }
245+
fpc_ProcID GetTgOldApid() { return mTgOldApid; }
246+
bool ChkNoActor() { return field_0x1C & 1;}
247+
bool ChkNoneActorPerfTblId() { return field_0x08 == 0xFFFF; }
248+
dCcG_At_Spl GetAtSpl() { return (dCcG_At_Spl)mAt; }
249+
void SetAtSpl(dCcG_At_Spl spl) { mAt = spl; }
250+
dCcG_Tg_Spl GetTgSpl() { return (dCcG_Tg_Spl)mTg; }
251+
void SetTgSpl(dCcG_Tg_Spl spl) { mTg = spl; }
252+
void OnNoActor() { field_0x1C |= 1; }
253+
254+
// private:
255+
/* 0x04 */ u8 mAt;
256+
/* 0x05 */ u8 mTg;
257+
/* 0x06 */ u8 mRoomId;
258+
/* 0x08 */ u16 field_0x08;
259+
/* 0x0C */ int mAtApid;
260+
/* 0x10 */ int mAtOldApid;
261+
/* 0x14 */ int mTgApid;
262+
/* 0x18 */ int mTgOldApid;
263+
/* 0x1C */ int field_0x1C;
264+
}; // Size = 0x20
265+
266+
class dCcD_Stts : public cCcD_Stts, public dCcD_GStts {
267+
public:
268+
dCcD_Stts() {}
269+
/* 80083850 */ virtual cCcD_GStts* GetGStts();
270+
/* 80083860 */ void Init(int weight, int, fopAc_ac_c* pactor);
271+
/* 800838F4 */ virtual void Ct();
272+
/* 80083928 */ virtual void ClrAt();
273+
/* 80083934 */ virtual void ClrTg();
274+
/* 800851AC */ virtual ~dCcD_Stts() {}
275+
276+
}; // Size = 0x3C
277+
275278
// Object Info
276279
class dCcD_GObjInf : public cCcD_GObjInf {
277280
public:
@@ -420,6 +423,36 @@ class dCcD_GObjInf : public cCcD_GObjInf {
420423
/* 0x0E8 */ dCcD_GObjCo mGObjCo;
421424
}; // Size = 0x104
422425

426+
// Point (unused, existence is inferred)
427+
// Including this definition (and its GetShapeAttr impl) causes functions
428+
// from cCcD_PntAttr to be emitted in debug, matching what's seen in ShieldD.
429+
class dCcD_Pnt : public dCcD_GObjInf, public cCcD_PntAttr {
430+
public:
431+
/* 80084814 */ cCcD_ShapeAttr* GetShapeAttr();
432+
/* 8008506C */ virtual ~dCcD_Pnt() {}
433+
dCcD_Pnt() {}
434+
}; // Size = 0x144
435+
436+
// Capsule
437+
class dCcD_Cps : public dCcD_GObjInf, public cCcD_CpsAttr {
438+
public:
439+
/* 800847D0 */ void Set(dCcD_SrcCps const&);
440+
/* 80084814 */ cCcD_ShapeAttr* GetShapeAttr();
441+
/* 80084824 */ void CalcAtVec();
442+
/* 80084854 */ void CalcTgVec();
443+
/* 8008506C */ virtual ~dCcD_Cps() {}
444+
dCcD_Cps() {}
445+
}; // Size = 0x144
446+
447+
// Triangle
448+
class dCcD_Tri : public dCcD_GObjInf, public cCcD_TriAttr {
449+
public:
450+
/* 80084884 */ void Set(dCcD_SrcTri const&);
451+
/* 800848A4 */ cCcD_ShapeAttr* GetShapeAttr();
452+
/* 80084EF4 */ virtual ~dCcD_Tri() {}
453+
dCcD_Tri() {}
454+
};
455+
423456
// Cylinder
424457
class dCcD_Cyl : public dCcD_GObjInf, public cCcD_CylAttr {
425458
public:
@@ -443,27 +476,6 @@ class dCcD_Sph : public dCcD_GObjInf, public cCcD_SphAttr {
443476
/* 80084BF4 */ virtual ~dCcD_Sph() {}
444477
}; // Size = 0x138
445478

446-
447-
// Capsule
448-
class dCcD_Cps : public dCcD_GObjInf, public cCcD_CpsAttr {
449-
public:
450-
/* 800847D0 */ void Set(dCcD_SrcCps const&);
451-
/* 80084814 */ cCcD_ShapeAttr* GetShapeAttr();
452-
/* 80084824 */ void CalcAtVec();
453-
/* 80084854 */ void CalcTgVec();
454-
/* 8008506C */ virtual ~dCcD_Cps() {}
455-
dCcD_Cps() {}
456-
}; // Size = 0x144
457-
458-
// Triangle
459-
class dCcD_Tri : public dCcD_GObjInf, public cCcD_TriAttr {
460-
public:
461-
/* 80084884 */ void Set(dCcD_SrcTri const&);
462-
/* 800848A4 */ cCcD_ShapeAttr* GetShapeAttr();
463-
/* 80084EF4 */ virtual ~dCcD_Tri() {}
464-
dCcD_Tri() {}
465-
};
466-
467479
dCcD_GObjInf* dCcD_GetGObjInf(cCcD_Obj* param_0);
468480

469481
#endif /* D_CC_D_CC_D_H */

include/m_Do/m_Do_graphic.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
#include "JSystem/JFramework/JFWDisplay.h"
55
#include "dolphin/mtx.h"
66
#include "global.h"
7+
// Possibly fakematch?
8+
// Using `sym off` for this header fixes cXyz::~cXyz being incorrectly placed in
9+
// a separate .text section.
10+
#pragma sym off
11+
#include "SSystem/SComponent/c_xyz.h"
12+
#pragma sym on
713

814
int mDoGph_Create();
915
void mDoGph_drawFilterQuad(s8 param_0, s8 param_1);
@@ -176,6 +182,9 @@ class mDoGph_gInf_c {
176182
static u8 mFade;
177183

178184
#if PLATFORM_WII || PLATFORM_SHIELD
185+
static cXyz m_nowEffPos;
186+
static cXyz m_oldEffPos;
187+
static cXyz m_oldOldEffPos;
179188
static u8 mWide;
180189
static ResTIMG* m_fullFrameBufferTimg;
181190
static void* m_fullFrameBufferTex;

0 commit comments

Comments
 (0)