e_rd, npc_ks dbg work (#3029)

* Partial e_rd, npc_ks dbg work

* More e_rd matching

* e_rd fixes and dbg ctor matched

* obj_ita dbg equiv

* e_st dbg almost equiv

* Some obj_ladder dbg work

* dbg e_rd PR comments

* Further e_rd dbg clangd fixes
This commit is contained in:
YunataSavior
2026-01-11 19:49:05 -08:00
committed by GitHub
parent 6a59c5231f
commit 24c08d322e
16 changed files with 1390 additions and 1000 deletions
+1 -1
View File
@@ -446,7 +446,7 @@ S_find = .bss:0x000000AC; // type:object size:0x2 scope:global data:2byte
lbl_70_bss_AE = .bss:0x000000AE; // type:object size:0x1 scope:local align:1 data:byte
@4242 = .bss:0x000000B0; // type:object size:0xC scope:local
S_find_pos = .bss:0x000000BC; // type:object size:0xC scope:global align:4 data:float
data_80519200 = .bss:0x000000C8; // type:object size:0x1 data:byte
desert_substage = .bss:0x000000C8; // type:object size:0x1 data:byte
data_80519201 = .bss:0x000000C9; // type:object size:0x1 data:byte
target_info = .bss:0x000000CC; // type:object size:0x28 scope:global data:4byte
target_info_count = .bss:0x000000F4; // type:object size:0x4 scope:global data:4byte
+1 -1
View File
@@ -445,7 +445,7 @@ S_find = .bss:0x000000AC; // type:object size:0x2 scope:global data:2byte
lbl_70_bss_AE = .bss:0x000000AE; // type:object size:0x1 data:byte
@4242 = .bss:0x000000B0; // type:object size:0xC scope:local
S_find_pos = .bss:0x000000BC; // type:object size:0xC scope:global align:4 data:float
data_80519200 = .bss:0x000000C8; // type:object size:0x1 data:byte
desert_substage = .bss:0x000000C8; // type:object size:0x1 data:byte
data_80519201 = .bss:0x000000C9; // type:object size:0x1 data:byte
target_info = .bss:0x000000CC; // type:object size:0x28 scope:global data:4byte
target_info_count = .bss:0x000000F4; // type:object size:0x4 scope:global data:4byte
+1 -1
View File
@@ -445,7 +445,7 @@ S_find = .bss:0x000000AC; // type:object size:0x2 scope:global data:2byte
lbl_70_bss_AE = .bss:0x000000AE; // type:object size:0x1 data:byte
@4242 = .bss:0x000000B0; // type:object size:0xC scope:local
S_find_pos = .bss:0x000000BC; // type:object size:0xC scope:global align:4 data:float
data_80519200 = .bss:0x000000C8; // type:object size:0x1 data:byte
desert_substage = .bss:0x000000C8; // type:object size:0x1 data:byte
data_80519201 = .bss:0x000000C9; // type:object size:0x1 data:byte
target_info = .bss:0x000000CC; // type:object size:0x28 scope:global data:4byte
target_info_count = .bss:0x000000F4; // type:object size:0x4 scope:global data:4byte
@@ -506,6 +506,7 @@ lbl_68_bss_68 = .bss:0x00000068; // type:object size:0x1 data:byte
lbl_68_bss_69 = .bss:0x00000069; // type:object size:0x7 data:byte
target_info = .bss:0x00000070; // type:object size:0x28 scope:global data:4byte
target_info_count = .bss:0x00000098; // type:object size:0x4 scope:global data:4byte
data_80519230 = .bss:0x0000009C; // type:object size:0x1 data:byte
@LOCAL@path_check__FP10e_rd_class@check_index = .bss:0x000000A0; // type:object size:0xFF scope:local
rd_count = .bss:0x000001A0; // type:object size:0x4 scope:global data:4byte
lbl_68_bss_1A4 = .bss:0x000001A4; // type:object size:0x1 data:byte
+10 -20
View File
@@ -7,6 +7,7 @@
#include "d/d_msg_flow.h"
#include "d/d_path.h"
#include "f_op/f_op_actor_mng.h"
#include "m_Do/m_Do_ext.h"
/**
* @ingroup actors-enemies
@@ -45,9 +46,7 @@ public:
/* 0x06A0 */ s8 field_0x6a0;
/* 0x06A4 */ cXyz field_0x6a4;
/* 0x06B0 */ cXyz field_0x6b0;
/* 0x06BC */ u8 field_0x6bc[0x6be - 0x6bc];
/* 0x06BE */ s16 field_0x6be;
/* 0x06C0 */ s16 field_0x6c0;
/* 0x06BC */ csXyz field_0x6bc;
/* 0x06C2 */ s8 field_0x6c2;
/* 0x06C3 */ u8 field_0x6c3;
/* 0x06C4 */ J3DModel* mpEyeModels[2];
@@ -101,22 +100,17 @@ public:
/* 0x09CE */ s16 field_0x9ce;
/* 0x09D0 */ s16 field_0x9d0;
/* 0x09D4 */ cXyz field_0x9d4;
/* 0x09E0 */ u8 field_0x9e0[0x9ec - 0x9e0];
/* 0x09E0 */ cXyz field_0x9e0; // unused, dbg offset 0xa18
/* 0x09EC */ f32 field_0x9ec;
/* 0x09F0 */ f32 field_0x9f0;
/* 0x09F4 */ s16 field_0x9f4;
/* 0x09F6 */ s16 field_0x9f6;
/* 0x09F8 */ s8 field_0x9f8;
/* 0x09F9 */ u8 field_0x9f9[0xa0c - 0x9f9];
/* 0x0A0C */ s16 field_0xa0c;
/* 0x0A0E */ s16 field_0xa0e;
/* 0x0A10 */ u8 field_0xa10[0xa12 - 0xa10];
/* 0x0A12 */ s16 field_0xa12;
/* 0x0A14 */ u8 field_0xa14[0xa16 - 0xa14];
/* 0x0A16 */ s16 field_0xa16;
/* 0x0A18 */ s16 field_0xa18;
/* 0x0A1A */ u8 field_0xa1a[0xa1c - 0xa1a];
/* 0x0A1C */ s16 field_0xa1c;
/* 0x09FC */ cXyz field_0x9fc; // unused, dbg offset 0xa34
/* 0x0A08 */ u8 field_0xa08[0x0A0C - 0x0A08];
/* 0x0A0C */ csXyz field_0xa0c;
/* 0x0A12 */ csXyz field_0xa12;
/* 0x0A18 */ csXyz field_0xa18;
/* 0x0A1E */ s8 field_0xa1e;
/* 0x0A1F */ s8 field_0xa1f;
/* 0x0A20 */ u32 field_0xa20;
@@ -136,12 +130,8 @@ public:
/* 0x0AD2 */ s16 field_0xad2[4];
/* 0x0ADA */ s16 field_0xada;
/* 0x0ADC */ s16 field_0xadc;
/* 0x0ADE */ s16 field_0xade;
/* 0x0AE0 */ s16 field_0xae0;
/* 0x0AE2 */ u8 field_0xae2[0xae4 - 0xae2];
/* 0x0AE4 */ s16 field_0xae4;
/* 0x0AE6 */ s16 field_0xae6;
/* 0x0AE8 */ u8 field_0xae8[0xaec - 0xae8];
/* 0x0ADE */ csXyz field_0xade; // dbg offset 0xb1c
/* 0x0AE4 */ csXyz field_0xae4;
/* 0x0AEC */ f32 field_0xaec;
/* 0x0AF0 */ s16 field_0xaf0;
/* 0x0AF2 */ s16 field_0xaf2;
+3 -3
View File
@@ -34,10 +34,10 @@ public:
void setHamonPrtcl();
u8 getType() {
int iVar1 = fopAcM_GetParam(this) & 0xFF;
u8 rv;
u8 adj_arg = argument & 0x7F;
u8 iVar1 = fopAcM_GetParam(this) & 0xFF;
switch ((argument & 127)) {
switch (adj_arg) {
case 0:
switch (iVar1) {
case 0:
+12 -12
View File
@@ -13,6 +13,15 @@
*
*/
namespace daObjLadder {
enum Type_e {
TYPE_0,
TYPE_1,
TYPE_2,
TYPE_3,
TYPE_4,
TYPE_5,
};
class Act_c : public dBgS_MoveBgActor {
public:
enum Prm_e {
@@ -22,15 +31,6 @@ namespace daObjLadder {
PRM_16 = 16,
};
enum Type_e {
TYPE_0,
TYPE_1,
TYPE_2,
TYPE_3,
TYPE_4,
TYPE_5,
};
enum Mode {
MODE_WAIT,
MODE_DEMOREQ,
@@ -62,15 +62,15 @@ namespace daObjLadder {
int Execute(Mtx**);
int Draw();
u8 prm_get_evId() {
u8 prm_get_evId() const {
return daObj::PrmAbstract(this, PRM_8, PRM_16);
}
int prm_get_swSave() {
int prm_get_swSave() const {
return daObj::PrmAbstract(this,PRM_8, PRM_8);
}
Type_e prm_get_type() {
Type_e prm_get_type() const {
return(Type_e)daObj::PrmAbstract(this,PRM_3, PRM_0);
}
+26 -26
View File
@@ -205,107 +205,107 @@ extern dScnPly_preset_HIO_c g_presetHIO;
#define tREG_S(i) g_regHIO.mChildReg[25].mShortReg[i]
#else
// Morita
#define TREG_F(i) (0)
#define TREG_F(i) (0.0f)
#define TREG_S(i) (0)
// Matsutani
#define DREG_F(i) (0)
#define DREG_F(i) (0.0f)
#define DREG_S(i) (0)
// Iwawaki
#define IREG_F(i) (0)
#define IREG_F(i) (0.0f)
#define IREG_S(i) (0)
// Sasa
#define SREG_F(i) (0)
#define SREG_F(i) (0.0f)
#define SREG_S(i) (0)
// Umemiya
#define UREG_F(i) (0)
#define UREG_F(i) (0.0f)
#define UREG_S(i) (0)
// Ogawa
#define OREG_F(i) (0)
#define OREG_F(i) (0.0f)
#define OREG_S(i) (0)
// Sakaguchi
#define YREG_F(i) (0)
#define YREG_F(i) (0.0f)
#define YREG_S(i) (0)
// Sakai
#define KREG_F(i) (0)
#define KREG_F(i) (0.0f)
#define KREG_S(i) (0)
// Hara
#define BREG_F(i) (0)
#define BREG_F(i) (0.0f)
#define BREG_S(i) (0)
// Sumiyoshi
#define MREG_F(i) (0)
#define MREG_F(i) (0.0f)
#define MREG_S(i) (0)
// Takeshita
#define AREG_F(i) (0)
#define AREG_F(i) (0.0f)
#define AREG_S(i) (0)
// Yoshida
#define PREG_F(i) (0)
#define PREG_F(i) (0.0f)
#define PREG_S(i) (0)
// Noma
#define NREG_F(i) (0)
#define NREG_F(i) (0.0f)
#define NREG_S(i) (0)
// Nishiwaki
#define WREG_F(i) (0)
#define WREG_F(i) (0.0f)
#define WREG_S(i) (0)
// Masaro
#define JREG_F(i) (0)
#define JREG_F(i) (0.0f)
#define JREG_S(i) (0)
// Hayakawa
#define HREG_F(i) (0)
#define HREG_F(i) (0.0f)
#define HREG_S(i) (0)
// Sadamoto
#define VREG_F(i) (0)
#define VREG_F(i) (0.0f)
#define VREG_S(i) (0)
// Nishikawa
#define XREG_F(i) (0)
#define XREG_F(i) (0.0f)
#define XREG_S(i) (0)
// Suzuki
#define ZREG_F(i) (0)
#define ZREG_F(i) (0.0f)
#define ZREG_S(i) (0)
// Nakanishi
#define nREG_F(i) (0)
#define nREG_F(i) (0.0f)
#define nREG_S(i) (0)
// Kuwajima
#define kREG_F(i) (0)
#define kREG_F(i) (0.0f)
#define kREG_S(i) (0)
// Okajima
#define oREG_F(i) (0)
#define oREG_F(i) (0.0f)
#define oREG_S(i) (0)
// Yamazaki
#define yREG_F(i) (0)
#define yREG_F(i) (0.0f)
#define yREG_S(i) (0)
// Ashida
#define aREG_F(i) (0)
#define aREG_F(i) (0.0f)
#define aREG_S(i) (0)
// Okada
#define hREG_F(i) (0)
#define hREG_F(i) (0.0f)
#define hREG_S(i) (0)
// Takahashi
#define tREG_F(i) (0)
#define tREG_F(i) (0.0f)
#define tREG_S(i) (0)
#endif
+7
View File
@@ -138,4 +138,11 @@ static const float INF = 2000000000.0f;
#define ASM
#endif
// potential fakematch?
#if PLATFORM_SHIELD
#define UNSET_FLAG(var, flag) (var) &= (u16)~(flag)
#else
#define UNSET_FLAG(var, flag) (var) &= ~(flag)
#endif
#endif
+878 -655
View File
File diff suppressed because it is too large Load Diff
+128 -91
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3884,7 +3884,7 @@ static void demo_camera(e_wb_class* i_this) {
i_this->field_0x1714 = 55.0f + KREG_F(7);
i_this->field_0x16a0 = 0;
s16 sp16 = local_194->actor.shape_angle.y +
(local_194->field_0xa0e - local_194->actor.shape_angle.y) / 2;
(local_194->field_0xa0c.y - local_194->actor.shape_angle.y) / 2;
mDoMtx_stack_c::YrotS(sp16);
local_3c.x = NREG_F(0);
local_3c.y = NREG_F(1) + 500.0f;
File diff suppressed because it is too large Load Diff
+11 -9
View File
@@ -411,13 +411,12 @@ static void action(obj_hb_class* i_this) {
if (cc_move_p != NULL) {
a_this->current.pos.x += cc_move_p->x * 0.5f;
a_this->current.pos.z += cc_move_p->z * 0.5f;
if (fabsf(cc_move_p->x) >= 2.0f || fabsf(cc_move_p->z) >= 2.0f) {
cLib_addCalc2(&i_this->field_0x688, NREG_F(5) + 1000.0f, 0.1f, NREG_F(6) + 200.0f);
s16 target = fopAcM_searchPlayerAngleY(a_this);
s16 angle_delta = i_this->field_0x676.y - target;
if (angle_delta > 0x4000 || angle_delta < -0x4000) {
target -= 0x8000;
ADD_ANGLE(target, 0x8000);
}
cLib_addCalcAngleS2(&i_this->field_0x676.y, target, 4, 0x100);
}
@@ -427,7 +426,7 @@ static void action(obj_hb_class* i_this) {
i_this->mBgc.CrrPos(dComIfG_Bgsp());
sVar1 = 1;
break;
case ACTION_FLOAT:
obj_hb_float(i_this);
i_this->mBgc.CrrPos(dComIfG_Bgsp());
@@ -449,8 +448,9 @@ static void action(obj_hb_class* i_this) {
i_this->field_0x6b0 = 0;
if (i_this->mAtInfo.mHitType == HIT_TYPE_LINK_NORMAL_ATTACK) {
if (daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_TURN_RIGHT || daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_UNK_9) {
a_this->speedF = WREG_F(16) + cM_rndF(10.0f) + 40.0f;
if (daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_TURN_RIGHT
|| daPy_getPlayerActorClass()->getCutType() == daPy_py_c::CUT_TYPE_UNK_9) {
a_this->speedF = cM_rndF(10.0f) + 40.0f + WREG_F(16);
i_this->field_0x690 = cM_rndF(2000.0f) + 5500.0f;
i_this->field_0x688 = (s16)(cM_rndF(1000.0f) + 5000.0f);
} else {
@@ -477,8 +477,8 @@ static void action(obj_hb_class* i_this) {
cLib_addCalcAngleS2(&i_this->field_0x68e, 0, 8, 0x100);
cLib_addCalcAngleS2(&i_this->field_0x690, 0, 1, WREG_S(6) + 0x96);
} else {
i_this->field_0x68c = i_this->field_0x688 * cM_ssin(i_this->field_0x650 * (NREG_F(3) + 3000));
i_this->field_0x68e = i_this->field_0x688 * cM_ssin(i_this->field_0x650 * (NREG_F(4) + 4000));
i_this->field_0x68c = i_this->field_0x688 * cM_ssin(i_this->field_0x650 * (NREG_S(3) + 3000));
i_this->field_0x68e = i_this->field_0x688 * cM_ssin(i_this->field_0x650 * (NREG_S(4) + 4000));
cLib_addCalc0(&i_this->field_0x688, 0.1f, NREG_F(1) + 50.0f);
cLib_addCalcAngleS2(&i_this->field_0x690, 0, 1, WREG_S(5) + 0x32);
}
@@ -503,7 +503,8 @@ static void action(obj_hb_class* i_this) {
}
a_this->speedF = 0.0f;
cXyz scale(a_this->scale.x, a_this->scale.x, a_this->scale.x);
f32 val_scale = a_this->scale.x;
cXyz scale(val_scale, val_scale, val_scale);
cXyz pos(a_this->current.pos);
pos.y = i_this->mGroundCross;
@@ -522,7 +523,8 @@ static void action(obj_hb_class* i_this) {
if (i_this->field_0x6a4 != 0) {
i_this->field_0x6a4--;
if (i_this->field_0x6a4 != 0) {
cLib_addCalc2(&a_this->scale.x, i_this->field_0x6a4 * (BREG_F(2) + 0.01f) * cM_ssin(i_this->field_0x6a4 * (KREG_S(3) + 15000)) + 1.0f, 1.0f, 0.2f);
f32 reg_f30 = i_this->field_0x6a4 * (BREG_F(2) + 0.01f);
cLib_addCalc2(&a_this->scale.x, reg_f30 * cM_ssin(i_this->field_0x6a4 * (KREG_S(3) + 15000)) + 1.0f, 1.0f, 0.2f);
} else {
a_this->scale.x = 1.0f;
}
+37 -26
View File
@@ -15,13 +15,7 @@ public:
daObj_ITA_HIO_c();
virtual ~daObj_ITA_HIO_c() {}
void genMessage(JORMContext* ctx) {
ctx->genLabel("ヒメクジ", 0x80000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
ctx->genSlider("サーチエリア", &search_area, 0.0f, 2000.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
ctx->genSlider("飛ばし方向スピード", &launch_dir_spd, 0.0f, -100.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
ctx->genSlider("飛ばし方向Yスピード", &launch_dir_y_spd, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
ctx->genSlider("重力設定", &gravity_settings, 0.0f, -20.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
}
void genMessage(JORMContext* ctx);
/* ヒメクジ */
/* 0x04 */ s8 id;
@@ -31,8 +25,6 @@ public:
/* 0x14 */ f32 gravity_settings;
};
static char* l_arcName = "M_Ita";
daObj_ITA_HIO_c::daObj_ITA_HIO_c() {
id = -1;
search_area = 600.0f;
@@ -41,6 +33,18 @@ daObj_ITA_HIO_c::daObj_ITA_HIO_c() {
gravity_settings = -9.0f;
}
#if DEBUG
void daObj_ITA_HIO_c::genMessage(JORMContext* ctx) {
ctx->genLabel("ヒメクジ", 0x80000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
ctx->genSlider("サーチエリア", &search_area, 0.0f, 2000.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
ctx->genSlider("飛ばし方向スピード", &launch_dir_spd, 0.0f, -100.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
ctx->genSlider("飛ばし方向Yスピード", &launch_dir_y_spd, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
ctx->genSlider("重力設定", &gravity_settings, 0.0f, -20.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
}
#endif
static char* l_arcName = "M_Ita";
static f32 dummy() {
return 0.0f;
}
@@ -59,16 +63,15 @@ namespace {
} // namespace
void daObjIta_c::Search_Ymb() {
f32 zero = 0.0f;
f32 speed_f = 0.0f;
cXyz pos(e_ymb_Pos->x - current.pos.x, e_ymb_Pos->y - current.pos.y, e_ymb_Pos->z - current.pos.z);
mDoMtx_stack_c::YrotS(-shape_angle.y);
mDoMtx_stack_c::multVec(&pos, &pos);
if (pos.x < BREG_F(0) + 750.0f && pos.x > -750.0f - BREG_F(0) && pos.z < 450.0f + BREG_F(1) && pos.z > -450.0f - BREG_F(1) && pos.y < BREG_F(7) + 600.0f) {
f32 speed_f = fopAcM_GetSpeedF(e_ymb);
zero = 0.0f;
if (speed_f > zero) {
speed_f = fopAcM_GetSpeedF(e_ymb);
if (speed_f > 0.0f) {
field_0x5b0 = speed_f * (BREG_F(6) + 16.0f) + 256.0f;
e_ymb->setHitBoardSe();
field_0x5a0 = speed_f * (BREG_F(5) + 31.0f);
@@ -98,15 +101,21 @@ void daObjIta_c::Search_Ymb() {
BOOL daObjIta_c::Check_RideOn() {
daPy_py_c* player = daPy_getPlayerActorClass();
cXyz& pos = fopAcM_GetPosition(player);
f32 speed_f = 0.0f;
int reg_r26 = 0; // unused
field_0x6c0 = 1;
cXyz vecTrans(pos.x - current.pos.x, pos.y - current.pos.y, pos.z - current.pos.z);
mDoMtx_stack_c::YrotS(-shape_angle.y);
mDoMtx_stack_c::multVec(&vecTrans, &vecTrans);
if (vecTrans.x < 1000.0f && vecTrans.x > -1000.0f && vecTrans.z < 700.0f && vecTrans.z > -700.0f && fopAcM_GetSpeedF(player) > 0.0f) {
cLib_addCalcAngleS(&field_0x5b0, 0x150, 11, 0x100, 0);
field_0x5c8 = 0x400;
if (vecTrans.x < 1000.0f && vecTrans.x > -1000.0f && vecTrans.z < 700.0f && vecTrans.z > -700.0f) {
f32 reg_f30 = 0.0f;
speed_f = fopAcM_GetSpeedF(player);
if (speed_f > 0.0f) {
cLib_addCalcAngleS(&field_0x5b0, 0x150, 11, 0x100, 0);
field_0x5c8 = 0x400;
}
}
return FALSE;
@@ -123,16 +132,18 @@ void daObjIta_c::setBaseMtx() {
mDoMtx_stack_c::XrotM(shape_angle.z);
mDoMtx_stack_c::ZrotM(shape_angle.x);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
MTXCopy(mDoMtx_stack_c::get(), mBgMtx);
cMtx_copy(mDoMtx_stack_c::get(), mBgMtx);
}
static void rideCallBack(dBgW* param_1, fopAc_ac_c* a_this, fopAc_ac_c* i_player) {
UNUSED(param_1);
(void) a_this; // it is used, but this is needed for dbg matching
daObjIta_c* i_this = (daObjIta_c*)a_this;
if (fopAcM_GetName(i_player) == PROC_ALINK) {
daPy_py_c* player = daPy_getPlayerActorClass();
if (i_this->field_0x5ac < 0.0f) {
i_this->field_0x5a8 = i_this->field_0x5ac * 0.8f;
i_this->field_0x5a8 = (0.8f + HREG_F(2)) * i_this->field_0x5ac;
i_this->field_0x5ac = 0.0f;
}
@@ -148,20 +159,19 @@ static int daObjIta_Execute(daObjIta_c* i_this) {
return i_this->MoveBGExecute();
}
static int daObjIta_IsDelete(daObjIta_c* i_this) {
static int daObjIta_IsDelete(daObjIta_c*) {
return 1;
}
static int daObjIta_Delete(daObjIta_c* i_this) {
fpc_ProcID id = fopAcM_GetID(i_this);
fopAcM_RegisterDeleteID(i_this, "Obj_Ita");
i_this->MoveBGDelete();
return 1;
}
static int daObjIta_Create(fopAc_ac_c* a_this) {
daObjIta_c* i_this = (daObjIta_c*)a_this;
fpc_ProcID id = fopAcM_GetID(a_this);
return i_this->create();
static int daObjIta_Create(fopAc_ac_c* i_this) {
fopAcM_RegisterCreateID(daObjIta_c, i_this, "Obj_Ita");
return a_this->create();
}
int daObjIta_c::CreateHeap() {
@@ -196,7 +206,7 @@ cPhs__Step daObjIta_c::create() {
cXyz pos(current.pos.x, current.pos.y + 300.0f, current.pos.z);
if (fopAcM_wt_c::waterCheck(&pos)) {
current.pos.y = oREG_F(0) + HREG_F(0) + fopAcM_wt_c::getWaterY() + 50.0f;
current.pos.y = fopAcM_wt_c::getWaterY() + 50.0f + HREG_F(0) + oREG_F(0);
}
return phase;
@@ -218,6 +228,7 @@ int daObjIta_c::Execute(Mtx** mtx) {
}
daPy_py_c* player = daPy_getPlayerActorClass();
cXyz& unused_pos = fopAcM_GetPosition(player);
cXyz& playerSpeed = fopAcM_GetSpeed(player);
if (fopAcM_SearchByName(PROC_E_YMB, (fopAc_ac_c**)&e_ymb) != 0 && e_ymb != NULL) {
@@ -242,7 +253,7 @@ int daObjIta_c::Execute(Mtx** mtx) {
}
cLib_addCalc(&current.pos.y, field_0x5d4 + (posY + 60.0f + field_0x5a8 * (HREG_F(0) + 5.0f) + cM_ssin(field_0x5cc) * 20.0f), 0.1f, 15.0f, 0.1f);
cLib_addCalcAngleS(&shape_angle.x, field_0x5ce.x + (nREG_F(0) + 1.0f) * field_0x5b0 * cM_ssin(field_0x5ca + oREG_F(1) + 0x2000), 2, 0x1000, 1);
cLib_addCalcAngleS(&shape_angle.x, field_0x5ce.x + (nREG_F(0) + 1.0f) * field_0x5b0 * cM_ssin(field_0x5ca + oREG_S(1) + 0x2000), 2, 0x1000, 1);
cLib_addCalcAngleS(&shape_angle.z, field_0x5ce.z + (nREG_F(1) + 1.0f) * field_0x5b0 * cM_ssin(field_0x5cc), 2, 0x1000, 1);
cLib_addCalc(&field_0x5a4, field_0x5c8, HREG_F(13) + 0.05f, 100.0f, 0.0f);
cLib_addCalc2(&field_0x5a8, 0.0f, HREG_F(1) + 0.1f, 10.0f);
+187 -65
View File
@@ -10,40 +10,50 @@
#include "SSystem/SComponent/c_math.h"
#include "d/d_com_inf_game.h"
#include "d/d_bg_s.h"
#include "d/d_bg_w.h"
#include "f_op/f_op_actor_mng.h"
namespace daObjLadder {
namespace {
struct Attr {
/* 0x00 */ f32 field_0x00;
/* 0x04 */ f32 field_0x04;
/* 0x08 */ f32 field_0x08;
/* 0x0C */ f32 field_0x0c;
/* 0x10 */ u8 field_0x10;
/* 0x11 */ u8 field_0x11;
/* 0x12 */ u8 field_0x12;
/* 0x13 */ u8 field_0x13;
/* 0x14 */ u8 field_0x14;
/* 0x16 */ s16 field_0x16;
/* 0x18 */ s16 field_0x18;
/* 0x1A */ s16 vibrationTimer;
/* 0x1C */ f32 field_0x1c;
/* 0x20 */ f32 field_0x20;
struct Attr_c {
/* 0x00 */ f32 gravity;
/* 0x04 */ f32 viscous_resistance;
/* 0x08 */ f32 inertia_resistance;
/* 0x0C */ f32 reflectance;
/* 0x10 */ u8 num_of_bounces;
/* 0x11 */ u8 bound_vol_0;
/* 0x12 */ u8 bound_vol_1;
/* 0x13 */ u8 bound_vol_2;
/* 0x14 */ u8 bound_vol_3;
/* 0x16 */ s16 vibration_speed_x;
/* 0x18 */ s16 vibration_speed_y;
/* 0x1A */ s16 vibration_timer;
/* 0x1C */ f32 vibration_amp_x;
/* 0x20 */ f32 vibration_amp_y;
};
static Attr const L_attr = {
-3.0f, 0.005f, 0.0005f,
0.5f, 0x03, 0x4B, 0x32, 0x2D, 0x28, 0x4E20,
0x3CC3, 0x0F, 2.0f, 1.0f,
static Attr_c const L_attr = {
-3.0f,
0.005f,
0.0005f,
0.5f,
//
3,
75,
50,
45,
40,
//
20000,
15555,
15,
2.0f,
1.0f,
};
inline static const Attr& attr() {
inline static const Attr_c& attr() {
return L_attr;
}
char const Act_c::M_arcname[5] = "Mhsg";
struct AttrType {
/* 0x0 */ s16 field_0x0;
/* 0x2 */ s16 field_0x2;
@@ -59,10 +69,110 @@ static AttrType L_attr_type[6] = {
{ 0x06, 0x0E, 300.0f},
};
static inline const AttrType& attr_type(Act_c::Type_e type) {
static inline const AttrType& attr_type(Type_e type) {
return L_attr_type[type];
}
#if DEBUG
class Hio_c : public JORReflexible {
public:
Hio_c();
virtual ~Hio_c() {}
void default_set();
void ct();
void dt();
void listenPropertyEvent(const JORPropertyEvent*);
void genMessage(JORMContext*);
Attr_c attr;
int mCount;
bool field_0x2c;
bool field_0x2d;
};
Hio_c::Hio_c() {
mCount = 0;
field_0x2c = false;
field_0x2d = false;
default_set();
}
void Hio_c::default_set() {
attr = L_attr;
}
void Hio_c::ct() {
if (mCount++ == 0) {
// ladder
daObj::HioVarious_c::init(this, "はしご");
}
}
void Hio_c::dt() {
if (--mCount == 0) {
daObj::HioVarious_c::clean(this);
}
}
void Hio_c::genMessage(JORMContext* ctx) {
// ladder
ctx->genLabel("§ はしご §\n", 0, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
// reset to initial position
ctx->genButton("初期位置に", 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
// attack
ctx->genButton("アタック", 2, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18);
// gravity
ctx->genSlider("重力", &attr.gravity, -30.0f, 0.0f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
// viscous resistance
ctx->genSlider("粘性抵抗", &attr.viscous_resistance, 0.0f, 0.1f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
// inertia resistance
ctx->genSlider("慣性抵抗", &attr.inertia_resistance, 0.0f, 0.1f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
// reflectance
ctx->genSlider("反射率", &attr.reflectance, 0.0f, 1.0f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
//
// number of bounces
ctx->genSlider("バウンド回数", &attr.num_of_bounces, 0, 10, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
// Bound Vol_0, 1, 2, 3
ctx->genSlider("バウンド Vol_0", &attr.bound_vol_0, 0, 100, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
ctx->genSlider("バウンド Vol_1", &attr.bound_vol_1, 0, 100, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
ctx->genSlider("バウンド Vol_2", &attr.bound_vol_2, 0, 100, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
ctx->genSlider("バウンド Vol_3", &attr.bound_vol_3, 0, 100, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
//
// vibration speed x, y
ctx->genSlider("vib 速度 x", &attr.vibration_speed_x, 0, 0x7fff, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
ctx->genSlider("vib 速度 y", &attr.vibration_speed_y, 0, 0x7fff, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
// vibration time
ctx->genSlider("vib 時間", &attr.vibration_timer, 0, 50, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
// vibration amplitude x, y
ctx->genSlider("vib 振幅 x", &attr.vibration_amp_x, 0.0f, 5.0f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
ctx->genSlider("vib 振幅 y", &attr.vibration_amp_y, 0.0f, 5.0f, 0, NULL, 0xffff, 0xffff, 0x200, 0x18);
}
void Hio_c::listenPropertyEvent(const JORPropertyEvent* property) {
JORReflexible::listenPropertyEvent(property);
switch ((u32)property->id) {
case 1: {
field_0x2c = true;
break;
}
case 2: {
field_0x2d = true;
break;
}
}
// TODO.
}
Hio_c L_hio;
#endif
}
char const Act_c::M_arcname[5] = "Mhsg";
int Act_c::CreateHeap() {
J3DModelData* model_data = (J3DModelData*)dComIfG_getObjectRes(M_arcname, attr_type(mType).field_0x0);
JUT_ASSERT(382, model_data != NULL);
@@ -94,7 +204,12 @@ int Act_c::Create() {
} else {
mode_wait_init();
}
if (mHeight <= -G_CM3D_F_INF) {
// "The ladder is falling <%s %d>\n"
OS_REPORT_ERROR("はしごは落ちる<%s %d>\n", "d_a_obj_ladder.cpp", 459);
}
return 1;
}
@@ -106,6 +221,9 @@ int Act_c::Mthd_Create() {
phase_state = MoveBGCreate(M_arcname, attr_type(mType).field_0x2,
dBgS_MoveBGProc_Trans, 0xcb0, NULL);
JUT_ASSERT(486, (phase_state == cPhs_COMPLEATE_e) || (phase_state == cPhs_ERROR_e));
#if DEBUG
L_hio.ct();
#endif
}
return phase_state;
}
@@ -115,6 +233,9 @@ int Act_c::Delete() {
}
int Act_c::Mthd_Delete() {
#if DEBUG
L_hio.dt();
#endif
int rv = MoveBGDelete();
dComIfG_resDelete(&mPhase, M_arcname);
return rv;
@@ -161,17 +282,17 @@ void Act_c::mode_demoreq() {
}
void Act_c::mode_vib_init() {
mVibrationTimer = attr().vibrationTimer;
mVibrationTimer = attr().vibration_timer;
field_0x610 = 0;
field_0x612 = 0;
mMode = MODE_VIB;
}
void Act_c::mode_vib() {
field_0x610 += attr().field_0x16;
field_0x612 += attr().field_0x18;
field_0x614 = cM_scos(field_0x610) * attr().field_0x1c;
field_0x618 = cM_scos(field_0x612) * attr().field_0x20;
field_0x610 += attr().vibration_speed_x;
field_0x612 += attr().vibration_speed_y;
field_0x614 = cM_scos(field_0x610) * attr().vibration_amp_x;
field_0x618 = cM_scos(field_0x612) * attr().vibration_amp_y;
if (--mVibrationTimer <= 0) {
mode_drop_init();
}
@@ -180,27 +301,27 @@ void Act_c::mode_vib() {
void Act_c::mode_drop_init() {
gravity = -5.0f;
speed.set(cXyz::Zero);
field_0x5b6 = attr().field_0x10;
field_0x5b6 = attr().num_of_bounces;
mMode = MODE_DROP;
}
void Act_c::mode_drop() {
daObj::posMoveF_stream(this, NULL, &cXyz::Zero, attr().field_0x04, attr().field_0x08);
daObj::posMoveF_stream(this, NULL, &cXyz::Zero, attr().viscous_resistance, attr().inertia_resistance);
if (current.pos.y < mHeight) {
if (field_0x5b6 == attr().field_0x10) {
if (field_0x5b6 == attr().num_of_bounces) {
fopAcM_seStart(this, Z2SE_SY_DUMMY, dComIfG_Bgsp().GetMtrlSndId(mGndChk));
dComIfGp_getVibration().StartShock(4, 0x1f, cXyz(0.0f, 1.0f, 0.0f));
} else {
int uVar7;
int iVar5 = attr().field_0x10 - field_0x5b6;
int iVar5 = attr().num_of_bounces - field_0x5b6;
if (iVar5 == 1) {
uVar7 = attr().field_0x11;
uVar7 = attr().bound_vol_0;
} else if (iVar5 == 2) {
uVar7 = attr().field_0x12;
uVar7 = attr().bound_vol_1;
} else if (iVar5 == 3) {
uVar7 = attr().field_0x13;
uVar7 = attr().bound_vol_2;
} else {
uVar7 = attr().field_0x14;
uVar7 = attr().bound_vol_3;
}
fopAcM_seStart(this, Z2SE_SY_DUMMY, uVar7);
}
@@ -263,35 +384,36 @@ int Act_c::Draw() {
return 1;
}
static int Mthd_Create(void* i_this) {
return ((Act_c*)i_this)->Mthd_Create();
namespace {
static int Mthd_Create(void* i_this) {
return ((Act_c*)i_this)->Mthd_Create();
}
static int Mthd_Delete(void* i_this) {
return ((Act_c*)i_this)->Mthd_Delete();
}
static int Mthd_Execute(void* i_this) {
return ((Act_c*)i_this)->MoveBGExecute();
}
static int Mthd_Draw(void* i_this) {
return ((Act_c*)i_this)->MoveBGDraw();
}
static int Mthd_IsDelete(void* i_this) {
return ((Act_c*)i_this)->MoveBGIsDelete();
}
static actor_method_class Mthd_Table = {
(process_method_func)Mthd_Create,
(process_method_func)Mthd_Delete,
(process_method_func)Mthd_Execute,
(process_method_func)Mthd_IsDelete,
(process_method_func)Mthd_Draw,
};
}
static int Mthd_Delete(void* i_this) {
return ((Act_c*)i_this)->Mthd_Delete();
}
static int Mthd_Execute(void* i_this) {
return ((Act_c*)i_this)->MoveBGExecute();
}
static int Mthd_Draw(void* i_this) {
return ((Act_c*)i_this)->MoveBGDraw();
}
static int Mthd_IsDelete(void* i_this) {
return ((Act_c*)i_this)->MoveBGIsDelete();
}
static actor_method_class Mthd_Table = {
(process_method_func)Mthd_Create,
(process_method_func)Mthd_Delete,
(process_method_func)Mthd_Execute,
(process_method_func)Mthd_IsDelete,
(process_method_func)Mthd_Draw,
};
}
}
actor_process_profile_definition g_profile_Obj_Ladder = {