From 13cc824dc2539918479a6ed7ef23c2ecbbc2d8ec Mon Sep 17 00:00:00 2001 From: kipcode66 Date: Fri, 5 Dec 2025 23:01:52 -0500 Subject: [PATCH] updating variable argument headers & minor fixes for register statement and header file placement --- CMakeLists.txt | 2 +- include/JSystem/J2DGraph/J2DPrint.h | 2 +- .../JSystem/J3DGraphAnimator/J3DSkinDeform.h | 2 +- include/JSystem/J3DGraphBase/J3DTransform.h | 42 +++--- include/JSystem/JGadget/define.h | 2 +- include/JSystem/JGeometry.h | 54 ++++---- include/JSystem/JHostIO/JORMContext.h | 2 +- include/JSystem/JMath/JMath.h | 124 +++++++++--------- include/JSystem/JUtility/JUTConsole.h | 4 +- include/JSystem/JUtility/JUTDirectPrint.h | 2 +- include/JSystem/JUtility/JUTException.h | 2 +- include/JSystem/JUtility/JUTGamePad.h | 2 +- {src => include}/d/d_debug_pad.h | 0 include/dolphin/gd/GDLight.h | 4 + include/dolphin/os.h | 12 +- include/dolphin/types.h | 6 + include/m_Do/m_Do_printf.h | 3 +- .../MSL/MSL_C/MSL_Common/Include/printf.h | 4 +- 18 files changed, 140 insertions(+), 129 deletions(-) rename {src => include}/d/d_debug_pad.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6318e778c5..09842b56a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1344,7 +1344,7 @@ source_group("dusk" FILES ${DUSK_FILES}) add_library(game SHARED ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${SSYSTEM_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES}) target_compile_definitions(game PRIVATE TARGET_PC VERSION=0) -target_include_directories(game PRIVATE include) +target_include_directories(game PRIVATE include src/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Include) target_link_libraries(game PRIVATE aurora::core aurora::gx aurora::si aurora::vi aurora::pad) add_executable(dusk src/dusk/main.cpp) diff --git a/include/JSystem/J2DGraph/J2DPrint.h b/include/JSystem/J2DGraph/J2DPrint.h index 48bdb59bc9..02e704d0d2 100644 --- a/include/JSystem/J2DGraph/J2DPrint.h +++ b/include/JSystem/J2DGraph/J2DPrint.h @@ -2,7 +2,7 @@ #define J2DPRINT_H #include "JSystem/J2DGraph/J2DTextBox.h" -#include "__va_arg.h" +#include class JUTFont; class J2DPrint; diff --git a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h index 89331247ec..fd906d8a3c 100644 --- a/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h +++ b/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h @@ -100,7 +100,7 @@ public: /* 0x10 */ u32 mFlags; }; // Size: 0x14 -inline void J3DFillZero32B(register void* param_0, register u32 param_1) { +inline void J3DFillZero32B(__REGISTER void* param_0, __REGISTER u32 param_1) { #ifdef __MWERKS__ asm { srwi param_1, param_1, 5 diff --git a/include/JSystem/J3DGraphBase/J3DTransform.h b/include/JSystem/J3DGraphBase/J3DTransform.h index 7b54237676..9b4fad8ce3 100644 --- a/include/JSystem/J3DGraphBase/J3DTransform.h +++ b/include/JSystem/J3DGraphBase/J3DTransform.h @@ -23,10 +23,10 @@ struct J3DTransformInfo { } */ #ifdef __MWERKS__ - inline J3DTransformInfo& operator=(const register J3DTransformInfo& b) { - register const J3DTransformInfo& var_r31 = b; - register J3DTransformInfo& var_r30 = *this; - register f32 var_f31; + inline J3DTransformInfo& operator=(const __REGISTER J3DTransformInfo& b) { + __REGISTER const J3DTransformInfo& var_r31 = b; + __REGISTER J3DTransformInfo& var_r30 = *this; + __REGISTER f32 var_f31; asm { psq_l var_f31, J3DTransformInfo.mScale(var_r31), 0, 0 psq_st var_f31, J3DTransformInfo.mScale(var_r30), 0, 0 @@ -64,13 +64,13 @@ void J3DScaleNrmMtx33(f32 (*)[3], const Vec&); void J3DMtxProjConcat(f32 (*)[4], f32 (*)[4], f32 (*)[4]); void J3DPSMtxArrayConcat(f32 (*)[4], f32 (*)[4], f32 (*)[4], u32); -inline void J3DPSMtx33Copy(register Mtx3P src, register Mtx3P dst) { +inline void J3DPSMtx33Copy(__REGISTER Mtx3P src, __REGISTER Mtx3P dst) { #ifdef __MWERKS__ - register f32 fr4; - register f32 fr3; - register f32 fr2; - register f32 fr1; - register f32 fr0; + __REGISTER f32 fr4; + __REGISTER f32 fr3; + __REGISTER f32 fr2; + __REGISTER f32 fr1; + __REGISTER f32 fr0; asm { psq_l fr4, 0(src), 0, 0 @@ -87,14 +87,14 @@ inline void J3DPSMtx33Copy(register Mtx3P src, register Mtx3P dst) { #endif } -inline void J3DPSMtx33CopyFrom34(register MtxP src, register Mtx3P dst) { +inline void J3DPSMtx33CopyFrom34(__REGISTER MtxP src, __REGISTER Mtx3P dst) { #ifdef __MWERKS__ - register f32 x_y1; - register f32 z1; - register f32 x_y2; - register f32 z2; - register f32 x_y3; - register f32 z3; + __REGISTER f32 x_y1; + __REGISTER f32 z1; + __REGISTER f32 x_y2; + __REGISTER f32 z2; + __REGISTER f32 x_y3; + __REGISTER f32 z3; asm { psq_l x_y1, 0(src), 0, 0 lfs z1, 8(src) @@ -112,7 +112,7 @@ inline void J3DPSMtx33CopyFrom34(register MtxP src, register Mtx3P dst) { #endif } -inline void J3DPSMulMtxVec(register MtxP mtx, register Vec* vec, register Vec* dst) { +inline void J3DPSMulMtxVec(__REGISTER MtxP mtx, __REGISTER Vec* vec, __REGISTER Vec* dst) { #ifdef __MWERKS__ asm { psq_l f0, 0(vec), 0, 0 @@ -139,7 +139,7 @@ inline void J3DPSMulMtxVec(register MtxP mtx, register Vec* vec, register Vec* d #endif } -inline void J3DPSMulMtxVec(register MtxP mtx, register S16Vec* vec, register S16Vec* dst) { +inline void J3DPSMulMtxVec(__REGISTER MtxP mtx, __REGISTER S16Vec* vec, __REGISTER S16Vec* dst) { #ifdef __MWERKS__ asm { psq_l f0, 0(vec), 0, 7 @@ -166,7 +166,7 @@ inline void J3DPSMulMtxVec(register MtxP mtx, register S16Vec* vec, register S16 #endif } -inline void J3DPSMulMtxVec(register Mtx3P mtx, register Vec* vec, register Vec* dst) { +inline void J3DPSMulMtxVec(__REGISTER Mtx3P mtx, __REGISTER Vec* vec, __REGISTER Vec* dst) { #ifdef __MWERKS__ asm { lis r6, PSMulUnit01@ha @@ -197,7 +197,7 @@ inline void J3DPSMulMtxVec(register Mtx3P mtx, register Vec* vec, register Vec* #endif } -inline void J3DPSMulMtxVec(register Mtx3P mtx, register S16Vec* vec, register S16Vec* dst) { +inline void J3DPSMulMtxVec(__REGISTER Mtx3P mtx, __REGISTER S16Vec* vec, __REGISTER S16Vec* dst) { #ifdef __MWERKS__ asm { lis r6, PSMulUnit01@ha diff --git a/include/JSystem/JGadget/define.h b/include/JSystem/JGadget/define.h index 4ae789ada2..c964acc996 100644 --- a/include/JSystem/JGadget/define.h +++ b/include/JSystem/JGadget/define.h @@ -1,7 +1,7 @@ #ifndef DEFINE_H #define DEFINE_H -#include "types.h" +#include "dolphin/types.h" #ifdef __cplusplus extern "C" { diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 9e9662c4f3..1be5e75eb7 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -127,11 +127,11 @@ struct TVec3 { inline void setTVec3f(const f32* vec_a, f32* vec_b) { #ifdef __MWERKS__ - const register f32* v_a = vec_a; - register f32* v_b = vec_b; + const __REGISTER f32* v_a = vec_a; + __REGISTER f32* v_b = vec_b; - register f32 a_x; - register f32 b_x; + __REGISTER f32 a_x; + __REGISTER f32 b_x; asm { psq_l a_x, 0(v_a), 0, 0 @@ -154,14 +154,14 @@ inline float fsqrt_step(float mag) { #endif } -inline void mulInternal(register const f32* a, register const f32* b, register float* dst) { +inline void mulInternal(__REGISTER const f32* a, __REGISTER const f32* b, __REGISTER float* dst) { #ifdef __MWERKS__ - register f32 a_x_y; - register f32 b_x_y; - register f32 x_y; - register f32 za; - register f32 zb; - register f32 z; + __REGISTER f32 a_x_y; + __REGISTER f32 b_x_y; + __REGISTER f32 x_y; + __REGISTER f32 za; + __REGISTER f32 zb; + __REGISTER f32 z; asm { psq_l a_x_y, 0(a), 0, 0 @@ -287,12 +287,12 @@ struct TVec3 : public Vec { return VECMag((Vec*)this); } - void scale(register f32 sc) { + void scale(__REGISTER f32 sc) { #ifdef __MWERKS__ - register f32 z; - register f32 x_y; - register f32* dst = &x; - register f32 zres; + __REGISTER f32 z; + __REGISTER f32 x_y; + __REGISTER f32* dst = &x; + __REGISTER f32 zres; asm { psq_l x_y, 0(dst), 0, 0 @@ -305,13 +305,13 @@ struct TVec3 : public Vec { #endif } - void scale(register f32 sc, const TVec3& other) { + void scale(__REGISTER f32 sc, const TVec3& other) { #ifdef __MWERKS__ - register const f32* src = &other.x; - register f32 z; - register f32 x_y; - register f32* dst = &x; - register f32 zres; + __REGISTER const f32* src = &other.x; + __REGISTER f32 z; + __REGISTER f32 x_y; + __REGISTER f32* dst = &x; + __REGISTER f32 zres; asm { psq_l x_y, 0(src), 0, 0 @@ -324,16 +324,16 @@ struct TVec3 : public Vec { #endif } - void scaleAdd(register f32 sc, const TVec3& a, const TVec3& b) { + void scaleAdd(__REGISTER f32 sc, const TVec3& a, const TVec3& b) { JMAVECScaleAdd(&a, &b, this, sc); } void negateInternal(TVec3* dst) { #ifdef __MWERKS__ - register f32* rdst = &dst->x; - const register f32* src = &x; - register f32 x_y; - register f32 z; + __REGISTER f32* rdst = &dst->x; + const __REGISTER f32* src = &x; + __REGISTER f32 x_y; + __REGISTER f32 z; asm { psq_l x_y, 0(src), 0, 0 diff --git a/include/JSystem/JHostIO/JORMContext.h b/include/JSystem/JHostIO/JORMContext.h index daf8bbc5f5..b0fe008186 100644 --- a/include/JSystem/JHostIO/JORMContext.h +++ b/include/JSystem/JHostIO/JORMContext.h @@ -1,7 +1,7 @@ #ifndef JORMCONTEXT_H #define JORMCONTEXT_H -#include +#include #include #include "JSystem/JHostIO/JORReflexible.h" #include "JSystem/JSupport/JSUMemoryStream.h" diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index fd31a8dd25..a17a882c7e 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -7,9 +7,9 @@ void JMAMTXApplyScale(const Mtx, Mtx, f32, f32, f32); void JMAEulerToQuat(s16 param_0, s16 param_1, s16 param_2, Quaternion* param_3); void JMAQuatLerp(const Quaternion*, const Quaternion*, f32, Quaternion*); -void JMAFastVECNormalize(register const Vec* src, register Vec* dst); -void JMAVECScaleAdd(register const Vec* vec1, register const Vec* vec2, register Vec* dst, - register f32 scale); +void JMAFastVECNormalize(__REGISTER const Vec* src, __REGISTER Vec* dst); +void JMAVECScaleAdd(__REGISTER const Vec* vec1, __REGISTER const Vec* vec2, __REGISTER Vec* dst, + __REGISTER f32 scale); inline int JMAAbs(int value) { #ifdef __MWERKS__ @@ -23,9 +23,9 @@ inline f32 JMAFastReciprocal(f32 value) { #endif } -inline float __frsqrtes(register double f) { +inline float __frsqrtes(__REGISTER double f) { #ifdef __MWERKS__ - register float out; + __REGISTER float out; // clang-format off asm { @@ -37,10 +37,10 @@ inline float __frsqrtes(register double f) { #endif } -inline f32 JMAFastSqrt(register f32 input) { +inline f32 JMAFastSqrt(__REGISTER f32 input) { #ifdef __MWERKS__ if (input > 0.0f) { - register f32 out; + __REGISTER f32 out; asm { frsqrte out, input } @@ -51,17 +51,17 @@ inline f32 JMAFastSqrt(register f32 input) { #endif } -inline f32 JMAHermiteInterpolation(register f32 p1, register f32 p2, register f32 p3, - register f32 p4, register f32 p5, register f32 p6, - register f32 p7) { +inline f32 JMAHermiteInterpolation(__REGISTER f32 p1, __REGISTER f32 p2, __REGISTER f32 p3, + __REGISTER f32 p4, __REGISTER f32 p5, __REGISTER f32 p6, + __REGISTER f32 p7) { #ifdef __MWERKS__ - register f32 ff25; - register f32 ff31; - register f32 ff30; - register f32 ff29; - register f32 ff28; - register f32 ff27; - register f32 ff26; + __REGISTER f32 ff25; + __REGISTER f32 ff31; + __REGISTER f32 ff30; + __REGISTER f32 ff29; + __REGISTER f32 ff28; + __REGISTER f32 ff27; + __REGISTER f32 ff26; // clang-format off asm { fsubs ff31, p1, p2 @@ -99,10 +99,10 @@ inline void fastVECNormalize(const Vec* src, Vec* dst) { return JMAFastVECNormalize(src, dst); } -inline void gekko_ps_copy3(register void* dst, register const void* src) { +inline void gekko_ps_copy3(__REGISTER void* dst, __REGISTER const void* src) { #ifdef __MWERKS__ - register f32 src0; - register f32 src1; + __REGISTER f32 src0; + __REGISTER f32 src1; asm { psq_l src0, 0(src), 0, 0 lfs src1, 8(src) @@ -112,11 +112,11 @@ inline void gekko_ps_copy3(register void* dst, register const void* src) { #endif } -inline void gekko_ps_copy6(register void* dst, register const void* src) { +inline void gekko_ps_copy6(__REGISTER void* dst, __REGISTER const void* src) { #ifdef __MWERKS__ - register f32 src0; - register f32 src1; - register f32 src2; + __REGISTER f32 src0; + __REGISTER f32 src1; + __REGISTER f32 src2; asm { psq_l src0, 0(src), 0, 0 psq_l src1, 8(src), 0, 0 @@ -128,14 +128,14 @@ inline void gekko_ps_copy6(register void* dst, register const void* src) { #endif } -inline void gekko_ps_copy12(register void* dst, register const void* src) { +inline void gekko_ps_copy12(__REGISTER void* dst, __REGISTER const void* src) { #ifdef __MWERKS__ - register f32 src0; - register f32 src1; - register f32 src2; - register f32 src3; - register f32 src4; - register f32 src5; + __REGISTER f32 src0; + __REGISTER f32 src1; + __REGISTER f32 src2; + __REGISTER f32 src3; + __REGISTER f32 src4; + __REGISTER f32 src5; asm { psq_l src0, 0(src), 0, 0 psq_l src1, 8(src), 0, 0 @@ -153,16 +153,16 @@ inline void gekko_ps_copy12(register void* dst, register const void* src) { #endif } -inline void gekko_ps_copy16(register void* dst, register const void* src) { +inline void gekko_ps_copy16(__REGISTER void* dst, __REGISTER const void* src) { #ifdef __MWERKS__ - register f32 src0; - register f32 src1; - register f32 src2; - register f32 src3; - register f32 src4; - register f32 src5; - register f32 src6; - register f32 src7; + __REGISTER f32 src0; + __REGISTER f32 src1; + __REGISTER f32 src2; + __REGISTER f32 src3; + __REGISTER f32 src4; + __REGISTER f32 src5; + __REGISTER f32 src6; + __REGISTER f32 src7; asm { psq_l src0, 0(src), 0, 0 psq_l src1, 8(src), 0, 0 @@ -187,13 +187,13 @@ inline void gekko_ps_copy16(register void* dst, register const void* src) { }; // namespace JMath namespace JMathInlineVEC { - inline void C_VECAdd(register const Vec* a, register const Vec* b, register Vec* ab) { + inline void C_VECAdd(__REGISTER const Vec* a, __REGISTER const Vec* b, __REGISTER Vec* ab) { #ifdef __MWERKS__ - register f32 axy; - register f32 bxy; - register f32 az; - register f32 sumz; - register f32 bz; + __REGISTER f32 axy; + __REGISTER f32 bxy; + __REGISTER f32 az; + __REGISTER f32 sumz; + __REGISTER f32 bz; asm { psq_l axy, 0(a), 0, 0 psq_l bxy, 0(b), 0, 0 @@ -207,13 +207,13 @@ namespace JMathInlineVEC { #endif } - inline void C_VECSubtract(register const Vec* a, register const Vec* b, register Vec* ab) { + inline void C_VECSubtract(__REGISTER const Vec* a, __REGISTER const Vec* b, __REGISTER Vec* ab) { #ifdef __MWERKS__ - register f32 axy; - register f32 bxy; - register f32 az; - register f32 subz; - register f32 bz; + __REGISTER f32 axy; + __REGISTER f32 bxy; + __REGISTER f32 az; + __REGISTER f32 subz; + __REGISTER f32 bz; asm { psq_l axy, 0(a), 0, 0 psq_l bxy, 0(b), 0, 0 @@ -227,11 +227,11 @@ namespace JMathInlineVEC { #endif } - inline f32 C_VECSquareMag(register const Vec* v) { + inline f32 C_VECSquareMag(__REGISTER const Vec* v) { #ifdef __MWERKS__ - register f32 x_y; - register f32 z; - register f32 res; + __REGISTER f32 x_y; + __REGISTER f32 z; + __REGISTER f32 res; asm { psq_l x_y, 0(v), 0, 0 @@ -244,13 +244,13 @@ namespace JMathInlineVEC { #endif } - inline f32 C_VECDotProduct(register const Vec *a, register const Vec *b) { + inline f32 C_VECDotProduct(__REGISTER const Vec *a, __REGISTER const Vec *b) { #ifdef __MWERKS__ - register f32 res; - register f32 thisyz; - register f32 otheryz; - register f32 otherxy; - register f32 thisxy; + __REGISTER f32 res; + __REGISTER f32 thisyz; + __REGISTER f32 otheryz; + __REGISTER f32 otherxy; + __REGISTER f32 thisxy; asm { psq_l thisyz, 4(a), 0, 0 psq_l otheryz, 4(b), 0, 0 diff --git a/include/JSystem/JUtility/JUTConsole.h b/include/JSystem/JUtility/JUTConsole.h index 9ed5c413e7..7a55173161 100644 --- a/include/JSystem/JUtility/JUTConsole.h +++ b/include/JSystem/JUtility/JUTConsole.h @@ -4,7 +4,7 @@ #include "JSystem/JGadget/linklist.h" #include "JSystem/JKernel/JKRDisposer.h" #include "JSystem/JUtility/JUTFont.h" -#include "__va_arg.h" +#include /** * @ingroup jsystem-jutility @@ -141,7 +141,7 @@ public: typedef JGadget::TLinkList ConsoleList; #else // clangd does not support offsetof in template arguments. - typedef JGadget::TLinkList ConsoleList; + typedef JGadget::TLinkList(sizeof(JKRDisposer))> ConsoleList; #endif private: diff --git a/include/JSystem/JUtility/JUTDirectPrint.h b/include/JSystem/JUtility/JUTDirectPrint.h index 8d85ba5982..14ed2c28b8 100644 --- a/include/JSystem/JUtility/JUTDirectPrint.h +++ b/include/JSystem/JUtility/JUTDirectPrint.h @@ -2,7 +2,7 @@ #define JUTDIRECTPRINT_H #include "JSystem/JUtility/TColor.h" -#include "__va_arg.h" +#include /** * @ingroup jsystem-jutility diff --git a/include/JSystem/JUtility/JUTException.h b/include/JSystem/JUtility/JUTException.h index dc6ef1ac4d..92e4c36f60 100644 --- a/include/JSystem/JUtility/JUTException.h +++ b/include/JSystem/JUtility/JUTException.h @@ -3,7 +3,7 @@ #include "JSystem/JKernel/JKRThread.h" #include "JSystem/JUtility/JUTGamePad.h" -#include "__va_arg.h" +#include #include #include #include "global.h" diff --git a/include/JSystem/JUtility/JUTGamePad.h b/include/JSystem/JUtility/JUTGamePad.h index b2e5403de8..0df3f24640 100644 --- a/include/JSystem/JUtility/JUTGamePad.h +++ b/include/JSystem/JUtility/JUTGamePad.h @@ -3,7 +3,7 @@ #include "JSystem/JKernel/JKRDisposer.h" #include "JSystem/JUtility/JUTAssert.h" -#include +#include typedef void (*callbackFn)(int, void*); diff --git a/src/d/d_debug_pad.h b/include/d/d_debug_pad.h similarity index 100% rename from src/d/d_debug_pad.h rename to include/d/d_debug_pad.h diff --git a/include/dolphin/gd/GDLight.h b/include/dolphin/gd/GDLight.h index a725830fe4..bc53ec4954 100644 --- a/include/dolphin/gd/GDLight.h +++ b/include/dolphin/gd/GDLight.h @@ -59,7 +59,11 @@ void GDSetChanCtrl(GXChannelID chan, u8 enable, GXColorSrc amb_src, inline static u16 __GDLightID2Index(GXLightID id) { u16 idx; +#ifdef __MWERKS__ idx = 0x1F - __cntlzw(id); +#else + idx = 0x1F - __builtin_clz(id); +#endif if (idx > 7) { idx = 0; } diff --git a/include/dolphin/os.h b/include/dolphin/os.h index ac0df7b59e..1063800e89 100644 --- a/include/dolphin/os.h +++ b/include/dolphin/os.h @@ -288,10 +288,10 @@ extern int __OSInIPL; #define ASSERT(cond) ASSERTLINE(__LINE__, cond) -inline s16 __OSf32tos16(register f32 inF) { - register s16 out; +inline s16 __OSf32tos16(__REGISTER f32 inF) { + __REGISTER s16 out; u32 tmp; - register u32* tmpPtr = &tmp; + __REGISTER u32* tmpPtr = &tmp; // clang-format off #ifdef __MWERKS__ asm { @@ -308,10 +308,10 @@ inline void OSf32tos16(f32* f, s16* out) { *out = __OSf32tos16(*f); } -inline u8 __OSf32tou8(register f32 inF) { - register u8 out; +inline u8 __OSf32tou8(__REGISTER f32 inF) { + __REGISTER u8 out; u32 tmp; - register u32* tmpPtr = &tmp; + __REGISTER u32* tmpPtr = &tmp; // clang-format off #ifdef __MWERKS__ asm { diff --git a/include/dolphin/types.h b/include/dolphin/types.h index ad119905a9..2520cf508c 100644 --- a/include/dolphin/types.h +++ b/include/dolphin/types.h @@ -56,6 +56,12 @@ typedef unsigned int uint; #endif #endif +#if defined(__MWERKS__) +#define __REGISTER register +#else +#define __REGISTER +#endif + #ifndef DECL_WEAK #if defined(__MWERKS__) #define DECL_WEAK __declspec(weak) diff --git a/include/m_Do/m_Do_printf.h b/include/m_Do/m_Do_printf.h index 84d6c080b4..032efe518b 100644 --- a/include/m_Do/m_Do_printf.h +++ b/include/m_Do/m_Do_printf.h @@ -1,7 +1,8 @@ #ifndef M_DO_M_DO_PRINTF_H #define M_DO_M_DO_PRINTF_H -#include "__va_arg.h" +#include +#include "dolphin/types.h" void my_PutString(const char*); void mDoPrintf_vprintf_Interrupt(char const*, va_list); diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/printf.h b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/printf.h index 39e1c83f04..dd233867ef 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/printf.h +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/printf.h @@ -2,7 +2,7 @@ #define _MSL_COMMON_PRINTF_H #include "ansi_files.h" -#include "__va_arg.h" +#include #ifdef __cplusplus extern "C" { @@ -19,4 +19,4 @@ int vprintf(const char* format, va_list arg); } #endif -#endif /* _MSL_COMMON_PRINTF_H */ \ No newline at end of file +#endif /* _MSL_COMMON_PRINTF_H */