From 2588a1f52e30fb828050f60bd5c2ddb3ccbcb9f4 Mon Sep 17 00:00:00 2001 From: SuperDude88 <82904174+SuperDude88@users.noreply.github.com> Date: Fri, 25 Sep 2026 13:57:25 -0400 Subject: [PATCH] __Register Macro Use __Register more consistently when not inside __MWERKS__ guard --- include/JSystem/J3DGraphBase/J3DTransform.h | 8 +- include/JSystem/JMath/JMath.h | 54 ++--- include/dolphin/base/PPCArch.h | 26 +-- include/dolphin/os/OS.h | 18 +- src/JSystem/J3DGraphAnimator/J3DAnimation.cpp | 16 +- src/JSystem/J3DGraphBase/J3DTransform.cpp | 36 ++-- src/d/actor/d_a_movie_player.cpp | 198 +++++++++--------- src/dolphin/gx/GXLight.c | 8 +- src/dolphin/gx/GXTransform.c | 20 +- src/dolphin/os/OS.c | 4 +- src/dolphin/os/OSAlarm.c | 8 +- src/dolphin/os/OSCache.c | 20 +- src/dolphin/os/OSContext.c | 18 +- src/dolphin/os/OSInterrupt.c | 4 +- src/dolphin/os/OSMemory.c | 2 +- src/dolphin/os/OSReboot.c | 2 +- 16 files changed, 221 insertions(+), 221 deletions(-) diff --git a/include/JSystem/J3DGraphBase/J3DTransform.h b/include/JSystem/J3DGraphBase/J3DTransform.h index d6f24affc..30a65c207 100644 --- a/include/JSystem/J3DGraphBase/J3DTransform.h +++ b/include/JSystem/J3DGraphBase/J3DTransform.h @@ -42,7 +42,7 @@ void J3DPSMtx33Copy(Mtx3P src, Mtx3P dst); void J3DPSMtx33CopyFrom34(MtxP src, Mtx3P dst); void J3DPSMtxArrayConcat(Mtx, Mtx, Mtx, u32); -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 @@ -69,7 +69,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 @@ -97,7 +97,7 @@ inline void J3DPSMulMtxVec(register MtxP mtx, register S16Vec* vec, register S16 } // regalloc issues -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 @@ -129,7 +129,7 @@ inline void J3DPSMulMtxVec(register Mtx3P mtx, register Vec* vec, register Vec* } // regalloc issues -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/JMath/JMath.h b/include/JSystem/JMath/JMath.h index ef217058e..a9e08aeba 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -13,8 +13,8 @@ inline f32 JMAFastReciprocal(f32 value) { return __fres(value); } -inline float __frsqrtes(register double f) { - register float out; +inline float __frsqrtes(__REGISTER double f) { + __REGISTER float out; // clang-format off #ifdef __MWERKS__ asm { @@ -25,9 +25,9 @@ inline float __frsqrtes(register double f) { return out; } -inline f32 JMAFastSqrt(register f32 input) { +inline f32 JMAFastSqrt(__REGISTER f32 input) { if (input > 0.0f) { - register f32 out; + __REGISTER f32 out; #ifdef __MWERKS__ asm { frsqrte out, input @@ -45,9 +45,9 @@ inline f32 fastReciprocal(f32 value) { return JMAFastReciprocal(value); } -inline void gekko_ps_copy3(register void* dst, register const void* src) { - register f32 src0; - register f32 src1; +inline void gekko_ps_copy3(__REGISTER void* dst, __REGISTER const void* src) { + __REGISTER f32 src0; + __REGISTER f32 src1; #ifdef __MWERKS__ asm { psq_l src0, 0(src), 0, 0 @@ -58,10 +58,10 @@ 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) { - register f32 src0; - register f32 src1; - register f32 src2; +inline void gekko_ps_copy6(__REGISTER void* dst, __REGISTER const void* src) { + __REGISTER f32 src0; + __REGISTER f32 src1; + __REGISTER f32 src2; #ifdef __MWERKS__ asm { psq_l src0, 0(src), 0, 0 @@ -74,13 +74,13 @@ 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) { - register f32 src0; - register f32 src1; - register f32 src2; - register f32 src3; - register f32 src4; - register f32 src5; +inline void gekko_ps_copy12(__REGISTER void* dst, __REGISTER const void* src) { + __REGISTER f32 src0; + __REGISTER f32 src1; + __REGISTER f32 src2; + __REGISTER f32 src3; + __REGISTER f32 src4; + __REGISTER f32 src5; #ifdef __MWERKS__ asm { psq_l src0, 0(src), 0, 0 @@ -99,15 +99,15 @@ 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) { - register f32 src0; - register f32 src1; - register f32 src2; - register f32 src3; - register f32 src4; - register f32 src5; - register f32 src6; - register f32 src7; +inline void gekko_ps_copy16(__REGISTER void* dst, __REGISTER const void* src) { + __REGISTER f32 src0; + __REGISTER f32 src1; + __REGISTER f32 src2; + __REGISTER f32 src3; + __REGISTER f32 src4; + __REGISTER f32 src5; + __REGISTER f32 src6; + __REGISTER f32 src7; #ifdef __MWERKS__ asm { psq_l src0, 0(src), 0, 0 diff --git a/include/dolphin/base/PPCArch.h b/include/dolphin/base/PPCArch.h index 120ba9225..cacc18c02 100644 --- a/include/dolphin/base/PPCArch.h +++ b/include/dolphin/base/PPCArch.h @@ -467,25 +467,25 @@ typedef union { #endif u32 PPCMfmsr(void); -void PPCMtmsr(register u32 newMSR); +void PPCMtmsr(__REGISTER u32 newMSR); u32 PPCMfhid0(void); -void PPCMthid0(register u32 newHID0); +void PPCMthid0(__REGISTER u32 newHID0); u32 PPCMfl2cr(void); -void PPCMtl2cr(register u32 newL2cr); -void PPCMtdec(register u32 newDec); +void PPCMtl2cr(__REGISTER u32 newL2cr); +void PPCMtdec(__REGISTER u32 newDec); void PPCSync(void); void PPCHalt(void); -void PPCMtmmcr0(register u32 newMmcr0); -void PPCMtmmcr1(register u32 newMmcr1); -void PPCMtpmc1(register u32 newPmc1); -void PPCMtpmc2(register u32 newPmc2); -void PPCMtpmc3(register u32 newPmc3); -void PPCMtpmc4(register u32 newPmc4); +void PPCMtmmcr0(__REGISTER u32 newMmcr0); +void PPCMtmmcr1(__REGISTER u32 newMmcr1); +void PPCMtpmc1(__REGISTER u32 newPmc1); +void PPCMtpmc2(__REGISTER u32 newPmc2); +void PPCMtpmc3(__REGISTER u32 newPmc3); +void PPCMtpmc4(__REGISTER u32 newPmc4); u32 PPCMffpscr(void); -void PPCMtfpscr(register u32 newFPSCR); +void PPCMtfpscr(__REGISTER u32 newFPSCR); u32 PPCMfhid2(void); -void PPCMthid2(register u32 newhid2); -void PPCMtwpar(register u32 newwpar); +void PPCMthid2(__REGISTER u32 newhid2); +void PPCMtwpar(__REGISTER u32 newwpar); void PPCDisableSpeculation(void); void PPCSetFpNonIEEEMode(void); diff --git a/include/dolphin/os/OS.h b/include/dolphin/os/OS.h index f492edb8e..257e5ce54 100644 --- a/include/dolphin/os/OS.h +++ b/include/dolphin/os/OS.h @@ -117,10 +117,10 @@ u32 __OSGetDIConfig(void); void OSRegisterVersion(const char* version); void OSSwitchFiberEx(u32, u32, u32, u32, u32, u32); -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 { @@ -137,10 +137,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 { @@ -157,10 +157,10 @@ inline void OSf32tou8(f32* f, u8* out) { *out = __OSf32tou8(*f); } -inline s8 __OSf32tos8(register f32 inF) { - register u8 out; +inline s8 __OSf32tos8(__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/src/JSystem/J3DGraphAnimator/J3DAnimation.cpp b/src/JSystem/J3DGraphAnimator/J3DAnimation.cpp index c6178bcc9..8f2c88df0 100644 --- a/src/JSystem/J3DGraphAnimator/J3DAnimation.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DAnimation.cpp @@ -330,14 +330,14 @@ f32 J3DHermiteInterpolationS(f32 t, s16* time0, s16* value0, s16* tangent0, s16* return (t1 * kt * kt + (timeRange * *(f32*)tangent0 + t2) * kt + v0) - t2; */ - register f32 p1 = t; - register s16* p2 = time0; - register s16* p3 = value0; - register s16* p4 = tangent0; - register s16* p5 = time1; - register s16* p6 = value1; - register s16* p7 = tangent1; - register f32 fout; + __REGISTER f32 p1 = t; + __REGISTER s16* p2 = time0; + __REGISTER s16* p3 = value0; + __REGISTER s16* p4 = tangent0; + __REGISTER s16* p5 = time1; + __REGISTER s16* p6 = value1; + __REGISTER s16* p7 = tangent1; + __REGISTER f32 fout; #ifdef __MWERKS__ asm { psq_l f0, 0(p2), 0x1, 5 diff --git a/src/JSystem/J3DGraphBase/J3DTransform.cpp b/src/JSystem/J3DGraphBase/J3DTransform.cpp index f882ae1d5..23939434e 100644 --- a/src/JSystem/J3DGraphBase/J3DTransform.cpp +++ b/src/JSystem/J3DGraphBase/J3DTransform.cpp @@ -29,7 +29,7 @@ const Mtx j3dDefaultMtx = { }; /* 802DA0A8-802DA0B0 .text __MTGQR7__FUl */ -void __MTGQR7(register u32 v) { +void __MTGQR7(__REGISTER u32 v) { #ifdef __MWERKS__ asm { mtspr GQR7, v @@ -105,7 +105,7 @@ void J3DCalcYBBoardMtx(Mtx mtx) { } /* 802DA584-802DA64C .text J3DPSCalcInverseTranspose__FPA4_fPA3_f */ -ASM void J3DPSCalcInverseTranspose(register Mtx src, register Mtx33 dst) { +ASM void J3DPSCalcInverseTranspose(__REGISTER Mtx src, __REGISTER Mtx33 dst) { #ifdef __MWERKS__ psq_l f0, 0(src), 1, 0 psq_l f1, 4(src), 0, 0 @@ -311,8 +311,8 @@ void J3DGetTextureMtxMayaOld(const J3DTextureSRTInfo& srt, Mtx dst) { } /* 802DAB04-802DAB68 .text J3DScaleNrmMtx__FPA4_fRC3Vec */ -void J3DScaleNrmMtx(register Mtx mtx, const register Vec& scl) { - register f32 mtx_xy, mtx_z_, scl_xy, scl_z_; +void J3DScaleNrmMtx(__REGISTER Mtx mtx, const __REGISTER Vec& scl) { + __REGISTER f32 mtx_xy, mtx_z_, scl_xy, scl_z_; #ifdef __MWERKS__ asm { @@ -350,11 +350,11 @@ asm { } /* 802DAB68-802DABBC .text J3DScaleNrmMtx33__FPA3_fRC3Vec */ -void J3DScaleNrmMtx33(register Mtx33 mtx, const register Vec& scl) { - register f32 mtx0_xy, mtx0_z_; - register f32 mtx1_xy, mtx1_z_; - register f32 mtx2_xy, mtx2_z_; - register f32 scl__xy, scl__z_; +void J3DScaleNrmMtx33(__REGISTER Mtx33 mtx, const __REGISTER Vec& scl) { + __REGISTER f32 mtx0_xy, mtx0_z_; + __REGISTER f32 mtx1_xy, mtx1_z_; + __REGISTER f32 mtx2_xy, mtx2_z_; + __REGISTER f32 scl__xy, scl__z_; #ifdef __MWERKS__ asm { @@ -383,7 +383,7 @@ asm { } /* 802DABBC-802DACE0 .text J3DMtxProjConcat__FPA4_fPA4_fPA4_f */ -void J3DMtxProjConcat(register Mtx a, register Mtx b, register Mtx dst) { +void J3DMtxProjConcat(__REGISTER Mtx a, __REGISTER Mtx b, __REGISTER Mtx dst) { /* Nonmatching */ #ifdef __MWERKS__ asm { @@ -470,12 +470,12 @@ void J3DMtxProjConcat(register Mtx a, register Mtx b, register Mtx dst) { } /* 802DACE0-802DAD0C .text J3DPSMtx33Copy__FPA3_fPA3_f */ -void J3DPSMtx33Copy(register Mtx3P src, register Mtx3P dst) { - register f32 x1_y1; - register f32 z1_x2; - register f32 y2_z2; - register f32 x3_y3; - register f32 z3; +void J3DPSMtx33Copy(__REGISTER Mtx3P src, __REGISTER Mtx3P dst) { + __REGISTER f32 x1_y1; + __REGISTER f32 z1_x2; + __REGISTER f32 y2_z2; + __REGISTER f32 x3_y3; + __REGISTER f32 z3; #ifdef __MWERKS__ asm { @@ -494,7 +494,7 @@ asm { } /* 802DAD0C-802DAD40 .text J3DPSMtx33CopyFrom34__FPA4_fPA3_f */ -void J3DPSMtx33CopyFrom34(register MtxP src, register Mtx3P dst) { +void J3DPSMtx33CopyFrom34(__REGISTER MtxP src, __REGISTER Mtx3P dst) { #ifdef __MWERKS__ asm { psq_l f0, 0(src), 0, 0 @@ -516,7 +516,7 @@ asm { static f32 Unit01[2] = { 0.0f, 1.0f }; /* 802DAD40-802DAE1C .text J3DPSMtxArrayConcat__FPA4_fPA4_fPA4_fUl */ -ASM void J3DPSMtxArrayConcat(register Mtx mA, register Mtx mB, register Mtx mAB, register u32 count) { +ASM void J3DPSMtxArrayConcat(__REGISTER Mtx mA, __REGISTER Mtx mB, __REGISTER Mtx mAB, __REGISTER u32 count) { #ifdef __MWERKS__ nofralloc diff --git a/src/d/actor/d_a_movie_player.cpp b/src/d/actor/d_a_movie_player.cpp index abf611ebb..7d89a143d 100644 --- a/src/d/actor/d_a_movie_player.cpp +++ b/src/d/actor/d_a_movie_player.cpp @@ -761,7 +761,7 @@ static void __THPDecompressYUV(void* tileY, void* tileU, void* tileV) { /* 000016B0-000016D0 .text __THPGQRRestore */ static void __THPGQRRestore() { - register u32 tmp1, tmp2; + __REGISTER u32 tmp1, tmp2; tmp1 = __THPOldGQR5; tmp2 = __THPOldGQR6; @@ -777,7 +777,7 @@ static void __THPGQRRestore() { /* 000016D0-00001704 .text __THPGQRSetup */ static void __THPGQRSetup() { - register u32 tmp1, tmp2; + __REGISTER u32 tmp1, tmp2; // clang-format off #ifdef __MWERKS__ @@ -868,22 +868,22 @@ static void __THPDecompressiMCURow512x448() { } /* 00001944-00001DE4 .text __THPInverseDCTY8 */ -static void __THPInverseDCTY8(register THPCoeff* in, register u32 xPos) { - register f32 *q, *ws; - register f32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9; - register f32 tmp10, tmp11, tmp12, tmp13; - register f32 tmp20, tmp21, tmp22, tmp23; - register f32 cc4 = 1.414213562F; - register f32 cc2 = 1.847759065F; - register f32 cc2c6s = 1.082392200F; - register f32 cc2c6a = -2.613125930F; - register f32 bias = 1024.0F; +static void __THPInverseDCTY8(__REGISTER THPCoeff* in, __REGISTER u32 xPos) { + __REGISTER f32 *q, *ws; + __REGISTER f32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9; + __REGISTER f32 tmp10, tmp11, tmp12, tmp13; + __REGISTER f32 tmp20, tmp21, tmp22, tmp23; + __REGISTER f32 cc4 = 1.414213562F; + __REGISTER f32 cc2 = 1.847759065F; + __REGISTER f32 cc2c6s = 1.082392200F; + __REGISTER f32 cc2c6a = -2.613125930F; + __REGISTER f32 bias = 1024.0F; q = Gq; ws = &__THPIDCTWorkspace[0] - 2; { - register u32 itmp0, itmp1, itmp2, itmp3; + __REGISTER u32 itmp0, itmp1, itmp2, itmp3; // clang-format off #ifdef __MWERKS__ @@ -1052,11 +1052,11 @@ static void __THPInverseDCTY8(register THPCoeff* in, register u32 xPos) { ws = &__THPIDCTWorkspace[0]; { - register THPSample* obase = Gbase; - register u32 wid = Gwid; + __REGISTER THPSample* obase = Gbase; + __REGISTER u32 wid = Gwid; - register u32 itmp0, off0, off1; - register THPSample *out0, *out1; + __REGISTER u32 itmp0, off0, off1; + __REGISTER THPSample *out0, *out1; // clang-format off #ifdef __MWERKS__ @@ -1183,21 +1183,21 @@ static void __THPInverseDCTY8(register THPCoeff* in, register u32 xPos) { } /* 00001DE4-0000227C .text __THPInverseDCTNoYPos */ -static void __THPInverseDCTNoYPos(register THPCoeff* in, register u32 xPos) { - register f32 *q, *ws; - register f32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9; - register f32 tmp10, tmp11, tmp12, tmp13; - register f32 tmp20, tmp21, tmp22, tmp23; - register f32 cc4 = 1.414213562F; - register f32 cc2 = 1.847759065F; - register f32 cc2c6s = 1.082392200F; - register f32 cc2c6a = -2.613125930F; - register f32 bias = 1024.0F; +static void __THPInverseDCTNoYPos(__REGISTER THPCoeff* in, __REGISTER u32 xPos) { + __REGISTER f32 *q, *ws; + __REGISTER f32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9; + __REGISTER f32 tmp10, tmp11, tmp12, tmp13; + __REGISTER f32 tmp20, tmp21, tmp22, tmp23; + __REGISTER f32 cc4 = 1.414213562F; + __REGISTER f32 cc2 = 1.847759065F; + __REGISTER f32 cc2c6s = 1.082392200F; + __REGISTER f32 cc2c6a = -2.613125930F; + __REGISTER f32 bias = 1024.0F; q = Gq; ws = &__THPIDCTWorkspace[0] - 2; { - register u32 itmp0, itmp1, itmp2, itmp3; + __REGISTER u32 itmp0, itmp1, itmp2, itmp3; // clang-format off #ifdef __MWERKS__ asm { @@ -1365,11 +1365,11 @@ static void __THPInverseDCTNoYPos(register THPCoeff* in, register u32 xPos) { ws = &__THPIDCTWorkspace[0]; { - register THPSample* obase = Gbase; - register u32 wid = Gwid; + __REGISTER THPSample* obase = Gbase; + __REGISTER u32 wid = Gwid; - register u32 itmp0, off0, off1; - register THPSample *out0, *out1; + __REGISTER u32 itmp0, off0, off1; + __REGISTER THPSample *out0, *out1; // clang-format off #ifdef __MWERKS__ @@ -1626,11 +1626,11 @@ static void __THPDecompressiMCURowNxN() { } /* 00002714-00002B20 .text __THPHuffDecodeDCTCompY */ -static void __THPHuffDecodeDCTCompY(register THPFileInfo* info, THPCoeff* block) { +static void __THPHuffDecodeDCTCompY(__REGISTER THPFileInfo* info, THPCoeff* block) { { - register s32 t; + __REGISTER s32 t; THPCoeff dc; - register THPCoeff diff; + __REGISTER THPCoeff diff; __dcbz((void*)block, 0); t = __THPHuffDecodeTab(info, Ydchuff); @@ -1640,13 +1640,13 @@ static void __THPHuffDecodeDCTCompY(register THPFileInfo* info, THPCoeff* block) if (t) { { - register s32 v; - register u32 cb; - register u32 cnt; - register u32 code; - register u32 tmp; - register u32 cnt1; - register u32 tmp1; + __REGISTER s32 v; + __REGISTER u32 cb; + __REGISTER u32 cnt; + __REGISTER u32 code; + __REGISTER u32 tmp; + __REGISTER u32 cnt1; + __REGISTER u32 tmp1; // clang-format off #ifdef __MWERKS__ asm { @@ -1702,13 +1702,13 @@ static void __THPHuffDecodeDCTCompY(register THPFileInfo* info, THPCoeff* block) } { - register s32 k; - register s32 code; - register u32 cnt; - register u32 cb; - register u32 increment; - register s32 tmp; - register THPHuffmanTab* h = Yachuff; + __REGISTER s32 k; + __REGISTER s32 code; + __REGISTER u32 cnt; + __REGISTER u32 cb; + __REGISTER u32 increment; + __REGISTER s32 tmp; + __REGISTER THPHuffmanTab* h = Yachuff; // clang-format off #ifdef __MWERKS__ @@ -1723,8 +1723,8 @@ static void __THPHuffDecodeDCTCompY(register THPFileInfo* info, THPCoeff* block) for (k = 1; k < 64; k++) { - register s32 ssss; - register s32 rrrr; + __REGISTER s32 ssss; + __REGISTER s32 rrrr; // clang-format off #ifdef __MWERKS__ @@ -1746,8 +1746,8 @@ static void __THPHuffDecodeDCTCompY(register THPFileInfo* info, THPCoeff* block) // clang-format on { - register u32 maxcodebase; - register u32 tmp2; + __REGISTER u32 maxcodebase; + __REGISTER u32 tmp2; _FailedCheckEnoughBits: cnt += 5; @@ -1892,8 +1892,8 @@ static void __THPHuffDecodeDCTCompY(register THPFileInfo* info, THPCoeff* block) goto _DoneDecodeTab; _Read4 : { - register u32 maxcodebase = (u32) & (h->maxCode); - register u32 tmp2; + __REGISTER u32 maxcodebase = (u32) & (h->maxCode); + __REGISTER u32 tmp2; // clang-format off #ifdef __MWERKS__ @@ -1925,9 +1925,9 @@ static void __THPHuffDecodeDCTCompY(register THPFileInfo* info, THPCoeff* block) _FailedCheckNoBits0: _FailedCheckNoBits1: _REALFAILEDCHECKNOBITS : { - register u32 mask = 0xFFFFFFFF << (33 - cnt); - register u32 tmp2; - register u32 tmp3; + __REGISTER u32 mask = 0xFFFFFFFF << (33 - cnt); + __REGISTER u32 tmp2; + __REGISTER u32 tmp3; code = (s32)(cb & (~mask)); mask = (u32) & (h->maxCode); @@ -1982,9 +1982,9 @@ static void __THPHuffDecodeDCTCompY(register THPFileInfo* info, THPCoeff* block) { k += ssss; { - register s32 v; - register u32 cnt1; - register u32 tmp1; + __REGISTER s32 v; + __REGISTER u32 cnt1; + __REGISTER u32 tmp1; // clang-format off #ifdef __MWERKS__ asm @@ -2058,12 +2058,12 @@ static void __THPHuffDecodeDCTCompY(register THPFileInfo* info, THPCoeff* block) } /* 00002B20-00002D98 .text __THPHuffDecodeTab */ -static s32 __THPHuffDecodeTab(register THPFileInfo* info, register THPHuffmanTab* h) { - register s32 code; - register u32 cnt; - register s32 cb; - register u32 increment; - register s32 tmp; +static s32 __THPHuffDecodeTab(__REGISTER THPFileInfo* info, __REGISTER THPHuffmanTab* h) { + __REGISTER s32 code; + __REGISTER u32 cnt; + __REGISTER s32 cb; + __REGISTER u32 increment; + __REGISTER s32 tmp; // clang-format off #ifdef __MWERKS__ @@ -2089,8 +2089,8 @@ _done: return code; { - register u32 maxcodebase; - register u32 tmp2; + __REGISTER u32 maxcodebase; + __REGISTER u32 tmp2; _FailedCheckEnoughBits: maxcodebase = (u32) & (h->maxCode); @@ -2197,8 +2197,8 @@ _FCEB_Done: return tmp; _Read4 : { - register u32 maxcodebase = (u32) & (h->maxCode); - register u32 tmp2; + __REGISTER u32 maxcodebase = (u32) & (h->maxCode); + __REGISTER u32 tmp2; // clang-format off #ifdef __MWERKS__ @@ -2275,8 +2275,8 @@ _FailedCheckNoBits0: _FailedCheckNoBits1: { - register u32 mask = 0xFFFFFFFF << (33 - cnt); - register u32 tmp2; + __REGISTER u32 mask = 0xFFFFFFFF << (33 - cnt); + __REGISTER u32 tmp2; code = (s32)(cb & (~mask)); mask = (u32) & (h->maxCode); @@ -2322,20 +2322,20 @@ _FailedCheckNoBits1: } /* 00002D98-00002F80 .text __THPHuffDecodeDCTCompU */ -static void __THPHuffDecodeDCTCompU(register THPFileInfo* info, THPCoeff* block) { - register s32 t; - register THPCoeff diff; +static void __THPHuffDecodeDCTCompU(__REGISTER THPFileInfo* info, THPCoeff* block) { + __REGISTER s32 t; + __REGISTER THPCoeff diff; THPCoeff dc; - register s32 v; - register u32 cb; - register u32 cnt; - register u32 cnt33; - register u32 tmp; - register u32 cnt1; - register u32 tmp1; - register s32 k; - register s32 ssss; - register s32 rrrr; + __REGISTER s32 v; + __REGISTER u32 cb; + __REGISTER u32 cnt; + __REGISTER u32 cnt33; + __REGISTER u32 tmp; + __REGISTER u32 cnt1; + __REGISTER u32 tmp1; + __REGISTER s32 k; + __REGISTER s32 ssss; + __REGISTER s32 rrrr; __dcbz((void*)block, 0); t = __THPHuffDecodeTab(info, Udchuff); @@ -2458,20 +2458,20 @@ static void __THPHuffDecodeDCTCompU(register THPFileInfo* info, THPCoeff* block) } /* 00002F80-00003168 .text __THPHuffDecodeDCTCompV */ -static void __THPHuffDecodeDCTCompV(register THPFileInfo* info, THPCoeff* block) { - register s32 t; - register THPCoeff diff; +static void __THPHuffDecodeDCTCompV(__REGISTER THPFileInfo* info, THPCoeff* block) { + __REGISTER s32 t; + __REGISTER THPCoeff diff; THPCoeff dc; - register s32 v; - register u32 cb; - register u32 cnt; - register u32 cnt33; - register u32 tmp; - register u32 cnt1; - register u32 tmp1; - register s32 k; - register s32 ssss; - register s32 rrrr; + __REGISTER s32 v; + __REGISTER u32 cb; + __REGISTER u32 cnt; + __REGISTER u32 cnt33; + __REGISTER u32 tmp; + __REGISTER u32 cnt1; + __REGISTER u32 tmp1; + __REGISTER s32 k; + __REGISTER s32 ssss; + __REGISTER s32 rrrr; __dcbz((void*)block, 0); t = __THPHuffDecodeTab(info, Vdchuff); diff --git a/src/dolphin/gx/GXLight.c b/src/dolphin/gx/GXLight.c index 3ab5e37c0..5f8f9fd60 100644 --- a/src/dolphin/gx/GXLight.c +++ b/src/dolphin/gx/GXLight.c @@ -129,10 +129,10 @@ void GXInitLightColor(GXLightObj* obj, GXColor color) { *(u32*)&obj->color = *(u32*)&color; } -static inline void PushLight(const register GXLightObj* lt_obj, register void* dest) { - register u32 zero, color; - register f32 a0_a1, a2_k0, k1_k2; - register f32 px_py, pz_dx, dy_dz; +static inline void PushLight(const __REGISTER GXLightObj* lt_obj, __REGISTER void* dest) { + __REGISTER u32 zero, color; + __REGISTER f32 a0_a1, a2_k0, k1_k2; + __REGISTER f32 px_py, pz_dx, dy_dz; #ifdef __MWERKS__ // clang-format off asm { lwz color, 12(lt_obj) diff --git a/src/dolphin/gx/GXTransform.c b/src/dolphin/gx/GXTransform.c index dba3024d9..5d7e4e9e8 100644 --- a/src/dolphin/gx/GXTransform.c +++ b/src/dolphin/gx/GXTransform.c @@ -2,8 +2,8 @@ #include "dolphin/gx/GX.h" #include "dolphin/gx/GXInit.h" -static void Copy6Floats(register f32 src[6], register f32 dst[6]) { - register f32 ps_0, ps_1, ps_2; +static void Copy6Floats(__REGISTER f32 src[6], __REGISTER f32 dst[6]) { + __REGISTER f32 ps_0, ps_1, ps_2; // clang-format off #ifdef __MWERKS__ @@ -19,8 +19,8 @@ static void Copy6Floats(register f32 src[6], register f32 dst[6]) { // clang-format on } -static void WriteProjPS(const register f32 src[6], register volatile void* dst) { - register f32 ps_0, ps_1, ps_2; +static void WriteProjPS(const __REGISTER f32 src[6], __REGISTER volatile void* dst) { + __REGISTER f32 ps_0, ps_1, ps_2; // clang-format off #ifdef __MWERKS__ @@ -133,8 +133,8 @@ void GXGetProjectionv(f32* proj) { proj[6] = gx->projMtx[5]; } -static void WriteMTXPS4x3(register volatile void* dst, register const Mtx src) { - register f32 ps_0, ps_1, ps_2, ps_3, ps_4, ps_5; +static void WriteMTXPS4x3(__REGISTER volatile void* dst, __REGISTER const Mtx src) { + __REGISTER f32 ps_0, ps_1, ps_2, ps_3, ps_4, ps_5; // clang-format off #ifdef __MWERKS__ @@ -162,8 +162,8 @@ void GXLoadPosMtxImm(Mtx mtx, u32 id) { WriteMTXPS4x3(&GXFIFO, mtx); } -static void WriteMTXPS3x3(register volatile void* dst, register const Mtx src) { - register f32 ps_0, ps_1, ps_2, ps_3, ps_4, ps_5; +static void WriteMTXPS3x3(__REGISTER volatile void* dst, __REGISTER const Mtx src) { + __REGISTER f32 ps_0, ps_1, ps_2, ps_3, ps_4, ps_5; // clang-format off #ifdef __MWERKS__ @@ -196,8 +196,8 @@ void GXSetCurrentMtx(u32 id) { __GXSetMatrixIndex(GX_VA_PNMTXIDX); } -static void WriteMTXPS4x2(register volatile void* dst, register const Mtx src) { - register f32 ps_0, ps_1, ps_2, ps_3; +static void WriteMTXPS4x2(__REGISTER volatile void* dst, __REGISTER const Mtx src) { + __REGISTER f32 ps_0, ps_1, ps_2, ps_3; // clang-format off #ifdef __MWERKS__ diff --git a/src/dolphin/os/OS.c b/src/dolphin/os/OS.c index b3bf6e5f5..d1d516116 100644 --- a/src/dolphin/os/OS.c +++ b/src/dolphin/os/OS.c @@ -581,8 +581,8 @@ entry __OSEVEnd #endif } -static ASM void OSDefaultExceptionHandler(register __OSException exception, - register OSContext* context) { +static ASM void OSDefaultExceptionHandler(__REGISTER __OSException exception, + __REGISTER OSContext* context) { #ifdef __MWERKS__ // clang-format off nofralloc diff --git a/src/dolphin/os/OSAlarm.c b/src/dolphin/os/OSAlarm.c index 1988f1f75..fee59ff93 100644 --- a/src/dolphin/os/OSAlarm.c +++ b/src/dolphin/os/OSAlarm.c @@ -130,8 +130,8 @@ void OSCancelAlarm(OSAlarm* alarm) { OSRestoreInterrupts(enabled); } -static void DecrementerExceptionCallback(register __OSException exception, - register OSContext* context) { +static void DecrementerExceptionCallback(__REGISTER __OSException exception, + __REGISTER OSContext* context) { OSAlarm* alarm; OSAlarm* next; OSAlarmHandler handler; @@ -177,8 +177,8 @@ static void DecrementerExceptionCallback(register __OSException exception, OSLoadContext(context); } -static ASM void DecrementerExceptionHandler(register __OSException exception, - register OSContext* context) { +static ASM void DecrementerExceptionHandler(__REGISTER __OSException exception, + __REGISTER OSContext* context) { #ifdef __MWERKS__ // clang-format off nofralloc diff --git a/src/dolphin/os/OSCache.c b/src/dolphin/os/OSCache.c index 99a41efb2..26a9dd539 100644 --- a/src/dolphin/os/OSCache.c +++ b/src/dolphin/os/OSCache.c @@ -18,7 +18,7 @@ static ASM void DCEnable(void) { // clang-format on } -ASM void DCInvalidateRange(register void* start, register u32 nBytes) { +ASM void DCInvalidateRange(__REGISTER void* start, __REGISTER u32 nBytes) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -42,7 +42,7 @@ do_invalidate: // clang-format on } -ASM void DCFlushRange(register void* start, register u32 nBytes) { +ASM void DCFlushRange(__REGISTER void* start, __REGISTER u32 nBytes) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -67,7 +67,7 @@ do_flush: // clang-format on } -ASM void DCStoreRange(register void* start, register u32 nBytes) { +ASM void DCStoreRange(__REGISTER void* start, __REGISTER u32 nBytes) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -92,7 +92,7 @@ do_store: // clang-format on } -ASM void DCFlushRangeNoSync(register void* start, register u32 nBytes) { +ASM void DCFlushRangeNoSync(__REGISTER void* start, __REGISTER u32 nBytes) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -116,7 +116,7 @@ do_flush: // clang-format on } -ASM void DCStoreRangeNoSync(register void* start, register u32 nBytes) { +ASM void DCStoreRangeNoSync(__REGISTER void* start, __REGISTER u32 nBytes) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -140,7 +140,7 @@ do_store: // clang-format on } -ASM void DCZeroRange(register void* start, register u32 nBytes) { +ASM void DCZeroRange(__REGISTER void* start, __REGISTER u32 nBytes) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -164,7 +164,7 @@ do_zero: // clang-format on } -ASM void ICInvalidateRange(register void* start, register u32 nBytes) { +ASM void ICInvalidateRange(__REGISTER void* start, __REGISTER u32 nBytes) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -318,8 +318,8 @@ do_invalidate: // clang-format on } -static ASM void LCStoreBlocks(register void* destAddr, register void* srcAddr, - register u32 blockNum){ +static ASM void LCStoreBlocks(__REGISTER void* destAddr, __REGISTER void* srcAddr, + __REGISTER u32 blockNum){ // clang-format off #ifdef __MWERKS__ nofralloc @@ -359,7 +359,7 @@ u32 LCStoreData(void* destAddr, void* srcAddr, u32 nBytes) { return ret; } -ASM void LCQueueWait(register u32 len) { +ASM void LCQueueWait(__REGISTER u32 len) { // clang-format off #ifdef __MWERKS__ nofralloc diff --git a/src/dolphin/os/OSContext.c b/src/dolphin/os/OSContext.c index 9965d875e..e8b583982 100644 --- a/src/dolphin/os/OSContext.c +++ b/src/dolphin/os/OSContext.c @@ -6,7 +6,7 @@ volatile OSContext* __OSCurrentContext AT_ADDRESS(OS_BASE_CACHED | 0x00D4); volatile OSContext* __OSFPUContext AT_ADDRESS(OS_BASE_CACHED | 0x00D8); -ASM void __OSLoadFPUContext(s32 unused0, register OSContext* context) { +ASM void __OSLoadFPUContext(s32 unused0, __REGISTER OSContext* context) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -94,7 +94,7 @@ exit: // clang-format on } -ASM void __OSSaveFPUContext(s32 unused0, s32 unused1, register OSContext* context) { +ASM void __OSSaveFPUContext(s32 unused0, s32 unused1, __REGISTER OSContext* context) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -182,7 +182,7 @@ exit: // clang-format on } -ASM void OSSaveFPUContext(register OSContext* context) { +ASM void OSSaveFPUContext(__REGISTER OSContext* context) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -193,7 +193,7 @@ ASM void OSSaveFPUContext(register OSContext* context) { // clang-format on } -ASM void OSSetCurrentContext(register OSContext* context) { +ASM void OSSetCurrentContext(__REGISTER OSContext* context) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -231,7 +231,7 @@ OSContext* OSGetCurrentContext(void) { return OS_CURRENT_CONTEXT; } -ASM u32 OSSaveContext(register OSContext* context) { +ASM u32 OSSaveContext(__REGISTER OSContext* context) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -277,7 +277,7 @@ ASM u32 OSSaveContext(register OSContext* context) { // clang-format on } -ASM void OSLoadContext(register OSContext* context) { +ASM void OSLoadContext(__REGISTER OSContext* context) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -366,7 +366,7 @@ void OSClearContext(OSContext* context) { } } -ASM void OSInitContext(register OSContext* context, register u32 srr0, register u32 stack) { +ASM void OSInitContext(__REGISTER OSContext* context, __REGISTER u32 srr0, __REGISTER u32 stack) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -475,7 +475,7 @@ void OSDumpContext(OSContext* context) { } } -static ASM void OSSwitchFPUContext(register u8 err, register OSContext* context) { +static ASM void OSSwitchFPUContext(__REGISTER u8 err, __REGISTER OSContext* context) { // clang-format off #ifdef __MWERKS__ nofralloc @@ -527,7 +527,7 @@ void __OSContextInit(void) { DBPrintf("FPU-unavailable handler installed\n"); } -ASM void OSFillFPUContext(register OSContext* context) { +ASM void OSFillFPUContext(__REGISTER OSContext* context) { // clang-format off #ifdef __MWERKS__ nofralloc diff --git a/src/dolphin/os/OSInterrupt.c b/src/dolphin/os/OSInterrupt.c index e3fe7ce08..3a89d0965 100644 --- a/src/dolphin/os/OSInterrupt.c +++ b/src/dolphin/os/OSInterrupt.c @@ -45,7 +45,7 @@ ASM BOOL OSEnableInterrupts(void) { #endif } -ASM BOOL OSRestoreInterrupts(register BOOL status) { +ASM BOOL OSRestoreInterrupts(__REGISTER BOOL status) { #ifdef __MWERKS__ // clang-format off nofralloc @@ -407,7 +407,7 @@ void __OSDispatchInterrupt(__OSException exception, OSContext* context) { OSLoadContext(context); } -static ASM void ExternalInterruptHandler(register __OSInterrupt type, register OSContext* context) { +static ASM void ExternalInterruptHandler(__REGISTER __OSInterrupt type, __REGISTER OSContext* context) { #ifdef __MWERKS__ // clang-format off nofralloc diff --git a/src/dolphin/os/OSMemory.c b/src/dolphin/os/OSMemory.c index efe5b6766..a4df388b3 100644 --- a/src/dolphin/os/OSMemory.c +++ b/src/dolphin/os/OSMemory.c @@ -155,7 +155,7 @@ static ASM void Config48MB(void) { // clang-format on } -static ASM void RealMode(register u32 config) { +static ASM void RealMode(__REGISTER u32 config) { // clang-format off #ifdef __MWERKS__ nofralloc diff --git a/src/dolphin/os/OSReboot.c b/src/dolphin/os/OSReboot.c index 2a3af285d..825da2082 100644 --- a/src/dolphin/os/OSReboot.c +++ b/src/dolphin/os/OSReboot.c @@ -22,7 +22,7 @@ typedef struct _ApploaderHeader { static ApploaderHeader Header ALIGN_DECL(32); -ASM static void Run(register u32 addr) { +ASM static void Run(__REGISTER u32 addr) { nofralloc sync