d_a_obj debug (#3089)

This commit is contained in:
Jcw87 2026-02-11 00:06:12 -08:00 committed by GitHub
parent d8a4157b9f
commit b9de3375b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 327 additions and 31 deletions

View File

@ -24,14 +24,79 @@ T PrmAbstract(const fopAc_ac_c* i_actor, T i_nbits, T i_shift) {
class HioVarious_c : public JORReflexible {
public:
HioVarious_c();
virtual void genMessage(JORMContext*);
static void init(JORReflexible* node_ptr, const char* node_name);
static void clean(JORReflexible* node_ptr);
void genMessage(JORMContext*);
static HioVarious_c M_hio;
/* 0x04 */ JORReflexible* node_ptrs[16];
/* 0x44 */ const char* node_names[16];
/* 0x84 */ u8 field_0x84;
/* 0x84 */ s8 field_0x84;
};
class HioThrow_c : public JORReflexible {
public:
HioThrow_c();
#if DEBUG
virtual void listen(u32 command, const JOREvent* event) { JORReflexible::listen(command, event); }
virtual void genObjectInfo(const JORGenEvent* event) { JORReflexible::genObjectInfo(event); }
virtual void listenNodeEvent(const JORNodeEvent* event) { JORReflexible::listenNodeEvent(event); }
virtual void listenPropertyEvent(const JORPropertyEvent* event) { JORReflexible::listenPropertyEvent(event); }
#endif
virtual void genMessage(JORMContext*);
static void init(JORReflexible* node_ptr, const char* node_name);
static void clean(JORReflexible* node_ptr);
static HioThrow_c M_hio;
static cXyz M_throw_pos_st;
static cXyz M_throw_pos_now;
/* 0x04 */ JORReflexible* node_ptrs[20];
/* 0x54 */ const char* node_names[20];
/* 0xA4 */ s8 field_0xa4;
};
class HioField_c : public JORReflexible {
public:
HioField_c();
virtual void genMessage(JORMContext*);
static HioField_c M_hio;
/* 0x04 */ JORReflexible* node_ptrs[16];
/* 0x44 */ const char* node_names[16];
/* 0x84 */ s8 field_0x84;
};
class HioSpot_c : public JORReflexible {
public:
HioSpot_c();
virtual void genMessage(JORMContext*);
static HioSpot_c M_hio;
/* 0x04 */ JORReflexible* node_ptrs[16];
/* 0x44 */ const char* node_names[16];
/* 0x84 */ s8 field_0x84;
};
class HioObj_c : public JORReflexible {
public:
HioObj_c();
virtual void genMessage(JORMContext*);
static void init();
static void clean();
static HioObj_c M_hio;
static const char* const M_node_name[];
static JORReflexible* const M_node_ptr[];
/* 0x04 */ s8 M_no;
};
}; // namespace daObj

View File

@ -5,13 +5,13 @@
struct ResourceData {
const char* get_arcName() const { return mArcName; }
s16 get_bmdName() const { return mBmdName; }
s16 get_btk1Name() const { return mBtkName; }
s16 get_bpk1Name() const { return mBpkName; }
s16 get_bck1Name() const { return mBckName; }
s16 get_bxa1Name() const { return mBxaName; }
s16 get_brk1Name() const { return mBrkName; }
s16 get_btp1Name() const { return mBtpName; }
const s16 get_bmdName() const { return mBmdName; }
const s16 get_btk1Name() const { return mBtkName; }
const s16 get_bpk1Name() const { return mBpkName; }
const s16 get_bck1Name() const { return mBckName; }
const s16 get_bxa1Name() const { return mBxaName; }
const s16 get_brk1Name() const { return mBrkName; }
const s16 get_btp1Name() const { return mBtpName; }
f32 get_scale() const { return mScale; }
f32 get_offsetY() const { return mOffsetY; }
s16 get_angleX() const { return mAngle.x; }

View File

@ -11,13 +11,13 @@ BOOL e_wb_class::checkWait() {
void e_wb_class::setPlayerRideNow() {
mActionID = ACT_PL_RIDE_NOW;
mActionMode = 0;
mStatusFlags |= 3;
mStatusFlags |= u16(3);
}
void e_wb_class::setPlayerRide() {
mActionID = ACT_PL_RIDE;
mActionMode = 0;
mStatusFlags |= 3;
mStatusFlags |= u16(3);
mZ2Ride.setLinkRiding(true);
}
@ -30,7 +30,7 @@ void e_wb_class::getOff() {
}
mActionMode = 0;
mStatusFlags &= ~3;
mStatusFlags &= u16(~3);
mZ2Ride.setLinkRiding(false);
}

View File

@ -7,6 +7,11 @@
#include "d/d_a_item_static.h"
static void dummy(daItem_c* item) {
item->setFlag(0);
item->clrFlag(0);
}
u32 daItem_c::startCtrl() {
setFlag(FLAG_NO_MOVE_e);
return 1;

View File

@ -14,6 +14,11 @@ u8 daItemBase_c::getItemNo() {
return m_itemNo;
}
static void dummy(dItem_data* data) {
data->getR(0);
data->getH(0);
}
void daItemBase_c::hide() {
cLib_offBit<u8>(field_0x92b, 1);
}
@ -31,7 +36,7 @@ void daItemBase_c::changeDraw() {
}
bool daItemBase_c::chkDraw() {
return cLib_checkBit<u8>(field_0x92b, 1);
return cLib_checkBit<u8>(u8(field_0x92b), 1);
}
void daItemBase_c::dead() {
@ -39,7 +44,7 @@ void daItemBase_c::dead() {
}
bool daItemBase_c::chkDead() {
return cLib_checkBit<u8>(field_0x92b, 2);
return cLib_checkBit<u8>(u8(field_0x92b), 2);
}
int CheckItemCreateHeap(fopAc_ac_c* i_this) {

View File

@ -6,6 +6,7 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_a_obj.h"
#include "JSystem/JHostIO/JORServer.h"
#include "SSystem/SComponent/c_math.h"
#include "d/actor/d_a_player.h"
#include "d/d_com_inf_game.h"
@ -16,12 +17,14 @@ namespace daObj {
void eff_break_tsubo(fopAc_ac_c* i_actor, cXyz i_scale, int i_type) {
J3DModelData* tubo_bmd = (J3DModelData*)dComIfG_getObjectRes("Always", 0x20);
J3DAnmTexPattern* tubo_btp = (J3DAnmTexPattern*)dComIfG_getObjectRes("Always", 0x42);
JUT_ASSERT(29, tubo_bmd != NULL);
JUT_ASSERT(30, tubo_btp != NULL);
JPABaseEmitter* emitter = dComIfGp_particle_set(
ID_ZI_J_M_TUBOHAHEN, &i_actor->current.pos, NULL, NULL, 0xFF,
&dPa_modelEcallBack::mEcallback, fopAcM_GetRoomNo(i_actor), NULL, NULL, &i_scale);
&dPa_modelEcallBack::getEcallback(), fopAcM_GetRoomNo(i_actor), NULL, NULL, &i_scale);
dPa_modelEcallBack::setModel(emitter, tubo_bmd, i_actor->tevStr, 3, tubo_btp, 0, i_type);
dPa_modelEcallBack::setModel(emitter, tubo_bmd, i_actor->tevStr, 3, tubo_btp, i_type);
dComIfGp_particle_set(ID_ZI_J_TUBOHAHEN, &i_actor->current.pos, NULL, NULL, 0xFF,
dPa_control_c::getTsuboSelectTexEcallBack(i_type),
@ -40,6 +43,12 @@ void make_eff_break_kotubo2(fopAc_ac_c* i_actor) {
eff_break_tsubo(i_actor, scale, 1);
}
void make_eff_break_ootubo(fopAc_ac_c* i_actor) {
static cXyz scale(1.0f, 1.0f, 1.0f);
eff_break_tsubo(i_actor, scale, 2);
}
void make_eff_break_gm_kotubo(fopAc_ac_c* i_actor) {
static cXyz scale(1.0f, 1.0f, 1.0f);
@ -102,12 +111,13 @@ void posMoveF_grade_acc(cXyz* pos, const fopAc_ac_c* i_actor, cXyz const* param_
void posMoveF_grade(fopAc_ac_c* i_actor, cXyz const* param_1, cXyz const* stream_spd, f32 param_3,
f32 param_4, cXyz const* param_5, f32 friction, f32 no_grade_cos,
cXyz const* param_8) {
JUT_ASSERT(0, stream_spd != NULL);
{ int unused; }
JUT_ASSERT(321, stream_spd != NULL);
cXyz spAC;
posMoveF_resist_acc(&spAC, i_actor, stream_spd, param_3, param_4);
JUT_ASSERT(0, (friction >= 0.0f) && (friction < 1.0f) && (no_grade_cos >= 0.0f) &&
JUT_ASSERT(330, (friction >= 0.0f) && (friction < 1.0f) && (no_grade_cos >= 0.0f) &&
(no_grade_cos <= 1.0f));
cXyz spB8;
@ -147,7 +157,7 @@ void quat_rotBaseY(Quaternion* quat, cXyz const& param_1) {
f32 var_f30 = sp4C.abs2();
if (var_f30 > 9.999999E-9f) {
cXyz sp58 = param_1 / var_f31;
f32 var_f1 = acos(cXyz::BaseY.inprod(sp58));
f32 var_f1 = acosf(cXyz::BaseY.inprod(sp58));
sp4C /= JMAFastSqrt(var_f30);
mDoMtx_quatRotAxisRad(quat, &sp4C, var_f1);
} else {
@ -158,6 +168,10 @@ void quat_rotBaseY(Quaternion* quat, cXyz const& param_1) {
}
}
static void dummy1(fopAc_ac_c* actor) {
fopAcM_SetRoomNo(actor, 0);
}
void HitSeStart(cXyz const* i_sePos, int i_roomNo, dCcD_GObjInf const* i_CcObj, u32 param_3) {
int hit_se = const_cast<dCcD_GObjInf*>(i_CcObj)->GetTgHitObjSe();
fopAc_ac_c* hit_actor = const_cast<dCcD_GObjInf*>(i_CcObj)->GetTgHitAc();
@ -174,10 +188,11 @@ void HitSeStart(cXyz const* i_sePos, int i_roomNo, dCcD_GObjInf const* i_CcObj,
} else if (hit_obj->ChkAtType(AT_TYPE_HOOKSHOT)) {
sfx = Z2SE_HIT_HOOKSHOT_REBOUND;
} else {
if (fopAcM_GetProfName(hit_actor) == PROC_ALINK &&
daPy_py_c::checkMasterSwordEquip())
{
master_sword_hit = true;
if (fopAcM_GetProfName(hit_actor) == PROC_ALINK) {
daPy_py_c* sp14 = (daPy_py_c*)hit_actor;
if (sp14->checkMasterSwordEquip()) {
master_sword_hit = true;
}
}
if (hit_se == dCcD_SE_WOOD) {
@ -192,17 +207,222 @@ void HitSeStart(cXyz const* i_sePos, int i_roomNo, dCcD_GObjInf const* i_CcObj,
}
}
u32 sp10 = param_3 & 0xFF;
s8 reverb = dComIfGp_getReverb(i_roomNo);
mDoAud_seStart(sfx, i_sePos, param_3 & 0xFF, (s8)reverb);
mDoAud_seStart(sfx, i_sePos, sp10, (s8)reverb);
}
}
static cXyz dummy1(cCcD_CylAttr* cyl) {
return cyl->GetCoCP();
void get_wind_spd(fopAc_ac_c*, float) {
static cXyz total_spd(1.0f, 1.0f, 1.0f);
}
static cXyz dummy2(cCcD_SphAttr* sph) {
return sph->GetCoCP();
void get_path_spd(cBgS_PolyInfo&, float) {
static cXyz path_spd(1.0f, 1.0f, 1.0f);
}
static void dummy2(cCcD_SphAttr* sph, dCcD_GObjInf* objInf, cCcD_CylAttr* cyl) {
sph->GetCoCP();
objInf->GetTgHitPosP();
objInf->GetTgRVecP();
cyl->GetCoCP();
}
#if DEBUG
HioVarious_c HioVarious_c::M_hio;
HioVarious_c::HioVarious_c() {
field_0x84 = -1;
for (int i = 0; i < ARRAY_SIZE(M_hio.node_ptrs); i++) {
node_ptrs[i] = NULL;
node_names[i] = NULL;
}
}
void HioVarious_c::init(JORReflexible* node_ptr, const char* node_name) {
JUT_ASSERT(849, node_ptr && node_name);
int i;
for (i = 0; i < ARRAY_SIZE(M_hio.node_ptrs); i++) {
if (M_hio.node_ptrs[i]) {
continue;
}
M_hio.node_ptrs[i] = node_ptr;
M_hio.node_names[i] = node_name;
JORMContext* mctx = attachJORMContext(12);
mctx->startNode(&M_hio, 1, node_name, node_ptr, 0, 0);
node_ptr->genMessage(mctx);
mctx->endNode();
releaseJORMContext(mctx);
break;
}
if (i >= ARRAY_SIZE(M_hio.node_ptrs)) {
OSReport_Error("汎用オブジェノードバッファがパンク(%s %d)\n", __FILE__, 872);
}
}
void HioVarious_c::clean(JORReflexible* node_ptr) {
JUT_ASSERT(882, node_ptr);
int i;
for (i = 0; i < ARRAY_SIZE(M_hio.node_ptrs); i++) {
if (M_hio.node_ptrs[i] != node_ptr) {
continue;
}
JORMContext* mctx = attachJORMContext(5);
M_hio.node_ptrs[i] = NULL;
M_hio.node_names[i] = NULL;
mctx->invalidNode(node_ptr, 3);
releaseJORMContext(mctx);
break;
}
if (i >= ARRAY_SIZE(M_hio.node_ptrs)) {
OSReport_Error("汎用オブジェノード削除失敗(%s %d)\n", __FILE__, 898);
}
}
void HioVarious_c::genMessage(JORMContext* mctx) {
for (int i = 0; i < ARRAY_SIZE(node_ptrs); i++) {
if (node_ptrs[i]) {
mctx->genNode(node_names[i], node_ptrs[i], 0, 0);
}
}
}
HioThrow_c HioThrow_c::M_hio;
cXyz HioThrow_c::M_throw_pos_st(cXyz::Zero);
cXyz HioThrow_c::M_throw_pos_now(cXyz::Zero);
HioThrow_c::HioThrow_c() {
field_0xa4 = -1;
for (int i = 0; i < ARRAY_SIZE(M_hio.node_ptrs); i++) {
node_ptrs[i] = NULL;
node_names[i] = NULL;
}
}
void HioThrow_c::init(JORReflexible* node_ptr, const char* node_name) {
JUT_ASSERT(945, node_ptr && node_name);
int i;
for (i = 0; i < ARRAY_SIZE(M_hio.node_ptrs); i++) {
if (M_hio.node_ptrs[i]) {
continue;
}
M_hio.node_ptrs[i] = node_ptr;
M_hio.node_names[i] = node_name;
JORMContext* mctx = attachJORMContext(12);
mctx->startNode(&M_hio, 1, node_name, node_ptr, 0, 0);
node_ptr->genMessage(mctx);
mctx->endNode();
releaseJORMContext(mctx);
break;
}
if (i >= ARRAY_SIZE(M_hio.node_ptrs)) {
OSReport_Error("投げ物ノードバッファがパンク(%s %d)\n", __FILE__, 970);
}
}
void HioThrow_c::clean(JORReflexible* node_ptr) {
JUT_ASSERT(980, node_ptr);
int i;
for (i = 0; i < ARRAY_SIZE(M_hio.node_ptrs); i++) {
if (M_hio.node_ptrs[i] != node_ptr) {
continue;
}
JORMContext* mctx = attachJORMContext(5);
M_hio.node_ptrs[i] = NULL;
M_hio.node_names[i] = NULL;
mctx->invalidNode(node_ptr, 3);
releaseJORMContext(mctx);
break;
}
if (i >= ARRAY_SIZE(M_hio.node_ptrs)) {
OSReport_Error("投げ物ノード削除失敗(%s %d)\n", __FILE__, 997);
}
}
void HioThrow_c::genMessage(JORMContext* mctx) {
for (int i = 0; i < ARRAY_SIZE(node_ptrs); i++) {
if (node_ptrs[i]) {
mctx->genNode(node_names[i], node_ptrs[i], 0, 0);
}
}
}
static void dummy3(JORMContext* mctx) {
OS_REPORT("水平距離");
OS_REPORT("フレーム");
OS_REPORT("水平距離 %-6.1f");
OS_REPORT("最頂点 %-6.1f");
OS_REPORT("フレーム %-3d");
OS_REPORT("フィールドオブジェノードバッファがパンク(%s %d)\n");
OS_REPORT("フィールドオブジェノード削除失敗(%s %d)\n");
OS_REPORT("スポットオブジェノードバッファがパンク(%s %d)\n");
OS_REPORT("スポットオブジェノード削除失敗(%s %d)\n");
mctx->updateLabel(0, 0, NULL);
}
HioField_c HioField_c::M_hio;
HioField_c::HioField_c() {
field_0x84 = -1;
for (int i = 0; i < ARRAY_SIZE(M_hio.node_ptrs); i++) {
node_ptrs[i] = NULL;
node_names[i] = NULL;
}
}
void HioField_c::genMessage(JORMContext* mctx) {
for (int i = 0; i < ARRAY_SIZE(node_ptrs); i++) {
if (node_ptrs[i]) {
mctx->genNode(node_names[i], node_ptrs[i], 0, 0);
}
}
}
HioSpot_c HioSpot_c::M_hio;
HioSpot_c::HioSpot_c() {
field_0x84 = -1;
for (int i = 0; i < ARRAY_SIZE(M_hio.node_ptrs); i++) {
node_ptrs[i] = NULL;
node_names[i] = NULL;
}
}
void HioSpot_c::genMessage(JORMContext* mctx) {
for (int i = 0; i < ARRAY_SIZE(node_ptrs); i++) {
if (node_ptrs[i]) {
mctx->genNode(node_names[i], node_ptrs[i], 0, 0);
}
}
}
HioObj_c HioObj_c::M_hio;
const char* const HioObj_c::M_node_name[4] = { "汎用オブジェ", "投げ物", "フィールドオブジェ", "スポット" };
JORReflexible* const HioObj_c::M_node_ptr[4] = { &HioVarious_c::M_hio, &HioThrow_c::M_hio, &HioField_c::M_hio, &HioSpot_c::M_hio };
HioObj_c::HioObj_c() {
M_no = -1;
}
void HioObj_c::init() {
JUT_ASSERT(1332, M_hio.M_no < 0);
M_hio.M_no = mDoHIO_createChild("オブジェクト", &M_hio);
}
void HioObj_c::clean() {
mDoHIO_deleteChild(M_hio.M_no);
M_hio.M_no = -1;
}
void HioObj_c::genMessage(JORMContext* mctx) {
for (int i = 0; i < ARRAY_SIZE(M_node_ptr); i++) {
mctx->genNode(M_node_name[i], M_node_ptr[i], 0, 0);
}
}
#endif
} // namespace daObj

View File

@ -42,10 +42,11 @@ ResourceData const daShopItem_c::mData[23] = {
};
int CheckShopItemCreateHeap(fopAc_ac_c* i_this) {
daShopItem_c* a_this = static_cast<daShopItem_c*>(i_this);
daShopItem_c* a_this1 = static_cast<daShopItem_c*>(i_this);
daShopItem_c* a_this2 = static_cast<daShopItem_c*>(i_this);
u8 a_ShopItemID = a_this->getShopItemID();
return a_this->CreateItemHeap(daShopItem_c::mData[a_ShopItemID].get_arcName(),
u8 a_ShopItemID = a_this2->getShopItemID();
return a_this1->CreateItemHeap(daShopItem_c::mData[a_ShopItemID].get_arcName(),
daShopItem_c::mData[a_ShopItemID].get_bmdName(),
daShopItem_c::mData[a_ShopItemID].get_btk1Name(),
daShopItem_c::mData[a_ShopItemID].get_bpk1Name(),