diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2025-11-05 17:19:01 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-06 03:19:01 +0200 |
| commit | 226325284dc69f85a75104b084b4481781fe33f2 (patch) | |
| tree | 6c3c1e55d97698735936411a51d41adab9f6eef6 /include | |
| parent | 957a743742f5e9a93ec30e641bb7daf49633c767 (diff) | |
lv6togetrap, swpush2, tafence done (#2771)
* lv6togetrap, swpush2, tafence done
* fix jp/pal
* Use dEvtCnd_CANDEMO_e
---------
Co-authored-by: hatal175 <hatal175@users.noreply.github.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/d/actor/d_a_obj_lv6TogeTrap.h | 72 | ||||
| -rw-r--r-- | include/d/actor/d_a_obj_swpush2.h | 168 | ||||
| -rw-r--r-- | include/d/actor/d_a_obj_taFence.h | 52 | ||||
| -rw-r--r-- | include/d/d_a_obj.h | 16 | ||||
| -rw-r--r-- | include/d/d_bg_w.h | 2 | ||||
| -rw-r--r-- | include/d/d_com_inf_game.h | 12 | ||||
| -rw-r--r-- | include/f_op/f_op_actor_mng.h | 5 |
7 files changed, 243 insertions, 84 deletions
diff --git a/include/d/actor/d_a_obj_lv6TogeTrap.h b/include/d/actor/d_a_obj_lv6TogeTrap.h index 77438e832f..ca2eb440f1 100644 --- a/include/d/actor/d_a_obj_lv6TogeTrap.h +++ b/include/d/actor/d_a_obj_lv6TogeTrap.h @@ -2,6 +2,8 @@ #define D_A_OBJ_LV6TOGETRAP_H #include "f_op/f_op_actor_mng.h" +#include "d/d_bg_s_movebg_actor.h" +#include "d/d_cc_d.h" /** * @ingroup actors-objects @@ -11,13 +13,11 @@ * @details * */ -class daLv6TogeTrap_c : public fopAc_ac_c { +class daLv6TogeTrap_c : public dBgS_MoveBgActor { public: /* 80C79F10 */ void setBaseMtx(); - /* 80C79FE8 */ void CreateHeap(); - /* 80C7A068 */ void create(); - /* 80C7A6B0 */ void searchSekizoAct(void*, void*); - /* 80C7A700 */ void Execute(Mtx**); + /* 80C7A068 */ int create(); + /* 80C7A6B0 */ static void* searchSekizoAct(void*, void*); /* 80C7A97C */ void moveLift(); /* 80C7ABC8 */ void executeType1(); /* 80C7ACA0 */ void init_modeBound(); @@ -50,25 +50,57 @@ public: /* 80C7BED8 */ void init_modeBreak(); /* 80C7BFE4 */ void modeBreak(); /* 80C7C1D8 */ void setNextPoint(); - /* 80C7C33C */ void Draw(); - /* 80C7C3E0 */ void Delete(); - static u8 const mCcDObjInfo[48]; - static u8 const mCcDObjInfo2[48]; - static u8 const mSpeed[64]; - static u8 mCcDSph[64]; - static u8 mCcDCyl[68]; + /* 80C79FE8 */ virtual int CreateHeap(); + /* 80C7A700 */ virtual int Execute(Mtx**); + /* 80C7C33C */ virtual int Draw(); + /* 80C7C3E0 */ virtual int Delete(); -private: - /* 0x568 */ u8 field_0x568[0x8f4 - 0x568]; -}; + int getSpeed() { return fopAcM_GetParamBit(this, 8, 4); } + int getType() { return fopAcM_GetParamBit(this, 12, 4); } + int getHankei() { return fopAcM_GetParamBit(this, 16, 4); } + int getModelType() { return fopAcM_GetParamBit(this, 20, 4); } + int getHankei2() { return fopAcM_GetParamBit(this, 24, 8); } -STATIC_ASSERT(sizeof(daLv6TogeTrap_c) == 0x8f4); + static const dCcD_SrcGObjInf mCcDObjInfo; + static const dCcD_SrcGObjInf mCcDObjInfo2; + static const f32 mSpeed[16]; + static dCcD_SrcSph mCcDSph; + static dCcD_SrcCyl mCcDCyl; -class daLv6TogeTrap_HIO_c { -public: - /* 80C79E4C */ daLv6TogeTrap_HIO_c(); - /* 80C7C504 */ ~daLv6TogeTrap_HIO_c(); + /* 0x5A0 */ request_of_phase_process_class mPhase; + /* 0x5A8 */ J3DModel* mpModel; + /* 0x5AC */ u8 mPathNo; + /* 0x5AD */ s8 mRotateDirection; + /* 0x5AE */ s16 field_0x5ae; + /* 0x5B0 */ cXyz field_0x5b0; + /* 0x5BC */ cXyz field_0x5bc; + /* 0x5C8 */ cXyz field_0x5c8; + /* 0x5D4 */ f32 mMoveSpeed; + /* 0x5D8 */ u8 mMode; + /* 0x5D9 */ u8 field_0x5d9; + /* 0x5DA */ u8 mType; + /* 0x5DB */ u8 field_0x5db; + /* 0x5DC */ cM3dGLin mLine; + /* 0x5F8 */ u8 mIsPathClosed; + /* 0x5F9 */ u8 field_0x5f9; + /* 0x5FC */ f32 mRadius; + /* 0x600 */ s16 field_0x600; + /* 0x604 */ f32 field_0x604; + /* 0x608 */ u8 field_0x608; + /* 0x609 */ u8 field_0x609; + /* 0x60A */ u8 field_0x60a; + /* 0x60B */ u8 field_0x60b; + /* 0x60C */ u8 mModelType; + /* 0x610 */ f32 field_0x610; + /* 0x614 */ dCcD_Stts mCcStts; + /* 0x650 */ dCcD_Sph mCcSph; + /* 0x788 */ dCcD_Cyl mCcCyl; + /* 0x8C4 */ cXyz field_0x8c4; + /* 0x8D0 */ u8 field_0x8d0; + /* 0x8D4 */ Z2SoundObjSimple mSound; }; +STATIC_ASSERT(sizeof(daLv6TogeTrap_c) == 0x8f4); + #endif /* D_A_OBJ_LV6TOGETRAP_H */ diff --git a/include/d/actor/d_a_obj_swpush2.h b/include/d/actor/d_a_obj_swpush2.h index 24203985be..55bb6c3271 100644 --- a/include/d/actor/d_a_obj_swpush2.h +++ b/include/d/actor/d_a_obj_swpush2.h @@ -2,6 +2,7 @@ #define D_A_OBJ_SWPUSH2_H #include "f_op/f_op_actor_mng.h" +#include "d/d_a_obj.h" /** * @ingroup actors-objects @@ -11,32 +12,81 @@ * @details * */ -class daObjSwpush2 : public fopAc_ac_c { -public: - class Act_c { +namespace daObjSwpush2 { + enum AttrFlag_e { + AttrFlag_UNK_0x1_e = 0x1, + AttrFlag_UNK_0x2_e = 0x2, + AttrFlag_REV_SW_e = 0x4, + AttrFlag_HEAVY_e = 0x8, + AttrFlag_UNK_0x10_e = 0x10, + AttrFlag_UNK_0x20_e = 0x20, + }; + + class Attr_c { + public: + /* 0x00 */ u32 heap_size; + /* 0x04 */ AttrFlag_e flags; + /* 0x08 */ f32 size; + /* 0x0C */ const char* arcname; + /* 0x10 */ f32 unk_0x10; + /* 0x14 */ f32 unk_0x14; + /* 0x18 */ f32 unk_0x18; + /* 0x1C */ f32 unk_0x1c; + /* 0x20 */ s16 unk_0x20; + /* 0x22 */ s16 ride_time; + /* 0x24 */ s16 heavy_ride_time; + /* 0x26 */ s16 field_0x26; + /* 0x28 */ f32 unk_0x28; + /* 0x2C */ f32 unk_0x2c; + /* 0x30 */ s16 demo_run_time; + /* 0x34 */ f32 effect_distance; + }; + + class Hio_c : public JORReflexible { + public: + void genMessage(JORMContext*); + + void ct(); + void dt(); + void default_set(); + + /* 0x4 */ int field_0x4; + /* 0x8 */ Attr_c M_attr[4]; + }; + + class Act_c : public fopAc_ac_c { public: - struct Prm_e {}; - - /* 80CFE098 */ void getArcName(); - /* 80CFE0A4 */ void getBmdName(); - /* 80CFE0B4 */ void getDzbName(); - /* 80CFE0C4 */ void getNmlBtkName(); - /* 80CFE0D4 */ void getNmlBrkName(); - /* 80CFE0E4 */ void getOnBtkName(); - /* 80CFE0F4 */ void getRunBpkName(); - /* 80CFE104 */ void getRunBrkName(); - /* 80CFE114 */ void getRunBtkName(); + enum Prm_e { + PRM_SAVESW_SHIFT_e = 0x8, + PRM_SAVESW_NBITS_e = 0x8, + + PRM_EVID_SHIFT_e = 0x0, + PRM_EVID_NBITS_e = 0x8, + + PRM_TYPE_SHIFT_e = 0x18, + PRM_TYPE_NBITS_e = 0x3, + }; + + /* 80CFE098 */ const char* getArcName(); + /* 80CFE0A4 */ const char* getBmdName(); + /* 80CFE0B4 */ const char* getDzbName(); + /* 80CFE0C4 */ const char* getNmlBtkName(); + /* 80CFE0D4 */ const char* getNmlBrkName(); + /* 80CFE0E4 */ const char* getOnBtkName(); + /* 80CFE0F4 */ const char* getRunBpkName(); + /* 80CFE104 */ const char* getRunBrkName(); + /* 80CFE114 */ const char* getRunBtkName(); /* 80CFE124 */ void prmZ_init(); - /* 80CFE154 */ void is_switch2() const; - /* 80CFE1AC */ void solidHeapCB(fopAc_ac_c*); - /* 80CFE1D0 */ void create_heap(); - /* 80CFE6D8 */ void create_init(); - /* 80CFE8CC */ void create_res_load(); - /* 80CFE928 */ void Mthd_Create(); - /* 80CFEA3C */ void Mthd_Delete(); + /* 80CFE154 */ bool is_switch2() const; + /* 80CFE1AC */ static int solidHeapCB(fopAc_ac_c*); + /* 80CFE1D0 */ bool create_heap(); + /* 80CFE6D8 */ bool create_init(); + /* 80CFE8CC */ int create_res_load(); + /* 80CFE928 */ int Mthd_Create(); + /* 80CFEA3C */ int Mthd_Delete(); /* 80CFEAB4 */ void set_mtx(); /* 80CFEB3C */ void init_mtx(); - /* 80CFEB78 */ void rideCB(dBgW*, fopAc_ac_c*, fopAc_ac_c*); + /* 80CFEB78 */ static void rideCB(dBgW*, fopAc_ac_c*, fopAc_ac_c*); /* 80CFEBE4 */ void calc_top_pos(); /* 80CFEC4C */ void set_push_flag(); /* 80CFEDDC */ void mode_upper_init(); @@ -57,27 +107,69 @@ public: /* 80CFF48C */ void demo_reqSw(); /* 80CFF500 */ void demo_runSw_init(); /* 80CFF50C */ void demo_runSw(); - /* 80CFF568 */ void Mthd_Execute(); - /* 80CFF8FC */ void Mthd_Draw(); + /* 80CFF568 */ int Mthd_Execute(); + /* 80CFF8FC */ int Mthd_Draw(); - static u8 const M_arcname[9 + 3 /* padding */]; - static void* const M_attr[56]; - }; + const Attr_c& attr() const { + #if DEBUG + return M_hio.M_attr[mType]; + #else + return M_attr[mType]; + #endif + } -private: - /* 0x568 */ u8 field_0x568[0x5f4 - 0x568]; -}; + u8 prmZ_get_swSave2() const { return mPrmZ & 0xFF; } + int prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_SAVESW_NBITS_e, PRM_SAVESW_SHIFT_e); } + u8 prm_get_evId() const { return daObj::PrmAbstract(this, PRM_EVID_NBITS_e, PRM_EVID_SHIFT_e); } + int prm_get_type() const { return daObj::PrmAbstract(this, PRM_TYPE_NBITS_e, PRM_TYPE_SHIFT_e); } + + bool is_switch() const { return fopAcM_isSwitch(this, prm_get_swSave()); } + void on_switch() const { fopAcM_onSwitch(this, prm_get_swSave()); } + void off_switch() const { fopAcM_offSwitch(this, prm_get_swSave()); } + void rev_switch() const { fopAcM_revSwitch(this, prm_get_swSave()); } -STATIC_ASSERT(sizeof(daObjSwpush2) == 0x5f4); + static const char M_arcname[]; + static const Attr_c M_attr[4]; -struct daObj { -public: - template <typename A1> - void PrmAbstract(/* ... */); - /* 80CFFBD0 */ /* daObj::PrmAbstract<daObjSwpush2::Act_c::Prm_e> */ - void func_80CFFBD0(void* _this, fopAc_ac_c const*, daObjSwpush2::Act_c::Prm_e, - daObjSwpush2::Act_c::Prm_e); + #if DEBUG + static Hio_c M_hio; + #endif + + /* 0x568 */ request_of_phase_process_class mPhase; + /* 0x570 */ dBgW* mpBgw; + /* 0x574 */ Mtx mBgMtx; + /* 0x5A4 */ J3DModel* mpModel; + /* 0x5A8 */ mDoExt_bpkAnm* mpRunBpk; + /* 0x5AC */ mDoExt_btkAnm* mpRunBtk; + /* 0x5B0 */ mDoExt_brkAnm* mpRunBrk; + /* 0x5B4 */ mDoExt_btkAnm* mpOnBtk; + /* 0x5B8 */ mDoExt_brkAnm* mpNmlBrk; + /* 0x5BC */ mDoExt_btkAnm* mpNmlBtk; + /* 0x5C0 */ int mType; + /* 0x5C4 */ int mModeProc; + /* 0x5C8 */ int mDemoProc; + /* 0x5CC */ s16 mDemoRunTime; + /* 0x5CE */ s16 mEventIdx; + /* 0x5D0 */ u16 mPrmZ; + /* 0x5D2 */ u8 mPrmInit; + /* 0x5D3 */ u8 mShockTimer; + /* 0x5D4 */ u8 mRideType; + /* 0x5D5 */ u8 mPrevRideType; + /* 0x5D6 */ s16 mRideTimer; + /* 0x5D8 */ u8 mPushFlag; + /* 0x5D9 */ u8 mIsPlayerRideHeavy; + /* 0x5DA */ u8 mPrevPlayerRideHeavy; + /* 0x5DC */ s16 mHeavyRideTimer; + /* 0x5DE */ u8 mHeavyPushFlag; + /* 0x5DF */ u8 field_0x5df; + /* 0x5E0 */ s16 mPauseDemoTimer; + /* 0x5E4 */ f32 mTopPos; + /* 0x5E8 */ f32 field_0x5e8; + /* 0x5EC */ f32 field_0x5ec; + /* 0x5F0 */ u8 field_0x5f0; + }; }; +STATIC_ASSERT(sizeof(daObjSwpush2::Act_c) == 0x5f4); #endif /* D_A_OBJ_SWPUSH2_H */ diff --git a/include/d/actor/d_a_obj_taFence.h b/include/d/actor/d_a_obj_taFence.h index 4a9dbbe74c..eac74aee85 100644 --- a/include/d/actor/d_a_obj_taFence.h +++ b/include/d/actor/d_a_obj_taFence.h @@ -2,6 +2,8 @@ #define D_A_OBJ_TAFENCE_H #include "f_op/f_op_actor_mng.h" +#include "d/d_bg_s_movebg_actor.h" +#include "d/d_cc_d.h" /** * @ingroup actors-objects @@ -11,12 +13,10 @@ * @details * */ -class daTaFence_c : public fopAc_ac_c { +class daTaFence_c : public dBgS_MoveBgActor { public: /* 80D04F8C */ void setBaseMtx(); - /* 80D0503C */ void CreateHeap(); - /* 80D050A8 */ void create(); - /* 80D05550 */ void Execute(Mtx**); + /* 80D050A8 */ int create(); /* 80D055A0 */ void fenceProc(); /* 80D057C4 */ void init_modeWait(); /* 80D057D0 */ void modeWait(); @@ -26,23 +26,41 @@ public: /* 80D05CAC */ void modeMove(); /* 80D05D2C */ void init_modeMoveEnd(); /* 80D05E54 */ void modeMoveEnd(); - /* 80D05E58 */ void Draw(); - /* 80D05EFC */ void Delete(); - static u8 const mCcDObjInfo[48]; - static u8 mCcDCyl[68]; + /* 80D0503C */ virtual int CreateHeap(); + /* 80D05550 */ virtual int Execute(Mtx**); + /* 80D05E58 */ virtual int Draw(); + /* 80D05EFC */ virtual int Delete(); -private: - /* 0x568 */ u8 field_0x568[0x13d4 - 0x568]; -}; - -STATIC_ASSERT(sizeof(daTaFence_c) == 0x13d4); + static const dCcD_SrcGObjInf mCcDObjInfo; + static dCcD_SrcCyl mCcDCyl; -class daTaFence_HIO_c { -public: - /* 80D04E6C */ daTaFence_HIO_c(); - /* 80D06000 */ ~daTaFence_HIO_c(); + /* 0x05A0 */ request_of_phase_process_class mPhase; + /* 0x05A8 */ J3DModel* mpModel; + /* 0x05AC */ u8 mMode; + /* 0x05B0 */ dCcD_Stts mCcStts; + /* 0x05EC */ dCcD_Cyl mCyl[11]; + /* 0x1380 */ f32 mFallSpeed; + /* 0x1384 */ s16 field_0x1384; + /* 0x1386 */ u8 mCollapseTimer; + /* 0x1388 */ int mCounter; + /* 0x138C */ csXyz mShakeYZ; + /* 0x1394 */ f32 mShakeYZ_intensity; + /* 0x1398 */ f32 mShakeYZ_ampZ; + /* 0x139C */ f32 mShakeYZ_ampY; + /* 0x13A0 */ f32 mShakeYZ_damp; + /* 0x13A4 */ f32 mShakeYZ_maxDamp; + /* 0x13A8 */ f32 mShakeYZ_minDamp; + /* 0x13AC */ cXyz mShakeXZ; + /* 0x13B8 */ f32 mShakeXZ_ampX; + /* 0x13BC */ f32 mShakeXZ_ampZ; + /* 0x13C0 */ f32 mShakeXZ_intensity; + /* 0x13C4 */ f32 mShakeXZ_damp; + /* 0x13C8 */ f32 mShakeXZ_maxDamp; + /* 0x13CC */ f32 mShakeXZ_minDamp; + /* 0x13D0 */ u8 mShakeTimer; }; +STATIC_ASSERT(sizeof(daTaFence_c) == 0x13d4); #endif /* D_A_OBJ_TAFENCE_H */ diff --git a/include/d/d_a_obj.h b/include/d/d_a_obj.h index aa1f5f6566..50eb03abd2 100644 --- a/include/d/d_a_obj.h +++ b/include/d/d_a_obj.h @@ -17,15 +17,21 @@ void quat_rotBaseY(Quaternion*, cXyz const&); void HitSeStart(cXyz const*, int, dCcD_GObjInf const*, u32); template <typename T> -int PrmAbstract(const fopAc_ac_c* i_actor, T i_prmA, T i_prmB) { +T PrmAbstract(const fopAc_ac_c* i_actor, T i_nbits, T i_shift) { u32 param = fopAcM_GetParam(i_actor); - return ((1 << i_prmA) - 1) & (param >> i_prmB); + return T((param >> i_shift) & ((1 << i_nbits) - 1)); } -class HioVarious_c { +class HioVarious_c : public JORReflexible { public: - static void init(JORReflexible*, const char*); - static void clean(JORReflexible*); + static void init(JORReflexible* node_ptr, const char* node_name); + static void clean(JORReflexible* node_ptr); + + void genMessage(JORMContext*); + + /* 0x04 */ JORReflexible* node_ptrs[16]; + /* 0x44 */ const char* node_names[16]; + /* 0x84 */ u8 field_0x84; }; }; // namespace daObj diff --git a/include/d/d_bg_w.h b/include/d/d_bg_w.h index 0df43782ac..0de571eacc 100644 --- a/include/d/d_bg_w.h +++ b/include/d/d_bg_w.h @@ -341,4 +341,6 @@ private: /* 0xBC */ u8 m_flags; }; +dBgW* dBgW_NewSet(cBgD_t* pbgd, u32 flags, Mtx* pbase_mtx); + #endif /* D_BG_D_BG_W_H */ diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index de900f731d..5401dfdb45 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -1237,6 +1237,10 @@ inline void dComIfGs_offSwitch(int i_no, int i_roomNo) { g_dComIfG_gameInfo.info.offSwitch(i_no, i_roomNo); } +inline void dComIfGs_revSwitch(int i_no, int i_roomNo) { + g_dComIfG_gameInfo.info.revSwitch(i_no, i_roomNo); +} + inline BOOL dComIfGs_isSwitch(int i_no, int i_roomNo) { return g_dComIfG_gameInfo.info.isSwitch(i_no, i_roomNo); } @@ -2147,10 +2151,6 @@ inline void dComIfGs_offTransformLV(int i_no) { g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().offTransformLV(i_no); } -inline void dComIfGs_revSwitch(int i_no, int i_roomNo) { - g_dComIfG_gameInfo.info.revSwitch(i_no, i_roomNo); -} - inline s8 dComIfGs_Grass_hide_Check() { return g_dComIfG_gameInfo.field_0x1ddfc; } @@ -3748,6 +3748,10 @@ inline bool dComIfGp_evmng_existence(const char* eventname) { dComIfGp_evmng_getEventIdx(eventname, 0xFF)) != NULL; } +inline bool dComIfGp_evmng_existence(s16 eventId) { + return g_dComIfG_gameInfo.play.getEvtManager().getEventData(eventId) != NULL; +} + inline void dComIfGp_particle_createCommon(const void* data) { g_dComIfG_gameInfo.play.getParticle()->createCommon(data); } diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 545d650dc7..8621493209 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -441,6 +441,7 @@ inline void fopAcM_SetAngle(fopAc_ac_c* i_actor, s16 x, s16 y, s16 z) { inline void dComIfGs_onSwitch(int i_no, int i_roomNo); inline void dComIfGs_offSwitch(int i_no, int i_roomNo); +inline void dComIfGs_revSwitch(int i_no, int i_roomNo); inline BOOL dComIfGs_isSwitch(int i_no, int i_roomNo); inline void dComIfGs_offActor(int i_no, int i_roomNo); @@ -452,6 +453,10 @@ inline void fopAcM_offSwitch(const fopAc_ac_c* i_actor, int sw) { return dComIfGs_offSwitch(sw, fopAcM_GetHomeRoomNo(i_actor)); } +inline void fopAcM_revSwitch(const fopAc_ac_c* i_actor, int sw) { + return dComIfGs_revSwitch(sw, fopAcM_GetHomeRoomNo(i_actor)); +} + inline BOOL fopAcM_isSwitch(const fopAc_ac_c* i_actor, int sw) { return dComIfGs_isSwitch(sw, fopAcM_GetHomeRoomNo(i_actor)); } |
