diff options
| author | Pheenoh <pheenoh@gmail.com> | 2022-12-26 10:55:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-26 10:55:53 -0700 |
| commit | 8b0ee4d50bd650c308b35703873093220ac46f90 (patch) | |
| tree | afd1a82ec762ad38c31e85056bba2cd4d90d46d1 /include | |
| parent | 8516f01f79086c0efce77ab12f8dba23a62b3e54 (diff) | |
d_insect first pass (#219)
* dInsect_c::dInsect_c
* dInsect_c::Insect_GetDemoMain attempt
* dInsect_c::CalcZBuffer attempt
* remove asm
* convert clib inlines to template functions
Diffstat (limited to 'include')
| -rw-r--r-- | include/SSystem/SComponent/c_lib.h | 11 | ||||
| -rw-r--r-- | include/d/com/d_com_inf_game.h | 4 | ||||
| -rw-r--r-- | include/d/d_camera.h | 4 | ||||
| -rw-r--r-- | include/d/d_drawlist.h | 4 | ||||
| -rw-r--r-- | include/d/d_insect.h | 24 | ||||
| -rw-r--r-- | include/d/menu/d_menu_insect.h | 2 | ||||
| -rw-r--r-- | include/f_op/f_op_actor.h | 2 | ||||
| -rw-r--r-- | include/m_Do/m_Do_lib.h | 1 |
8 files changed, 47 insertions, 5 deletions
diff --git a/include/SSystem/SComponent/c_lib.h b/include/SSystem/SComponent/c_lib.h index 6eb7142e4f..3e277a79d9 100644 --- a/include/SSystem/SComponent/c_lib.h +++ b/include/SSystem/SComponent/c_lib.h @@ -36,13 +36,18 @@ s16 cLib_targetAngleX(const cXyz*, const cXyz*); void cLib_offsetPos(cXyz* pDest, cXyz const* pSrc, s16 angle, cXyz const* vec); s32 cLib_distanceAngleS(s16 x, s16 y); -inline void cLib_offBit(u8& value, u8 bit) { +template <typename T> +inline void cLib_offBit(T& value, u8 bit) { value &= ~bit; } -inline void cLib_onBit(u8& value, u8 bit) { + +template <typename T> +inline void cLib_onBit(T& value, u8 bit) { value |= bit; } -inline u8 cLib_checkBit(u8& value, u8 bit) { + +template <typename T> +inline T cLib_checkBit(T& value, u8 bit) { return value & bit; } diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h index 72fad43697..b7e094eb84 100644 --- a/include/d/com/d_com_inf_game.h +++ b/include/d/com/d_com_inf_game.h @@ -2769,6 +2769,10 @@ inline void dComIfGd_init() { g_dComIfG_gameInfo.drawlist.init(); } +inline void dComIfGd_peekZ(s16 param_0, s16 param_1, u32* param_2) { + g_dComIfG_gameInfo.drawlist.newPeekZdata(param_0, param_1, param_2); +} + inline void dComIfGd_peekZdata() { g_dComIfG_gameInfo.drawlist.peekZdata(); } diff --git a/include/d/d_camera.h b/include/d/d_camera.h index 5aad5b6ae1..b5e2336c7e 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -515,7 +515,9 @@ public: /* 0x920 */ f32 mTrimHeight; /* 0x924 */ int mTrimSize; /* 0x928 */ int mTrimTypeForce; - /* 0x92C */ u8 field_0x92c[0x970 - 0x92c]; + /* 0x92C */ u8 field_0x92c[0x93C - 0x92c]; + /* 0x93C */ f32 field_0x93c; + /* 0x940 */ u8 field_0x940[0x970 - 0x940]; /* 0x970 */ dCamSetup_c mCamSetup; /* 0xAEC */ dCamParam_c mCamParam; /* 0xB0C */ diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 423383e051..c22a647f2b 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -326,6 +326,10 @@ public: param_6); } + void newPeekZdata(s16 param_0, s16 param_1, u32* param_2) { + mPeekZ.newData(param_0, param_1, param_2); + } + static void offWipe() { mWipe = 0; } static f32 getWipeRate() { return mWipeRate; } diff --git a/include/d/d_insect.h b/include/d/d_insect.h index 0e30b48d28..286dbaa6a1 100644 --- a/include/d/d_insect.h +++ b/include/d/d_insect.h @@ -2,5 +2,29 @@ #define D_D_INSECT_H #include "dolphin/types.h" +#include "f_op/f_op_actor.h" + +class dInsect_c : public fopAc_ac_c { +public: +/* 80110648 */ virtual void Insect_Release(); +/* 8015E010 */ dInsect_c(); +/* 8015E078 */ virtual void Insect_GetDemoMain(); +/* 8015E26C */ virtual void CalcZBuffer(f32); +private: + /* 0x56C */ u8 field_0x56C; + /* 0x56D */ u8 field_0x56D; + /* 0x56E */ u8 field_0x56E[10]; + /* 0x578 */ u32 field_0x578; + /* 0x57C */ f32 field_0x57C; + /* 0x580 */ u8 field_0x580; + /* 0x581 */ u8 field_0x581; + /* 0x582 */ s16 field_0x582; + /* 0x584 */ u8 field_0x584; + /* 0x585 */ u8 field_0x585; + /* 0x586 */ u8 field_0x586[2]; + /* 0x588 */ u32 field_0x588; + /* 0x58C */ int field_0x58C; + +}; #endif /* D_D_INSECT_H */ diff --git a/include/d/menu/d_menu_insect.h b/include/d/menu/d_menu_insect.h index 84b4d2d3cc..40cc9ebf3f 100644 --- a/include/d/menu/d_menu_insect.h +++ b/include/d/menu/d_menu_insect.h @@ -38,7 +38,7 @@ public: /* 801D9E20 */ void isGiveInsect(int, int); /* 801D9ED4 */ void isGiveInsect(u8); /* 801D9E7C */ void isCatchInsect(u8); - /* 801D9F3C */ void isCatchNotGiveInsect(u8); + /* 801D9F3C */ static u8 isCatchNotGiveInsect(u8); /* 801D9F8C */ void cursorMove(); /* 801DA1EC */ void setCursorPos(); /* 801DA2FC */ bool dpdMove(); diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index f61f938669..9c2f1a1da8 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -136,6 +136,8 @@ public: s8 getRoomNo() const { return current.mRoomNo; } }; // Size: 0x568 +STATIC_ASSERT(sizeof(fopAc_ac_c) == 0x568); + class fopEn_enemy_c : public fopAc_ac_c { public: /* 80019404 */ void initBallModel(); diff --git a/include/m_Do/m_Do_lib.h b/include/m_Do/m_Do_lib.h index 4fc35f86c7..7c51c8b22d 100644 --- a/include/m_Do/m_Do_lib.h +++ b/include/m_Do/m_Do_lib.h @@ -16,5 +16,6 @@ struct mDoLib_clipper { void mDoLib_project(Vec* param_0, Vec* param_1); bool mDoLib_setResTimgObj(ResTIMG const* res, GXTexObj* o_texObj, u32 param_2, GXTlutObj* o_tlutObj); +void mDoLib_pos2camera(Vec* param_0, Vec* param_1); #endif /* M_DO_M_DO_LIB_H */ |
