Skip to content

Commit d22dccd

Browse files
committed
Misc. framework/d/ improvements
1 parent 3caf422 commit d22dccd

File tree

13 files changed

+209
-205
lines changed

13 files changed

+209
-205
lines changed

config/GZ2E01/symbols.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,7 @@ drawDoorCommon__19renderingPlusDoor_cFPC21stage_tgsc_data_classib = .text:0x8004
20312031
checkDispDoorS__19renderingPlusDoor_cFiif = .text:0x80040710; // type:function size:0x128 scope:global align:4
20322032
drawNormalDoorS__19renderingPlusDoor_cFPC21stage_tgsc_data_classiib = .text:0x80040838; // type:function size:0x17C scope:global align:4
20332033
isDrawRoomIcon__16renderingDAmap_cCFii = .text:0x800409B4; // type:function size:0x2C scope:global align:4
2034-
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siibbPC3Vec = .text:0x800409E0; // type:function size:0xB4 scope:global align:4
2034+
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siiibPC3Vec = .text:0x800409E0; // type:function size:0xB4 scope:global align:4
20352035
getFirstData__28renderingPlusDoorAndCursor_cFUc = .text:0x80040A94; // type:function size:0x24 scope:global align:4
20362036
getNextData__28renderingPlusDoorAndCursor_cFPQ27dTres_c15typeGroupData_c = .text:0x80040AB8; // type:function size:0x24 scope:global align:4
20372037
getIconPosition__28renderingPlusDoorAndCursor_cCFPQ27dTres_c15typeGroupData_c = .text:0x80040ADC; // type:function size:0x8 scope:global align:4
@@ -21819,7 +21819,8 @@ m_mode__7dDemo_c = .sbss:0x80450E38; // type:object size:0x4 scope:global align:
2181921819
m_status__7dDemo_c = .sbss:0x80450E3C; // type:object size:0x4 scope:global align:4 data:4byte
2182021820
m_branchType__7dDemo_c = .sbss:0x80450E40; // type:object size:0x2 scope:global align:2 data:2byte
2182121821
m_branchData__7dDemo_c = .sbss:0x80450E44; // type:object size:0x4 scope:global align:4 data:4byte
21822-
struct_80450E48 = .sbss:0x80450E48; // type:object size:0x4 scope:local align:4 data:byte
21822+
init$1867 = .sbss:0x80450E48; // type:object size:0x1 scope:local align:1 data:byte
21823+
init$1870 = .sbss:0x80450E49; // type:object size:0x1 scope:local align:1 data:byte
2182321824
it = .sbss:0x80450E4C; // type:object size:0x4 scope:local align:4 data:4byte
2182421825
init$1672 = .sbss:0x80450E50; // type:object size:0x1 scope:local align:1 data:byte
2182521826
mNowStayFloorNo__10dMapInfo_c = .sbss:0x80450E58; // type:object size:0x1 scope:global align:1 data:byte

config/GZ2J01/symbols.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ drawDoorCommon__19renderingPlusDoor_cFPC21stage_tgsc_data_classib = .text:0x8004
20332033
checkDispDoorS__19renderingPlusDoor_cFiif = .text:0x80040710; // type:function size:0x128 scope:global align:4
20342034
drawNormalDoorS__19renderingPlusDoor_cFPC21stage_tgsc_data_classiib = .text:0x80040838; // type:function size:0x17C scope:global align:4
20352035
isDrawRoomIcon__16renderingDAmap_cCFii = .text:0x800409B4; // type:function size:0x2C scope:global align:4
2036-
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siibbPC3Vec = .text:0x800409E0; // type:function size:0xB4 scope:global align:4
2036+
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siiibPC3Vec = .text:0x800409E0; // type:function size:0xB4 scope:global align:4
20372037
getFirstData__28renderingPlusDoorAndCursor_cFUc = .text:0x80040A94; // type:function size:0x24 scope:global align:4
20382038
getNextData__28renderingPlusDoorAndCursor_cFPQ27dTres_c15typeGroupData_c = .text:0x80040AB8; // type:function size:0x24 scope:global align:4
20392039
getIconPosition__28renderingPlusDoorAndCursor_cCFPQ27dTres_c15typeGroupData_c = .text:0x80040ADC; // type:function size:0x8 scope:global align:4

config/GZ2P01/symbols.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ drawDoorCommon__19renderingPlusDoor_cFPC21stage_tgsc_data_classib = .text:0x8004
20332033
checkDispDoorS__19renderingPlusDoor_cFiif = .text:0x80040840; // type:function size:0x128 scope:global align:4
20342034
drawNormalDoorS__19renderingPlusDoor_cFPC21stage_tgsc_data_classiib = .text:0x80040968; // type:function size:0x17C scope:global align:4
20352035
isDrawRoomIcon__16renderingDAmap_cCFii = .text:0x80040AE4; // type:function size:0x2C scope:global align:4
2036-
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siibbPC3Vec = .text:0x80040B10; // type:function size:0xB4 scope:global align:4
2036+
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siiibPC3Vec = .text:0x80040B10; // type:function size:0xB4 scope:global align:4
20372037
getFirstData__28renderingPlusDoorAndCursor_cFUc = .text:0x80040BC4; // type:function size:0x24 scope:global align:4
20382038
getNextData__28renderingPlusDoorAndCursor_cFPQ27dTres_c15typeGroupData_c = .text:0x80040BE8; // type:function size:0x24 scope:global align:4
20392039
getIconPosition__28renderingPlusDoorAndCursor_cCFPQ27dTres_c15typeGroupData_c = .text:0x80040C0C; // type:function size:0x8 scope:global align:4

config/RZDE01_00/symbols.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2248,7 +2248,7 @@ drawDoorCommon__19renderingPlusDoor_cFPC21stage_tgsc_data_classib = .text:0x8004
22482248
checkDispDoorS__19renderingPlusDoor_cFiif = .text:0x80043C1C; // type:function size:0x170 scope:global align:4
22492249
drawNormalDoorS__19renderingPlusDoor_cFPC21stage_tgsc_data_classiib = .text:0x80043D8C; // type:function size:0x1D0 scope:global align:4
22502250
isDrawRoomIcon__16renderingDAmap_cCFii = .text:0x80043F5C; // type:function size:0x10 scope:global align:4
2251-
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siibbPC3Vec = .text:0x80043F6C; // type:function size:0xB4 scope:global align:4
2251+
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siiibPC3Vec = .text:0x80043F6C; // type:function size:0xB4 scope:global align:4
22522252
getFirstData__28renderingPlusDoorAndCursor_cFUc = .text:0x80044020; // type:function size:0x8 scope:global align:4
22532253
getNextData__28renderingPlusDoorAndCursor_cFPQ27dTres_c15typeGroupData_c = .text:0x80044028; // type:function size:0x8 scope:global align:4
22542254
getIconPosition__28renderingPlusDoorAndCursor_cCFPQ27dTres_c15typeGroupData_c = .text:0x80044030; // type:function size:0x8 scope:global align:4

config/ShieldD/symbols.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4595,7 +4595,7 @@ GXEnd = .text:0x8008CCA0; // type:function size:0x4C scope:local hash:0x0C8037B5
45954595
multVecArray__14mDoMtx_stack_cFPC3VecP3VecUl = .text:0x8008CCF0; // type:function size:0x40 scope:global hash:0xDC41BA9F dhash:0x65379881
45964596
ZrotM__14mDoMtx_stack_cFs = .text:0x8008CD30; // type:function size:0x30 scope:global hash:0x64860001 dhash:0xE8901322
45974597
isDrawRoomIcon__16renderingDAmap_cCFii = .text:0x8008CD60; // type:function size:0x44 scope:global hash:0x0DB6AD26 dhash:0x3E883DCC
4598-
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siibbPC3Vec = .text:0x8008CDB0; // type:function size:0x118 scope:global hash:0x468B2516 dhash:0xB56C7C8D
4598+
isDrawIconSingle__16renderingDAmap_cCFPCQ27dTres_c6data_siiibPC3Vec = .text:0x8008CDB0; // type:function size:0x118 scope:global hash:0x468B2516 dhash:0xB56C7C8D
45994599
getFirstData__28renderingPlusDoorAndCursor_cFUc = .text:0x8008CED0; // type:function size:0x2C scope:global hash:0x27F32B38 dhash:0xDC8ACAD2
46004600
getNextData__28renderingPlusDoorAndCursor_cFPQ27dTres_c15typeGroupData_c = .text:0x8008CF00; // type:function size:0x28 scope:global hash:0xE49604D0 dhash:0xEA6D0177
46014601
getIconPosition__28renderingPlusDoorAndCursor_cCFPQ27dTres_c15typeGroupData_c = .text:0x8008CF30; // type:function size:0x28 scope:global hash:0xBB09BE16 dhash:0x8BFCB657

configure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,12 +548,12 @@ def MatchingFor(*versions) -> bool:
548548
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_a_item_static.cpp"),
549549
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_a_shop_item_static.cpp"),
550550
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_a_horse_static.cpp"),
551-
Object(NonMatching, "d/d_demo.cpp"),
551+
Object(MatchingFor("GZ2E01"), "d/d_demo.cpp"),
552552
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_door_param2.cpp", extra_cflags=['-pragma "nosyminline on"']),
553553
Object(NonMatching, "d/d_resorce.cpp"),
554554
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_map_path.cpp"),
555555
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_map_path_fmap.cpp", extra_cflags=['-pragma "nosyminline on"']),
556-
Object(NonMatching, "d/d_map_path_dmap.cpp"),
556+
Object(MatchingFor("GZ2E01"), "d/d_map_path_dmap.cpp"),
557557
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_event.cpp"),
558558
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_event_data.cpp"),
559559
Object(MatchingFor("GZ2E01", "GZ2J01"), "d/d_event_manager.cpp", extra_cflags=['-pragma "nosyminline on"']),

include/JSystem/JParticle/JPAEmitter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class JPABaseEmitter {
160160
void setGlobalParticleScale(f32 scaleX, f32 scaleY) {
161161
mGlobalPScl.set(scaleX, scaleY);
162162
}
163-
void getGlobalParticleScale(JGeometry::TVec3<f32>& scale) {
163+
void getGlobalParticleScale(JGeometry::TVec3<f32>& scale) const {
164164
scale.set(mGlobalPScl.x, mGlobalPScl.y, 1.0f);
165165
}
166166
void setGlobalScale(const JGeometry::TVec3<f32>& scale) {

include/d/d_demo.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,8 @@ class dDemo_actor_c : public JStage::TActor {
9494
cMtx_copy(mModel->getAnmMtx((u16)param_0), param_1);
9595
return true;
9696
}
97-
/* 8003A0D8 */ virtual void JSGGetTranslation(Vec* o_trans) const {
98-
*o_trans = mTrans;
99-
}
10097
/* 80038920 */ virtual void JSGSetTranslation(Vec const&);
101-
/* 8003A0F4 */ virtual void JSGGetScaling(Vec* o_scale) const {
102-
*o_scale = mScale;
103-
}
10498
/* 80038980 */ virtual void JSGSetScaling(Vec const&);
105-
/* 8003A110 */ virtual void JSGGetRotation(Vec* param_0) const {
106-
param_0->x = mRotate.x * 0.005493164f;
107-
param_0->y = mRotate.y * 0.005493164f;
108-
param_0->z = mRotate.z * 0.005493164f;
109-
}
11099
/* 800389A8 */ virtual void JSGSetRotation(Vec const&);
111100
/* 80038A0C */ virtual void JSGSetShape(u32);
112101
/* 80038A20 */ virtual void JSGSetAnimation(u32);
@@ -120,6 +109,17 @@ class dDemo_actor_c : public JStage::TActor {
120109
/* 8003A0D0 */ virtual f32 JSGGetTextureAnimationFrameMax() const {
121110
return mTexAnmFrameMax;
122111
}
112+
/* 8003A0D8 */ virtual void JSGGetTranslation(Vec* o_trans) const {
113+
*o_trans = mTrans;
114+
}
115+
/* 8003A0F4 */ virtual void JSGGetScaling(Vec* o_scale) const {
116+
*o_scale = mScale;
117+
}
118+
/* 8003A110 */ virtual void JSGGetRotation(Vec* param_0) const {
119+
param_0->x = mRotate.x * 0.005493164f;
120+
param_0->y = mRotate.y * 0.005493164f;
121+
param_0->z = mRotate.z * 0.005493164f;
122+
}
123123

124124
void setModel(J3DModel* p_model) { mModel = p_model; }
125125
BOOL checkEnable(u16 flag) { return mFlags & flag; }
@@ -164,10 +164,10 @@ class dDemo_system_c : public JStage::TSystem {
164164
public:
165165
dDemo_system_c() { mpObject = NULL; }
166166

167-
/* 80039AAC */ virtual ~dDemo_system_c();
168167
/* 80039528 */ virtual int JSGFindObject(JStage::TObject**, char const*,
169168
JStage::TEObject) const;
170-
169+
/* 80039AAC */ virtual ~dDemo_system_c();
170+
171171
void setObject(dDemo_object_c* i_object) { mpObject = i_object; }
172172

173173
private:
@@ -198,13 +198,13 @@ class dDemo_light_c : public JStage::TLight {
198198
mFlags = 0;
199199
}
200200

201-
/* 80039468 */ virtual ~dDemo_light_c();
202201
/* 80038E20 */ virtual void JSGSetLightType(JStage::TELight);
203202
/* 80038E34 */ virtual void JSGSetPosition(Vec const&);
204203
/* 80038E5C */ virtual void JSGSetColor(GXColor);
205204
/* 80038E8C */ virtual void JSGSetDistanceAttenuation(f32, f32, GXDistAttnFn);
206205
/* 80038EA8 */ virtual void JSGSetAngleAttenuation(f32, GXSpotFn);
207206
/* 80038EC0 */ virtual void JSGSetDirection(Vec const&);
207+
/* 80039468 */ virtual ~dDemo_light_c();
208208

209209
void onEnable(u8 flag) { mFlags |= flag; }
210210

@@ -234,11 +234,11 @@ class dDemo_fog_c : public JStage::TFog {
234234
mFlags = 0;
235235
}
236236

237-
/* 80039408 */ virtual ~dDemo_fog_c();
238237
/* 80038EE8 */ virtual void JSGSetFogFunction(GXFogType);
239238
/* 80038EFC */ virtual void JSGSetStartZ(f32);
240239
/* 80038F10 */ virtual void JSGSetEndZ(f32);
241240
/* 80038F24 */ virtual void JSGSetColor(GXColor);
241+
/* 80039408 */ virtual ~dDemo_fog_c();
242242

243243
void onEnable(u8 flag) { mFlags |= flag; }
244244

@@ -267,7 +267,6 @@ class dDemo_camera_c : public JStage::TCamera {
267267
mFlags = 0;
268268
}
269269

270-
/* 80039FFC */ virtual ~dDemo_camera_c();
271270
/* 80038AC4 */ virtual f32 JSGGetProjectionNear() const;
272271
/* 80038AF8 */ virtual void JSGSetProjectionNear(f32);
273272
/* 80038B0C */ virtual f32 JSGGetProjectionFar() const;
@@ -284,6 +283,7 @@ class dDemo_camera_c : public JStage::TCamera {
284283
/* 80038D5C */ virtual void JSGSetViewTargetPosition(Vec const&);
285284
/* 80038D84 */ virtual f32 JSGGetViewRoll() const;
286285
/* 80038DDC */ virtual void JSGSetViewRoll(f32);
286+
/* 80039FFC */ virtual ~dDemo_camera_c();
287287

288288
void onEnable(u8 flag) { mFlags |= flag; }
289289
bool checkEnable(u8 flag) { return mFlags & flag; }
@@ -316,8 +316,8 @@ class dDemo_ambient_c : public JStage::TAmbientLight {
316316
mFlags = 0;
317317
}
318318

319-
/* 800394C8 */ virtual ~dDemo_ambient_c();
320319
/* 80038DF0 */ virtual void JSGSetColor(GXColor);
320+
/* 800394C8 */ virtual ~dDemo_ambient_c();
321321

322322
void onEnable(u8 flag) { mFlags |= flag; }
323323

include/d/d_map_path_dmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class renderingDAmap_c : public dRenderingFDAmap_c {
127127
/* 800402E8 */ virtual int getNextDrawLayerNo(int);
128128

129129
// See cpp for argument type change comment
130-
/* 800409E0 */ virtual bool isDrawIconSingle(dTres_c::data_s const*, int, int, bool, bool,
130+
/* 800409E0 */ virtual bool isDrawIconSingle(dTres_c::data_s const*, int, int, int, bool,
131131
Vec const*) const;
132132
/* 80040AE4 */ virtual int getIconGroupNumber(u8) const;
133133
virtual bool hasMap() const = 0;

src/d/d_demo.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ int dDemo_actor_c::getDemoIDData(int* param_0, int* param_1, int* param_2, u16*
255255
return 1;
256256
}
257257

258-
s16 dDemo_c::m_branchNum = 0;
258+
//#if DEBUG
259+
//s16 dDemo_c::m_branchNum = 0;
260+
//#endif
259261

260262
/* 80038490-80038518 032DD0 0088+00 1/1 0/0 0/0 .text dDemo_getJaiPointer__FPCcUliPUs */
261263
static void* dDemo_getJaiPointer(char const* arcName, u32 anmID, int param_2, u16* param_3) {
@@ -287,8 +289,7 @@ int dDemo_setDemoData(fopAc_ac_c* i_actor, u8 i_flags, mDoExt_McaMorf* i_morf, c
287289

288290
u8 flags = demo_actor->checkEnable(i_flags);
289291
if (flags & dDemo_actor_c::ENABLE_TRANS_e) {
290-
i_actor->current.pos = demo_actor->getTrans();
291-
i_actor->old.pos = i_actor->current.pos;
292+
i_actor->old.pos = i_actor->current.pos = demo_actor->getTrans();
292293
}
293294

294295
if (flags & dDemo_actor_c::ENABLE_ROTATE_e) {
@@ -311,24 +312,26 @@ int dDemo_setDemoData(fopAc_ac_c* i_actor, u8 i_flags, mDoExt_McaMorf* i_morf, c
311312

312313
if (flags & dDemo_actor_c::ENABLE_ANM_e) {
313314
u32 anmID = demo_actor->getAnmId();
315+
void* ptr;
314316

315317
if (anmID != demo_actor->getOldAnmId()) {
316318
const char* a_name;
317319
if (anmID & 0x10000) {
318320
a_name = dStage_roomControl_c::getDemoArcName();
319-
JUT_ASSERT(267, a_name != NULL);
321+
JUT_ASSERT(0x267, a_name != NULL);
320322
} else {
321323
a_name = i_arcName;
322324
}
323325

324326
demo_actor->setOldAnmId(anmID);
325327

326-
J3DAnmTransform* i_key = (J3DAnmTransform*)dComIfG_getObjectIDRes(a_name, anmID);
328+
J3DAnmTransform* i_key = (J3DAnmTransform*)dComIfG_getObjectIDRes(a_name, anmID & 0xffff);
327329
JUT_ASSERT(272, i_key != 0);
328330

329-
void* ptr = dDemo_getJaiPointer(a_name, anmID, param_4, param_5);
331+
ptr = dDemo_getJaiPointer(a_name, anmID & 0xffff, param_4, param_5);
330332

331-
i_morf->setAnm(i_key, -1, demo_actor->getPrm_Morf(), 1.0f, 0.0f, -1.0f, ptr);
333+
f32 prmMorf = demo_actor->getPrm_Morf();
334+
i_morf->setAnm(i_key, -1, prmMorf, 1.0f, 0.0f, -1.0f, ptr);
332335
demo_actor->setAnmFrameMax(i_morf->getEndFrame());
333336
}
334337
}
@@ -337,7 +340,8 @@ int dDemo_setDemoData(fopAc_ac_c* i_actor, u8 i_flags, mDoExt_McaMorf* i_morf, c
337340
f32 anm_frame = demo_actor->getAnmFrame();
338341

339342
if (anm_frame > 1.0f) {
340-
i_morf->setFrame(anm_frame - 1.0f);
343+
anm_frame -= 1.0f;
344+
i_morf->setFrame(anm_frame);
341345
i_morf->play(&i_actor->current.pos, param_6, i_reverb);
342346
} else {
343347
i_morf->setFrame(anm_frame);

0 commit comments

Comments
 (0)