d_a_mg_rod debug improvements (#2993)

This commit is contained in:
Max Roncace 2025-12-23 19:11:09 -05:00 committed by GitHub
parent 877889c510
commit 8a478c5ebe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 937 additions and 867 deletions

View File

@ -94,9 +94,9 @@ public:
/* 0x0574 */ u8 arg0;
/* 0x0575 */ u8 arg1;
/* 0x0576 */ u8 arg2;
/* 0x0578 */ s16 field_0x578;
/* 0x0578 */ s16 counter;
/* 0x057A */ s16 timers[10];
/* 0x0590 */ f32 field_0x590;
/* 0x0590 */ f32 water_surface_y;
/* 0x0594 */ f32 field_0x594;
/* 0x0598 */ f32 field_0x598;
/* 0x059C */ f32 field_0x59c;
@ -106,12 +106,12 @@ public:
/* 0x06A0 */ f32 field_0x6a0;
/* 0x06A4 */ f32 field_0x6a4;
/* 0x06A8 */ u8 field_0x6a8;
/* 0x06AC */ cXyz field_0x6ac;
/* 0x06AC */ cXyz rod_tip_pos;
/* 0x06B8 */ cXyz field_0x6b8;
/* 0x06C4 */ s16 field_0x6c4;
/* 0x06C4 */ s16 rod_angle_y;
/* 0x06C8 */ cXyz field_0x6c8;
/* 0x06D4 */ cXyz field_0x6d4;
/* 0x06E0 */ f32 field_0x6e0;
/* 0x06E0 */ f32 cast_momentum;
/* 0x06E4 */ f32 field_0x6e4;
/* 0x06E8 */ s8 field_0x6e8;
/* 0x06EC */ cXyz field_0x6ec;
@ -156,10 +156,10 @@ public:
/* 0x0FF2 */ s16 field_0xff2;
/* 0x0FF4 */ s16 field_0xff4;
/* 0x0FF8 */ f32 field_0xff8;
/* 0x0FFC */ s16 field_0xffc;
/* 0x0FFE */ s16 field_0xffe;
/* 0x1000 */ s16 field_0x1000;
/* 0x1002 */ s16 field_0x1002;
/* 0x0FFC */ s16 lure_yaw_offset;
/* 0x0FFE */ s16 lure_yaw_target;
/* 0x1000 */ s16 lure_pitch_offset;
/* 0x1002 */ s16 lure_pitch_target;
/* 0x1004 */ s16 field_0x1004;
/* 0x1006 */ s16 field_0x1006;
/* 0x1008 */ s8 field_0x1008;
@ -167,7 +167,7 @@ public:
/* 0x100A */ s8 field_0x100a;
/* 0x100B */ u8 field_0x100b;
/* 0x100C */ u8 field_0x100c;
/* 0x100D */ s8 field_0x100d;
/* 0x100D */ s8 is_hook_in_water;
/* 0x100E */ s8 field_0x100e;
/* 0x100F */ s8 field_0x100f;
/* 0x1010 */ cXyz field_0x1010;
@ -218,10 +218,11 @@ public:
/* 0x114E */ s16 field_0x114e;
/* 0x1150 */ s16 field_0x1150;
/* 0x1154 */ f32 field_0x1154;
/* 0x1158 */ u8 field_0x1158[0x1165 - 0x1158];
/* 0x1165 */ s8 field_0x1165;
/* 0x1158 */ cXyz field_0x1158;
/* 0x1164 */ u8 field_0x1164[0x1165 - 0x1164];
/* 0x1165 */ s8 cast_bob_timer;
/* 0x1168 */ u32 sibuki_eff[4];
/* 0x1178 */ u32 field_0x1178;
/* 0x1178 */ u32 emitter_id;
/* 0x117C */ u32 field_0x117c;
/* 0x1180 */ u32 field_0x1180[2];
/* 0x1188 */ f32 field_0x1188;
@ -246,7 +247,7 @@ public:
/* 0x1407 */ u8 field_0x1407;
/* 0x1408 */ f32 play_cam_fovy;
/* 0x140C */ f32 field_0x140c;
/* 0x1410 */ f32 field_0x1410;
/* 0x1410 */ f32 camera_morf_rate;
/* 0x1414 */ f32 field_0x1414;
/* 0x1418 */ s16 field_0x1418;
/* 0x141A */ s16 field_0x141a;
@ -262,8 +263,8 @@ public:
/* 0x1458 */ cXyz field_0x1458;
/* 0x1464 */ f32 field_0x1464;
/* 0x1468 */ u8 field_0x1468[0x146C - 0x1468];
/* 0x146C */ u8 field_0x146c;
/* 0x146D */ s8 field_0x146d;
/* 0x146C */ u8 input_cooldown;
/* 0x146D */ s8 msg_flow_state;
/* 0x146E */ u8 field_0x146E[0x1470 - 0x146E];
/* 0x1470 */ u8 field_0x1470;
/* 0x1472 */ s16 field_0x1472;

View File

@ -1,6 +1,8 @@
#ifndef D_D_DEMO_H
#define D_D_DEMO_H
#include "m_Do/m_Do_ext.h"
#include "m_Do/m_Do_mtx.h"
#include "JSystem/JStudio/JStudio_JAudio2/control.h"
#include "JSystem/JStudio/JStudio_JParticle/object-particle.h"
#include "JSystem/JStudio/JStudio_JStage/object.h"

View File

@ -1,8 +1,9 @@
#ifndef D_D_KANKYO_TEV_STR
#define D_D_KANKYO_TEV_STR
#include "JSystem/J3DGraphBase/J3DStruct.h"
#include "m_Do/m_Do_ext.h"
#include "JSystem/J3DGraphBase/J3DTevs.h"
#include "SSystem/SComponent/c_xyz.h"
#include "dolphin/types.h"
class dKy_tevstr_c {
public:

View File

@ -117,7 +117,7 @@ public:
bool isUseButton(int i_buttonBit) { return i_buttonBit & mUseButton; }
void setMeterMapClass(dMeterMap_c* i_map) { mMeterMap = i_map; }
void resetGameStatus() { mGameStatus = 0; }
void onGameStatus(int i_status) { mGameStatus |= i_status; }
void onGameStatus(int i_status) { mGameStatus |= (u16)i_status; }
void setMapStatus(u8 i_status) { mMapStatus = i_status; }
u8 getMapStatus() { return mMapStatus; }
void setPauseStatus(u8 i_status) { mPauseStatus = i_status; }

View File

@ -15,6 +15,8 @@
#include "JSystem/JUtility/JUTGamePad.h" // IWYU pragma: export
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h" // IWYU pragma: export
#include "JSystem/JHostIO/JORReflexible.h" // IWYU pragma: export
#include "SSystem/SComponent/c_m3d_g_sph.h" // IWYU pragma: export
#include "SSystem/SComponent/c_m3d_g_aab.h" // IWYU pragma: export
#include "SSystem/SComponent/c_m3d_g_pla.h" // IWYU pragma: export
#include "SSystem/SComponent/c_bg_s_chk.h" // IWYU pragma: export
#include "f_op/f_op_actor.h" // IWYU pragma: export

View File

@ -3,13 +3,16 @@
#include "d/d_kankyo_tev_str.h"
#include "f_pc/f_pc_leaf.h"
#include "m_Do/m_Do_audio.h"
#include "JSystem/J3DGraphAnimator/J3DModel.h"
#include "SSystem/SComponent/c_sxyz.h"
#include "global.h"
struct actor_method_class {
/* 0x00 */ leafdraw_method_class base;
/* 0x14 */ u8 field_0x14[0xC]; // Likely padding
};
};
struct actor_process_profile_definition {
/* 0x00 */ leaf_process_profile_definition base;
/* 0x24 */ actor_method_class* sub_method;

View File

@ -37,6 +37,8 @@ class J3DModelData; // placeholder
class JKRHeap;
class cM3dGPla;
s8 dComIfGp_getReverb(int roomNo);
struct fopAcM_prmBase_class {
/* 0x00 */ u32 parameters;
/* 0x04 */ cXyz position;
@ -760,8 +762,6 @@ inline s16 fopAcM_toPlayerShapeAngleY(const fopAc_ac_c* i_actor) {
return fopAcM_toActorShapeAngleY(i_actor, dComIfGp_getPlayer(0));
}
s8 dComIfGp_getReverb(int roomNo);
inline void fopAcM_seStartCurrent(const fopAc_ac_c* actor, u32 sfxID, u32 param_2) {
mDoAud_seStart(sfxID, &actor->current.pos, param_2,
dComIfGp_getReverb(fopAcM_GetRoomNo(actor)));

View File

@ -231,8 +231,8 @@ void daE_BG_c::setSparkEffect() {
fopAc_ac_c* daE_BG_c::search_esa() {
dmg_rod_class* rod = (dmg_rod_class*)fopAcM_SearchByName(PROC_MG_ROD);
if (rod != NULL && rod->kind == 1 && rod->action != 5 && rod->field_0x100d != 0 &&
rod->actor.current.pos.y < rod->field_0x590 - 20.0f) {
if (rod != NULL && rod->kind == 1 && rod->action != 5 && rod->is_hook_in_water != 0 &&
rod->actor.current.pos.y < rod->water_surface_y - 20.0f) {
return &rod->actor;
} else {
return NULL;

View File

@ -215,8 +215,8 @@ static obj_kbox_class* search_box(e_sg_class* i_this) {
static dmg_rod_class* search_esa(e_sg_class* i_this) {
dmg_rod_class* rod = (dmg_rod_class*)fopAcM_SearchByName(PROC_MG_ROD);
if (rod != NULL && rod->kind == 1 && rod->action != 5 && rod->field_0x100d != 0 &&
rod->actor.current.pos.y < rod->field_0x590 - 20.0f)
if (rod != NULL && rod->kind == 1 && rod->action != 5 && rod->is_hook_in_water != 0 &&
rod->actor.current.pos.y < rod->water_surface_y - 20.0f)
{
return rod;
}

View File

@ -175,7 +175,7 @@ static void* s_lure_sub(void* a, void* b) {
if (rod->kind == 0 &&
rod->action == 4 &&
rod->field_0x10a9 == 0 &&
rod->field_0x100d != 0) {
rod->is_hook_in_water != 0) {
return rod;
}
}
@ -189,8 +189,8 @@ static void* s_esa_sub(void* a, void* b) {
dmg_rod_class* rod = (dmg_rod_class*)a;
if (rod->kind == 1 &&
rod->action != 5 &&
rod->field_0x100d != 0 &&
rod->actor.current.pos.y < rod->field_0x590 - 20.0f) {
rod->is_hook_in_water != 0 &&
rod->actor.current.pos.y < rod->water_surface_y - 20.0f) {
return rod;
}
}
@ -1328,7 +1328,7 @@ static void mf_lure_search(mg_fish_class* i_this) {
dmg_rod_class* rod = (dmg_rod_class*)fopAcM_SearchByID(i_this->mRodId);
if (rod == NULL || rod->field_0x1008 != 0) {
foundLure = true;
} else if (rod->field_0x100a != 0 || rod->field_0x100d == 0) {
} else if (rod->field_0x100a != 0 || rod->is_hook_in_water == 0) {
foundLure = true;
} else if (rod->action != 4) {
if (rod->action >= 5 &&
@ -1531,7 +1531,7 @@ static void mf_lure_search(mg_fish_class* i_this) {
}
}
rod->field_0x1410 = 0.0f;
rod->camera_morf_rate = 0.0f;
dKy_Sound_set(i_this->actor.current.pos, 40.0f * i_this->mJointScale,
fopAcM_GetID(i_this), 5);
rod->vib_timer = 5;
@ -1848,7 +1848,7 @@ static void mf_hit(mg_fish_class* i_this) {
pvVar5->play_cam_timer = 0;
pvVar5->field_0x14c2 = 0;
pvVar5->play_cam_fovy = 90.0f;
pvVar5->field_0x146d = 0;
pvVar5->msg_flow_state = 0;
pvVar5->field_0x10b0 = 0;
daPy_py_c* player = daPy_getLinkPlayerActorClass();
player->onFishingRodGetFish();
@ -2173,7 +2173,7 @@ static void mf_catch(mg_fish_class* i_this) {
rod->actor.health = 1;
rod->play_cam_mode = 11;
rod->play_cam_timer = 0;
rod->field_0x146d = 0;
rod->msg_flow_state = 0;
i_this->field_0x740 = cM_rndF(1000.0f) + 3000.0f;
}
break;
@ -2234,7 +2234,7 @@ static void mf_esa_search(mg_fish_class* i_this) {
if (rod_actor == NULL) {
flag1 = 1;
} else if (rod->field_0x100d == 0) {
} else if (rod->is_hook_in_water == 0) {
flag1 = 1;
} else if (rod->action == 5) {
flag1 = 1;
@ -3575,8 +3575,8 @@ static int daMg_Fish_Execute(mg_fish_class* i_this) {
rod->actor.current.pos.x = i_this->field_0x638.x;
rod->actor.current.pos.y = i_this->field_0x638.y;
rod->actor.current.pos.z = i_this->field_0x638.z;
rod->field_0x1000 = 0;
rod->field_0xffc = 0;
rod->lure_pitch_offset = 0;
rod->lure_yaw_offset = 0;
}
if (i_this->field_0x659 != 0) {
fopAc_ac_c* rod = fopAcM_SearchByID(i_this->mRodId);

File diff suppressed because it is too large Load Diff

View File

@ -135,7 +135,7 @@ static void df_fly(npc_df_class* i_this, df_s* df_p) {
df_p->field_0x72 = cM_rndF(5.0f) + 5.0f;
if (df_p->field_0x77 == 0 && df_p->field_0x6c > 2000 && lrl != NULL) {
if (lrl->field_0x6ac.y < player->eyePos.y + 80.0f) {
if (lrl->rod_tip_pos.y < player->eyePos.y + 80.0f) {
if (lrl->kind == 0 || (lrl->kind != 0 && lrl->play_cam_mode == 7)) {
df_p->field_0x74 = 2;
df_p->field_0x75 = 0;
@ -200,7 +200,7 @@ static void df_rod(npc_df_class* i_this, df_s* df_p) {
}
if (df_p->field_0x2c.y < 50.0f) {
cLib_addCalcAngleS2(&df_p->field_0x44.y, lrl->field_0x6c4 + df_p->field_0x6e, 4, 0x400);
cLib_addCalcAngleS2(&df_p->field_0x44.y, lrl->rod_angle_y + df_p->field_0x6e, 4, 0x400);
} else {
if (fabsf(df_p->field_0x2c.x) > 10.0f && fabsf(df_p->field_0x2c.z) > 10.0f) {
cLib_addCalcAngleS2(&df_p->field_0x44.y, cM_atan2s(-df_p->field_0x2c.x, -df_p->field_0x2c.z), 4, 0x400);
@ -214,12 +214,12 @@ static void df_rod(npc_df_class* i_this, df_s* df_p) {
df_p->field_0x38.z = 0.0f;
df_p->field_0x38.x = 0.0f;
df_p->field_0x38.y = 5.0f;
cLib_addCalcAngleS2(&df_p->field_0x44.y, lrl->field_0x6c4 + df_p->field_0x6e, 2, 0x800);
cLib_addCalcAngleS2(&df_p->field_0x44.y, lrl->rod_angle_y + df_p->field_0x6e, 2, 0x800);
}
cXyz sp54(lrl->mg_rod.field_0x0[df_p->field_0x7b] + ((lrl->mg_rod.field_0x0[df_p->field_0x7b + 1] - lrl->mg_rod.field_0x0[df_p->field_0x7b]) * df_p->field_0x64));
if ((i_this->field_0xd34 - lrl->mg_rod.field_0x0[8]).abs() > 5.0f || lrl->field_0x6ac.y > player->eyePos.y + 80.0f) {
if ((i_this->field_0xd34 - lrl->mg_rod.field_0x0[8]).abs() > 5.0f || lrl->rod_tip_pos.y > player->eyePos.y + 80.0f) {
df_p->field_0x74 = 1;
df_p->field_0x4a.y += (int)cM_rndFX(8192.0f);
df_p->field_0x44.x = df_p->field_0x4a.x = -8192.0f - cM_rndF(4096.0f);

View File

@ -601,7 +601,7 @@ static void henna_ride(npc_henna_class* i_this) {
lookat_pos.y = 0.0f;
lookat_pos.z = -100.0f + VREG_F(8);
MtxPosition(&lookat_pos, &pos);
pos.y = lrl->field_0x590;
pos.y = lrl->water_surface_y;
f32 unkFloat1;
if (i_this->mAnmResIndex == 7) {
unkFloat1 = 22.0f;
@ -630,7 +630,7 @@ static void henna_ride(npc_henna_class* i_this) {
i_this->field_0x70d = 10;
}
if ((lrl != NULL && lrl->field_0x146d != 0) || i_this->field_0x7b8 != 0 ||
if ((lrl != NULL && lrl->msg_flow_state != 0) || i_this->field_0x7b8 != 0 ||
dComIfGp_checkPlayerStatus0(0, 0x2000) != 0)
{
i_this->field_0x70d = 2;