From 877889c5105e59ee3aa4e57e53d3b0c5ffcfca77 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Tue, 23 Dec 2025 18:53:10 -0500 Subject: Clean up code, remove fakematches, add UNUSED, enable warnings (#2992) * Remove NDEBUG_DEFINED fakematch, clean up getName temps * Fix ifdef * Fix bad JSystem pch ifdef breaking decomp.me * Remove Acch Chk fakematches * Private Acch fields * Fix some clangd errors in headers * Add UNUSED macro for matching debug parameters * Enable clangd unused-parameter warning * Remove extern from initializers Probably added by dol2asm? * Fix process profile definitions * Remove leftover dol2asm address comments * Remove some unnecessary double casts * Enable some more clangd warnings * Fix missing usages of fopAcM_ct * Fix wrong enum usage * Fix more fakematches --- include/JSystem/JGadget/linklist.h | 4 ++ include/JSystem/JSystem.h | 2 +- include/JSystem/JUtility/JUTResFont.h | 4 +- include/SSystem/SComponent/c_cc_d.h | 36 ++++++++-------- include/SSystem/SComponent/c_cc_s.h | 2 +- .../TRK_MINNOW_DOLPHIN/MetroTRK/Portable/mem_TRK.h | 4 ++ .../TRK_MINNOW_DOLPHIN/MetroTRK/Portable/msgbuf.h | 19 +++++++++ .../MetroTRK/Portable/mutex_TRK.h | 1 + include/d/actor/d_a_npc_cdn3.h | 2 +- include/d/actor/d_a_npc_tk.h | 8 ---- include/d/actor/d_a_obj_lv6SwGate.h | 1 - include/d/actor/d_a_obj_stone.h | 2 +- include/d/d_bg_s_acch.h | 4 +- include/d/d_com_inf_game.h | 2 +- include/d/d_debug_camera.h | 2 +- include/d/d_menu_fmap.h | 1 + include/d/d_menu_fmap_map.h | 6 +-- include/d/d_meter2_info.h | 10 +---- include/d/d_stage.h | 48 +++++++++++----------- include/f_op/f_op_actor_mng.h | 2 +- include/f_op/f_op_scene.h | 9 +++- include/global.h | 5 +++ include/m_Do/m_Do_audio.h | 2 +- 23 files changed, 101 insertions(+), 75 deletions(-) (limited to 'include') diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h index 2fcb281f06..47a438ddb8 100644 --- a/include/JSystem/JGadget/linklist.h +++ b/include/JSystem/JGadget/linklist.h @@ -270,7 +270,11 @@ struct TLinkList_factory : public TLinkList { template TLinkList_factory::~TLinkList_factory() { +#ifdef __MWERKS__ JGADGET_ASSERTWARN(934, empty()); +#else + JGADGET_ASSERTWARN(934, this->empty()); +#endif } template diff --git a/include/JSystem/JSystem.h b/include/JSystem/JSystem.h index 82231fe4d4..2b2f1143d0 100644 --- a/include/JSystem/JSystem.h +++ b/include/JSystem/JSystem.h @@ -1,7 +1,7 @@ #ifndef JSYSTEM_H #define JSYSTEM_H -#ifdef __MWERKS__ +#if __MWERKS__ && !defined(DECOMPCTX) #include "JSystem/JSystem.mch" // IWYU pragma: export #else #include "JSystem/JSystem.pch" // IWYU pragma: export diff --git a/include/JSystem/JUtility/JUTResFont.h b/include/JSystem/JUtility/JUTResFont.h index 819c77c05e..473a8e8f99 100644 --- a/include/JSystem/JUtility/JUTResFont.h +++ b/include/JSystem/JUtility/JUTResFont.h @@ -79,7 +79,7 @@ public: /* 0x6C */ const IsLeadByte_func* mIsLeadByte; }; -extern u8 const JUTResFONT_Ascfont_fix12[16736]; -extern u8 const JUTResFONT_Ascfont_fix16[16736]; +extern u8 const JUTResFONT_Ascfont_fix12[]; +extern u8 const JUTResFONT_Ascfont_fix16[]; #endif /* JUTRESFONT_H */ diff --git a/include/SSystem/SComponent/c_cc_d.h b/include/SSystem/SComponent/c_cc_d.h index f8802dfc25..0ad2f717a7 100644 --- a/include/SSystem/SComponent/c_cc_d.h +++ b/include/SSystem/SComponent/c_cc_d.h @@ -403,24 +403,24 @@ public: virtual bool CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const { return false; } - /* vt[4] */ virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const = 0; - /* vt[5] */ virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const = 0; - /* vt[6] */ virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const = 0; - /* vt[7] */ virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const = 0; - /* vt[8] */ virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const = 0; - /* vt[9] */ virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const = 0; - /* 802649E0 vt[10]*/ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const { return false; } - /* vt[11]*/ virtual bool CrossCo(cCcD_PntAttr const&, f32*) const = 0; - /* vt[12]*/ virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const = 0; - /* vt[13]*/ virtual bool CrossCo(cCcD_TriAttr const&, f32*) const = 0; - /* vt[14]*/ virtual bool CrossCo(cCcD_AabAttr const&, f32*) const = 0; - /* vt[15]*/ virtual bool CrossCo(cCcD_CylAttr const&, f32*) const = 0; - /* vt[16]*/ virtual bool CrossCo(cCcD_SphAttr const&, f32*) const = 0; - /* 80084E38 vt[17]*/ virtual const cXyz& GetCoCP() const { return m_virtual_center; } - /* 80084E2C vt[18]*/ virtual cXyz& GetCoCP() { return m_virtual_center; } - /* vt[19]*/ virtual void CalcAabBox() = 0; - /* vt[20]*/ virtual bool GetNVec(cXyz const&, cXyz*) const = 0; - /* 80263A64 vt[21]*/ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const; + /* vt[4] */ virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const = 0; + /* vt[5] */ virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const = 0; + /* vt[6] */ virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const = 0; + /* vt[7] */ virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const = 0; + /* vt[8] */ virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const = 0; + /* vt[9] */ virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const = 0; + /* vt[10]*/ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const { return false; } + /* vt[11]*/ virtual bool CrossCo(cCcD_PntAttr const&, f32*) const = 0; + /* vt[12]*/ virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const = 0; + /* vt[13]*/ virtual bool CrossCo(cCcD_TriAttr const&, f32*) const = 0; + /* vt[14]*/ virtual bool CrossCo(cCcD_AabAttr const&, f32*) const = 0; + /* vt[15]*/ virtual bool CrossCo(cCcD_CylAttr const&, f32*) const = 0; + /* vt[16]*/ virtual bool CrossCo(cCcD_SphAttr const&, f32*) const = 0; + /* vt[17]*/ virtual const cXyz& GetCoCP() const { return m_virtual_center; } + /* vt[18]*/ virtual cXyz& GetCoCP() { return m_virtual_center; } + /* vt[19]*/ virtual void CalcAabBox() = 0; + /* vt[20]*/ virtual bool GetNVec(cXyz const&, cXyz*) const = 0; + /* vt[21]*/ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const; cM3dGAab& GetWorkAab() { return mAab; } cM3dGAab const& GetWorkAab() const { return mAab; } diff --git a/include/SSystem/SComponent/c_cc_s.h b/include/SSystem/SComponent/c_cc_s.h index b82cd29a33..334f7351d8 100644 --- a/include/SSystem/SComponent/c_cc_s.h +++ b/include/SSystem/SComponent/c_cc_s.h @@ -46,7 +46,7 @@ public: virtual void CalcTgPlusDmg(cCcD_Obj*, cCcD_Obj*, cCcD_Stts*, cCcD_Stts*); void SetAtTgCommonHitInf(cCcD_Obj*, cCcD_Obj*, cXyz*); void SetCoCommonHitInf(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32); - /* 80265750 vt[3]*/ virtual void SetPosCorrect(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32); + /* vt[3]*/ virtual void SetPosCorrect(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32); void CalcArea(); void Move(); void DrawClear(); diff --git a/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/mem_TRK.h b/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/mem_TRK.h index 740ce2cfdb..135e1275b1 100644 --- a/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/mem_TRK.h +++ b/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/mem_TRK.h @@ -3,4 +3,8 @@ #include "dolphin/types.h" +void* TRK_memset(void* dest, int val, size_t count); +void* TRK_memcpy(void* dest, const void* src, size_t count); +void TRK_fill_mem(void* dest, int val, size_t count); + #endif /* METROTRK_PORTABLE_MEM_TRK_H */ diff --git a/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/msgbuf.h b/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/msgbuf.h index d06794c1e7..ff14b43261 100644 --- a/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/msgbuf.h +++ b/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/msgbuf.h @@ -11,6 +11,25 @@ DSError TRKSetBufferPosition(TRKBuffer* msg, u32 pos); void* TRKGetBuffer(int); void TRKResetBuffer(TRKBuffer* msg, BOOL keepData); +DSError TRKAppendBuffer1_ui16(TRKBuffer* buffer, const u16 data); +DSError TRKAppendBuffer1_ui32(TRKBuffer* buffer, const u32 data); +DSError TRKAppendBuffer1_ui64(TRKBuffer* buffer, const u64 data); + +DSError TRKAppendBuffer_ui8(TRKBuffer* buffer, const u8* data, int count); +DSError TRKAppendBuffer_ui16(TRKBuffer* buffer, const u16* data, int count); +DSError TRKAppendBuffer_ui32(TRKBuffer* buffer, const u32* data, int count); +DSError TRKAppendBuffer_ui64(TRKBuffer* buffer, const u64* data, int count); + +DSError TRKReadBuffer1_ui8(TRKBuffer* buffer, u8* data); +DSError TRKReadBuffer1_ui16(TRKBuffer* buffer, u16* data); +DSError TRKReadBuffer1_ui32(TRKBuffer* buffer, u32* data); +DSError TRKReadBuffer1_ui64(TRKBuffer* buffer, u64* data); + +DSError TRKReadBuffer_ui8(TRKBuffer* buffer, u8* data, int count); +DSError TRKReadBuffer_ui16(TRKBuffer* buffer, u16* data, int count); +DSError TRKReadBuffer_ui32(TRKBuffer* buffer, u32* data, int count); +DSError TRKReadBuffer_ui64(TRKBuffer* buffer, u64* data, int count); + #ifdef __cplusplus } #endif diff --git a/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/mutex_TRK.h b/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/mutex_TRK.h index 9f112f2e64..d491ced086 100644 --- a/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/mutex_TRK.h +++ b/include/TRK_MINNOW_DOLPHIN/MetroTRK/Portable/mutex_TRK.h @@ -1,6 +1,7 @@ #ifndef METROTRK_PORTABLE_MUTEX_TRK_H #define METROTRK_PORTABLE_MUTEX_TRK_H +#include "revolution/types.h" u8 TRKReleaseMutex(); u8 TRKAcquireMutex(); diff --git a/include/d/actor/d_a_npc_cdn3.h b/include/d/actor/d_a_npc_cdn3.h index d20ddfdce5..890f362862 100644 --- a/include/d/actor/d_a_npc_cdn3.h +++ b/include/d/actor/d_a_npc_cdn3.h @@ -137,7 +137,7 @@ public: } void setSpeed(f32 param_0, f32 param_1, f32* param_2, int param_3) { - (void)param_3; + UNUSED(param_3); f32 target = field_0xb5c * (param_1 * field_0xb5c); f32 step = field_0xb5c * (param_0 * field_0xb5c); if (param_1 < target) { diff --git a/include/d/actor/d_a_npc_tk.h b/include/d/actor/d_a_npc_tk.h index 15489c9284..34833f7e0d 100644 --- a/include/d/actor/d_a_npc_tk.h +++ b/include/d/actor/d_a_npc_tk.h @@ -29,33 +29,26 @@ public: void setActionMode(int); f32 setAddCalcSpeedXZ(cXyz&, cXyz const&, f32, f32, f32); cXyz chaseTargetPos(cXyz, f32, f32, s16); - /* 80B01D84 */ fopAc_ac_c* getMasterPointer(); void setMasterShoulder(cXyz*); void setAwayAction(int); void setFlySE(); void executeFly(); void initPerchDemo(int); - /* 80B02B5C */ bool executePerchDemo(int); void executePerch(); void executeHandOn(); - /* 80B039A8 */ bool checkWaterSurface(f32); void executeAttack(); void executeAway(); void setCarryActorMtx(); - /* 80B04F64 */ f32 getTakePosY(); - /* 80B04FA8 */ f32 getTakeOffPosY(); void executeBack(); - /* 80B05BD0 */ cXyz getHanjoHandPos(); void executeStayHanjo(); void executeAttackLink(); void executeBackHanjo(); - /* 80B07114 */ bool checkAttackDemo(); void executeAttackDemo(); void executeBackHanjoDemo(); @@ -74,7 +67,6 @@ public: void cc_set(); int execute(); int _delete(); - /* 80B0B9AC */ int ctrlJoint(J3DJoint*, J3DModel*); static int JointCallBack(J3DJoint*, int); int CreateHeap(); diff --git a/include/d/actor/d_a_obj_lv6SwGate.h b/include/d/actor/d_a_obj_lv6SwGate.h index 9809cbcd63..964c073c1d 100644 --- a/include/d/actor/d_a_obj_lv6SwGate.h +++ b/include/d/actor/d_a_obj_lv6SwGate.h @@ -57,7 +57,6 @@ STATIC_ASSERT(sizeof(daLv6SwGate_c) == 0x14f8); class daLv6SwGate_HIO_c : public fOpAcm_HIO_entry_c { public: - /* 80C73F0C */ daLv6SwGate_HIO_c(); void genMessage(JORMContext*); diff --git a/include/d/actor/d_a_obj_stone.h b/include/d/actor/d_a_obj_stone.h index bad3bb5d61..b5f4da8c39 100644 --- a/include/d/actor/d_a_obj_stone.h +++ b/include/d/actor/d_a_obj_stone.h @@ -81,7 +81,7 @@ private: /* 0x094E */ bool mIsInWater; /* 0x094F */ u8 field_0x094f; /* 0x0950 */ u8 field_0x0950; - /* 0x0951 */ u8 field_0x0951; + /* 0x0951 */ bool field_0x0951; /* 0x0954 */ u32 field_0x0954; /* 0x0954 */ u32 field_0x0958; /* 0x0954 */ u32 field_0x095c; diff --git a/include/d/d_bg_s_acch.h b/include/d/d_bg_s_acch.h index f5d7579c97..712aa3c47a 100644 --- a/include/d/d_bg_s_acch.h +++ b/include/d/d_bg_s_acch.h @@ -195,7 +195,7 @@ public: f32 GetCx() const { return pm_pos->x; } f32 GetCz() const { return pm_pos->z; } -public: +private: /* 0x02C */ u32 m_flags; /* 0x030 */ cXyz* pm_pos; /* 0x034 */ cXyz* pm_old_pos; @@ -231,9 +231,11 @@ public: /* 0x0E4 */ cXyz unk_0xe4; #endif /* 0x0D8 */ f32 field_0xd8; +public: /* 0x0DC */ dBgS_GndChk m_gnd; /* 0x130 */ dBgS_RoofChk m_roof; /* 0x180 */ dBgS_WtrChk m_wtr; +private: /* 0x1D4 */ u8 m_wtr_mode; }; // Size: 0x1D8 diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 388e2d6a4d..df64a28249 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -840,7 +840,7 @@ public: ~dComIfG_inf_c() {} void ct(); void createBaseCsr(); - dComIfG_play_c& getPlay() { return play; } + dComIfG_play_c& getPlay() { return play; } // fake inline #if PLATFORM_WII || VERSION == VERSION_SHIELD_DEBUG class baseCsr_c : public mDoGph_gInf_c::csr_c { diff --git a/include/d/d_debug_camera.h b/include/d/d_debug_camera.h index 51d11fd0e5..854cf0ecfa 100644 --- a/include/d/d_debug_camera.h +++ b/include/d/d_debug_camera.h @@ -24,7 +24,7 @@ public: /* 0x1C */ f32 mBank; struct { /* 0x20 */ fpc_ProcID id; - /* 0x24 */ char name[8]; + /* 0x24 */ char name[dStage_NAME_LENGTH]; } mActorInfo; /* 0x2C */ int mAction; /* 0x30 */ int mTimer; diff --git a/include/d/d_menu_fmap.h b/include/d/d_menu_fmap.h index bd95772c59..2b450aa577 100644 --- a/include/d/d_menu_fmap.h +++ b/include/d/d_menu_fmap.h @@ -1,6 +1,7 @@ #ifndef D_MENU_D_MENU_FMAP_H #define D_MENU_D_MENU_FMAP_H +#include "JSystem/JHostIO/JORReflexible.h" #include "SSystem/SComponent/c_xyz.h" #include "d/d_menu_map_common.h" #include "d/d_msg_flow.h" diff --git a/include/d/d_menu_fmap_map.h b/include/d/d_menu_fmap_map.h index dfb1197848..2879d03d02 100644 --- a/include/d/d_menu_fmap_map.h +++ b/include/d/d_menu_fmap_map.h @@ -141,13 +141,13 @@ public: virtual void genMessage(JORMContext*); virtual u32 addString(char* param_1, u32 param_2, u32 param_3) { return field_0xc.addString(param_1, param_2, param_3); } virtual u32 addData(char* param_1, u32 param_2, u32 param_3) { - (void)param_2; - (void)param_3; + UNUSED(param_2); + UNUSED(param_3); memcpy(param_1, dMfm_HIO_prm_res_dst_s::m_res, 366); return 366; } virtual void copyReadBufToData(const char* param_1, s32 param_2) { - (void)param_2; + UNUSED(param_2); field_0xc.copyBufToHio(param_1); } virtual u32 addStringBinary(char* param_1, u32 param_2, u32 param_3) { return field_0xc.addStringBinary(param_1, param_2, param_3); } diff --git a/include/d/d_meter2_info.h b/include/d/d_meter2_info.h index 45f165341b..4738c7faf6 100644 --- a/include/d/d_meter2_info.h +++ b/include/d/d_meter2_info.h @@ -124,10 +124,7 @@ public: void resetPauseStatus() { mPauseStatus = 0; } u8 getPauseStatus() { return mPauseStatus; } bool isGameStatus(int i_status) { return (mGameStatus & (u16)i_status) != 0 ? true : false; } - bool isTouchKeyCheck(int i_status) { return mTouchKeyCheck & (1 << i_status); } - - // fake function, should be isTouchKeyCheck - bool isTouchKeyCheck_alt(int i_status) { return (mTouchKeyCheck >> i_status) & 1; } + bool isTouchKeyCheck(int i_status) { return mTouchKeyCheck & (u16)(1 << i_status) ? true : false; } void setMapKeyDirection(u16 i_direction) { mMapKeyDirection = i_direction; } bool isSub2DStatus(int i_flag) { return (mSub2DStatus & (u16)(1 << i_flag)) != 0 ? true : false; } @@ -486,11 +483,6 @@ inline bool dMeter2Info_isTouchKeyCheck(int i_status) { return g_meter2_info.isTouchKeyCheck(i_status); } -// fake function, should be dMeter2Info_isTouchKeyCheck -inline bool dMeter2Info_isTouchKeyCheck_alt(int i_status) { - return g_meter2_info.isTouchKeyCheck_alt(i_status); -} - inline void dMeter2Info_setMapKeyDirection(u16 i_direction) { g_meter2_info.setMapKeyDirection(i_direction); } diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 848e7bd21e..4afb1e9afb 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -586,7 +586,7 @@ public: /* vt[38] */ virtual void setVrboxcolNumInfo(int i_VrboxcolNumInfo) { mVrboxcolNumInfo = i_VrboxcolNumInfo; } /* vt[39] */ virtual int getVrboxcolNumInfo(void) const { return mVrboxcolNumInfo; } /* vt[42] */ virtual void setLightVecInfo(stage_pure_lightvec_info_class* i_LightVecInfo) { - (void)i_LightVecInfo; + UNUSED(i_LightVecInfo); dStage_SetErrorStage(); OSReport("stage non LightVec data !!\n"); JUT_ASSERT(3003, FALSE); @@ -597,7 +597,7 @@ public: return NULL; } /* vt[44] */ virtual void setLightVecInfoNum(int i_LightVecInfoNum) { - (void)i_LightVecInfoNum; + UNUSED(i_LightVecInfoNum); dStage_SetErrorStage(); OSReport("stage non LightVecNum data !!\n"); JUT_ASSERT(3014, FALSE); @@ -628,7 +628,7 @@ public: /* vt[62] */ virtual void setMapEventInfo(dStage_MapEventInfo_c* i_MapEventInfo) { mMapEventInfo = i_MapEventInfo; } /* vt[63] */ virtual dStage_MapEventInfo_c* getMapEventInfo(void) const { return mMapEventInfo; } /* vt[64] */ virtual void setFileList2Info(dStage_FileList2_dt_c* list) { - (void)list; + UNUSED(list); dStage_SetErrorStage(); OSReport("stage non filelist2 data!\n"); JUT_ASSERT(3123, FALSE); @@ -639,7 +639,7 @@ public: return NULL; } /* vt[66] */ virtual void setFileListInfo(dStage_FileList_dt_c* list) { - (void)list; + UNUSED(list); dStage_SetErrorStage(); OSReport("stage non filelist data!\n"); JUT_ASSERT(3138, FALSE); @@ -661,7 +661,7 @@ public: /* vt[77] */ virtual void resetOldMulti(void); /* vt[78] */ virtual dStage_Multi_c* getOldMulti(void) const { return mOldMulti; } /* vt[79] */ virtual void setLbnk(dStage_Lbnk_c* lbnk) { - (void)lbnk; + UNUSED(lbnk); dStage_SetErrorStage(); OSReport("stage non Lbnk data!\n"); JUT_ASSERT(3231, FALSE); @@ -746,7 +746,7 @@ public: virtual void setPlayerNum(u16 i_PlayerNum) { mPlayerNum = i_PlayerNum; } virtual u16 getPlayerNum(void) const { return mPlayerNum; } virtual void setRoom(roomRead_class* i_Room) { - (void)i_Room; + UNUSED(i_Room); dStage_SetErrorRoom(); OSReport("Room non room data !!\n"); JUT_ASSERT(2095, FALSE); @@ -762,7 +762,7 @@ public: virtual void setMapInfoBase(stage_map_info_dummy_class* i_MapInfoBase) { mMapInfoBase = i_MapInfoBase; } virtual stage_map_info_dummy_class* getMapInfoBase(void) const { return mMapInfoBase; } virtual void setPaletteInfo(stage_palette_info_class* i_PaletteInfo) { - (void)i_PaletteInfo; + UNUSED(i_PaletteInfo); dStage_SetErrorRoom(); OSReport("Room non palet data !!\n"); JUT_ASSERT(2126, FALSE); @@ -773,7 +773,7 @@ public: return NULL; } virtual void setPselectInfo(stage_pselect_info_class* i_PselectInfo) { - (void)i_PselectInfo; + UNUSED(i_PselectInfo); dStage_SetErrorRoom(); OSReport("Room non pselect data !!\n"); JUT_ASSERT(2137, FALSE); @@ -784,7 +784,7 @@ public: return NULL; } virtual void setEnvrInfo(stage_envr_info_class* i_EnvrInfo) { - (void)i_EnvrInfo; + UNUSED(i_EnvrInfo); dStage_SetErrorRoom(); OSReport("Room non envr data !!\n"); JUT_ASSERT(2148, FALSE); @@ -799,7 +799,7 @@ public: virtual void setVrboxcolInfo(stage_vrboxcol_info_class* i_VrboxcolInfo) { mVrboxcolInfo = i_VrboxcolInfo; } virtual stage_vrboxcol_info_class* getVrboxcolInfo(void) const { return mVrboxcolInfo; } virtual void setPlightInfo(stage_plight_info_class* i_PlightInfo) { - (void)i_PlightInfo; + UNUSED(i_PlightInfo); dStage_SetErrorRoom(); OSReport("Room non plight data !!\n"); JUT_ASSERT(2174, FALSE); @@ -810,7 +810,7 @@ public: return NULL; } virtual void setPaletteNumInfo(int i_PaletteNumInfo) { - (void)i_PaletteNumInfo; + UNUSED(i_PaletteNumInfo); dStage_SetErrorRoom(); OSReport("Room non palette num data !!\n"); JUT_ASSERT(2186, FALSE); @@ -821,7 +821,7 @@ public: return NULL; } virtual void setPselectNumInfo(int i_PselectNumInfo) { - (void)i_PselectNumInfo; + UNUSED(i_PselectNumInfo); dStage_SetErrorRoom(); OSReport("Room non pselect num data !!\n"); JUT_ASSERT(2197, FALSE); @@ -832,7 +832,7 @@ public: return NULL; } virtual void setEnvrNumInfo(int i_EnvrNumInfo) { - (void)i_EnvrNumInfo; + UNUSED(i_EnvrNumInfo); dStage_SetErrorRoom(); OSReport("Room non envr num data !!\n"); JUT_ASSERT(2208, FALSE); @@ -847,7 +847,7 @@ public: virtual void setVrboxcolNumInfo(int i_VrboxcolNumInfo) { mVrboxcolNumInfo = i_VrboxcolNumInfo; } virtual int getVrboxcolNumInfo(void) const { return mVrboxcolNumInfo; } virtual void setPlightNumInfo(int i_PlightNumInfo) { - (void)i_PlightNumInfo; + UNUSED(i_PlightNumInfo); dStage_SetErrorRoom(); OSReport("Room non plight num data !!\n"); JUT_ASSERT(2223, FALSE); @@ -862,7 +862,7 @@ public: virtual void setLightVecInfoNum(int i_LightVecInfoNum) { mLightVecInfoNum = i_LightVecInfoNum; } virtual int getLightVecInfoNum(void) const { return mLightVecInfoNum; } virtual void setStagInfo(stage_stag_info_class* i_StagInfo) { - (void)i_StagInfo; + UNUSED(i_StagInfo); dStage_SetErrorRoom(); OSReport("Room non stag data !!\n"); JUT_ASSERT(2256, FALSE); @@ -875,7 +875,7 @@ public: virtual void setSclsInfo(stage_scls_info_dummy_class* i_SclsInfo) { mSclsInfo = i_SclsInfo; } virtual stage_scls_info_dummy_class* getSclsInfo(void) const { return mSclsInfo; } virtual void setPntInfo(dStage_dPnt_c* i_PntInfo) { - (void)i_PntInfo; + UNUSED(i_PntInfo); dStage_SetErrorRoom(); OSReport("Room non Pnt data !\n"); JUT_ASSERT(2281, FALSE); @@ -886,7 +886,7 @@ public: return NULL; } virtual void setPathInfo(dStage_dPath_c* i_PathInfo) { - (void)i_PathInfo; + UNUSED(i_PathInfo); dStage_SetErrorRoom(); OSReport("Room non Path data !\n"); JUT_ASSERT(2292, FALSE); @@ -913,7 +913,7 @@ public: virtual void setFloorInfo(dStage_FloorInfo_c* i_FloorInfo) { mFloorInfo = i_FloorInfo; } virtual dStage_FloorInfo_c* getFloorInfo(void) const { return mFloorInfo; } virtual void setMemoryConfig(dStage_MemoryConfig_c* i_MemoryConfig) { - (void)i_MemoryConfig; + UNUSED(i_MemoryConfig); OSReport("Room non memory config data!\n"); JUT_ASSERT(2414, FALSE); } @@ -923,7 +923,7 @@ public: return NULL; } virtual void setMemoryMap(dStage_MemoryMap_c* i_MemoryMap) { - (void)i_MemoryMap; + UNUSED(i_MemoryMap); OSReport("Room non memory map data!\n"); JUT_ASSERT(2433, FALSE); } @@ -933,7 +933,7 @@ public: return NULL; } virtual void setMulti(dStage_Multi_c* i_Multi) { - (void)i_Multi; + UNUSED(i_Multi); OSReport("Room non multi data!\n"); JUT_ASSERT(2452, FALSE); } @@ -960,7 +960,7 @@ public: virtual void setTresure(stage_tresure_class* i_Tresure) { mTresure = i_Tresure; } virtual stage_tresure_class* getTresure(void) const { return mTresure; } virtual void setDMap(dStage_DMap_c* i_DMap) { - (void)i_DMap; + UNUSED(i_DMap); OS_REPORT("Room non DMap data\n"); JUT_ASSERT(2508, FALSE); } @@ -974,7 +974,7 @@ public: virtual void setDoor(stage_tgsc_class* i_Door) { mDoor = i_Door; } virtual stage_tgsc_class* getDoor(void) const { return mDoor; } virtual void setMapPath(void* i_MapPath) { - (void)i_MapPath; + UNUSED(i_MapPath); OSReport("stage non 2d map path data !!\n"); JUT_ASSERT(2557, FALSE); } @@ -984,7 +984,7 @@ public: return NULL; } virtual void setElst(dStage_Elst_c* i_Elst) { - (void)i_Elst; + UNUSED(i_Elst); dStage_SetErrorRoom(); OSReport("Room non envLayserSet data\n"); JUT_ASSERT(2572, FALSE); @@ -1323,6 +1323,8 @@ void dStage_dt_c_roomLoader(void* i_data, dStage_dt_c* stageDt, int param_2); dStage_KeepDoorInfo* dStage_GetKeepDoorInfo(); dStage_KeepDoorInfo* dStage_GetRoomKeepDoorInfo(); void dStage_dt_c_fieldMapLoader(void* i_data, dStage_dt_c* i_stage); + +#define dStage_NAME_LENGTH 8 const char* dStage_getName(s16 procName, s8 argument); #if VERSION == VERSION_WII_USA_R0 diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index b5a11a6beb..dbf01d374d 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -842,7 +842,7 @@ void fopAcM_showAssert_f(const fopAc_ac_c*, const char*, int, const char*, ...); #define fopAcM_setWarningMessage(...) #endif -void fopAcM_getNameString(const fopAc_ac_c*, char*); +BOOL fopAcM_getNameString(const fopAc_ac_c*, char*); class fopAcM_lc_c { public: diff --git a/include/f_op/f_op_scene.h b/include/f_op/f_op_scene.h index 2da8e5e9ba..a42eee7211 100644 --- a/include/f_op/f_op_scene.h +++ b/include/f_op/f_op_scene.h @@ -2,20 +2,25 @@ #define F_F_OP_SCENE_H_ #include "f_op/f_op_scene_tag.h" +#include "f_pc/f_pc_leaf.h" struct request_of_phase_process_class; class mDoDvdThd_command_c; +struct scene_method_class { + /* 0x00 */ leafdraw_method_class base; +}; + typedef struct scene_process_profile_definition { /* 0x00 */ node_process_profile_definition nase; - /* 0x20 */ process_method_class* submethod; // Subclass methods + /* 0x20 */ scene_method_class* submethod; // Subclass methods /* 0x24 */ u32 unk_0x24; // padding? } scene_process_profile_definition; class scene_class { public: /* 0x000 */ process_node_class base; - /* 0x1AC */ process_method_class* submethod; + /* 0x1AC */ scene_method_class* submethod; /* 0x1B0 */ scene_tag_class scene_tag; }; diff --git a/include/global.h b/include/global.h index 4f2b7a60ad..bd726e2e07 100644 --- a/include/global.h +++ b/include/global.h @@ -44,6 +44,10 @@ #define ROUND(n, a) (((u32)(n) + (a)-1) & ~((a)-1)) #define TRUNC(n, a) (((u32)(n)) & ~((a)-1)) +// Silence unused parameter warnings. +// Necessary for debug matches. +#define UNUSED(x) ((void)(x)) + #ifndef decltype #define decltype __decltype__ #endif @@ -68,6 +72,7 @@ // Silence clangd errors about MWCC PPC intrinsics by declaring them here. extern int __cntlzw(unsigned int); extern int __rlwimi(int, int, int, int, int); +extern void __dcbf(void*, int); extern void __dcbz(void*, int); extern void __sync(); extern int __abs(int); diff --git a/include/m_Do/m_Do_audio.h b/include/m_Do/m_Do_audio.h index 5cd89860fb..e558bd7b98 100644 --- a/include/m_Do/m_Do_audio.h +++ b/include/m_Do/m_Do_audio.h @@ -314,7 +314,7 @@ inline void mDoAud_loadStaticWaves() { inline int mDoAud_monsSeStart(u32 i_soundId, const Vec* i_pos, u32 i_actorId, u32 param_3, s8 i_reverb) { - (void)i_actorId; + UNUSED(i_actorId); return Z2GetAudioMgr()->seStart(i_soundId, i_pos, param_3, i_reverb, 1.0f, 1.0f, -1.0f, -1.0f, 0); } -- cgit v1.2.3