diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2024-03-07 19:23:18 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-07 20:23:18 -0700 |
| commit | ba4847e9cc2514fd722d45e54f7af87ee9de5bbd (patch) | |
| tree | b84de84c303d05af80777f79c7f0579c9b9fadb2 /include | |
| parent | 22e941fd8c506a8b8ee0d963c5e50dae7ba379bc (diff) | |
d_a_shop_item, d_a_b_go, d_a_b_gos OK (#2085)
* d_a_shop_item OK
* d_a_b_go OK
* d_a_b_gos OK
* remove asm
* some work on d_a_b_oh / d_a_b_zant_sima
* d_a_startAndGoal done
Diffstat (limited to 'include')
| -rw-r--r-- | include/JSystem/JGadget/search.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JMath/JMATrigonometric.h | 4 | ||||
| -rw-r--r-- | include/JSystem/JStudio/JStudio/functionvalue.h | 1 | ||||
| -rw-r--r-- | include/JSystem/JStudio/JStudio/stb.h | 2 | ||||
| -rw-r--r-- | include/d/a/d_a_itembase.h | 4 | ||||
| -rw-r--r-- | include/d/a/d_a_npc.h | 22 | ||||
| -rw-r--r-- | include/d/a/d_a_shop_item_static.h | 60 | ||||
| -rw-r--r-- | include/d/com/d_com_inf_game.h | 1 | ||||
| -rw-r--r-- | include/d/d_stage.h | 2 | ||||
| -rw-r--r-- | include/d/d_timer.h | 6 | ||||
| -rw-r--r-- | include/dolphin/os.h | 2 | ||||
| -rw-r--r-- | include/global.h | 1 | ||||
| -rw-r--r-- | include/rel/d/a/b/d_a_b_go/d_a_b_go.h | 37 | ||||
| -rw-r--r-- | include/rel/d/a/b/d_a_b_gos/d_a_b_gos.h | 39 | ||||
| -rw-r--r-- | include/rel/d/a/b/d_a_b_oh/d_a_b_oh.h | 2 | ||||
| -rw-r--r-- | include/rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.h | 10 | ||||
| -rw-r--r-- | include/rel/d/a/d_a_shop_item/d_a_shop_item.h | 12 | ||||
| -rw-r--r-- | include/rel/d/a/d_a_spinner/d_a_spinner.h | 2 |
18 files changed, 186 insertions, 23 deletions
diff --git a/include/JSystem/JGadget/search.h b/include/JSystem/JGadget/search.h index a7b3510800..0ef191d046 100644 --- a/include/JSystem/JGadget/search.h +++ b/include/JSystem/JGadget/search.h @@ -1,7 +1,7 @@ #ifndef SEARCH_H #define SEARCH_H -#include "global.h" +#include "dolphin/os.h" namespace JGadget { diff --git a/include/JSystem/JMath/JMATrigonometric.h b/include/JSystem/JMath/JMATrigonometric.h index 48107ab04d..206cc47077 100644 --- a/include/JSystem/JMath/JMATrigonometric.h +++ b/include/JSystem/JMath/JMATrigonometric.h @@ -15,8 +15,8 @@ struct TAngleConstant_<f32> { struct TSinCosTable { std::pair<f32, f32> table[0x2000]; - f32 sinShort(s16 v) const { return table[static_cast<u16>(v) >> 3].first; } - f32 cosShort(s16 v) const { return table[static_cast<u16>(v) >> 3].second; } + f32 sinShort(s16 v) const { return table[(u16)v >> 3U].first; } + f32 cosShort(s16 v) const { return table[(u16)v >> 3U].second; } inline f32 sinLap(f32 v) { if (v < 0.0f) { diff --git a/include/JSystem/JStudio/JStudio/functionvalue.h b/include/JSystem/JStudio/JStudio/functionvalue.h index 9dd8d9abd0..cc03e765d6 100644 --- a/include/JSystem/JStudio/JStudio/functionvalue.h +++ b/include/JSystem/JStudio/JStudio/functionvalue.h @@ -3,6 +3,7 @@ #include "JSystem/JGadget/search.h" #include "JSystem/JGadget/vector.h" +#include "dolphin/os.h" #include "global.h" namespace JStudio { diff --git a/include/JSystem/JStudio/JStudio/stb.h b/include/JSystem/JStudio/JStudio/stb.h index dd56bce92a..00b5e6fe17 100644 --- a/include/JSystem/JStudio/JStudio/stb.h +++ b/include/JSystem/JStudio/JStudio/stb.h @@ -4,7 +4,7 @@ #include "JSystem/JGadget/linklist.h" #include "JSystem/JStudio/JStudio/object-id.h" #include "JSystem/JStudio/JStudio/stb-data-parse.h" -#include "global.h" +#include "dolphin/os.h" namespace JStudio { struct TObject; diff --git a/include/d/a/d_a_itembase.h b/include/d/a/d_a_itembase.h index 2231dae7f6..e8f1ed76f6 100644 --- a/include/d/a/d_a_itembase.h +++ b/include/d/a/d_a_itembase.h @@ -4,7 +4,7 @@ #include "SSystem/SComponent/c_phase.h" #include "d/bg/d_bg_s_acch.h" #include "d/cc/d_cc_d.h" -#include "f_op/f_op_actor.h" +#include "f_op/f_op_actor_mng.h" struct daItemBase_data { /* 0x00 */ f32 mGravity; @@ -71,7 +71,7 @@ public: /* 0x764 */ dBgS_AcchCir mAcchCir; /* 0x7A4 */ dCcD_Stts mColStatus; /* 0x7E0 */ dCcD_Cyl mCollider; - /* 0x91C */ u32 field_0x91c; + /* 0x91C */ u32 mShadowKey; /* 0x920 */ u32 field_0x920; /* 0x924 */ int field_0x924; /* 0x928 */ s16 field_0x928; diff --git a/include/d/a/d_a_npc.h b/include/d/a/d_a_npc.h index 72a7df4e6e..53644bf54a 100644 --- a/include/d/a/d_a_npc.h +++ b/include/d/a/d_a_npc.h @@ -867,7 +867,13 @@ private: public: /* 80150870 */ void initialize(dPath*, int); -}; + + daNpcF_SPCurve_c() { + initialize(NULL, 0); + } + + virtual ~daNpcF_SPCurve_c() {} +}; // Size: 0x60C class daNpcF_Path_c { private: @@ -888,17 +894,23 @@ public: /* 80150A7C */ void chkPassedDst(cXyz); /* 80150BBC */ void reverse(); /* 80150BE0 */ int setNextIdx(); - /* 80150C18 */ u16 getNextIdx(); + /* 80150C18 */ int getNextIdx(); /* 80150C60 */ u16 getBeforeIdx(); /* 80150CA8 */ int getBeforePos(cXyz&); /* 80150D44 */ int getNextPos(cXyz&); /* 80150DE0 */ int getDstPos(cXyz, cXyz&); /* 80150EB4 */ void setNextIdxDst(cXyz); - u16& getIdx() { return mIdx; }; - inline Vec getPntPos(int i_idx) { return mpRoomPath->m_points[i_idx].m_position; } + daNpcF_Path_c() { + initialize(); + } + + virtual ~daNpcF_Path_c() {} + + int getIdx() { return mIdx; }; + Vec getPntPos(int i_idx) { return mpRoomPath->m_points[i_idx].m_position; } int chkClose() { return dPath_ChkClose(mpRoomPath); } -}; +}; // Size: 0x630 class daNpcF_Lookat_c { private: diff --git a/include/d/a/d_a_shop_item_static.h b/include/d/a/d_a_shop_item_static.h index bc6dd4448f..c6c3cf96c4 100644 --- a/include/d/a/d_a_shop_item_static.h +++ b/include/d/a/d_a_shop_item_static.h @@ -12,6 +12,18 @@ struct ResourceData { s16 get_bxa1Name() const { return mBxaName; } s16 get_brk1Name() const { return mBrkName; } s16 get_btp1Name() const { return mBtpName; } + f32 get_scale() const { return mScale; } + f32 get_offsetY() const { return mOffsetY; } + s16 get_angleX() const { return mAngle.x; } + s16 get_angleY() const { return mAngle.y; } + s16 get_angleZ() const { return mAngle.z; } + s16 get_angleOffsetX() const { return mAngleOffsetX; } + u32 get_flag() const { return mFlag; } + s8 get_tevfrm() const { return mTevFrm; } + s8 get_btpfrm() const { return mBtpFrm; } + u8 get_shadowSize() const { return mShadowSize; } + u8 get_collisionH() const { return mCollisionH; } + u8 get_collisionR() const { return mCollisionR; } /* 0x00 */ const char* mArcName; /* 0x04 */ s16 mBmdName; @@ -37,6 +49,24 @@ class daShopItem_c : public daItemBase_c { public: /* 80037C14 */ csXyz* getRotateP(); /* 80037C1C */ cXyz* getPosP(); + /* 8059E9B8 */ const char* getShopArcname(); + /* 8059EC04 */ u16 getHeapSize(); + /* 8059EC1C */ void CreateInit(); + /* 8059ED58 */ void set_mtx(); + /* 8059EEF4 */ bool _execute(); + /* 8059EF48 */ bool _draw(); + + inline int _create(); + inline int _delete(); + + /* 8059EF9C */ virtual void setListStart(); + /* 8059EFA0 */ virtual void setShadow(); + /* 8059F024 */ virtual BOOL chkFlag(int); + /* 8059F044 */ virtual s8 getTevFrm(); + /* 8059F064 */ virtual s8 getBtpFrm(); + /* 8059F084 */ virtual u8 getShadowSize(); + /* 8059F0A0 */ virtual u8 getCollisionH(); + /* 8059F0BC */ virtual u8 getCollisionR(); u8 getShopItemID() const { return mShopItemID; } s16 getAngleX() const { return mAngleX; } @@ -45,6 +75,34 @@ public: void setAngleY(s16 angle) { mAngleY = angle;} static ResourceData const mData[23]; + static f32 const m_cullfar_max; + + enum { + SHOP_ITEMNO_SOLD, + SHOP_ITEMNO_OIL, + SHOP_ITEMNO_RED, + SHOP_ITEMNO_MILK, + SHOP_ITEMNO_HALF_MILK, + SHOP_ITEMNO_ARROW, + SHOP_ITEMNO_SHIELD_B, + SHOP_ITEMNO_SHIELD_A, + SHOP_ITEMNO_BOMB, + SHOP_ITEMNO_WATER_BOMB, + SHOP_ITEMNO_POKE_BOMB, + SHOP_ITEMNO_BOMB_BAG, + SHOP_ITEMNO_BOMB_BAG_LV2, + SHOP_ITEMNO_LAND_MINE, + SHOP_ITEMNO_BOTTLE2, + SHOP_ITEMNO_BEE_CHILD, + SHOP_ITEMNO_PACHINKO, + SHOP_ITEMNO_BLUE, + SHOP_ITEMNO_HAWKEYE, + SHOP_ITEMNO_ARMOR, + SHOP_ITEMNO_ARMOR_SOLD, + SHOP_ITEMNO_GREEN, + SHOP_ITEMNO_DROP, + SHOP_ITEMNO_MAX, + }; private: /* 0x92C */ Mtx mMtx; @@ -54,4 +112,6 @@ private: /* 0x964 */ u8 mShopItemID; }; +int CheckShopItemCreateHeap(fopAc_ac_c* i_this); + #endif /* D_A_D_A_SHOP_ITEM_STATIC_H */ diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h index d10b8eeef3..0de93bcaeb 100644 --- a/include/d/com/d_com_inf_game.h +++ b/include/d/com/d_com_inf_game.h @@ -823,6 +823,7 @@ int dComIfG_resLoad(request_of_phase_process_class* i_phase, char const* resName int dComIfG_TimerDeleteRequest(int i_mode); int dComIfG_TimerStart(int i_mode, s16 i_time); bool dComIfGp_isLightDropMapVisible(); +int dComIfG_TimerEnd(int i_mode, int param_1); inline void dComIfG_setBrightness(u8 brightness) { g_dComIfG_gameInfo.mFadeBrightness = brightness; diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 32b5626177..e469243d41 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -292,7 +292,7 @@ struct dStage_dPnt_c { /* 0x1 */ u8 field_0x1; /* 0x2 */ u8 field_0x2; /* 0x3 */ u8 field_0x3; - /* 0x4 */ cXyz m_position; + /* 0x4 */ Vec m_position; }; // Size: 0x10 struct dStage_FloorInfo_c { diff --git a/include/d/d_timer.h b/include/d/d_timer.h index fce6bed8c4..1365cbc59c 100644 --- a/include/d/d_timer.h +++ b/include/d/d_timer.h @@ -10,9 +10,11 @@ class JKRArchive; class JKRExpHeap; s32 dTimer_createStockTimer(); -s32 dTimer_createTimer(s32 param_0, u32 param_1, u8 param_2, u8 param_3, f32 param_4, f32 param_5, +s32 dTimer_createTimer(s32 i_mode, u32 i_limitMs, u8 i_type, u8 param_3, f32 param_4, f32 param_5, f32 param_6, f32 param_7); int dTimer_getRestTimeMs(); +u8 dTimer_isStart(); +u8 dTimer_isReadyFlag(); class dDlst_TimerScrnDraw_c : public dDlst_base_c { public: @@ -125,7 +127,7 @@ public: /* 8025D9F0 */ int getTimeMs(); /* 8025DA54 */ int getLimitTimeMs(); /* 8025DA9C */ int getRestTimeMs(); - /* 8025DB10 */ int isStart(); + /* 8025DB10 */ u8 isStart(); /* 802613DC */ int createGetIn(cXyz); s32 createStart(u16 param_0) { return mp_tm_scrn->createStart(param_0); } diff --git a/include/dolphin/os.h b/include/dolphin/os.h index b320ec27b1..2f436afe8b 100644 --- a/include/dolphin/os.h +++ b/include/dolphin/os.h @@ -97,11 +97,13 @@ void OSReportInit(void); #define OS_REPORT(...) OSReport(__VA_ARGS__) #define OS_PANIC(msg) OSPanic(__FILE__, __LINE__, msg) #define ASSERTMSG(exp, msg) (void)((exp) || (OSPanic(__FILE__, __LINE__, (msg)), 0)) +#define ASSERT(cond) ((cond) || (OSPanic(__FILE__, line, "Failed assertion " #cond), 0)) #else #define OS_REPORT(...) #define OS_REPORT_ERROR(...) #define OS_PANIC(...) #define ASSERTMSG(exp, msg) ((void)0) +#define ASSERT(cond) ((void)0) #endif extern u8 __OSReport_disable; diff --git a/include/global.h b/include/global.h index 2a255c6070..9898b9f220 100644 --- a/include/global.h +++ b/include/global.h @@ -13,7 +13,6 @@ #define IS_NOT_ALIGNED(X, N) (((X) & ((N)-1)) != 0) #define JUT_EXPECT(...) -#define ASSERT(...) #define FLAG_ON(V, F) (((V) & (F)) == 0) #define FLOAT_LABEL(x) (*(f32*)&x) diff --git a/include/rel/d/a/b/d_a_b_go/d_a_b_go.h b/include/rel/d/a/b/d_a_b_go/d_a_b_go.h index 82a20e840f..bb524ad0b2 100644 --- a/include/rel/d/a/b/d_a_b_go/d_a_b_go.h +++ b/include/rel/d/a/b/d_a_b_go/d_a_b_go.h @@ -1,5 +1,42 @@ #ifndef D_A_B_GO_H #define D_A_B_GO_H +#include "f_op/f_op_actor_mng.h" +#include "Z2AudioLib/Z2Creature.h" +#include "d/cc/d_cc_d.h" +#include "d/cc/d_cc_uty.h" + +#define GORON_CHILD_MAX 31 + +class b_go_class : public fopEn_enemy_c { +public: + /* 80603CA0 */ b_go_class(); + + /* 0x5AC */ request_of_phase_process_class mPhase; + /* 0x5B4 */ mDoExt_McaMorfSO* mpMorf; + /* 0x5B8 */ Z2CreatureEnemy mSound; + /* 0x65C */ int mAnmID; + /* 0x660 */ u8 unk_0x660; + /* 0x661 */ u8 field_0x661[0x668 - 0x661]; + /* 0x668 */ s16 unk_0x668; + /* 0x66A */ s16 mActionID; + /* 0x66C */ s16 mMode; + /* 0x66E */ u8 field_0x66e[0x67e - 0x66e]; + /* 0x67E */ s16 mAngleToPlayer; + /* 0x680 */ f32 mDistToPlayer; + /* 0x684 */ u8 field_0x684[4]; + /* 0x688 */ s16 mTimers[4]; + /* 0x690 */ s16 unk_0x690; + /* 0x692 */ s16 field_0x692; + /* 0x694 */ dBgS_AcchCir mAcchCir; + /* 0x6D4 */ dBgS_ObjAcch mAcch; + /* 0x8AC */ dCcD_Stts mStts; + /* 0x8E8 */ dCcD_Sph field_0x8e8; + /* 0xA20 */ dCcD_Sph field_0xa20; + /* 0xB58 */ dCcD_Cyl field_0xb58; + /* 0xC94 */ dCcU_AtInfo mAtInfo; + /* 0xCB8 */ u32 mGoronChildIDs[GORON_CHILD_MAX]; + /* 0xD34 */ u8 field_0xd34; +}; #endif /* D_A_B_GO_H */ diff --git a/include/rel/d/a/b/d_a_b_gos/d_a_b_gos.h b/include/rel/d/a/b/d_a_b_gos/d_a_b_gos.h index 05d72ddfa3..c823bdca94 100644 --- a/include/rel/d/a/b/d_a_b_gos/d_a_b_gos.h +++ b/include/rel/d/a/b/d_a_b_gos/d_a_b_gos.h @@ -1,6 +1,43 @@ #ifndef D_A_B_GOS_H #define D_A_B_GOS_H -#include "dolphin/types.h" +#include "Z2AudioLib/Z2Creature.h" +#include "d/cc/d_cc_d.h" +#include "d/cc/d_cc_uty.h" +#include "f_op/f_op_actor_mng.h" + +class b_gos_class : public fopEn_enemy_c { +public: + /* 80605024 */ b_gos_class(); + + /* 0x5AC */ request_of_phase_process_class mPhase; + /* 0x5B4 */ mDoExt_McaMorfSO* mpMorf; + /* 0x5B8 */ Z2CreatureEnemy mSound; + /* 0x65C */ int mAnmID; + /* 0x660 */ u32 mJointIndex; + /* 0x664 */ u8 field_0x664[0x668 - 0x664]; + /* 0x668 */ u32 mShadowKey; + /* 0x66C */ s16 field_0x66c; + /* 0x66E */ s16 mAction; + /* 0x670 */ s16 mMode; + /* 0x672 */ u8 field_0x672[0x680 - 0x672]; + /* 0x680 */ s16 mWalkDirection; + /* 0x682 */ s16 mAngleToPlayer; + /* 0x684 */ f32 mDistToPlayer; + /* 0x688 */ u8 field_0x688[0x68C - 0x688]; + /* 0x68C */ s16 mTimers[4]; + /* 0x694 */ s16 field_0x694; + /* 0x698 */ f32 field_0x698; + /* 0x69C */ f32 field_0x69c; + /* 0x6A0 */ s16 mAngleOffset; + /* 0x6A4 */ dBgS_AcchCir mAcchCir; + /* 0x6E4 */ dBgS_ObjAcch mAcch; + /* 0x8BC */ dCcD_Stts mCcStts; + /* 0x8F8 */ dCcD_Sph field_0x8f8; + /* 0xA30 */ dCcD_Sph field_0xa30; + /* 0xB68 */ dCcD_Cyl mCyl; + /* 0xCA4 */ dCcU_AtInfo mAtInfo; + /* 0xCC8 */ u8 field_0xcc8; +}; #endif /* D_A_B_GOS_H */ diff --git a/include/rel/d/a/b/d_a_b_oh/d_a_b_oh.h b/include/rel/d/a/b/d_a_b_oh/d_a_b_oh.h index 1fc10bd7b4..efb2b49387 100644 --- a/include/rel/d/a/b/d_a_b_oh/d_a_b_oh.h +++ b/include/rel/d/a/b/d_a_b_oh/d_a_b_oh.h @@ -6,7 +6,7 @@ class daB_OH_HIO_c { public: /* 8061B72C */ daB_OH_HIO_c(); - /* 8061D93C */ virtual ~daB_OH_HIO_c(); + /* 8061D93C */ virtual ~daB_OH_HIO_c(); // supposed to be inlined /* 0x4 */ s8 field_0x4; /* 0x8 */ f32 mModelSize; diff --git a/include/rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.h b/include/rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.h index f55bb9ca7b..19970cc41c 100644 --- a/include/rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.h +++ b/include/rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.h @@ -20,10 +20,12 @@ public: /* 0x578 */ mDoExt_btkAnm* mpBtkAnm; /* 0x57C */ u32 mPlayerID; /* 0x580 */ u32 mBossID; - /* 0x584 */ u8 field_0x584[4]; - /* 0x588 */ f32 field_0x588; - /* 0x58C */ csXyz field_0x58c; - /* 0x594 */ Mtx field_0x594; + /* 0x584 */ u8 mSinkTimers[2]; + /* 0x586 */ bool mSinkPlayer; + /* 0x587 */ bool mSinkZant; + /* 0x588 */ f32 mHeight; + /* 0x58C */ csXyz mRotation; + /* 0x594 */ Mtx mMtx; /* 0x5C4 */ dBgW* mpBgW; }; diff --git a/include/rel/d/a/d_a_shop_item/d_a_shop_item.h b/include/rel/d/a/d_a_shop_item/d_a_shop_item.h index a3cd4a9dc2..b5cff75720 100644 --- a/include/rel/d/a/d_a_shop_item/d_a_shop_item.h +++ b/include/rel/d/a/d_a_shop_item/d_a_shop_item.h @@ -1,6 +1,16 @@ #ifndef D_A_SHOP_ITEM_H #define D_A_SHOP_ITEM_H -#include "dolphin/types.h" +#include "d/a/d_a_shop_item_static.h" + +namespace daShopItem_prm { +inline u8 getGroup(daShopItem_c* i_this) { + return fopAcM_GetParam(i_this) >> 0x1C; +} + +inline u8 getItemNo(daShopItem_c* i_this) { + return fopAcM_GetParam(i_this) & 0xFF; +} +} // namespace dahopItem_prm #endif /* D_A_SHOP_ITEM_H */ diff --git a/include/rel/d/a/d_a_spinner/d_a_spinner.h b/include/rel/d/a/d_a_spinner/d_a_spinner.h index 418ae6d453..133fb20971 100644 --- a/include/rel/d/a/d_a_spinner/d_a_spinner.h +++ b/include/rel/d/a/d_a_spinner/d_a_spinner.h @@ -19,7 +19,7 @@ public: /* 804D3174 */ void setWallHit(s16, u32); /* 804D34B0 */ void setAnm(); /* 804D3618 */ int setNextPathNum(); - /* 804D3694 */ cXyz* getPathNextPos(); + /* 804D3694 */ Vec* getPathNextPos(); /* 804D36F4 */ int checkLineWallHit(cXyz*, cXyz*); /* 804D3774 */ int checkPathMove(); /* 804D3D60 */ void setSpreadEffect(); |
