Skip to content

Commit eddbe73

Browse files
authored
d_a_b_ds and d_a_e_vt equivalent (#2424)
1 parent 38c4252 commit eddbe73

File tree

6 files changed

+38
-126
lines changed

6 files changed

+38
-126
lines changed

configure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ def MatchingFor(*versions) -> bool:
16051605
ActorRel(NonMatching, "d_a_b_bq"),
16061606
ActorRel(Equivalent, "d_a_b_dr"), # weak func order
16071607
ActorRel(Equivalent, "d_a_b_dre"), # weak func order
1608-
ActorRel(NonMatching, "d_a_b_ds"),
1608+
ActorRel(Equivalent, "d_a_b_ds"),
16091609
ActorRel(NonMatching, "d_a_b_gg"),
16101610
ActorRel(NonMatching, "d_a_b_gm"),
16111611
ActorRel(NonMatching, "d_a_b_gnd"),
@@ -1705,7 +1705,7 @@ def MatchingFor(*versions) -> bool:
17051705
ActorRel(MatchingFor("GZ2E01"), "d_a_e_tk2"),
17061706
ActorRel(MatchingFor("GZ2E01"), "d_a_e_tk_ball"),
17071707
ActorRel(NonMatching, "d_a_e_tt"),
1708-
ActorRel(NonMatching, "d_a_e_vt"),
1708+
ActorRel(Equivalent, "d_a_e_vt"),
17091709
ActorRel(NonMatching, "d_a_e_warpappear"),
17101710
ActorRel(NonMatching, "d_a_e_wb"),
17111711
ActorRel(NonMatching, "d_a_e_ws"),

include/JSystem/JParticle/JPAEmitter.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,7 @@ class JPABaseEmitter {
127127
void setGlobalRTMatrix(const Mtx m) { JPASetRMtxTVecfromMtx(m, mGlobalRot, &mGlobalTrs); }
128128
void setGlobalSRTMatrix(const Mtx m) {
129129
JPASetRMtxSTVecfromMtx(m, mGlobalRot, &mGlobalScl, &mGlobalTrs);
130-
131-
// set is actually used here in debug
132-
mGlobalPScl.x = mGlobalScl.x;
133-
mGlobalPScl.y = mGlobalScl.y;
130+
mGlobalPScl.set(mGlobalScl.x, mGlobalScl.y);
134131
}
135132
void setGlobalTranslation(f32 x, f32 y, f32 z) { mGlobalTrs.set(x, y, z); }
136133
void setGlobalTranslation(const JGeometry::TVec3<f32>& trs) { mGlobalTrs.set(trs); }
@@ -170,10 +167,6 @@ class JPABaseEmitter {
170167
mGlobalScl.set(scale);
171168
mGlobalPScl.set(scale.x ,scale.y);
172169
}
173-
void setGlobalSRTMatrix(const MtxP matrix) {
174-
JPASetRMtxSTVecfromMtx(matrix, mGlobalRot, &mGlobalScl, &mGlobalTrs);
175-
mGlobalPScl.set(mGlobalScl.x, mGlobalScl.y);
176-
}
177170
void setDirection(const JGeometry::TVec3<f32>& direction) {
178171
mLocalDir.set(direction);
179172
}

include/d/d_bg_s.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class dBgS : public cBgS {
138138
bool WaterChk(dBgS_SplGrpChk* chk) { return SplGrpChk(chk); }
139139
u32 GetMtrlSndId(const cBgS_PolyInfo& param_0) { return dKy_pol_sound_get(&param_0); }
140140
void DebugDrawPoly(dBgW_Base *param_1) {}
141-
fopAc_ac_c* GetActorPointer(cBgS_PolyInfo const& param_0) { return cBgS::GetActorPointer(param_0); }
141+
fopAc_ac_c* GetActorPointer(cBgS_PolyInfo const& param_0) const { return cBgS::GetActorPointer(param_0); }
142142

143143
#ifdef DEBUG
144144
/* 0x1404 */ u8 field_0x1404[0x1408 - 0x1404];

src/d/actor/d_a_b_ds.cpp

Lines changed: 10 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include "JSystem/J3DGraphBase/J3DMaterial.h"
1515
#include "SSystem/SComponent/c_math.h"
1616
#include "c/c_damagereaction.h"
17+
UNK_REL_DATA;
18+
#include "f_op/f_op_actor_enemy.h"
1719

1820
enum daB_DS_Joint {
1921
DS_JNT_BACKBONE1,
@@ -76,56 +78,6 @@ enum daB_DS_head_Joint {
7678
DS_HEAD_JNT_JAW,
7779
};
7880

79-
/* 805DD248-805DD254 000000 000C+00 4/4 0/0 0/0 .data cNullVec__6Z2Calc */
80-
SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
81-
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
82-
};
83-
84-
/* 805DD254-805DD268 00000C 0004+10 0/0 0/0 0/0 .data @1787 */
85-
#pragma push
86-
#pragma force_active on
87-
SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = {
88-
0x02000201,
89-
/* padding */
90-
0x40080000,
91-
0x00000000,
92-
0x3FE00000,
93-
0x00000000,
94-
};
95-
#pragma pop
96-
97-
/* 805DD268-805DD270 000020 0008+00 0/0 0/0 0/0 .data e_prim$3811 */
98-
#pragma push
99-
#pragma force_active on
100-
SECTION_DATA static u8 e_prim[8] = {
101-
0xFF, 0x78, 0x00, 0x00, 0xFF, 0x64, 0x78, 0x00,
102-
};
103-
#pragma pop
104-
105-
/* 805DD270-805DD278 000028 0008+00 0/0 0/0 0/0 .data e_env$3812 */
106-
#pragma push
107-
#pragma force_active on
108-
SECTION_DATA static u8 e_env[8] = {
109-
0x5A, 0x2D, 0x2D, 0x00, 0x3C, 0x1E, 0x1E, 0x00,
110-
};
111-
#pragma pop
112-
113-
/* 805DD278-805DD280 000030 0006+02 0/0 0/0 0/0 .data eff_id$3820 */
114-
#pragma push
115-
#pragma force_active on
116-
SECTION_DATA static u8 eff_id[6 + 2 /* padding */] = {
117-
0x02,
118-
0x9D,
119-
0x02,
120-
0x9E,
121-
0x02,
122-
0x9F,
123-
/* padding */
124-
0x00,
125-
0x00,
126-
};
127-
#pragma pop
128-
12981
namespace {
13082
/* 805DD280-805DD2C0 000038 0040+00 0/1 0/0 0/0 .data cc_ds_week_src__22@unnamed@d_a_b_ds_cpp@ */
13183
static dCcD_SrcSph cc_ds_week_src = {
@@ -223,31 +175,6 @@ static dCcD_SrcSph cc_ds_breath_at_src = {
223175
};
224176
}; // namespace
225177

226-
f32 dummyLiteral0() {
227-
f32 temp = 100.0f;
228-
229-
f32 temp_0 = 0.0f;
230-
temp += temp_0;
231-
temp += 1.0f;
232-
return temp;
233-
}
234-
235-
f64 dummyLiteral1() {
236-
return 0.5;
237-
}
238-
239-
f64 dummyLiteral2() {
240-
return 3.0;
241-
}
242-
243-
f64 dummyLiteral3() {
244-
return 0.0;
245-
}
246-
247-
f32 dummyLiteral4() {
248-
return 0.01f;
249-
}
250-
251178
/* 805CB22C-805CB314 0000EC 00E8+00 1/1 0/0 0/0 .text __ct__12daB_DS_HIO_cFv */
252179
daB_DS_HIO_c::daB_DS_HIO_c() {
253180
field_0x04 = -1;
@@ -1360,7 +1287,6 @@ bool daB_DS_c::doYoMessage() {
13601287
}
13611288

13621289
/* 805CDAC0-805CFA08 002980 1F48+00 2/1 0/0 0/0 .text executeOpeningDemo__8daB_DS_cFv */
1363-
// r25 / r25 swap
13641290
void daB_DS_c::executeOpeningDemo() {
13651291
camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0));
13661292
daPy_py_c* pla = daPy_getPlayerActorClass();
@@ -2476,7 +2402,7 @@ void daB_DS_c::executeDamage() {
24762402
mCameraCenter = down_center_dt[3];
24772403
mCameraEye = down_eye_dt[3];
24782404
camera->mCamera.Set(mCameraCenter, mCameraEye);
2479-
dComIfGp_getVibration().StartShock(5, 0x1f, cXyz(0.0f, 1.0f, 0.0f));
2405+
dComIfGp_getVibration().StartQuake(5, 0x1f, cXyz(0.0f, 1.0f, 0.0f));
24802406

24812407
mModeTimer = 30;
24822408
mMode++;
@@ -5367,7 +5293,6 @@ void daB_DS_c::mBattle2_cc_set() {
53675293
}
53685294

53695295
/* 805DADC4-805DB184 00FC84 03C0+00 1/1 0/0 0/0 .text execute__8daB_DS_cFv */
5370-
// extra extsh
53715296
int daB_DS_c::execute() {
53725297
if (arg0 == TYPE_BULLET_A || arg0 == TYPE_BULLET_B || arg0 == TYPE_BULLET_C) {
53735298
mBulletAction();
@@ -5386,20 +5311,23 @@ int daB_DS_c::execute() {
53865311
return 1;
53875312
}
53885313

5389-
handR_ang = -4000;
5390-
handL_ang = -4000;
5314+
handR_ang = -(4000.0f + BREG_F(15));
5315+
handL_ang = -(4000.0f + BREG_F(15));
53915316

53925317
mtx_set();
53935318

5319+
u8 unused_bool = 0;
5320+
cXyz jnt_pos;
53945321
dBgS_GndChk gnd_chk;
5395-
cXyz jnt_pos, chk_pos;
5322+
cXyz unused_0, chk_pos, unused_1;
53965323

53975324
J3DModel* model = mpMorf->getModel();
53985325
s8 var_r25;
53995326
int i = 0;
54005327

54015328
if (!mIsOpeningDemo) {
5402-
s16 hand_x_ang_target = (s16)(mBackboneLevel * 1000) - 6000;
5329+
s16 hand_x_ang_target = -6000;
5330+
hand_x_ang_target += (s16)(mBackboneLevel * 1000);
54035331
if (handX_ang > -4000) {
54045332
handX_ang = -4000;
54055333
}

src/d/actor/d_a_b_mgn.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ void daB_MGN_c::executeDash() {
11641164

11651165
switch (mMoveMode) {
11661166
case 10:
1167-
case 11:
1167+
case 11: {
11681168
cXyz gate_offset(0.0f, 0.0f, -800.0f);
11691169
cXyz player_pos(player->current.pos);
11701170

@@ -1218,6 +1218,7 @@ void daB_MGN_c::executeDash() {
12181218
}
12191219
}
12201220
break;
1221+
}
12211222
case 12:
12221223
if (field_0xa9c == 0) {
12231224
if (field_0xaff >= 5) {
@@ -1246,9 +1247,7 @@ void daB_MGN_c::executeDash() {
12461247
field_0xaac = 20;
12471248
field_0xa9c = 21;
12481249
mJewelColorMode = 1;
1249-
gravity = 0.0f;
1250-
speed.y = 0.0f;
1251-
speedF = 0.0f;
1250+
speedF = speed.y = gravity = 0.0f;
12521251

12531252
if (field_0xb10 != -1) {
12541253
current.angle.y = shape_angle.y = mGdgateAngle[field_0xb10];
@@ -1393,9 +1392,9 @@ void daB_MGN_c::executeDash() {
13931392
}
13941393

13951394
if ((s16)(mAcchCir.GetWallAngleY() - shape_angle.y) < 0) {
1396-
shape_angle.y += 0x100;
1395+
shape_angle.y += (s16) 0x100;
13971396
} else {
1398-
shape_angle.y += -0x100;
1397+
shape_angle.y += (s16) -0x100;
13991398
}
14001399

14011400
current.angle.y = shape_angle.y;
@@ -1406,6 +1405,7 @@ void daB_MGN_c::executeDash() {
14061405
field_0x20f4[0].OffTgSetBit();
14071406
mAtSph.OffAtSetBit();
14081407
setActionMode(ACTION_CIRCLE_e, field_0xb03);
1408+
break;
14091409
}
14101410
}
14111411
}
@@ -1417,7 +1417,7 @@ void daB_MGN_c::executeDash() {
14171417
cXyz sp30;
14181418
mDoMtx_stack_c::transS(current.pos);
14191419
mDoMtx_stack_c::YrotM(shape_angle.y);
1420-
mDoMtx_stack_c::transM(0.0f, 0.0f, 1000.0f);
1420+
mDoMtx_stack_c::transM(0.0f, 0.0f, 1000.0f + nREG_F(10));
14211421
mDoMtx_stack_c::multVecZero(&sp30);
14221422

14231423
dComIfGp_particle_set(0x8c1c, &sp30, &tevStr, &shape_angle, 0);
@@ -1445,7 +1445,7 @@ void daB_MGN_c::executeDash() {
14451445
mAtSph.SetAtAtp(2);
14461446
current.angle.y = shape_angle.y;
14471447
speedF = l_HIO.dash_speed;
1448-
case 6:
1448+
case 6: {
14491449
if (mpMgnBtk->isStop()) {
14501450
setBloodEffect();
14511451
}
@@ -1468,6 +1468,17 @@ void daB_MGN_c::executeDash() {
14681468
}
14691469
break;
14701470
}
1471+
case 8:
1472+
case 9:
1473+
case 14:
1474+
case 15:
1475+
case 16:
1476+
case 17:
1477+
case 18:
1478+
case 19:
1479+
case 7:
1480+
break;
1481+
}
14711482
}
14721483

14731484
/* 80609D70-8060A670 004730 0900+00 2/1 0/0 0/0 .text executeThrown__9daB_MGN_cFv */

src/d/actor/d_a_e_vt.cpp

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "d/d_com_inf_game.h"
1313
#include "d/d_s_play.h"
1414
#include "d/d_camera.h"
15+
UNK_REL_DATA;
1516
#include "f_op/f_op_actor_enemy.h"
1617

1718
#define WL_CUT_TYPE_SMALL 1
@@ -74,21 +75,6 @@ enum daE_VA_JOINT {
7475
JNT_TAIL_CLOTH_04,
7576
};
7677

77-
/* 807CEF08-807CEF14 000000 000C+00 3/3 0/0 0/0 .data cNullVec__6Z2Calc */
78-
static u8 cNullVec__6Z2Calc[12] = {
79-
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
80-
};
81-
82-
/* 807CEF14-807CEF28 00000C 0004+10 0/0 0/0 0/0 .data @1787 */
83-
static u32 lit_1787[1 + 4 /* padding */] = {
84-
0x02000201,
85-
/* padding */
86-
0x40080000,
87-
0x00000000,
88-
0x3FE00000,
89-
0x00000000,
90-
};
91-
9278
namespace
9379
{
9480

@@ -1900,7 +1886,6 @@ void daE_VA_c::executeClearWait() {
19001886
}
19011887

19021888
/* 807C7640-807C783C 005140 01FC+00 1/1 0/0 0/0 .text executeClearChase__8daE_VA_cFv */
1903-
// NONMATCHING load order
19041889
void daE_VA_c::executeClearChase() {
19051890
cLib_addCalc(&current.pos.y, 0.0f, 0.1f, 10.0f, 1.0f);
19061891

@@ -1926,7 +1911,7 @@ void daE_VA_c::executeClearChase() {
19261911
}
19271912
}
19281913

1929-
if (speedF != 0.0f) {
1914+
if (speedF) {
19301915
if (!checkBck(ANM_INVI_WALK_e)) {
19311916
setBck(ANM_INVI_WALK_e, J3DFrameCtrl::EMode_LOOP, 10.0f, 1.0f);
19321917
}
@@ -3817,7 +3802,6 @@ static int daE_VA_Delete(daE_VA_c* i_this) {
38173802
}
38183803

38193804
/* 807CD048-807CD600 00AB48 05B8+00 1/1 0/0 0/0 .text CreateHeap__8daE_VA_cFv */
3820-
// NONMATCHING weird data issue / reg alloc (probably related)
38213805
int daE_VA_c::CreateHeap() {
38223806
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_VA", 0x33);
38233807
JUT_ASSERT(0, modelData != 0);
@@ -3898,9 +3882,8 @@ int daE_VA_c::CreateHeap() {
38983882
}
38993883

39003884
f32* size_p = field_0x139c.getSize(0);
3901-
for (int i = 0; i < 5; i++) {
3885+
for (int i = 0; i < 5; i++, size_p++) {
39023886
*size_p = 5.0f;
3903-
size_p++;
39043887
}
39053888

39063889
if (!mRope.init(11, 10, (ResTIMG*)dComIfG_getObjectRes("E_VA", 0x3E), 1)) {
@@ -3910,15 +3893,12 @@ int daE_VA_c::CreateHeap() {
39103893
for (int i = 0; i < 11; i++) {
39113894
f32* size_p = mRope.getSize(i);
39123895

3913-
for (int j = 0; j < 10; j++) {
3914-
*size_p = 5.0f;
3915-
size_p++;
3896+
for (int j = 0; j < 10; ++j, size_p++) {
3897+
*size_p = 2.0f;
39163898
}
39173899
}
39183900

39193901
for (int i = 0; i < 40; i++) {
3920-
J3DModelData* modelData;
3921-
39223902
switch (va_tag_set_size[i]) {
39233903
case 0:
39243904
modelData = (J3DModelData*)dComIfG_getObjectRes("E_VA", 0x34);

0 commit comments

Comments
 (0)