summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland <roland@wildpaws.xyz>2026-03-01 17:36:56 -0600
committerGitHub <noreply@github.com>2026-03-01 18:36:56 -0500
commit60b0d94e2a63d873bfc035228d080fe72a4e0aff (patch)
tree16119fe0f9e3636c4e57ca48d306daa780741b1a
parent034b90bfdc9a71c1a1ae6f46ba5a3fc46eccf340 (diff)
d_a_obj_auzu (#935)
* 59% matching in .text * d_a_obj_auzu 100% for demo and retail * Named all fields of daObjAuzu::Act_c * All fields named
-rwxr-xr-xconfigure.py2
-rw-r--r--include/d/actor/d_a_obj_auzu.h72
-rw-r--r--include/d/actor/d_a_ship.h12
-rw-r--r--include/f_pc/f_pc_manager.h3
-rw-r--r--src/d/actor/d_a_obj_auzu.cpp247
5 files changed, 298 insertions, 38 deletions
diff --git a/configure.py b/configure.py
index c812967e..ed657ebc 100755
--- a/configure.py
+++ b/configure.py
@@ -1684,7 +1684,7 @@ config.libs = [
ActorRel(Matching, "d_a_obj_ajav"),
ActorRel(NonMatching, "d_a_obj_apzl"),
ActorRel(NonMatching, "d_a_obj_ashut"),
- ActorRel(NonMatching, "d_a_obj_auzu"),
+ ActorRel(Matching, "d_a_obj_auzu"),
ActorRel(NonMatching, "d_a_obj_buoyflag"),
ActorRel(Matching, "d_a_obj_buoyrace"),
ActorRel(Matching, "d_a_obj_correct"),
diff --git a/include/d/actor/d_a_obj_auzu.h b/include/d/actor/d_a_obj_auzu.h
index 90495ea7..e32cc5d0 100644
--- a/include/d/actor/d_a_obj_auzu.h
+++ b/include/d/actor/d_a_obj_auzu.h
@@ -1,42 +1,78 @@
#ifndef D_A_OBJ_AUZU_H
#define D_A_OBJ_AUZU_H
+#include "d/d_a_obj.h"
#include "f_op/f_op_actor.h"
+#include "m_Do/m_Do_ext.h"
class J3DMaterial;
namespace daObjAuzu {
+ struct Attr_c {
+ /* 0x00 */ f32 mRadiusMult;
+ /* 0x04 */ f32 mOuterActivationMult;
+ /* 0x08 */ f32 mInnerActivationMult;
+ /* 0x0C */ f32 mAnmSpeed;
+ };
+
class Act_c : public fopAc_ac_c {
public:
- void attr() const {}
- bool is_appear() const { return field_0x2B4 > 0.999f; }
- void prm_get_appear() const {}
- void prm_get_linkID() const {}
- void prm_get_swSave() const {}
- void prm_get_type() const {}
- void prm_make_squid() {}
- void to_appear() { field_0x2B8 = true; }
- void to_disappear() { field_0x2B8 = false; }
+ enum Prm_e {
+ PRM_APPEAR_W = 0x1,
+ PRM_APPEAR_S = 0x10,
+
+ PRM_LINK_ID_W = 0x8,
+ PRM_LINK_ID_S = 0x8,
+
+ PRM_SWSAVE_W = 0x8,
+ PRM_SWSAVE_S = 0x0,
+
+ PRM_TYPE_W = 0x4,
+ PRM_TYPE_S = 0x14
+ };
+ public:
+ const Attr_c& attr() const { return M_attr[mType]; }
+ bool is_appear() const { return mScaleAnimFactor > 0.999f; }
+ s32 prm_get_appear() const { return daObj::PrmAbstract(this, PRM_APPEAR_W, PRM_APPEAR_S); }
+ s32 prm_get_linkID() const { return daObj::PrmAbstract(this, PRM_LINK_ID_W, PRM_LINK_ID_S); }
+ s32 prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_SWSAVE_W, PRM_SWSAVE_S); }
+ s32 prm_get_type() const { return daObj::PrmAbstract(this, PRM_TYPE_W, PRM_TYPE_S); }
+ static s32 prm_make_squid() {
+ return
+ 0x1 << 20 | // type
+ 0x1 << 16 | // appear
+ 0x00 << 8 | // linkID
+ 0xFF << 0; // swSave
+ }
+ void to_appear() { mbToAppear = true; }
+ void to_disappear() { mbToAppear = false; }
- void solidHeapCB(fopAc_ac_c*);
- void create_heap();
+ bool create_heap();
cPhs_State _create();
bool _delete();
- void is_exist() const;
+ bool is_exist() const;
void set_mtx();
void init_mtx();
void set_state_map();
void ship_whirl();
void bgm_start();
bool _execute();
- void set_material(J3DMaterial*, unsigned char);
bool _draw();
-
+ static BOOL solidHeapCB(fopAc_ac_c*);
+ static void set_material(J3DMaterial*, u8);
+ static const char M_arcname[];
+ static const Attr_c M_attr[2];
public:
- /* 0x290 */ u8 field_0x290[0x2B4 - 0x290];
- /* 0x2B4 */ f32 field_0x2B4;
- /* 0x2B8 */ bool field_0x2B8;
- /* 0x2B9 */ u8 field_0x2B9[0x2C0 - 0x2B9];
+ /* 0x290 */ request_of_phase_process_class mPhs;
+ /* 0x298 */ J3DModel* mpModel;
+ /* 0x29C */ mDoExt_btkAnm mBtkAnm;
+ /* 0x2B0 */ s32 mType;
+ /* 0x2B4 */ f32 mScaleAnimFactor;
+ /* 0x2B8 */ bool mbToAppear;
+ /* 0x2B9 */ bool mbIsExist;
+ /* 0x2BA */ bool mbBgmStarted;
+ /* 0x2BB */ /* 1 byte of alignment padding */
+ /* 0x2BC */ fpc_ProcID mKytagPcId;
}; // Size: 0x2C0
};
diff --git a/include/d/actor/d_a_ship.h b/include/d/actor/d_a_ship.h
index 596fbb99..47d5651c 100644
--- a/include/d/actor/d_a_ship.h
+++ b/include/d/actor/d_a_ship.h
@@ -186,8 +186,16 @@ public:
void onShortHitFlg() { onStateFlg(daSFLG_UNK20_e); }
void onStateFlg(daSHIP_SFLG flag) { mStateFlag |= flag; }
void onTornadoFlg(u32 tornadoID) { mTornadoID = tornadoID; }
- void onWhirlFlg(u32, s16) {}
- void onWhirlFlgDirect(u32, s16) {}
+ void onWhirlFlg(u32 whirlID, s16 linkID) {
+ mWhirlID = whirlID;
+ m03B2 = linkID;
+ m0352 = 1;
+ }
+ void onWhirlFlgDirect(u32 whirlID, s16 linkID) {
+ mWhirlID = whirlID;
+ m03B2 = linkID;
+ m0352 = 0;
+ }
void setAtnPos(const cXyz* pPos) {
onStateFlg(daSFLG_UNK1000000_e);
m1068 = *pPos;
diff --git a/include/f_pc/f_pc_manager.h b/include/f_pc/f_pc_manager.h
index 5bbcdf60..8c5e6106 100644
--- a/include/f_pc/f_pc_manager.h
+++ b/include/f_pc/f_pc_manager.h
@@ -18,6 +18,9 @@ typedef int (*fpcM_DrawIteraterFunc)(void*, void*);
inline fpc_ProcID fpcM_GetID(void* pProc) {
return pProc != NULL ? ((base_process_class*)pProc)->mBsPcId : fpcM_ERROR_PROCESS_ID_e;
}
+inline BOOL fpcM_IsErrorID(fpc_ProcID id) {
+ return id == fpcM_ERROR_PROCESS_ID_e ? TRUE : FALSE;
+}
inline s16 fpcM_GetName(void* pProc) {
return ((base_process_class*)pProc)->mProcName;
}
diff --git a/src/d/actor/d_a_obj_auzu.cpp b/src/d/actor/d_a_obj_auzu.cpp
index 361e03df..06c4e122 100644
--- a/src/d/actor/d_a_obj_auzu.cpp
+++ b/src/d/actor/d_a_obj_auzu.cpp
@@ -5,72 +5,285 @@
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_obj_auzu.h"
+#include "d/actor/d_a_kytag01.h"
+#include "d/actor/d_a_player_main.h"
+#include "d/actor/d_a_ship.h"
#include "d/d_procname.h"
#include "d/d_priority.h"
+#include "d/res/res_auzu.h"
+
+namespace daObjAuzu {
+namespace {
+f32 L_radius = 2500.0f;
+};
+
+const char Act_c::M_arcname[] = "Auzu";
+const Attr_c Act_c::M_attr[2] = {
+ {
+ /* mRadiusMult */ 1.5f,
+ /* mOuterActivationMult */ 1.5f,
+ /* mInnerActivationMult */ 1.3f,
+ /* mAnmSpeed */ 0.5f
+ },
+ {
+ /* mRadiusMult */ 2.0f,
+ /* mOuterActivationMult */ 2.0f,
+ /* mInnerActivationMult */ 2.0f,
+ /* mAnmSpeed */ 1.0f
+ }
+};
+};
/* 00000078-0000009C .text solidHeapCB__Q29daObjAuzu5Act_cFP10fopAc_ac_c */
-void daObjAuzu::Act_c::solidHeapCB(fopAc_ac_c*) {
- /* Nonmatching */
+BOOL daObjAuzu::Act_c::solidHeapCB(fopAc_ac_c* i_this) {
+ return ((Act_c*)i_this)->create_heap();
}
/* 0000009C-000001F8 .text create_heap__Q29daObjAuzu5Act_cFv */
-void daObjAuzu::Act_c::create_heap() {
- /* Nonmatching */
+bool daObjAuzu::Act_c::create_heap() {
+ bool create_result = false;
+ J3DModelData* mdl_data = static_cast<J3DModelData *>(dComIfG_getObjectRes(M_arcname, AUZU_BDL_AUZU));
+ JUT_ASSERT(226, mdl_data != NULL);
+ mpModel = mDoExt_J3DModel__create(mdl_data, 0x80000, 0x11000222);
+
+ J3DAnmTextureSRTKey* btk_data = static_cast<J3DAnmTextureSRTKey *>(dComIfG_getObjectRes(M_arcname, AUZU_BTK_AUZU));
+ JUT_ASSERT(236, btk_data != NULL);
+
+ int init_result = mBtkAnm.init(
+ mdl_data, btk_data, TRUE,
+ J3DFrameCtrl::EMode_LOOP, attr().mAnmSpeed,
+ 0, -1, false, FALSE
+ );
+
+ if (mpModel && init_result != 0) {
+ create_result = true;
+ }
+
+ return create_result;
}
/* 000001F8-000003B8 .text _create__Q29daObjAuzu5Act_cFv */
cPhs_State daObjAuzu::Act_c::_create() {
- /* Nonmatching */
+ cPhs_State state = cPhs_ERROR_e;
+ mType = prm_get_type();
+ fopAcM_SetupActor(this, daObjAuzu::Act_c);
+
+ mbIsExist = is_exist();
+ if (mbIsExist != 0) {
+ state = dComIfG_resLoad(&mPhs, M_arcname);
+ if (state == cPhs_COMPLEATE_e) {
+ if (fopAcM_entrySolidHeap(this, solidHeapCB, 3456)) {
+ fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
+ init_mtx();
+ f32 cull_xz = attr().mRadiusMult * 3000.0f;
+ fopAcM_setCullSizeBox(this,
+ -cull_xz, -30.0f, -cull_xz,
+ cull_xz, 30.0f, cull_xz
+ );
+ mbToAppear = false;
+
+ if (prm_get_appear() == 1) {
+ mScaleAnimFactor = 0.0f;
+ } else {
+ if (fopAcM_isSwitch(this, prm_get_swSave())) {
+ mScaleAnimFactor = 0.0f;
+ } else {
+ mScaleAnimFactor = 1.0f;
+ }
+ }
+
+ mbBgmStarted = false;
+ mKytagPcId = fpcM_ERROR_PROCESS_ID_e;
+ set_state_map();
+ } else {
+ state = cPhs_ERROR_e;
+ }
+ }
+ }
+
+ return state;
}
/* 0000045C-00000498 .text _delete__Q29daObjAuzu5Act_cFv */
bool daObjAuzu::Act_c::_delete() {
- /* Nonmatching */
+ if (mbIsExist != 0) {
+ dComIfG_resDeleteDemo(&mPhs, M_arcname);
+ }
+ return true;
}
/* 00000498-000004E8 .text is_exist__Q29daObjAuzu5Act_cCFv */
-void daObjAuzu::Act_c::is_exist() const {
- /* Nonmatching */
+bool daObjAuzu::Act_c::is_exist() const {
+ if (mType == 0) {
+ return dComIfGs_isEventBit(dSv_event_flag_c::ENDLESS_NIGHT);
+ }
+ return true;
}
/* 000004E8-00000554 .text set_mtx__Q29daObjAuzu5Act_cFv */
void daObjAuzu::Act_c::set_mtx() {
- /* Nonmatching */
+ mDoMtx_stack_c::transS(current.pos);
+ mDoMtx_stack_c::ZXYrotM(shape_angle);
+ mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
}
/* 00000554-000005B8 .text init_mtx__Q29daObjAuzu5Act_cFv */
void daObjAuzu::Act_c::init_mtx() {
- /* Nonmatching */
+ mpModel->setBaseScale(
+ cXyz(
+ scale.x * attr().mRadiusMult,
+ scale.y,
+ scale.z * attr().mRadiusMult
+ )
+ );
+ set_mtx();
}
/* 000005B8-00000624 .text set_state_map__Q29daObjAuzu5Act_cFv */
void daObjAuzu::Act_c::set_state_map() {
- /* Nonmatching */
+ if (prm_get_appear() != 1) {
+ if (is_appear()) {
+ fopAcM_OnStatus(this, fopAcStts_SHOWMAP_e);
+ } else {
+ fopAcM_OffStatus(this, fopAcStts_SHOWMAP_e);
+ }
+ }
}
/* 00000624-00000788 .text ship_whirl__Q29daObjAuzu5Act_cFv */
void daObjAuzu::Act_c::ship_whirl() {
- /* Nonmatching */
+ daShip_c* ship_p = dComIfGp_getShipActor();
+ if (ship_p && fopAcM_GetName(ship_p) == PROC_SHIP) {
+ f32 sqr_mag_xz = fopAcM_searchActorDistanceXZ2(this, ship_p);
+#if VERSION > VERSION_DEMO
+ f32 inner_activation = (daObjAuzu::L_radius * attr().mInnerActivationMult) *
+ (daObjAuzu::L_radius * attr().mInnerActivationMult);
+
+ f32 outer_activation = (daObjAuzu::L_radius * attr().mOuterActivationMult) *
+ (daObjAuzu::L_radius * attr().mOuterActivationMult);
+#else
+ f32 outer_activation = (daObjAuzu::L_radius * attr().mOuterActivationMult) *
+ (daObjAuzu::L_radius * attr().mOuterActivationMult);
+
+ f32 inner_activation = (daObjAuzu::L_radius * attr().mInnerActivationMult) *
+ (daObjAuzu::L_radius * attr().mInnerActivationMult);
+#endif
+ if (sqr_mag_xz < outer_activation) {
+ if (mScaleAnimFactor > 0.01f) {
+ bgm_start();
+ if (sqr_mag_xz < inner_activation) {
+ ship_p->onWhirlFlg(fopAcM_GetID(this), prm_get_linkID());
+ } else {
+ ship_p->onWhirlFlgDirect(fopAcM_GetID(this), prm_get_linkID());
+ }
+ } else {
+ ship_p->offWhirlFlg();
+ }
+ }
+ }
}
/* 00000788-000007DC .text bgm_start__Q29daObjAuzu5Act_cFv */
void daObjAuzu::Act_c::bgm_start() {
- /* Nonmatching */
+ if (mType == 0 && !mbBgmStarted) {
+ mbBgmStarted = true;
+ mDoAud_subBgmStart(JA_BGM_DIOCTA_BATTLE);
+ }
}
/* 000007DC-00000AF8 .text _execute__Q29daObjAuzu5Act_cFv */
bool daObjAuzu::Act_c::_execute() {
- /* Nonmatching */
+ f32 scale_target;
+#if VERSION > VERSION_JPN
+ set_mtx();
+#endif
+ if (dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e)) {
+ ship_whirl();
+ } else {
+ if (DEMO_SELECT(true, mScaleAnimFactor > 0.01f)) {
+ daPy_lk_c* link_p = daPy_getPlayerLinkActorClass();
+ fopAcM_searchActorDistanceXZ2(this, daPy_getPlayerLinkActorClass());
+ if (
+ fopAcM_searchActorDistanceXZ2(this, link_p) <
+ ((daObjAuzu::L_radius * attr().mOuterActivationMult) *
+ (daObjAuzu::L_radius * attr().mOuterActivationMult))
+ ) {
+ link_p->setWhirlId(fopAcM_GetID(this));
+ }
+ }
+ }
+
+ mBtkAnm.play();
+
+ if (prm_get_appear() == 1) {
+ if (mbToAppear) {
+ scale_target = 1.0f;
+ } else {
+ scale_target = 0.0f;
+ }
+ } else {
+ if (fopAcM_isSwitch(this, prm_get_swSave())) {
+ scale_target = 0.0f;
+ } else {
+ scale_target = 1.0f;
+ }
+ }
+
+ cLib_chaseF(&mScaleAnimFactor, scale_target, 0.02f);
+ s8 param = s8(100.0f * mScaleAnimFactor);
+ fopAcM_seStart(this, JA_SE_ATM_SWIRL, param);
+
+ if (mScaleAnimFactor > 0.0f && fpcM_IsErrorID(mKytagPcId)) {
+ cXyz scaleXZ;
+ scaleXZ.x = (mScaleAnimFactor * (daObjAuzu::L_radius * attr().mRadiusMult)) / 5000.0f;
+ scaleXZ.z = (mScaleAnimFactor * ((daObjAuzu::L_radius + 500.0f) * attr().mRadiusMult)) / 5000.0f;
+ mKytagPcId = fopAcM_create(
+ PROC_KYTAG01, -1, &current.pos,
+ tevStr.mRoomNo, &current.angle, &scaleXZ
+ );
+ } else if (mScaleAnimFactor > 0.0f && fpcM_IsErrorID(mKytagPcId) == FALSE) {
+ kytag01_class* kytag01_p = (kytag01_class *) fopAcM_SearchByID(mKytagPcId);
+ if (kytag01_p){
+ kytag01_p->mWaveInfo.mInnerRadius = mScaleAnimFactor * (daObjAuzu::L_radius * attr().mRadiusMult);
+ kytag01_p->mWaveInfo.mOuterRadius = mScaleAnimFactor * ((daObjAuzu::L_radius + 500.0f) * attr().mRadiusMult);
+ }
+ } else if (mScaleAnimFactor == 0.0f && fpcM_IsErrorID(mKytagPcId) == FALSE) {
+ kytag01_class* kytag01_p = (kytag01_class *) fopAcM_SearchByID(mKytagPcId);
+ if (kytag01_p){
+ fopAcM_delete(kytag01_p);
+ }
+ }
+
+ set_state_map();
+ return true;
}
/* 00000AF8-00000B88 .text set_material__Q29daObjAuzu5Act_cFP11J3DMaterialUc */
-void daObjAuzu::Act_c::set_material(J3DMaterial*, unsigned char) {
- /* Nonmatching */
+void daObjAuzu::Act_c::set_material(J3DMaterial* i_materialP, u8 i_alphaVal) {
+ while (i_materialP != NULL) {
+ if (i_alphaVal == 0) {
+ i_materialP->getShape()->hide();
+ } else {
+ i_materialP->getShape()->show();
+ i_materialP->getTevKColor(3)->mColor.a = i_alphaVal;
+ }
+ i_materialP = i_materialP->getNext();
+ }
}
/* 00000B88-00000C38 .text _draw__Q29daObjAuzu5Act_cFv */
bool daObjAuzu::Act_c::_draw() {
- /* Nonmatching */
+ g_env_light.settingTevStruct(TEV_TYPE_BG1, &current.pos, &tevStr);
+ g_env_light.setLightTevColorType(mpModel, &tevStr);
+ mBtkAnm.entry(mpModel->getModelData());
+ J3DModelData* model_data_p = mpModel->getModelData();
+ u8 alpha = u8(mScaleAnimFactor * 255.5f) & 0xFF;
+ set_material(
+ model_data_p->getJointNodePointer(0)->getMesh(),
+ alpha
+ );
+ mDoExt_modelUpdateDL(mpModel);
+ return true;
}
namespace daObjAuzu {