diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-12-04 19:03:13 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-04 16:03:13 -0800 |
| commit | 7fe9a68a9d47750fa0b3956349260fc4e3968047 (patch) | |
| tree | e1e8325785a4466c34ac3ec6ce5e80fa0619d762 /include | |
| parent | 4d3f25d34ed0782ba693c80698631cac6add8f9c (diff) | |
d_a_horse 100% (#2912)
* Fix missing line numbers for debug
* Fix horse inlines and HIO
* Match daHorse_c::setEffect
* Improve a few debug matches
* Match daHorse_c::checkHorseNoMove (half fake)
* Update configure.py
Diffstat (limited to 'include')
| -rw-r--r-- | include/JSystem/JParticle/JPAEmitter.h | 2 | ||||
| -rw-r--r-- | include/d/actor/d_a_horse.h | 45 | ||||
| -rw-r--r-- | include/d/actor/d_a_obj_bemos.h | 1 | ||||
| -rw-r--r-- | include/d/d_bg_s.h | 53 | ||||
| -rw-r--r-- | include/d/d_bg_s_movebg_actor.h | 1 |
5 files changed, 79 insertions, 23 deletions
diff --git a/include/JSystem/JParticle/JPAEmitter.h b/include/JSystem/JParticle/JPAEmitter.h index 22b1edf378..eca7556754 100644 --- a/include/JSystem/JParticle/JPAEmitter.h +++ b/include/JSystem/JParticle/JPAEmitter.h @@ -264,7 +264,7 @@ public: /* 0xE8 */ JPAResource* mpRes; /* 0xEC */ JPAEmitterCallBack* mpEmtrCallBack; /* 0xF0 */ JPAParticleCallBack* mpPtclCallBack; - /* 0xF4 */ volatile u32 mStatus; + /* 0xF4 */ u32 mStatus; /* 0xF8 */ f32 mEmitCount; /* 0xFC */ f32 mScaleOut; /* 0x100 */ u32 mTick; diff --git a/include/d/actor/d_a_horse.h b/include/d/actor/d_a_horse.h index ed57253b6d..a7673635b6 100644 --- a/include/d/actor/d_a_horse.h +++ b/include/d/actor/d_a_horse.h @@ -38,6 +38,13 @@ public: class daHoZelda_c; class daHorse_hio_c; +class daHorse_hio_c0; + +#if DEBUG +#define HORSE_HIO_CLASS daHorse_hio_c +#else +#define HORSE_HIO_CLASS daHorse_hio_c0 +#endif /** * @ingroup actors-unsorted @@ -231,11 +238,9 @@ public: ~daHorse_c(); u32 getLashDashStart() const { return checkResetStateFlg0(RFLG0_LASH_DASH_START); } - - - bool checkNoBombProc() const { return m_procID == PROC_WAIT_e || m_procID == PROC_MOVE_e; } - BOOL checkResetStateFlg0(daHorse_RFLG0 flag) const { return m_resetStateFlg0 & flag; } - bool checkEndResetStateFlg0(daHorse_ERFLG0 flag) const { return m_endResetStateFlg0 & flag; } + BOOL checkNoBombProc() const { return !(m_procID == PROC_WAIT_e || m_procID == PROC_MOVE_e); } + u32 checkResetStateFlg0(daHorse_RFLG0 flag) const { return m_resetStateFlg0 & flag; } + u32 checkEndResetStateFlg0(daHorse_ERFLG0 flag) const { return m_endResetStateFlg0 & flag; } u32 checkStateFlg0(daHorse_FLG0 flag) const { return m_stateFlg0 & flag; } f32 getNormalMaxSpeedF() { return m_normalMaxSpeedF; } f32 getLashMaxSpeedF() { return m_lashMaxSpeedF; } @@ -267,21 +272,21 @@ public: void setZeldaActor(fopAc_ac_c* i_actor) { m_zeldaActorKeep.setData(i_actor); } u32 checkTurnStandCamera() const { return checkResetStateFlg0(RFLG0_TURN_STAND_CAMERA); } - BOOL checkTurnStand() const { return checkResetStateFlg0(RFLG0_TURN_STAND); } + u32 checkTurnStand() const { return checkResetStateFlg0(RFLG0_TURN_STAND); } u32 checkRodeoMode() const { return checkStateFlg0(FLG0_RODEO_MODE); } - bool checkCutTurnCancel() const { return checkEndResetStateFlg0(ERFLG0_CUT_TURN_CANCEL); } - bool checkTurnCancelKeep() const { return checkStateFlg0(FLG0_TURN_CANCEL_KEEP); } - BOOL checkRodeoLeft() const { return checkStateFlg0(FLG0_RODEO_LEFT); } - BOOL checkHorseCallWait() const { return checkStateFlg0(FLG0_NO_DRAW_WAIT); } + u32 checkCutTurnCancel() const { return checkEndResetStateFlg0(ERFLG0_CUT_TURN_CANCEL); } + u32 checkTurnCancelKeep() const { return checkStateFlg0(FLG0_TURN_CANCEL_KEEP); } + u32 checkRodeoLeft() const { return checkStateFlg0(FLG0_RODEO_LEFT); } + u32 checkHorseCallWait() const { return checkStateFlg0(FLG0_NO_DRAW_WAIT); } BOOL checkTurn() const { return m_procID == PROC_TURN_e && field_0x1720 == 0; } BOOL checkStop() const { return m_procID == PROC_STOP_e; } BOOL checkJump() const { return m_procID == PROC_JUMP_e; } - bool checkWait() const { return m_procID == PROC_WAIT_e; } - bool checkLand() const { return m_procID == PROC_LAND_e && field_0x171a == 0; } - bool checkGetOff() const { return fabsf(speedF) < 3.0f; } - BOOL checkEnemySearch() { return checkResetStateFlg0(RFLG0_ENEMY_SEARCH); } - bool checkOriginalDemo() const { return field_0x16b8 == 3; } - bool checkHorseDemoMode() { return field_0x16b8 != 0; } + BOOL checkWait() const { return m_procID == PROC_WAIT_e; } + BOOL checkLand() const { return m_procID == PROC_LAND_e && field_0x171a == 0; } + BOOL checkGetOff() const { return fabsf(speedF) < 3.0f; } + u32 checkEnemySearch() { return checkResetStateFlg0(RFLG0_ENEMY_SEARCH); } + BOOL checkOriginalDemo() const { return field_0x16b8 == 3; } + BOOL checkHorseDemoMode() { return field_0x16b8 != 0; } s16 checkCowHit() const { return m_cowHit; } s16 getCowHitAngle() const { return m_cowHitAngle; } u8 getRodeoPointCnt() const { return m_rodeoPointCnt; } @@ -333,7 +338,7 @@ public: u32 getShadowID() const { return m_shadowID; } - bool checkInputOnR() const { return m_padStickValue > 0.05f; } + BOOL checkInputOnR() const { return m_padStickValue > 0.05f; } void onBagMaterial() { m_modelData->getMaterialNodePointer(5)->getShape()->show(); @@ -354,7 +359,7 @@ public: /* 0x0594 */ mDoExt_AnmRatioPack m_anmRatio[3]; /* 0x05AC */ mDoExt_MtxCalcOldFrame* m_oldFrame; /* 0x05B0 */ daPy_frameCtrl_c m_frameCtrl[3]; - /* 0x05F8 */ daHorse_hio_c* m_hio; + /* 0x05F8 */ HORSE_HIO_CLASS* m_hio; /* 0x05FC */ dBgS_AcchCir m_acchcir[3]; /* 0x06BC */ dBgS_HorseAcch m_acch; /* 0x0894 */ dCcD_Stts m_cc_stts; @@ -566,15 +571,15 @@ class daHorse_hio_c : public JORReflexible { public: daHorse_hio_c() { #if DEBUG - mParameters = daHorse_hio_c0::m; + m = daHorse_hio_c0::m; #endif } #if DEBUG virtual ~daHorse_hio_c() {} void genMessage(JORMContext*); /* 0x4 */ s8 id; - /* 0x8 */ daHorse_hio_c1 mParameters; #endif + /* 0x8 */ daHorse_hio_c1 m; }; #endif /* D_A_HORSE_H */ diff --git a/include/d/actor/d_a_obj_bemos.h b/include/d/actor/d_a_obj_bemos.h index c08b50bd7a..7b3be1c0e9 100644 --- a/include/d/actor/d_a_obj_bemos.h +++ b/include/d/actor/d_a_obj_bemos.h @@ -7,6 +7,7 @@ #include "d/d_cc_d.h" #include "f_op/f_op_actor_mng.h" #include "m_Do/m_Do_ext.h" +#include "JSystem/JParticle/JPAEmitter.h" /** * @ingroup actors-objects diff --git a/include/d/d_bg_s.h b/include/d/d_bg_s.h index f8cb52660d..d300226e3d 100644 --- a/include/d/d_bg_s.h +++ b/include/d/d_bg_s.h @@ -3,6 +3,7 @@ #include "d/d_bg_w_base.h" #include "JSystem/JHostIO/JORReflexible.h" +#include <dolphin/os.h> #include "global.h" class dBgW; @@ -80,6 +81,11 @@ public: virtual void genMessage(JORMContext*); virtual ~dBgS_HIO(); + BOOL ChkLineOff(); + BOOL ChkCheckCounter(); + BOOL ChkLineTimer(); + BOOL ChkGroundCheckTimer(); + /* 0x04 */ u8 field_0x4[0x6 - 0x4]; /* 0x06 */ u16 field_0x6; /* 0x08 */ u16 field_0x8; @@ -90,6 +96,12 @@ public: #endif }; +extern int g_line_counter; +extern OSStopwatch s_line_sw; + +extern int g_ground_counter; +extern OSStopwatch s_ground_sw; + class dBgS : public cBgS { public: dBgS() {} @@ -139,8 +151,45 @@ public: u32 GetMtrlSndId(const cBgS_PolyInfo& param_0) { return dKy_pol_sound_get(¶m_0); } void DebugDrawPoly(dBgW_Base *param_1) {} fopAc_ac_c* GetActorPointer(cBgS_PolyInfo const& param_0) const { return cBgS::GetActorPointer(param_0); } - bool LineCross(cBgS_LinChk* i_linChk) { return ((cBgS*)this)->LineCross(i_linChk); } - f32 GroundCross(cBgS_GndChk* i_gndChk) { return (f32)((cBgS*)this)->GroundCross(i_gndChk); } + bool LineCross(cBgS_LinChk* i_linChk) { + #ifdef DEBUG + if (m_hio.ChkLineOff()) { + return false; + } + if (m_hio.ChkCheckCounter()) { + g_line_counter++; + } + if (m_hio.ChkLineTimer()) { + OSStartStopwatch(&s_line_sw); + } + bool rt = cBgS::LineCross(i_linChk); + if (m_hio.ChkLineTimer()) { + OSStopStopwatch(&s_line_sw); + OSDumpStopwatch(&s_line_sw); + } + return rt; + #else + return cBgS::LineCross(i_linChk); + #endif + } + f32 GroundCross(cBgS_GndChk* i_gndChk) { + #ifdef DEBUG + if (m_hio.ChkCheckCounter()) { + g_ground_counter++; + } + if (m_hio.ChkGroundCheckTimer()) { + OSStartStopwatch(&s_ground_sw); + } + f32 rt = cBgS::GroundCross(i_gndChk); + if (m_hio.ChkGroundCheckTimer()) { + OSStopStopwatch(&s_ground_sw); + OSDumpStopwatch(&s_ground_sw); + } + return rt; + #else + return cBgS::GroundCross(i_gndChk); + #endif + } void ChkDeleteActorRegist(fopAc_ac_c*); diff --git a/include/d/d_bg_s_movebg_actor.h b/include/d/d_bg_s_movebg_actor.h index af2757a13b..f419ec7e41 100644 --- a/include/d/d_bg_s_movebg_actor.h +++ b/include/d/d_bg_s_movebg_actor.h @@ -2,6 +2,7 @@ #define D_BG_D_BG_S_MOVEBG_ACTOR_H #include "f_op/f_op_actor.h" +#include "SSystem/SComponent/c_bg_s_poly_info.h" class dBgW; typedef void (*MoveBGActor_SetFunc)(dBgW*, void*, cBgS_PolyInfo const&, bool, cXyz*, csXyz*, |
