diff --git a/include/d/actor/d_a_b_ds.h b/include/d/actor/d_a_b_ds.h index d7dd03a90b..00bd3cb24a 100644 --- a/include/d/actor/d_a_b_ds.h +++ b/include/d/actor/d_a_b_ds.h @@ -332,8 +332,6 @@ private: /* 0x2EDC */ dMsgFlow_c mMsgFlow; }; -cXyz daB_DS_c::getHandPosR() { return mHandPos[1]; } -cXyz daB_DS_c::getHandPosL() { return mHandPos[0]; } STATIC_ASSERT(sizeof(daB_DS_c) == 0x2F28); diff --git a/include/dolphin/os.h b/include/dolphin/os.h index 07eb305adb..1c083eb815 100644 --- a/include/dolphin/os.h +++ b/include/dolphin/os.h @@ -1,17 +1,15 @@ #ifndef _DOLPHIN_OS_H_ #define _DOLPHIN_OS_H_ -#ifdef __MWERKS__ #include -#else -#include -#endif #ifdef __REVOLUTION_SDK__ #include #else + #include #include + void OSReportInit(void); void OSSwitchFiberEx(u32, u32, u32, u32, u32, u32); void OSVAttention(const char* fmt, va_list args); @@ -45,7 +43,9 @@ typedef u32 OSTick; #include #include #include +#ifdef __MWERKS__ #include +#endif #include #include #include @@ -54,6 +54,18 @@ typedef u32 OSTick; // private macro, maybe shouldn't be defined here? #define OFFSET(addr, align) (((u32)(addr) & ((align)-1))) +#ifndef __MWERKS__ +typedef struct { + BOOL valid; + u32 restartCode; + u32 bootDol; + void* regionStart; + void* regionEnd; + int argsUseDefault; + void* argsAddr; +} OSExecParams; +#endif + #define DOLPHIN_ALIGNMENT 32 // Upper words of the masks, since UIMM is only 16 bits @@ -80,9 +92,11 @@ OSThread* __gUnkThread1 AT_ADDRESS(OS_BASE_CACHED | 0x00D8); int __gUnknown800030C0[2] AT_ADDRESS(OS_BASE_CACHED | 0x30C0); u8 __gUnknown800030E3 AT_ADDRESS(OS_BASE_CACHED | 0x30E3); #else -#define __OSBusClock (*(u32 *)(OS_BASE_CACHED | 0x00F8)) -#define __OSCoreClock (*(u32 *)(OS_BASE_CACHED | 0x00FC)) -#endif + +#define __OSBusClock 486000000 +#define __OSCoreClock (486000000 / 4) + +#endif // __MWERKS__ #define OS_BUS_CLOCK __OSBusClock #define OS_CORE_CLOCK __OSCoreClock @@ -210,7 +224,6 @@ DECL_WEAK void OSReportDisable(void); DECL_WEAK void OSReportEnable(void); DECL_WEAK void OSReportForceEnableOff(void); DECL_WEAK void OSReportForceEnableOn(void); -DECL_WEAK void OSVReport(const char* format, va_list list); #if DEBUG #define OS_REPORT(...) OSReport(__VA_ARGS__) @@ -233,6 +246,30 @@ extern u8 __OSReport_enable; #define OSRoundUp32B(x) (((u32)(x) + 32 - 1) & ~(32 - 1)) #define OSRoundDown32B(x) (((u32)(x)) & ~(32 - 1)) + +#ifdef TARGET_PC + +static inline void* OSPhysicalToCached(u32 paddr) { + return reinterpret_cast(static_cast(paddr)); +} +static inline void* OSPhysicalToUncached(u32 paddr) { + return reinterpret_cast(static_cast(paddr)); +} +static inline u32 OSCachedToPhysical(void* caddr) { + return static_cast(reinterpret_cast(caddr)); +} +static inline u32 OSUncachedToPhysical(void* ucaddr) { + return static_cast(reinterpret_cast(ucaddr)); +} +static inline void* OSCachedToUncached(void* caddr) { + return caddr; +} +static inline void* OSUncachedToCached(void* ucaddr) { + return ucaddr; +} + +#else // non-TARGET_PC + void* OSPhysicalToCached(u32 paddr); void* OSPhysicalToUncached(u32 paddr); u32 OSCachedToPhysical(void* caddr); @@ -240,7 +277,9 @@ u32 OSUncachedToPhysical(void* ucaddr); void* OSCachedToUncached(void* caddr); void* OSUncachedToCached(void* ucaddr); -#if !DEBUG +#endif // TARGET_PC + +#if !DEBUG && !defined(TARGET_PC) #define OSPhysicalToCached(paddr) ((void*) ((u32)(OS_BASE_CACHED + (u32)(paddr)))) #define OSPhysicalToUncached(paddr) ((void*) ((u32)(OS_BASE_UNCACHED + (u32)(paddr)))) #define OSCachedToPhysical(caddr) ((u32) ((u32)(caddr) - OS_BASE_CACHED)) @@ -257,6 +296,10 @@ extern OSTime __OSStartTime; extern int __OSInIPL; // helper for assert line numbers in different revisions +#ifndef SDK_REVISION +#define SDK_REVISION 0 +#endif + #if SDK_REVISION < 1 #define LINE(l0, l1, l2) (l0) #elif SDK_REVISION < 2 @@ -275,7 +318,6 @@ extern int __OSInIPL; // This is dumb but we dont have a Metrowerks way to do variadic macros in the macro to make this done in a not scrubby way. #define ASSERTMSG1LINE(line, cond, msg, arg1) \ ((cond) || (OSPanic(__FILE__, line, msg, arg1), 0)) - #define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) \ ((cond) || (OSPanic(__FILE__, line, msg, arg1, arg2), 0)) @@ -289,7 +331,6 @@ extern int __OSInIPL; #define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) (void)0 #define ASSERTMSGLINEV(line, cond, ...) (void)0 #endif - #define ASSERT(cond) ASSERTLINE(__LINE__, cond) inline s16 __OSf32tos16(__REGISTER f32 inF) { @@ -357,5 +398,5 @@ static inline void OSInitFastCast(void) { } #endif -#endif -#endif +#endif // __REVOLUTION_SDK__ +#endif // _DOLPHIN_OS_H_ diff --git a/src/DynamicLink.cpp b/src/DynamicLink.cpp index 52cf257970..c05fa23458 100644 --- a/src/DynamicLink.cpp +++ b/src/DynamicLink.cpp @@ -453,14 +453,6 @@ const char* DynamicModuleControl::getModuleTypeString() const { return strings[mResourceType & 3]; } -extern "C" void ModuleProlog() { - /* empty function */ -} - -extern "C" void ModuleEpilog() { - /* empty function */ -} - extern "C" void ModuleUnresolved() { // "\nError: Unlinked function was called.\n" OSReport_Error("\nError: リンクされていない関数が呼び出されました.\n"); diff --git a/src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp b/src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp index a1e9ba0243..8b881d27d0 100644 --- a/src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp @@ -15,11 +15,11 @@ Mtx* J3DMtxBuffer::sNoUseDrawMtxPtr = &J3DMtxBuffer::sNoUseDrawMtx; Mtx33* J3DMtxBuffer::sNoUseNrmMtxPtr = &J3DMtxBuffer::sNoUseNrmMtx; // force .sdata2 order -f32 dummy1() { +static f32 dummy1() { return 1.0f; } -f32 dummy0() { +static f32 dummy0() { return 0.0f; } diff --git a/src/d/actor/d_a_b_ds.cpp b/src/d/actor/d_a_b_ds.cpp index 88b5c8042a..5d5c05d3a2 100644 --- a/src/d/actor/d_a_b_ds.cpp +++ b/src/d/actor/d_a_b_ds.cpp @@ -5426,6 +5426,10 @@ static int useHeapInit(fopAc_ac_c* i_this) { return static_cast(i_this)->CreateHeap(); } + +cXyz daB_DS_c::getHandPosR() { return mHandPos[1]; } +cXyz daB_DS_c::getHandPosL() { return mHandPos[0]; } + cPhs_Step daB_DS_c::create() { fopAcM_ct(this, daB_DS_c); diff --git a/src/d/actor/d_a_e_dd.cpp b/src/d/actor/d_a_e_dd.cpp index e0de6cb03f..1094366738 100644 --- a/src/d/actor/d_a_e_dd.cpp +++ b/src/d/actor/d_a_e_dd.cpp @@ -336,7 +336,7 @@ static BOOL way_bg_check(e_dd_class* i_this, f32 param_2) { return FALSE; } -u8 hio_set; +static u8 hio_set; static daE_DD_HIO_c l_HIO; diff --git a/src/d/actor/d_a_e_dn.cpp b/src/d/actor/d_a_e_dn.cpp index 794458bbe6..649dfe2895 100644 --- a/src/d/actor/d_a_e_dn.cpp +++ b/src/d/actor/d_a_e_dn.cpp @@ -354,13 +354,13 @@ static BOOL other_bg_check2(e_dn_class* i_this, cXyz* i_pos) { return FALSE; } -u8 hio_set; +static u8 hio_set; -daE_DN_HIO_c l_HIO; +static daE_DN_HIO_c l_HIO; fopAc_ac_c* target_info[10]; -int target_info_count; +static int target_info_count; static void* s_b_sub(void* i_actor, void* i_data) { if (fopAcM_IsActor(i_actor) && dBomb_c::checkBombActor((fopAc_ac_c*)i_actor) && !((dBomb_c*)i_actor)->checkStateExplode() && target_info_count < 10) { @@ -2978,7 +2978,7 @@ static void anm_se_set(e_dn_class* i_this) { } } -int c_start; +static int c_start; static int daE_DN_Execute(e_dn_class* i_this) { if (i_this->status != 0) { @@ -3298,9 +3298,9 @@ static int daE_DN_Delete(e_dn_class* i_this) { return 1; } -Vec jv_offset = { 0.0f, 0.0f, 0.0f }; +static Vec jv_offset = { 0.0f, 0.0f, 0.0f }; -dJntColData_c jc_data[12] = { +static dJntColData_c jc_data[12] = { {0, 1, 2, 40.0f, &jv_offset}, {0, 1, 3, 30.0f, &jv_offset}, {0, 1, 22, 40.0f, &jv_offset}, {0, 1, 11, 15.0f, &jv_offset}, {0, 1, 12, 10.0f, &jv_offset}, {0, 1, 17, 15.0f, &jv_offset}, diff --git a/src/d/actor/d_a_e_fb.cpp b/src/d/actor/d_a_e_fb.cpp index 1fbbbc2410..877e43d537 100644 --- a/src/d/actor/d_a_e_fb.cpp +++ b/src/d/actor/d_a_e_fb.cpp @@ -127,7 +127,7 @@ static f32 dummy_117095() { } #endif -bool hio_set; +static bool hio_set; static daE_FB_HIO_c l_HIO; diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index 42ad76cfd7..0c3c101416 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -289,13 +289,13 @@ static BOOL other_bg_check2(e_mf_class* i_this, cXyz* param_2) { return FALSE; } -u8 hio_set; +static u8 hio_set; -daE_MF_HIO_c l_HIO; +static daE_MF_HIO_c l_HIO; -fopAc_ac_c* target_info[10]; +static fopAc_ac_c* target_info[10]; -int target_info_count; +static int target_info_count; static void* s_b_sub(void* i_actor, void* i_data) { if (fopAcM_IsActor(i_actor) && dBomb_c::checkBombActor((fopAc_ac_c*)i_actor) && !((dBomb_c*)i_actor)->checkStateExplode() && target_info_count < 10) { @@ -2773,7 +2773,7 @@ static void anm_se_set(e_mf_class* i_this) { } } -int c_start; +static int c_start; static int daE_MF_Execute(e_mf_class* i_this) { fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; @@ -3085,9 +3085,9 @@ static int daE_MF_Delete(e_mf_class* i_this) { return 1; } -Vec jv_offset = { 0.0f, 0.0f, 0.0f }; +static Vec jv_offset = { 0.0f, 0.0f, 0.0f }; -dJntColData_c jc_data[12] = { +static dJntColData_c jc_data[12] = { {0, 1, 2, 40.0f, &jv_offset}, {0, 1, 3, 30.0f, &jv_offset}, {0, 1, 22, 40.0f, &jv_offset}, {0, 1, 11, 15.0f, &jv_offset}, {0, 1, 12, 10.0f, &jv_offset}, {0, 1, 17, 15.0f, &jv_offset}, diff --git a/src/d/actor/d_a_e_mk.cpp b/src/d/actor/d_a_e_mk.cpp index fef3a86675..c5b4b7a34c 100644 --- a/src/d/actor/d_a_e_mk.cpp +++ b/src/d/actor/d_a_e_mk.cpp @@ -137,7 +137,7 @@ static cXyz STAGE_CENTER_POS; static s16 STAGE_ANGLE_Y; -u8 hio_set; +static u8 hio_set; static daE_MK_HIO_c l_HIO; diff --git a/src/d/actor/d_a_e_nz.cpp b/src/d/actor/d_a_e_nz.cpp index 738d01b3bf..59f4258f7e 100644 --- a/src/d/actor/d_a_e_nz.cpp +++ b/src/d/actor/d_a_e_nz.cpp @@ -129,7 +129,7 @@ static int daE_NZ_Draw(e_nz_class* i_this) { return 1; } -bool hio_set; +static bool hio_set; static daE_NZ_HIO_c l_HIO; diff --git a/src/d/actor/d_a_e_vt.cpp b/src/d/actor/d_a_e_vt.cpp index a9d716acd0..a0fc8b926c 100644 --- a/src/d/actor/d_a_e_vt.cpp +++ b/src/d/actor/d_a_e_vt.cpp @@ -873,7 +873,7 @@ void daE_VA_c::setFireEffect(int param_0) { dComIfGp_particle_set(field_0x10f80[idx + 2], 0x3AE, &field_0x1140[param_0], NULL, &scale); } -f32 dummy() { +static f32 dummy() { return 3.2f; } diff --git a/src/d/actor/d_a_e_yr.cpp b/src/d/actor/d_a_e_yr.cpp index f329c48a9a..a5dfd55d9d 100644 --- a/src/d/actor/d_a_e_yr.cpp +++ b/src/d/actor/d_a_e_yr.cpp @@ -1716,7 +1716,7 @@ static void e_yr_su_wait_move(e_yr_class* i_this) { } } -f32 dummy() { +static f32 dummy() { return -50.0f; } diff --git a/src/d/actor/d_a_npc_ash.cpp b/src/d/actor/d_a_npc_ash.cpp index 5f285ace08..d4cd04573a 100644 --- a/src/d/actor/d_a_npc_ash.cpp +++ b/src/d/actor/d_a_npc_ash.cpp @@ -57,7 +57,7 @@ void daNpcAsh_HIO_c::genMessage(JORMContext* ctext) { } #endif -NPC_ASH_HIO_CLASS l_HIO; +static NPC_ASH_HIO_CLASS l_HIO; void daNpcAsh_c::setLookMode(int i_lookMode, fopAc_ac_c* i_talkPartner) { if (i_lookMode != mLookMode || i_talkPartner != mTalkPartner) { diff --git a/src/d/actor/d_a_npc_ashB.cpp b/src/d/actor/d_a_npc_ashB.cpp index 237c93aa58..ec241ac46a 100644 --- a/src/d/actor/d_a_npc_ashB.cpp +++ b/src/d/actor/d_a_npc_ashB.cpp @@ -46,7 +46,7 @@ const daNpcAshB_HIOParam daNpcAshB_Param_c::m = { 400.0f, // field_0x6c }; -NPC_ASHB_HIO_CLASS l_HIO; +static NPC_ASHB_HIO_CLASS l_HIO; static daNpc_GetParam2 l_bckGetParamList[21] = { {-1, 2, 0}, {13, 0, 0}, {14, 0, 0}, {11, 0, 0}, {10, 0, 0}, {9, 0, 0}, {12, 0, 0}, diff --git a/src/d/actor/d_a_npc_bou.cpp b/src/d/actor/d_a_npc_bou.cpp index fe6f44846e..23640f7a09 100644 --- a/src/d/actor/d_a_npc_bou.cpp +++ b/src/d/actor/d_a_npc_bou.cpp @@ -16,7 +16,7 @@ static int l_bmdData[1][2] = { {11, 1}, }; -daNpcT_evtData_c l_evtList[11] = { +static daNpcT_evtData_c l_evtList[11] = { {"", 0}, {"NO_RESPONSE", 0}, {"WILDGOAT", 2}, diff --git a/src/d/actor/d_a_npc_clerka.cpp b/src/d/actor/d_a_npc_clerka.cpp index 21b089eb67..e3175bb4cd 100644 --- a/src/d/actor/d_a_npc_clerka.cpp +++ b/src/d/actor/d_a_npc_clerka.cpp @@ -780,7 +780,7 @@ static int daNpc_clerkA_IsDelete(void* i_this) { return 1; } -NPC_CLERKA_HIO_CLASS l_HIO; +static NPC_CLERKA_HIO_CLASS l_HIO; static actor_method_class daNpc_clerkA_MethodTable = { (process_method_func)daNpc_clerkA_Create, (process_method_func)daNpc_clerkA_Delete, diff --git a/src/d/actor/d_a_npc_clerkb.cpp b/src/d/actor/d_a_npc_clerkb.cpp index c6400f90a0..41ec390d4a 100644 --- a/src/d/actor/d_a_npc_clerkb.cpp +++ b/src/d/actor/d_a_npc_clerkb.cpp @@ -932,7 +932,7 @@ static int daNpc_clerkB_IsDelete(void* i_this) { return 1; } -NPC_CLERKB_HIO_CLASS l_HIO; +static NPC_CLERKB_HIO_CLASS l_HIO; static actor_method_class daNpc_clerkB_MethodTable = { (process_method_func)daNpc_clerkB_Create, (process_method_func)daNpc_clerkB_Delete, diff --git a/src/d/actor/d_a_npc_clerkt.cpp b/src/d/actor/d_a_npc_clerkt.cpp index 21398595be..43544cd533 100644 --- a/src/d/actor/d_a_npc_clerkt.cpp +++ b/src/d/actor/d_a_npc_clerkt.cpp @@ -693,7 +693,7 @@ void daNpcClerkT_c::setCollision() { mCyl.ClrTgHit(); } -NPC_CLERKT_HIO_CLASS l_HIO; +static NPC_CLERKT_HIO_CLASS l_HIO; static actor_method_class daNpcClerkt_MethodTable = { (process_method_func)daNpcClerkt_Create, (process_method_func)daNpcClerkt_Delete, diff --git a/src/d/actor/d_a_npc_gnd.cpp b/src/d/actor/d_a_npc_gnd.cpp index 8856e476d0..bc34c405af 100644 --- a/src/d/actor/d_a_npc_gnd.cpp +++ b/src/d/actor/d_a_npc_gnd.cpp @@ -96,7 +96,7 @@ const daNpc_Gnd_HIOParam daNpc_Gnd_Param_c::m = { 0.0f, }; -NPC_GND_HIO_CLASS l_HIO; +static NPC_GND_HIO_CLASS l_HIO; daNpc_Gnd_c::~daNpc_Gnd_c() { OS_REPORT("|%06d:%x|daNpc_Gnd_c -> デストラクト\n", g_Counter.mCounter0, this); diff --git a/src/d/actor/d_a_npc_gra.cpp b/src/d/actor/d_a_npc_gra.cpp index d6978ec3cb..65c2e6baa2 100644 --- a/src/d/actor/d_a_npc_gra.cpp +++ b/src/d/actor/d_a_npc_gra.cpp @@ -129,7 +129,7 @@ daNpc_grA_HIO_c::daNpc_grA_HIO_c() { } #endif -NPC_GRA_HIO_CLASS l_HIO; +static NPC_GRA_HIO_CLASS l_HIO; static char* l_evtNames[11] = { NULL, diff --git a/src/d/actor/d_a_npc_impal.cpp b/src/d/actor/d_a_npc_impal.cpp index 00e9a02905..7241c9c87f 100644 --- a/src/d/actor/d_a_npc_impal.cpp +++ b/src/d/actor/d_a_npc_impal.cpp @@ -45,7 +45,7 @@ daNpcImpal_HIOParam const daNpcImpal_Param_c::m = { 300.0f, // demo_start_dist }; -NPC_IMPAL_HIO_CLASS l_HIO; +static NPC_IMPAL_HIO_CLASS l_HIO; static daNpc_GetParam2 l_bckGetParamList[18] = { {-1, 2, 0}, {14, 0, 0}, {8, 0, 0}, {7, 2, 0}, {11, 0, 0}, {13, 0, 0}, diff --git a/src/d/actor/d_a_npc_knj.cpp b/src/d/actor/d_a_npc_knj.cpp index 7a6993223f..51d8b5020b 100644 --- a/src/d/actor/d_a_npc_knj.cpp +++ b/src/d/actor/d_a_npc_knj.cpp @@ -130,7 +130,7 @@ daNpc_Knj_c::cutFunc daNpc_Knj_c::mCutList[1] = { NULL, }; -NPC_KNJ_HIO_CLASS l_HIO; +static NPC_KNJ_HIO_CLASS l_HIO; daNpc_Knj_c::~daNpc_Knj_c() { if (heap != NULL) { diff --git a/src/d/actor/d_a_npc_kyury.cpp b/src/d/actor/d_a_npc_kyury.cpp index fc17e0fa54..84c497373e 100644 --- a/src/d/actor/d_a_npc_kyury.cpp +++ b/src/d/actor/d_a_npc_kyury.cpp @@ -136,7 +136,7 @@ daNpc_Kyury_c::cutFunc daNpc_Kyury_c::mCutList[2] = { &daNpc_Kyury_c::cutConversation, }; -NPC_KYURY_HIO_CLASS l_HIO; +static NPC_KYURY_HIO_CLASS l_HIO; #if DEBUG daNpc_Kyury_HIO_c::daNpc_Kyury_HIO_c() { diff --git a/src/d/actor/d_a_npc_len.cpp b/src/d/actor/d_a_npc_len.cpp index 6d3586be20..511dcf969f 100644 --- a/src/d/actor/d_a_npc_len.cpp +++ b/src/d/actor/d_a_npc_len.cpp @@ -652,7 +652,7 @@ void daNpc_Len_c::beforeMove() { } } -NPC_LEN_HIO_CLASS l_HIO; +static NPC_LEN_HIO_CLASS l_HIO; void daNpc_Len_c::setAttnPos() { cXyz acStack_40(-30.0f, 15.0f, 0.0f); diff --git a/src/d/actor/d_a_npc_lud.cpp b/src/d/actor/d_a_npc_lud.cpp index b15297f89d..4573edf91c 100644 --- a/src/d/actor/d_a_npc_lud.cpp +++ b/src/d/actor/d_a_npc_lud.cpp @@ -693,7 +693,7 @@ void daNpc_Lud_c::beforeMove() { } } -NPC_LUD_HIO_CLASS l_HIO; +static NPC_LUD_HIO_CLASS l_HIO; void daNpc_Lud_c::setAttnPos() { cXyz cStack_70(5.0f, 30.0f, 0.0f); diff --git a/src/d/actor/d_a_npc_maro.cpp b/src/d/actor/d_a_npc_maro.cpp index 709e27cb5c..492d83527e 100644 --- a/src/d/actor/d_a_npc_maro.cpp +++ b/src/d/actor/d_a_npc_maro.cpp @@ -116,7 +116,7 @@ static int l_bmdData[2][2] = { {11, 1}, {5, 2}, }; -daNpcT_evtData_c l_evtList[15] = { +static daNpcT_evtData_c l_evtList[15] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, diff --git a/src/d/actor/d_a_npc_moi.cpp b/src/d/actor/d_a_npc_moi.cpp index 50462a6f25..e901cb4248 100644 --- a/src/d/actor/d_a_npc_moi.cpp +++ b/src/d/actor/d_a_npc_moi.cpp @@ -244,7 +244,7 @@ enum Motion { /* 0x2F */ MOT_UNK_47 = 47, }; -NPC_MOI_HIO_CLASS l_HIO; +static NPC_MOI_HIO_CLASS l_HIO; daNpc_Moi_c::~daNpc_Moi_c() { if (mpMorf[0] != 0) { diff --git a/src/d/actor/d_a_npc_pouya.cpp b/src/d/actor/d_a_npc_pouya.cpp index 2129c5c52f..5d36a5992a 100644 --- a/src/d/actor/d_a_npc_pouya.cpp +++ b/src/d/actor/d_a_npc_pouya.cpp @@ -1189,7 +1189,7 @@ static bool daNpc_Pouya_IsDelete(void* i_this) { return 1; } -NPC_POUYA_HIO_CLASS l_HIO; +static NPC_POUYA_HIO_CLASS l_HIO; static actor_method_class daNpc_Pouya_MethodTable = { (process_method_func)daNpc_Pouya_Create, (process_method_func)daNpc_Pouya_Delete, diff --git a/src/d/actor/d_a_npc_shad.cpp b/src/d/actor/d_a_npc_shad.cpp index bffc93e883..ec87bf930f 100644 --- a/src/d/actor/d_a_npc_shad.cpp +++ b/src/d/actor/d_a_npc_shad.cpp @@ -307,7 +307,7 @@ static char* l_evtArcs[14] = { static char* l_myName = "Shad"; -NPC_SHAD_HIO_CLASS l_HIO; +static NPC_SHAD_HIO_CLASS l_HIO; daNpcShad_c::EventFn daNpcShad_c::mEvtSeqList[14] = { NULL, diff --git a/src/d/actor/d_a_npc_shoe.cpp b/src/d/actor/d_a_npc_shoe.cpp index 1639f2ee86..06b63797a7 100644 --- a/src/d/actor/d_a_npc_shoe.cpp +++ b/src/d/actor/d_a_npc_shoe.cpp @@ -54,7 +54,7 @@ void daNpcShoe_HIO_c::genMessage(JORMContext* ctext) { } #endif -NPC_SHOE_HIO_CLASS l_HIO; +static NPC_SHOE_HIO_CLASS l_HIO; void daNpcShoe_c::setLookMode(int i_lookMode) { if (mLookMode != i_lookMode) { diff --git a/src/d/actor/d_a_npc_taro.cpp b/src/d/actor/d_a_npc_taro.cpp index 32956de232..4bcfb6a0d8 100644 --- a/src/d/actor/d_a_npc_taro.cpp +++ b/src/d/actor/d_a_npc_taro.cpp @@ -20,7 +20,7 @@ #include "f_op/f_op_camera_mng.h" #include -daNpc_Maro_c::actionFunc dummy_lit_3931() { +static daNpc_Maro_c::actionFunc dummy_lit_3931() { return &daNpc_Maro_c::choccai; } diff --git a/src/d/actor/d_a_npc_the.cpp b/src/d/actor/d_a_npc_the.cpp index 79c169935d..7d63b43c42 100644 --- a/src/d/actor/d_a_npc_the.cpp +++ b/src/d/actor/d_a_npc_the.cpp @@ -61,7 +61,7 @@ void daNpcThe_HIO_c::genMessage(JORMContext* ctext) { } #endif -NPC_THE_HIO_CLASS l_HIO; +static NPC_THE_HIO_CLASS l_HIO; static daNpc_GetParam1 l_bmdGetParamList[2] = { {23, 0}, // the diff --git a/src/d/actor/d_a_npc_toby.cpp b/src/d/actor/d_a_npc_toby.cpp index 232d107471..1d934e3ada 100644 --- a/src/d/actor/d_a_npc_toby.cpp +++ b/src/d/actor/d_a_npc_toby.cpp @@ -265,7 +265,7 @@ daNpc_Toby_c::cutFunc daNpc_Toby_c::mCutList[7] = { &daNpc_Toby_c::cutConversationAboutZra, }; -NPC_TOBY_HIO_CLASS l_HIO; +static NPC_TOBY_HIO_CLASS l_HIO; daNpc_Toby_c::~daNpc_Toby_c() { OS_REPORT("|%06d:%x|daNpc_Toby_c -> デストラクト\n", g_Counter.mCounter0, this); diff --git a/src/d/actor/d_a_npc_uri.cpp b/src/d/actor/d_a_npc_uri.cpp index c3d835e6a3..d61729efee 100644 --- a/src/d/actor/d_a_npc_uri.cpp +++ b/src/d/actor/d_a_npc_uri.cpp @@ -209,7 +209,7 @@ daNpc_Uri_c::cutFunc daNpc_Uri_c::mCutList[7] = { &daNpc_Uri_c::cutMeetingAgain, }; -NPC_URI_HIO_CLASS l_HIO; +static NPC_URI_HIO_CLASS l_HIO; daNpc_Uri_c::~daNpc_Uri_c() { if (mpMorf[0] != 0) { diff --git a/src/d/actor/d_a_obj_brakeeff.cpp b/src/d/actor/d_a_obj_brakeeff.cpp index d9299694f9..6a43938f72 100644 --- a/src/d/actor/d_a_obj_brakeeff.cpp +++ b/src/d/actor/d_a_obj_brakeeff.cpp @@ -141,7 +141,7 @@ u32 bef_brk[2] = { 10, }; -int useHeapInit(fopAc_ac_c* i_this) { +static int useHeapInit(fopAc_ac_c* i_this) { obj_brakeeff_class* a_this = static_cast(i_this); J3DModelData* modelData = diff --git a/src/d/actor/d_a_obj_burnbox.cpp b/src/d/actor/d_a_obj_burnbox.cpp index b7b47b5357..b1c3f2a9c7 100644 --- a/src/d/actor/d_a_obj_burnbox.cpp +++ b/src/d/actor/d_a_obj_burnbox.cpp @@ -81,7 +81,7 @@ int daObjBurnBox_c::Create() { return 1; } -const char* l_arcName[3] = { +static const char* l_arcName[3] = { "Kkiba_00", // crate "Kkiba_00", "J_taru00", // barrel diff --git a/src/d/actor/d_a_obj_ice_l.cpp b/src/d/actor/d_a_obj_ice_l.cpp index 34d489308c..7048eb3a18 100644 --- a/src/d/actor/d_a_obj_ice_l.cpp +++ b/src/d/actor/d_a_obj_ice_l.cpp @@ -14,7 +14,7 @@ #include "d/d_s_play.h" #include -f32 dummyLiteral() { +static f32 dummyLiteral() { return 0.0f; } diff --git a/src/d/actor/d_a_obj_katatsumuri.cpp b/src/d/actor/d_a_obj_katatsumuri.cpp index 115d0dfadd..1cb47bd8c8 100644 --- a/src/d/actor/d_a_obj_katatsumuri.cpp +++ b/src/d/actor/d_a_obj_katatsumuri.cpp @@ -149,19 +149,19 @@ static int daObjKAT_Delete(daObjKAT_c* i_this) { return 1; } -f32 dummy0() { +static f32 dummy0() { return 0.0f; } -f32 dummy1() { +static f32 dummy1() { return 0.4f; } -f32 dummy2() { +static f32 dummy2() { return 10.0f; } -f32 dummy3() { +static f32 dummy3() { return 0.02f; } diff --git a/src/d/actor/d_a_obj_klift00.cpp b/src/d/actor/d_a_obj_klift00.cpp index 739c7fe7f8..221e4f8812 100644 --- a/src/d/actor/d_a_obj_klift00.cpp +++ b/src/d/actor/d_a_obj_klift00.cpp @@ -109,7 +109,7 @@ static const int l_dzbidx[] = {9}; #endif // force dCcD_Sph::~dCcD_Sph to be emitted earlier than it otherwise would -void dummy() { +static void dummy() { delete (dCcD_Sph*)NULL; delete (dCcD_Cyl*)NULL; } diff --git a/src/d/actor/d_a_obj_maki.cpp b/src/d/actor/d_a_obj_maki.cpp index c555335745..8c36b8bd2c 100644 --- a/src/d/actor/d_a_obj_maki.cpp +++ b/src/d/actor/d_a_obj_maki.cpp @@ -146,7 +146,7 @@ int daObj_Maki_Delete(obj_maki_class* i_this) { return 1; } -int useHeapInit(fopAc_ac_c* i_this) { +static int useHeapInit(fopAc_ac_c* i_this) { obj_maki_class* a_this = (obj_maki_class*)i_this; J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Obj_maki", 4); @@ -176,7 +176,7 @@ int useHeapInit(fopAc_ac_c* i_this) { return 1; } -daObj_Maki_HIO_c l_HIO; +static daObj_Maki_HIO_c l_HIO; cPhs_Step daObj_Maki_Create(fopAc_ac_c* i_this) { fopAcM_ct(i_this, obj_maki_class); diff --git a/src/d/actor/d_a_obj_sakuita.cpp b/src/d/actor/d_a_obj_sakuita.cpp index 0f828d4d73..87073326d1 100644 --- a/src/d/actor/d_a_obj_sakuita.cpp +++ b/src/d/actor/d_a_obj_sakuita.cpp @@ -89,7 +89,7 @@ void daObjSakuita_c::setBaseMtx() { cMtx_copy(mDoMtx_stack_c::get(), mMtx); } -f32 dummyLiteral() { return 0.5f; } +static f32 dummyLiteral() { return 0.5f; } void daObjSakuita_c::setPlatePos() { cXyz cStack_24; diff --git a/src/d/actor/d_a_obj_ss_base.cpp b/src/d/actor/d_a_obj_ss_base.cpp index e4712d3813..92db022b60 100644 --- a/src/d/actor/d_a_obj_ss_base.cpp +++ b/src/d/actor/d_a_obj_ss_base.cpp @@ -15,7 +15,3 @@ daObj_SSBase_c::~daObj_SSBase_c() {} u32 daObj_SSBase_c::getProcessID() { return fopAcM_GetID(this); } - -void daObj_SSBase_c::setSoldOut() { - /* empty function */ -} diff --git a/src/d/actor/d_a_obj_thashi.cpp b/src/d/actor/d_a_obj_thashi.cpp index a702266dd4..0d0e8495a5 100644 --- a/src/d/actor/d_a_obj_thashi.cpp +++ b/src/d/actor/d_a_obj_thashi.cpp @@ -9,7 +9,7 @@ #include "d/d_cc_d.h" #include "d/d_s_play.h" -char* l_arcName = "S_thashi"; +static const char* l_arcName = "S_thashi"; static void dataStripping() { const static u32 ccCylSrc[] = {0, 0x100000, 0, 0x13, 0x100000, 0x1f, 0x75, 0, diff --git a/src/d/actor/d_a_obj_tornado.cpp b/src/d/actor/d_a_obj_tornado.cpp index 3b6c837f73..6761f0a329 100644 --- a/src/d/actor/d_a_obj_tornado.cpp +++ b/src/d/actor/d_a_obj_tornado.cpp @@ -216,7 +216,7 @@ static int daObjTrnd_Create(daObjTrnd_c* i_this) { return i_this->create(); } -void dummyString() { +static void dummyString() { DEAD_STRING(""); } diff --git a/src/d/actor/d_a_obj_waterPillar.cpp b/src/d/actor/d_a_obj_waterPillar.cpp index 65abe22e5c..47e2aecf16 100644 --- a/src/d/actor/d_a_obj_waterPillar.cpp +++ b/src/d/actor/d_a_obj_waterPillar.cpp @@ -110,7 +110,7 @@ const dCcD_SrcGObjInf daWtPillar_c::mCcDObjCoInfo = { {}, // mGObjCo }; -daWtPillar_HIO_c l_HIO; +static daWtPillar_HIO_c l_HIO; dCcD_SrcCps daWtPillar_c::mCcDCps = { daWtPillar_c::mCcDObjInfo, diff --git a/src/d/actor/d_a_obj_wdStick.cpp b/src/d/actor/d_a_obj_wdStick.cpp index d7e5275460..be060df460 100644 --- a/src/d/actor/d_a_obj_wdStick.cpp +++ b/src/d/actor/d_a_obj_wdStick.cpp @@ -435,7 +435,7 @@ void daWdStick_c::mode_proc_roll() { bgCheck(); } -f32 dummyLiteral() { return 100.0f; } +static f32 dummyLiteral() { return 100.0f; } BOOL daWdStick_c::chkWaterLineIn() { return mAcch.m_wtr.GetHeight() > current.pos.y + 40.0f; diff --git a/src/d/actor/d_a_tag_CstaSw.cpp b/src/d/actor/d_a_tag_CstaSw.cpp index 6974c3d5d3..03a07e7a99 100644 --- a/src/d/actor/d_a_tag_CstaSw.cpp +++ b/src/d/actor/d_a_tag_CstaSw.cpp @@ -10,7 +10,7 @@ #include "d/d_debug_viewer.h" #include "d/d_procname.h" -daTagCstaSw_HIO_c l_HIO; + static daTagCstaSw_HIO_c l_HIO; daTagCstaSw_HIO_c::daTagCstaSw_HIO_c() { show_range = 0; diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp index d9cbd2bf66..25cf35e224 100644 --- a/src/d/actor/d_a_tag_msg.cpp +++ b/src/d/actor/d_a_tag_msg.cpp @@ -264,7 +264,7 @@ void daTag_Msg_HIO_c::genMessage(JORMContext* ctx) { } #endif -void dummyString() { +static void dummyString() { DEAD_STRING("Timer"); } diff --git a/src/dusk/stubs.cpp b/src/dusk/stubs.cpp index 8590df30eb..29e5a198dc 100644 --- a/src/dusk/stubs.cpp +++ b/src/dusk/stubs.cpp @@ -673,25 +673,6 @@ void Z2AudioCS::extensionProcess(s32, s32) { # pragma mark JORServer #include -void JORServer::releaseMCTX(JORMContext*) { - puts("releaseMCTX is a stub"); -} - -JORMContext* JORServer::attachMCTX(u32) { - puts("attachMCTX is a stub"); - return NULL; -} - -JORServer* JORServer::instance; - -void JORMContext::genCheckBoxSub(u32 kind, const char* label, u32 id, u32 style, u16 initValue, u16 mask, - JOREventListener* pListener, u16 posX, u16 posY, u16 width, - u16 height) { - puts("JORServer::genCheckBoxSub is a stub"); -} -void JORMContext::updateCheckBoxSub(u32 mode, u32 id, u16 value, u16 mask, u32 param_4) { - puts("JORServer::updateCheckBoxSub is a stub"); -} int JOREventCallbackListNode::JORAct(u32, const char*) { return 0; @@ -728,13 +709,6 @@ mDoExt_onCupOffAupPacket::~mDoExt_onCupOffAupPacket() { puts("mDoExt_onCupOffAupPacket_c destructor is a stub"); } -# pragma mark mDoExt -namespace mDoExt { - u8 CurrentHeapAdjustVerbose; - u8 HeapAdjustVerbose; - u8 HeapAdjustQuiet; -}; - # pragma mark dKankyo_vrboxHIO_c #include void dKankyo_vrboxHIO_c::dKankyo_vrboxHIOInfoUpDateF() { @@ -1513,7 +1487,7 @@ void GXInitTexCacheRegion(GXTexRegion* region, u8 is_32b_mipmap, u32 tmem_even, puts("GXInitTexCacheRegion is a stub"); } // XXX, this should be some struct? -GXRenderModeObj GXNtsc480IntDf; +// GXRenderModeObj GXNtsc480IntDf; GXRenderModeObj GXNtsc480Int; void GXPeekZ(u16 x, u16 y, u32* z) { puts("GXPeekZ is a stub"); @@ -1643,9 +1617,6 @@ u8 fapGm_HIO_c::mCaptureScreenDivH = 1; # pragma mark dMsgObject #include -void dMsgObject_c::setSelectWordFlag(u8 flag) { - puts("dMsgObject_c::setSelectWordFlag is a stub"); -} void dMsgObject_c::setWord(const char* i_word) { puts("dMsgObject_c::setWord is a stub"); } diff --git a/src/f_op/f_op_msg_mng.cpp b/src/f_op/f_op_msg_mng.cpp index 9442a807a6..c0b6dd060a 100644 --- a/src/f_op/f_op_msg_mng.cpp +++ b/src/f_op/f_op_msg_mng.cpp @@ -248,7 +248,7 @@ u8 fopMsgM_itemNumIdx(u8 i_no) { return itemicon[i_no] & 0xFF; } -f32 dummy() { +static f32 dummy() { J2DPane* dummyPlane = NULL; dummyPlane->getAlpha(); dummyPlane->getHeight();