diff --git a/.clangd b/.clangd index a8c07d67..a9539102 100644 --- a/.clangd +++ b/.clangd @@ -13,6 +13,7 @@ CompileFlags: "-Wunused-parameter", "-Wunused-but-set-parameter", "-Wself-assign", + "-D__CLANGD__", ] Diagnostics: Suppress: diff --git a/config/eur/arm9/itcm/symbols.txt b/config/eur/arm9/itcm/symbols.txt index 2ec269eb..1346f5fe 100644 --- a/config/eur/arm9/itcm/symbols.txt +++ b/config/eur/arm9/itcm/symbols.txt @@ -52,36 +52,36 @@ func_01ff9ec4 kind:function(arm,size=0x30) addr:0x01ff9ec4 func_01ff9ef4 kind:function(arm,size=0x10) addr:0x01ff9ef4 func_01ff9f04 kind:function(arm,size=0x10) addr:0x01ff9f04 func_01ff9f14 kind:function(arm,size=0x24) addr:0x01ff9f14 -Mat2p_InitIdentity kind:function(arm,size=0x18) addr:0x01ff9f38 +MtxFx22_InitIdentity kind:function(arm,size=0x18) addr:0x01ff9f38 func_01ff9f50 kind:function(thumb,size=0xc) addr:0x01ff9f50 -Mat2p_InitRotation kind:function(thumb,size=0xc) addr:0x01ff9f5c +MtxFx22_InitRotation kind:function(thumb,size=0xc) addr:0x01ff9f5c func_01ff9f68 kind:function(arm,size=0x54) addr:0x01ff9f68 func_01ff9fbc kind:function(arm,size=0xb0) addr:0x01ff9fbc -Mat3p_InitIdentity kind:function(arm,size=0x24) addr:0x01ffa06c -Mat3p_CopyToMat4x3p kind:function(arm,size=0x2c) addr:0x01ffa090 +MtxFx33_InitIdentity kind:function(arm,size=0x24) addr:0x01ffa06c +MtxFx33_CopyToMtxFx43 kind:function(arm,size=0x2c) addr:0x01ffa090 func_01ffa0bc kind:function(arm,size=0xc8) addr:0x01ffa0bc -Mat3p_InitXRotation kind:function(thumb,size=0x1c) addr:0x01ffa184 -Mat3p_InitYRotation kind:function(thumb,size=0x1c) addr:0x01ffa1a0 -Mat3p_InitZRotation kind:function(thumb,size=0x18) addr:0x01ffa1bc -Mat3p_func_01ff8248 kind:function(arm,size=0x154) addr:0x01ffa1d4 +MtxFx33_InitXRotation kind:function(thumb,size=0x1c) addr:0x01ffa184 +MtxFx33_InitYRotation kind:function(thumb,size=0x1c) addr:0x01ffa1a0 +MtxFx33_InitZRotation kind:function(thumb,size=0x18) addr:0x01ffa1bc +MtxFx33_func_01ff8248 kind:function(arm,size=0x154) addr:0x01ffa1d4 func_01ffa328 kind:function(arm,size=0x2e4) addr:0x01ffa328 func_01ffa60c kind:function(arm,size=0x194) addr:0x01ffa60c func_01ffa7a0 kind:function(arm,size=0x7c) addr:0x01ffa7a0 -Mat4x3p_InitIdentity kind:function(arm,size=0x28) addr:0x01ffa81c -Mat4x3p_CopyToMat4p kind:function(arm,size=0x34) addr:0x01ffa844 -Mat4x3p_func_01ff8988 kind:function(arm,size=0xac) addr:0x01ffa878 -Mat4x3p_InitScale kind:function(thumb,size=0x16) addr:0x01ffa924 +MtxFx43_InitIdentity kind:function(arm,size=0x28) addr:0x01ffa81c +MtxFx43_CopyToMtxFx44 kind:function(arm,size=0x34) addr:0x01ffa844 +MtxFx43_func_01ff8988 kind:function(arm,size=0xac) addr:0x01ffa878 +MtxFx43_InitScale kind:function(thumb,size=0x16) addr:0x01ffa924 func_01ffa93c kind:function(arm,size=0x34) addr:0x01ffa93c -Mat4x3p_InitXRotation kind:function(thumb,size=0x1e) addr:0x01ffa970 -Mat4x3p_InitYRotation kind:function(thumb,size=0x1a) addr:0x01ffa990 -Mat4x3p_InitZRotation kind:function(thumb,size=0x1a) addr:0x01ffa9ac -Mat4x3p_func_01ff8ad8 kind:function(arm,size=0x20) addr:0x01ffa9c8 +MtxFx43_InitXRotation kind:function(thumb,size=0x1e) addr:0x01ffa970 +MtxFx43_InitYRotation kind:function(thumb,size=0x1a) addr:0x01ffa990 +MtxFx43_InitZRotation kind:function(thumb,size=0x1a) addr:0x01ffa9ac +MtxFx43_func_01ff8ad8 kind:function(arm,size=0x20) addr:0x01ffa9c8 func_01ffa9e8 kind:function(arm,size=0x374) addr:0x01ffa9e8 func_01ffad5c kind:function(arm,size=0x218) addr:0x01ffad5c func_01ffaf74 kind:function(arm,size=0x98) addr:0x01ffaf74 -Mat4p_InitIdentity kind:function(arm,size=0x2c) addr:0x01ffb00c -Mat4p_CopyToMat4x3p kind:function(arm,size=0x34) addr:0x01ffb038 -Mat4p_Multiply kind:function(arm,size=0x3bc) addr:0x01ffb06c +MtxFx44_InitIdentity kind:function(arm,size=0x2c) addr:0x01ffb00c +MtxFx44_CopyToMtxFx43 kind:function(arm,size=0x34) addr:0x01ffb038 +MtxFx44_Multiply kind:function(arm,size=0x3bc) addr:0x01ffb06c func_01ffb428 kind:function(arm,size=0x10) addr:0x01ffb428 func_01ffb438 kind:function(arm,size=0x2c) addr:0x01ffb438 func_01ffb464 kind:function(arm,size=0x10) addr:0x01ffb464 diff --git a/config/eur/arm9/overlays/ov000/symbols.txt b/config/eur/arm9/overlays/ov000/symbols.txt index 15c9482f..c30518b7 100644 --- a/config/eur/arm9/overlays/ov000/symbols.txt +++ b/config/eur/arm9/overlays/ov000/symbols.txt @@ -109,8 +109,8 @@ _ZN11ModelRender19func_ov000_02057d3cEP18G3d_BoneMtxStruct_ kind:function(arm,si func_ov000_02057d6c kind:function(arm,size=0x18) addr:0x02057d6c _ZN11ModelRender8vfunc_20Ev kind:function(arm,size=0x18) addr:0x02057d84 _ZN11ModelRender19func_ov000_02057d9cEv kind:function(arm,size=0x2c) addr:0x02057d9c -_ZN11ModelRender8vfunc_10EP7VecFx32P5Mat3pS1_ kind:function(arm,size=0x7c) addr:0x02057dc8 -_ZN11ModelRender8vfunc_14EP5Mat3pP7VecFx32 kind:function(arm,size=0x64) addr:0x02057e44 +_ZN11ModelRender8vfunc_10EP7VecFx32P7MtxFx33S1_ kind:function(arm,size=0x7c) addr:0x02057dc8 +_ZN11ModelRender8vfunc_14EP7MtxFx33P7VecFx32 kind:function(arm,size=0x64) addr:0x02057e44 _ZN11ModelRender8vfunc_18EP7VecFx32 kind:function(arm,size=0x1c) addr:0x02057ea8 _ZN15ModelRenderBaseD1Ev kind:function(thumb,size=0x2) addr:0x02057ec4 _ZN15ModelRenderBaseD0Ev kind:function(thumb,size=0xc) addr:0x02057ec8 diff --git a/config/eur/arm9/overlays/ov024/symbols.txt b/config/eur/arm9/overlays/ov024/symbols.txt index 9c1361f1..478120d5 100644 --- a/config/eur/arm9/overlays/ov024/symbols.txt +++ b/config/eur/arm9/overlays/ov024/symbols.txt @@ -661,7 +661,7 @@ _ZN12CargoManager19func_ov024_020d591cEv kind:function(arm,size=0x1c) addr:0x020 _ZN15UnkTrainSystem2C1Ev kind:function(arm,size=0x40) addr:0x020d5938 _ZN15UnkTrainSystem2D1Ev kind:function(arm,size=0x18) addr:0x020d5978 _ZN15UnkTrainSystem219func_ov024_020d5990Ev kind:function(arm,size=0x16c) addr:0x020d5990 -_ZN15UnkTrainSystem219func_ov024_020d5afcEPK5Mat3pPK7VecFx32i kind:function(arm,size=0x144) addr:0x020d5afc +_ZN15UnkTrainSystem219func_ov024_020d5afcEPK7MtxFx33PK7VecFx32i kind:function(arm,size=0x144) addr:0x020d5afc _ZN15UnkTrainSystem219func_ov024_020d5c40Ev kind:function(arm,size=0x4c) addr:0x020d5c40 _ZN18UnkStruct_027e0d08C1Ev kind:function(arm,size=0x44) addr:0x020d5c8c _ZN18UnkStruct_027e0d08D1Ev kind:function(arm,size=0x1c) addr:0x020d5cd0 diff --git a/config/eur/arm9/overlays/ov031/symbols.txt b/config/eur/arm9/overlays/ov031/symbols.txt index 5701fe73..9d68878d 100644 --- a/config/eur/arm9/overlays/ov031/symbols.txt +++ b/config/eur/arm9/overlays/ov031/symbols.txt @@ -498,7 +498,7 @@ _ZN12ActorUnkSWBM19func_ov031_020e6d80Ei kind:function(arm,size=0x104) addr:0x02 _ZN12ActorUnkSWBM19func_ov031_020e6e84Es kind:function(arm,size=0x74) addr:0x020e6e84 _ZN12ActorUnkSWBM6UpdateEv kind:function(arm,size=0x268) addr:0x020e6ef8 _ZN12ActorUnkSWBM8vfunc_24Ev kind:function(arm,size=0x2c) addr:0x020e7160 -_ZN12ActorUnkSWBM19func_ov031_020e718cEP7VecFx32P5Mat3pists kind:function(arm,size=0x108) addr:0x020e718c +_ZN12ActorUnkSWBM19func_ov031_020e718cEP7VecFx32P7MtxFx33ists kind:function(arm,size=0x108) addr:0x020e718c _ZN12ActorUnkSWBM8vfunc_2CEP14Actor_vfunc_30 kind:function(arm,size=0x40) addr:0x020e7294 _ZN15ActorUnkSWBM_94D0Ev kind:function(arm,size=0x1c) addr:0x020e72d4 _ZN15ActorUnkSWBM_98D0Ev kind:function(arm,size=0x1c) addr:0x020e72f0 @@ -902,9 +902,9 @@ _ZN14ActorShotArrow19func_ov031_020f2214Ev kind:function(arm,size=0x5c) addr:0x0 _ZN14ActorShotArrow19func_ov031_020f2270Ev kind:function(arm,size=0x10) addr:0x020f2270 _ZN14ActorShotArrow19func_ov031_020f2280Ev kind:function(arm,size=0x1c) addr:0x020f2280 _ZN14ActorShotArrow19func_ov031_020f229cEv kind:function(arm,size=0x38) addr:0x020f229c -_ZN14ActorShotArrow19func_ov031_020f22d4EP5Mat3pP7VecFx32 kind:function(arm,size=0x3c) addr:0x020f22d4 +_ZN14ActorShotArrow19func_ov031_020f22d4EP7MtxFx33P7VecFx32 kind:function(arm,size=0x3c) addr:0x020f22d4 _ZN14ActorShotArrow8vfunc_2CEP14Actor_vfunc_30 kind:function(arm,size=0x344) addr:0x020f2310 -_ZN14ActorShotArrow19func_ov031_020f2654EP5Mat3p kind:function(arm,size=0x140) addr:0x020f2654 +_ZN14ActorShotArrow19func_ov031_020f2654EP7MtxFx33 kind:function(arm,size=0x140) addr:0x020f2654 _ZN14ActorShotArrow19func_ov031_020f2794Es kind:function(arm,size=0x118) addr:0x020f2794 _ZN14ActorShotArrow19func_ov031_020f28acEv kind:function(arm,size=0x2e0) addr:0x020f28ac _ZN14ActorShotArrow19func_ov031_020f2b8cEv kind:function(arm,size=0x30) addr:0x020f2b8c @@ -916,7 +916,7 @@ _ZN14ActorShotArrow19func_ov031_020f2ef0Ev kind:function(arm,size=0x6c) addr:0x0 _ZN14ActorShotArrow19func_ov031_020f2f5cEP7VecFx32 kind:function(arm,size=0x40) addr:0x020f2f5c _ZN14ActorShotArrow19func_ov031_020f2f9cEv kind:function(arm,size=0x64) addr:0x020f2f9c _ZN14ActorShotArrow19func_ov031_020f3000Ev kind:function(arm,size=0x11c) addr:0x020f3000 -_ZN14ActorShotArrow19func_ov031_020f311cEP7Mat4x3p kind:function(arm,size=0xf4) addr:0x020f311c +_ZN14ActorShotArrow19func_ov031_020f311cEP7MtxFx43 kind:function(arm,size=0xf4) addr:0x020f311c _ZN14ActorShotArrow19func_ov031_020f3210Et kind:function(arm,size=0x48) addr:0x020f3210 _ZN14ActorShotArrow19func_ov031_020f3258Et kind:function(arm,size=0x30) addr:0x020f3258 _ZN18ActorShotArrow_178C1EP14ActorShotArrow kind:function(arm,size=0x3c) addr:0x020f3288 diff --git a/config/eur/arm9/overlays/ov084/symbols.txt b/config/eur/arm9/overlays/ov084/symbols.txt index a7819a25..316012db 100644 --- a/config/eur/arm9/overlays/ov084/symbols.txt +++ b/config/eur/arm9/overlays/ov084/symbols.txt @@ -38,7 +38,7 @@ _ZN12ActorUnkIWTS19func_ov084_02152cecEv kind:function(arm,size=0x24) addr:0x021 _ZN12ActorUnkIWTS19func_ov084_02152d10Ev kind:function(arm,size=0x180) addr:0x02152d10 _ZN12ActorUnkIWTSD0Ev kind:function(arm,size=0x188) addr:0x02152e90 _ZN12ActorUnkIWTS19func_ov084_02153018Ev kind:function(arm,size=0x4c) addr:0x02153018 -_ZN12ActorUnkIWTS19func_ov084_02153064EP8ActorRefPP7Mat4x3p kind:function(arm,size=0x70) addr:0x02153064 +_ZN12ActorUnkIWTS19func_ov084_02153064EP8ActorRefPP7MtxFx43 kind:function(arm,size=0x70) addr:0x02153064 _ZN12ActorUnkIWTS19func_ov084_021530d4Ev kind:function(arm,size=0x88) addr:0x021530d4 _ZN12ActorUnkIWTS19func_ov084_0215315cEv kind:function(arm,size=0x38) addr:0x0215315c _ZN12ActorUnkIWTS19func_ov084_02153194Ev kind:function(arm,size=0x50) addr:0x02153194 diff --git a/config/eur/arm9/overlays/ov102/symbols.txt b/config/eur/arm9/overlays/ov102/symbols.txt index d07705d6..60bd5421 100644 --- a/config/eur/arm9/overlays/ov102/symbols.txt +++ b/config/eur/arm9/overlays/ov102/symbols.txt @@ -1,5 +1,5 @@ -_ZN18PlayerActorBase_7419func_ov102_02182c20EiP7Mat4x3p kind:function(arm,size=0x64) addr:0x02182c20 -_ZN18PlayerActorBase_7419func_ov102_02182c84Ebi14UnkAngleStructP7Mat4x3pS2_ kind:function(arm,size=0x1d0) addr:0x02182c84 +_ZN18PlayerActorBase_7419func_ov102_02182c20EiP7MtxFx43 kind:function(arm,size=0x64) addr:0x02182c20 +_ZN18PlayerActorBase_7419func_ov102_02182c84Ebi14UnkAngleStructP7MtxFx43S2_ kind:function(arm,size=0x1d0) addr:0x02182c84 _ZN25UnkStruct_027e0ce0_40_10819func_ov102_02182e54EiP7VecFx32i kind:function(arm,size=0x154) addr:0x02182e54 _ZN24UnkStruct_ItemManager_2019func_ov102_02182fa8Ebb kind:function(arm,size=0x54) addr:0x02182fa8 _ZN24UnkStruct_ItemManager_2019func_ov102_02182ffcEPv kind:function(arm,size=0x40) addr:0x02182ffc diff --git a/config/eur/arm9/symbols.txt b/config/eur/arm9/symbols.txt index 7c5d7f90..8d28b24b 100644 --- a/config/eur/arm9/symbols.txt +++ b/config/eur/arm9/symbols.txt @@ -1570,7 +1570,7 @@ OS_func_0095 kind:function(arm,size=0x10) addr:0x02027fb8 OS_func_0096 kind:function(arm,size=0xec) addr:0x02027fc8 OS_func_0097 kind:function(thumb,size=0x24) addr:0x020280b4 OS_func_0098 kind:function(arm,size=0x14) addr:0x020280d8 -OS_DisableInterrupts_Irq kind:function(arm,size=0x14) addr:0x020280ec +OS_DisableInterrupts kind:function(arm,size=0x14) addr:0x020280ec OS_RestoreInterrupts kind:function(arm,size=0x18) addr:0x02028100 OS_func_0099 kind:function(arm,size=0x14) addr:0x02028118 OS_func_0100 kind:function(arm,size=0x18) addr:0x0202812c diff --git a/config/eur1/arm9/itcm/symbols.txt b/config/eur1/arm9/itcm/symbols.txt index 2ec269eb..1346f5fe 100644 --- a/config/eur1/arm9/itcm/symbols.txt +++ b/config/eur1/arm9/itcm/symbols.txt @@ -52,36 +52,36 @@ func_01ff9ec4 kind:function(arm,size=0x30) addr:0x01ff9ec4 func_01ff9ef4 kind:function(arm,size=0x10) addr:0x01ff9ef4 func_01ff9f04 kind:function(arm,size=0x10) addr:0x01ff9f04 func_01ff9f14 kind:function(arm,size=0x24) addr:0x01ff9f14 -Mat2p_InitIdentity kind:function(arm,size=0x18) addr:0x01ff9f38 +MtxFx22_InitIdentity kind:function(arm,size=0x18) addr:0x01ff9f38 func_01ff9f50 kind:function(thumb,size=0xc) addr:0x01ff9f50 -Mat2p_InitRotation kind:function(thumb,size=0xc) addr:0x01ff9f5c +MtxFx22_InitRotation kind:function(thumb,size=0xc) addr:0x01ff9f5c func_01ff9f68 kind:function(arm,size=0x54) addr:0x01ff9f68 func_01ff9fbc kind:function(arm,size=0xb0) addr:0x01ff9fbc -Mat3p_InitIdentity kind:function(arm,size=0x24) addr:0x01ffa06c -Mat3p_CopyToMat4x3p kind:function(arm,size=0x2c) addr:0x01ffa090 +MtxFx33_InitIdentity kind:function(arm,size=0x24) addr:0x01ffa06c +MtxFx33_CopyToMtxFx43 kind:function(arm,size=0x2c) addr:0x01ffa090 func_01ffa0bc kind:function(arm,size=0xc8) addr:0x01ffa0bc -Mat3p_InitXRotation kind:function(thumb,size=0x1c) addr:0x01ffa184 -Mat3p_InitYRotation kind:function(thumb,size=0x1c) addr:0x01ffa1a0 -Mat3p_InitZRotation kind:function(thumb,size=0x18) addr:0x01ffa1bc -Mat3p_func_01ff8248 kind:function(arm,size=0x154) addr:0x01ffa1d4 +MtxFx33_InitXRotation kind:function(thumb,size=0x1c) addr:0x01ffa184 +MtxFx33_InitYRotation kind:function(thumb,size=0x1c) addr:0x01ffa1a0 +MtxFx33_InitZRotation kind:function(thumb,size=0x18) addr:0x01ffa1bc +MtxFx33_func_01ff8248 kind:function(arm,size=0x154) addr:0x01ffa1d4 func_01ffa328 kind:function(arm,size=0x2e4) addr:0x01ffa328 func_01ffa60c kind:function(arm,size=0x194) addr:0x01ffa60c func_01ffa7a0 kind:function(arm,size=0x7c) addr:0x01ffa7a0 -Mat4x3p_InitIdentity kind:function(arm,size=0x28) addr:0x01ffa81c -Mat4x3p_CopyToMat4p kind:function(arm,size=0x34) addr:0x01ffa844 -Mat4x3p_func_01ff8988 kind:function(arm,size=0xac) addr:0x01ffa878 -Mat4x3p_InitScale kind:function(thumb,size=0x16) addr:0x01ffa924 +MtxFx43_InitIdentity kind:function(arm,size=0x28) addr:0x01ffa81c +MtxFx43_CopyToMtxFx44 kind:function(arm,size=0x34) addr:0x01ffa844 +MtxFx43_func_01ff8988 kind:function(arm,size=0xac) addr:0x01ffa878 +MtxFx43_InitScale kind:function(thumb,size=0x16) addr:0x01ffa924 func_01ffa93c kind:function(arm,size=0x34) addr:0x01ffa93c -Mat4x3p_InitXRotation kind:function(thumb,size=0x1e) addr:0x01ffa970 -Mat4x3p_InitYRotation kind:function(thumb,size=0x1a) addr:0x01ffa990 -Mat4x3p_InitZRotation kind:function(thumb,size=0x1a) addr:0x01ffa9ac -Mat4x3p_func_01ff8ad8 kind:function(arm,size=0x20) addr:0x01ffa9c8 +MtxFx43_InitXRotation kind:function(thumb,size=0x1e) addr:0x01ffa970 +MtxFx43_InitYRotation kind:function(thumb,size=0x1a) addr:0x01ffa990 +MtxFx43_InitZRotation kind:function(thumb,size=0x1a) addr:0x01ffa9ac +MtxFx43_func_01ff8ad8 kind:function(arm,size=0x20) addr:0x01ffa9c8 func_01ffa9e8 kind:function(arm,size=0x374) addr:0x01ffa9e8 func_01ffad5c kind:function(arm,size=0x218) addr:0x01ffad5c func_01ffaf74 kind:function(arm,size=0x98) addr:0x01ffaf74 -Mat4p_InitIdentity kind:function(arm,size=0x2c) addr:0x01ffb00c -Mat4p_CopyToMat4x3p kind:function(arm,size=0x34) addr:0x01ffb038 -Mat4p_Multiply kind:function(arm,size=0x3bc) addr:0x01ffb06c +MtxFx44_InitIdentity kind:function(arm,size=0x2c) addr:0x01ffb00c +MtxFx44_CopyToMtxFx43 kind:function(arm,size=0x34) addr:0x01ffb038 +MtxFx44_Multiply kind:function(arm,size=0x3bc) addr:0x01ffb06c func_01ffb428 kind:function(arm,size=0x10) addr:0x01ffb428 func_01ffb438 kind:function(arm,size=0x2c) addr:0x01ffb438 func_01ffb464 kind:function(arm,size=0x10) addr:0x01ffb464 diff --git a/config/eur1/arm9/overlays/ov000/symbols.txt b/config/eur1/arm9/overlays/ov000/symbols.txt index 6f28f4f6..0133ab14 100644 --- a/config/eur1/arm9/overlays/ov000/symbols.txt +++ b/config/eur1/arm9/overlays/ov000/symbols.txt @@ -109,8 +109,8 @@ _ZN11ModelRender19func_ov000_02057d3cEP18G3d_BoneMtxStruct_ kind:function(arm,si func_ov000_02057d6c kind:function(arm,size=0x18) addr:0x02057d6c _ZN11ModelRender8vfunc_20Ev kind:function(arm,size=0x18) addr:0x02057d84 _ZN11ModelRender19func_ov000_02057d9cEv kind:function(arm,size=0x2c) addr:0x02057d9c -_ZN11ModelRender8vfunc_10EP7VecFx32P5Mat3pS1_ kind:function(arm,size=0x7c) addr:0x02057dc8 -_ZN11ModelRender8vfunc_14EP5Mat3pP7VecFx32 kind:function(arm,size=0x64) addr:0x02057e44 +_ZN11ModelRender8vfunc_10EP7VecFx32P7MtxFx33S1_ kind:function(arm,size=0x7c) addr:0x02057dc8 +_ZN11ModelRender8vfunc_14EP7MtxFx33P7VecFx32 kind:function(arm,size=0x64) addr:0x02057e44 _ZN11ModelRender8vfunc_18EP7VecFx32 kind:function(arm,size=0x1c) addr:0x02057ea8 _ZN15ModelRenderBaseD1Ev kind:function(thumb,size=0x2) addr:0x02057ec4 _ZN15ModelRenderBaseD0Ev kind:function(thumb,size=0xc) addr:0x02057ec8 diff --git a/config/eur1/arm9/overlays/ov024/symbols.txt b/config/eur1/arm9/overlays/ov024/symbols.txt index 0d92008b..0608fbf0 100644 --- a/config/eur1/arm9/overlays/ov024/symbols.txt +++ b/config/eur1/arm9/overlays/ov024/symbols.txt @@ -661,7 +661,7 @@ _ZN12CargoManager19func_ov024_020d591cEv kind:function(arm,size=0x1c) addr:0x020 _ZN15UnkTrainSystem2C1Ev kind:function(arm,size=0x40) addr:0x020d5a58 _ZN15UnkTrainSystem2D1Ev kind:function(arm,size=0x18) addr:0x020d5a98 _ZN15UnkTrainSystem219func_ov024_020d5990Ev kind:function(arm,size=0x16c) addr:0x020d5ab0 -_ZN15UnkTrainSystem219func_ov024_020d5afcEPK5Mat3pPK7VecFx32i kind:function(arm,size=0x144) addr:0x020d5c1c +_ZN15UnkTrainSystem219func_ov024_020d5afcEPK7MtxFx33PK7VecFx32i kind:function(arm,size=0x144) addr:0x020d5c1c _ZN15UnkTrainSystem219func_ov024_020d5c40Ev kind:function(arm,size=0x4c) addr:0x020d5d60 _ZN18UnkStruct_027e0d08C1Ev kind:function(arm,size=0x44) addr:0x020d5dac _ZN18UnkStruct_027e0d08D1Ev kind:function(arm,size=0x1c) addr:0x020d5df0 diff --git a/config/eur1/arm9/overlays/ov031/symbols.txt b/config/eur1/arm9/overlays/ov031/symbols.txt index 07abc319..ef89cc40 100644 --- a/config/eur1/arm9/overlays/ov031/symbols.txt +++ b/config/eur1/arm9/overlays/ov031/symbols.txt @@ -498,7 +498,7 @@ _ZN12ActorUnkSWBM19func_ov031_020e6d80Ei kind:function(arm,size=0x104) addr:0x02 _ZN12ActorUnkSWBM19func_ov031_020e6e84Es kind:function(arm,size=0x74) addr:0x020e6fa4 _ZN12ActorUnkSWBM6UpdateEv kind:function(arm,size=0x268) addr:0x020e7018 _ZN12ActorUnkSWBM8vfunc_24Ev kind:function(arm,size=0x2c) addr:0x020e7280 -_ZN12ActorUnkSWBM19func_ov031_020e718cEP7VecFx32P5Mat3pists kind:function(arm,size=0x108) addr:0x020e72ac +_ZN12ActorUnkSWBM19func_ov031_020e718cEP7VecFx32P7MtxFx33ists kind:function(arm,size=0x108) addr:0x020e72ac _ZN12ActorUnkSWBM8vfunc_2CEP14Actor_vfunc_30 kind:function(arm,size=0x40) addr:0x020e73b4 _ZN15ActorUnkSWBM_94D0Ev kind:function(arm,size=0x1c) addr:0x020e73f4 _ZN15ActorUnkSWBM_98D0Ev kind:function(arm,size=0x1c) addr:0x020e7410 @@ -902,9 +902,9 @@ _ZN14ActorShotArrow19func_ov031_020f2214Ev kind:function(arm,size=0x5c) addr:0x0 _ZN14ActorShotArrow19func_ov031_020f2270Ev kind:function(arm,size=0x10) addr:0x020f23a0 _ZN14ActorShotArrow19func_ov031_020f2280Ev kind:function(arm,size=0x1c) addr:0x020f23b0 _ZN14ActorShotArrow19func_ov031_020f229cEv kind:function(arm,size=0x38) addr:0x020f23cc -_ZN14ActorShotArrow19func_ov031_020f22d4EP5Mat3pP7VecFx32 kind:function(arm,size=0x3c) addr:0x020f2404 +_ZN14ActorShotArrow19func_ov031_020f22d4EP7MtxFx33P7VecFx32 kind:function(arm,size=0x3c) addr:0x020f2404 _ZN14ActorShotArrow8vfunc_2CEP14Actor_vfunc_30 kind:function(arm,size=0x344) addr:0x020f2440 -_ZN14ActorShotArrow19func_ov031_020f2654EP5Mat3p kind:function(arm,size=0x140) addr:0x020f2784 +_ZN14ActorShotArrow19func_ov031_020f2654EP7MtxFx33 kind:function(arm,size=0x140) addr:0x020f2784 _ZN14ActorShotArrow19func_ov031_020f2794Es kind:function(arm,size=0x118) addr:0x020f28c4 _ZN14ActorShotArrow19func_ov031_020f28acEv kind:function(arm,size=0x2e0) addr:0x020f29dc _ZN14ActorShotArrow19func_ov031_020f2b8cEv kind:function(arm,size=0x30) addr:0x020f2cbc @@ -916,7 +916,7 @@ _ZN14ActorShotArrow19func_ov031_020f2ef0Ev kind:function(arm,size=0x6c) addr:0x0 _ZN14ActorShotArrow19func_ov031_020f2f5cEP7VecFx32 kind:function(arm,size=0x40) addr:0x020f308c _ZN14ActorShotArrow19func_ov031_020f2f9cEv kind:function(arm,size=0x64) addr:0x020f30cc _ZN14ActorShotArrow19func_ov031_020f3000Ev kind:function(arm,size=0x11c) addr:0x020f3130 -_ZN14ActorShotArrow19func_ov031_020f311cEP7Mat4x3p kind:function(arm,size=0xf4) addr:0x020f324c +_ZN14ActorShotArrow19func_ov031_020f311cEP7MtxFx43 kind:function(arm,size=0xf4) addr:0x020f324c _ZN14ActorShotArrow19func_ov031_020f3210Et kind:function(arm,size=0x48) addr:0x020f3340 _ZN14ActorShotArrow19func_ov031_020f3258Et kind:function(arm,size=0x30) addr:0x020f3388 _ZN18ActorShotArrow_178C1EP14ActorShotArrow kind:function(arm,size=0x3c) addr:0x020f33b8 diff --git a/config/eur1/arm9/overlays/ov084/symbols.txt b/config/eur1/arm9/overlays/ov084/symbols.txt index 1d1fe538..421dd4dd 100644 --- a/config/eur1/arm9/overlays/ov084/symbols.txt +++ b/config/eur1/arm9/overlays/ov084/symbols.txt @@ -38,7 +38,7 @@ _ZN12ActorUnkIWTS19func_ov084_02152cecEv kind:function(arm,size=0x24) addr:0x021 _ZN12ActorUnkIWTS19func_ov084_02152d10Ev kind:function(arm,size=0x180) addr:0x02152e90 _ZN12ActorUnkIWTSD0Ev kind:function(arm,size=0x188) addr:0x02153010 _ZN12ActorUnkIWTS19func_ov084_02153018Ev kind:function(arm,size=0x4c) addr:0x02153198 -_ZN12ActorUnkIWTS19func_ov084_02153064EP8ActorRefPP7Mat4x3p kind:function(arm,size=0x70) addr:0x021531e4 +_ZN12ActorUnkIWTS19func_ov084_02153064EP8ActorRefPP7MtxFx43 kind:function(arm,size=0x70) addr:0x021531e4 _ZN12ActorUnkIWTS19func_ov084_021530d4Ev kind:function(arm,size=0x88) addr:0x02153254 _ZN12ActorUnkIWTS19func_ov084_0215315cEv kind:function(arm,size=0x38) addr:0x021532dc _ZN12ActorUnkIWTS19func_ov084_02153194Ev kind:function(arm,size=0x50) addr:0x02153314 diff --git a/config/eur1/arm9/overlays/ov102/symbols.txt b/config/eur1/arm9/overlays/ov102/symbols.txt index b7999e7e..9112bb35 100644 --- a/config/eur1/arm9/overlays/ov102/symbols.txt +++ b/config/eur1/arm9/overlays/ov102/symbols.txt @@ -1,5 +1,5 @@ -_ZN18PlayerActorBase_7419func_ov102_02182c20EiP7Mat4x3p kind:function(arm,size=0x64) addr:0x02182e20 -_ZN18PlayerActorBase_7419func_ov102_02182c84Ebi14UnkAngleStructP7Mat4x3pS2_ kind:function(arm,size=0x1d0) addr:0x02182e84 +_ZN18PlayerActorBase_7419func_ov102_02182c20EiP7MtxFx43 kind:function(arm,size=0x64) addr:0x02182e20 +_ZN18PlayerActorBase_7419func_ov102_02182c84Ebi14UnkAngleStructP7MtxFx43S2_ kind:function(arm,size=0x1d0) addr:0x02182e84 _ZN25UnkStruct_027e0ce0_40_10819func_ov102_02182e54EiP7VecFx32i kind:function(arm,size=0x154) addr:0x02183054 _ZN24UnkStruct_ItemManager_2019func_ov102_02182fa8Ebb kind:function(arm,size=0x54) addr:0x021831a8 _ZN24UnkStruct_ItemManager_2019func_ov102_02182ffcEPv kind:function(arm,size=0x40) addr:0x021831fc diff --git a/config/eur1/arm9/symbols.txt b/config/eur1/arm9/symbols.txt index 7cc8e1cb..d122c72e 100644 --- a/config/eur1/arm9/symbols.txt +++ b/config/eur1/arm9/symbols.txt @@ -1570,7 +1570,7 @@ OS_func_0095 kind:function(arm,size=0x10) addr:0x02027fb8 OS_func_0096 kind:function(arm,size=0xec) addr:0x02027fc8 OS_func_0097 kind:function(thumb,size=0x24) addr:0x020280b4 OS_func_0098 kind:function(arm,size=0x14) addr:0x020280d8 -OS_DisableInterrupts_Irq kind:function(arm,size=0x14) addr:0x020280ec +OS_DisableInterrupts kind:function(arm,size=0x14) addr:0x020280ec OS_RestoreInterrupts kind:function(arm,size=0x18) addr:0x02028100 OS_func_0099 kind:function(arm,size=0x14) addr:0x02028118 OS_func_0100 kind:function(arm,size=0x18) addr:0x0202812c diff --git a/config/jp/arm9/itcm/symbols.txt b/config/jp/arm9/itcm/symbols.txt index 2ec269eb..1346f5fe 100644 --- a/config/jp/arm9/itcm/symbols.txt +++ b/config/jp/arm9/itcm/symbols.txt @@ -52,36 +52,36 @@ func_01ff9ec4 kind:function(arm,size=0x30) addr:0x01ff9ec4 func_01ff9ef4 kind:function(arm,size=0x10) addr:0x01ff9ef4 func_01ff9f04 kind:function(arm,size=0x10) addr:0x01ff9f04 func_01ff9f14 kind:function(arm,size=0x24) addr:0x01ff9f14 -Mat2p_InitIdentity kind:function(arm,size=0x18) addr:0x01ff9f38 +MtxFx22_InitIdentity kind:function(arm,size=0x18) addr:0x01ff9f38 func_01ff9f50 kind:function(thumb,size=0xc) addr:0x01ff9f50 -Mat2p_InitRotation kind:function(thumb,size=0xc) addr:0x01ff9f5c +MtxFx22_InitRotation kind:function(thumb,size=0xc) addr:0x01ff9f5c func_01ff9f68 kind:function(arm,size=0x54) addr:0x01ff9f68 func_01ff9fbc kind:function(arm,size=0xb0) addr:0x01ff9fbc -Mat3p_InitIdentity kind:function(arm,size=0x24) addr:0x01ffa06c -Mat3p_CopyToMat4x3p kind:function(arm,size=0x2c) addr:0x01ffa090 +MtxFx33_InitIdentity kind:function(arm,size=0x24) addr:0x01ffa06c +MtxFx33_CopyToMtxFx43 kind:function(arm,size=0x2c) addr:0x01ffa090 func_01ffa0bc kind:function(arm,size=0xc8) addr:0x01ffa0bc -Mat3p_InitXRotation kind:function(thumb,size=0x1c) addr:0x01ffa184 -Mat3p_InitYRotation kind:function(thumb,size=0x1c) addr:0x01ffa1a0 -Mat3p_InitZRotation kind:function(thumb,size=0x18) addr:0x01ffa1bc -Mat3p_func_01ff8248 kind:function(arm,size=0x154) addr:0x01ffa1d4 +MtxFx33_InitXRotation kind:function(thumb,size=0x1c) addr:0x01ffa184 +MtxFx33_InitYRotation kind:function(thumb,size=0x1c) addr:0x01ffa1a0 +MtxFx33_InitZRotation kind:function(thumb,size=0x18) addr:0x01ffa1bc +MtxFx33_func_01ff8248 kind:function(arm,size=0x154) addr:0x01ffa1d4 func_01ffa328 kind:function(arm,size=0x2e4) addr:0x01ffa328 func_01ffa60c kind:function(arm,size=0x194) addr:0x01ffa60c func_01ffa7a0 kind:function(arm,size=0x7c) addr:0x01ffa7a0 -Mat4x3p_InitIdentity kind:function(arm,size=0x28) addr:0x01ffa81c -Mat4x3p_CopyToMat4p kind:function(arm,size=0x34) addr:0x01ffa844 -Mat4x3p_func_01ff8988 kind:function(arm,size=0xac) addr:0x01ffa878 -Mat4x3p_InitScale kind:function(thumb,size=0x16) addr:0x01ffa924 +MtxFx43_InitIdentity kind:function(arm,size=0x28) addr:0x01ffa81c +MtxFx43_CopyToMtxFx44 kind:function(arm,size=0x34) addr:0x01ffa844 +MtxFx43_func_01ff8988 kind:function(arm,size=0xac) addr:0x01ffa878 +MtxFx43_InitScale kind:function(thumb,size=0x16) addr:0x01ffa924 func_01ffa93c kind:function(arm,size=0x34) addr:0x01ffa93c -Mat4x3p_InitXRotation kind:function(thumb,size=0x1e) addr:0x01ffa970 -Mat4x3p_InitYRotation kind:function(thumb,size=0x1a) addr:0x01ffa990 -Mat4x3p_InitZRotation kind:function(thumb,size=0x1a) addr:0x01ffa9ac -Mat4x3p_func_01ff8ad8 kind:function(arm,size=0x20) addr:0x01ffa9c8 +MtxFx43_InitXRotation kind:function(thumb,size=0x1e) addr:0x01ffa970 +MtxFx43_InitYRotation kind:function(thumb,size=0x1a) addr:0x01ffa990 +MtxFx43_InitZRotation kind:function(thumb,size=0x1a) addr:0x01ffa9ac +MtxFx43_func_01ff8ad8 kind:function(arm,size=0x20) addr:0x01ffa9c8 func_01ffa9e8 kind:function(arm,size=0x374) addr:0x01ffa9e8 func_01ffad5c kind:function(arm,size=0x218) addr:0x01ffad5c func_01ffaf74 kind:function(arm,size=0x98) addr:0x01ffaf74 -Mat4p_InitIdentity kind:function(arm,size=0x2c) addr:0x01ffb00c -Mat4p_CopyToMat4x3p kind:function(arm,size=0x34) addr:0x01ffb038 -Mat4p_Multiply kind:function(arm,size=0x3bc) addr:0x01ffb06c +MtxFx44_InitIdentity kind:function(arm,size=0x2c) addr:0x01ffb00c +MtxFx44_CopyToMtxFx43 kind:function(arm,size=0x34) addr:0x01ffb038 +MtxFx44_Multiply kind:function(arm,size=0x3bc) addr:0x01ffb06c func_01ffb428 kind:function(arm,size=0x10) addr:0x01ffb428 func_01ffb438 kind:function(arm,size=0x2c) addr:0x01ffb438 func_01ffb464 kind:function(arm,size=0x10) addr:0x01ffb464 diff --git a/config/jp/arm9/overlays/ov000/symbols.txt b/config/jp/arm9/overlays/ov000/symbols.txt index 12270628..28232cb9 100644 --- a/config/jp/arm9/overlays/ov000/symbols.txt +++ b/config/jp/arm9/overlays/ov000/symbols.txt @@ -109,8 +109,8 @@ _ZN11ModelRender19func_ov000_02057d3cEP18G3d_BoneMtxStruct_ kind:function(arm,si func_ov000_02057d6c kind:function(arm,size=0x18) addr:0x020592ec _ZN11ModelRender8vfunc_20Ev kind:function(arm,size=0x18) addr:0x02059304 _ZN11ModelRender19func_ov000_02057d9cEv kind:function(arm,size=0x2c) addr:0x0205931c -_ZN11ModelRender8vfunc_10EP7VecFx32P5Mat3pS1_ kind:function(arm,size=0x7c) addr:0x02059348 -_ZN11ModelRender8vfunc_14EP5Mat3pP7VecFx32 kind:function(arm,size=0x64) addr:0x020593c4 +_ZN11ModelRender8vfunc_10EP7VecFx32P7MtxFx33S1_ kind:function(arm,size=0x7c) addr:0x02059348 +_ZN11ModelRender8vfunc_14EP7MtxFx33P7VecFx32 kind:function(arm,size=0x64) addr:0x020593c4 _ZN11ModelRender8vfunc_18EP7VecFx32 kind:function(arm,size=0x1c) addr:0x02059428 _ZN15ModelRenderBaseD1Ev kind:function(thumb,size=0x2) addr:0x02059444 _ZN15ModelRenderBaseD0Ev kind:function(thumb,size=0xc) addr:0x02059448 diff --git a/config/jp/arm9/overlays/ov024/symbols.txt b/config/jp/arm9/overlays/ov024/symbols.txt index edebafd5..d0c9d6e4 100644 --- a/config/jp/arm9/overlays/ov024/symbols.txt +++ b/config/jp/arm9/overlays/ov024/symbols.txt @@ -661,7 +661,7 @@ _ZN12CargoManager19func_ov024_020d591cEv kind:function(arm,size=0x1c) addr:0x020 _ZN15UnkTrainSystem2C1Ev kind:function(arm,size=0x40) addr:0x020d72dc _ZN15UnkTrainSystem2D1Ev kind:function(arm,size=0x18) addr:0x020d731c _ZN15UnkTrainSystem219func_ov024_020d5990Ev kind:function(arm,size=0x16c) addr:0x020d7334 -_ZN15UnkTrainSystem219func_ov024_020d5afcEPK5Mat3pPK7VecFx32i kind:function(arm,size=0x144) addr:0x020d74a0 +_ZN15UnkTrainSystem219func_ov024_020d5afcEPK7MtxFx33PK7VecFx32i kind:function(arm,size=0x144) addr:0x020d74a0 _ZN15UnkTrainSystem219func_ov024_020d5c40Ev kind:function(arm,size=0x4c) addr:0x020d75e4 _ZN18UnkStruct_027e0d08C1Ev kind:function(arm,size=0x44) addr:0x020d7630 _ZN18UnkStruct_027e0d08D1Ev kind:function(arm,size=0x1c) addr:0x020d7674 diff --git a/config/jp/arm9/overlays/ov031/symbols.txt b/config/jp/arm9/overlays/ov031/symbols.txt index aa465df1..75eafb16 100644 --- a/config/jp/arm9/overlays/ov031/symbols.txt +++ b/config/jp/arm9/overlays/ov031/symbols.txt @@ -498,7 +498,7 @@ _ZN12ActorUnkSWBM19func_ov031_020e6d80Ei kind:function(arm,size=0x104) addr:0x02 _ZN12ActorUnkSWBM19func_ov031_020e6e84Es kind:function(arm,size=0x74) addr:0x020e8870 _ZN12ActorUnkSWBM6UpdateEv kind:function(arm,size=0x268) addr:0x020e88e4 _ZN12ActorUnkSWBM8vfunc_24Ev kind:function(arm,size=0x2c) addr:0x020e8b4c -_ZN12ActorUnkSWBM19func_ov031_020e718cEP7VecFx32P5Mat3pists kind:function(arm,size=0x108) addr:0x020e8b78 +_ZN12ActorUnkSWBM19func_ov031_020e718cEP7VecFx32P7MtxFx33ists kind:function(arm,size=0x108) addr:0x020e8b78 _ZN12ActorUnkSWBM8vfunc_2CEP14Actor_vfunc_30 kind:function(arm,size=0x40) addr:0x020e8c80 _ZN15ActorUnkSWBM_94D0Ev kind:function(arm,size=0x1c) addr:0x020e8cc0 _ZN15ActorUnkSWBM_98D0Ev kind:function(arm,size=0x1c) addr:0x020e8cdc @@ -902,9 +902,9 @@ _ZN14ActorShotArrow19func_ov031_020f2214Ev kind:function(arm,size=0x5c) addr:0x0 _ZN14ActorShotArrow19func_ov031_020f2270Ev kind:function(arm,size=0x10) addr:0x020f3c6c _ZN14ActorShotArrow19func_ov031_020f2280Ev kind:function(arm,size=0x1c) addr:0x020f3c7c _ZN14ActorShotArrow19func_ov031_020f229cEv kind:function(arm,size=0x38) addr:0x020f3c98 -_ZN14ActorShotArrow19func_ov031_020f22d4EP5Mat3pP7VecFx32 kind:function(arm,size=0x3c) addr:0x020f3cd0 +_ZN14ActorShotArrow19func_ov031_020f22d4EP7MtxFx33P7VecFx32 kind:function(arm,size=0x3c) addr:0x020f3cd0 _ZN14ActorShotArrow8vfunc_2CEP14Actor_vfunc_30 kind:function(arm,size=0x344) addr:0x020f3d0c -_ZN14ActorShotArrow19func_ov031_020f2654EP5Mat3p kind:function(arm,size=0x140) addr:0x020f4050 +_ZN14ActorShotArrow19func_ov031_020f2654EP7MtxFx33 kind:function(arm,size=0x140) addr:0x020f4050 _ZN14ActorShotArrow19func_ov031_020f2794Es kind:function(arm,size=0x118) addr:0x020f4190 _ZN14ActorShotArrow19func_ov031_020f28acEv kind:function(arm,size=0x2e0) addr:0x020f42a8 _ZN14ActorShotArrow19func_ov031_020f2b8cEv kind:function(arm,size=0x30) addr:0x020f4588 @@ -916,7 +916,7 @@ _ZN14ActorShotArrow19func_ov031_020f2ef0Ev kind:function(arm,size=0x6c) addr:0x0 _ZN14ActorShotArrow19func_ov031_020f2f5cEP7VecFx32 kind:function(arm,size=0x40) addr:0x020f4958 _ZN14ActorShotArrow19func_ov031_020f2f9cEv kind:function(arm,size=0x64) addr:0x020f4998 _ZN14ActorShotArrow19func_ov031_020f3000Ev kind:function(arm,size=0x11c) addr:0x020f49fc -_ZN14ActorShotArrow19func_ov031_020f311cEP7Mat4x3p kind:function(arm,size=0xf4) addr:0x020f4b18 +_ZN14ActorShotArrow19func_ov031_020f311cEP7MtxFx43 kind:function(arm,size=0xf4) addr:0x020f4b18 _ZN14ActorShotArrow19func_ov031_020f3210Et kind:function(arm,size=0x48) addr:0x020f4c0c _ZN14ActorShotArrow19func_ov031_020f3258Et kind:function(arm,size=0x30) addr:0x020f4c54 _ZN18ActorShotArrow_178C1EP14ActorShotArrow kind:function(arm,size=0x3c) addr:0x020f4c84 diff --git a/config/jp/arm9/overlays/ov084/symbols.txt b/config/jp/arm9/overlays/ov084/symbols.txt index 2599d497..0f24d046 100644 --- a/config/jp/arm9/overlays/ov084/symbols.txt +++ b/config/jp/arm9/overlays/ov084/symbols.txt @@ -39,7 +39,7 @@ _ZN12ActorUnkIWTS19func_ov084_02152cecEv kind:function(arm,size=0x24) addr:0x021 _ZN12ActorUnkIWTS19func_ov084_02152d10Ev kind:function(arm,size=0x188) addr:0x02154e28 _ZN12ActorUnkIWTSD0Ev kind:function(arm,size=0x190) addr:0x02154fb0 _ZN12ActorUnkIWTS19func_ov084_02153018Ev kind:function(arm,size=0x4c) addr:0x02155140 -_ZN12ActorUnkIWTS19func_ov084_02153064EP8ActorRefPP7Mat4x3p kind:function(arm,size=0x70) addr:0x0215518c +_ZN12ActorUnkIWTS19func_ov084_02153064EP8ActorRefPP7MtxFx43 kind:function(arm,size=0x70) addr:0x0215518c _ZN12ActorUnkIWTS19func_ov084_021530d4Ev kind:function(arm,size=0x88) addr:0x021551fc _ZN12ActorUnkIWTS19func_ov084_0215315cEv kind:function(arm,size=0x38) addr:0x02155284 _ZN12ActorUnkIWTS19func_ov084_02153194Ev kind:function(arm,size=0x50) addr:0x021552bc diff --git a/config/jp/arm9/overlays/ov102/symbols.txt b/config/jp/arm9/overlays/ov102/symbols.txt index 8842b246..e5978d64 100644 --- a/config/jp/arm9/overlays/ov102/symbols.txt +++ b/config/jp/arm9/overlays/ov102/symbols.txt @@ -1,5 +1,5 @@ -_ZN18PlayerActorBase_7419func_ov102_02182c20EiP7Mat4x3p kind:function(arm,size=0x64) addr:0x021847a0 -_ZN18PlayerActorBase_7419func_ov102_02182c84Ebi14UnkAngleStructP7Mat4x3pS2_ kind:function(arm,size=0x1d0) addr:0x02184804 +_ZN18PlayerActorBase_7419func_ov102_02182c20EiP7MtxFx43 kind:function(arm,size=0x64) addr:0x021847a0 +_ZN18PlayerActorBase_7419func_ov102_02182c84Ebi14UnkAngleStructP7MtxFx43S2_ kind:function(arm,size=0x1d0) addr:0x02184804 _ZN25UnkStruct_027e0ce0_40_10819func_ov102_02182e54EiP7VecFx32i kind:function(arm,size=0x154) addr:0x021849d4 _ZN24UnkStruct_ItemManager_2019func_ov102_02182fa8Ebb kind:function(arm,size=0x54) addr:0x02184b28 _ZN24UnkStruct_ItemManager_2019func_ov102_02182ffcEPv kind:function(arm,size=0x40) addr:0x02184b7c diff --git a/config/jp/arm9/symbols.txt b/config/jp/arm9/symbols.txt index 1026ca28..9bbf7a6a 100644 --- a/config/jp/arm9/symbols.txt +++ b/config/jp/arm9/symbols.txt @@ -1591,7 +1591,7 @@ OS_func_0095 kind:function(arm,size=0x10) addr:0x020294e8 OS_func_0096 kind:function(arm,size=0xec) addr:0x020294f8 OS_func_0097 kind:function(thumb,size=0x24) addr:0x020295e4 OS_func_0098 kind:function(arm,size=0x14) addr:0x02029608 -OS_DisableInterrupts_Irq kind:function(arm,size=0x14) addr:0x0202961c +OS_DisableInterrupts kind:function(arm,size=0x14) addr:0x0202961c OS_RestoreInterrupts kind:function(arm,size=0x18) addr:0x02029630 OS_func_0099 kind:function(arm,size=0x14) addr:0x02029648 OS_func_0100 kind:function(arm,size=0x18) addr:0x0202965c diff --git a/config/usa/arm9/itcm/symbols.txt b/config/usa/arm9/itcm/symbols.txt index 2ec269eb..1346f5fe 100644 --- a/config/usa/arm9/itcm/symbols.txt +++ b/config/usa/arm9/itcm/symbols.txt @@ -52,36 +52,36 @@ func_01ff9ec4 kind:function(arm,size=0x30) addr:0x01ff9ec4 func_01ff9ef4 kind:function(arm,size=0x10) addr:0x01ff9ef4 func_01ff9f04 kind:function(arm,size=0x10) addr:0x01ff9f04 func_01ff9f14 kind:function(arm,size=0x24) addr:0x01ff9f14 -Mat2p_InitIdentity kind:function(arm,size=0x18) addr:0x01ff9f38 +MtxFx22_InitIdentity kind:function(arm,size=0x18) addr:0x01ff9f38 func_01ff9f50 kind:function(thumb,size=0xc) addr:0x01ff9f50 -Mat2p_InitRotation kind:function(thumb,size=0xc) addr:0x01ff9f5c +MtxFx22_InitRotation kind:function(thumb,size=0xc) addr:0x01ff9f5c func_01ff9f68 kind:function(arm,size=0x54) addr:0x01ff9f68 func_01ff9fbc kind:function(arm,size=0xb0) addr:0x01ff9fbc -Mat3p_InitIdentity kind:function(arm,size=0x24) addr:0x01ffa06c -Mat3p_CopyToMat4x3p kind:function(arm,size=0x2c) addr:0x01ffa090 +MtxFx33_InitIdentity kind:function(arm,size=0x24) addr:0x01ffa06c +MtxFx33_CopyToMtxFx43 kind:function(arm,size=0x2c) addr:0x01ffa090 func_01ffa0bc kind:function(arm,size=0xc8) addr:0x01ffa0bc -Mat3p_InitXRotation kind:function(thumb,size=0x1c) addr:0x01ffa184 -Mat3p_InitYRotation kind:function(thumb,size=0x1c) addr:0x01ffa1a0 -Mat3p_InitZRotation kind:function(thumb,size=0x18) addr:0x01ffa1bc -Mat3p_func_01ff8248 kind:function(arm,size=0x154) addr:0x01ffa1d4 +MtxFx33_InitXRotation kind:function(thumb,size=0x1c) addr:0x01ffa184 +MtxFx33_InitYRotation kind:function(thumb,size=0x1c) addr:0x01ffa1a0 +MtxFx33_InitZRotation kind:function(thumb,size=0x18) addr:0x01ffa1bc +MtxFx33_func_01ff8248 kind:function(arm,size=0x154) addr:0x01ffa1d4 func_01ffa328 kind:function(arm,size=0x2e4) addr:0x01ffa328 func_01ffa60c kind:function(arm,size=0x194) addr:0x01ffa60c func_01ffa7a0 kind:function(arm,size=0x7c) addr:0x01ffa7a0 -Mat4x3p_InitIdentity kind:function(arm,size=0x28) addr:0x01ffa81c -Mat4x3p_CopyToMat4p kind:function(arm,size=0x34) addr:0x01ffa844 -Mat4x3p_func_01ff8988 kind:function(arm,size=0xac) addr:0x01ffa878 -Mat4x3p_InitScale kind:function(thumb,size=0x16) addr:0x01ffa924 +MtxFx43_InitIdentity kind:function(arm,size=0x28) addr:0x01ffa81c +MtxFx43_CopyToMtxFx44 kind:function(arm,size=0x34) addr:0x01ffa844 +MtxFx43_func_01ff8988 kind:function(arm,size=0xac) addr:0x01ffa878 +MtxFx43_InitScale kind:function(thumb,size=0x16) addr:0x01ffa924 func_01ffa93c kind:function(arm,size=0x34) addr:0x01ffa93c -Mat4x3p_InitXRotation kind:function(thumb,size=0x1e) addr:0x01ffa970 -Mat4x3p_InitYRotation kind:function(thumb,size=0x1a) addr:0x01ffa990 -Mat4x3p_InitZRotation kind:function(thumb,size=0x1a) addr:0x01ffa9ac -Mat4x3p_func_01ff8ad8 kind:function(arm,size=0x20) addr:0x01ffa9c8 +MtxFx43_InitXRotation kind:function(thumb,size=0x1e) addr:0x01ffa970 +MtxFx43_InitYRotation kind:function(thumb,size=0x1a) addr:0x01ffa990 +MtxFx43_InitZRotation kind:function(thumb,size=0x1a) addr:0x01ffa9ac +MtxFx43_func_01ff8ad8 kind:function(arm,size=0x20) addr:0x01ffa9c8 func_01ffa9e8 kind:function(arm,size=0x374) addr:0x01ffa9e8 func_01ffad5c kind:function(arm,size=0x218) addr:0x01ffad5c func_01ffaf74 kind:function(arm,size=0x98) addr:0x01ffaf74 -Mat4p_InitIdentity kind:function(arm,size=0x2c) addr:0x01ffb00c -Mat4p_CopyToMat4x3p kind:function(arm,size=0x34) addr:0x01ffb038 -Mat4p_Multiply kind:function(arm,size=0x3bc) addr:0x01ffb06c +MtxFx44_InitIdentity kind:function(arm,size=0x2c) addr:0x01ffb00c +MtxFx44_CopyToMtxFx43 kind:function(arm,size=0x34) addr:0x01ffb038 +MtxFx44_Multiply kind:function(arm,size=0x3bc) addr:0x01ffb06c func_01ffb428 kind:function(arm,size=0x10) addr:0x01ffb428 func_01ffb438 kind:function(arm,size=0x2c) addr:0x01ffb438 func_01ffb464 kind:function(arm,size=0x10) addr:0x01ffb464 diff --git a/config/usa/arm9/overlays/ov000/symbols.txt b/config/usa/arm9/overlays/ov000/symbols.txt index 9f7ffe68..f2567e50 100644 --- a/config/usa/arm9/overlays/ov000/symbols.txt +++ b/config/usa/arm9/overlays/ov000/symbols.txt @@ -109,8 +109,8 @@ _ZN11ModelRender19func_ov000_02057d3cEP18G3d_BoneMtxStruct_ kind:function(arm,si func_ov000_02057d6c kind:function(arm,size=0x18) addr:0x02057d4c _ZN11ModelRender8vfunc_20Ev kind:function(arm,size=0x18) addr:0x02057d64 _ZN11ModelRender19func_ov000_02057d9cEv kind:function(arm,size=0x2c) addr:0x02057d7c -_ZN11ModelRender8vfunc_10EP7VecFx32P5Mat3pS1_ kind:function(arm,size=0x7c) addr:0x02057da8 -_ZN11ModelRender8vfunc_14EP5Mat3pP7VecFx32 kind:function(arm,size=0x64) addr:0x02057e24 +_ZN11ModelRender8vfunc_10EP7VecFx32P7MtxFx33S1_ kind:function(arm,size=0x7c) addr:0x02057da8 +_ZN11ModelRender8vfunc_14EP7MtxFx33P7VecFx32 kind:function(arm,size=0x64) addr:0x02057e24 _ZN11ModelRender8vfunc_18EP7VecFx32 kind:function(arm,size=0x1c) addr:0x02057e88 _ZN15ModelRenderBaseD1Ev kind:function(thumb,size=0x2) addr:0x02057ea4 _ZN15ModelRenderBaseD0Ev kind:function(thumb,size=0xc) addr:0x02057ea8 diff --git a/config/usa/arm9/overlays/ov024/symbols.txt b/config/usa/arm9/overlays/ov024/symbols.txt index 9776e595..807a44a6 100644 --- a/config/usa/arm9/overlays/ov024/symbols.txt +++ b/config/usa/arm9/overlays/ov024/symbols.txt @@ -661,7 +661,7 @@ _ZN12CargoManager19func_ov024_020d591cEv kind:function(arm,size=0x1c) addr:0x020 _ZN15UnkTrainSystem2C1Ev kind:function(arm,size=0x40) addr:0x020d5918 _ZN15UnkTrainSystem2D1Ev kind:function(arm,size=0x18) addr:0x020d5958 _ZN15UnkTrainSystem219func_ov024_020d5990Ev kind:function(arm,size=0x16c) addr:0x020d5970 -_ZN15UnkTrainSystem219func_ov024_020d5afcEPK5Mat3pPK7VecFx32i kind:function(arm,size=0x144) addr:0x020d5adc +_ZN15UnkTrainSystem219func_ov024_020d5afcEPK7MtxFx33PK7VecFx32i kind:function(arm,size=0x144) addr:0x020d5adc _ZN15UnkTrainSystem219func_ov024_020d5c40Ev kind:function(arm,size=0x4c) addr:0x020d5c20 _ZN18UnkStruct_027e0d08C1Ev kind:function(arm,size=0x44) addr:0x020d5c6c _ZN18UnkStruct_027e0d08D1Ev kind:function(arm,size=0x1c) addr:0x020d5cb0 diff --git a/config/usa/arm9/overlays/ov031/symbols.txt b/config/usa/arm9/overlays/ov031/symbols.txt index 27338cce..a7e11b89 100644 --- a/config/usa/arm9/overlays/ov031/symbols.txt +++ b/config/usa/arm9/overlays/ov031/symbols.txt @@ -498,7 +498,7 @@ _ZN12ActorUnkSWBM19func_ov031_020e6d80Ei kind:function(arm,size=0x104) addr:0x02 _ZN12ActorUnkSWBM19func_ov031_020e6e84Es kind:function(arm,size=0x74) addr:0x020e6e64 _ZN12ActorUnkSWBM6UpdateEv kind:function(arm,size=0x268) addr:0x020e6ed8 _ZN12ActorUnkSWBM8vfunc_24Ev kind:function(arm,size=0x2c) addr:0x020e7140 -_ZN12ActorUnkSWBM19func_ov031_020e718cEP7VecFx32P5Mat3pists kind:function(arm,size=0x108) addr:0x020e716c +_ZN12ActorUnkSWBM19func_ov031_020e718cEP7VecFx32P7MtxFx33ists kind:function(arm,size=0x108) addr:0x020e716c _ZN12ActorUnkSWBM8vfunc_2CEP14Actor_vfunc_30 kind:function(arm,size=0x40) addr:0x020e7274 _ZN15ActorUnkSWBM_94D0Ev kind:function(arm,size=0x1c) addr:0x020e72b4 _ZN15ActorUnkSWBM_98D0Ev kind:function(arm,size=0x1c) addr:0x020e72d0 @@ -902,9 +902,9 @@ _ZN14ActorShotArrow19func_ov031_020f2214Ev kind:function(arm,size=0x5c) addr:0x0 _ZN14ActorShotArrow19func_ov031_020f2270Ev kind:function(arm,size=0x10) addr:0x020f2250 _ZN14ActorShotArrow19func_ov031_020f2280Ev kind:function(arm,size=0x1c) addr:0x020f2260 _ZN14ActorShotArrow19func_ov031_020f229cEv kind:function(arm,size=0x38) addr:0x020f227c -_ZN14ActorShotArrow19func_ov031_020f22d4EP5Mat3pP7VecFx32 kind:function(arm,size=0x3c) addr:0x020f22b4 +_ZN14ActorShotArrow19func_ov031_020f22d4EP7MtxFx33P7VecFx32 kind:function(arm,size=0x3c) addr:0x020f22b4 _ZN14ActorShotArrow8vfunc_2CEP14Actor_vfunc_30 kind:function(arm,size=0x344) addr:0x020f22f0 -_ZN14ActorShotArrow19func_ov031_020f2654EP5Mat3p kind:function(arm,size=0x140) addr:0x020f2634 +_ZN14ActorShotArrow19func_ov031_020f2654EP7MtxFx33 kind:function(arm,size=0x140) addr:0x020f2634 _ZN14ActorShotArrow19func_ov031_020f2794Es kind:function(arm,size=0x118) addr:0x020f2774 _ZN14ActorShotArrow19func_ov031_020f28acEv kind:function(arm,size=0x2e0) addr:0x020f288c _ZN14ActorShotArrow19func_ov031_020f2b8cEv kind:function(arm,size=0x30) addr:0x020f2b6c @@ -916,7 +916,7 @@ _ZN14ActorShotArrow19func_ov031_020f2ef0Ev kind:function(arm,size=0x6c) addr:0x0 _ZN14ActorShotArrow19func_ov031_020f2f5cEP7VecFx32 kind:function(arm,size=0x40) addr:0x020f2f3c _ZN14ActorShotArrow19func_ov031_020f2f9cEv kind:function(arm,size=0x64) addr:0x020f2f7c _ZN14ActorShotArrow19func_ov031_020f3000Ev kind:function(arm,size=0x11c) addr:0x020f2fe0 -_ZN14ActorShotArrow19func_ov031_020f311cEP7Mat4x3p kind:function(arm,size=0xf4) addr:0x020f30fc +_ZN14ActorShotArrow19func_ov031_020f311cEP7MtxFx43 kind:function(arm,size=0xf4) addr:0x020f30fc _ZN14ActorShotArrow19func_ov031_020f3210Et kind:function(arm,size=0x48) addr:0x020f31f0 _ZN14ActorShotArrow19func_ov031_020f3258Et kind:function(arm,size=0x30) addr:0x020f3238 _ZN18ActorShotArrow_178C1EP14ActorShotArrow kind:function(arm,size=0x3c) addr:0x020f3268 diff --git a/config/usa/arm9/overlays/ov084/symbols.txt b/config/usa/arm9/overlays/ov084/symbols.txt index 0db255d4..6b8ecf19 100644 --- a/config/usa/arm9/overlays/ov084/symbols.txt +++ b/config/usa/arm9/overlays/ov084/symbols.txt @@ -38,7 +38,7 @@ _ZN12ActorUnkIWTS19func_ov084_02152cecEv kind:function(arm,size=0x24) addr:0x021 _ZN12ActorUnkIWTS19func_ov084_02152d10Ev kind:function(arm,size=0x180) addr:0x02152cf0 _ZN12ActorUnkIWTSD0Ev kind:function(arm,size=0x188) addr:0x02152e70 _ZN12ActorUnkIWTS19func_ov084_02153018Ev kind:function(arm,size=0x4c) addr:0x02152ff8 -_ZN12ActorUnkIWTS19func_ov084_02153064EP8ActorRefPP7Mat4x3p kind:function(arm,size=0x70) addr:0x02153044 +_ZN12ActorUnkIWTS19func_ov084_02153064EP8ActorRefPP7MtxFx43 kind:function(arm,size=0x70) addr:0x02153044 _ZN12ActorUnkIWTS19func_ov084_021530d4Ev kind:function(arm,size=0x88) addr:0x021530b4 _ZN12ActorUnkIWTS19func_ov084_0215315cEv kind:function(arm,size=0x38) addr:0x0215313c _ZN12ActorUnkIWTS19func_ov084_02153194Ev kind:function(arm,size=0x50) addr:0x02153174 diff --git a/config/usa/arm9/overlays/ov102/symbols.txt b/config/usa/arm9/overlays/ov102/symbols.txt index 74c22b7f..2b0ca6f3 100644 --- a/config/usa/arm9/overlays/ov102/symbols.txt +++ b/config/usa/arm9/overlays/ov102/symbols.txt @@ -1,5 +1,5 @@ -_ZN18PlayerActorBase_7419func_ov102_02182c20EiP7Mat4x3p kind:function(arm,size=0x64) addr:0x02182c00 -_ZN18PlayerActorBase_7419func_ov102_02182c84Ebi14UnkAngleStructP7Mat4x3pS2_ kind:function(arm,size=0x1d0) addr:0x02182c64 +_ZN18PlayerActorBase_7419func_ov102_02182c20EiP7MtxFx43 kind:function(arm,size=0x64) addr:0x02182c00 +_ZN18PlayerActorBase_7419func_ov102_02182c84Ebi14UnkAngleStructP7MtxFx43S2_ kind:function(arm,size=0x1d0) addr:0x02182c64 _ZN25UnkStruct_027e0ce0_40_10819func_ov102_02182e54EiP7VecFx32i kind:function(arm,size=0x154) addr:0x02182e34 _ZN24UnkStruct_ItemManager_2019func_ov102_02182fa8Ebb kind:function(arm,size=0x54) addr:0x02182f88 _ZN24UnkStruct_ItemManager_2019func_ov102_02182ffcEPv kind:function(arm,size=0x40) addr:0x02182fdc diff --git a/config/usa/arm9/symbols.txt b/config/usa/arm9/symbols.txt index 47492978..609ee0a0 100644 --- a/config/usa/arm9/symbols.txt +++ b/config/usa/arm9/symbols.txt @@ -1570,7 +1570,7 @@ OS_func_0095 kind:function(arm,size=0x10) addr:0x02027f90 OS_func_0096 kind:function(arm,size=0xec) addr:0x02027fa0 OS_func_0097 kind:function(thumb,size=0x24) addr:0x0202808c OS_func_0098 kind:function(arm,size=0x14) addr:0x020280b0 -OS_DisableInterrupts_Irq kind:function(arm,size=0x14) addr:0x020280c4 +OS_DisableInterrupts kind:function(arm,size=0x14) addr:0x020280c4 OS_RestoreInterrupts kind:function(arm,size=0x18) addr:0x020280d8 OS_func_0099 kind:function(arm,size=0x14) addr:0x020280f0 OS_func_0100 kind:function(arm,size=0x18) addr:0x02028104 diff --git a/docs/tips.md b/docs/tips.md index 985b3255..c8419e25 100644 --- a/docs/tips.md +++ b/docs/tips.md @@ -46,7 +46,7 @@ There is a `ABS(x)` macro that computes the absolute value of the given value. `fx32` (and smaller `fx` types) represent **F**ixed **P**oint floats used in the source code. They appear very often, especially with the `VexFx32` struct (3 `fx32`s components that represent a position or other kind of vectors). -Some macros exists to operate on them, two major ones are `FLOAT_TO_FX32(n)` (takes a C `float` and transforms it into a `fx32`) and `MUL_FX32(a, b)` (takes two `fx32` and performs multiplication). +Some macros exists to operate on them, two major ones are `FX_F32_TO_FX32(n)` (takes a C `float` and transforms it into a `fx32`) and `FX_MUL(a, b)` (takes two `fx32` and performs multiplication). ## Angles diff --git a/include/Actor/Actor.hpp b/include/Actor/Actor.hpp index 003e0d64..aabf5bf3 100644 --- a/include/Actor/Actor.hpp +++ b/include/Actor/Actor.hpp @@ -118,7 +118,7 @@ public: class Actor_38 { public: - /* 00 (base) */ STRUCT_PAD(0x00, 0x08); + /* 00 (base) */ PAD(0x00, 0x08); /* 08 */ unk16 mUnk_08; /* 0A */ }; diff --git a/include/Actor/ActorBomb.hpp b/include/Actor/ActorBomb.hpp index 4c329448..4f75a5ce 100644 --- a/include/Actor/ActorBomb.hpp +++ b/include/Actor/ActorBomb.hpp @@ -60,7 +60,7 @@ public: class ActorBomb_ov031_020e2134 : public UnkStruct_ov031_Items_00 { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x4, 0x8); + /* 04 */ PAD(0x4, 0x8); /* 08 */ // data_ov031_02112cb0 @@ -73,7 +73,7 @@ public: /* 094 */ ModelRender mUnk_094; /* 0F4 */ UnkSystem5 mUnk_0F4; /* 114 */ unk32 mUnk_114; - /* 118 */ STRUCT_PAD(0x118, 0x134); + /* 118 */ PAD(0x118, 0x134); /* 134 */ Actor_9C mUnk_134; /* 154 */ Cylinder mUnk_154; /* 164 */ ActorBomb_unk mUnk_164[0x2]; @@ -94,9 +94,9 @@ public: #if IS_JP /* 1F1 */ bool mUnk_1F1; #else - /* 1F1 */ STRUCT_PAD(0x1F1, 0x1F2); + /* 1F1 */ PAD(0x1F1, 0x1F2); #endif - /* 1F2 */ STRUCT_PAD(0x1F2, 0x1F4); + /* 1F2 */ PAD(0x1F2, 0x1F4); /* 1F4 */ Actor_Derived1_94 mUnk_1F4; /* 200 */ diff --git a/include/Actor/ActorFleeingSpinut.hpp b/include/Actor/ActorFleeingSpinut.hpp index 5e7dbdb9..ecf3364f 100644 --- a/include/Actor/ActorFleeingSpinut.hpp +++ b/include/Actor/ActorFleeingSpinut.hpp @@ -5,6 +5,7 @@ #include "ActorProfile_ov000_020b3018.hpp" #include "ActorSpinut.hpp" #include "global.h" +#include "math.hpp" #include "types.h" enum ActorFleeingSpinutState_ { @@ -27,7 +28,7 @@ public: /* 10 */ unk32 mUnk_10; /* 14 */ unk32 mUnk_14; /* 18 */ unk32 mUnk_18; - /* 1C */ VecFx32 mUnk_1C; + /* 1C */ VecFx32Cpp mUnk_1C; /* 28 */ u16 mUnk_28; /* 2C */ unk32 mUnk_2C; /* 30 */ @@ -60,10 +61,10 @@ public: class ActorFleeingSpinut : public Actor_Derived2 { public: /* 000 (base) */ - /* 0AE */ STRUCT_PAD(0x0AE, 0x0B0); + /* 0AE */ PAD(0x0AE, 0x0B0); /* 0B0 */ ModelRender_ov000_020b1a1c mUnk_0B0; /* 110 */ ActorSpinut_110 mUnk_110; - /* 1A0 */ STRUCT_PAD(0x1A0, 0x1BC); + /* 1A0 */ PAD(0x1A0, 0x1BC); /* 1BC */ ActorState mPrevState; /* 1BE */ unk16 mUnk_1BE; /* 1C0 */ Actor_9C mUnk_1C0; @@ -108,7 +109,7 @@ public: class ActorProfileFleeingSpinut : public ActorProfile_ov000_020b3018 { public: /* 00 (base) */ - /* 3C */ STRUCT_PAD(0x3C, 0x44); + /* 3C */ PAD(0x3C, 0x44); /* 44 */ ActorProfileFleeingSpinut(); diff --git a/include/Actor/ActorHeart.hpp b/include/Actor/ActorHeart.hpp index 8235a41c..cd16232a 100644 --- a/include/Actor/ActorHeart.hpp +++ b/include/Actor/ActorHeart.hpp @@ -36,7 +36,7 @@ public: /* BA */ unk16 mUnk_BA; /* BC */ unk16 mUnk_BC; /* BE */ bool mUnk_BE; - /* BF */ STRUCT_PAD(0xBF, 0xC0); + /* BF */ PAD(0xBF, 0xC0); /* C0 */ ActorRef mUnk_C0; /* C4 */ ActorRef mUnk_C4; /* C8 */ ActorHeart_C4 mUnk_C8; diff --git a/include/Actor/ActorItemBoomerang.hpp b/include/Actor/ActorItemBoomerang.hpp index deee23bf..78f1bf76 100644 --- a/include/Actor/ActorItemBoomerang.hpp +++ b/include/Actor/ActorItemBoomerang.hpp @@ -28,7 +28,7 @@ public: class ActorItemBoomerang_11C : public UnkStruct_ov031_Items_00 { public: /* 00 (vtable) */ - /* 04 */ STRUCT_PAD(0x04, 0x08); + /* 04 */ PAD(0x04, 0x08); /* 08 */ ActorItemBoomerang *mUnk_08; /* 0C */ @@ -75,9 +75,9 @@ public: /* 138 */ u16 mUnk_138; // timer ? /* 13A */ u16 mUnk_13A; /* 13C */ u16 mUnk_13C; - /* 13E */ STRUCT_PAD(0x13E, 0x140); + /* 13E */ PAD(0x13E, 0x140); /* 140 */ UnkStruct_ov031_Items_02 mUnk_140; - /* 14C */ STRUCT_PAD(0x14C, 0x188); + /* 14C */ PAD(0x14C, 0x188); /* 188 */ ActorItemBoomerang(); diff --git a/include/Actor/ActorItemDrop.hpp b/include/Actor/ActorItemDrop.hpp index c7e9e1ae..7b4892c6 100644 --- a/include/Actor/ActorItemDrop.hpp +++ b/include/Actor/ActorItemDrop.hpp @@ -47,7 +47,7 @@ class ActorItemDrop : public Actor_Derived2 { public: /* 000 (base) */ /* 0AE */ Timer mUnk_AE; - /* 0B2 */ STRUCT_PAD(0xB2, 0xB4); + /* 0B2 */ PAD(0xB2, 0xB4); /* 0B4 */ Actor_9C mUnk_B4; /* 0D4 */ ItemDropType mItemTypeId; /* 0D8 */ fx32 mUnk_D8; @@ -55,7 +55,7 @@ public: /* 0E0 */ ActorRef mUnk_E0; /* 0E4 */ ActorItemDrop_C4 mUnk_E4; /* 108 */ unk16 mUnk_108; - /* 10A */ STRUCT_PAD(0x10A, 0x10C); + /* 10A */ PAD(0x10A, 0x10C); /* 10C */ VecFx32 mUnk_10C; /* 118 */ bool mUnk_118; /* 119 */ bool mUnk_119; diff --git a/include/Actor/ActorItemFlower.hpp b/include/Actor/ActorItemFlower.hpp index 56c68947..b648bf6b 100644 --- a/include/Actor/ActorItemFlower.hpp +++ b/include/Actor/ActorItemFlower.hpp @@ -35,7 +35,7 @@ class ActorItemFlower : public Actor_ov031_02113fd4 { public: /* 000 (base) */ /* 110 */ ModelRender_ov031_0211578c mUnk_110; - /* 170 */ STRUCT_PAD(0x170, 0x17C); + /* 170 */ PAD(0x170, 0x17C); /* 17C */ ActorItemFlower(); diff --git a/include/Actor/ActorItemTornado.hpp b/include/Actor/ActorItemTornado.hpp index 1a92eb47..7a3a1af1 100644 --- a/include/Actor/ActorItemTornado.hpp +++ b/include/Actor/ActorItemTornado.hpp @@ -26,12 +26,12 @@ public: /* 094 */ ModelRender mUnk_94; /* 0F4 */ UnkSystem5 mUnk_F4; /* 114 */ unk32 mUnk_114; - /* 118 */ STRUCT_PAD(0x118, 0x134); + /* 118 */ PAD(0x118, 0x134); /* 134 */ UnkSystem5 mUnk_134; /* 154 */ unk32 mUnk_154; - /* 158 */ STRUCT_PAD(0x158, 0x174); + /* 158 */ PAD(0x158, 0x174); /* 174 */ UnkStruct_ov031_02112ff4 mUnk_174; - /* 178 */ STRUCT_PAD(0x178, 0x17C); + /* 178 */ PAD(0x178, 0x17C); /* 17C */ UnkStruct_PlayerGet_74 mUnk_17C; /* 194 */ UnkStruct_ov031_Items_01 mUnk_194; /* 1C0 */ VecFx32 mUnk_1C0; diff --git a/include/Actor/ActorKeese.hpp b/include/Actor/ActorKeese.hpp index 26a1f45d..9fb5a72a 100644 --- a/include/Actor/ActorKeese.hpp +++ b/include/Actor/ActorKeese.hpp @@ -51,9 +51,9 @@ public: class ActorKeese_2AC : public UnkStruct_ov031_Items_00 { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x08); + /* 04 */ PAD(0x04, 0x08); /* 08 */ ActorKeese *mUnk_08; - /* 0C */ VecFx32 mUnk_0C; + /* 0C */ VecFx32Cpp mUnk_0C; /* 18 */ ActorKeese_2AC(ActorKeese *param1); @@ -67,7 +67,7 @@ public: class ModelRender_ov032_02122568 : public UnkStruct_ov000_020b3268 { public: /* 00 (base) */ - /* 60 */ STRUCT_PAD(0x60, 0x6C); + /* 60 */ PAD(0x60, 0x6C); /* 6C */ unk32 mUnk_6C; /* 70 */ @@ -91,9 +91,9 @@ public: /* 000 (base) */ /* 0B0 */ ModelRender_ov032_02122568 mUnk_0B0; /* 120 */ ActorSpinut_110 mUnk_120; - /* 1B0 */ STRUCT_PAD(0x1B0, 0x1CC); + /* 1B0 */ PAD(0x1B0, 0x1CC); /* 1CC */ ActorSpinut_1BC mUnk_1CC; - /* 20C */ STRUCT_PAD(0x20C, 0x228); + /* 20C */ PAD(0x20C, 0x228); /* 228 */ unk16 mUnk_228; /* 22A */ unk16 mUnk_22A; /* 22C */ Actor_Derived1_EC mUnk_22C; @@ -110,7 +110,7 @@ public: /* 2A4 */ unk32 mUnk_2A4; /* 2A8 */ fx16 mUnk_2A8; /* 2AC */ ActorKeese_2AC mUnk_2AC; - /* 2C4 */ VecFx32 mUnk_2C4; + /* 2C4 */ VecFx32Cpp mUnk_2C4; /* 2D0 */ Actor_38 *mUnk_2D0; /* 2D4 */ ActorRef mUnk_2D4; /* 2D8 */ diff --git a/include/Actor/ActorPot.hpp b/include/Actor/ActorPot.hpp index 7276e677..62a8a374 100644 --- a/include/Actor/ActorPot.hpp +++ b/include/Actor/ActorPot.hpp @@ -39,11 +39,11 @@ class Actor_ov031_02113fd4 : public Actor { public: /* 000 (base) */ /* 094 */ UnkStruct_ov031_Items_01 mUnk_94; - /* 0C0 */ STRUCT_PAD(0x0C0, 0x0EC); + /* 0C0 */ PAD(0x0C0, 0x0EC); /* 0EC */ u16 mUnk_EC; - /* 0EE */ STRUCT_PAD(0x0EE, 0xF0); + /* 0EE */ PAD(0x0EE, 0xF0); /* 0F0 */ UnkStruct_ov031_02113fb8 mUnk_F0; - /* 0F4 */ STRUCT_PAD(0xF4, 0x110); + /* 0F4 */ PAD(0xF4, 0x110); /* 110 */ Actor_ov031_02113fd4(); diff --git a/include/Actor/ActorRollingStone.hpp b/include/Actor/ActorRollingStone.hpp index 93420483..b5b7b3d7 100644 --- a/include/Actor/ActorRollingStone.hpp +++ b/include/Actor/ActorRollingStone.hpp @@ -62,8 +62,8 @@ public: /* 0D4 */ ActorRollingStone_D4 mUnk_D4; /* 104 */ ActorRollingStone_104 mUnk_104; /* 108 */ u16 mUnk_108; - /* 10A */ STRUCT_PAD(0x10A, 0x10C); - /* 10C */ Mat3p mUnk_10C; + /* 10A */ PAD(0x10A, 0x10C); + /* 10C */ MtxFx33 mUnk_10C; /* 130 */ UnkStruct_PlayerGet_ec mUnk_130[0x2]; /* 138 */ unk16 mUnk_138; /* 13C */ Cylinder mUnk_13C; diff --git a/include/Actor/ActorShotArrow.hpp b/include/Actor/ActorShotArrow.hpp index d067e7ad..9e7c187b 100644 --- a/include/Actor/ActorShotArrow.hpp +++ b/include/Actor/ActorShotArrow.hpp @@ -26,7 +26,7 @@ class ActorShotArrow; class ActorShotArrow_140 : public Actor_9C { public: /* 00 (vtable) */ - /* 20 */ STRUCT_PAD(0x20, 0x24); + /* 20 */ PAD(0x20, 0x24); /* 24 */ bool mUnk_24; /* 25 */ unk8 mUnk_25; /* 26 */ unk8 mUnk_26; @@ -39,7 +39,7 @@ public: class ActorShotArrow_178 : public UnkStruct_ov031_Items_00 { public: /* 00 (vtable) */ - /* 04 */ STRUCT_PAD(0x04, 0x08); + /* 04 */ PAD(0x04, 0x08); /* 08 */ ActorShotArrow *mUnk_08; /* 0C */ VecFx32 mUnk_0C; /* 18 */ u16 mUnk_18; @@ -72,7 +72,7 @@ public: // data_ov031_0211426c /* 0C */ virtual bool vfunc_0C(Actor *param1, VecFx32 *vector) override; // func_ov031_020f3c38 /* 10 */ virtual void vfunc_10(Actor *actor) override; // func_ov031_020f38b0 - // /* 14 */ virtual void vfunc_14(Mat3p *, VecFx32 *); + // /* 14 */ virtual void vfunc_14(MtxFx33 *, VecFx32 *); void func_ov031_020f374c(Actor *param1); }; @@ -102,7 +102,7 @@ public: /* 0A0 */ ModelRender mUnk_A0; /* 100 */ UnkSystem5_Derived1 mUnk_100; /* 120 */ unk32 mUnk_120; - /* 124 */ STRUCT_PAD(0x124, 0x140); + /* 124 */ PAD(0x124, 0x140); /* 140 */ ActorShotArrow_140 mUnk_140; /* 168 */ unk32 mUnk_168; /* 16C */ fx32 mUnk_16C; @@ -114,9 +114,9 @@ public: /* 194 */ ActorShotArrow_194 mUnk_194; /* 1C8 */ ActorShotArrow_1C8 mUnk_1C8; /* 1DC */ UnkStruct_ov031_Items_02 mUnk_1DC; - /* 1E0 */ STRUCT_PAD(0x1E8, 0x224); - /* 224 */ Mat4x3p *mUnk_224; - /* 228 */ Mat4x3p mUnk_228; + /* 1E0 */ PAD(0x1E8, 0x224); + /* 224 */ MtxFx43 *mUnk_224; + /* 228 */ MtxFx43 mUnk_228; /* 258 */ u16 mUnk_258; /* 25A */ bool mUnk_25A; /* 25B */ bool mUnk_25B; @@ -139,8 +139,8 @@ public: unk32 func_ov031_020f2270(); void func_ov031_020f2280(); void func_ov031_020f229c(); - void func_ov031_020f22d4(Mat3p *param1, VecFx32 *param2); - void func_ov031_020f2654(Mat3p *param1); + void func_ov031_020f22d4(MtxFx33 *param1, VecFx32 *param2); + void func_ov031_020f2654(MtxFx33 *param1); void func_ov031_020f2794(unk16 param1); void func_ov031_020f28ac(); void func_ov031_020f2b8c(); @@ -152,7 +152,7 @@ public: void func_ov031_020f2f5c(VecFx32 *param1); bool func_ov031_020f2f9c(); void func_ov031_020f3000(); - void func_ov031_020f311c(Mat4x3p *param1); + void func_ov031_020f311c(MtxFx43 *param1); bool func_ov031_020f3210(u16 param1); bool func_ov031_020f3258(u16 param1); void func_ov031_020f3d04(unk16 param1); diff --git a/include/Actor/ActorSpinut.hpp b/include/Actor/ActorSpinut.hpp index 7ddd90be..a5e5557c 100644 --- a/include/Actor/ActorSpinut.hpp +++ b/include/Actor/ActorSpinut.hpp @@ -34,7 +34,7 @@ enum ActorSpinutState_ { class ActorSpinut_268 : public UnkStruct_ov031_Items_00 { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x08); + /* 04 */ PAD(0x04, 0x08); /* 08 */ VecFx32 mUnk_08; /* 14 */ @@ -50,7 +50,7 @@ public: /* 00 (base) */ /* 2C */ UnkSystem5 mUnk_2C; /* 4C */ unk32 mUnk_4C; - /* 50 */ STRUCT_PAD(0x50, 0x6C); + /* 50 */ PAD(0x50, 0x6C); /* 6C */ UnkSystem5 mUnk_6C; /* 8C */ unk32 mUnk_8C; /* 90 */ @@ -94,12 +94,12 @@ public: class ActorSpinut : public Actor_Derived2 { public: /* 000 (base) */ - /* 0AE */ STRUCT_PAD(0x0AE, 0x0B0); + /* 0AE */ PAD(0x0AE, 0x0B0); /* 0B0 */ ModelRender_ov000_020b1a1c mUnk_0B0; /* 110 */ ActorSpinut_110 mUnk_110; - /* 1A0 */ STRUCT_PAD(0x1A0, 0x1BC); + /* 1A0 */ PAD(0x1A0, 0x1BC); /* 1BC */ ActorSpinut_1BC mUnk_1BC; - /* 1FC */ STRUCT_PAD(0x1FC, 0x218); + /* 1FC */ PAD(0x1FC, 0x218); /* 218 */ unk16 mUnk_218; /* 21C */ unk32 mUnk_21C; /* 220 */ unk32 mUnk_220; diff --git a/include/Actor/ActorTearLight.hpp b/include/Actor/ActorTearLight.hpp index a108010d..328077f0 100644 --- a/include/Actor/ActorTearLight.hpp +++ b/include/Actor/ActorTearLight.hpp @@ -92,7 +92,7 @@ public: /* 104 */ ActorTearLight_104 mUnk_104; /* 120 */ UnkSystem5 mUnk_120; /* 140 */ unk32 mUnk_140; - /* 144 */ STRUCT_PAD(0x144, 0x160); + /* 144 */ PAD(0x144, 0x160); /* 160 */ ActorTearLight_UnkStruct mUnk_160; /* 168 */ Actor_9C mUnk_168; /* 188 */ unk32 mUnk_188; @@ -103,7 +103,7 @@ public: /* 1B8 */ u8 mUnk_1B8; /* 1B9 */ unk8 mUnk_1B9; /* 1BC */ UnkStruct_ov031_Items_02 mUnk_1BC; - /* 1C8 */ STRUCT_PAD(0x1C8, 0x204); + /* 1C8 */ PAD(0x1C8, 0x204); /* 204 */ ActorTearLight_204 mUnk_204[0x2]; ActorTearLight(); diff --git a/include/Actor/ActorUnkCANS.hpp b/include/Actor/ActorUnkCANS.hpp index d841aa0a..0c88e426 100644 --- a/include/Actor/ActorUnkCANS.hpp +++ b/include/Actor/ActorUnkCANS.hpp @@ -34,7 +34,7 @@ struct UnkStruct_02162ea8_vfunc_0C { class UnkStruct_ov063_02162ea8 : public UnkStruct_ov031_Items_00 { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x4, 0x8); + /* 04 */ PAD(0x4, 0x8); /* 08 */ VecFx32 mUnk_08; /* 14 */ @@ -48,7 +48,7 @@ public: class UnkStruct_ov063_02162ee8 : public UnkStruct_ov000_020b3268 { public: /* 00 (base) */ - /* 60 */ STRUCT_PAD(0x60, 0x6C); + /* 60 */ PAD(0x60, 0x6C); /* 6C */ unk32 mUnk_6C; /* 70 */ unk32 mUnk_70; /* 74 */ unk32 mUnk_74; @@ -62,7 +62,7 @@ public: /* 2C */ /* 2C */ UnkSystem5 mUnk_2C; /* 4C */ unk32 mUnk_4C; - /* 50 */ STRUCT_PAD(0x50, 0x7C); + /* 50 */ PAD(0x50, 0x7C); /* 7C */ UnkSystem5 mUnk_7C; /* 9C */ unk32 mUnk_9C; @@ -93,10 +93,10 @@ public: class ActorUnkCANS : public Actor_Derived2 { public: /* 000 (base) */ - /* 0AE */ STRUCT_PAD(0xAE, 0xB0); + /* 0AE */ PAD(0xAE, 0xB0); /* 0B0 */ UnkStruct_ov063_02162ee8 mUnk_0B0; /* 128 */ UnkStruct_ov063_02162f14 mUnk_128; - /* 1C8 */ STRUCT_PAD(0x1C8, 0x1F4); + /* 1C8 */ PAD(0x1C8, 0x1F4); /* 1F4 */ Actor_Derived1_94 mUnk_1F4; /* 200 */ UnkStruct_ov063_02162e88 mUnk_200; /* 224 */ UnkStruct_ActorUnkCANS_224 mUnk_224; @@ -109,7 +109,7 @@ public: /* 264 */ unk32 mUnk_264; /* 268 */ ActorUnkCASE *mUnk_268; /* 26C */ fx16 mUnk_26C; // Some kind of angle, probably - /* 26E */ STRUCT_PAD(0x26E, 0x270); + /* 26E */ PAD(0x26E, 0x270); /* 270 */ unk32 mUnk_270; /* 274 */ u16 mUnk_274; /* 276 */ s8 mUnk_276; diff --git a/include/Actor/ActorUnkCASE.hpp b/include/Actor/ActorUnkCASE.hpp index c4713786..8d20b411 100644 --- a/include/Actor/ActorUnkCASE.hpp +++ b/include/Actor/ActorUnkCASE.hpp @@ -17,7 +17,7 @@ class UnkStruct_ov063_021631a0 : public UnkStruct_ov000_020b3268 { public: /* 00 (base) */ - /* 60 */ STRUCT_PAD(0x60, 0x6C); + /* 60 */ PAD(0x60, 0x6C); /* 6C */ unk32 mUnk_6C; /* 70 */ @@ -26,14 +26,14 @@ public: class UnkStruct_func_ov063_0215a678 { public: - /* 00 */ STRUCT_PAD(0x00, 0x04); + /* 00 */ PAD(0x00, 0x04); /* 04 */ ModelRender *mUnk_04; //! INFO: Placeholder that matches /* 08 */ unk32 mUnk_08; - /* 0C */ STRUCT_PAD(0x0C, 0x25); + /* 0C */ PAD(0x0C, 0x25); /* 25 */ u8 mUnk_25; - /* 26 */ STRUCT_PAD(0x26, 0x92); + /* 26 */ PAD(0x26, 0x92); /* 92 */ s8 mUnk_92; - /* 93 */ STRUCT_PAD(0x93, 0xAE); + /* 93 */ PAD(0x93, 0xAE); /* AE */ u8 mUnk_AE; }; @@ -66,15 +66,15 @@ public: /* 0AE */ unk16 mUnk_0AE; /* 0B0 */ UnkStruct_ov063_021631a0 mUnk_0B0; /* 120 */ unk16 mUnk_120; - /* 122 */ STRUCT_PAD(0x122, 0x124); + /* 122 */ PAD(0x122, 0x124); /* 124 */ ActorShotArrow_140 mUnk_124; /* 14C */ Actor *mUnk_14C; /* 150 */ ActorUnkCASE_150 mUnk_150; /* 174 */ ActorUnkCASE_174 mUnk_174; - /* 1A4 */ Mat3p mUnk_1A4; + /* 1A4 */ MtxFx33 mUnk_1A4; /* 1C8 */ unk16 mUnk_1C8; // Angle related - /* 1CA */ STRUCT_PAD(0x1CA, 0x1CC); - /* 1CC */ VecFx32 mUnk_1CC; + /* 1CA */ PAD(0x1CA, 0x1CC); + /* 1CC */ VecFx32Cpp mUnk_1CC; /* 1D8 */ unk32 mUnk_1D8; /* 1DC */ unk32 mUnk_1DC; /* 1E0 */ unk32 mUnk_1E0; diff --git a/include/Actor/ActorUnkGYAM.hpp b/include/Actor/ActorUnkGYAM.hpp index 14e6092a..1b61d579 100644 --- a/include/Actor/ActorUnkGYAM.hpp +++ b/include/Actor/ActorUnkGYAM.hpp @@ -20,8 +20,8 @@ public: class ActorUnkGYAM : public Actor { public: /* 000 (base) */ - /* 094 */ STRUCT_PAD(0x94, 0x220); - /* 220 */ Mat4x3p mUnk_220; + /* 094 */ PAD(0x94, 0x220); + /* 220 */ MtxFx43 mUnk_220; ActorUnkGYAM(); diff --git a/include/Actor/ActorUnkITWP.hpp b/include/Actor/ActorUnkITWP.hpp index 3ba5638d..5889dbeb 100644 --- a/include/Actor/ActorUnkITWP.hpp +++ b/include/Actor/ActorUnkITWP.hpp @@ -21,10 +21,10 @@ public: class ActorUnkITWP : public Actor { public: /* 00 (base) */ - /* 094 */ STRUCT_PAD(0x094, 0x0E8); + /* 094 */ PAD(0x094, 0x0E8); /* 0E8 */ VecFx32 mUnk_0E8; - /* 0F4 */ STRUCT_PAD(0x0F4, 0x154); - /* 154 */ Mat3p mUnk_154; + /* 0F4 */ PAD(0x0F4, 0x154); + /* 154 */ MtxFx33 mUnk_154; ActorUnkITWP(); diff --git a/include/Actor/ActorUnkIWTS.hpp b/include/Actor/ActorUnkIWTS.hpp index 0ca6e7b4..77b8bf57 100644 --- a/include/Actor/ActorUnkIWTS.hpp +++ b/include/Actor/ActorUnkIWTS.hpp @@ -20,7 +20,7 @@ public: class ActorUnkIWTS : public Actor { public: /* 00 (base) */ - /* 94 */ STRUCT_PAD(0x94, 0x22F8); + /* 94 */ PAD(0x94, 0x22F8); /* 22F8 */ VecFx32 mUnk_22F8; ActorUnkIWTS(); @@ -62,7 +62,7 @@ public: void func_ov084_02152cec(void); void func_ov084_02152d10(void); void func_ov084_02153018(void); - bool func_ov084_02153064(ActorRef *pRef, Mat4x3p **param2); + bool func_ov084_02153064(ActorRef *pRef, MtxFx43 **param2); void func_ov084_021530d4(void); void func_ov084_0215315c(void); void func_ov084_02153194(void); diff --git a/include/Actor/ActorUnkKEYN.hpp b/include/Actor/ActorUnkKEYN.hpp index f171a173..07ce1ae6 100644 --- a/include/Actor/ActorUnkKEYN.hpp +++ b/include/Actor/ActorUnkKEYN.hpp @@ -21,7 +21,7 @@ public: class ActorUnkKEYN : public Actor { public: /* 00 (base) */ - /* 94 */ STRUCT_PAD(0x94, 0xA0); + /* 94 */ PAD(0x94, 0xA0); /* A0 */ ItemId mItemId; ActorUnkKEYN(); diff --git a/include/Actor/ActorUnkMRD2.hpp b/include/Actor/ActorUnkMRD2.hpp index efa8ca0a..613ecf51 100644 --- a/include/Actor/ActorUnkMRD2.hpp +++ b/include/Actor/ActorUnkMRD2.hpp @@ -20,7 +20,7 @@ public: class ActorUnkMRD2 : public Actor { public: /* 000 (base) */ - /* 094 */ STRUCT_PAD(0x094, 0x910); + /* 094 */ PAD(0x094, 0x910); /* 910 */ unk32 mUnk_910; ActorUnkMRD2(); diff --git a/include/Actor/ActorUnkNSSW.hpp b/include/Actor/ActorUnkNSSW.hpp index e860419b..7d022881 100644 --- a/include/Actor/ActorUnkNSSW.hpp +++ b/include/Actor/ActorUnkNSSW.hpp @@ -21,11 +21,11 @@ public: class ActorUnkNSSW : public Actor { public: /* 000 (base) */ - /* 094 */ STRUCT_PAD(0x094, 0x0BC); + /* 094 */ PAD(0x094, 0x0BC); /* 0BC */ unk32 mUnk_0BC; - /* 0C0 */ STRUCT_PAD(0x0C0, 0x184); + /* 0C0 */ PAD(0x0C0, 0x184); #if IS_JP - /* 184 */ STRUCT_PAD(0x184, 0x190); + /* 184 */ PAD(0x184, 0x190); /* 190 */ MapObjectUnkSWSW *mUnk_184_eur; /* 194 */ MapObjectUnkSWSW *mUnk_188_eur; #else diff --git a/include/Actor/ActorUnkRB1T.hpp b/include/Actor/ActorUnkRB1T.hpp index 9271ca5b..81472f83 100644 --- a/include/Actor/ActorUnkRB1T.hpp +++ b/include/Actor/ActorUnkRB1T.hpp @@ -23,13 +23,13 @@ public: /* 000 (base) */ /* 120 */ Actor_Derived1_94_0C *mUnk_120; - /* 124 */ STRUCT_PAD(0x124, 0x20C); + /* 124 */ PAD(0x124, 0x20C); /* 20C */ ModelRender mUnk_20C; // actually a derived class of a derived class - /* 26C */ STRUCT_PAD(0x26C, 0x280); + /* 26C */ PAD(0x26C, 0x280); /* 280 */ unk32 mUnk_280; - /* 284 */ STRUCT_PAD(0x284, 0x300); + /* 284 */ PAD(0x284, 0x300); /* 300 */ unk32 mUnk_300; - /* 304 */ STRUCT_PAD(0x304, 0x36C); + /* 304 */ PAD(0x304, 0x36C); /* 36C */ unk8 mUnk_36C; /* 36D */ unk8 mUnk_36D; /* 36E */ unk8 mUnk_36E; diff --git a/include/Actor/ActorUnkRBLS.hpp b/include/Actor/ActorUnkRBLS.hpp index 253aea39..149d0ce0 100644 --- a/include/Actor/ActorUnkRBLS.hpp +++ b/include/Actor/ActorUnkRBLS.hpp @@ -21,7 +21,7 @@ public: /* 00 (base) */ /* 94 */ ModelRender mUnk_94; /* F4 */ UnkStruct_ov063_02163784 mUnk_F4; - /* 134 */ STRUCT_PAD(0x134, 0x160); + /* 134 */ PAD(0x134, 0x160); /* 160 */ ActorUnkRBLS(); diff --git a/include/Actor/ActorUnkRMSBase.hpp b/include/Actor/ActorUnkRMSBase.hpp index 26631251..168de4ed 100644 --- a/include/Actor/ActorUnkRMSBase.hpp +++ b/include/Actor/ActorUnkRMSBase.hpp @@ -11,7 +11,7 @@ public: /* F4 */ ModelRender mUnk_F4; /* 154 */ u8 mUnk_154; /* 155 */ unk8 mUnk_155; - /* 156 */ STRUCT_PAD(0x156, 0x158); + /* 156 */ PAD(0x156, 0x158); /* 158 */ ActorUnkRMSBase(); diff --git a/include/Actor/ActorUnkRMSD.hpp b/include/Actor/ActorUnkRMSD.hpp index dfdac2ab..c6b7472d 100644 --- a/include/Actor/ActorUnkRMSD.hpp +++ b/include/Actor/ActorUnkRMSD.hpp @@ -12,7 +12,7 @@ class ActorUnkRMSD : public ActorUnkRMSBase { public: /* 00 (base) */ /* 158 */ UnkStruct_ov063_021632e4 mUnk_158; - /* 198 */ STRUCT_PAD(0x198, 0x1D4); //! INFO: Force alignment to match ::Create + /* 198 */ PAD(0x198, 0x1D4); //! INFO: Force alignment to match ::Create /* 1D4 */ ActorUnkRMSD(); diff --git a/include/Actor/ActorUnkRMSV.hpp b/include/Actor/ActorUnkRMSV.hpp index 30ea8457..aebbe643 100644 --- a/include/Actor/ActorUnkRMSV.hpp +++ b/include/Actor/ActorUnkRMSV.hpp @@ -33,9 +33,9 @@ class ActorUnkRMSV : public ActorUnkRMSBase { public: /* 00 (base) */ /* 158 */ UnkStruct_ov063_021632e4 mUnk_158; - /* 198 */ STRUCT_PAD(0x198, 0x1D4); //! INFO: Force alignment to match ::Create + /* 198 */ PAD(0x198, 0x1D4); //! INFO: Force alignment to match ::Create /* 1D4 */ UnkStruct_ov063_021632e4 mUnk_1D4; - /* 214 */ STRUCT_PAD(0x214, 0x250); //! INFO: Force alignment to match ::Create + /* 214 */ PAD(0x214, 0x250); //! INFO: Force alignment to match ::Create /* 250 */ ActorUnkRMSV(); diff --git a/include/Actor/ActorUnkRMSW.hpp b/include/Actor/ActorUnkRMSW.hpp index 013e8fa1..b212e69b 100644 --- a/include/Actor/ActorUnkRMSW.hpp +++ b/include/Actor/ActorUnkRMSW.hpp @@ -22,7 +22,7 @@ class ActorUnkRMSW : public ActorUnkRMSBase { public: /* 00 (base) */ /* 158 */ UnkStruct_ov063_021632e4 mUnk_158; - /* 198 */ STRUCT_PAD(0x198, 0x1D4); //! INFO: Force alignment to match ::Create + /* 198 */ PAD(0x198, 0x1D4); //! INFO: Force alignment to match ::Create /* 1D4 */ ActorUnkRMSW(); diff --git a/include/Actor/ActorUnkRPMT.hpp b/include/Actor/ActorUnkRPMT.hpp index f2744e14..5942bbcc 100644 --- a/include/Actor/ActorUnkRPMT.hpp +++ b/include/Actor/ActorUnkRPMT.hpp @@ -26,7 +26,7 @@ enum ActorUnkRPMTState_ { class ActorUnkRPMT : public Actor { public: /* 00 (base) */ - /* 94 */ STRUCT_PAD(0x94, 0xA4); + /* 94 */ PAD(0x94, 0xA4); /* A4 */ bool mUnk_A4; /* A5 */ diff --git a/include/Actor/ActorUnkSHIT.hpp b/include/Actor/ActorUnkSHIT.hpp index 0d173d78..86290596 100644 --- a/include/Actor/ActorUnkSHIT.hpp +++ b/include/Actor/ActorUnkSHIT.hpp @@ -21,9 +21,9 @@ public: class ActorUnkSHIT : public Actor { public: /* 000 (base) */ - /* 094 */ STRUCT_PAD(0x94, 0xE4); + /* 094 */ PAD(0x94, 0xE4); /* 0E4 */ ItemId mItemId; - /* 0E8 */ STRUCT_PAD(0xE8, 0x2D3); + /* 0E8 */ PAD(0xE8, 0x2D3); /* 2D3 */ bool mUnk_2D3; ActorUnkSHIT(); diff --git a/include/Actor/ActorUnkSWBM.hpp b/include/Actor/ActorUnkSWBM.hpp index 880b507b..3723075b 100644 --- a/include/Actor/ActorUnkSWBM.hpp +++ b/include/Actor/ActorUnkSWBM.hpp @@ -41,7 +41,7 @@ public: class ActorUnkSWBM_C8 : public UnkStruct_PlayerGet_74_base { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x14); + /* 04 */ PAD(0x04, 0x14); /* 14 */ ActorUnkSWBM *mUnk_14; /* 18 */ @@ -74,7 +74,7 @@ public: void func_ov031_020e6d48(); void func_ov031_020e6d80(unk32 param1); void func_ov031_020e6e84(ActorState state); - static void func_ov031_020e718c(VecFx32 *param0, Mat3p *param1, s32 param2, s16 param3, u16 param4, s16 param5); + static void func_ov031_020e718c(VecFx32 *param0, MtxFx33 *param1, s32 param2, s16 param3, u16 param4, s16 param5); }; class ActorProfileUnkSWBM : public ActorProfile { diff --git a/include/Actor/ActorUnkTGTZ.hpp b/include/Actor/ActorUnkTGTZ.hpp index 3064c591..a60d2a64 100644 --- a/include/Actor/ActorUnkTGTZ.hpp +++ b/include/Actor/ActorUnkTGTZ.hpp @@ -23,9 +23,9 @@ public: #else /* 094 */ ActorUnkTGTZ_ModelRender mUnk_094; /* 100 */ unk32 mUnk_100; - /* 104 */ STRUCT_PAD(0x104, 0x190); + /* 104 */ PAD(0x104, 0x190); #endif - /* 190 */ Mat3p mUnk_190; + /* 190 */ MtxFx33 mUnk_190; /* 1B4 */ ActorUnkNTTZ *mUnk_1B4; /* 1B8 */ unk32 mUnk_1B8; /* 1BC */ unk32 mUnk_1BC; diff --git a/include/Actor/ActorUnkTLKT.hpp b/include/Actor/ActorUnkTLKT.hpp index 2ded8438..4fd90785 100644 --- a/include/Actor/ActorUnkTLKT.hpp +++ b/include/Actor/ActorUnkTLKT.hpp @@ -19,7 +19,7 @@ enum ActorUnkTLKTState_ { class ActorUnkTLKTnCLLT_Base : public Actor { public: /* 00 (base) */ - /* 94 */ STRUCT_PAD(0x94, 0x9C); + /* 94 */ PAD(0x94, 0x9C); /* 9C */ ActorUnkTLKTnCLLT_Base(); diff --git a/include/Actor/ActorUnkZLSL_ZSRS.hpp b/include/Actor/ActorUnkZLSL_ZSRS.hpp index 0a113322..1c353c4c 100644 --- a/include/Actor/ActorUnkZLSL_ZSRS.hpp +++ b/include/Actor/ActorUnkZLSL_ZSRS.hpp @@ -45,7 +45,7 @@ public: /* 10 */ G3d_Model *mUnk_10; /* 14 */ unk32 mUnk_14; /* 18 */ unk8 mUnk_18; - /* 19 */ STRUCT_PAD(0x19, 0x1C); + /* 19 */ PAD(0x19, 0x1C); /* 1C */ UnkStruct_ov000_020b31a8(UnkSystem5 *param1, ModelRender *param2, UnkActorFileSystem2 *param3); @@ -76,7 +76,7 @@ public: /* 00 (base) */ /* 1C */ UnkSystem5 mUnk_1C; /* 5C */ unk32 mUnk_5C; - /* 60 */ STRUCT_PAD(0x60, 0x7C); + /* 60 */ PAD(0x60, 0x7C); /* 7C */ ActorUnkZLSL_27CC(UnkSystem5 *param1, ModelRender *param2, UnkActorFileSystem2 *param3) : @@ -113,7 +113,7 @@ public: /* 20 */ unk32 mUnk_20; /* 24 */ unk32 mUnk_24; /* 28 */ unk8 mUnk_28; // deduced from strb [..., 0x18] - /* 29 */ STRUCT_PAD(0x29, 0x2A); + /* 29 */ PAD(0x29, 0x2A); /* 2A */ unk16 mUnk_2A; /* 2C */ @@ -141,7 +141,7 @@ public: /* 00 (base) */ /* 04 */ UnkSystem5 *mUnk_04; /* 08 */ ModelRender *mUnk_08; - /* 0C */ STRUCT_PAD(0x0C, 0x1C); + /* 0C */ PAD(0x0C, 0x1C); /* 1C */ UnkSystem5 *mUnk_1C; /* 20 */ @@ -219,38 +219,38 @@ public: class ActorUnkZLSL : public Actor_Derived1 { public: /* 0000 (base) */ - /* 0120 */ STRUCT_PAD(0x120, 0x1620); + /* 0120 */ PAD(0x120, 0x1620); /* 1620 */ ModelRender_ov031_02113670 mUnk_1620; - /* 1680 */ STRUCT_PAD(0x1680, 0x1690); + /* 1680 */ PAD(0x1680, 0x1690); /* 1690 */ ActorUnkZLSL_1690 mUnk_1690; - /* 1694 */ STRUCT_PAD(0x1694, 0x2700); + /* 1694 */ PAD(0x1694, 0x2700); /* 2700 */ ActorUnkZLSL_2700 mUnk_2700; - /* 2704 */ STRUCT_PAD(0x275C, 0x276C); + /* 2704 */ PAD(0x275C, 0x276C); /* 276C */ ModelRender_ov031_02113670 mUnk_276C; /* 27CC */ ActorUnkZLSL_27CC mUnk_27CC; /* 2828 */ UnkStruct_PlayerGet_ec mUnk_2828; /* 282C */ unk32 mUnk_282C; /* 2830 */ unk32 mUnk_2830; - /* 2834 */ STRUCT_PAD(0x2834, 0x2838); + /* 2834 */ PAD(0x2834, 0x2838); /* 2838 */ unk32 mUnk_2838; /* 283C */ unk32 mUnk_283C; - /* 2840 */ STRUCT_PAD(0x2840, 0x2844); + /* 2840 */ PAD(0x2840, 0x2844); /* 2844 */ unk32 mUnk_2844; /* 2848 */ unk32 mUnk_2848; - /* 284C */ STRUCT_PAD(0x284C, 0x2850); + /* 284C */ PAD(0x284C, 0x2850); /* 2850 */ unk32 mUnk_2850; /* 2854 */ unk32 mUnk_2854; - /* 2858 */ STRUCT_PAD(0x2858, 0x285C); + /* 2858 */ PAD(0x2858, 0x285C); /* 285C */ unk32 mUnk_285C; /* 2860 */ unk32 mUnk_2860; - /* 2864 */ STRUCT_PAD(0x2864, 0x286A); + /* 2864 */ PAD(0x2864, 0x286A); /* 286A */ unk16 mUnk_286A; /* 286C */ unk16 mUnk_286C; /* 286E */ unk16 mUnk_286E; /* 2870 */ unk16 mUnk_2870; /* 2872 */ s16 mUnk_2872; /* 2874 */ bool mUnk_2874; - /* 2875 */ STRUCT_PAD(0x2875, 0x2878); + /* 2875 */ PAD(0x2875, 0x2878); /* 2878 */ VecFx32 mUnk_2878; /* 2884 */ unk32 mUnk_2884; /* 2888 */ fx32 mUnk_2888; @@ -263,15 +263,15 @@ public: /* 28C0 */ unk32 mUnk_28C0; /* 28C4 */ unk32 mUnk_28C4; /* 28C8 */ unk32 mUnk_28C8; - /* 2894 */ STRUCT_PAD(0x28CC, 0x28DC); + /* 2894 */ PAD(0x28CC, 0x28DC); /* 28DC */ ActorRef mUnk_28DC; - /* 28E0 */ STRUCT_PAD(0x28E0, 0x28E4); + /* 28E0 */ PAD(0x28E0, 0x28E4); /* 28E4 */ unk16 mUnk_28E4; - /* 28E6 */ STRUCT_PAD(0x28E6, 0x28E8); + /* 28E6 */ PAD(0x28E6, 0x28E8); /* 28E8 */ VecFx32 mUnk_28E8; /* 28F4 */ VecFx32 mUnk_28F4; /* 2900 */ u16 mUnk_2900; - /* 2902 */ STRUCT_PAD(0x2902, 0x2904); + /* 2902 */ PAD(0x2902, 0x2904); /* 2904 */ unk32 mUnk_2904; /* 2908 */ diff --git a/include/Actor/Actor_Derived1.hpp b/include/Actor/Actor_Derived1.hpp index 02cba2da..8f00972a 100644 --- a/include/Actor/Actor_Derived1.hpp +++ b/include/Actor/Actor_Derived1.hpp @@ -36,9 +36,9 @@ public: class Actor_Derived1_94_vfunc_10 { public: - /* 00 */ STRUCT_PAD(0x00, 0x04); + /* 00 */ PAD(0x00, 0x04); /* 04 */ unk32 mUnk_04; - /* 08 */ STRUCT_PAD(0x04, 0x08); + /* 08 */ PAD(0x04, 0x08); /* 0C */ unk32 mUnk_0C; /* 10 */ }; @@ -135,7 +135,7 @@ public: /* 0B4 */ unk32 mUnk_0B4; /* 0B8 */ unk32 mUnk_0B8; /* 0BC */ ActorRef mUnk_0BC; - /* 0C0 */ Vec3p mUnk_0C0; + /* 0C0 */ VecFx32Cpp mUnk_0C0; /* 0CC */ unk16 mUnk_0CC; /* 0CC */ unk16 mUnk_0CE; /* 0D0 */ unk32 mUnk_0D0; diff --git a/include/Game/Game.hpp b/include/Game/Game.hpp index f8f6ca37..9484f5c3 100644 --- a/include/Game/Game.hpp +++ b/include/Game/Game.hpp @@ -4,6 +4,7 @@ #include "Game/GameModeStartUp.hpp" #include "Save/SaveManager.hpp" #include "global.h" +#include "nitro/os.h" #include "types.h" typedef void (*GameUnkCallback1)(void); @@ -15,8 +16,8 @@ class GameModeFileSelect; class UnkStruct_02049a2c_1C { public: /* 00 (vtable) */ - /* 04 */ unk32 mUnk_04; - /* 08 */ STRUCT_PAD(0x08, 0xCC); + /* 04 */ OSThread mUnk_04; + /* C0 */ PAD(0xC0, 0xCC); /* CC */ UnkStruct_02049a2c_1C(); diff --git a/include/Game/GameModeBattle.hpp b/include/Game/GameModeBattle.hpp index 334fb098..f2f11261 100644 --- a/include/Game/GameModeBattle.hpp +++ b/include/Game/GameModeBattle.hpp @@ -7,7 +7,7 @@ class GameModeBattle : public GameModeBase { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x4C); + /* 04 */ PAD(0x04, 0x4C); /* 4C */ GameModeBattle(unk32 param1); diff --git a/include/Game/GameModeContactMode.hpp b/include/Game/GameModeContactMode.hpp index 3dd3aba4..a35942d6 100644 --- a/include/Game/GameModeContactMode.hpp +++ b/include/Game/GameModeContactMode.hpp @@ -8,7 +8,7 @@ class GameModeContactMode : public GameModeBase { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x20); + /* 04 */ PAD(0x04, 0x20); /* 20 */ GameModeContactMode(); diff --git a/include/Game/GameModeDownloadPlay.hpp b/include/Game/GameModeDownloadPlay.hpp index 0c867948..62008714 100644 --- a/include/Game/GameModeDownloadPlay.hpp +++ b/include/Game/GameModeDownloadPlay.hpp @@ -8,7 +8,7 @@ class UnkStruct_ov001_020c46fc { public: /* 00000 (vtable) */ - /* 00004 */ STRUCT_PAD(0x04, 0xAF054); + /* 00004 */ PAD(0x04, 0xAF054); /* AF054 */ UnkStruct_ov001_020c46fc(); @@ -19,9 +19,9 @@ public: class GameModeDownloadPlay : public GameModeBase { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x48); + /* 04 */ PAD(0x04, 0x48); /* 48 */ UnkStruct_ov001_020c46fc *mUnk_48; - /* 4C */ STRUCT_PAD(0x4C, 0x6C); + /* 4C */ PAD(0x4C, 0x6C); /* 6C */ GameModeDownloadPlay(); diff --git a/include/Game/GameModeManager.hpp b/include/Game/GameModeManager.hpp index e69f7b9a..82772bb1 100644 --- a/include/Game/GameModeManager.hpp +++ b/include/Game/GameModeManager.hpp @@ -18,7 +18,7 @@ class UnkStruct_0204a110_Sub2; class GameModeManagerBase_004_00 { public: - /* 00 */ STRUCT_PAD(0x00, 0x38); + /* 00 */ PAD(0x00, 0x38); /* 38 */ GameModeManagerBase_004_00(s16 param1); diff --git a/include/Item/ItemManager.hpp b/include/Item/ItemManager.hpp index 71c3ee08..2ab7f6c0 100644 --- a/include/Item/ItemManager.hpp +++ b/include/Item/ItemManager.hpp @@ -53,7 +53,7 @@ public: /* 08 */ UnkStruct_ItemManager_20_00_08 mUnk_08; /* 1C */ unk32 mUnk_1C; /* 20 */ UnkStruct_ItemManager_20_00_20 mUnk_20; - /* 24 */ STRUCT_PAD(0x24, 0x2C); + /* 24 */ PAD(0x24, 0x2C); /* 2C */ unk16 mUnk_2C; /* 2E */ unk16 mUnk_2E; // pad? /* 30 */ @@ -78,7 +78,7 @@ public: /* 04 */ unk32 mUnk_04; /* 08 */ unk32 mUnk_08; /* 0C */ bool mUnk_0C; - /* 0D */ STRUCT_PAD(0x0D, 0x10); + /* 0D */ PAD(0x0D, 0x10); /* 10 */ UnkStruct_ItemManager_20_04_08_310(); //! TODO: params @@ -89,14 +89,14 @@ public: /* 000 (vtable) */ /* 004 (base) */ /* 00C */ unk32 mUnk_00C; - /* 010 */ STRUCT_PAD(0x10, 0x310); + /* 010 */ PAD(0x10, 0x310); /* 310 */ UnkStruct_ItemManager_20_04_08_310 mUnk_310; /* 320 */ unk32 mUnk_320; /* 324 */ unk16 mUnk_324; /* 326 */ bool mUnk_326; /* 327 */ bool mUnk_327; /* 328 */ unk32 mUnk_328; - /* 32C */ STRUCT_PAD(0x32C, 0x3CC); + /* 32C */ PAD(0x32C, 0x3CC); /* 3CC */ void *mUnk_3CC; /* 3D0 */ unk32 mUnk_3D0; /* 3D4 */ diff --git a/include/MainGame/AdventureMode.hpp b/include/MainGame/AdventureMode.hpp index 4d13c545..0985e642 100644 --- a/include/MainGame/AdventureMode.hpp +++ b/include/MainGame/AdventureMode.hpp @@ -150,9 +150,9 @@ public: class AdventureModeManager_160_14 { public: - /* 00 */ STRUCT_PAD(0x00, 0x1C); + /* 00 */ PAD(0x00, 0x1C); /* 1C */ unk32 mUnk_1C; - /* 20 */ STRUCT_PAD(0x20, 0x40); + /* 20 */ PAD(0x20, 0x40); /* 40 */ AdventureModeManager_160_18 *mUnk_40; /* 44 */ unk32 mUnk_44; /* 48 */ unk32 mUnk_48; @@ -228,7 +228,7 @@ public: class AdventureModeManager_164 : public FileSelectManager_UnkDrawBase { public: /* 00 (base) */ - /* 0C */ STRUCT_PAD(0x0C, 0x1C); + /* 0C */ PAD(0x0C, 0x1C); /* 1C */ AdventureModeManager_164(GameModeManagerBase_104 *param1, GameModeManagerBase_004 *param2); // overlay 26 @@ -245,7 +245,7 @@ public: class AdventureModeManager_168 : public FileSelectManager_UnkDrawBase { public: /* 00 (base) */ - /* 0C */ STRUCT_PAD(0x0C, 0x20); + /* 0C */ PAD(0x0C, 0x20); /* 20 */ bool mUnk_20; /* 21 */ bool mUnk_21; /* 24 */ @@ -269,7 +269,7 @@ public: class AdventureModeManager_16C : public FileSelectManager_UnkDrawBase { public: /* 00 (base) */ - /* 0C */ STRUCT_PAD(0x0C, 0x1C); + /* 0C */ PAD(0x0C, 0x1C); /* 1C */ bool mUnk_1C; /* 20 */ @@ -521,7 +521,7 @@ public: class AdventureModeManager_188 : public FileSelectManager_UnkDrawBase { public: /* 00 (base) */ - /* 0C */ STRUCT_PAD(0x0C, 0x38); + /* 0C */ PAD(0x0C, 0x38); AdventureModeManager_188(GameModeManagerBase_104 *param1); // overlay 31 @@ -549,7 +549,7 @@ public: class AdventureModeManager_18C_10 { public: - /* 0000 */ STRUCT_PAD(0x0000, 0x10E9); + /* 0000 */ PAD(0x0000, 0x10E9); /* 10E9 */ u8 mUnk_10E9; /* 10EA */ unk8 mUnk_10EA; // pad? /* 10EB */ unk8 mUnk_10EB; // pad? @@ -653,7 +653,7 @@ public: class AdventureModeManager_194_0C { public: - /* 00 (base) */ STRUCT_PAD(0x00, 0xC4); + /* 00 (base) */ PAD(0x00, 0xC4); /* C4 */ u8 mUnk_C4; /* C8 */ }; @@ -662,7 +662,7 @@ class AdventureModeManager_194 : public FileSelectManager_UnkDrawBase { public: /* 00 (base) */ /* 0C */ AdventureModeManager_194_0C *mUnk_0C; - /* 10 */ STRUCT_PAD(0x10, 0x48); + /* 10 */ PAD(0x10, 0x48); /* 48 */ AdventureModeManager_194(GameModeManagerBase_104 *param1); @@ -681,7 +681,7 @@ public: class AdventureModeManager_198 : public FileSelectManager_UnkDrawBase { public: /* 00 (base) */ - /* 0C */ STRUCT_PAD(0x0C, 0x3C); + /* 0C */ PAD(0x0C, 0x3C); AdventureModeManager_198(GameModeManagerBase_104 *param1); // overlay 58 @@ -699,7 +699,7 @@ public: class AdventureModeManager_19C : public FileSelectManager_UnkDrawBase { public: /* 00 (base) */ - /* 0C */ STRUCT_PAD(0x0C, 0x14); + /* 0C */ PAD(0x0C, 0x14); /* 14 */ AdventureModeManager_19C(GameModeManagerBase_104 *param1); // overlay 26 @@ -753,7 +753,7 @@ public: class AdventureModeManager_1A8 : public FileSelectManager_UnkDrawBase { public: /* 00 (base) */ - /* 0C */ STRUCT_PAD(0x0C, 0x38); + /* 0C */ PAD(0x0C, 0x38); AdventureModeManager_1A8(GameModeManagerBase_104 *param1); // overlay 88 @@ -783,7 +783,7 @@ public: class AdventureModeManager_1B0 : public GameModeManagerBase_104 { public: /* 1C */ UnkStruct_ov019_020d24c8_28_258 mUnk_1C; - /* 34 */ STRUCT_PAD(0x34, 0x50); + /* 34 */ PAD(0x34, 0x50); /* 50 */ AdventureModeManager_1B0(); // overlay 31 @@ -901,7 +901,7 @@ public: class AdventureModeManager_1BC : public AdventureModeManager_1B8_Base { public: /* 00 (base) */ - /* 24 */ STRUCT_PAD(0x24, 0x34); + /* 24 */ PAD(0x24, 0x34); /* 34 */ bool mUnk_34; /* 35 */ unk8 mUnk_35; /* 36 */ unk8 mUnk_36; diff --git a/include/MainGame/UnkAdventureModeSystem1.hpp b/include/MainGame/UnkAdventureModeSystem1.hpp index c231edf1..a38b6af4 100644 --- a/include/MainGame/UnkAdventureModeSystem1.hpp +++ b/include/MainGame/UnkAdventureModeSystem1.hpp @@ -6,7 +6,7 @@ #include struct UnkAdventureModeSystem1_48 { - /* 00 */ STRUCT_PAD(0x00, 0x2A); + /* 00 */ PAD(0x00, 0x2A); /* 2A */ bool mUnk_2A; }; diff --git a/include/MainGame/UnkTrainSystems.hpp b/include/MainGame/UnkTrainSystems.hpp index ac5e11d2..f637dc6e 100644 --- a/include/MainGame/UnkTrainSystems.hpp +++ b/include/MainGame/UnkTrainSystems.hpp @@ -36,18 +36,18 @@ class UnkTrainSystem2 { this->mModelRender.vfunc_08(G3d_GetModelPtr(data_027e0d00->mUnk_0F4->mUnk_50)); } - void SetTransform(const Mat3p *param1, const VecFx32 *param2, fx32 param3) { + void SetTransform(const MtxFx33 *param1, const VecFx32 *param2, fx32 param3) { VecFx32 temp; temp.x = param3; temp.y = param3; temp.z = param3; - this->mModelRender.vfunc_10(&temp, (Mat3p *) param1, (VecFx32 *) param2); + this->mModelRender.vfunc_10(&temp, (MtxFx33 *) param1, (VecFx32 *) param2); } UnkTrainSystem2(); ~UnkTrainSystem2(); void func_ov024_020d5990(); - void func_ov024_020d5afc(const Mat3p *param1, const VecFx32 *param2, unk32 param3); + void func_ov024_020d5afc(const MtxFx33 *param1, const VecFx32 *param2, unk32 param3); bool func_ov024_020d5c40(); }; diff --git a/include/MapObject/MapObjectBombFlower.hpp b/include/MapObject/MapObjectBombFlower.hpp index ab0dbdc3..e642c5e1 100644 --- a/include/MapObject/MapObjectBombFlower.hpp +++ b/include/MapObject/MapObjectBombFlower.hpp @@ -24,7 +24,7 @@ class MapObjectBombFlower : public MapObjectPot_Base { public: /* 00 (base) */ /* 48 */ ModelRender_ov031_0211578c mUnk_48; - /* A8 */ STRUCT_PAD(0xA8, 0xB0); + /* A8 */ PAD(0xA8, 0xB0); /* BC */ fx32 mUnk_B0; /* BC */ fx32 mUnk_B4; /* B8 */ Timer mUnk_B8; diff --git a/include/MapObject/MapObjectManager.hpp b/include/MapObject/MapObjectManager.hpp index b67f923a..12640655 100644 --- a/include/MapObject/MapObjectManager.hpp +++ b/include/MapObject/MapObjectManager.hpp @@ -32,7 +32,7 @@ public: /* 1E */ unk16 mUnk_1E; /* 20 */ unk16 mUnk_20; /* 22 */ unk16 mUnk_22; - /* 24 */ STRUCT_PAD(0x24, 0x6C); + /* 24 */ PAD(0x24, 0x6C); /* 6C */ void *mUnk_6C; /* 70 */ diff --git a/include/MapObject/MapObjectSwitchStep.hpp b/include/MapObject/MapObjectSwitchStep.hpp index ab82d98a..eeec96fc 100644 --- a/include/MapObject/MapObjectSwitchStep.hpp +++ b/include/MapObject/MapObjectSwitchStep.hpp @@ -39,7 +39,7 @@ public: /* 40 */ MapObjectSwitchStep_40 mUnk_40; /* A4 */ UnkSystem5 mUnk_A4; /* C4 */ unk32 mUnk_C4; - /* C8 */ STRUCT_PAD(0xC8, 0xE4); + /* C8 */ PAD(0xC8, 0xE4); /* E4 */ Timer mUnk_E4; /* E8 */ unk16 mUnk_E8; /* EA */ u8 mUnk_EA; // bool? diff --git a/include/MapObject/MapObjectUnkDRTY.hpp b/include/MapObject/MapObjectUnkDRTY.hpp index 66925460..f82607d7 100644 --- a/include/MapObject/MapObjectUnkDRTY.hpp +++ b/include/MapObject/MapObjectUnkDRTY.hpp @@ -11,9 +11,9 @@ class MapObjectUnkDRTY : public MapObjectUnkWPHL { //! TODO: fake? public: /* 00 (base) */ - /* 8C */ STRUCT_PAD(0x8C, 0xCC); + /* 8C */ PAD(0x8C, 0xCC); /* CC */ unk32 mUnk_CC; - /* D0 */ STRUCT_PAD(0xD0, 0xF4); + /* D0 */ PAD(0xD0, 0xF4); /* F4 */ MapObjectUnkDRTY(); diff --git a/include/MapObject/MapObjectUnkSKDI.hpp b/include/MapObject/MapObjectUnkSKDI.hpp index 302dc525..780b7432 100644 --- a/include/MapObject/MapObjectUnkSKDI.hpp +++ b/include/MapObject/MapObjectUnkSKDI.hpp @@ -28,11 +28,11 @@ public: /* 087 */ u8 mUnk_087; /* 088 */ u8 mUnk_088; /* 089 */ unk8 mUnk_089; - /* 080 */ STRUCT_PAD(0x08A, 0x08C); + /* 080 */ PAD(0x08A, 0x08C); /* 08C */ UnkStruct_ov031_Items_02 mUnk_08C; - /* 0A8 */ STRUCT_PAD(0x098, 0x0BC); + /* 0A8 */ PAD(0x098, 0x0BC); /* 0BC */ unk32 mUnk_0BC; - /* 0C0 */ STRUCT_PAD(0x0C0, 0x0D4); + /* 0C0 */ PAD(0x0C0, 0x0D4); /* 0D4 */ MapObject_10 mUnk_0D4; /* 0F8 */ Timer mUnk_0F8; /* 0FC */ unk32 mUnk_0FC; diff --git a/include/MapObject/MapObjectUnkSTAT.hpp b/include/MapObject/MapObjectUnkSTAT.hpp index 0bf0e547..ab284898 100644 --- a/include/MapObject/MapObjectUnkSTAT.hpp +++ b/include/MapObject/MapObjectUnkSTAT.hpp @@ -16,7 +16,7 @@ public: /* 54 */ unk32 mUnk_54; /* 58 */ unk16 mUnk_58; /* 5A */ Timer mUnk_5A; - /* 5E */ STRUCT_PAD(0x5E, 0x60); + /* 5E */ PAD(0x5E, 0x60); /* 60 */ unk32 mUnk_60; /* 64 */ unk32 mUnk_64; /* 68 */ unk32 mUnk_68; diff --git a/include/MapObject/MapObjectUnkSWHT.hpp b/include/MapObject/MapObjectUnkSWHT.hpp index 4119aba4..1b7311af 100644 --- a/include/MapObject/MapObjectUnkSWHT.hpp +++ b/include/MapObject/MapObjectUnkSWHT.hpp @@ -23,7 +23,7 @@ public: /* 054 */ ModelRender mUnk_054; /* 0B4 */ UnkSystem5 mUnk_0B4; /* 0D4 */ unk32 mUnk_0D4; - /* 0D8 */ STRUCT_PAD(0x0D8, 0x0F4); + /* 0D8 */ PAD(0x0D8, 0x0F4); /* 0F4 */ UnkSystem7 mUnk_0F4; /* 0F8 */ unk32 mUnk_0F8; /* 0FC */ unk32 mUnk_0FC; diff --git a/include/MapObject/MapObjectUnkSWSW.hpp b/include/MapObject/MapObjectUnkSWSW.hpp index d43c0626..120c8bc5 100644 --- a/include/MapObject/MapObjectUnkSWSW.hpp +++ b/include/MapObject/MapObjectUnkSWSW.hpp @@ -31,14 +31,14 @@ public: /* 040 */ MapObjectUnkSWSW_40 mUnk_040; /* 0AC */ UnkSystem5 mUnk_0AC; /* 0CC */ unk32 mUnk_0CC; - /* 0E0 */ STRUCT_PAD(0xD0, 0xEC); - /* 0EC */ VecFx32 mUnk_0EC; + /* 0E0 */ PAD(0xD0, 0xEC); + /* 0EC */ VecFx32Cpp mUnk_0EC; /* 0F8 */ ActorUnkNSSW *mUnk_0F8; /* 0FC */ unk32 mUnk_0FC; /* 100 */ Timer mUnk_100; /* 104 */ u8 mUnk_104; /* 105 */ u8 mUnk_105; - /* 106 */ STRUCT_PAD(0x106, 0x108); + /* 106 */ PAD(0x106, 0x108); /* 108 */ fx32 mUnk_108; /* 10C */ unk16 mUnk_10C; /* 10E */ Timer mUnk_10E; diff --git a/include/MapObject/MapObjectUnkWDST.hpp b/include/MapObject/MapObjectUnkWDST.hpp index 24b16219..3f293ffb 100644 --- a/include/MapObject/MapObjectUnkWDST.hpp +++ b/include/MapObject/MapObjectUnkWDST.hpp @@ -10,7 +10,7 @@ class MapObjectUnkWDST : public MapObject { public: /* 00 (base) */ - /* 40 */ STRUCT_PAD(0x40, 0xB8); + /* 40 */ PAD(0x40, 0xB8); /* B8 */ unk32 mUnk_B8; MapObjectUnkWDST(); diff --git a/include/MapObject/MapObjectUnkWPHL.hpp b/include/MapObject/MapObjectUnkWPHL.hpp index d6a0981d..8768f8cc 100644 --- a/include/MapObject/MapObjectUnkWPHL.hpp +++ b/include/MapObject/MapObjectUnkWPHL.hpp @@ -10,7 +10,7 @@ class MapObjectUnkWPHL : public MapObject { public: /* 00 (base) */ - /* 40 */ STRUCT_PAD(0x40, 0x8C); + /* 40 */ PAD(0x40, 0x8C); /* 8C */ MapObjectUnkWPHL(); diff --git a/include/Player/PlayerActorBase.hpp b/include/Player/PlayerActorBase.hpp index fc84518d..da872d2e 100644 --- a/include/Player/PlayerActorBase.hpp +++ b/include/Player/PlayerActorBase.hpp @@ -57,7 +57,7 @@ struct UnkStruct_ov000_020ab4dc { /* 24 */ const char mUnk_24[16]; /* 34 */ const char mUnk_34[16]; /* 44 */ const char mUnk_44[16]; - /* 54 */ STRUCT_PAD(0x54, 0x66); + /* 54 */ PAD(0x54, 0x66); /* 66 */ s16 mUnk_66; /* 66 */ unk16 mUnk_68; /* 66 */ unk16 mUnk_6A; @@ -66,12 +66,12 @@ struct UnkStruct_ov000_020ab4dc { /* 66 */ unk16 mUnk_70; /* 66 */ unk16 mUnk_72; /* 74 */ s16 mUnk_74; - /* 78 */ STRUCT_PAD(0x76, 0x83); + /* 78 */ PAD(0x76, 0x83); /* 83 */ u8 mUnk_83; /* 83 */ u8 mUnk_84; /* 83 */ u8 mUnk_85; /* 86 */ u8 mUnk_86[7]; - /* 8D */ STRUCT_PAD(0x8D, 0x98); + /* 8D */ PAD(0x8D, 0x98); /* 98 */ unk32 mUnk_98; /* 9C */ }; @@ -141,7 +141,7 @@ public: /* 78 */ unk32 mUnk_78; /* 7C */ unk32 mUnk_7C[9]; /* A0 */ unk32 mUnk_A0[7]; - /* BC */ Mat4x3p *mUnk_BC; + /* BC */ MtxFx43 *mUnk_BC; /* C0 */ ModelRender_Derived4(PlayerCharacter character, unk32 param2, G3d_Model *pModel, G3d_BoneMtxStruct *pCacheJntAnm); @@ -159,7 +159,7 @@ public: class ModelRender_Derived5 : public ModelRender_Derived3 { public: /* 00 (base) */ - /* 60 */ STRUCT_PAD(0x60, 0xA8); + /* 60 */ PAD(0x60, 0xA8); /* A8 */ ModelRender_Derived5(PlayerCharacter character, G3d_Model *pModel, G3d_BoneMtxStruct *pCacheJntAnm); @@ -257,7 +257,7 @@ public: class PlayerActorBase_70_1C : public UnkStruct_PlayerGet_74_base { private: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x2C); + /* 04 */ PAD(0x04, 0x2C); /* 2C */ public: @@ -273,7 +273,7 @@ public: class PlayerActorBase_70_30 { private: - /* 00 */ STRUCT_PAD(0x00, 0x1C); + /* 00 */ PAD(0x00, 0x1C); /* 1C */ public: @@ -283,7 +283,7 @@ public: class PlayerActorBase_70_6C { private: /* 00 */ UnkSystem5 mUnk_00; - /* 20 */ STRUCT_PAD(0x20, 0x70); + /* 20 */ PAD(0x20, 0x70); /* 70 */ public: @@ -294,7 +294,7 @@ public: class PlayerActorBase_70_DC { private: /* 00 */ UnkSystem5 mUnk_00; - /* 20 */ STRUCT_PAD(0x20, 0x60); + /* 20 */ PAD(0x20, 0x60); /* 60 */ public: @@ -331,7 +331,7 @@ public: class PlayerActorBase_70_134 { private: - /* 00 */ STRUCT_PAD(0x00, 0x28); + /* 00 */ PAD(0x00, 0x28); /* 28 */ public: @@ -364,8 +364,8 @@ public: /* 0DC */ PlayerActorBase_70_DC *mUnk_0DC; /* 0E0 */ PlayerActorBase_70_E0 mUnk_0E0; /* 0E4 */ PlayerActorBase_70_E4 mUnk_0E4; - /* 114 */ Mat4x3p *mUnk_114; // allocated array, size = PlayerCharacter_Max - /* 118 */ Vec3p mUnk_118; + /* 114 */ MtxFx43 *mUnk_114; // allocated array, size = PlayerCharacter_Max + /* 118 */ VecFx32Cpp mUnk_118; /* 124 */ UnkAngleStruct mUnk_124; /* 126 */ s8 mUnk_126; /* 127 */ bool mUnk_127; @@ -422,12 +422,12 @@ public: void func_ov001_020db190(); // overlay 102 - void func_ov102_02182c20(unk32 param1, Mat4x3p *param2); - void func_ov102_02182c84(bool param1, unk32 param2, UnkAngleStruct param3, Mat4x3p *param4, Mat4x3p *param5); + void func_ov102_02182c20(unk32 param1, MtxFx43 *param2); + void func_ov102_02182c84(bool param1, unk32 param2, UnkAngleStruct param3, MtxFx43 *param4, MtxFx43 *param5); }; struct PlayerActorBase_78_04 { - STRUCT_PAD(0x00, 0x0C); + PAD(0x00, 0x0C); void func_ov000_0205c584(unk32 param1, unk32 param2); }; @@ -457,20 +457,20 @@ public: class PlayerLinkActor_9C { public: /* 000 (vtable) */ - /* 004 */ STRUCT_PAD(0x04, 0x08); + /* 004 */ PAD(0x04, 0x08); /* 008 */ ActorRef mUnk_008; //! TODO: confirm type - /* 00C */ STRUCT_PAD(0x0C, 0x34); + /* 00C */ PAD(0x0C, 0x34); /* 034 */ PlayerLinkActor_9C_34 mUnk_034; - /* 004 */ STRUCT_PAD(0x50, 0x5A); + /* 004 */ PAD(0x50, 0x5A); /* 05A */ UnkAngleStruct mUnk_5A; - /* 05C */ STRUCT_PAD(0x5C, 0x6C); + /* 05C */ PAD(0x5C, 0x6C); /* 06C */ VecFx32 mUnk_06C; - /* 078 */ STRUCT_PAD(0x78, 0x90); + /* 078 */ PAD(0x78, 0x90); /* 090 */ s16 mUnk_090; /* 090 */ unk16 mUnk_092; /* 094 */ unk32 mUnk_094; /* 098 */ unk16 mUnk_098; - /* 094 */ STRUCT_PAD(0x9A, 0xDC); + /* 094 */ PAD(0x9A, 0xDC); /* 0DC */ u16 mUnk_0DC; /* 0DE */ unk16 mUnk_0DE; /* 0E0 */ unk32 mUnk_0E0; @@ -483,11 +483,11 @@ public: /* 0FC */ bool mUnk_0FC; /* 100 */ unk32 mUnk_100; /* 104 */ VecFx32 mUnk_104; - /* 110 */ STRUCT_PAD(0x110, 0x138); + /* 110 */ PAD(0x110, 0x138); /* 138 */ s16 mUnk_138; /* 13A */ u16 mUnk_13A; /* 13C */ unk16 mUnk_13C; - /* 13E */ STRUCT_PAD(0x13E, 0x154); + /* 13E */ PAD(0x13E, 0x154); /* 154 */ PlayerLinkActor_9C(UnkStruct_027e0ce0_40 *param1, u32 rawGrabParams, PlayerCharacter character); @@ -516,10 +516,10 @@ public: class PlayerActorBase { public: - /* 00 */ VecFx32 mPos; - /* 0C */ VecFx32 mPrevPos; - /* 18 */ VecFx32 mVel; - /* 24 */ VecFx32 mAccel; + /* 00 */ VecFx32Cpp mPos; + /* 0C */ VecFx32Cpp mPrevPos; + /* 18 */ VecFx32Cpp mVel; + /* 24 */ VecFx32Cpp mAccel; /* 30 */ UnkAngleStruct mAngle; /* 32 */ u8 mInvincibilityTimer; /* 33 */ u8 mInvincibilityIconTimer; // the blinking icon on top-screen diff --git a/include/Player/PlayerGet.hpp b/include/Player/PlayerGet.hpp index 0061745f..c792fd20 100644 --- a/include/Player/PlayerGet.hpp +++ b/include/Player/PlayerGet.hpp @@ -124,14 +124,14 @@ public: class UnkStruct_PlayerGet_48 { public: /* 00 */ unk32 mUnk_00; - /* 04 */ STRUCT_PAD(0x04, 0x40); + /* 04 */ PAD(0x04, 0x40); /* 40 */ unk16 mUnk_40; /* 42 */ unk16 mUnk_42; /* 44 */ unk8 mUnk_44; /* 45 */ unk8 mUnk_45; /* 46 */ unk8 mUnk_46; /* 47 */ unk8 mUnk_47; - /* 48 */ STRUCT_PAD(0x48, 0x5E); + /* 48 */ PAD(0x48, 0x5E); /* 5E */ unk16 mUnk_5E; /* 60 */ unk8 mUnk_60; /* 61 */ unk8 mUnk_61; diff --git a/include/Player/PlayerLink.hpp b/include/Player/PlayerLink.hpp index 2d685bbb..3423b5db 100644 --- a/include/Player/PlayerLink.hpp +++ b/include/Player/PlayerLink.hpp @@ -49,7 +49,7 @@ public: /* 00 */ UnkStruct_027e0ce0_40 *mUnk_00; /* 04 */ unk16 mUnk_04; /* 06 */ bool mUnk_06; - /* 07 */ STRUCT_PAD(0x07, 0x0C); + /* 07 */ PAD(0x07, 0x0C); /* 0C */ ActorRef mUnk_0C; /* 10 */ @@ -187,14 +187,14 @@ public: /* 30 */ unk32 mUnk_30; /* 34 */ PlayerLinkActor_A0_34 mUnk_34; /* 38 */ PlayerLinkActor_A0_38 *mUnk_38; - /* 3C */ STRUCT_PAD(0x3C, 0x5C); + /* 3C */ PAD(0x3C, 0x5C); /* 5C */ UnkStruct_PlayerGet_64 mUnk_5C; /* 68 */ unk32 mUnk_68; /* 6C */ unk32 mUnk_6C; /* 70 */ u32 mUnk_70; /* 74 */ unk32 mUnk_74; /* 78 */ bool mUnk_78; - /* 79 */ STRUCT_PAD(0x79, 0x7D); + /* 79 */ PAD(0x79, 0x7D); /* 7D */ bool mUnk_7D; /* 7E */ bool mUnk_7E; /* 80 */ void *mUnk_80; diff --git a/include/Player/PlayerPhantom.hpp b/include/Player/PlayerPhantom.hpp index 74a30364..eeb61cdc 100644 --- a/include/Player/PlayerPhantom.hpp +++ b/include/Player/PlayerPhantom.hpp @@ -10,7 +10,7 @@ public: /* 000 (base) */ /* 094 */ unk32 mUnk_94; /* 098 */ unk32 mUnk_98; - /* 09C */ STRUCT_PAD(0x9C, 0x154); + /* 09C */ PAD(0x9C, 0x154); /* 154 */ PlayerPhantomActor(unk32 param1, unk32 param2, UnkStruct_027e0ce0_40 *param3, bool *param4); diff --git a/include/Player/PlayerZelda.hpp b/include/Player/PlayerZelda.hpp index d9f0708d..dff03815 100644 --- a/include/Player/PlayerZelda.hpp +++ b/include/Player/PlayerZelda.hpp @@ -11,14 +11,14 @@ public: /* 000 (base) */ /* 094 */ unk32 mUnk_94; /* 098 */ PlayerActorBase *mpPlayer; - /* 09C */ STRUCT_PAD(0x9C, 0xCC); + /* 09C */ PAD(0x9C, 0xCC); /* 0CC */ bool mUnk_0CC; - /* 0CD */ STRUCT_PAD(0xCD, 0xD0); + /* 0CD */ PAD(0xCD, 0xD0); /* 0D0 */ unk32 mUnk_0D0; /* 0D4 */ unk32 mUnk_0D4; /* 0D8 */ unk32 mUnk_0D8; /* 0DC */ unk32 mUnk_0DC; - /* 0E0 */ STRUCT_PAD(0xE0, 0x154); + /* 0E0 */ PAD(0xE0, 0x154); /* 154 */ PlayerZeldaActor(void *param1, UnkStruct_027e0ce0_40 *param2, UnkStruct_027e0ce0_40_150 *param3, ItemFlag *pEquippedItem); diff --git a/include/Render/ModelRender.hpp b/include/Render/ModelRender.hpp index 7c866566..9add75bb 100644 --- a/include/Render/ModelRender.hpp +++ b/include/Render/ModelRender.hpp @@ -23,8 +23,8 @@ typedef void (*UnkSystem4_UnkCallback)(void *, unk32); class UnkSystem4_vfunc_1C_B4 { public: /* 00 */ unk32 mUnk_00; - /* 00 */ STRUCT_PAD(0x04, 0x28); - /* 28 */ Mat3p mUnk_28; + /* 00 */ PAD(0x04, 0x28); + /* 28 */ MtxFx33 mUnk_28; /* 4C */ unk32 mUnk_4C; /* 50 */ unk32 mUnk_50; /* 54 */ unk32 mUnk_54; @@ -34,7 +34,7 @@ class UnkSystem4_vfunc_1C { public: /* 00 */ u8 *mUnk_00; /* 04 */ unk32 *mUnk_04; - /* 08 */ STRUCT_PAD(0x08, 0xB4); + /* 08 */ PAD(0x08, 0xB4); /* B4 */ UnkSystem4_vfunc_1C_B4 *mUnk_B4; /* 00 */ unk32 *mUnk_B8; }; @@ -51,10 +51,10 @@ public: // data_ov000_020b1a98 /* 00 */ virtual ~ModelRenderBase(); /* 08 */ virtual void vfunc_08(G3d_Model *pModel); - /* 0C */ virtual void vfunc_0C() = 0; - /* 10 */ virtual void vfunc_10(VecFx32 *param1, Mat3p *param2, VecFx32 *param3) = 0; - /* 14 */ virtual void vfunc_14(Mat3p *param1, VecFx32 *param2) = 0; - /* 18 */ virtual void vfunc_18(VecFx32 *param1) = 0; + /* 0C */ virtual void vfunc_0C() = 0; + /* 10 */ virtual void vfunc_10(VecFx32 *param1, MtxFx33 *param2, VecFx32 *param3) = 0; + /* 14 */ virtual void vfunc_14(MtxFx33 *param1, VecFx32 *param2) = 0; + /* 18 */ virtual void vfunc_18(VecFx32 *param1) = 0; /* 1C */ void func_01ffc634(VecFx32 *param1, UnkAngleStruct param2, VecFx32 *param3); @@ -79,8 +79,8 @@ public: /* 00 */ virtual ~ModelRender(); /* 08 */ virtual void vfunc_08(G3d_Model *pModel) override; /* 0C */ virtual void vfunc_0C() override; - /* 10 */ virtual void vfunc_10(VecFx32 *param1, Mat3p *param2, VecFx32 *param3) override; // SetTransform? - /* 14 */ virtual void vfunc_14(Mat3p *param1, VecFx32 *param2) override; // SetRotationTranslation? + /* 10 */ virtual void vfunc_10(VecFx32 *param1, MtxFx33 *param2, VecFx32 *param3) override; // SetTransform? + /* 14 */ virtual void vfunc_14(MtxFx33 *param1, VecFx32 *param2) override; // SetRotationTranslation? /* 18 */ virtual void vfunc_18(VecFx32 *param1) override; /* 1C */ virtual void vfunc_1C(UnkSystem4_vfunc_1C *param1); /* 20 */ virtual void vfunc_20(); @@ -104,8 +104,8 @@ public: // data_ov000_020b1a48 /* 00 */ virtual ~UnkSystem6_Derived1() override {} - /* 10 */ virtual void vfunc_10(VecFx32 *param1, Mat3p *param2, VecFx32 *param3) override; - /* 14 */ virtual void vfunc_14(Mat3p *param1, VecFx32 *param2) override; + /* 10 */ virtual void vfunc_10(VecFx32 *param1, MtxFx33 *param2, VecFx32 *param3) override; + /* 14 */ virtual void vfunc_14(MtxFx33 *param1, VecFx32 *param2) override; /* 18 */ virtual void vfunc_18(VecFx32 *param1) override; }; @@ -138,7 +138,7 @@ class ModelRender_ov000_020b198c : public ModelRenderBase { public: /* 00 (base) */ /* 08 */ unk8 mUnk_08; - /* 09 */ STRUCT_PAD(0x09, 0x0A); + /* 09 */ PAD(0x09, 0x0A); /* 0A */ unk16 mUnk_0A; /* 0C */ unk16 mUnk_0C; /* 0E */ @@ -149,8 +149,8 @@ public: // data_ov000_020b198c /* 08 */ virtual void vfunc_08(G3d_Model *pModel) override; // func_ov000_02057908 /* 0C */ virtual void vfunc_0C() override; // func_ov000_0205793c - /* 10 */ virtual void vfunc_10(VecFx32 *param1, Mat3p *param2, VecFx32 *param3) override; - /* 14 */ virtual void vfunc_14(Mat3p *param1, VecFx32 *param2) override; + /* 10 */ virtual void vfunc_10(VecFx32 *param1, MtxFx33 *param2, VecFx32 *param3) override; + /* 14 */ virtual void vfunc_14(MtxFx33 *param1, VecFx32 *param2) override; /* 18 */ virtual void vfunc_18(VecFx32 *param1) override; void func_ov000_02057ed8(G3d_Model *pModel); diff --git a/include/Save/SaveFile.hpp b/include/Save/SaveFile.hpp index 826342fa..9204722a 100644 --- a/include/Save/SaveFile.hpp +++ b/include/Save/SaveFile.hpp @@ -20,7 +20,7 @@ struct SaveFile_00000_0000_Data_D8 { /* 00 */ unk32 unk_00; - /* 04 */ STRUCT_PAD(0x04, 0x40); + /* 04 */ PAD(0x04, 0x40); /* 40 */ UnkStruct_Param1 unk_40; /* 58 */ unk32 unk_58; /* 5C */ unk32 unk_5C; @@ -270,7 +270,7 @@ struct SaveInfoData { /* 02A */ u16 mUnk_02A; /* 02C */ u16 mUnk_02C; - /* 028 */ STRUCT_PAD(0x30, 0x40); + /* 028 */ PAD(0x30, 0x40); /* 040 */ SaveInventory inventory; /* 0D8 */ SaveFile_00000_0000_Data_D8 unk_0D8; /* 158 */ SaveFile_00000_0000_Data_158 unk_158; @@ -319,11 +319,11 @@ struct SaveTreasureData { }; struct SaveFile_00000_1D00_Data { - /* 000 */ STRUCT_PAD(0x00, 0xFE); + /* 000 */ PAD(0x00, 0xFE); /* 0FE */ unk16 unk_0FE; - /* 100 */ STRUCT_PAD(0x100, 0x3C4); + /* 100 */ PAD(0x100, 0x3C4); /* 3C4 */ wchar_t unk_3C4[LENGTH_PLAYER_NAME + 1]; - /* 3D6 */ STRUCT_PAD(0x3D6, 0x3FE); + /* 3D6 */ PAD(0x3D6, 0x3FE); /* 3FE */ u16 unk_3FE; /* 400 */ }; diff --git a/include/Save/SaveManager.hpp b/include/Save/SaveManager.hpp index 7056b2c9..20dddab6 100644 --- a/include/Save/SaveManager.hpp +++ b/include/Save/SaveManager.hpp @@ -40,7 +40,7 @@ struct SaveManager_00 { class SaveManager_244 { public: - /* 00 */ STRUCT_PAD(0x00, 0x7E); + /* 00 */ PAD(0x00, 0x7E); /* 7E */ u16 mUnk_7E; /* 80 */ @@ -51,7 +51,7 @@ class SaveManager { public: /* 000 */ SaveManager_00 *mUnk_000; // related to mUnk_184, allocated from func_ov001_020ba670 /* 004 */ unk32 mUnk_004; - /* 008 */ STRUCT_PAD(0x08, 0x204); + /* 008 */ PAD(0x08, 0x204); /* 204 */ u16 mCardId; /* 206 */ s16 mUnk_206; // this is a save slot index? /* 208 */ unk16 mUnk_208; diff --git a/include/System/OverlayManager.hpp b/include/System/OverlayManager.hpp index e3507134..1991ea79 100644 --- a/include/System/OverlayManager.hpp +++ b/include/System/OverlayManager.hpp @@ -7,6 +7,9 @@ typedef u32 ItemFlag; +#define EXTERN_OVERLAY_ID(name_or_index) extern u32 OVERLAY_##name_or_index##_ID; +#define OVERLAY_ID(name_or_index) ((u32) & OVERLAY_##name_or_index##_ID) + EXTERN_OVERLAY_ID(0); EXTERN_OVERLAY_ID(1); EXTERN_OVERLAY_ID(2); diff --git a/include/System/SysNew.hpp b/include/System/SysNew.hpp index 052b978b..29cfc26e 100644 --- a/include/System/SysNew.hpp +++ b/include/System/SysNew.hpp @@ -58,7 +58,7 @@ public: class UnkStruct_02011e10_2C { public: /* 00 */ UnkStruct_02011e10_Sub1 *mUnk_00; - /* 04 */ STRUCT_PAD(0x04, 0x18); + /* 04 */ PAD(0x04, 0x18); /* 18 */ UnkStruct_02011e10_2C(); diff --git a/include/Unknown/Common.hpp b/include/Unknown/Common.hpp index 0dd94c7b..efe739f1 100644 --- a/include/Unknown/Common.hpp +++ b/include/Unknown/Common.hpp @@ -534,7 +534,7 @@ public: class UnkSystem2_UnkSubSystem7_Derived2 { public: /* 00 */ UnkSystem2_UnkSubSystem7 mUnk_00; - /* 04 */ STRUCT_PAD(0x04, 0x64); + /* 04 */ PAD(0x04, 0x64); UnkSystem2_UnkSubSystem7_Derived2(); }; @@ -620,7 +620,7 @@ public: /* 05C */ unk32 mUnk_04C; /* 060 */ unk32 mUnk_050; /* 064 */ unk32 mUnk_054; - /* 068 */ STRUCT_PAD(0x58, 0x130); + /* 068 */ PAD(0x58, 0x130); /* 130 */ UnkSystem2_UnkSubSystem5_Base_10(); @@ -686,7 +686,7 @@ public: class UnkSystem2_UnkSubSystem11_Derived1 : public UnkSystem2_UnkSubSystem11_Base { public: /* 00 (base) */ - /* 30 */ STRUCT_PAD(0x30, 0xC0); + /* 30 */ PAD(0x30, 0xC0); /* C0 */ UnkSystem2_UnkSubSystem11_Derived1(); // func_ov000_02061f30 @@ -708,7 +708,7 @@ public: class UnkSystem2_UnkSubSystem11_Derived2 : public UnkSystem2_UnkSubSystem11_Derived1 { public: /* 00 (base) */ - /* C0 */ STRUCT_PAD(0xC0, 0xE0); + /* C0 */ PAD(0xC0, 0xE0); /* E0 */ UnkSystem2_UnkSubSystem11_Derived2() {} @@ -850,7 +850,7 @@ class UnkStruct2 { public: /* 00 */ unk32 mUnk_00; /* 04 */ const char *mUnk_04; - /* 08 */ STRUCT_PAD(0x08, 0x10); + /* 08 */ PAD(0x08, 0x10); /* 10 */ UnkStruct2(const char *path, unk32 param2); @@ -967,7 +967,7 @@ struct UnkStackStruct1 { extern "C" void func_ov000_02072fd0(UnkStackStruct1 *); struct UnkSystem7_UnkStruct_00_20_00 { - /* 00 */ STRUCT_PAD(0x00, 0x04); + /* 00 */ PAD(0x00, 0x04); /* 04 */ VecFx32 mUnk_04; }; @@ -977,11 +977,11 @@ struct UnkSystem7_UnkStruct_00_20 { }; struct UnkSystem7_UnkStruct_00 { - /* 00 */ STRUCT_PAD(0x00, 0x20); + /* 00 */ PAD(0x00, 0x20); /* 20 */ UnkSystem7_UnkStruct_00_20 *mUnk_20; /* 24 */ unk32 mUnk_24; /* 28 */ VecFx32 mUnk_28; - /* 34 */ STRUCT_PAD(0x34, 0xA0); + /* 34 */ PAD(0x34, 0xA0); /* A0 */ unk32 mUnk_A0; /* A4 */ unk16 mUnk_A4; diff --git a/include/Unknown/UICounterManager.hpp b/include/Unknown/UICounterManager.hpp index ee961110..ba70cee5 100644 --- a/include/Unknown/UICounterManager.hpp +++ b/include/Unknown/UICounterManager.hpp @@ -123,7 +123,7 @@ public: class UnkStruct_020d8698_2C_198 { public: - /* 00 */ STRUCT_PAD(0x00, 0x80); + /* 00 */ PAD(0x00, 0x80); /* 80 */ }; @@ -219,9 +219,9 @@ public: // this is the item button, it's technically a counter because of arrows and bombs class UICounter_Items : public LinkList { public: - /* 008 */ STRUCT_PAD(0x0C, 0x18B); + /* 008 */ PAD(0x0C, 0x18B); /* 18B */ bool mUnk_18B; - /* 18C */ STRUCT_PAD(0x18C, 0x52C); + /* 18C */ PAD(0x18C, 0x52C); /* 52C */ UICounter_Items(); // overlay 31 diff --git a/include/Unknown/UnkStruct_02049b18.hpp b/include/Unknown/UnkStruct_02049b18.hpp index 4b0718ef..8c4b2081 100644 --- a/include/Unknown/UnkStruct_02049b18.hpp +++ b/include/Unknown/UnkStruct_02049b18.hpp @@ -19,7 +19,7 @@ public: /* 06 */ UnkStruct_02049b18_06 mUnk_06; /* 28 */ u16 mUnk_28; /* 2A */ u16 mUnk_2A; - /* 2C */ STRUCT_PAD(0x2C, 0x58); + /* 2C */ PAD(0x2C, 0x58); /* 58 */ unk16 mUnk_58; /* 5A */ unk16 mUnk_5A; diff --git a/include/Unknown/UnkStruct_0204a110.hpp b/include/Unknown/UnkStruct_0204a110.hpp index f854ae41..764d5f60 100644 --- a/include/Unknown/UnkStruct_0204a110.hpp +++ b/include/Unknown/UnkStruct_0204a110.hpp @@ -29,11 +29,11 @@ struct UnkStruct_0204a110_Sub2_000 { unk32 mUnk_34[2]; unk32 mUnk_3C[2]; unk32 mUnk_44[2]; - STRUCT_PAD(0x4C, 0x150); + PAD(0x4C, 0x150); unk32 mUnk_150; unk32 mUnk_154; UnkStruct_0204a110_Sub2_000_158 mUnk_158[16]; - STRUCT_PAD(0x258, 0x358); + PAD(0x258, 0x358); unk32 mUnk_358; }; @@ -56,7 +56,7 @@ public: /* 034 */ unk32 mUnk_034[2]; /* 03C */ unk32 mUnk_03C[2]; /* 044 */ unk32 mUnk_044[2]; - /* 04C */ STRUCT_PAD(0x4C, 0x150); + /* 04C */ PAD(0x4C, 0x150); /* 150 */ unk32 mUnk_150[2]; /* 158 */ UnkStruct_0204a110_Sub2_158 mUnk_158[2][16]; /* 358 */ unk32 mUnk_358[2]; @@ -144,7 +144,7 @@ public: class UnkStruct_0204a110_Sub7_08 : public UnkSubStruct1_Base { public: /* 00 (vtable) */ - /* 0B */ STRUCT_PAD(0x20, 0x30); + /* 0B */ PAD(0x20, 0x30); /* 30 */ UnkStruct_0204a110_Sub7_08(); @@ -235,14 +235,14 @@ public: /* 010 */ UnkStruct_0204a110_Sub2 mUnk_010; /* 370 */ UnkStruct_0204a110_Sub3 mUnk_370; /* 794 */ UnkStruct_0204a110_Sub4 mUnk_794; - /* 798 */ STRUCT_PAD(0x798, 0xD9C); + /* 798 */ PAD(0x798, 0xD9C); /* D9C */ UnkStruct_0204a110_Sub5 mUnk_D9C; /* DA4 */ unk8 mUnk_DA4; /* DA5 */ unk8 mUnk_DA5; /* DA6 */ unk8 mUnk_DA6; /* DA7 */ unk8 mUnk_DA7; /* DA8 */ UnkStruct_0204a110_Sub6 mUnk_DA8; - /* DBC */ STRUCT_PAD(0xDBC, 0xDC0); + /* DBC */ PAD(0xDBC, 0xDC0); /* DC0 */ UnkStruct_0204a110_Sub7 mUnk_DC0; /* DDC */ UnkStruct_0204a110_Sub8 mUnk_DDC; /* DEC */ GameModeManagerBase *mpManager; diff --git a/include/Unknown/UnkStruct_0204e5f8.hpp b/include/Unknown/UnkStruct_0204e5f8.hpp index 7e276b21..d85e8032 100644 --- a/include/Unknown/UnkStruct_0204e5f8.hpp +++ b/include/Unknown/UnkStruct_0204e5f8.hpp @@ -33,7 +33,7 @@ public: /* 1A */ unk8 mUnk_1A; /* 1B */ unk8 mUnk_1B; /* 1C */ UnkStruct_0204e5f8_1C mUnk_1C; - /* 2C */ STRUCT_PAD(0x2C, 0x38); + /* 2C */ PAD(0x2C, 0x38); /* 38 */ unk8 mUnk_38; /* 39 */ unk8 mUnk_39; /* 3A */ u16 mUnk_3A; diff --git a/include/Unknown/UnkStruct_027e0208.hpp b/include/Unknown/UnkStruct_027e0208.hpp index 41716acd..9168f2db 100644 --- a/include/Unknown/UnkStruct_027e0208.hpp +++ b/include/Unknown/UnkStruct_027e0208.hpp @@ -6,9 +6,9 @@ class UnkStruct_027e0208 { public: /* 000 */ unk32 mUnk_000; - /* 004 */ STRUCT_PAD(0x04, 0x94); + /* 004 */ PAD(0x04, 0x94); /* 094 */ unk32 mUnk_094; - /* 098 */ STRUCT_PAD(0x98, 0xE0); + /* 098 */ PAD(0x98, 0xE0); /* 0E0 */ unk32 mUnk_0E0; /* 0E4 */ unk32 mUnk_0E4; /* 0E8 */ unk32 mUnk_0E8; diff --git a/include/Unknown/UnkStruct_027e095c.hpp b/include/Unknown/UnkStruct_027e095c.hpp index 10ac8025..bb05bb5b 100644 --- a/include/Unknown/UnkStruct_027e095c.hpp +++ b/include/Unknown/UnkStruct_027e095c.hpp @@ -10,19 +10,19 @@ public: #if IS_JP /* 000 */ VecFx32 mUnk_000[64]; /* 300 */ unk32 mUnk_2F4; - /* 304 */ STRUCT_PAD(0x304, 0x900); + /* 304 */ PAD(0x304, 0x900); /* 900 */ void *mUnk_8DC; /* 904 */ unk32 mUnk_8E0; - /* 908 */ STRUCT_PAD(0x908, 0x964); + /* 908 */ PAD(0x908, 0x964); /* 960 */ void *mUnk_940; /* 968 */ #else /* 000 */ VecFx32 mUnk_000[63]; /* 2F4 */ unk32 mUnk_2F4; - /* 2F8 */ STRUCT_PAD(0x2F8, 0x8DC); + /* 2F8 */ PAD(0x2F8, 0x8DC); /* 8DC */ void *mUnk_8DC; /* 8E0 */ unk32 mUnk_8E0; - /* 8E4 */ STRUCT_PAD(0x8E4, 0x940); + /* 8E4 */ PAD(0x8E4, 0x940); /* 940 */ void *mUnk_940; /* 944 */ #endif diff --git a/include/Unknown/UnkStruct_027e09a0.hpp b/include/Unknown/UnkStruct_027e09a0.hpp index 16da469c..90a6dba1 100644 --- a/include/Unknown/UnkStruct_027e09a0.hpp +++ b/include/Unknown/UnkStruct_027e09a0.hpp @@ -8,10 +8,10 @@ #include "types.h" struct UnkStruct_func_ov000_020702a8 { - /* 00 */ STRUCT_PAD(0x00, 0x10); + /* 00 */ PAD(0x00, 0x10); /* 10 */ Vec2s mUnk_10; /* 14 */ u8 mUnk_14; - /* 15 */ STRUCT_PAD(0x15, 0x18); + /* 15 */ PAD(0x15, 0x18); /* 18 */ u16 mUnk_18; /* 1A */ u16 mUnk_1A; /* 1C */ u16 mUnk_1C; diff --git a/include/Unknown/UnkStruct_027e09a4.hpp b/include/Unknown/UnkStruct_027e09a4.hpp index 0566a344..bd66b2d4 100644 --- a/include/Unknown/UnkStruct_027e09a4.hpp +++ b/include/Unknown/UnkStruct_027e09a4.hpp @@ -117,7 +117,7 @@ struct EntranceInfo { class UnkStruct_WarpUnk1_24 : public UnkStruct_0204a060_Base3 { public: /* 00 (base) */ - /* 14 */ STRUCT_PAD(0x14, 0x2A); + /* 14 */ PAD(0x14, 0x2A); /* 2A */ bool mUnk_2A; /* 2C */ diff --git a/include/Unknown/UnkStruct_027e09b8.hpp b/include/Unknown/UnkStruct_027e09b8.hpp index a2fa72cf..035fa77f 100644 --- a/include/Unknown/UnkStruct_027e09b8.hpp +++ b/include/Unknown/UnkStruct_027e09b8.hpp @@ -18,7 +18,7 @@ struct stack_ov000_02073578 { class UnkStruct_027e09b8_00 { public: - /* 000 */ STRUCT_PAD(0x000, 0xFD0); + /* 000 */ PAD(0x000, 0xFD0); /* FD0 */ unk16 mUnk_FD0; // set to 1 when link has a blocking interaction? /* FD2 */ unk16 mUnk_FD2; /* FD4 */ @@ -48,7 +48,7 @@ public: class UnkStruct_027e09b8_04 : public UnkStruct_027e09b8_04_Base { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x14); + /* 04 */ PAD(0x04, 0x14); /* 14 */ UnkStruct_0204a060_Base mUnk_14; /* 38 */ UnkStruct_WarpUnk1_50 mUnk_38; /* 60 */ unk32 mUnk_60; @@ -71,7 +71,7 @@ public: class UnkStruct_027e09b8_08 : public UnkStruct_027e09b8_04_Base { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x30); + /* 04 */ PAD(0x04, 0x30); /* 30 */ UnkStruct_027e09b8_08(void *param1); @@ -83,9 +83,9 @@ public: class UnkStruct_027e09b8_0C : public UnkStruct_027e09b8_04_Base { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x0C); + /* 04 */ PAD(0x04, 0x0C); /* 0C */ UnkSystem1_ov000_Derived3 mUnk_0C; - /* 20 */ STRUCT_PAD(0x20, 0x98); + /* 20 */ PAD(0x20, 0x98); /* 98 */ UnkStruct_WarpUnk1_50 mUnk_98; /* C0 */ unk32 mUnk_C4; /* C4 */ MapObjectId mMapObjId; @@ -107,7 +107,7 @@ public: class UnkStruct_027e09b8_10 : public UnkStruct_027e09b8_04_Base { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x18); + /* 04 */ PAD(0x04, 0x18); /* 18 */ UnkStruct_027e09b8_10(); @@ -118,7 +118,7 @@ public: class UnkStruct_027e09b8_98 { public: - /* 0000 */ STRUCT_PAD(0x00, 0x151C); + /* 0000 */ PAD(0x00, 0x151C); /* 151C */ UnkStruct_027e09b8_98(); diff --git a/include/Unknown/UnkStruct_027e09bc.hpp b/include/Unknown/UnkStruct_027e09bc.hpp index 43d29ae5..53454ae5 100644 --- a/include/Unknown/UnkStruct_027e09bc.hpp +++ b/include/Unknown/UnkStruct_027e09bc.hpp @@ -31,16 +31,16 @@ struct UnkStruct_027e09bc_0C_268 { class UnkStruct_027e09bc_0C { public: /* 000 (vtable) */ - /* 004 */ STRUCT_PAD(0x04, 0x34); + /* 004 */ PAD(0x04, 0x34); /* 034 */ VecFx32 mUnk_034; /* 040 */ VecFx32 mUnk_040; - /* 04C */ STRUCT_PAD(0x4C, 0x58); + /* 04C */ PAD(0x4C, 0x58); /* 058 */ unk32 mUnk_058; - /* 05C */ STRUCT_PAD(0x5C, 0xCA); + /* 05C */ PAD(0x5C, 0xCA); /* 0CA */ unk16 mUnk_0CA; - /* 0CC */ STRUCT_PAD(0xCC, 0x230); + /* 0CC */ PAD(0xCC, 0x230); /* 230 */ UnkStruct_027e09bc_0C_230 *mUnk_230; - /* 234 */ STRUCT_PAD(0x234, 0x264); + /* 234 */ PAD(0x234, 0x264); /* 264 */ unk32 mUnk_264; /* 268 */ UnkStruct_027e09bc_0C_268 mUnk_268; /* 27C */ unk32 mUnk_27C; diff --git a/include/Unknown/UnkStruct_027e09c0.hpp b/include/Unknown/UnkStruct_027e09c0.hpp index efc6b0b0..47bedb73 100644 --- a/include/Unknown/UnkStruct_027e09c0.hpp +++ b/include/Unknown/UnkStruct_027e09c0.hpp @@ -60,9 +60,9 @@ public: /* 770 */ void *mUnk_770; /* 774 */ unk32 mUnk_774; /* 778 */ unk32 mUnk_778; - /* 77C */ STRUCT_PAD(0x77C, 0x878); + /* 77C */ PAD(0x77C, 0x878); /* 878 */ unk32 mUnk_878; - /* 87C */ STRUCT_PAD(0x87C, 0x978); + /* 87C */ PAD(0x87C, 0x978); /* 978 */ UnkStruct_027e09c0(); diff --git a/include/Unknown/UnkStruct_027e09e8.hpp b/include/Unknown/UnkStruct_027e09e8.hpp index 6abefd75..001d7df9 100644 --- a/include/Unknown/UnkStruct_027e09e8.hpp +++ b/include/Unknown/UnkStruct_027e09e8.hpp @@ -8,7 +8,7 @@ class UnkStruct_027e09e8 { public: /* 00 */ unk32 mUnk_00; - /* 04 */ STRUCT_PAD(0x04, 0x24); + /* 04 */ PAD(0x04, 0x24); /* 24 */ ZCBEntryPLCB *mpPolyClassTable; /* 28 */ ZCBEntryPLCB *mpPolyClassTableEnd; /* 2C */ u32 mNumPolyClasses; diff --git a/include/Unknown/UnkStruct_027e0b48.hpp b/include/Unknown/UnkStruct_027e0b48.hpp index 93f40d33..f0858c4f 100644 --- a/include/Unknown/UnkStruct_027e0b48.hpp +++ b/include/Unknown/UnkStruct_027e0b48.hpp @@ -6,7 +6,7 @@ class UnkStruct_027e0b48_IteratorEntry { public: - /* 00 */ STRUCT_PAD(0x00, 0x70); + /* 00 */ PAD(0x00, 0x70); /* 70 */ void *mUnk_70; /* 74 */ diff --git a/include/Unknown/UnkStruct_027e0cd8.hpp b/include/Unknown/UnkStruct_027e0cd8.hpp index 613f453a..3b182d3c 100644 --- a/include/Unknown/UnkStruct_027e0cd8.hpp +++ b/include/Unknown/UnkStruct_027e0cd8.hpp @@ -105,7 +105,7 @@ public: class UnkStruct_027e0cd8_0C_Base_98 { public: - /* 00 */ STRUCT_PAD(0x00, 0xB0); + /* 00 */ PAD(0x00, 0xB0); /* B0 */ UnkStruct_027e0cd8_0C_Base_98(); @@ -117,7 +117,7 @@ public: class UnkStruct_027e0cd8_0C_Base_148_00_Base { public: - /* 00 */ STRUCT_PAD(0x00, 0x14); + /* 00 */ PAD(0x00, 0x14); /* 14 */ UnkStruct_027e0cd8_0C_Base_148_00_Base(); @@ -125,7 +125,7 @@ public: class UnkStruct_027e0cd8_0C_Base_148_00 : public UnkStruct_027e0cd8_0C_Base_148_00_Base { public: - /* 00 */ STRUCT_PAD(0x14, 0x2C); + /* 00 */ PAD(0x14, 0x2C); /* 2C */ UnkStruct_027e0cd8_0C_Base_148_00(ZMBEntryARAB *pARAB); @@ -134,7 +134,7 @@ public: class UnkStruct_027e0cd8_0C_Base_148_01 : public UnkStruct_027e0cd8_0C_Base_148_00_Base { public: - /* 00 */ STRUCT_PAD(0x14, 0x28); + /* 00 */ PAD(0x14, 0x28); /* 28 */ UnkStruct_027e0cd8_0C_Base_148_01(ZMBEntryARAB *pARAB); @@ -143,7 +143,7 @@ public: class UnkStruct_027e0cd8_0C_Base_148_02 : public UnkStruct_027e0cd8_0C_Base_148_00_Base { public: - /* 00 */ STRUCT_PAD(0x14, 0x34); + /* 00 */ PAD(0x14, 0x34); /* 34 */ UnkStruct_027e0cd8_0C_Base_148_02(ZMBEntryARAB *pARAB); @@ -184,7 +184,7 @@ enum UnkFlags2_ { class UnkStruct_func_ov000_02080620 { public: /* 00 (vtable) */ - /* 04 */ STRUCT_PAD(0x04, 0x14); + /* 04 */ PAD(0x04, 0x14); /* 14 */ VecFx32 mUnk_14; /* 20 */ VecFx32 mUnk_20; /* 2C */ @@ -348,7 +348,7 @@ public: class UnkStruct_027e0cd8_0C_Derived2 : public UnkStruct_027e0cd8_0C_Base { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x160, 0x4F8); + /* 04 */ PAD(0x160, 0x4F8); UnkStruct_027e0cd8_0C_Derived2(UnkStruct_027e0cd8 *param1); }; @@ -365,7 +365,7 @@ public: /* 04 */ unk32 mUnk_04; /* 08 */ s16 mUnk_08; /* 0C */ volatile u32 mUnk_0C; - /* 10 */ STRUCT_PAD(0x10, 0x50); + /* 10 */ PAD(0x10, 0x50); /* 50 */ UnkStruct_027e0cd8_04_0C(); @@ -387,9 +387,9 @@ public: /* 16 */ u8 mUnk_16; /* 16 */ u8 mUnk_17; /* 18 */ Vec2p mUnk_18; - /* 20 */ STRUCT_PAD(0x20, 0x40); + /* 20 */ PAD(0x20, 0x40); /* 40 */ u8 mUnk_40[1][10]; // at least one - STRUCT_PAD(0x4C, 0xB4); + PAD(0x4C, 0xB4); /* B4 */ UnkStruct_027e0cd8_04(); diff --git a/include/Unknown/UnkStruct_027e0ce0.hpp b/include/Unknown/UnkStruct_027e0ce0.hpp index 0cee78bd..de14b246 100644 --- a/include/Unknown/UnkStruct_027e0ce0.hpp +++ b/include/Unknown/UnkStruct_027e0ce0.hpp @@ -57,7 +57,7 @@ public: class UnkStruct_027e0ce0_1C_C8 { public: - /* 00 */ STRUCT_PAD(0x00, 0x20); + /* 00 */ PAD(0x00, 0x20); /* 20 */ UnkStruct_027e0ce0_1C_C8(unk32 param1, unk32 param2); @@ -66,7 +66,7 @@ public: class UnkStruct_027e0ce0_1C_D4 { public: - /* 0000 */ STRUCT_PAD(0x00, 0x6AD8); + /* 0000 */ PAD(0x00, 0x6AD8); /* 6AD8 */ UnkStruct_027e0ce0_1C_D4(); @@ -74,7 +74,7 @@ public: class UnkStruct_027e0ce0_1C_D8 { public: - /* 0000 */ STRUCT_PAD(0x00, 0x6AB0); + /* 0000 */ PAD(0x00, 0x6AB0); /* 6AB0 */ UnkStruct_027e0ce0_1C_D8(); @@ -107,7 +107,7 @@ public: class UnkStruct_027e0ce0_20 { public: - /* 00 */ STRUCT_PAD(0x00, 0x0C); + /* 00 */ PAD(0x00, 0x0C); /* 0C */ UnkStruct_027e0ce0_20(); @@ -116,9 +116,9 @@ public: class UnkStruct_027e0ce0_24 { public: - /* 00 */ STRUCT_PAD(0x00, 0x70); + /* 00 */ PAD(0x00, 0x70); /* 70 */ u16 mUnk_70[1]; //! TODO: confirm array size - /* 72 */ STRUCT_PAD(0x72, 0x88); + /* 72 */ PAD(0x72, 0x88); /* 88 */ UnkStruct_027e0ce0_24(); @@ -166,7 +166,7 @@ public: class UnkStruct_027e0ce0_30_04 { private: - /* 00 */ STRUCT_PAD(0x00, 0x0C); + /* 00 */ PAD(0x00, 0x0C); /* 0C */ public: @@ -176,7 +176,7 @@ public: class UnkStruct_027e0ce0_30_08 { private: - /* 00 */ STRUCT_PAD(0x00, 0x24); + /* 00 */ PAD(0x00, 0x24); /* 24 */ public: @@ -212,7 +212,7 @@ public: class UnkStruct_027e0ce0_34_20 { public: - /* 000 */ STRUCT_PAD(0x00, 0x960); + /* 000 */ PAD(0x00, 0x960); /* 960 */ UnkStruct_027e0ce0_34_20(); @@ -234,7 +234,7 @@ public: /* 30 */ u32 mSpiritTrackFlags; //! TODO: rename (actually handles train parts?) /* 34 */ unk32 mUnk_34; /* 38 */ u32 mTrackFlags[3]; - /* 44 */ STRUCT_PAD(0x44, 0xE8); + /* 44 */ PAD(0x44, 0xE8); /* E8 */ unk32 mUnk_E8; /* EC */ unk32 mUnk_EC; /* F0 */ unk32 mUnk_F0; @@ -284,7 +284,7 @@ public: class UnkStruct_027e0ce0_3C { public: /* 00 */ VecFx32 mUnk_00; - /* 0C */ STRUCT_PAD(0x0C, 0x98); + /* 0C */ PAD(0x0C, 0x98); /* 98 */ UnkStruct_027e0ce0_3C(); @@ -299,14 +299,14 @@ public: class UnkStruct_ov031_020f3310_00 { public: - /* 00 */ STRUCT_PAD(0x00, 0x06); + /* 00 */ PAD(0x00, 0x06); /* 06 */ u16 mUnk_06; /* 0A */ }; class UnkStruct_ov031_020f3310_04 { public: - /* 00 */ STRUCT_PAD(0x00, 0x24); + /* 00 */ PAD(0x00, 0x24); /* 24 */ unk32 mUnk_24[4]; /* 34 */ }; @@ -321,7 +321,7 @@ public: class UnkStruct_ov031_020e54d4 { public: - /* 00 */ STRUCT_PAD(0x00, 0x04); + /* 00 */ PAD(0x00, 0x04); /* 04 */ unk32 mUnk_04; /* 08 */ u32 mUnk_08; }; @@ -366,10 +366,10 @@ public: class UnkStruct_027e0ce0_38_58 { public: - /* 000 */ STRUCT_PAD(0x00, 0x338); + /* 000 */ PAD(0x00, 0x338); /* 338 */ unk32 mUnk_338; // rope pulled timer /* 33C */ unk32 mUnk_33C; // rope pull strength, 0 to 8 - /* 340 */ STRUCT_PAD(0x340, 0x3D4); + /* 340 */ PAD(0x340, 0x3D4); /* 3D4 */ UnkStruct_027e0ce0_38_58(); @@ -377,7 +377,7 @@ public: class UnkStruct_027e0ce0_38_5C { public: - /* 000 */ STRUCT_PAD(0x00, 0x1A4); + /* 000 */ PAD(0x00, 0x1A4); /* 1A4 */ UnkStruct_027e0ce0_38_5C(); @@ -385,7 +385,7 @@ public: class UnkStruct_027e0ce0_38_60 { public: - /* 00 */ STRUCT_PAD(0x00, 0xD8); + /* 00 */ PAD(0x00, 0xD8); /* D8 */ UnkStruct_027e0ce0_38_60(); @@ -393,7 +393,7 @@ public: class UnkStruct_027e0ce0_38_158 { public: - /* 000 */ STRUCT_PAD(0x00, 0x45C); + /* 000 */ PAD(0x00, 0x45C); /* 45C */ UnkStruct_027e0ce0_38_158(); @@ -403,7 +403,7 @@ public: class UnkStruct_027e0ce0_38_174 { public: - /* 00 */ STRUCT_PAD(0x00, 0x28); + /* 00 */ PAD(0x00, 0x28); /* 28 */ UnkStruct_027e0ce0_38_174(); @@ -411,7 +411,7 @@ public: class UnkStruct_027e0ce0_38_19C { public: - /* 00 */ STRUCT_PAD(0x00, 0x2C); + /* 00 */ PAD(0x00, 0x2C); /* 2C */ UnkStruct_027e0ce0_38_19C(); @@ -419,7 +419,7 @@ public: class UnkStruct_027e0ce0_38_1C8 { public: - /* 00 */ STRUCT_PAD(0x00, 0x34); + /* 00 */ PAD(0x00, 0x34); /* 34 */ UnkStruct_027e0ce0_38_1C8(); @@ -459,7 +459,7 @@ public: /* 150 */ unk32 mUnk_150; /* 154 */ unk32 mUnk_154; /* 158 */ UnkStruct_027e0ce0_38_158 *mUnk_158; - /* 15C */ STRUCT_PAD(0x15C, 0x170); + /* 15C */ PAD(0x15C, 0x170); /* 170 */ unk32 mUnk_170; /* 174 */ UnkStruct_027e0ce0_38_174 mUnk_174; /* 19C */ UnkStruct_027e0ce0_38_19C mUnk_19C; @@ -489,7 +489,7 @@ public: class UnkStruct_027e0ce0_40_Base_14 { public: /* 00 */ TouchControl mTouchControl; - /* 22 */ STRUCT_PAD(0x22, 0x24); + /* 22 */ PAD(0x22, 0x24); /* 24 */ VecFx32 mUnk_24; /* 30 */ VecFx32 mUnk_30; /* 3C */ unk32 mUnk_3C; @@ -568,7 +568,7 @@ struct UnkParamStruct1 { class UnkStruct_027e0ce0_40_Base_7C_04 { public: /* 00 */ unk32 mUnk_00; - /* 04 */ STRUCT_PAD(0x04, 0xB4); + /* 04 */ PAD(0x04, 0xB4); /* B4 */ UnkStruct_027e0ce0_40_Base_7C_04(); @@ -635,7 +635,7 @@ public: /* 1C */ ActorRef mUnk_1C; /* 20 */ Vec2s mTouchPosLast; /* 24 */ unk32 mUnk_24; - /* 28 */ STRUCT_PAD(0x28, 0x48); + /* 28 */ PAD(0x28, 0x48); /* 48 */ ActorRef mUnk_48; /* 4C */ u16 mUnk_4C; /* 50 */ @@ -771,7 +771,7 @@ class UnkStruct_027e0ce0_40_108 : public UnkStruct_027e0ce0_40_108_Base { public: /* 00 (base) */ /* 10 */ UnkStruct_027e0ce0_40_108_10 mUnk_10; - /* 18 */ STRUCT_PAD(0x16, 0x40); + /* 18 */ PAD(0x16, 0x40); /* 40 */ UnkStruct_027e0ce0_40_108_10 *mUnk_40; /* 44 */ @@ -791,7 +791,7 @@ public: class UnkStruct_027e0ce0_40_14C { public: - /* 00 */ STRUCT_PAD(0x00, 0x94); + /* 00 */ PAD(0x00, 0x94); /* 94 */ UnkStruct_027e0ce0_40_14C(); @@ -809,7 +809,7 @@ class UnkStruct_027e0ce0_40_150 { public: /* 00 */ bool mUnk_00; /* 01 */ bool mUnk_01; - /* 02 */ STRUCT_PAD(0x02, 0x0C); + /* 02 */ PAD(0x02, 0x0C); /* 0C */ UnkStruct_027e0ce0_40_150(); diff --git a/include/Unknown/UnkStruct_027e0cec.hpp b/include/Unknown/UnkStruct_027e0cec.hpp index a05d50d1..70eda0e5 100644 --- a/include/Unknown/UnkStruct_027e0cec.hpp +++ b/include/Unknown/UnkStruct_027e0cec.hpp @@ -37,9 +37,9 @@ public: struct UnkStruct_027e0cec_18_04_20 { /* 00 */ u32 mUnk_00_00 : 14; /* 00 */ u32 mUnk_00_14 : 1; - /* 04 */ STRUCT_PAD(0x04, 0x36); + /* 04 */ PAD(0x04, 0x36); /* 36 */ u16 mUnk_36; - /* 38 */ STRUCT_PAD(0x38, 0x40); + /* 38 */ PAD(0x38, 0x40); /* 40 */ u16 mUnk_40; }; @@ -67,7 +67,7 @@ public: /* 48 */ u16 mUnk_48; /* 48 */ u16 mUnk_4A; /* 48 */ u16 mUnk_4C; - /* 50 */ STRUCT_PAD(0x50, 0x84); + /* 50 */ PAD(0x50, 0x84); /* 84 */ unk32 mUnk_84_00 : 16; /* 84 */ u32 mUnk_84_16 : 3; /* 88 */ unk32 mUnk_88; diff --git a/include/Unknown/UnkStruct_027e0cf8.hpp b/include/Unknown/UnkStruct_027e0cf8.hpp index b7e67e12..5087df8f 100644 --- a/include/Unknown/UnkStruct_027e0cf8.hpp +++ b/include/Unknown/UnkStruct_027e0cf8.hpp @@ -18,7 +18,7 @@ struct UnkStruct_027e0cf8_00_18_00 { struct UnkStruct_027e0cf8_00_18 { /* 0000 */ UnkStruct_027e0cf8_00_18_00 mUnk_00[48]; /* 18C0 */ Vec2p mUnk_18C0; - /* 18C8 */ STRUCT_PAD(0x18C8, 0x2220); + /* 18C8 */ PAD(0x18C8, 0x2220); /* 2220 */ }; @@ -69,7 +69,7 @@ public: class UnkStruct_027e0cf8_04 { public: - /* 00 */ STRUCT_PAD(0x00, 0x1C); + /* 00 */ PAD(0x00, 0x1C); UnkStruct_027e0cf8_04(); diff --git a/include/Unknown/UnkStruct_027e0d00.hpp b/include/Unknown/UnkStruct_027e0d00.hpp index d6885d6e..66828884 100644 --- a/include/Unknown/UnkStruct_027e0d00.hpp +++ b/include/Unknown/UnkStruct_027e0d00.hpp @@ -10,7 +10,7 @@ #define MAX_TRAIN_SETS 8 struct UnkStruct_027e0d00_00 { - /* 00 */ STRUCT_PAD(0x00, 0x1B); + /* 00 */ PAD(0x00, 0x1B); /* 1B */ u8 mUnk_1B; /* 1C */ unk32 mUnk_1C; /* 20 */ unk32 mUnk_20; @@ -21,7 +21,7 @@ struct UnkStruct_027e0d00_00 { }; struct UnkStruct_027e0d00_10 { - /* 0000 */ STRUCT_PAD(0x00, 0x44C0); + /* 0000 */ PAD(0x00, 0x44C0); /* 44C0 */ }; @@ -50,7 +50,7 @@ public: class UnkStruct_027e0d00_E0 : public MapObjectProfile_Derived2_20_Base { public: /* 00 (base) */ - /* 94 */ STRUCT_PAD(0x94, 0xA8); + /* 94 */ PAD(0x94, 0xA8); /* A8 */ UnkStruct_027e0d00_E0(bool hasRecruitUniform); @@ -61,7 +61,7 @@ public: }; struct UnkStruct_027e0d00_FC { - /* 000 */ STRUCT_PAD(0x00, 0xD30); + /* 000 */ PAD(0x00, 0xD30); /* D30 */ }; diff --git a/include/Unknown/UnkStruct_ov000_0208f820.hpp b/include/Unknown/UnkStruct_ov000_0208f820.hpp index 93c1e8fc..501df26d 100644 --- a/include/Unknown/UnkStruct_ov000_0208f820.hpp +++ b/include/Unknown/UnkStruct_ov000_0208f820.hpp @@ -42,7 +42,7 @@ public: /* 00 */ unk32 mUnk_00; /* 04 */ unk32 mUnk_04; /* 08 */ u16 mUnk_08; - /* 0C */ STRUCT_PAD(0x0C, 0x38); + /* 0C */ PAD(0x0C, 0x38); /* 38 */ UnkStruct_PlayerGet_64 mUnk_38; void func_ov093_0216f76c(VecFx32 *param1, unk32 param2); @@ -50,14 +50,14 @@ public: class UnkStruct_ov000_0208f820_28 { public: - /* 00 */ STRUCT_PAD(0x00, 0x38); + /* 00 */ PAD(0x00, 0x38); /* 38 */ UnkStruct_PlayerGet_64 mUnk_38; - /* 42 */ STRUCT_PAD(0x44, 0x48); + /* 42 */ PAD(0x44, 0x48); /* 48 */ unk32 mUnk_48; /* 48 */ unk32 mUnk_4C; /* 48 */ unk32 mUnk_50; /* 54 */ ItemManager *pItemManager; - /* 58 */ STRUCT_PAD(0x58, 0x94); + /* 58 */ PAD(0x58, 0x94); /* 94 */ unk32 mUnk_94; /* 98 */ UnkStruct_ov000_0208f820_28_98 *mUnk_98; @@ -75,13 +75,13 @@ public: /* 10 */ unk32 mUnk_10; /* 14 */ unk16 mUnk_14; /* 16 */ unk16 mUnk_16; - /* 18 */ STRUCT_PAD(0x18, 0x26); + /* 18 */ PAD(0x18, 0x26); /* 26 */ unk16 mUnk_26; - /* 28 */ STRUCT_PAD(0x28, 0x58); + /* 28 */ PAD(0x28, 0x58); /* 58 */ unk16 mUnk_58; - /* 5A */ STRUCT_PAD(0x5A, 0x9C); + /* 5A */ PAD(0x5A, 0x9C); /* 9C */ unk32 mUnk_9C; - /* A0 */ STRUCT_PAD(0xA0, 0x148); + /* A0 */ PAD(0xA0, 0x148); /* 148 */ u32 mUnk_148; /* 14C */ unk32 mUnk_14C; /* 150 */ ActorRef mUnk_150; diff --git a/include/Unknown/UnkStruct_ov000_020b504c.hpp b/include/Unknown/UnkStruct_ov000_020b504c.hpp index d1a44000..17d15710 100644 --- a/include/Unknown/UnkStruct_ov000_020b504c.hpp +++ b/include/Unknown/UnkStruct_ov000_020b504c.hpp @@ -104,7 +104,7 @@ public: /* 08 */ unk16 mUnk_08; /* 0A */ unk16 mUnk_0A; /* 0C */ unk16 mUnk_0C; - /* 0E */ STRUCT_PAD(0x0E, 0x18); + /* 0E */ PAD(0x0E, 0x18); /* 18 */ UnkStruct_ov000_020b504c_08_18C() { @@ -123,16 +123,16 @@ public: /* 098 */ CellAnimObject mUnk_098; /* 110 */ CellAnimObject mUnk_110; /* 188 */ bool mUnk_188; - /* 189 */ STRUCT_PAD(0x189, 0x18C); + /* 189 */ PAD(0x189, 0x18C); /* 18C */ UnkStruct_ov000_020b504c_08_18C mUnk_18C[2]; - /* 1BC */ STRUCT_PAD(0x1BC, 0x1C4); + /* 1BC */ PAD(0x1BC, 0x1C4); /* 1C4 */ bool mUnk_1C4; - /* 1C5 */ STRUCT_PAD(0x1C5, 0x1C8); + /* 1C5 */ PAD(0x1C5, 0x1C8); /* 1C8 */ CellAnimObject mUnk_1C8[2]; /* 2B8 */ unk32 mUnk_2B8; /* 2BC */ unk32 mUnk_2BC; /* 2C0 */ bool mUnk_2C0; - /* 2C1 */ STRUCT_PAD(0x2C1, 0x2C4); + /* 2C1 */ PAD(0x2C1, 0x2C4); /* 2C4 */ UnkStruct_ov000_020b504c_08(); @@ -150,7 +150,7 @@ class UnkStruct_ov000_020b504c_0C_Base { public: /* 04 */ UnkSystem2_UnkSubSystem11_Derived2 *mUnk_04; /* 08 */ UnkStruct_ov000_020b504c_08 *mUnk_08; - /* 0C */ STRUCT_PAD(0x0C, 0x1C); + /* 0C */ PAD(0x0C, 0x1C); /* 1C */ UnkStruct_ov000_020b504c_0C_Base(); @@ -173,7 +173,7 @@ public: class UnkStruct_ov000_020b504c_0C_Derived1 : public UnkStruct_ov000_020b504c_0C_Base { public: /* 000 (base) */ - /* 01C */ STRUCT_PAD(0x1C, 0x194); + /* 01C */ PAD(0x1C, 0x194); /* 194 */ UnkStruct_ov000_020b504c_0C_Derived1(unk32 param1); @@ -182,7 +182,7 @@ public: class UnkStruct_ov000_020b504c_0C_Derived2 : public UnkStruct_ov000_020b504c_0C_Base { public: /* 00 (base) */ - /* 1C */ STRUCT_PAD(0x1C, 0xCC); + /* 1C */ PAD(0x1C, 0xCC); /* CC */ UnkStruct_ov000_020b504c_0C_Derived2(); @@ -191,7 +191,7 @@ public: class UnkStruct_ov000_020b504c_0C_Derived3 : public UnkStruct_ov000_020b504c_0C_Base { public: /* 000 (base) */ - /* 01C */ STRUCT_PAD(0x1C, 0x194); + /* 01C */ PAD(0x1C, 0x194); /* 194 */ UnkStruct_ov000_020b504c_0C_Derived3(unk32 param1); @@ -200,7 +200,7 @@ public: class UnkStruct_ov000_020b504c_0C_Derived4 : public UnkStruct_ov000_020b504c_0C_Base { public: /* 00 (base) */ - /* 1C */ STRUCT_PAD(0x1C, 0x28); + /* 1C */ PAD(0x1C, 0x28); /* 28 */ UnkStruct_ov000_020b504c_0C_Derived4(); @@ -210,7 +210,7 @@ class UnkStruct_ov000_020b504c_28_Base_160 { public: /* 00 */ unk32 mUnk_00; /* 04 */ bool mUnk_04; - /* 05 */ STRUCT_PAD(0x05, 0x08); + /* 05 */ PAD(0x05, 0x08); /* 08 */ CellAnimObject mUnk_08; /* 80 */ @@ -283,11 +283,11 @@ public: /* 158 */ unk32 mUnk_158; /* 15C */ bool mUnk_15C; /* 15D */ bool mUnk_15D; - /* 15E */ STRUCT_PAD(0x15E, 0x160); + /* 15E */ PAD(0x15E, 0x160); /* 160 */ UnkStruct_ov000_020b504c_28_Base_160 mUnk_160; /* 1E0 */ unk32 mUnk_1E0; /* 1E4 */ bool mUnk_1E4; - /* 1E5 */ STRUCT_PAD(0x1E5, 0x1E8); + /* 1E5 */ PAD(0x1E5, 0x1E8); /* 1E8 */ UnkSystem2_UnkSubSystem9 mUnk_1E8; /* 22C */ UnkSubStruct1 mUnk_22C; /* 25C */ UnkStruct_ov000_020b504c_28_Base_25C mUnk_25C[15]; @@ -306,7 +306,7 @@ public: /* 3A9 */ unk8 mUnk_3A9; // pad? /* 3AA */ unk16 mUnk_3AA; /* 3AC */ bool mUnk_3AC; - /* 3AD */ STRUCT_PAD(0x3AD, 0x3B8); + /* 3AD */ PAD(0x3AD, 0x3B8); /* 3B8 */ UnkStruct_ov000_020b504c_28_Base(); diff --git a/include/Unknown/UnkStruct_ov000_020b50c0.hpp b/include/Unknown/UnkStruct_ov000_020b50c0.hpp index 39d6e31a..b206bb7a 100644 --- a/include/Unknown/UnkStruct_ov000_020b50c0.hpp +++ b/include/Unknown/UnkStruct_ov000_020b50c0.hpp @@ -35,7 +35,7 @@ extern UnkStruct_ov018_020c5ac0 *data_027e099c; class UnkStruct_ov000_020b50c0 { public: - /* 00 */ STRUCT_PAD(0x00, 0x94); + /* 00 */ PAD(0x00, 0x94); /* 94 */ unk32 mUnk_94; /* 98 */ unk32 mUnk_98; /* 9C */ unk16 mUnk_9C; diff --git a/include/Unknown/UnkStruct_ov000_020b51b8.hpp b/include/Unknown/UnkStruct_ov000_020b51b8.hpp index ff448bdd..0c144d10 100644 --- a/include/Unknown/UnkStruct_ov000_020b51b8.hpp +++ b/include/Unknown/UnkStruct_ov000_020b51b8.hpp @@ -8,7 +8,7 @@ class UnkStruct_ov000_020b51b8_00 { public: /* 00 (vtable) */ - /* 04 */ STRUCT_PAD(0x04, 0xA0); + /* 04 */ PAD(0x04, 0xA0); UnkStruct_ov000_020b51b8_00(void *param1); @@ -21,7 +21,7 @@ public: class UnkStruct_ov000_020b51b8_04 { public: /* 00 (vtable) */ - /* 04 */ STRUCT_PAD(0x04, 0x98); + /* 04 */ PAD(0x04, 0x98); UnkStruct_ov000_020b51b8_04(void *param1); diff --git a/include/Unknown/UnkStruct_ov017_020c3f70.hpp b/include/Unknown/UnkStruct_ov017_020c3f70.hpp index 5d4ec0b0..dc127613 100644 --- a/include/Unknown/UnkStruct_ov017_020c3f70.hpp +++ b/include/Unknown/UnkStruct_ov017_020c3f70.hpp @@ -1,13 +1,15 @@ #pragma once #include "global.h" -#include "nitro/os/thread.h" +#include "nitro/os.h" #include "types.h" class UnkStruct_ov017_020c3f70_Base { public: /* 00 (vtable) */ /* 04 */ OSThread mThread; + /* BC */ unk32 mUnk_BC; + /* C0 */ unk32 mUnk_C0; /* C4 */ unk32 mUnk_C4; /* C8 */ unk32 mUnk_C8; /* CC */ diff --git a/include/Unknown/UnkStruct_ov020_020e8544.hpp b/include/Unknown/UnkStruct_ov020_020e8544.hpp index d624b748..b2e4bb8b 100644 --- a/include/Unknown/UnkStruct_ov020_020e8544.hpp +++ b/include/Unknown/UnkStruct_ov020_020e8544.hpp @@ -22,7 +22,7 @@ public: class UnkStruct_ov020_020e8544_Derived1 : public UnkStruct_ov020_020e8544_Base { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x30); + /* 04 */ PAD(0x04, 0x30); /* 30 */ UnkStruct_ov020_020e8544_Derived1(); @@ -31,7 +31,7 @@ public: class UnkStruct_ov020_020e8544_Derived2 : public UnkStruct_ov020_020e8544_Base { public: /* 00 (base) */ - /* 04 */ STRUCT_PAD(0x04, 0x2E4); + /* 04 */ PAD(0x04, 0x2E4); /* 2E4 */ UnkStruct_ov020_020e8544_Derived2(); diff --git a/include/Unknown/UnkStruct_ov031_Items.hpp b/include/Unknown/UnkStruct_ov031_Items.hpp index 12601743..ca901d61 100644 --- a/include/Unknown/UnkStruct_ov031_Items.hpp +++ b/include/Unknown/UnkStruct_ov031_Items.hpp @@ -50,7 +50,7 @@ public: /* 2C */ UnkStruct_ov031_Items_01() { - this->mUnk_0C.Init(FLOAT_TO_FX32(0.0f)); + this->mUnk_0C.Init(FX_F32_TO_FX32(0.0f)); this->mUnk_1C = 0; this->mUnk_20 = 0; this->mUnk_24 = 0; diff --git a/include/files.h b/include/files.h index 4e3d40ce..29492828 100644 --- a/include/files.h +++ b/include/files.h @@ -1,5 +1,6 @@ #pragma once +#include "global.h" #include "types.h" #include @@ -28,7 +29,7 @@ typedef struct FileInfos { // .cib typedef struct CourseInitEntry { /* 00 */ char name[16]; - /* 10 */ STRUCT_PAD(0x10, 0x24); + /* 10 */ PAD(0x10, 0x24); } CourseInitEntry; // size = 0x24 typedef struct CourseInitHeader { diff --git a/include/global.h b/include/global.h index 6bebeb4f..34121cf3 100644 --- a/include/global.h +++ b/include/global.h @@ -1,124 +1,123 @@ -#ifndef GLOBAL_H - #define GLOBAL_H +#pragma once - // Prevent the IDE from reporting errors that the compiler/linker won't report - #ifndef __MWERKS__ - #endif +// start of thumb region, using thumb instructions +#define THUMB_BEGIN _Pragma("thumb on") +#define ARM_END THUMB_BEGIN - // start of thumb region, using thumb instructions - #define THUMB_BEGIN _Pragma("thumb on") - #define ARM_END THUMB_BEGIN +// end of thumb region, using arm instructions +#define THUMB_END _Pragma("thumb off") +#define ARM_BEGIN THUMB_END - // end of thumb region, using arm instructions - #define THUMB_END _Pragma("thumb off") - #define ARM_BEGIN THUMB_END +// `override` was added in C++11 before the DS, so we only use the keyword to indicate overriden functions +#define override - // `override` was added in C++11 before the DS, so we only use the keyword to indicate overriden functions - #define override +#pragma define_section dtcm ".dtcm" \ + ".dtcm" +// Puts variables in the DTCM module +#define DTCM_BEGIN _Pragma("section dtcm begin") +#define DTCM_END _Pragma("section dtcm end") - #pragma define_section dtcm ".dtcm" \ - ".dtcm" - // Puts variables in the DTCM module - #define DTCM_BEGIN _Pragma("section dtcm begin") - #define DTCM_END _Pragma("section dtcm end") - - #pragma define_section sbss ".data" \ - ".sbss" - // Define .sbss variables - #define SBSS_BEGIN _Pragma("section sbss begin") - #define SBSS_END _Pragma("section sbss end") - - #ifdef __MWERKS__ - #define NO_INLINE __attribute__((never_inline)) - #define AT_ADDRESS(xyz) : (xyz) - #define DECL_SECTION(x) __declspec(section x) - #define EXPORT __declspec(export) - #define WEAK __declspec(weak) - #define ASM asm - #else - #define AT_ADDRESS(xyz) - #define DECL_SECTION(x) - #define EXPORT - #define WEAK - #define ASM - #define NO_INLINE - #endif - - #define STRUCT_PAD(from, to) unsigned char _pad_##from[(to) - (from)] - - #define DF_CONCAT3_(a, b, c) a##b##c - #define DF_CONCAT3(a, b, c) DF_CONCAT3_(a, b, c) - #define DF_UNIQUE_IDENT(ident_) DF_CONCAT3(ident_, _, __LINE__) - - // sometimes we need something in .bss - // to force things in .data to align properly - #define DATA_ALIGN_FIX() int DF_UNIQUE_IDENT(__data_align_fix) - - // for cases where `DATA_ALIGN_FIX` doesn't work - #define DATA_ALIGN_FIX2() \ - static const int DF_UNIQUE_IDENT(__data_align_fix) = 0; \ - void DF_UNIQUE_IDENT(__data_align_fix_func)() { \ - *(int *) &DF_UNIQUE_IDENT(__data_align_fix) = 0; \ - } - - #ifndef typeof - #define typeof __typeof__ - #endif - #define DF_TYPEOF typeof - #define DF_FUNCTION_DECLARATOR_WITH_PROTO(ident_) \ - extern void(ident_)(void); \ - extern void(ident_)(void) - #define DF_FUNCTION_CALL(ident_, arg_) \ - extern void(ident_)(DF_TYPEOF(arg_)); \ - (ident_)(arg_) - - // prevents the linker from deadstripping a symbol (can be anything) - #define DECOMP_FORCE(arg_) \ - DF_FUNCTION_DECLARATOR_WITH_PROTO(DF_UNIQUE_IDENT(DECOMP_FORCE)) { \ - DF_FUNCTION_CALL(DF_UNIQUE_IDENT(DECOMP_FORCE_CALL), arg_); \ - } - - #define SUBSCREEN_WIDTH 256 - #define SUBSCREEN_HEIGHT 192 - - #define ALIGN_PREV(X, N) ((X) & ~((N) - 1)) - #define ALIGN_NEXT(X, N) ALIGN_PREV(((X) + (N) - 1), N) - #define ALIGN(X, N) ((X + N) & ~N) - - #define STACK_PAD(N) \ - struct __StackPad { \ - char pad[(N)]; \ - ~__StackPad() {} \ - } __stack_pad - - #define VTABLE_PAD(name) \ - class _VTABLE_PAD_##name { \ - public: \ - virtual void dummy(); \ - }; \ - void _VTABLE_PAD_##name::dummy() {} - - #define DELETE(ptr) \ - { \ - delete ptr; \ - ptr = NULL; \ - } \ - (void) 0 - - #define DELETE_ARRAY(ptr) \ - { \ - delete[] ptr; \ - ptr = NULL; \ - } \ - (void) 0 - - #define DELETE_ARRAY2(ptr) \ - { \ - ::operator delete[](ptr); \ - ptr = NULL; \ - } \ - (void) 0 +#pragma define_section sbss ".data" \ + ".sbss" +// Define .sbss variables +#define SBSS_BEGIN _Pragma("section sbss begin") +#define SBSS_END _Pragma("section sbss end") +#ifdef __MWERKS__ + #define NO_INLINE __attribute__((never_inline)) + #define AT_ADDRESS(xyz) : (xyz) + #define DECL_SECTION(x) __declspec(section x) + #define EXPORT __declspec(export) + #define WEAK __declspec(weak) +#else + #define AT_ADDRESS(xyz) + #define DECL_SECTION(x) + #define EXPORT + #define WEAK + #define NO_INLINE #endif +#define DF_CONCAT3_(a, b, c) a##b##c +#define DF_CONCAT3(a, b, c) DF_CONCAT3_(a, b, c) +#define DF_UNIQUE_IDENT(ident_) DF_CONCAT3(ident_, _, __LINE__) + +// sometimes we need something in .bss +// to force things in .data to align properly +#define DATA_ALIGN_FIX() int DF_UNIQUE_IDENT(__data_align_fix) + +// for cases where `DATA_ALIGN_FIX` doesn't work +#define DATA_ALIGN_FIX2() \ + static const int DF_UNIQUE_IDENT(__data_align_fix) = 0; \ + void DF_UNIQUE_IDENT(__data_align_fix_func)() { \ + *(int *) &DF_UNIQUE_IDENT(__data_align_fix) = 0; \ + } + +#ifndef typeof + #define typeof __typeof__ +#endif +#define DF_TYPEOF typeof +#define DF_FUNCTION_DECLARATOR_WITH_PROTO(ident_) \ + extern void(ident_)(void); \ + extern void(ident_)(void) +#define DF_FUNCTION_CALL(ident_, arg_) \ + extern void(ident_)(DF_TYPEOF(arg_)); \ + (ident_)(arg_) + +// prevents the linker from deadstripping a symbol (can be anything) +#define DECOMP_FORCE(arg_) \ + DF_FUNCTION_DECLARATOR_WITH_PROTO(DF_UNIQUE_IDENT(DECOMP_FORCE)) { \ + DF_FUNCTION_CALL(DF_UNIQUE_IDENT(DECOMP_FORCE_CALL), arg_); \ + } + +#define SUBSCREEN_WIDTH 256 +#define SUBSCREEN_HEIGHT 192 + +#define ALIGN_PREV(X, N) ((X) & ~((N) - 1)) +#define ALIGN_NEXT(X, N) ALIGN_PREV(((X) + (N) - 1), N) +#define ALIGN(X, N) ((X + N) & ~N) + +#define STACK_PAD(N) \ + struct __StackPad { \ + char pad[(N)]; \ + ~__StackPad() {} \ + } __stack_pad + +#define VTABLE_PAD(name) \ + class _VTABLE_PAD_##name { \ + public: \ + virtual void dummy(); \ + }; \ + void _VTABLE_PAD_##name::dummy() {} + +#define DELETE(ptr) \ + { \ + delete ptr; \ + ptr = NULL; \ + } \ + (void) 0 + +#define DELETE_ARRAY(ptr) \ + { \ + delete[] ptr; \ + ptr = NULL; \ + } \ + (void) 0 + +#define DELETE_ARRAY2(ptr) \ + { \ + ::operator delete[](ptr); \ + ptr = NULL; \ + } \ + (void) 0 + #define FILE_BUFFER_OFFSETOF(offset) ((size_t) (((u8 *) 0) + (offset))) + +//! TODO: move in an appropriate place +typedef union Vec2b { + struct { + /* 0 */ unsigned char x; + /* 4 */ unsigned char y; + /* 8 */ + }; + unsigned char coords[2]; +} Vec2b; diff --git a/include/math.hpp b/include/math.hpp index 0685ba30..957219be 100644 --- a/include/math.hpp +++ b/include/math.hpp @@ -2,17 +2,118 @@ #include -//! TODO: find a way to make VecFx32 work in ctor init lists -struct Vec3p { - fx32 x, y, z; +// some kind of angle conversion? only used for angle values so far +#define MUL_FX32_FX64(a, b) (fx32)(((((a) * (b)) + 0x80000000000LL) >> 32)) +#define UNK_FX_OPERATION_1(a) (MUL_FX32_FX64((u64) (a), 0xB60B60B60BLL) >> FX32_SHIFT) +#define MUL_FX32_U(a, b) (fx32)((((u64) (a)) * ((u64) (b)) + 0x800) >> FX32_SHIFT) +#define UNK_FX_OPERATION_2(a) MUL_FX32_U((u64) (a), FX_F32_TO_FX32(1.2f)) +#define DEG_TO_ANG(n) ((n) * 0x10000 / 360) +#define DEG_TO_ANG_ALT(n) DEG_TO_ANG((u64) (n)) - Vec3p(fx32 X, fx32 Y, fx32 Z) { - x = X; - y = Y; - z = Z; +#define ABS(x) ((x) < 0 ? -(x) : (x)) +#define ABS2(x) ((x) >= 0 ? (x) : -(x)) +#define CLAMP(x, min, max) ((x) > (max) ? (max) : (x) < (min) ? (min) : (x)) +#define CLAMP2(x, min, max) ((x) > (max) ? (max) : (x) >= (min) ? (x) : (min)) +#define CLAMP3(x, min, max) ((x) >= (max) ? (max) : (x) <= (min) ? (min) : (x)) +#define POW_2(x) (x * x) + +static inline const s32 ClampValue(s32 value, const s32 min, const s32 max) { + if (value > max) { + value = max; + } else if (value < min) { + value = min; + } + + return value; +} + +static inline void ClampValue16(s16 *value, const s32 min, const s32 max) { + if (*value > max) { + *value = max; + } else if (*value < min) { + *value = min; + } +} + +// C++ wrapper for VecFx32 +struct VecFx32Cpp { + VecFx32 vec; + + VecFx32Cpp() {} + VecFx32Cpp(fx32 X, fx32 Y, fx32 Z) { + vec.x = X; + vec.y = Y; + vec.z = Z; } }; +// C++ wrapper for VecFx16 +struct VecFx16Cpp { + VecFx16 vec; + + VecFx16Cpp() {} + VecFx16Cpp(fx16 X, fx16 Y, fx16 Z) { + vec.x = X; + vec.y = Y; + vec.z = Z; + } +}; + +union Vec2p { + struct { + /* 0 */ fx32 x; + /* 4 */ fx32 y; + /* 8 */ + }; + fx32 coords[2]; +}; + +#define Vec2p_Add(a, b, dst) Vec2_Add(Vec2p, a, b, dst) +#define Vec2p_Sub(a, b, dst) Vec2_Sub(Vec2p, a, b, dst) +#define Vec2p_Set(a, dst) Vec2_Set(Vec2p, a, dst) +#define Vec2p_Clear(dst) Vec2_Clear(fx32, dst) +static inline void Vec2p_Copy(const Vec2p *src, Vec2p *dst) { +#if __MWERKS__ + dst->coords = src->coords; +#else + dst->x = src->x; + dst->y = src->y; +#endif +} + +#if __MWERKS__ + #define Vec2_Set(a, dst) \ + { \ + (dst)->coords = (a)->coords; \ + } \ + ((void) 0) +#else + #define Vec2_Set(a, dst) \ + { \ + (dst)->x = (a)->x; \ + (dst)->y = (a)->y; \ + } \ + ((void) 0) +#endif + +#define Vec2_CopyAdd(type, a, b, dst) \ + { \ + type temp; \ + temp.x = (a)->x + (b)->x; \ + temp.y = (a)->y + (b)->y; \ + Vec2_Set(&temp, dst); \ + } \ + ((void) 0) + +#define Vec2_CopySub(type, a, b, dst) \ + { \ + type temp; \ + temp.x = (a)->x - (b)->x; \ + temp.y = (a)->y - (b)->y; \ + Vec2_Set(&temp, dst); \ + } \ + ((void) 0) + extern "C" { //! TODO: find a way to remove that typedef union Vec2sC { diff --git a/include/profile.hpp b/include/profile.hpp index 24f30f1e..85f53bcf 100644 --- a/include/profile.hpp +++ b/include/profile.hpp @@ -50,7 +50,7 @@ public: class UnkStruct_ov000_02058a84 { public: - /* 0 */ STRUCT_PAD(0x0, 0x6); + /* 0 */ PAD(0x0, 0x6); /* 6 */ u16 mUnk_6; /* 8 */ }; diff --git a/libs/c/include/critical_regions.h b/libs/c/include/critical_regions.h index 4c33f678..ff406d65 100644 --- a/libs/c/include/critical_regions.h +++ b/libs/c/include/critical_regions.h @@ -1,7 +1,7 @@ #ifndef MSL_COMMON_CRITICAL_REGIONS_H #define MSL_COMMON_CRITICAL_REGIONS_H -#include +#include enum critical_regions { atexit_funcs_access = 0, diff --git a/libs/dsprot/src/encryptor.c b/libs/dsprot/src/encryptor.c index dbf65265..c113e45a 100644 --- a/libs/dsprot/src/encryptor.c +++ b/libs/dsprot/src/encryptor.c @@ -1,6 +1,6 @@ #include "dsprot/encryptor.h" -#include +#include #include "dsprot/bss.h" #include "dsprot/encoding_constants.h" diff --git a/libs/dsprot/src/rc4.c b/libs/dsprot/src/rc4.c index 644b2ac1..f6457494 100644 --- a/libs/dsprot/src/rc4.c +++ b/libs/dsprot/src/rc4.c @@ -81,7 +81,7 @@ u32 RC4_InitSBox(u8 *sbox) { u32 RC4_EncryptInstructions(RC4_Ctx *ctx, void *src, void *dst, u32 size) { u8 sbox[256]; - ulong offset; + unsigned long offset; u8 *src_bytes; u8 *dst_bytes; @@ -139,7 +139,7 @@ u32 RC4_EncryptInstructions(RC4_Ctx *ctx, void *src, void *dst, u32 size) { u32 RC4_DecryptInstructions(RC4_Ctx *ctx, void *src, void *dst, u32 size) { u8 sbox[256]; - ulong offset; + unsigned long offset; u8 *src_bytes; u8 *dst_bytes; diff --git a/libs/nitro/include/nitro.h b/libs/nitro/include/nitro.h index f954dda3..c4bab50d 100644 --- a/libs/nitro/include/nitro.h +++ b/libs/nitro/include/nitro.h @@ -2,15 +2,21 @@ #include #include "nitro/card.h" +#include "nitro/dgt.h" #include "nitro/fs.h" #include "nitro/fx.h" #include "nitro/g2.h" +#include "nitro/g3.h" #include "nitro/gx.h" #include "nitro/hw.h" +#include "nitro/math.h" +#include "nitro/mb.h" #include "nitro/mi.h" +#include "nitro/mic.h" #include "nitro/os.h" #include "nitro/pad.h" #include "nitro/pm.h" +#include "nitro/pxi.h" #include "nitro/reg.h" #include "nitro/rtc.h" #include "nitro/snd.h" @@ -18,3 +24,4 @@ #include "nitro/svc.h" #include "nitro/tp.h" #include "nitro/types.h" +#include "nitro/wm.h" diff --git a/libs/nitro/include/nitro/card.h b/libs/nitro/include/nitro/card.h index 6e219ccf..354b49f0 100644 --- a/libs/nitro/include/nitro/card.h +++ b/libs/nitro/include/nitro/card.h @@ -7,17 +7,18 @@ extern "C" { #include "nitro/types.h" +#define CARD_BACKUP_TYPE_NOT_USE // TODO: Find value #define CARD_BACKUP_TYPE_EEPROM 1 #define CARD_BACKUP_TYPE_FLASH 2 #define CARD_BACKUP_TYPE_FRAM 3 #define CARD_BACKUP_TYPE_EEPROM_4KBITS (0x900 | CARD_BACKUP_TYPE_EEPROM) -#define CARD_BACKUP_TYPE_EEPROM_64KBITS (0xD00 | CARD_BACKUP_TYPE_EEPROM) +#define CARD_BACKUP_TYPE_EEPROM_64KBITS (0xd00 | CARD_BACKUP_TYPE_EEPROM) #define CARD_BACKUP_TYPE_EEPROM_512KBITS (0x1000 | CARD_BACKUP_TYPE_EEPROM) #define CARD_BACKUP_TYPE_FLASH_2MBITS (0x1200 | CARD_BACKUP_TYPE_FLASH) #define CARD_BACKUP_TYPE_FLASH_4MBITS (0x1300 | CARD_BACKUP_TYPE_FLASH) #define CARD_BACKUP_TYPE_FLASH_8MBITS (0x1400 | CARD_BACKUP_TYPE_FLASH) -#define CARD_BACKUP_TYPE_FRAM_256KBITS (0xF00 | CARD_BACKUP_TYPE_FRAM) +#define CARD_BACKUP_TYPE_FRAM_256KBITS (0xf00 | CARD_BACKUP_TYPE_FRAM) // TODO: Find values for these #define CARD_RESULT_SUCCESS 0 @@ -45,13 +46,31 @@ extern "C" { typedef u32 CARDBackupType; typedef u32 CARDResult; +typedef struct CARD_UnkStruct1 { + /* 00 */ PAD(0x00, 0x40); + /* 40 */ u32 unk_40; + /* 44 */ u32 unk_44; + /* 48 */ u32 unk_48; + /* 4c */ u32 unk_4c; + /* 50 */ +} CARD_UnkStruct1; + +typedef struct CARD_UnkStruct2 { + /* 00 */ PAD(0x00, 0x80); + /* 80 */ u32 unk_80; + /* 84 */ +} CARD_UnkStruct2; + +void CARD_Init(void); + void CARD_LockBackup(u16 cardId); void CARD_UnlockBackup(u16 cardId); BOOL CARD_IdentifyBackup(CARDBackupType type); CARDBackupType CARD_GetBackupType(); -#define CARD_IsBackupEeprom() (CARD_GetBackupType() & 0xFF) == CARD_BACKUP_TYPE_EEPROM -#define CARD_IsBackupFlash() (CARD_GetBackupType() & 0xFF) == CARD_BACKUP_TYPE_FLASH -#define CARD_IsBackupFram() (CARD_GetBackupType() & 0xFF) == CARD_BACKUP_TYPE_FRAM +#define CARD_IsBackupEeprom() (CARD_GetBackupType() & 0xff) == CARD_BACKUP_TYPE_EEPROM +#define CARD_IsBackupFlash() (CARD_GetBackupType() & 0xff) == CARD_BACKUP_TYPE_FLASH +#define CARD_IsBackupFram() (CARD_GetBackupType() & 0xff) == CARD_BACKUP_TYPE_FRAM +u32 CARD_GetBackupTotalSize(void); BOOL CARD_ReadWriteBackupAsync(u32 offset, void *buf, u32 size, void *, void *, u32, u32, u32, u32); void CARD_WaitBackupAsync(void); CARDResult CARD_GetResultCode(void); @@ -61,6 +80,33 @@ void CARD_func_0034(); void CARD_func_0010(u32); void CARD_func_0011(u32); +void CARD_LockRom(u16 lock); +void CARD_UnlockRom(u16 lock); +BOOL CARD_IsPulledOut(void); +void CARDi_ReadRom(u32 arg0, void *arg1, void *arg2, void (*callback)(void *param), void *param, u32 arg5); + +CARD_UnkStruct2 *CARD_func_0058(void); +CARD_UnkStruct1 *CARD_func_0059(void); + +inline void CARD_ReadEeprom(u32 offset, void *buf, u32 size) { + // TODO: Implement from GameSpy ReadFromBackup +} +inline void CARD_ReadFlash(u32 offset, void *buf, u32 size) { + // TODO: Implement from GameSpy ReadFromBackup +} +inline void CARD_ReadFram(u32 offset, void *buf, u32 size) { + // TODO: Implement from GameSpy ReadFromBackup +} +inline void CARD_WriteAndVerifyEeprom(u32 offset, void *buf, u32 size) { + // TODO: Implement from GameSpy WriteToBackup +} +inline void CARD_WriteAndVerifyFlash(u32 offset, void *buf, u32 size) { + // TODO: Implement from GameSpy WriteToBackup +} +inline void CARD_WriteAndVerifyFram(u32 offset, void *buf, u32 size) { + // TODO: Implement from GameSpy WriteToBackup +} + inline BOOL CARD_ReadEepromAsync(u32 offset, void *buf, u32 size, void *param4, void *param5) { return CARD_ReadWriteBackupAsync(offset, buf, size, param4, param5, 1, 6, 1, 0); } diff --git a/libs/nitro/include/nitro/dgt.h b/libs/nitro/include/nitro/dgt.h new file mode 100644 index 00000000..979939c6 --- /dev/null +++ b/libs/nitro/include/nitro/dgt.h @@ -0,0 +1,16 @@ +#ifndef _NITRO_DGT_H +#define _NITRO_DGT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/types.h" + +void DGT_Hash2CalcHmac(void *, void *, u32, void *, u32); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/nitro/include/nitro/fs.h b/libs/nitro/include/nitro/fs.h index 4bb29d3b..55cccfc2 100644 --- a/libs/nitro/include/nitro/fs.h +++ b/libs/nitro/include/nitro/fs.h @@ -5,171 +5,39 @@ extern "C" { #endif -#include "nitro/os.h" +#include "nitro/fs/fs_archive.h" +#include "nitro/fs/fs_command.h" +#include "nitro/fs/fs_common.h" +#include "nitro/fs/fs_dir.h" +#include "nitro/fs/fs_file.h" +#include "nitro/fs/fs_overlay.h" #include "nitro/types.h" -#define FS_SEEK_SET 0 -#define FS_SEEK_CUR 1 -#define FS_SEEK_END 2 +typedef struct FS_UnkStruct14 { + /* 00 */ s32 pos; + /* 04 */ +} FS_UnkStruct14; -#define FS_FILE_FLAG_FILE 0x10 - -#define FS_FILEMODE_R 0x1 - -struct FSVolume; -typedef struct FSUnkStruct2 { - /* 00 */ struct FSVolume *unk_00; - /* 04 */ s16 unk_04; - /* 06 */ u16 unk_06; - /* 08 */ -} FSUnkStruct2; - -typedef struct FSUnkStruct5 { - /* 00 */ struct FSVolume *volume; - /* 04 */ struct FSVolume *next; - /* 08 */ struct FSVolume *prev; - /* 0c */ -} FSUnkStruct5; - -struct FSFile; -typedef struct FSVolume { - /* 00 */ u32 volumeName; - /* 04 */ struct FSVolume *next; - /* 08 */ struct FSVolume *prev; - /* 0c */ u32 unk_0c; - /* 10 */ u32 unk_10; - /* 14 */ u32 unk_14; - /* 18 */ u32 unk_18; - /* 1c */ vu32 flags; - /* 20 */ u32 unk_20; - /* 24 */ struct FSVolume *unk_24; - /* 28 */ u32 unk_28; - /* 2c */ u32 *fat; - /* 30 */ u32 fatSize; - /* 34 */ u8 *fnt; - /* 38 */ u32 fntSize; - /* 3c */ u32 fatRomOffset; - /* 40 */ u32 fntRomOffset; - /* 44 */ u32 *unk_44; - /* 48 */ BOOL (*unk_48)(struct FSVolume *, u32, u32, u32); - /* 4c */ BOOL (*unk_4c)(struct FSVolume *, u32, u32, u32); - /* 50 */ BOOL (*unk_50)(struct FSVolume *, u32, u32, u32); - /* 54 */ u32 (*unk_54)(struct FSFile *, u32); - /* 58 */ u32 unk_58; - /* 5c */ -} FSVolume; - -typedef struct FSUnkStruct3 { - /* 00 */ u32 volumeName; - /* 04 */ u32 unk_04; - /* 08 */ u32 unk_08; - /* 0c */ u32 unk_0c; - /* 10 */ u32 unk_10; - /* 14 */ u8 unk_14[0x94 - 0x14]; - /* 94 */ -} FSUnkStruct3; - -typedef struct FSUnkStruct7 { +typedef struct FS_UnkStruct19 { /* 00 */ u32 unk_00; /* 04 */ u32 unk_04; - /* 08 */ u32 unk_08; - /* 0c */ -} FSUnkStruct7; - -typedef struct FSFile { - /* 00 */ u32 unk_00; - /* 04 */ s32 *unk_04; - /* 08 */ FSVolume *volume; - /* 0c */ vu32 flags; - /* 10 */ u32 unk_10; - /* 14 */ u32 unk_14; - /* 18 */ OSLinkedList unk_18; - /* 20 */ u32 unk_20; - /* 24 */ u32 startRomOffset; - /* 28 */ u32 endRomOffset; - /* 2c */ u32 cursor; - /* 30 */ u32 buf; - union { - /* 34 */ u32 unk_34; - struct { - /* 34 */ u16 unk_34_s; - /* 36 */ u16 unk_36_s; - }; - }; - /* 38 */ u16 unk_38; - /* 3c */ u32 unk_3c; - /* 40 */ u32 unk_40; - /* 44 */ u32 unk_44; - /* 48 */ -} FSFile; - -typedef struct FSFntDirectory { - /* 00 */ u32 subtableOffset; - /* 04 */ u16 firstFileId; - /* 06 */ u16 parentId; /* 08 */ -} FSFntDirectory; +} FS_UnkStruct19; -typedef struct FSDirEntry { - /* 00 */ u32 unk_00; - /* 04 */ union { - u32 unk_04_u32; - struct { - u16 unk_04_u16; - u16 unk_06; - }; - }; - /* 08 */ u32 unk_08; - /* 0c */ u32 unk_0c; - /* 10 */ u32 unk_10; - /* 14 */ char name[0x80]; - /* 94 */ -} FSDirEntry; +typedef struct FS_UnkStruct6 { + /* 00 */ PAD(0x00, 0x04); + /* 04 */ s32 start; + /* 08 */ s32 end; + /* 0c */ s32 pos; + /* 10 */ +} FS_UnkStruct6; -typedef struct FSOverlay { - /* 00 */ s32 id; - /* 04 */ void *addr; - /* 08 */ u32 textSize; - /* 0C */ s32 bssSize; - /* 10 */ s32 ctorStart; - /* 14 */ s32 ctorEnd; - /* 18 */ s32 fileId; - /* 1C */ u32 fileSize; - /* 20 */ -} FSOverlay; +BOOL FSi_InitRom(s32 dmaCount); +BOOL FSi_GetLengthFromRom(FSFile *file, FSiCmdGetLength *cmd); +BOOL FSi_GetPositionFromRom(FSFile *file, FSiCmdGetPosition *cmd); +BOOL FSi_SeekFileFromRom(FSFile *arg0, FS_UnkStruct14 arg1, s32 mode); -void FS_Init(u32 dmaCount); -void FS_InitFile(FSFile *file); -BOOL FS_OpenFile(FSFile *file, const char *path); -BOOL FS_OpenFileEx(FSFile *file, const char *path, u32 flags); -BOOL FS_SeekFile(FSFile *file, s32 pos, u32 mode); -u32 FS_GetLength(FSFile *file); -u32 FS_ReadFile(FSFile *file, void *buf, u32 size); -BOOL FS_CloseFile(FSFile *file); -inline BOOL FS_IsFile(FSFile *file) { - return !!(file->flags & FS_FILE_FLAG_FILE); -} - -BOOL FS_FindDir(FSFile *file, const char *path); -BOOL FS_ReadDir(FSFile *file, FSDirEntry *dir); -void FS_CloseDirectory(FSFile *file); - -#define EXTERN_OVERLAY_ID(name_or_index) extern u32 OVERLAY_##name_or_index##_ID; -#define OVERLAY_ID(name_or_index) ((u32) & OVERLAY_##name_or_index##_ID) - -u32 FS_GetOverlaySize(FSOverlay *overlay); -void FS_ClearOverlayCacheAndBss(FSOverlay *overlay); -void FS_Overlay_0202d6cc(void **param1, FSOverlay *overlay); // param1 is the address of gArchiveList -BOOL FS_Overlay_0202d6f4(FSOverlay *param1, FSOverlay *param2, s32 param3, s32 param4, s32 param5, u32 param6, s32 param7, - u32 param8); -BOOL FS_LoadOverlayInfo(FSOverlay *overlay, s32 param2, s32 param3); -BOOL FS_LoadOverlayFile(FSOverlay *overlay); -BOOL FS_Overlay_0202d984(FSOverlay *param1, s32 param2, s32 param3); -BOOL FS_StartOverlay(FSOverlay *overlay); -BOOL FS_CleanupOverlayResources(FSOverlay *overlay); -BOOL FS_StopOverlay(FSOverlay *overlay); -BOOL FS_LoadOverlay(FSOverlay *overlay, s32 param2); -BOOL FS_UnloadOverlay(FSOverlay *overlay, s32 param2); +FSResult FS_func_0037(FSFile *file, FSResult result); #ifdef __cplusplus } // extern "C" diff --git a/libs/nitro/include/nitro/fs/fs_archive.h b/libs/nitro/include/nitro/fs/fs_archive.h new file mode 100644 index 00000000..45b06d77 --- /dev/null +++ b/libs/nitro/include/nitro/fs/fs_archive.h @@ -0,0 +1,121 @@ +#ifndef _NITRO_FS_ARCHIVE_H +#define _NITRO_FS_ARCHIVE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/fs/fs_command.h" +#include "nitro/fs/fs_common.h" +#include "nitro/os/os_common.h" +#include "nitro/types.h" + +#define FS_ARCHIVE_FLAG_0x1 0x1 +#define FS_ARCHIVE_FLAG_0x2 0x2 +#define FS_ARCHIVE_FLAG_0x4 0x4 +#define FS_ARCHIVE_FLAG_0x8 0x8 +#define FS_ARCHIVE_FLAG_0x10 0x10 +#define FS_ARCHIVE_FLAG_0x20 0x20 +#define FS_ARCHIVE_FLAG_0x40 0x40 +#define FS_ARCHIVE_FLAG_0x80 0x80 + +struct FSFile; +struct FSArchive; +typedef struct FS_UnkStruct7 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ u32 unk_0c; + /* 10 */ u32 unk_10; + /* 14 */ u32 unk_14; + /* 18 */ u32 unk_18; + /* 1c */ u32 unk_1c; + /* 20 */ FSResult (*read)(struct FSArchive *, void *, void *, s32 size); + /* 24 */ FSResult (*write)(struct FSArchive *, void *, void *, s32 size); + /* 28 */ PAD(0x28, 0x2c); + /* 2c */ FSResult (*proc)(struct FSFile *file, FSFileProc fn); + /* 30 */ u32 overrideMask; // bitfield of FSFileProc to override when calling FSi_ExecuteFileProc + /* 34 */ +} FS_UnkStruct7; + +typedef struct FsArchiveFns { + union { + /* 00 */ void *array[FS_MAX_CMD_COUNT]; + struct { + /* 00 */ FSResult (*read)(struct FSArchive *archive, struct FSFile *file, u32 size, FSiCmdReadFile *cmd); + /* 04 */ FSResult (*write)(struct FSArchive *archive, struct FSFile *file, u32, FSiCmd1 *cmd); + /* 08 */ FSResult (*unk_08)(struct FSArchive *archive, struct FSFile *file, u32, u32); + /* 0c */ FSResult (*unk_0c)(struct FSArchive *archive, struct FSFile *file, FS_UnkStruct13 *); + /* 10 */ FSResult (*unk_10)(struct FSArchive *archive, u32, char *path, u32 *, BOOL); + /* 14 */ FSResult (*unk_14)(struct FSArchive *archive, struct FSFile *file, u32, u32, u32 *); + /* 18 */ FSResult (*unk_18)(struct FSArchive *archive, struct FSFile *file, u32, u32); + /* 1c */ FSResult (*unk_1c)(struct FSArchive *archive, struct FSFile *file, u32, u32, FSiCmd7 *cmd); + /* 20 */ FSResult (*close)(struct FSArchive *archive, struct FSFile *file); + /* 24 */ FSResult (*lock)(struct FSArchive *archive); + /* 28 */ FSResult (*unlock)(struct FSArchive *archive); + /* 2c */ FSResult (*unk_2c)(struct FSArchive *archive); + /* 30 */ FSResult (*unk_30)(struct FSArchive *archive); + /* 34 */ FSResult (*open)(struct FSArchive *archive, struct FSFile *file, u32, char *path, u32 flags); + /* 38 */ FSResult (*seek)(struct FSArchive *archive, struct FSFile *file, s32 *pos, u32 mode); + /* 3c */ FSResult (*getLength)(struct FSArchive *archive, struct FSFile *file, FSiCmdGetLength *cmd); + /* 40 */ FSResult (*getPosition)(struct FSArchive *archive, struct FSFile *file, FSiCmdGetPosition *cmd); + /* 44 */ FSResult (*unk_44)(struct FSArchive *archive); + /* 48 */ FSResult (*unk_48)(struct FSArchive *archive); + /* 4c */ FSResult (*unk_4c)(struct FSArchive *archive, FSiCmd19 *cmd); + /* 50 */ FSResult (*unk_50)(struct FSArchive *archive, u32, u32, u32); + /* 54 */ FSResult (*unk_54)(struct FSArchive *archive, u32, u32); + /* 58 */ FSResult (*unk_58)(struct FSArchive *archive, u32, u32, u32, u32); + /* 5c */ FSResult (*unk_5c)(struct FSArchive *archive, u32, char *path, FS_UnkStruct15 *); + /* 60 */ FSResult (*unk_60)(struct FSArchive *archive, u32, u32, u32); + /* 64 */ FSResult (*unk_64)(struct FSArchive *archive, u32, u32, u32); + /* 68 */ FSResult (*unk_68)(struct FSArchive *archive, u32, u32); + /* 6c */ FSResult (*unk_6c)(struct FSArchive *archive, u32, u32, u32, u32); + /* 70 */ FSResult (*unk_70)(struct FSArchive *archive, FS_UnkStruct16 *); + /* 74 */ FSResult (*unk_74)(void); // unused? + /* 78 */ FSResult (*unk_78)(struct FSArchive *archive, struct FSFile *file); + /* 7c */ FSResult (*unk_7c)(struct FSArchive *archive, struct FSFile *file, u32); + /* 80 */ FSResult (*openDir)(struct FSArchive *archive, struct FSFile *file, u32, char *path, u32); + /* 84 */ FSResult (*closeDir)(struct FSArchive *archive, struct FSFile *file); + /* 88 */ FSResult (*unk_88)(struct FSArchive *archive, struct FSFile *file, u32, u32); + }; + }; + /* 8c */ +} FSArchiveFns; + +typedef struct FSArchive { + union { + /* 00 */ char name[4]; + /* 00 */ char *pName; + }; + /* 04 */ struct FSArchive *next; + /* 08 */ struct FSFile *currentFile; + /* 0c */ OSThreadQueue unk_0c; + /* 10 */ vu32 flags; + /* 18 */ u32 unk_18; + /* 1c */ u32 unk_1c; + /* 20 */ FS_UnkStruct7 *unk_20; + /* 24 */ const struct FsArchiveFns *fns; + /* 28 */ FS_UnkStruct7 unk_28; + /* 5c */ +} FSArchive; + +void FS_InitArchive(FSArchive *archive); +s32 FS_RegisterArchiveName(FSArchive *archive, const char *name, u32 length); +FSArchive *FS_FindArchive(const char *name, u32 length); +FSArchive *FS_func_0046(const char *path, u32 *arg1, char (*arg2)[FS_MAX_PATH]); +s32 FS_func_0052(char *path, s32 start); +char *FSi_GetPackedName(FSArchive *archive); +BOOL FS_func_0049(FSArchive *archive, FS_UnkStruct7 *arg1, const FSArchiveFns *fns); +void FS_NotifyArchiveAsyncEnd(FSArchive *archive, FSResult result); +BOOL FS_func_0044(char *arg0); +void FS_SetArchiveProc(FSArchive *archive, FSResult (*proc)(struct FSFile *file, FSFileProc index), u32 overrideMask); +void FS_LoadArchive(FSArchive *archive, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, + FSResult (*read)(FSArchive *, void *, void *, s32), FSResult (*write)(FSArchive *, void *, void *, s32)); + +extern FSArchive FS_romArchive; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/fs/fs_command.h b/libs/nitro/include/nitro/fs/fs_command.h new file mode 100644 index 00000000..0904b4c8 --- /dev/null +++ b/libs/nitro/include/nitro/fs/fs_command.h @@ -0,0 +1,223 @@ +#ifndef _NITRO_FS_COMMAND_H +#define _NITRO_FS_COMMAND_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/fs/fs_common.h" +#include "nitro/types.h" + +#define FS_CMD_READ_FILE ((FSCmd) 0) +#define FS_CMD_WRITE_FILE ((FSCmd) 1) +#define FS_CMD_2 ((FSCmd) 2) +#define FS_CMD_3 ((FSCmd) 3) +#define FS_CMD_4 ((FSCmd) 4) +#define FS_CMD_5 ((FSCmd) 5) +#define FS_CMD_6 ((FSCmd) 6) +#define FS_CMD_7 ((FSCmd) 7) +#define FS_CMD_CLOSE_FILE ((FSCmd) 8) +#define FS_CMD_LOCK ((FSCmd) 9) +#define FS_CMD_UNLOCK ((FSCmd) 10) +#define FS_CMD_11 ((FSCmd) 11) +#define FS_CMD_12 ((FSCmd) 12) +#define FS_CMD_OPEN_FILE ((FSCmd) 13) +#define FS_CMD_SEEK_FILE ((FSCmd) 14) +#define FS_CMD_GET_LENGTH ((FSCmd) 15) +#define FS_CMD_GET_POSITION ((FSCmd) 16) +#define FS_CMD_17 ((FSCmd) 17) +#define FS_CMD_18 ((FSCmd) 18) +#define FS_CMD_19 ((FSCmd) 19) +#define FS_CMD_20 ((FSCmd) 20) +#define FS_CMD_21 ((FSCmd) 21) +#define FS_CMD_22 ((FSCmd) 22) +#define FS_CMD_23 ((FSCmd) 23) +#define FS_CMD_24 ((FSCmd) 24) +#define FS_CMD_25 ((FSCmd) 25) +#define FS_CMD_26 ((FSCmd) 26) +#define FS_CMD_27 ((FSCmd) 27) +#define FS_CMD_28 ((FSCmd) 28) +#define FS_CMD_29 ((FSCmd) 29) +#define FS_CMD_30 ((FSCmd) 30) +#define FS_CMD_31 ((FSCmd) 31) +#define FS_CMD_OPEN_DIR ((FSCmd) 32) +#define FS_CMD_CLOSE_DIR ((FSCmd) 33) +#define FS_CMD_34 ((FSCmd) 34) +#define FS_CMD_COUNT 35 +#define FS_MAX_CMD_COUNT 64 + +typedef u8 FSCmd; + +typedef struct FSiCmdReadFile { + /* 00 */ void *buf; + /* 04 */ u32 size; + /* 08 */ +} FSiCmdReadFile; + +typedef struct FSiCmd1 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ +} FSiCmd1; + +typedef struct FSiCmd2 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ +} FSiCmd2; + +typedef struct FSiCmd3 { + /* 00 */ FS_UnkStruct13 *unk_00; + /* 04 */ +} FSiCmd3; + +typedef struct FSiCmd4 { + /* 00 */ u32 unk_00; + /* 04 */ char *path; + /* 08 */ u32 unk_08; + /* 0c */ u32 unk_0c; + /* 10 */ +} FSiCmd4; + +typedef struct FSiCmd5 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ +} FSiCmd5; + +typedef struct FSiCmd6 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ +} FSiCmd6; + +typedef struct FSiCmd7 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ u32 unk_0c; + /* 10 */ +} FSiCmd7; + +typedef struct FSiCmdOpenFile { + /* 00 */ u32 unk_00; + /* 04 */ char *path; + /* 08 */ u32 flags; + /* 0c */ +} FSiCmdOpenFile; + +typedef struct FSiCmdSeekFile { + /* 00 */ s32 pos; + /* 04 */ u32 mode; + /* 08 */ +} FSiCmdSeekFile; + +typedef struct FSiCmd15 { + /* 00 */ u32 length; + /* 04 */ +} FSiCmdGetLength; + +typedef struct FSiCmd16 { + /* 00 */ u32 pos; + /* 04 */ +} FSiCmdGetPosition; + +typedef struct FSiCmd19 { + /* 00 */ u32 unk_00; + /* 04 */ +} FSiCmd19; + +typedef struct FSiCmd20 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ +} FSiCmd20; + +typedef struct FSiCmd21 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ +} FSiCmd21; + +typedef struct FSiCmd22 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ u32 unk_0c; + /* 10 */ +} FSiCmd22; + +typedef struct FSiCmd23 { + /* 00 */ u32 unk_00; + /* 04 */ char *path; + /* 08 */ FS_UnkStruct15 *unk_08; + /* 0c */ +} FSiCmd23; + +typedef struct FSiCmd24 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ +} FSiCmd24; + +typedef struct FSiCmd25 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ +} FSiCmd25; + +typedef struct FSiCmd26 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ +} FSiCmd26; + +typedef struct FSiCmd27 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ u32 unk_0c; + /* 10 */ +} FSiCmd27; + +typedef struct FSiCmd28 { + /* 00 */ FS_UnkStruct16 *unk_00; + /* 04 */ +} FSiCmd28; + +typedef struct FSiCmd31 { + /* 00 */ u32 unk_00; + /* 04 */ +} FSiCmd31; + +typedef struct FSiCmd32 { + /* 00 */ u32 unk_00; + /* 04 */ char *path; + /* 08 */ u32 unk_08; + /* 0c */ +} FSiCmd32; + +typedef struct FSiCmd34 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ +} FSiCmd34; + +struct FSFile; +struct FSArchive; + +BOOL FSi_SendCommand(struct FSFile *file, s32 cmdType, BOOL sync); +FSResult FSi_TranslateCommand(struct FSFile *file, u8 cmdType); +void FSi_ReleaseCommand(struct FSFile *file, FSResult result); +struct FSFile *FSi_NextCommand(struct FSArchive *archive, BOOL arg1); +void FSi_ExecuteAsyncCommand(struct FSFile *file); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/fs/fs_common.h b/libs/nitro/include/nitro/fs/fs_common.h new file mode 100644 index 00000000..9e68200c --- /dev/null +++ b/libs/nitro/include/nitro/fs/fs_common.h @@ -0,0 +1,75 @@ +#ifndef _NITRO_FS_COMMON_H +#define _NITRO_FS_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/types.h" + +#define FS_MAX_PATH 260 + +#define FS_RESULT_SUCCESS ((FSResult) 0x0) +#define FS_RESULT_FAILURE ((FSResult) 0x1) +#define FS_RESULT_0x3 ((FSResult) 0x3) +#define FS_RESULT_0x5 ((FSResult) 0x5) +#define FS_RESULT_INVALID_COMMAND ((FSResult) 0x4) +#define FS_RESULT_INVALID_PARAM ((FSResult) 0x6) +#define FS_RESULT_0x8 ((FSResult) 0x8) +#define FS_RESULT_0xB ((FSResult) 0xb) +#define FS_RESULT_AWAIT_ASYNC ((FSResult) 0x100) +#define FS_RESULT_0x101 ((FSResult) 0x101) +#define FS_RESULT_0x102 ((FSResult) 0x102) + +typedef s32 FSResult; +typedef u32 FSFileProc; + +typedef struct FS_UnkStruct13 { + /* 000 */ u8 unk_00[4]; + /* 004 */ PAD(0x04, 0x10); + /* 010 */ u32 unk_10; + /* 014 */ char unk_14[FS_MAX_PATH]; + /* 118 */ u32 unk_118; + /* 11c */ u32 unk_11c; + /* 120 */ PAD(0x120, 0x138); + /* 138 */ u32 unk_138; + /* 13c */ u32 unk_13c; + /* 140 */ u32 unk_140; + /* 144 */ u32 unk_144; + /* 148 */ u32 unk_148; + /* 14c */ u32 unk_14c; + /* 150 */ PAD(0x150, 0x168); + /* 168 */ u32 unk_168; + /* 16c */ u32 unk_16c; + /* 170 */ +} FS_UnkStruct13; + +typedef struct FS_UnkStruct15 { + /* 00 */ u32 unk_00; + /* 04 */ PAD(0x04, 0x4c); + /* 4c */ u32 unk_4c; + /* 50 */ u32 unk_50; + /* 54 */ +} FS_UnkStruct15; + +typedef struct FS_UnkStruct16 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ u32 unk_0c; + /* 10 */ u32 unk_10; + /* 14 */ u32 unk_14; + /* 18 */ u32 unk_18; + /* 1c */ u32 unk_1c; + /* 20 */ u32 unk_20; + /* 24 */ u32 unk_24; + /* 28 */ u32 unk_28; + /* 2c */ u32 unk_2c; + /* 30 */ +} FS_UnkStruct16; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/fs/fs_dir.h b/libs/nitro/include/nitro/fs/fs_dir.h new file mode 100644 index 00000000..df536a64 --- /dev/null +++ b/libs/nitro/include/nitro/fs/fs_dir.h @@ -0,0 +1,41 @@ +#ifndef _NITRO_FS_DIR_H +#define _NITRO_FS_DIR_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/fs/fs_file.h" + +typedef struct FSFntDirectory { + /* 00 */ u32 subtableOffset; + /* 04 */ u16 firstFileId; + /* 06 */ u16 parentId; + /* 08 */ +} FSFntDirectory; + +typedef struct FSDirEntry { + /* 00 */ FSArchive *archive; + /* 04 */ union { + u32 unk_04u; + struct { + u16 unk_04s; + u16 unk_06s; + }; + }; + /* 08 */ u32 unk_08; + /* 0c */ u32 unk_0c; + /* 10 */ u32 unk_10; + /* 14 */ char unk_14[0x80]; + /* 94 */ +} FSDirEntry; + +FSResult FS_FindDir(FSFile *file, const char *path); +FSResult FS_ReadDir(FSFile *file, FSDirEntry *dir); +FSResult FS_CloseDirectory(FSFile *file); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/fs/fs_file.h b/libs/nitro/include/nitro/fs/fs_file.h new file mode 100644 index 00000000..2ca50234 --- /dev/null +++ b/libs/nitro/include/nitro/fs/fs_file.h @@ -0,0 +1,158 @@ +#ifndef _NITRO_FS_FILE_H +#define _NITRO_FS_FILE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/fs/fs_archive.h" +#include "nitro/fs/fs_command.h" +#include "nitro/fs/fs_common.h" +#include "nitro/types.h" + +#define FS_FILE_FLAG_SEND_CMD 0x1 +#define FS_FILE_FLAG_0x2 0x2 +#define FS_FILE_FLAG_AWAIT_SYNC 0x4 +#define FS_FILE_FLAG_0x8 0x8 +#define FS_FILE_FLAG_FILE 0x10 +#define FS_FILE_FLAG_DIR 0x20 +#define FS_FILE_FLAG_0x40 0x40 +#define FS_FILE_FLAG_0x80 0x80 +#define FS_FILE_FLAG_CMD_TYPE_MASK 0xff00 +#define FS_FILE_FLAG_CMD_TYPE(flags) ((FSCmd) ((flags) >> 8)) +#define FS_CMD_FILE_FLAG(cmdType) ((u32) (cmdType << 8)) + +#define FS_SEEK_SET 0 +#define FS_SEEK_CUR 1 +#define FS_SEEK_END 2 + +#define FS_FILEMODE_R 0x1 + +#define FS_FILE_PROC_READ ((FSFileProc) 0) +#define FS_FILE_PROC_WRITE ((FSFileProc) 1) +#define FS_FILE_PROC_2 ((FSFileProc) 2) +#define FS_FILE_PROC_3 ((FSFileProc) 3) +#define FS_FILE_PROC_4 ((FSFileProc) 4) +#define FS_FILE_PROC_5 ((FSFileProc) 5) +#define FS_FILE_PROC_6 ((FSFileProc) 6) +#define FS_FILE_PROC_7 ((FSFileProc) 7) +#define FS_FILE_PROC_CLOSE ((FSFileProc) 8) +#define FS_FILE_PROC_SUSPEND ((FSFileProc) 9) +#define FS_FILE_PROC_UNLOCK ((FSFileProc) 10) +#define FS_FILE_PROC_11 ((FSFileProc) 11) +#define FS_FILE_PROC_12 ((FSFileProc) 12) +#define FS_FILE_PROC_COUNT ((FSFileProc) 13) + +typedef struct FS_UnkStruct8 { + /* 00 */ union { + void *unk_00p; + u32 unk_00u; + }; + /* 04 */ union { + void *unk_04p; + u32 unk_04u; + struct { + u16 unk_04s; + u16 unk_06s; + }; + }; + /* 08 */ union { + void *unk_08p; + u32 unk_08u; + struct { + u16 unk_08s; + u16 unk_0as; + }; + }; + /* 0c */ +} FS_UnkStruct8; + +typedef struct FS_UnkStruct11 { + /* 00 */ FSArchive *archive; + /* 04 */ void *src; + /* 08 */ +} FS_UnkStruct11; + +typedef struct FSFile { + /* 00 */ struct FSFile *next; + /* 04 */ void *cursor; + /* 08 */ FSArchive *archive; + /* 0c */ vu32 flags; + /* 10 */ union { + FSiCmdReadFile *readFile; + FSiCmd1 *cmd1; + FSiCmd2 *cmd2; + FSiCmd3 *cmd3; + FSiCmd4 *cmd4; + FSiCmd5 *cmd5; + FSiCmd6 *cmd6; + FSiCmd7 *cmd7; + FSiCmdSeekFile *seekFile; + FSiCmdOpenFile *openFile; + FSiCmdGetLength *getLength; + FSiCmdGetPosition *getPosition; + FSiCmd19 *cmd19; + FSiCmd20 *cmd20; + FSiCmd21 *cmd21; + FSiCmd22 *cmd22; + FSiCmd23 *cmd23; + FSiCmd24 *cmd24; + FSiCmd25 *cmd25; + FSiCmd26 *cmd26; + FSiCmd27 *cmd27; + FSiCmd28 *cmd28; + FSiCmd31 *cmd31; + FSiCmd32 *cmd32; + FSiCmd34 *cmd34; + void *ptr; + } cmd; + /* 14 */ u32 unk_14; + /* 18 */ OSThreadQueue unk_18; + /* 20 */ FS_UnkStruct8 unk_20; + /* 2c */ union { + void *unk_2cp; + u32 unk_2cu; + u16 unk_2cs; + }; + /* 30 */ FS_UnkStruct8 unk_30; + /* 3c */ char *unk_3c; // path? + /* 40 */ u32 unk_40; + /* 40 */ FS_UnkStruct8 *unk_44; + /* 48 */ +} FSFile; + +typedef FSResult (*const FSFileProcs[FS_FILE_PROC_COUNT])(struct FSFile *file); + +typedef struct FS_UnkStruct21 { + /* 00 */ FSArchive *archive; + /* 04 */ u32 fileId; + /* 08 */ +} FS_UnkStruct21; + +void FS_Init(u32 dmaCount); +void FS_InitFile(FSFile *file); +BOOL FS_OpenFile(FSFile *file, const char *path); +BOOL FS_OpenFileFast(FSFile *file, FS_UnkStruct21 arg1); +BOOL FS_OpenFileDirect(FSFile *file, FSArchive *archive, u32 start, u32 end, u32); +BOOL FS_OpenFileEx(FSFile *file, const char *path, u32 flags); +BOOL FS_SeekFile(FSFile *file, s32 pos, u32 mode); +u32 FS_GetLength(FSFile *file); +u32 FS_ReadFile(FSFile *file, void *buf, u32 size); +BOOL FS_CloseFile(FSFile *file); +s32 FS_func_0003(FS_UnkStruct11 *arg0, void *dst, s32 size); +void FS_func_0060(void); +void FS_func_0055(FSFile *file, FSArchive *archive, s32 arg2, s32 arg3, s32 arg4); +s32 FSi_GetPosition(FSFile *file); +s32 FS_func_0094(FSFile *file); +inline BOOL FS_IsFile(FSFile *file) { + return !!(file->flags & FS_FILE_FLAG_FILE); +} + +extern const u8 FS_data_0001[64]; +extern const FSFileProcs FS_fileProcs; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/fs/fs_overlay.h b/libs/nitro/include/nitro/fs/fs_overlay.h new file mode 100644 index 00000000..2ca51620 --- /dev/null +++ b/libs/nitro/include/nitro/fs/fs_overlay.h @@ -0,0 +1,47 @@ +#ifndef _NITRO_FS_OVERLAY_H +#define _NITRO_FS_OVERLAY_H + +#include "nitro/os.h" +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/types.h" + +#define FS_EXTERN_OVERLAY_ID(name_or_index) extern u32 OVERLAY_##name_or_index##_ID; +#define FS_OVERLAY_ID(name_or_index) ((u32) & OVERLAY_##name_or_index##_ID) + +#define FS_OVERLAY_FLAGS(overlay) ((overlay)->fileSize >> 24) +#define FS_OVERLAY_FLAG_COMPRESSED 1 +#define FS_OVERLAY_FLAG_SIGNED 2 + +typedef void (*FSStaticInit)(void); + +typedef struct FSOverlay { + /* 00 */ u32 id; + /* 04 */ void *addr; + /* 08 */ u32 textSize; + /* 0C */ s32 bssSize; + /* 10 */ FSStaticInit *ctorStart; + /* 14 */ FSStaticInit *ctorEnd; + /* 18 */ s32 fileId; + /* 1C */ u32 fileSize; + /* 20 */ +} FSOverlay; + +typedef struct FSOverlayInfo { + /* 00 */ FSOverlay overlay; + /* 20 */ OSCpu cpu; + /* 24 */ u32 unk_24; + /* 28 */ u32 unk_28; + /* 2c */ +} FSOverlayInfo; + +BOOL FS_LoadOverlay(u32 arg0, u32 id); +BOOL FS_UnloadOverlay(u32 arg0, u32 id); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/fx.h b/libs/nitro/include/nitro/fx.h index 2011e0d0..92a365ae 100644 --- a/libs/nitro/include/nitro/fx.h +++ b/libs/nitro/include/nitro/fx.h @@ -1,18 +1,28 @@ #ifndef _NITRO_FX_H #define _NITRO_FX_H +#include + #include "nitro/types.h" #ifdef __cplusplus extern "C" { #endif +#define FX64C_SHIFT 32 #define FX32_SHIFT 12 #define FX16_SHIFT 12 -#define FX32_ONE (fx32)(1 << FX32_SHIFT) -#define FX16_ONE (fx16)(1 << FX16_SHIFT) +#define FX32_ONE ((fx32) 1 << FX32_SHIFT) +#define FX16_ONE ((fx16) 1 << FX16_SHIFT) +#define FX_F32_TO_FX32(n) ((s32) (((n) * 8192 + 1) / 2)) + +#define FX_MUL(a, b) (fx32)((((s64) (a)) * ((s64) (b)) + 0x800) >> FX32_SHIFT) +#define FX_MUL32x64C(a, b) (fx32)((((s64) (a)) * ((s64) (b)) + 0x80000000) >> FX64C_SHIFT) + +typedef s64 fx64c; +typedef s64 fx64; typedef s32 fx32; typedef s16 fx16; @@ -23,7 +33,7 @@ typedef union VecFx16 { /* 04 */ fx16 z; /* 06 */ }; - fx16 coords[3]; + fx16 values[3]; } VecFx16; typedef union VecFx32 { @@ -33,31 +43,112 @@ typedef union VecFx32 { /* 08 */ fx32 z; /* 0c */ }; - fx32 coords[3]; - -//! TODO: figure out a better way... -#ifdef VECFX32_CTORS - VecFx32(fx32 _x, fx32 _y, fx32 _z) : - x(_x), - y(_y), - z(_z) {} - VecFx32() {} -#endif + fx32 values[3]; } VecFx32; typedef union MtxFx22 { struct { - /* 00 */ fx32 x; - /* 04 */ fx32 y; - /* 08 */ fx32 z; - /* 0c */ fx32 w; + /* 00 */ fx32 _00; + /* 04 */ fx32 _01; + /* 08 */ fx32 _10; + /* 0c */ fx32 _11; /* 10 */ }; - fx32 coords[4]; + fx32 values[4]; } MtxFx22; +typedef union MtxFx33 { + struct { + /* 00 */ fx32 _00; + /* 04 */ fx32 _01; + /* 08 */ fx32 _02; + /* 0c */ fx32 _10; + /* 10 */ fx32 _11; + /* 14 */ fx32 _12; + /* 18 */ fx32 _20; + /* 1c */ fx32 _21; + /* 20 */ fx32 _22; + /* 24 */ + }; + fx32 values[9]; +} MtxFx33; + +typedef union MtxFx43 { + struct { + /* 00 */ fx32 _00; + /* 04 */ fx32 _01; + /* 08 */ fx32 _02; + /* 0c */ fx32 _10; + /* 10 */ fx32 _11; + /* 14 */ fx32 _12; + /* 18 */ fx32 _20; + /* 1c */ fx32 _21; + /* 20 */ fx32 _22; + /* 24 */ fx32 _30; + /* 28 */ fx32 _31; + /* 2c */ fx32 _32; + /* 30 */ + }; + fx32 values[12]; +} MtxFx43; + +typedef union MtxFx44 { + struct { + /* 00 */ fx32 _00; + /* 04 */ fx32 _01; + /* 08 */ fx32 _02; + /* 0c */ fx32 _03; + /* 10 */ fx32 _10; + /* 14 */ fx32 _11; + /* 18 */ fx32 _12; + /* 1c */ fx32 _13; + /* 20 */ fx32 _20; + /* 24 */ fx32 _21; + /* 28 */ fx32 _22; + /* 2c */ fx32 _23; + /* 30 */ fx32 _30; + /* 34 */ fx32 _31; + /* 38 */ fx32 _32; + /* 3c */ fx32 _33; + /* 40 */ + }; + fx32 values[16]; +} MtxFx44; + void FX_Init(void); +fx32 FX_Div(fx32 numer, fx32 denom); +void FX_DivAsync(fx32 numer, fx32 denom); +s32 FX_DivS32(s32 numer, s32 denom); +s32 FX_ModS32(s32 numer, s32 denom); +fx32 FX_GetDivResult(void); +fx64c FX_GetDivResultFx64c(void); +fx32 FX_Inv(fx32 denom); +void FX_InvAsync(fx32 denom); + +s16 FX_Atan2(fx32 y, fx32 x); +u16 FX_AtanIdx(s32 tan); +u16 FX_Atan2Idx(fx32 y, fx32 x); + +void MTX_Transpose33_(const MtxFx33 *src, MtxFx33 *dst); +void MTX_RotX33_(MtxFx33 *mtx, fx32 sin, fx32 cos); +void MTX_RotZ33_(MtxFx33 *mtx, fx32 sin, fx32 cos); +void MTX_Concat33(MtxFx33 *a, MtxFx33 *b, MtxFx33 *dst); +void MTX_Identity43_(MtxFx43 *mtx); +void MTX_PerspectiveW(fx32 arg0, fx32 arg1, fx32 arg2, fx32 arg3, fx32 arg4, fx32 arg5, MtxFx44 *mtx); +void MTX_OrthoW(fx32 top, fx32 bottom, fx32 left, fx32 right, fx32 near, fx32 far, fx32 arg6, MtxFx44 *mtx); + +inline fx32 VEC_DotProduct(const VecFx32 *a, const VecFx32 *b) { + return ((fx64) a->x * (fx64) b->x + (fx64) a->y * (fx64) b->y + (fx64) a->z * (fx64) b->z) >> FX32_SHIFT; +} + +#define VEC_Set(vec, x_, y_, z_) \ + do { \ + vec.x = x_; \ + vec.y = y_; \ + vec.z = z_; \ + } while (0) + #ifdef __cplusplus } // extern "C" #endif diff --git a/libs/nitro/include/nitro/g2.h b/libs/nitro/include/nitro/g2.h index 49dde9c1..3c5d2ec0 100644 --- a/libs/nitro/include/nitro/g2.h +++ b/libs/nitro/include/nitro/g2.h @@ -51,103 +51,103 @@ inline void G2S_SetBG3Priority(u32 value) { } inline void G2_SetBG0Offset(u32 x, u32 y) { - REG_BG0OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000); + REG_BG0OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000); } inline void G2_SetBG1Offset(u32 x, u32 y) { - REG_BG1OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000); + REG_BG1OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000); } inline void G2_SetBG2Offset(u32 x, u32 y) { - REG_BG2OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000); + REG_BG2OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000); } inline void G2_SetBG3Offset(u32 x, u32 y) { - REG_BG3OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000); + REG_BG3OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000); } inline void G2S_SetBG0Offset(u32 x, u32 y) { - REG_BG0OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000); + REG_BG0OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000); } inline void G2S_SetBG1Offset(u32 x, u32 y) { - REG_BG1OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000); + REG_BG1OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000); } inline void G2S_SetBG2Offset(u32 x, u32 y) { - REG_BG2OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000); + REG_BG2OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000); } inline void G2S_SetBG3Offset(u32 x, u32 y) { - REG_BG3OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000); + REG_BG3OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000); } inline void G2_SetBG0Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) { - REG_BG0CNT = (REG_BG0CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); + REG_BG0CNT = (REG_BG0CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); } inline void G2_SetBG1Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) { - REG_BG1CNT = (REG_BG1CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); + REG_BG1CNT = (REG_BG1CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); } inline void G2_SetBG2Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) { - REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); + REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); } inline void G2_SetBG3Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) { - REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); + REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); } inline void G2S_SetBG0Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) { - REG_BG0CNT_SUB = (REG_BG0CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); + REG_BG0CNT_SUB = (REG_BG0CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); } inline void G2S_SetBG1Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) { - REG_BG1CNT_SUB = (REG_BG1CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); + REG_BG1CNT_SUB = (REG_BG1CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); } inline void G2S_SetBG2Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) { - REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); + REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); } inline void G2S_SetBG3Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) { - REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); + REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2); } inline void G2_SetBG2Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) { - REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD); + REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd); } inline void G2_SetBG3Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) { - REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD); + REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd); } inline void G2S_SetBG2Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) { - REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD); + REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd); } inline void G2S_SetBG3Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) { - REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD); + REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd); } inline void G2_SetBG2ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) { - REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD); + REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd); } inline void G2_SetBG3ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) { - REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD); + REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd); } inline void G2S_SetBG2ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) { - REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD); + REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd); } inline void G2S_SetBG3ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) { - REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD); + REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd); } inline void G2_SetBG2ControlText(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase) { @@ -287,16 +287,16 @@ inline void G2S_SetBlendAlpha(u32 srcPlane, u32 dstPlane, u32 srcAlpha, u32 dstA } inline void G2_GetOBJPosition(GXOamAttr *oam, u32 *x, u32 *y) { - *x = (oam->attr01 & 0x1FF0000) >> 16; - *y = oam->attr01 & 0xFF; + *x = (oam->attr01 & 0x1ff0000) >> 16; + *y = oam->attr01 & 0xff; } inline void G2_SetOBJPosition(GXOamAttr *oam, u32 x, u32 y) { - oam->attr01 = (oam->attr01 & 0xFE00FF00) | (y & 0xFF) | (x << 0x17 >> 0x7); + oam->attr01 = (oam->attr01 & 0xfe00ff00) | (y & 0xff) | (x << 0x17 >> 0x7); } inline u32 G2_GetOBJCharName(GXOamAttr *oam) { - return oam->attr2 & 0x3FF; + return oam->attr2 & 0x3ff; } inline void G2_SetOBJCharName(volatile GXOamAttr *oam, u32 name) { @@ -304,18 +304,18 @@ inline void G2_SetOBJCharName(volatile GXOamAttr *oam, u32 name) { } inline u32 G2_GetOBJColorParam(GXOamAttr *oam) { - return (oam->attr2 & 0xF000) >> 0xC; + return (oam->attr2 & 0xf000) >> 0xc; } // Defined as macro as sometimes `oam` is volatile and other times not -#define G2_GetOBJMode(oam) (GXOamMode)(((oam)->attr01 & 0xC00) >> 0xA) +#define G2_GetOBJMode(oam) (GXOamMode)(((oam)->attr01 & 0xc00) >> 0xa) // inline GXOamMode G2_GetOBJMode(volatile GXOamAttr *oam) { -// return ((oam)->attr01 & 0xC00) >> 0xA; +// return ((oam)->attr01 & 0xc00) >> 0xa; // } inline void G2_SetOBJMode(GXOamAttr *oam, GXOamMode mode, u32 color) { - oam->attr01 = (oam->attr01 & ~0xC00) | (mode << 0xA); - oam->attr2 = (oam->attr2 & ~0xF000) | (color << 0xC); + oam->attr01 = (oam->attr01 & ~0xc00) | (mode << 0xa); + oam->attr2 = (oam->attr2 & ~0xf000) | (color << 0xc); } inline void G2_SetOBJPriority(GXOamAttr *oam, u32 prio) { @@ -328,12 +328,12 @@ inline void G2_SetOBJAttr(GXOamAttr *oam, u32 x, u32 y, u32 param4, GXOamMode mo // c1ff0cff // 3 bits at 0x8 - // 4 bits at 0xC + // 4 bits at 0xc // 5 bits at 0x19 - oam->attr01 = (y & 0xFF) | (mode << 0xA) | (shape << 0x1E) | ((x << 0x17) >> 0x7); + oam->attr01 = (y & 0xff) | (mode << 0xa) | (shape << 0x1e) | ((x << 0x17) >> 0x7); // f3ff - // 2 bits at 0xA - oam->attr2 = param10 | (color << 0xC); + // 2 bits at 0xa + oam->attr2 = param10 | (color << 0xc); } #ifdef __cplusplus diff --git a/libs/nitro/include/nitro/g3.h b/libs/nitro/include/nitro/g3.h index 261524dd..e83d1d24 100644 --- a/libs/nitro/include/nitro/g3.h +++ b/libs/nitro/include/nitro/g3.h @@ -19,7 +19,6 @@ void G3X_SetClearColor(u32 rgb, u32 a, u32 param3, u32 param4, BOOL param5); inline void G3_TexImageParam(GXTexFmt fmt, u32 gen, GXTexSizeS sizeS, GXTexSizeT sizeT, u32 repeat, u32 flip, GXTexPlttColor0 color0, u32 addr) { - // Unclear where repeat and flip should go // GGCFFFTT_TSSSffRR_AAAAAAAA_AAAAAAAA (based on gbatek) // G: gen // C: color0 @@ -58,19 +57,21 @@ inline void G3_Translate(fx32 x, fx32 y, fx32 z) { REG_GFX_FIFO_MATRIX_TRANSLATE = y; REG_GFX_FIFO_MATRIX_TRANSLATE = z; } + inline void G3_Scale(fx32 x, fx32 y, fx32 z) { REG_GFX_FIFO_MATRIX_SCALE = x; REG_GFX_FIFO_MATRIX_SCALE = y; REG_GFX_FIFO_MATRIX_SCALE = z; } + inline void G3_ViewPort(u32 left, u32 top, u32 right, u32 bottom) { // Unclear how to combine the arguments // left = 0, top = 0, right = 255, bottom = 191 => 0x8000 - REG_GFX_FIFO_VIEWPORT = 0xBFFF0000; + REG_GFX_FIFO_VIEWPORT = 0xbfff0000; } void _G3_Ortho(fx32 top, fx32 bottom, fx32 left, fx32 right, fx32 near, fx32 far, fx32 param7, BOOL param8, void *param9); inline void G3_Ortho(fx32 top, fx32 bottom, fx32 left, fx32 right, fx32 near, fx32 far, void *param7) { - _G3_Ortho(top, bottom, left, right, near, far, FX32_ONE, true, param7); + _G3_Ortho(top, bottom, left, right, near, far, FX32_ONE, TRUE, param7); } inline void G3_StoreMtx(u32 param1) { REG_GFX_FIFO_MATRIX_STORE = param1; @@ -102,16 +103,20 @@ inline void G3_Direct1(u32 op, GXSt texCoord) { break; } } -inline void G3_Vtx16(u16 x, u16 y, u16 z) { + +inline void G3_Vtx(u16 x, u16 y, u16 z) { REG_GFX_FIFO_VERTEX_16 = x | (y << 0x10); REG_GFX_FIFO_VERTEX_16 = z; } + inline void G3_Vtx10(const u32 x, const u32 y, const u32 z) { REG_GFX_FIFO_VERTEX_10 = (x & 0x3FF) | ((y & 0x3FF) << 0x0A) | ((z & 0x3FF) << 0x14); } + inline void G3_VtxXZ(const u32 x, const u32 z) { REG_GFX_FIFO_VERTEX_XZ = x | (z << 0x10); } + inline void G3_End(void) { REG_GFX_FIFO_POLYGONS_END = 0; } @@ -134,11 +139,11 @@ inline void G3X_AlphaBlend(BOOL param1) { REG_DISP3DCNT = REG_DISP3DCNT & ~0x3000 | (param1 << 3); } -inline void G3X_Unk1(unk32 param1) { +inline void G3X_Unk1(u32 param1) { REG_DISP3DCNT = REG_DISP3DCNT & ~(0x3000 | (param1 << 1)); } -inline void G3X_Unk2(unk32 param1) { +inline void G3X_Unk2(u32 param1) { REG_DISP3DCNT &= ~(0x3000 | (param1 << 5)); } diff --git a/libs/nitro/include/nitro/gx.h b/libs/nitro/include/nitro/gx.h index 9e591dba..fa27328c 100644 --- a/libs/nitro/include/nitro/gx.h +++ b/libs/nitro/include/nitro/gx.h @@ -8,15 +8,15 @@ extern "C" { #include "nitro/reg.h" #include "nitro/types.h" -#define GX_POWER_ALL 0x20E +#define GX_POWER_ALL 0x20e #define GX_DISP_SELECT_MAIN_SUB 0x8000 #define GX_DISP_SELECT_SUB_MAIN 0 #define GX_DISPMODE_GRAPHICS 1 -#define GX_DISPMODE_VRAM_C 0xA -#define GX_DISPMODE_VRAM_D 0xE +#define GX_DISPMODE_VRAM_C 0xa +#define GX_DISPMODE_VRAM_D 0xe -#define GX_VRAM_LCDC_ALL 0x1FF +#define GX_VRAM_LCDC_ALL 0x1ff #define GX_VRAM_LCDC_C 0x4 #define GX_VRAM_LCDC_D 0x8 @@ -27,8 +27,8 @@ extern "C" { #define GX_VRAM_BG_128_D ((GXVRamBG) 0x8) #define GX_VRAM_BG_256_AB ((GXVRamBG) 0x3) #define GX_VRAM_BG_384_ABC ((GXVRamBG) 0x7) -#define GX_VRAM_BG_384_ABD ((GXVRamBG) 0xB) -#define GX_VRAM_BG_512_ABCD ((GXVRamBG) 0xF) +#define GX_VRAM_BG_384_ABD ((GXVRamBG) 0xb) +#define GX_VRAM_BG_512_ABCD ((GXVRamBG) 0xf) #define GX_VRAM_SUB_BG_NONE ((GXVRamBG) 0) #define GX_VRAM_SUB_BG_32_H ((GXVRamBG) 0x80) @@ -140,7 +140,7 @@ extern "C" { #define GX_OAM_SHAPE_64x64 0x3 -#define GX_OAM_COLOR_16 0xF +#define GX_OAM_COLOR_16 0xf #define GX_TEXSIZE_S8 0 #define GX_TEXSIZE_S16 0x1 @@ -189,7 +189,7 @@ extern "C" { #define GX_BEGIN_TRIS_STRIPS 2 // (based on gbatek) #define GX_BEGIN_QUAD_STRIPS 3 // (based on gbatek) -#define GX_RGB(r, g, b) ((r) | ((g) << 0x5) | ((b) << 0xA)) +#define GX_RGB(r, g, b) ((r) | ((g) << 0x5) | ((b) << 0xa)) #define GX_CAPTURE_SIZE_256x192 -1 // unknown value #define GX_CAPTURE_MODE_A -1 // unknown value @@ -382,11 +382,11 @@ inline u16 GX_GetVCount(void) { } inline void GX_SetVisiblePlane(s32 plane) { - REG_DISPCNT = (REG_DISPCNT & ~0x1F00) | (plane << 8); + REG_DISPCNT = (REG_DISPCNT & ~0x1f00) | (plane << 8); } inline void GXS_SetVisiblePlane(s32 plane) { - REG_DISPCNT_SUB = (REG_DISPCNT_SUB & ~0x1F00) | (plane << 8); + REG_DISPCNT_SUB = (REG_DISPCNT_SUB & ~0x1f00) | (plane << 8); } inline void GX_SetBGCharOffset(u32 offset) { diff --git a/libs/nitro/include/nitro/hw.h b/libs/nitro/include/nitro/hw.h index d2348103..a2abb330 100644 --- a/libs/nitro/include/nitro/hw.h +++ b/libs/nitro/include/nitro/hw.h @@ -5,33 +5,46 @@ extern "C" { #endif -#define HW_PLTT ((void *) 0x05000000) +#define HW_PLTT_ADDR 0x05000000 +#define HW_PLTT ((void *) HW_PLTT_ADDR) #define HW_PLTT_SIZE 0x400 -#define HW_DB_PLTT ((void *) 0x05000400) +#define HW_DB_PLTT_ADDR 0x05000400 +#define HW_DB_PLTT ((void *) HW_DB_PLTT_ADDR) #define HW_DB_PLTT_SIZE 0x400 -#define HW_BG_VRAM ((void *) 0x06000000) +#define HW_BG_VRAM_ADDR 0x06000000 +#define HW_BG_VRAM ((void *) HW_BG_VRAM_ADDR) #define HW_BG_VRAM_SIZE // TODO -#define HW_DB_BG_VRAM ((void *) 0x06200000) +#define HW_DB_BG_VRAM_ADDR 0x06200000 +#define HW_DB_BG_VRAM ((void *) HW_DB_BG_VRAM_ADDR) #define HW_DB_BG_VRAM_SIZE // TODO -#define HW_OBJ_VRAM ((void *) 0x06400000) +#define HW_OBJ_VRAM_ADDR 0x06400000 +#define HW_OBJ_VRAM ((void *) HW_OBJ_VRAM_ADDR) #define HW_OBJ_VRAM_SIZE // TODO -#define HW_DB_OBJ_VRAM ((void *) 0x06600000) +#define HW_DB_OBJ_VRAM_ADDR 0x06600000 +#define HW_DB_OBJ_VRAM ((void *) HW_DB_OBJ_VRAM_ADDR) #define HW_DB_OBJ_VRAM_SIZE // TODO -#define HW_LCDC_VRAM ((void *) 0x06800000) +#define HW_LCDC_VRAM_ADDR 0x06800000 +#define HW_LCDC_VRAM ((void *) HW_LCDC_VRAM_ADDR) #define HW_LCDC_VRAM_SIZE 0xA4000 -#define HW_OAM ((void *) 0x07000000) +#define HW_OAM_ADDR 0x07000000 +#define HW_OAM ((void *) HW_OAM_ADDR) #define HW_OAM_SIZE 0x400 -#define HW_DB_OAM ((void *) 0x07000400) +#define HW_DB_OAM_ADDR 0x07000400 +#define HW_DB_OAM ((void *) HW_DB_OAM_ADDR) #define HW_DB_OAM_SIZE 0x400 +#define HW_BIOS_ADDR 0xFFFF0000 +#define HW_BIOS ((void *) HW_BIOS_ADDR) +#define HW_BIOS_SIZE 0x8000 + #ifdef __cplusplus } // extern "C" #endif diff --git a/libs/nitro/include/nitro/math.h b/libs/nitro/include/nitro/math.h index b69e95f2..ac18663a 100644 --- a/libs/nitro/include/nitro/math.h +++ b/libs/nitro/include/nitro/math.h @@ -1,175 +1,35 @@ -#ifndef _NDS_MATH_H -#define _NDS_MATH_H +#ifndef _NITRO_MATH_H +#define _NITRO_MATH_H -#include "global.h" -#include "types.h" - -#include - -#if __MWERKS__ - #define Vec2_Set(a, dst) \ - { \ - (dst)->coords = (a)->coords; \ - } \ - ((void) 0) -#else - #define Vec2_Set(a, dst) \ - { \ - (dst)->x = (a)->x; \ - (dst)->y = (a)->y; \ - } \ - ((void) 0) -#endif - -#define Vec2_CopyAdd(type, a, b, dst) \ - { \ - type temp; \ - temp.x = (a)->x + (b)->x; \ - temp.y = (a)->y + (b)->y; \ - Vec2_Set(&temp, dst); \ - } \ - ((void) 0) - -#define Vec2_CopySub(type, a, b, dst) \ - { \ - type temp; \ - temp.x = (a)->x - (b)->x; \ - temp.y = (a)->y - (b)->y; \ - Vec2_Set(&temp, dst); \ - } \ - ((void) 0) +#include "nitro/fx.h" +#include "nitro/types.h" #ifdef __cplusplus extern "C" { #endif -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#define ABS2(x) ((x) >= 0 ? (x) : -(x)) -#define CLAMP(x, min, max) ((x) > (max) ? (max) : (x) < (min) ? (min) : (x)) -#define CLAMP2(x, min, max) ((x) > (max) ? (max) : (x) >= (min) ? (x) : (min)) -#define CLAMP3(x, min, max) ((x) >= (max) ? (max) : (x) <= (min) ? (min) : (x)) -#define POW_2(x) (x * x) - -static inline const s32 ClampValue(s32 value, const s32 min, const s32 max) { - if (value > max) { - value = max; - } else if (value < min) { - value = min; - } - - return value; -} - -static inline void ClampValue16(s16 *value, const s32 min, const s32 max) { - if (*value > max) { - *value = max; - } else if (*value < min) { - *value = min; - } -} - #define INT_TO_FX32(n) ((s32) ((n) << FX32_SHIFT)) -#define FLOAT_TO_FX32(n) ((s32) (((n) * 8192 + 1) / 2)) #define ROUND_FX32(n) (((s32) (n) + 0x800) >> FX32_SHIFT) -#define MUL_FX32(a, b) (fx32)((((s64) (a)) * ((s64) (b)) + 0x800) >> FX32_SHIFT) #define DIV_FX32(a, b) (((a) << FX32_SHIFT) / (b)) -// some kind of angle conversion? only used for angle values so far -#define MUL_FX32_FX64(a, b) (fx32)(((((a) * (b)) + 0x80000000000LL) >> 32)) -#define UNK_FX_OPERATION_1(a) (MUL_FX32_FX64((u64) (a), 0xB60B60B60BLL) >> FX32_SHIFT) - -#define MUL_FX32_U(a, b) (fx32)((((u64) (a)) * ((u64) (b)) + 0x800) >> FX32_SHIFT) -#define UNK_FX_OPERATION_2(a) MUL_FX32_U((u64) (a), FLOAT_TO_FX32(1.2f)) - -#define DEG_TO_ANG(n) ((n) * 0x10000 / 360) -#define DEG_TO_ANG_ALT(n) DEG_TO_ANG((u64) (n)) #define SIN(n) (gSinCosTable[2 * ((n) >> 4)]) #define COS(n) (gSinCosTable[2 * ((n) >> 4) + 1]) -#define SIN2(table, n) ((table)[2 * ((n) >> 4)]) -#define COS2(table, n) ((table)[2 * ((n) >> 4) + 1]) - -typedef union Vec2p { - struct { - /* 0 */ fx32 x; - /* 4 */ fx32 y; - /* 8 */ - }; - fx32 coords[2]; -} Vec2p; - -#define Vec2p_Add(a, b, dst) Vec2_Add(Vec2p, a, b, dst) -#define Vec2p_Sub(a, b, dst) Vec2_Sub(Vec2p, a, b, dst) -#define Vec2p_Set(a, dst) Vec2_Set(Vec2p, a, dst) -#define Vec2p_Clear(dst) Vec2_Clear(fx32, dst) -static inline void Vec2p_Copy(const Vec2p *src, Vec2p *dst) { -#if __MWERKS__ - dst->coords = src->coords; -#else - dst->x = src->x; - dst->y = src->y; -#endif -} - -typedef union Vec2b { - struct { - /* 0 */ u8 x; - /* 4 */ u8 y; - /* 8 */ - }; - u8 coords[2]; -} Vec2b; - -typedef struct Mat2p { - /* 00 */ Vec2p xColumn; - /* 08 */ Vec2p yColumn; - /* 10 */ -} Mat2p; - -typedef struct Mat3p { - /* 00 */ VecFx32 xColumn; - /* 0C */ VecFx32 yColumn; - /* 18 */ VecFx32 zColumn; - /* 24 */ -} Mat3p; - -typedef struct Mat4x3p { - /* 00 */ VecFx32 xColumn; - /* 0C */ VecFx32 yColumn; - /* 18 */ VecFx32 zColumn; - /* 24 */ VecFx32 wColumn; - /* 30 */ -} Mat4x3p; - -typedef struct Mat4p { - /* 00 */ MtxFx22 xColumn; - /* 10 */ MtxFx22 yColumn; - /* 20 */ MtxFx22 zColumn; - /* 30 */ MtxFx22 wColumn; - /* 40 */ -} Mat4p; - -u32 func_01ff9f3c(s32 a, s32 b); s32 Atan2(s32 x, s32 y); u32 CoDivide64By32(u32 a, u32 b); -u32 func_01ff98f0(u32 a, u32 b); u32 CoReciprocal(u32 x); -u64 func_01ff992c(u32 x); u32 CoSqrt(u32 x); u32 CoInvSqrt(u32 x); u32 AwaitDivisionResult(); u32 GetDivisionResult(); void StartReciprocal(u32 x); void StartSqrt(u32 x); -void func_01ff9ac4(u32 x); u32 AwaitSqrtResult(); void StartDivision64By32(u32 a, u32 b); u32 CoDivide32(u32 a, u32 b); u32 CoRemainder(u32 a, u32 b); -bool Approach(s32 *src, s32 dest, s32 step); -bool Approach_thunk(s32 *src, s32 dest, s32 step); extern const fx16 gSinCosTable[]; extern const VecFx32 gVecFx32_ZERO; @@ -188,10 +48,10 @@ void VecFx32_Scale(VecFx32 *vec, fx32 scale); bool VecFx32_CalculateNormal(VecFx32 *vec, VecFx32 *a, VecFx32 *b, VecFx32 *c); static inline void VecFx32_Rotate(VecFx32 *vec, fx32 sin, fx32 cos, VecFx32 *out) { - out->x += MUL_FX32(vec->z, sin); - out->z += MUL_FX32(vec->z, cos); - out->x += MUL_FX32(vec->x, cos); - out->z += MUL_FX32(vec->x, -sin); + out->x += FX_MUL(vec->z, sin); + out->z += FX_MUL(vec->z, cos); + out->x += FX_MUL(vec->x, cos); + out->z += FX_MUL(vec->x, -sin); } static inline void VecFx32_CopyXZ(VecFx32 *vec, VecFx32 *out) { @@ -244,39 +104,39 @@ static inline bool VecFx32_IsCleared(const VecFx32 *a) { return a->x == 0 && a->y == 0 && a->z == 0; } -void Mat2p_InitIdentity(Mat2p *m); -void Mat2p_InitRotation(Mat2p *m, fx32 sin, fx32 cos); -void Mat2p_Multiply(Mat2p *a, Mat2p *b, Mat2p *out); +void MtxFx22_InitIdentity(MtxFx22 *m); +void MtxFx22_InitRotation(MtxFx22 *m, fx32 sin, fx32 cos); +void MtxFx22_Multiply(MtxFx22 *a, MtxFx22 *b, MtxFx22 *out); -void Mat3p_InitIdentity(Mat3p *m); -void Mat3p_CopyToMat4x3p(Mat3p *m, Mat4x3p *out); -void Mat3p_InitScale(Mat3p *m, fx32 x, fx32 y, fx32 z); -void Mat3p_ScaleColumns(Mat3p *m, Mat3p *out, fx32 x, fx32 y, fx32 z); -void Mat3p_InitXRotation(Mat3p *m, fx32 sin, fx32 cos); -void Mat3p_InitYRotation(Mat3p *m, fx32 sin, fx32 cos); -void Mat3p_InitZRotation(Mat3p *m, fx32 sin, fx32 cos); -void Mat3p_func_01ff8248(Mat3p *m, VecFx32 *v, fx32 scale, fx32 offset); -void Mat3p_func_01ff83a0(Mat3p *a, Mat3p *b); -void Mat3p_Multiply(Mat3p *a, Mat3p *b, Mat3p *out); -void Mat3p_MultiplyVec(VecFx32 *v, Mat3p *m, VecFx32 *out); +void MtxFx33_InitIdentity(MtxFx33 *m); +void MtxFx33_CopyToMat4x3p(MtxFx33 *m, MtxFx33 *out); +void MtxFx33_InitScale(MtxFx33 *m, fx32 x, fx32 y, fx32 z); +void MtxFx33_ScaleColumns(MtxFx33 *m, MtxFx33 *out, fx32 x, fx32 y, fx32 z); +void MtxFx33_InitXRotation(MtxFx33 *m, fx32 sin, fx32 cos); +void MtxFx33_InitYRotation(MtxFx33 *m, fx32 sin, fx32 cos); +void MtxFx33_InitZRotation(MtxFx33 *m, fx32 sin, fx32 cos); +void MtxFx33_func_01ff8248(MtxFx33 *m, VecFx32 *v, fx32 scale, fx32 offset); +void MtxFx33_func_01ff83a0(MtxFx33 *a, MtxFx33 *b); +void MtxFx33_Multiply(MtxFx33 *a, MtxFx33 *b, MtxFx33 *out); +void MtxFx33_MultiplyVec(VecFx32 *v, MtxFx33 *m, VecFx32 *out); -void Mat4x3p_InitIdentity(Mat4x3p *m); -void Mat4x3p_CopyToMat4p(Mat4x3p *m, Mat4p *out); -void Mat4x3p_func_01ff8988(Mat4x3p *m, Mat4x3p *out, fx32 x, fx32 y, fx32 z); -void Mat4x3p_InitScale(Mat4x3p *m, fx32 x, fx32 y, fx32 z); -void Mat4x3p_ScaleColumns(Mat4x3p *m, Mat4x3p *out, fx32 x, fx32 y, fx32 z); -void Mat4x3p_InitXRotation(Mat4x3p *m, fx32 sin, fx32 cos); -void Mat4x3p_InitYRotation(Mat4x3p *m, fx32 sin, fx32 cos); -void Mat4x3p_InitZRotation(Mat4x3p *m, fx32 sin, fx32 cos); -void Mat4x3p_func_01ff8ad8(Mat4x3p *m, VecFx32 *v, fx32 scale, fx32 offset); -void Mat4x3p_func_01ff8af8(Mat4x3p *a, Mat4x3p *b); -void Mat4x3p_Multiply(Mat4x3p *a, Mat4x3p *b, Mat4x3p *out); -void Mat4x3p_MultiplyVec(VecFx32 *v, Mat4x3p *m, VecFx32 *out); +void MtxFx43_InitIdentity(MtxFx43 *m); +void MtxFx43_CopyToMtxFx44(MtxFx43 *m, MtxFx44 *out); +void MtxFx43_func_01ff8988(MtxFx43 *m, MtxFx43 *out, fx32 x, fx32 y, fx32 z); +void MtxFx43_InitScale(MtxFx43 *m, fx32 x, fx32 y, fx32 z); +void MtxFx43_ScaleColumns(MtxFx43 *m, MtxFx43 *out, fx32 x, fx32 y, fx32 z); +void MtxFx43_InitXRotation(MtxFx43 *m, fx32 sin, fx32 cos); +void MtxFx43_InitYRotation(MtxFx43 *m, fx32 sin, fx32 cos); +void MtxFx43_InitZRotation(MtxFx43 *m, fx32 sin, fx32 cos); +void MtxFx43_func_01ff8ad8(MtxFx43 *m, VecFx32 *v, fx32 scale, fx32 offset); +void MtxFx43_func_01ff8af8(MtxFx43 *a, MtxFx43 *b); +void MtxFx43_Multiply(MtxFx43 *a, MtxFx43 *b, MtxFx43 *out); +void MtxFx43_MultiplyVec(VecFx32 *v, MtxFx43 *m, VecFx32 *out); -void Mat4p_InitIdentity(Mat4p *m); -void Mat4p_CopyToMat4x3p(Mat4p *m, Mat4x3p *out); -void Mat4p_InitZRotation(Mat4p *m, fx32 sin, fx32 cos); -void Mat4p_Multiply(Mat4p *a, Mat4p *b, Mat4p *out); +void MtxFx44_InitIdentity(MtxFx44 *m); +void MtxFx44_CopyToMtxFx43(MtxFx44 *m, MtxFx43 *out); +void MtxFx44_InitZRotation(MtxFx44 *m, fx32 sin, fx32 cos); +void MtxFx44_Multiply(MtxFx44 *a, MtxFx44 *b, MtxFx44 *out); #ifdef __cplusplus } diff --git a/libs/nitro/include/nitro/mb.h b/libs/nitro/include/nitro/mb.h index 092d4935..66628dbe 100644 --- a/libs/nitro/include/nitro/mb.h +++ b/libs/nitro/include/nitro/mb.h @@ -35,7 +35,7 @@ typedef struct MBGameRegistry { /* 10 */ const char *iconPaletteFile; /* 14 */ u32 ggid; /* 18 */ u8 numPlayers; - /* 19 */ u8 unk_19[0x3C - 0x19]; + /* 19 */ u8 unk_19[0x3c - 0x19]; /* 3c */ } MBGameRegistry; diff --git a/libs/nitro/include/nitro/mi.h b/libs/nitro/include/nitro/mi.h index 652e0685..1f081dc5 100644 --- a/libs/nitro/include/nitro/mi.h +++ b/libs/nitro/include/nitro/mi.h @@ -10,22 +10,28 @@ extern "C" { #define MI_DMA_MAX_NUM 3 void MI_DmaFill32(u32, void *ptr, u8 value, u32 size); -void MI_DmaCopy16(u32, void *src, void *dst, u32 size); -void MI_DmaCopy32(u32, void *src, void *dst, u32 size); +void MI_DmaCopy16(u32, const void *src, void *dst, u32 size); +void MI_DmaCopy32(u32, const void *src, void *dst, u32 size); void MI_func_0206d87c(u32, void *src, void *dst, u32 size, u32, u32); void MI_func_0206d934(u32); BOOL MI_IsDmaBusy(u32); -void _MI_CpuCopy(void *src, void *dest, u32 size); +void _MI_CpuCopy(const void *src, void *dest, u32 size); void _MI_CpuFill(u32 value, void *ptr, u32 size); void MI_CpuFill8(void *ptr, u8 value, u32 size); -void MI_CpuCopy8(void *src, void *dst, u32 size); -void MI_CpuCopy16(void *src, void *dst, u32 size); -void MI_CpuCopy32(void *src, void *dst, u32 size); -void MI_CpuFill16(int value, void *dst, size_t size); +void MI_CpuCopy8(const void *src, void *dst, u32 size); +void MI_CpuCopy16(const void *src, void *dst, u32 size); +void MI_CpuCopy32(const void *src, void *dst, u32 size); +void MI_CpuFill16(u16 value, void *dst, u32 size); void MI_CpuFill32(u32 value, void *ptr, u32 size); void MI_Swap(u32 *a, u32 *b); +void MIi_UncompressBackward(void *addr); + +void MI_func_0008(s32 dmaChannel, void *param2, u32 param3, s32 param4); +void MI_func_0009(void); +s32 MI_func_0010(s32 dmaChannel, void *param2, u32 param3, u32 param4, u32 param5); + inline void MI_CpuClearFast(void *ptr, u32 size) { _MI_CpuFill(0, ptr, size); } diff --git a/libs/nitro/include/nitro/mic.h b/libs/nitro/include/nitro/mic.h new file mode 100644 index 00000000..d782bee0 --- /dev/null +++ b/libs/nitro/include/nitro/mic.h @@ -0,0 +1,34 @@ +#ifndef _NITRO_MIC_H +#define _NITRO_MIC_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/types.h" + +typedef struct MIC_UnkStruct2 { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ u32 unk_0c; + /* 10 */ u32 unk_10; + /* 14 */ void (*unk_14)(u32, u32); + /* 18 */ u32 unk_18; + /* 1c */ +} MIC_UnkStruct2; + +void MIC_Init(void); +s32 MIC_StartAutoSamplingAsync(MIC_UnkStruct2 *arg0, void (*arg1)(s32, s32), s32 arg2); +s32 MIC_StartAutoSampling(MIC_UnkStruct2 *arg0); +s32 MIC_StopAutoSamplingAsync(void (*arg0)(s32, s32), s32 arg1); +s32 MIC_StopAutoSampling(void); +s32 MIC_GetLastSamplingAddress(void); + +void MicWaitBusy(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/nitro/include/nitro/os.h b/libs/nitro/include/nitro/os.h index 45efa30d..cdac3459 100644 --- a/libs/nitro/include/nitro/os.h +++ b/libs/nitro/include/nitro/os.h @@ -7,19 +7,21 @@ extern "C" { #include -#include "nitro/os/cache.h" -#include "nitro/os/context.h" -#include "nitro/os/mutex.h" -#include "nitro/os/owner.h" -#include "nitro/os/thread.h" +#include "nitro/os/os_alarm.h" +#include "nitro/os/os_arena.h" +#include "nitro/os/os_cache.h" +#include "nitro/os/os_common.h" +#include "nitro/os/os_context.h" +#include "nitro/os/os_irq.h" +#include "nitro/os/os_mutex.h" +#include "nitro/os/os_owner.h" +#include "nitro/os/os_protection.h" +#include "nitro/os/os_thread.h" #include "nitro/reg.h" #define OS_IE_V_BLANK 1 #define OS_IE_H_BLANK 2 -#define OS_ARENA_MAIN 0 -#define OS_ARENA_ITCM 3 -#define OS_ARENA_DTCM 4 #define OS_CURRENT_HEAP_HANDLE -1 #define OS_MESSAGE_NOBLOCK 0 @@ -35,14 +37,10 @@ extern "C" { #define OS_EXMEM_CNT_NDS_SLOT_ACCESS_SHIFT 11 #define OS_EXMEM_CNT_NDS_SLOT_ACCESS (1 << OS_EXMEM_CNT_NDS_SLOT_ACCESS_SHIFT) -#define OS_CPU_ARM9 0 -#define OS_CPU_ARM7 1 +#define OS_CPU_ARM9 ((OSCpu) 0) +#define OS_CPU_ARM7 ((OSCpu) 1) -typedef struct OSLinkedList { - /* 00 */ void *head; - /* 04 */ void *tail; - /* 08 */ -} OSLinkedList; +typedef u32 OSCpu; typedef struct OSMessageQueue { /* 00 */ OSLinkedList unk_00; @@ -58,21 +56,6 @@ typedef struct OSMessageQueue { // TODO: Maybe align is wrong? g_msgBuf in PM4 is aligned by 8 with 4 bytes of padding before it typedef void *OSMessage ATTRIBUTE_ALIGN(8); -typedef struct OSAlarm { - /* 00 */ u32 unk_00; - /* 04 */ u32 unk_04; - /* 08 */ u32 unk_08; - /* 0c */ u32 unk_0c; - /* 10 */ u32 unk_10; - /* 14 */ void *unk_14; - /* 18 */ void *unk_18; - /* 1c */ u32 unk_1c; - /* 20 */ u32 unk_20; - /* 24 */ u32 unk_24; - /* 28 */ u32 unk_28; - /* 2c */ -} OSAlarm; - typedef struct OSDma { /* 00 */ vu32 src; /* 04 */ vu32 dst; @@ -80,19 +63,13 @@ typedef struct OSDma { /* 0c */ } OSDma; -typedef u32 OSHeapHandle; typedef u64 OSTime; -typedef u32 OSIntrMode; - void OS_Init(void); void OS_InitThread(void); void OS_InitTick(void); void OS_InitAlarm(void); void OS_Terminate(void); -void OS_SetIrqFunction(u32 type, void (*function)()); - -void OS_EnableIrqMask(u32 mask); void OS_WaitVBlankIntr(void); void _OS_SpinWait(u32 param1); @@ -112,26 +89,12 @@ void OS_Panic(const char *message) {} #define OS_TPrintf(...) #define OS_Printf(...) #define OS_TVPrintf(...) - #define OS_TPanic(...) _OS_Panic() - #define OS_Panic(...) _OS_Panic() + #define OS_TPanic(...) OS_Terminate() + #define OS_Panic(...) OS_Terminate() #endif void OS_ResetSystem(u32); -void *OS_InitAlloc(u32 arena, u32 addrLo, u32 addrHi, u32); -u32 OS_GetArenaLo(u32 arena); -u32 OS_GetArenaHi(u32 arena); - -void OS_SetArenaLo(u32 arena, void *addr); -void *OS_AllocFromArenaLo(u32 arena, u32 size, u32 num); - -OSHeapHandle OS_CreateHeap(u32 arena, void *addrLo, void *addrHi); -void OS_SetCurrentHeap(u32 arena, OSHeapHandle heap); -void OS_DumpHeap(u32 arena, OSHeapHandle heap); -void *OS_AllocFromHeap(u32 arena, OSHeapHandle heap, u32 size); -void OS_FreeFromHeap(u32 arena, OSHeapHandle heap, void *ptr); -u32 OS_CheckHeap(u32 arena, OSHeapHandle heap); - void OS_Sleep(u32 time); #ifdef DEBUG @@ -140,7 +103,7 @@ void OS_CheckStack(OSThread *thread); #define OS_CheckStack(thread) #endif void OS_func_0044(void); -s32 OS_func_0039(OSMutexQueue *param1); +OSMutex *OS_func_0039(OSMutexQueue *param1); void OS_InitMessageQueue(OSMessageQueue *queue, OSMessage *buf, u32 bufLength); void OS_ReceiveMessage(OSMessageQueue *queue, OSMessage *message, u32 block); @@ -156,17 +119,21 @@ u32 OS_GetConsoleType(void); u32 OS_GetLockID(void); -OSIntrMode OS_DisableInterrupts(void); -u32 OS_DisableInterrupts_Irq(void); -void OS_RestoreInterrupts(u32); -void OS_EnableInterrupts(void); - BOOL OS_func_0206d5ac(u16, u32); void OS_func_0206d66c(u16, u32); u32 OS_func_0206d3cc(void); +u32 OS_GetProcMode(void); + +void OS_Halt(void); + +void OSi_ReferSymbol(void); void OS_func_0013(s32, void (*)(u32), u32); +void OS_func_0094(OSAlarm *timer, u64 time, void *callback, void *arg); + +u32 OS_func_0159(void); + void OS_func_0167(void); void OS_func_0169(u32, void (*)(u32, u32, u32)); BOOL OS_func_0170(u32, u32); @@ -177,42 +144,7 @@ BOOL OS_func_0065(void); void OS_func_0176(u8 *); void OS_func_0178(u32); -inline void OS_SetIrqCheckFlag(void) { - REG_IRQ |= 1; -} - -inline u16 OS_EnableIrq(void) { - u16 oldVal = REG_IME; - REG_IME = 1; - return oldVal; -} - -inline u32 OS_GetMainArenaLo() { - return OS_GetArenaLo(OS_ARENA_MAIN); -} -inline u32 OS_GetMainArenaHi(void) { - return OS_GetArenaHi(OS_ARENA_MAIN); -} -inline u32 OS_GetITCMArenaLo() { - return OS_GetArenaLo(OS_ARENA_ITCM); -} -inline u32 OS_GetITCMArenaHi() { - return OS_GetArenaHi(OS_ARENA_ITCM); -} -inline u32 OS_GetDTCMArenaLo() { - return OS_GetArenaLo(OS_ARENA_DTCM); -} -inline u32 OS_GetDTCMArenaHi() { - return OS_GetArenaHi(OS_ARENA_DTCM); -} - -inline void OS_SetMainArenaLo(void *addr) { - OS_SetArenaLo(OS_ARENA_MAIN, addr); -} - -inline void *OS_AllocFromMainArenaLo(u32 size, u32 num) { - return OS_AllocFromArenaLo(OS_ARENA_MAIN, size, num); -} +void OS_func_0149(u32, u32, u32); inline void *OS_Alloc(u32 size) { return OS_AllocFromHeap(OS_ARENA_MAIN, OS_CURRENT_HEAP_HANDLE, size); diff --git a/libs/nitro/include/nitro/os/context.h b/libs/nitro/include/nitro/os/context.h deleted file mode 100644 index f4f0ddec..00000000 --- a/libs/nitro/include/nitro/os/context.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _NITRO_CONTEXT_H -#define _NITRO_CONTEXT_H - -#include "nitro/types.h" - -typedef struct OSContext { - /* 0x00 */ u32 cpsr; - /* 0x04 */ u32 r[13]; - /* 0x38 */ u32 sp; - /* 0x3C */ u32 lr; - /* 0x40 */ u32 pc; - /* 0x44 */ char unk_40[0x20]; -} OSContext; // Size: 0x64 - -#endif // _NITRO_CONTEXT_H diff --git a/libs/nitro/include/nitro/os/mutex.h b/libs/nitro/include/nitro/os/mutex.h deleted file mode 100644 index 0811ff82..00000000 --- a/libs/nitro/include/nitro/os/mutex.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef NITROSDK_OS_MUTEX_H -#define NITROSDK_OS_MUTEX_H - -#include "nitro/os/thread.h" -#include "nitro/types.h" - -typedef struct OSMutex { - /* 0x00 */ OSThreadQueue queue; - /* 0x08 */ OSThread *thread; - /* 0x0C */ s32 count; - /* 0x10 */ OSMutexLinkedList list; -} OSMutex; // Size: 0x18 - -void OS_InitMutex(OSMutex *mutex); -void OS_LockMutex(OSMutex *mutex); -void OS_UnlockMutex(OSMutex *mutex); -void OS_UnlockAllQueuedThreadMutex(OSThread *thread); -bool OS_TryLockMutex(OSMutex *mutex); - -#endif diff --git a/libs/nitro/include/nitro/os/os_alarm.h b/libs/nitro/include/nitro/os/os_alarm.h new file mode 100644 index 00000000..6b246d1c --- /dev/null +++ b/libs/nitro/include/nitro/os/os_alarm.h @@ -0,0 +1,29 @@ +#ifndef _NITRO_OS_ALARM_H +#define _NITRO_OS_ALARM_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/types.h" + +typedef struct OSAlarm { + /* 00 */ u32 unk_00; + /* 04 */ u32 unk_04; + /* 08 */ u32 unk_08; + /* 0c */ u32 unk_0c; + /* 10 */ u32 unk_10; + /* 14 */ void *unk_14; + /* 18 */ void *unk_18; + /* 1c */ u32 unk_1c; + /* 20 */ u32 unk_20; + /* 24 */ u32 unk_24; + /* 28 */ u32 unk_28; + /* 2c */ +} OSAlarm; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/os/os_arena.h b/libs/nitro/include/nitro/os/os_arena.h new file mode 100644 index 00000000..5978c7ee --- /dev/null +++ b/libs/nitro/include/nitro/os/os_arena.h @@ -0,0 +1,100 @@ +#ifndef _NITRO_OS_ARENA_H +#define _NITRO_OS_ARENA_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/types.h" + +#define OS_ARENA_MAIN 0 +#define OS_ARENA_2 2 +#define OS_ARENA_ITCM 3 +#define OS_ARENA_DTCM 4 +#define OS_ARENA_5 5 +#define OS_ARENA_6 6 +#define OS_ARENA_COUNT 7 + +typedef s32 OSHeapHandle; + +typedef struct OSMemoryBlock { + /* 00 */ struct OSMemoryBlock *prev; + /* 04 */ struct OSMemoryBlock *next; + /* 08 */ u32 size; + /* 0c */ +} OSMemoryBlock; + +typedef struct OSHeap { + /* 00 */ s32 size; + /* 04 */ OSMemoryBlock *free; // sorted by address, descending + /* 08 */ OSMemoryBlock *occupied; + /* 0c */ +} OSHeap; + +typedef struct OSAlloc { + /* 00 */ OSHeapHandle currentHeap; + /* 04 */ s32 numHeaps; + /* 08 */ void *lo; + /* 0c */ void *hi; + /* 10 */ OSHeap *heaps; + /* 14 */ OSHeap heapsArray[]; // length stored in numHeaps +} OSAlloc; + +extern u32 _OS_unk_linker_1; // 0xffffd9b8 +extern u32 _OS_unk_linker_2; // gtactw_eu, diamondtrust_us: 0x800 +extern u32 _OS_unk_linker_3; // 0x027e0080 +extern u32 _OS_unk_linker_4; // gtactw_eu, diamondtrust_us: 0 +#define OS_unk_linker_1 ((s32) (&_OS_unk_linker_1)) +#define OS_unk_linker_2 ((u32) (&_OS_unk_linker_2)) +#define OS_unk_linker_3 ((u8 *) (&_OS_unk_linker_3)) +#define OS_unk_linker_4 ((s32) (&_OS_unk_linker_4)) + +extern BOOL OSi_ArenaInitialized; + +void *OS_InitAlloc(u32 arena, void *addrLo, void *addrHi, u32); +void *OS_GetArenaLo(u32 arena); +void *OS_GetArenaHi(u32 arena); + +void OS_SetArenaLo(u32 arena, void *addr); +void OS_SetArenaHi(u32 arena, void *addr); +void *OS_AllocFromArenaLo(u32 arena, u32 size, u32 num); + +OSHeapHandle OS_CreateHeap(u32 arena, void *addrLo, void *addrHi); +OSHeapHandle OS_SetCurrentHeap(u32 arena, OSHeapHandle heap); +void OS_DumpHeap(u32 arena, OSHeapHandle heap); +void *OS_AllocFromHeap(u32 arena, OSHeapHandle heap, s32 size); +void OS_FreeFromHeap(u32 arena, OSHeapHandle heap, void *ptr); +s32 OS_CheckHeap(u32 arena, OSHeapHandle heap); + +inline void *OS_GetMainArenaLo(void) { + return OS_GetArenaLo(OS_ARENA_MAIN); +} +inline void *OS_GetMainArenaHi(void) { + return OS_GetArenaHi(OS_ARENA_MAIN); +} +inline void *OS_GetITCMArenaLo(void) { + return OS_GetArenaLo(OS_ARENA_ITCM); +} +inline void *OS_GetITCMArenaHi(void) { + return OS_GetArenaHi(OS_ARENA_ITCM); +} +inline void *OS_GetDTCMArenaLo(void) { + return OS_GetArenaLo(OS_ARENA_DTCM); +} +inline void *OS_GetDTCMArenaHi(void) { + return OS_GetArenaHi(OS_ARENA_DTCM); +} + +inline void OS_SetMainArenaLo(void *addr) { + OS_SetArenaLo(OS_ARENA_MAIN, addr); +} + +inline void *OS_AllocFromMainArenaLo(u32 size, u32 num) { + return OS_AllocFromArenaLo(OS_ARENA_MAIN, size, num); +} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/os/cache.h b/libs/nitro/include/nitro/os/os_cache.h similarity index 86% rename from libs/nitro/include/nitro/os/cache.h rename to libs/nitro/include/nitro/os/os_cache.h index f2fd9a3a..579354ce 100644 --- a/libs/nitro/include/nitro/os/cache.h +++ b/libs/nitro/include/nitro/os/os_cache.h @@ -15,10 +15,12 @@ void DC_StoreRange(void *ptr, u32 size); void DC_FlushAll(void); void DC_FlushRange(void *ptr, u32 size); +void DC_InvalidateAll(void *ptr, u32 size); void DC_InvalidateRange(void *ptr, u32 size); void DC_func_0002(); +void IC_InvalidateAll(void); void IC_InvalidateRange(void *ptr, u32 size); #ifdef __cplusplus diff --git a/libs/nitro/include/nitro/os/os_common.h b/libs/nitro/include/nitro/os/os_common.h new file mode 100644 index 00000000..c9ad7756 --- /dev/null +++ b/libs/nitro/include/nitro/os/os_common.h @@ -0,0 +1,26 @@ +#ifndef _NITRO_OS_COMMON_H +#define _NITRO_OS_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/types.h" + +typedef struct OSLinkedList { + /* 00 */ void *head; + /* 04 */ void *tail; + /* 08 */ +} OSLinkedList; + +struct OSThread; +typedef struct OSThreadQueue { + /* 0x00 */ struct OSThread *head; + /* 0x04 */ struct OSThread *tail; +} OSThreadQueue; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/os/os_context.h b/libs/nitro/include/nitro/os/os_context.h new file mode 100644 index 00000000..8424fb1f --- /dev/null +++ b/libs/nitro/include/nitro/os/os_context.h @@ -0,0 +1,14 @@ +#ifndef _NITRO_OS_CONTEXT_H +#define _NITRO_OS_CONTEXT_H + +#include "nitro/os/os_cp.h" +#include "nitro/types.h" + +typedef struct OSContext { + /* 0x00 */ u32 cpsr; + /* 0x04 */ u32 regs[16]; + /* 0x38 */ u32 sp; + /* 0x44 */ CPContext cpCtx; +} OSContext; // Size: 0x64 + +#endif // _NITRO_OS_CONTEXT_H diff --git a/libs/nitro/include/nitro/os/os_cp.h b/libs/nitro/include/nitro/os/os_cp.h new file mode 100644 index 00000000..64069b99 --- /dev/null +++ b/libs/nitro/include/nitro/os/os_cp.h @@ -0,0 +1,26 @@ +#ifndef _NITRO_OS_CP_H +#define _NITRO_OS_CP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/reg.h" +#include "nitro/types.h" + +typedef struct CPContext { + /* 00 */ DivParam div; + /* 10 */ u64 sqrtParam; + /* 18 */ u16 divCnt; + /* 1a */ u16 sqrtCnt; + /* 1c */ +} CPContext; + +void CP_SaveContext(CPContext *param1); +void CPi_RestoreContext(CPContext *param1); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/os/os_irq.h b/libs/nitro/include/nitro/os/os_irq.h new file mode 100644 index 00000000..e4e9f7b4 --- /dev/null +++ b/libs/nitro/include/nitro/os/os_irq.h @@ -0,0 +1,36 @@ +#ifndef _NITRO_OS_IRQ_H +#define _NITRO_OS_IRQ_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/reg.h" +#include "nitro/types.h" + +typedef u32 OSIntrMode; + +void OS_IrqHandler(void); +void OS_SetIrqFunction(u32 type, void (*function)()); +void OS_EnableIrqMask(u32 mask); +void OS_ResetRequestIrqMask(u32 mask); + +OSIntrMode OS_DisableInterrupts(void); +void OS_RestoreInterrupts(u32); +void OS_EnableInterrupts(void); + +inline void OS_SetIrqCheckFlag(void) { + REG_IRQ |= 1; +} + +inline u16 OS_EnableIrq(void) { + u16 oldVal = REG_IME; + REG_IME = 1; + return oldVal; +} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/os/os_mutex.h b/libs/nitro/include/nitro/os/os_mutex.h new file mode 100644 index 00000000..4c204804 --- /dev/null +++ b/libs/nitro/include/nitro/os/os_mutex.h @@ -0,0 +1,45 @@ +#ifndef _NITRO_OS_MUTEX_H +#define _NITRO_OS_MUTEX_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/os/os_common.h" +#include "nitro/types.h" + +struct OSMutex; +struct OSThread; + +typedef struct OSMutexQueue { + /* 0x00 */ struct OSMutex *head; + /* 0x04 */ struct OSMutex *tail; +} OSMutexQueue; + +typedef struct OS_Mutex_UnkStruct1 { + /* 00 */ PAD(0x00, 0x04); + /* 04 */ struct OSThread *unk_04; + /* 08 */ +} OS_Mutex_UnkStruct1; + +typedef struct OSMutex { + /* 00 */ OSThreadQueue unk_00; + /* 08 */ struct OSThread *unk_08; + /* 0c */ vu32 unk_0c; + /* 10 */ OSMutexQueue queue; + /* 18 */ +} OSMutex; + +void OS_InitMutex(OSMutex *mutex); +void OS_LockMutex(OSMutex *mutex); +void OS_UnlockMutex(OSMutex *mutex); +bool OS_TryLockMutex(OSMutex *mutex); + +void OSi_UnlockAllMutex(struct OSThread *param1); +void OS_UnlockAllQueuedThreadMutex(struct OSThread *thread); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/libs/nitro/include/nitro/os/owner.h b/libs/nitro/include/nitro/os/os_owner.h similarity index 100% rename from libs/nitro/include/nitro/os/owner.h rename to libs/nitro/include/nitro/os/os_owner.h diff --git a/libs/nitro/include/nitro/os/os_protection.h b/libs/nitro/include/nitro/os/os_protection.h new file mode 100644 index 00000000..7ef2284c --- /dev/null +++ b/libs/nitro/include/nitro/os/os_protection.h @@ -0,0 +1,31 @@ +#ifndef _NITRO_OS_PROTECTION_H +#define _NITRO_OS_PROTECTION_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/types.h" + +void OS_SetProtectionRegion0(u32); +void OS_SetProtectionRegion1(u32); +void OS_SetProtectionRegion2(u32); +void OS_SetProtectionRegion3(u32); +void OS_SetProtectionRegion4(u32); +void OS_SetProtectionRegion5(u32); +void OS_SetProtectionRegion6(u32); +void OS_SetProtectionRegion7(u32); +u32 OS_GetProtectionRegion0(void); +u32 OS_GetProtectionRegion1(void); +u32 OS_GetProtectionRegion2(void); +u32 OS_GetProtectionRegion3(void); +u32 OS_GetProtectionRegion4(void); +u32 OS_GetProtectionRegion5(void); +u32 OS_GetProtectionRegion6(void); +u32 OS_GetProtectionRegion7(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/nitro/include/nitro/os/os_thread.h b/libs/nitro/include/nitro/os/os_thread.h new file mode 100644 index 00000000..d747da61 --- /dev/null +++ b/libs/nitro/include/nitro/os/os_thread.h @@ -0,0 +1,84 @@ +#ifndef _NITRO_OS_THREAD_H +#define _NITRO_OS_THREAD_H + +#include "nitro/os/os_alarm.h" +#include "nitro/os/os_context.h" +#include "nitro/os/os_mutex.h" + +/// MARK: Types + +struct OSThread; + +typedef void (*OSThreadSwitchCallback)(struct OSThread *oldThread, struct OSThread *newThread); +typedef void (*OSThreadDtor)(void *); + +typedef struct OSThreadInfo { + /* 0x00 */ u16 isSchedulerWaiting; + /* 0x02 */ u16 irqDepth; + /* 0x10 */ struct OSThread *current; + /* 0x14 */ struct OSThread *list; + /* 0x18 */ OSThreadSwitchCallback callback; +} OSThreadInfo; + +typedef struct OSThread { + /* 00 */ OSContext context; + /* 64 */ u32 unk_64; + /* 68 */ struct OSThread *nextPrio; // next thread with lower priority + /* 6c */ u32 unk_6c; + /* 70 */ u32 prio; + /* 74 */ u32 unk_74; + /* 78 */ OSThreadQueue *unk_78; + /* 7c */ struct OSThread *prev; + /* 80 */ struct OSThread *next; + /* 84 */ OSMutex *unk_84; + /* 88 */ OSMutexQueue unk_88; + /* 90 */ void *stackLo; + /* 94 */ void *stackHi; + /* 98 */ u32 *unk_98; + /* 9c */ OSThreadQueue unk_9c; + /* a4 */ u8 unk_a4[0xb0 - 0xa4]; + /* b0 */ OSAlarm *alarm; + /* b4 */ OSThreadDtor destructor; + /* b8 */ +} OSThread; + +extern OSThreadInfo ThreadInfo; + +/// MARK: Functions + +void OS_PauseThread(OSThreadQueue *queue); +void OS_UnpauseThread(OSThreadQueue *queue); +OSMutex *OS_RemoveMutexFromQueue(OSMutexQueue *queue); +OSThread *OS_SelectThread(void); +void OS_CreateThread(OSThread *thread, void (*threadFunc)(void *arg), void *arg, void *stackHi, u32 stackSize, u32 prio); +void OS_WakeupThread(OSThreadQueue *); +void OS_ExitThread(void); +void OS_WakeupThreadDirect(OSThread *param1); +BOOL OS_IsThreadTerminated(const OSThread *thread); +void OS_KillThread(OSThread *thread, void *); +void OS_SleepThread(OSThreadQueue *list); // sleeps current thread, list is optional + +/// MARK: Inlines + +static inline void OS_InitThreadQueue(OSThreadQueue *queue) { + queue->tail = NULL; + queue->head = NULL; +} + +static inline OSThreadInfo *OS_GetThreadInfo(void) { + return &ThreadInfo; +} + +static inline OSThread *OS_GetCurrentThread(void) { + return OS_GetThreadInfo()->current; +} + +static inline void OS_SetCurrentThread(OSThread *thread) { + OS_GetThreadInfo()->current = thread; +} + +static inline u32 OS_GetThreadId(OSThread *thread) { + return thread->unk_6c; +} + +#endif // _NITRO_THREAD_H diff --git a/libs/nitro/include/nitro/os/thread.h b/libs/nitro/include/nitro/os/thread.h deleted file mode 100644 index 8adae05a..00000000 --- a/libs/nitro/include/nitro/os/thread.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef _NITRO_THREAD_H -#define _NITRO_THREAD_H - -#include - -/// MARK: Types - -typedef struct OSThread OSThread; -typedef struct OSMutex OSMutex; - -typedef void (*OSThreadSwitchCallback)(OSThread *oldThread, OSThread *newThread); -typedef void (*OSThreadDestructor)(void *); - -typedef struct OSThreadLinkedList { - /* 0x04 */ OSThread *prev; - /* 0x00 */ OSThread *next; -} OSThreadLinkedList; - -typedef struct OSMutexQueue { - /* 0x00 */ OSMutex *head; - /* 0x04 */ OSMutex *tail; -} OSMutexQueue; - -typedef struct OSMutexLinkedList { - /* 0x00 */ OSMutex *next; - /* 0x04 */ OSMutex *prev; -} OSMutexLinkedList; - -typedef struct OSThreadQueue { - /* 0x00 */ OSThread *head; - /* 0x04 */ OSThread *tail; -} OSThreadQueue; - -typedef struct OSThreadInfo { - /* 0x00 */ u16 isSchedulerWaiting; - /* 0x02 */ u16 irqDepth; - /* 0x10 */ OSThread *current; - /* 0x14 */ OSThread *list; - /* 0x18 */ OSThreadSwitchCallback callback; -} OSThreadInfo; - -typedef struct OSThread { - /* 0x00 */ OSContext context; - /* 0x64 */ s32 state; - /* 0x68 */ OSThread *next; - /* 0x6C */ u32 id; - /* 0x70 */ u32 priority; - /* 0x74 */ void *profiler; - /* 0x78 */ OSThreadQueue *queue; - /* 0x7C */ OSThreadLinkedList list; - /* 0x84 */ OSMutex *mutex; - /* 0x88 */ OSMutexQueue mutexQueue; - /* 0x90 */ u32 stackTop; - /* 0x94 */ u32 stackBottom; - /* 0x98 */ u32 stackOffset; - /* 0x9C */ OSThreadQueue joinQueue; - /* 0xA4 */ void *unk_A4[3]; - /* 0xB0 */ void *unk_B0; - /* 0xB4 */ OSThreadDestructor destructor; - /* 0xB8 */ void *userParam; - /* 0xBC */ s32 error; -} OSThread; // Size: 0xC0 - -extern OSThreadInfo ThreadInfo; - -/// MARK: Functions - -void OS_PauseThread(OSThreadQueue *queue); -void OS_UnpauseThread(OSThreadQueue *queue); -OSMutex *OS_RemoveMutexFromQueue(OSMutexQueue *queue); -OSThread *OS_SelectThread(void); -void OS_CreateThread(OSThread *thread, void (*func)(void *), void *arg, void *stack, u32 stackSize, u32 priority); -void OS_ExitThread(void); -void OS_WakeupThreadDirect(void *param1); - -/// MARK: Inlines - -static inline void OS_InitThreadQueue(OSThreadQueue *queue) { - queue->tail = NULL; - queue->head = NULL; -} - -static inline OSThreadInfo *OS_GetThreadInfo(void) { - return &ThreadInfo; -} - -static inline OSThread *OS_GetCurrentThread(void) { - return OS_GetThreadInfo()->current; -} - -static inline void OS_SetCurrentThread(OSThread *thread) { - OS_GetThreadInfo()->current = thread; -} - -static inline u32 OS_GetThreadId(OSThread *thread) { - return thread->id; -} - -#endif // _NITRO_THREAD_H diff --git a/libs/nitro/include/nitro/pad.h b/libs/nitro/include/nitro/pad.h index a01e94cb..fbf9de75 100644 --- a/libs/nitro/include/nitro/pad.h +++ b/libs/nitro/include/nitro/pad.h @@ -30,11 +30,11 @@ extern "C" { #define PAD_ALL (PAD_BUTTON_ALL | PAD_KEY_ALL) inline BOOL PAD_DetectFold(void) { - return (REG_PAD & 0x8000) >> 0xF; + return (REG_PAD & 0x8000) >> 0xf; } inline u16 PAD_Read(void) { - return ((REG_KEYINPUT | REG_PAD) ^ 0x2FFF) & 0x2FFF; + return ((REG_KEYINPUT | REG_PAD) ^ 0x2fff) & 0x2fff; } #ifdef __cplusplus diff --git a/libs/nitro/include/nitro/pxi.h b/libs/nitro/include/nitro/pxi.h new file mode 100644 index 00000000..90c8b456 --- /dev/null +++ b/libs/nitro/include/nitro/pxi.h @@ -0,0 +1,32 @@ +#ifndef _NITRO_MXI_H +#define _NITRO_MXI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "nitro/types.h" + +#define PXI_IPC_FIFO_CNT_SEND_FULL (1 << 1) // true if send fifo is full +#define PXI_IPC_FIFO_CNT_RECV_EMPTY (1 << 8) // true if recv fifo is empty +#define PXI_IPC_FIFO_CNT_ERROR (1 << 14) +#define PXI_IPC_FIFO_CNT_ERROR_ACK (1 << 14) +#define PXI_IPC_FIFO_CNT_ENABLE (1 << 15) // enables writes to REG_IPC_FIFO_SEND + +typedef struct PXI_UnkStruct1 { + u32 unk_00_0 : 5; + u32 unk_00_5 : 1; + u32 unk_00_6 : 26; +} PXI_UnkStruct1; + +void PXI_Init(void); +void PXI_InitFifo(void); +BOOL PXI_IsCallbackReady(u32, u32); +void PXI_SetFifoRecvCallback(u32, void (*)(u32, u32, u32)); +s32 PXI_SendWordByFifo(u32, u32, u32); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/nitro/include/nitro/reg.h b/libs/nitro/include/nitro/reg.h index b1d572d3..4aba25a3 100644 --- a/libs/nitro/include/nitro/reg.h +++ b/libs/nitro/include/nitro/reg.h @@ -10,7 +10,7 @@ extern "C" { #define REG_BASE 0x4000000 #define REG_POWER_CNT (*(vu16 *) (REG_BASE | 0x304)) -#define REG_IME (*(vu16 *) (REG_BASE | 0x208)) +#define REG_IME (*(vu32 *) (REG_BASE | 0x208)) #define REG_DISPSTAT (*(vu16 *) (REG_BASE | 0x4)) #define REG_VCOUNT (*(vu16 *) (REG_BASE | 0x6)) @@ -57,17 +57,41 @@ extern "C" { #define REG_CARD_DATA_OFFSET 0x100010 #define REG_CARD_DATA (*(vu32 *) (REG_BASE | REG_CARD_DATA_OFFSET)) +typedef struct DivParam { + union { + u64 numer; + struct { + u32 numerLo; + u32 numerHi; + }; + }; + u64 denom; +} DivParam; + +#define REG_DIV_CNT (*(vu16 *) (REG_BASE | 0x280)) +#define REG_DIV (*(DivParam *) (REG_BASE | 0x290)) +#define REG_DIV_NUMER (*(u64 *) (REG_BASE | 0x290)) +#define REG_DIV_DENOM (*(u64 *) (REG_BASE | 0x298)) +#define REG_DIV_RESULT (*(u64 *) (REG_BASE | 0x2a0)) +#define REG_REM_RESULT (*(u64 *) (REG_BASE | 0x2a8)) +#define REG_SQRT_CNT (*(vu16 *) (REG_BASE | 0x2b0)) +#define REG_SQRT_RESULT (*(vu32 *) (REG_BASE | 0x2b4)) +#define REG_SQRT_PARAM (*(u64 *) (REG_BASE | 0x2b8)) + #define REG_FRAME_COUNTER (*(u32 *) (_BIOS_REG_BASE | 0xC3C)) #define REG_027FFC40 (*(u16 *) (_BIOS_REG_BASE | 0xC40)) #define REG_027FFC42 (*(u16 *) (_BIOS_REG_BASE | 0xC42)) +#define REG_027FFD9C (*(void **) (_BIOS_REG_BASE | 0xD9C)) +#define REG_027FFDA0 ((void **) (_BIOS_REG_BASE | 0xDA0)) +#define REG_027FFDC4 ((void **) (_BIOS_REG_BASE | 0xDC4)) #define REG_027FFDE8 (*(u32 *) (_BIOS_REG_BASE | 0xDE8)) #define REG_027FFDEA (*(u16 *) (_BIOS_REG_BASE | 0xDEA)) #define REG_027FFDEC (*(u32 *) (_BIOS_REG_BASE | 0xDEC)) -#define REG_FNT_ROM_OFFSET (*(u32 *) (_BIOS_REG_BASE | 0xE40)) -#define REG_FNT_SIZE (*(u32 *) (_BIOS_REG_BASE | 0xE44)) -#define REG_FAT_ROM_OFFSET (*(u32 *) (_BIOS_REG_BASE | 0xE48)) -#define REG_FAT_SIZE (*(u32 *) (_BIOS_REG_BASE | 0xE4C)) -#define REG_027FFF9C (*(u32 *) (_BIOS_REG_BASE | 0xF9C)) +#define REG_ROM_HEADER (*(RomHeader *) (_BIOS_REG_BASE | 0xE00)) +#define REG_IPC_FIFO_RECV_CALLBACKS (*(u32 *) (_BIOS_REG_BASE | 0xF88)) +#define REG_027FFF90 (*(u32 *) (_BIOS_REG_BASE | 0xF90)) +#define REG_027FFF9C_ADDR (_BIOS_REG_BASE | 0xF9C) +#define REG_027FFF9C (*(u32 *) REG_027FFF9C_ADDR) #define REG_027FFFA0 (*(u32 *) (_BIOS_REG_BASE | 0xFA0)) #define REG_GFX_FIFO (*(vu32 *) (REG_BASE | 0x400)) @@ -93,8 +117,20 @@ extern "C" { #define REG_GFX_FIFO_SWAP_BUFFERS (*(vu32 *) (REG_BASE | 0x540)) #define REG_GFX_FIFO_VIEWPORT (*(vu32 *) (REG_BASE | 0x580)) +#define REG_IPC_SYNC (*(vu16 *) (REG_BASE | 0x180)) +#define REG_IPC_FIFO_CNT (*(vu16 *) (REG_BASE | 0x184)) +#define REG_IPC_FIFO_SEND (*(PXI_UnkStruct1 *) (REG_BASE | 0x188)) +#define REG_04100000 (*(PXI_UnkStruct1 *) (REG_BASE | 0x100000)) + extern u32 __DTCM_LO; +extern u32 __DTCM_HI; +extern u32 __ITCM_HI; +extern u32 __CODE_HI; #define DTCM_LO ((u8 *) &__DTCM_LO) +#define DTCM_HI ((u8 *) &__DTCM_HI) +#define ITCM_HI ((u8 *) &__ITCM_HI) +#define CODE_HI ((u8 *) (&__CODE_HI)) + #define REG_IRQ (*(u32 *) (DTCM_LO + 0x3FF8)) #define _MAIN_REG_BASE REG_BASE @@ -192,6 +228,66 @@ extern u32 __DTCM_LO; #define REG_04FFF200 (*(vu32 *) (REG_BASE | 0xFFF200)) +// TODO: Move these structs somewhere else +typedef struct ProgramOffset { + /* 00 */ u32 offset; + /* 04 */ u32 entry; + /* 08 */ u32 baseAddress; + /* 0c */ u32 size; + /* 10 */ +} ProgramOffset; + +typedef struct TableOffset { + /* 00 */ u32 offset; + /* 04 */ u32 size; + /* 08 */ +} TableOffset; + +typedef struct RomHeader { + /* 000 */ char title[0xc]; + /* 00c */ char gamecode[0x4]; + /* 010 */ char makercode[0x2]; + /* 012 */ u8 unitcode; + /* 013 */ u8 seedSelect; + /* 014 */ u8 capacity; + /* 015 */ PAD(0x015, 0x01c); + /* 01c */ u8 dsiFlags; + /* 01d */ u8 dsFlags; + /* 01e */ u8 romVersion; + /* 01f */ u8 autostart; + /* 020 */ ProgramOffset arm9; + /* 030 */ ProgramOffset arm7; + /* 040 */ TableOffset fnt; + /* 048 */ TableOffset fat; + /* 050 */ TableOffset arm9ovt; + /* 058 */ TableOffset arm7ovt; + /* 060 */ u32 normalCmdSetting; + /* 064 */ u32 key1CmdSetting; + /* 068 */ u32 bannerOffset; + /* 06c */ u16 secureAreaCrc; + /* 06e */ u16 secureAreaDelay; + /* 070 */ u32 arm9AutoloadCallback; + /* 074 */ u32 arm7AutoloadCallback; + /* 078 */ u64 secureAreaDisable; + /* 080 */ u32 romSizeDs; + /* 084 */ u32 headerSize; + /* 088 */ u32 arm9BuildInfoOffset; + /* 08c */ u32 arm7BuildInfoOffset; + /* 090 */ u16 dsRomRegionEnd; + /* 092 */ u16 dsiRomRegionEnd; + /* 094 */ u16 romNandEnd; + /* 096 */ u16 rwNandEnd; + /* 098 */ PAD(0x098, 0x0c0); + /* 0c0 */ u8 logo[0x9c]; + /* 15c */ u16 logoCrc; + /* 15e */ u16 headerCrc; + /* 160 */ u32 debugRomOffset; + /* 164 */ u32 debugSize; + /* 168 */ u32 debugRamAddr; + /* 16c */ PAD(0x16c, 0x170); + /* 170 */ +} RomHeader; + #ifdef __cplusplus } // extern "C" #endif diff --git a/libs/nitro/include/nitro/snd.h b/libs/nitro/include/nitro/snd.h index c62361fb..6769714c 100644 --- a/libs/nitro/include/nitro/snd.h +++ b/libs/nitro/include/nitro/snd.h @@ -10,7 +10,7 @@ extern "C" { #define SND_COMMAND_NOBLOCK 0 #define SND_COMMAND_BLOCK 1 -#define SND_TIMER_CLOCK 0xFFB0FF +#define SND_TIMER_CLOCK 0xffb0ff #define SND_WAVE_FORMAT_PCM16 1 @@ -22,13 +22,13 @@ typedef void (*SNDAlarmCallback)(void *arg); typedef u32 SNDCommandType; enum SNDCommandType_ { - SNDCommandType_StartTimer = 0xC, - SNDCommandType_SetupChannelPcm = 0xE, + SNDCommandType_StartTimer = 0xc, + SNDCommandType_SetupChannelPcm = 0xe, SNDCommandType_SetupAlarm = 0x12, SNDCommandType_SetChannelVolume = 0x14, SNDCommandType_SetChannelPan = 0x15, - SNDCommandType_LockChannel = 0x1A, - SNDCommandType_Unk_1d = 0x1D, + SNDCommandType_LockChannel = 0x1a, + SNDCommandType_Unk_1d = 0x1d, }; typedef struct SNDCommand { @@ -48,7 +48,6 @@ void SND_Init(void); SNDCommand *SND_RecvCommandReply(u32); BOOL SND_FlushCommand(u32); -void SND_StopTimer(u32 channel, u32, u32 alarm, u32); void SND_UnlockChannel(u32 channel, u32); void SND_LockChannel(u32 channel, u32); void SND_SetChannelVolume(u32 channel, u32 volume, u32 datashift); @@ -59,6 +58,7 @@ void SND_SetupChannelPcm(u32 channel, u32 format, void *buf, u32 loop, u32, u32 void SND_SetupAlarm(u32 num, u32, u32, SNDAlarmCallback callback, void *arg); void SND_StartTimer(u32 channel, u32, u32 num, u32); +void SND_StopTimer(u32 channel, u32, u32 alarm, u32); u32 SND_GetCurrentCommandTag(void); void SND_WaitForCommandProc(u32 tag); diff --git a/libs/nitro/include/nitro/std.h b/libs/nitro/include/nitro/std.h index 3c4f8454..27bf400d 100644 --- a/libs/nitro/include/nitro/std.h +++ b/libs/nitro/include/nitro/std.h @@ -5,10 +5,14 @@ extern "C" { #endif +#include "nitro/types.h" + s32 STD_CompareNString(const char *src, const char *dst, s32 size); s32 STD_CompareString(const char *src, const char *dst); char *STD_CopyString(char *dst, const char *src); -char *STD_SearchString(const char *src, const char *dst); +s32 STD_CopyLString(char *dst, const char *src, s32 size); +const char *STD_SearchString(const char *src, const char *dst); +s32 STD_GetStringLength(const char *arg0); #ifdef __cplusplus } // extern "C" diff --git a/libs/nitro/include/nitro/types.h b/libs/nitro/include/nitro/types.h index 899e7acb..ba8c987d 100644 --- a/libs/nitro/include/nitro/types.h +++ b/libs/nitro/include/nitro/types.h @@ -9,29 +9,28 @@ extern "C" { #endif typedef unsigned long long u64; -typedef unsigned long ulong; -typedef unsigned int u32; +typedef unsigned int u32; //! TODO: convert to unsigned long +typedef unsigned int uint; typedef unsigned short u16; typedef unsigned char u8; typedef long long s64; -typedef long slong; -typedef int s32; +typedef int s32; //! TODO: convert to unsigned long typedef short s16; -typedef char s8; +typedef char s8; //! TODO convert to signed char typedef float f32; typedef double f64; typedef volatile u64 vu64; -typedef volatile u64 vulong; typedef volatile u32 vu32; +typedef volatile uint vuint; typedef volatile u16 vu16; typedef volatile u8 vu8; typedef volatile s64 vs64; -typedef volatile s64 vslong; typedef volatile s32 vs32; +typedef volatile int vints; typedef volatile s16 vs16; typedef volatile s8 vs8; @@ -47,6 +46,22 @@ typedef s32 BOOL; #define ARRAY_LEN(arr) (s32)((sizeof(arr) / sizeof(*arr))) #define ARRAY_LEN_U(arr) (u32)((sizeof(arr) / sizeof(*arr))) +#define PAD(start, end) u8 unk_##start[end - start] + +#if !defined(NITRO_NO_ASM) && !defined(__MWERKS__) && !defined(__CLANGD__) + #error NITRO_NO_ASM is required for compilers other than mwccarm +#endif + +#ifdef __MWERKS__ + #define ASM asm + #define THUMB_DISABLE() _Pragma("push") _Pragma("thumb off") + #define THUMB_ENABLE() _Pragma("pop") +#else + #define ASM + #define THUMB_DISABLE() + #define THUMB_ENABLE() +#endif + #ifdef __cplusplus } // extern "C" #endif diff --git a/libs/nitro/include/nitro/wm.h b/libs/nitro/include/nitro/wm.h index baa0448c..c3fa2d75 100644 --- a/libs/nitro/include/nitro/wm.h +++ b/libs/nitro/include/nitro/wm.h @@ -5,20 +5,22 @@ extern "C" { #endif -#define WM_SYSTEM_BUF_SIZE 0xF00 +#include "nitro/types.h" + +#define WM_SYSTEM_BUF_SIZE 0xf00 #define WM_ERRCODE_SUCCESS 0 #define WM_ERRCODE_FAILED 0x1 #define WM_ERRCODE_ILLEGAL_STATE 0x3 #define WM_ERRCODE_OPERATING 0x2 #define WM_ERRCODE_TIMEOUT 0x9 -#define WM_ERRCODE_NO_ENTRY 0xB // may swap value with WM_ERRCODE_OVER_MAX_ENTRY -#define WM_ERRCODE_OVER_MAX_ENTRY 0xC -#define WM_ERRCODE_SEND_FAILED 0xF +#define WM_ERRCODE_NO_ENTRY 0xb // may swap value with WM_ERRCODE_OVER_MAX_ENTRY +#define WM_ERRCODE_OVER_MAX_ENTRY 0xc +#define WM_ERRCODE_SEND_FAILED 0xf #define WM_STATECODE_PARENT_START 0x0 #define WM_STATECODE_PARENT_FOUND 0x5 -#define WM_STATECODE_MP_START 0xA +#define WM_STATECODE_MP_START 0xa #define WM_STATECODE_CONNECTED 0x7 #define WM_STATECODE_BEACON_LOST 0x8 #define WM_STATECODE_DISCONNECTED 0x9 @@ -47,7 +49,7 @@ typedef struct WMParentParam { /* 14 */ u16 KS_Flag; /* 16 */ u16 CS_Flag; /* 18 */ u16 beaconPeriod; - /* 1a */ u8 unk_1a[0x32 - 0x1A]; + /* 1a */ u8 unk_1a[0x32 - 0x1a]; /* 32 */ u16 channel; /* 34 */ u16 parentMaxSize; /* 36 */ u16 childMaxSize; @@ -59,7 +61,7 @@ typedef struct WMScanParam { /* 04 */ u16 channel; /* 06 */ u16 maxChannelTime; /* 08 */ u8 bssid[WM_SIZE_BSSID]; - /* 0e */ u8 unk_0e[0x20 - 0x0E]; + /* 0e */ u8 unk_0e[0x20 - 0x0e]; /* 20 */ } WMScanParam; @@ -101,7 +103,7 @@ typedef struct WMPortRecvCallback { /* 00 */ u8 unk_00[0x02 - 0x00]; /* 02 */ WMErrCode errcode; /* 04 */ WMStateCode state; - /* 08 */ u8 unk_08[0x0C - 0x08]; + /* 08 */ u8 unk_08[0x0c - 0x08]; /* 0c */ void *data; /* 10 */ u16 length; /* 14 */ @@ -118,7 +120,7 @@ typedef struct WMStartParentCallback { /* 02 */ WMErrCode errcode; /* 04 */ u8 unk_04[0x08 - 0x04]; /* 08 */ WMStateCode state; - /* 0a */ u8 unk_0a[0x10 - 0x0A]; + /* 0a */ u8 unk_0a[0x10 - 0x0a]; /* 10 */ u16 aid; } WMStartParentCallback; @@ -134,16 +136,16 @@ typedef struct WMStartScanCallback { /* 02 */ WMErrCode errcode; /* 04 */ u8 unk_04[0x08 - 0x04]; /* 08 */ WMStateCode state; - /* 0a */ u8 unk_0a[0x3C - 0x0A]; + /* 0a */ u8 unk_0a[0x3c - 0x0a]; /* 3c */ WMGameInfo gameInfo; } WMStartScanCallback; typedef struct WMPortSendCallback { /* 00 */ u8 unk_00[0x02 - 0x00]; /* 02 */ WMErrCode errcode; - /* 04 */ u8 unk_04[0x0C - 0x04]; + /* 04 */ u8 unk_04[0x0c - 0x04]; /* 0c */ u16 destBitmap; - /* 0e */ u8 unk_0e[0x10 - 0x0E]; + /* 0e */ u8 unk_0e[0x10 - 0x0e]; /* 10 */ u16 sentBitmap; /* 12 */ u8 unk_12[0x14 - 0x12]; /* 14 */ void *data; @@ -160,7 +162,7 @@ typedef struct WMMeasureChannelCallback { typedef struct WMStatus { WMStateCode state; - u8 unk[0x7CC]; + u8 unk[0x7cc]; } WMStatus; WMErrCode WM_Initialize(void *buf, void (*callback)(void *arg), u32 param3); @@ -202,6 +204,10 @@ WMErrCode WM_MeasureChannel(void (*callback)(void *arg), u32 param2, u32 param3, void WM_ReadStatus(WMStatus *status); +void WM_func_0007(void *dst, const void *src, u32 size); +u32 WM_func_0008(void); +s32 WM_func_0009(const void *a, const void *b, u32 size); + #ifdef __cplusplus } // extern "C" #endif diff --git a/libs/nns/include/nns/anim.h b/libs/nns/include/nns/anim.h index 60df84c8..babb1636 100644 --- a/libs/nns/include/nns/anim.h +++ b/libs/nns/include/nns/anim.h @@ -44,7 +44,7 @@ typedef struct UnkAnimStruct1 { } UnkAnimStruct1; // size = 0x14 typedef struct UnkAnimStruct2 { - /* 00 */ STRUCT_PAD(0x00, 0x0A); + /* 00 */ PAD(0x00, 0x0A); /* 0A */ unk16 unk_0A; } UnkAnimStruct2; diff --git a/libs/nns/include/nns/g3d/g3d.h b/libs/nns/include/nns/g3d/g3d.h index c4cace22..ff2a2ec0 100644 --- a/libs/nns/include/nns/g3d/g3d.h +++ b/libs/nns/include/nns/g3d/g3d.h @@ -28,15 +28,15 @@ typedef struct G3d_NameList_Header_ { } G3d_NameList_Header; typedef struct G3d_InvBindMtx_ { - /* 00 */ Mat4x3p mtx; - /* 30 */ Mat3p unkMtx; + /* 00 */ MtxFx43 mtx; + /* 30 */ MtxFx33 unkMtx; /* 54 */ } G3d_InvBindMtx; typedef struct G3d_BoneMtxStruct_ { /* 00 */ u32 flag; /* 04 */ u8 mUnk_04[0x24]; - /* 28 */ Mat3p rot; + /* 28 */ MtxFx33 rot; /* 58 */ u8 mUnk_58[0xC]; /* 64 */ } G3d_BoneMtxStruct; diff --git a/libs/nns/include/nns/g3d/sbc.h b/libs/nns/include/nns/g3d/sbc.h index da4cff3e..cda0dd99 100644 --- a/libs/nns/include/nns/g3d/sbc.h +++ b/libs/nns/include/nns/g3d/sbc.h @@ -67,8 +67,8 @@ typedef struct G3d_RenderState_ { typedef struct UnkStruct_0205ae08_ { /* 00 */ u8 mUnk_00[0x1400]; /* 1400 */ struct { - Mat4p mtx1; - Mat3p mtx2; + MtxFx44 mtx1; + MtxFx33 mtx2; } mUnk_1400[64]; } UnkStruct_0205ae08; @@ -94,15 +94,15 @@ static inline void G3d_RestoreMtx_inline(u32 idx) { PushGeometryCommand(0x14, &idx, 1); } -static inline void G3d_MtxMult33_inline(const Mat3p *m) { +static inline void G3d_MtxMult33_inline(const MtxFx33 *m) { PushGeometryCommand(0x1A, (u32 *) m, 9); } -static inline void G3d_MtxMult43_inline(const Mat4x3p *m) { +static inline void G3d_MtxMult43_inline(const MtxFx43 *m) { PushGeometryCommand(0x19, (u32 *) m, 12); } -static inline void G3d_MtxMult44_inline(const Mat4p *m) { +static inline void G3d_MtxMult44_inline(const MtxFx44 *m) { PushGeometryCommand(0x18, (u32 *) m, 0x10); } diff --git a/libs/nns/src/g3d/sbc.c b/libs/nns/src/g3d/sbc.c index 6326208f..7d61fd7b 100644 --- a/libs/nns/src/g3d/sbc.c +++ b/libs/nns/src/g3d/sbc.c @@ -2,9 +2,9 @@ typedef struct UnkStruct_027e037c_ { /* 000 */ s32 mUnk_000; /* 004 */ s32 mUnk_004; - /* 008 */ Mat4p mUnk_008; + /* 008 */ MtxFx44 mUnk_008; /* 048 */ s32 mUnk_048; - /* 04C */ Mat4x3p mUnk_04C; + /* 04C */ MtxFx43 mUnk_04C; /* 07C */ s32 mUnk_07C; /* 080 */ s32 mUnk_080; /* 084 */ s32 mUnk_084; @@ -21,15 +21,15 @@ typedef struct UnkStruct_027e037c_ { /* 0B0 */ s32 mUnk_0B0; /* 0B4 */ s32 mUnk_0B4; /* 0B8 */ s32 mUnk_0B8; - /* 0BC */ Mat3p rotation; + /* 0BC */ MtxFx33 rotation; /* 0E0 */ VecFx32 translation; /* 0EC */ VecFx32 scale; /* 0F8 */ s32 mUnk_0F8; /* 0FC */ u32 flags; - /* 100 */ Mat4x3p mUnk_100; - /* 130 */ Mat4x3p mUnk_130; - /* 160 */ Mat4x3p mUnk_160; - /* 190 */ Mat4x3p mUnk_190; + /* 100 */ MtxFx43 mUnk_100; + /* 130 */ MtxFx43 mUnk_130; + /* 160 */ MtxFx43 mUnk_160; + /* 190 */ MtxFx43 mUnk_190; /* 1C0 */ } UnkStruct_027e037c; @@ -43,18 +43,18 @@ extern UnkStruct_027e037c data_027e0208; #define GX_PACK_TEXCOORD_PARAM(s, t) (GX_ST((s), (t))) extern void FlushGfxQueue(); -extern s32 func_02024d64(Mat4p *matrix); -extern Mat4x3p *func_0200c198(); -extern Mat4x3p *func_0200c23c(); -extern Mat4x3p *func_0200c270(); -extern s32 func_02024d94(Mat3p *matrix); -extern void func_02024a68(s32 param1); -extern void func_02024a30(Mat4x3p *matrix); +extern s32 func_02024d64(MtxFx44 *matrix); +extern MtxFx43 *func_0200c198(); +extern MtxFx43 *func_0200c23c(); +extern MtxFx43 *func_0200c270(); +extern s32 func_02024d94(MtxFx33 *matrix); +extern void func_02024a68(void *param1); +extern void func_02024a30(MtxFx43 *matrix); extern void func_01ff8dac(const void *param1, u32 param2); -extern void func_02024a84(Mat3p *param1); -extern Mat3p gGeomMatrix; +extern void func_02024a84(MtxFx33 *param1); +extern MtxFx33 gGeomMatrix; extern VecFx32 gGeomTranslation; -extern void G3d_GetCurrentMtx(Mat4x3p *mtx1, Mat3p *mtx2); +extern void G3d_GetCurrentMtx(MtxFx43 *mtx1, MtxFx33 *mtx2); UnkStruct_0205ae08 data_02046c80; @@ -196,7 +196,7 @@ void G3d_SBCRender_007(G3d_RenderState *renderState, u32 opCode) { VecFx32 *translationVec = (VecFx32 *) &funcArgs[12]; VecFx32 *scaleVec = (VecFx32 *) &funcArgs[15]; - Mat4p currentMtx; + MtxFx44 currentMtx; u8 callbackSkip; u32 callbackSegment; @@ -256,26 +256,26 @@ void G3d_SBCRender_007(G3d_RenderState *renderState, u32 opCode) { ; if (data_027e0208.flags & 1) { - const Mat4x3p *mtx1 = func_0200c23c(); - Mat4p mtx2; + const MtxFx43 *mtx1 = func_0200c23c(); + MtxFx44 mtx2; - Mat4x3p_CopyToMat4p(mtx1, &mtx2); - Mat4p_Multiply(¤tMtx, &mtx2, ¤tMtx); + MtxFx43_CopyToMtxFx44(mtx1, &mtx2); + MtxFx44_Multiply(¤tMtx, &mtx2, ¤tMtx); } else if (data_027e0208.flags & 2) { - const Mat4x3p *mtx1 = &data_027e0208.mUnk_04C; - Mat4p mtx2; + const MtxFx43 *mtx1 = &data_027e0208.mUnk_04C; + MtxFx44 mtx2; - Mat4x3p_CopyToMat4p(mtx1, &mtx2); - Mat4p_Multiply(¤tMtx, &mtx2, ¤tMtx); + MtxFx43_CopyToMtxFx44(mtx1, &mtx2); + MtxFx44_Multiply(¤tMtx, &mtx2, ¤tMtx); } - translationVec->x = currentMtx.wColumn.x; - translationVec->y = currentMtx.wColumn.y; - translationVec->z = currentMtx.wColumn.z; + translationVec->x = currentMtx._30; + translationVec->y = currentMtx._31; + translationVec->z = currentMtx._32; - scaleVec->x = VecFx32_Length((VecFx32 *) ¤tMtx.xColumn); - scaleVec->y = VecFx32_Length((VecFx32 *) ¤tMtx.yColumn); - scaleVec->z = VecFx32_Length((VecFx32 *) ¤tMtx.zColumn); + scaleVec->x = VecFx32_Length((VecFx32 *) ¤tMtx._00); + scaleVec->y = VecFx32_Length((VecFx32 *) ¤tMtx._10); + scaleVec->z = VecFx32_Length((VecFx32 *) ¤tMtx._20); if (data_027e0208.flags & 1) { REG_GFX_FIFO = 0x171012; // MTX_POP | MTX_MODE | MTX_LOAD_4x3 @@ -320,7 +320,7 @@ void G3d_SBCRender_007(G3d_RenderState *renderState, u32 opCode) { // Renders the SBC command 0x8 (unknown) void G3d_SBCRender_008(G3d_RenderState *renderState, u32 opCode) { u32 totalArgs = 2; - Mat4p currentMtx; + MtxFx44 currentMtx; // clang-format off static u32 funcArgs[] = { @@ -335,7 +335,7 @@ void G3d_SBCRender_008(G3d_RenderState *renderState, u32 opCode) { VecFx32 *translationVec = (VecFx32 *) &funcArgs[12]; VecFx32 *scaleVec = (VecFx32 *) &funcArgs[15]; - Mat4x3p *mtx = (Mat4x3p *) &funcArgs[3]; + MtxFx43 *mtx = (MtxFx43 *) &funcArgs[3]; u8 callbackSkip; u32 callbackSegment; @@ -394,37 +394,37 @@ void G3d_SBCRender_008(G3d_RenderState *renderState, u32 opCode) { ; if (data_027e0208.flags & 1) { - const Mat4x3p *mtx1 = func_0200c23c(); - Mat4p mtx2; + const MtxFx43 *mtx1 = func_0200c23c(); + MtxFx44 mtx2; - Mat4x3p_CopyToMat4p(mtx1, &mtx2); - Mat4p_Multiply(¤tMtx, &mtx2, ¤tMtx); + MtxFx43_CopyToMtxFx44(mtx1, &mtx2); + MtxFx44_Multiply(¤tMtx, &mtx2, ¤tMtx); } else if (data_027e0208.flags & 2) { - const Mat4x3p *mtx1 = &data_027e0208.mUnk_04C; - Mat4p mtx2; + const MtxFx43 *mtx1 = &data_027e0208.mUnk_04C; + MtxFx44 mtx2; - Mat4x3p_CopyToMat4p(mtx1, &mtx2); - Mat4p_Multiply(¤tMtx, &mtx2, ¤tMtx); + MtxFx43_CopyToMtxFx44(mtx1, &mtx2); + MtxFx44_Multiply(¤tMtx, &mtx2, ¤tMtx); } - translationVec->x = currentMtx.wColumn.x; - translationVec->y = currentMtx.wColumn.y; - translationVec->z = currentMtx.wColumn.z; + translationVec->x = currentMtx._30; + translationVec->y = currentMtx._31; + translationVec->z = currentMtx._32; - scaleVec->x = VecFx32_Length((VecFx32 *) ¤tMtx.xColumn); - scaleVec->y = VecFx32_Length((VecFx32 *) ¤tMtx.yColumn); - scaleVec->z = VecFx32_Length((VecFx32 *) ¤tMtx.zColumn); + scaleVec->x = VecFx32_Length((VecFx32 *) ¤tMtx._00); + scaleVec->y = VecFx32_Length((VecFx32 *) ¤tMtx._10); + scaleVec->z = VecFx32_Length((VecFx32 *) ¤tMtx._20); - if (currentMtx.yColumn.y != 0 || currentMtx.yColumn.z != 0) { - VecFx32_Normalize((VecFx32 *) ¤tMtx.yColumn, (VecFx32 *) &mtx->yColumn); + if (currentMtx._11 != 0 || currentMtx._12 != 0) { + VecFx32_Normalize((VecFx32 *) ¤tMtx._10, (VecFx32 *) &mtx->_10); - mtx->zColumn.y = -mtx->yColumn.z; - mtx->zColumn.z = mtx->yColumn.y; + mtx->_21 = -mtx->_12; + mtx->_22 = mtx->_11; } else { - VecFx32_Normalize((VecFx32 *) ¤tMtx.zColumn, (VecFx32 *) &mtx->zColumn); + VecFx32_Normalize((VecFx32 *) ¤tMtx._20, (VecFx32 *) &mtx->_20); - mtx->yColumn.z = -mtx->zColumn.y; - mtx->yColumn.y = mtx->zColumn.z; + mtx->_12 = -mtx->_21; + mtx->_11 = mtx->_22; } if (data_027e0208.flags & 1) { @@ -477,11 +477,11 @@ void G3d_SBCRender_SKN(G3d_RenderState *renderState, u32) { u8 *termPtr = renderState->currentCmd + 3; u32 i; struct { - Mat4x3p mtx1; - Mat3p mtx2; + MtxFx43 mtx1; + MtxFx33 mtx2; } mtxStruct; - Mat4p *mat4x; - Mat3p *mat3x; + MtxFx44 *mat4x; + MtxFx33 *mat3x; MI_CpuClearFast(&mtxStruct, sizeof(mtxStruct)); FlushGfxQueue(); @@ -505,17 +505,17 @@ void G3d_SBCRender_SKN(G3d_RenderState *renderState, u32) { } if (i != 0) { - mtxStruct.mtx2.xColumn.x += (weight * mat3x->xColumn.x) >> 0xC; - mtxStruct.mtx2.xColumn.y += (weight * mat3x->xColumn.y) >> 0xC; - mtxStruct.mtx2.xColumn.z += (weight * mat3x->xColumn.z) >> 0xC; + mtxStruct.mtx2._00 += (weight * mat3x->_00) >> 0xC; + mtxStruct.mtx2._01 += (weight * mat3x->_01) >> 0xC; + mtxStruct.mtx2._02 += (weight * mat3x->_02) >> 0xC; - mtxStruct.mtx2.yColumn.x += (weight * mat3x->yColumn.x) >> 0xC; - mtxStruct.mtx2.yColumn.y += (weight * mat3x->yColumn.y) >> 0xC; - mtxStruct.mtx2.yColumn.z += (weight * mat3x->yColumn.z) >> 0xC; + mtxStruct.mtx2._10 += (weight * mat3x->_10) >> 0xC; + mtxStruct.mtx2._11 += (weight * mat3x->_11) >> 0xC; + mtxStruct.mtx2._12 += (weight * mat3x->_12) >> 0xC; - mtxStruct.mtx2.zColumn.x += (weight * mat3x->zColumn.x) >> 0xC; - mtxStruct.mtx2.zColumn.y += (weight * mat3x->zColumn.y) >> 0xC; - mtxStruct.mtx2.zColumn.z += (weight * mat3x->zColumn.z) >> 0xC; + mtxStruct.mtx2._20 += (weight * mat3x->_20) >> 0xC; + mtxStruct.mtx2._21 += (weight * mat3x->_21) >> 0xC; + mtxStruct.mtx2._22 += (weight * mat3x->_22) >> 0xC; } if (!unk) { @@ -527,21 +527,21 @@ void G3d_SBCRender_SKN(G3d_RenderState *renderState, u32) { weight = *(termPtr + 2) << 4; - mtxStruct.mtx1.xColumn.x += (weight * mat4x->xColumn.x) >> 0xC; - mtxStruct.mtx1.xColumn.y += (weight * mat4x->xColumn.y) >> 0xC; - mtxStruct.mtx1.xColumn.z += (weight * mat4x->xColumn.z) >> 0xC; + mtxStruct.mtx1._00 += (weight * mat4x->_00) >> 0xC; + mtxStruct.mtx1._01 += (weight * mat4x->_01) >> 0xC; + mtxStruct.mtx1._02 += (weight * mat4x->_02) >> 0xC; - mtxStruct.mtx1.yColumn.x += (weight * mat4x->yColumn.x) >> 0xC; - mtxStruct.mtx1.yColumn.y += (weight * mat4x->yColumn.y) >> 0xC; - mtxStruct.mtx1.yColumn.z += (weight * mat4x->yColumn.z) >> 0xC; + mtxStruct.mtx1._10 += (weight * mat4x->_10) >> 0xC; + mtxStruct.mtx1._11 += (weight * mat4x->_11) >> 0xC; + mtxStruct.mtx1._12 += (weight * mat4x->_12) >> 0xC; - mtxStruct.mtx1.zColumn.x += (weight * mat4x->zColumn.x) >> 0xC; - mtxStruct.mtx1.zColumn.y += (weight * mat4x->zColumn.y) >> 0xC; - mtxStruct.mtx1.zColumn.z += (weight * mat4x->zColumn.z) >> 0xC; + mtxStruct.mtx1._20 += (weight * mat4x->_20) >> 0xC; + mtxStruct.mtx1._21 += (weight * mat4x->_21) >> 0xC; + mtxStruct.mtx1._22 += (weight * mat4x->_22) >> 0xC; - mtxStruct.mtx1.wColumn.x += (weight * mat4x->wColumn.x) >> 0xC; - mtxStruct.mtx1.wColumn.y += (weight * mat4x->wColumn.y) >> 0xC; - mtxStruct.mtx1.wColumn.z += (weight * mat4x->wColumn.z) >> 0xC; + mtxStruct.mtx1._30 += (weight * mat4x->_30) >> 0xC; + mtxStruct.mtx1._31 += (weight * mat4x->_31) >> 0xC; + mtxStruct.mtx1._32 += (weight * mat4x->_32) >> 0xC; termPtr += 3; mat3x = &data_02046c80.mUnk_1400[jntIndex].mtx2; @@ -551,19 +551,19 @@ void G3d_SBCRender_SKN(G3d_RenderState *renderState, u32) { ; } } - mtxStruct.mtx2.xColumn.x += (weight * mat3x->xColumn.x) >> 0xC; - mtxStruct.mtx2.xColumn.y += (weight * mat3x->xColumn.y) >> 0xC; - mtxStruct.mtx2.xColumn.z += (weight * mat3x->xColumn.z) >> 0xC; + mtxStruct.mtx2._00 += (weight * mat3x->_00) >> 0xC; + mtxStruct.mtx2._01 += (weight * mat3x->_01) >> 0xC; + mtxStruct.mtx2._02 += (weight * mat3x->_02) >> 0xC; - mtxStruct.mtx2.yColumn.x += (weight * mat3x->yColumn.x) >> 0xC; - mtxStruct.mtx2.yColumn.y += (weight * mat3x->yColumn.y) >> 0xC; - mtxStruct.mtx2.yColumn.z += (weight * mat3x->yColumn.z) >> 0xC; + mtxStruct.mtx2._10 += (weight * mat3x->_10) >> 0xC; + mtxStruct.mtx2._11 += (weight * mat3x->_11) >> 0xC; + mtxStruct.mtx2._12 += (weight * mat3x->_12) >> 0xC; - mtxStruct.mtx2.zColumn.x += (weight * mat3x->zColumn.x) >> 0xC; - mtxStruct.mtx2.zColumn.y += (weight * mat3x->zColumn.y) >> 0xC; - mtxStruct.mtx2.zColumn.z += (weight * mat3x->zColumn.z) >> 0xC; + mtxStruct.mtx2._20 += (weight * mat3x->_20) >> 0xC; + mtxStruct.mtx2._21 += (weight * mat3x->_21) >> 0xC; + mtxStruct.mtx2._22 += (weight * mat3x->_22) >> 0xC; - func_02024a30((const Mat4x3p *) &mtxStruct.mtx2); + func_02024a30((MtxFx43 *) &mtxStruct.mtx2); REG_GFX_FIFO_MATRIX_MODE = 1; // Position func_02024a30(&mtxStruct.mtx1); REG_GFX_FIFO_MATRIX_MODE = 0; // Projection @@ -727,7 +727,7 @@ void G3d_SBCRender_00C(G3d_RenderState *renderState, u32) { p += 8; } - G3d_MtxMult44_inline((const Mat4p *) p); // MTX_MULT_4x4 + G3d_MtxMult44_inline((const MtxFx44 *) p); // MTX_MULT_4x4 } } } @@ -743,18 +743,18 @@ void G3d_SBCRender_00C(G3d_RenderState *renderState, u32) { } if (!callbackSkip) { - Mat3p m; + MtxFx33 m; G3d_SetMtxMode_inline(2); // MTX_MODE = Position + Vector G3d_GetCurrentMtx(0, &m); G3d_SetMtxMode_inline(3); // MTX_MODE = Texture if (data_027e0208.flags & 1) { - G3d_MtxMult33_inline((const Mat3p *) &data_027e0208.mUnk_04C); // MTX_MULT_3x3 - G3d_MtxMult33_inline(&gGeomMatrix); // MTX_MULT_3x3 - G3d_MtxMult33_inline(&m); // MTX_MULT_3x3 + G3d_MtxMult33_inline((const MtxFx33 *) &data_027e0208.mUnk_04C); // MTX_MULT_3x3 + G3d_MtxMult33_inline(&gGeomMatrix); // MTX_MULT_3x3 + G3d_MtxMult33_inline(&m); // MTX_MULT_3x3 } else if (data_027e0208.flags & 2) { - G3d_MtxMult33_inline((const Mat3p *) &data_027e0208.mUnk_04C); // MTX_MULT_3x3 - G3d_MtxMult33_inline(&m); // MTX_MULT_3x3 + G3d_MtxMult33_inline((const MtxFx33 *) &data_027e0208.mUnk_04C); // MTX_MULT_3x3 + G3d_MtxMult33_inline(&m); // MTX_MULT_3x3 } else { G3d_MtxMult33_inline(&m); // MTX_MULT_3x3 } @@ -771,7 +771,7 @@ void G3d_SBCRender_00D(G3d_RenderState *renderState, u32) { u32 callbackSkip; u32 callbackSegment; u32 num; - Mat4x3p m; + MtxFx43 m; G3d_GetCurrentMtx(&m, 0); num = 30; @@ -811,12 +811,12 @@ void G3d_SBCRender_00D(G3d_RenderState *renderState, u32) { h = (s32) renderState->matAnim->height; { - static Mat4p mtx = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10000, 0, 0, 0, 0, 0x10000}; + static MtxFx44 mtx = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10000, 0, 0, 0, 0, 0x10000}; - mtx.xColumn.x = w << 15; - mtx.yColumn.y = -h << 15; - mtx.wColumn.x = w << 15; - mtx.wColumn.y = h << 15; + mtx._00 = w << 15; + mtx._10 = -h << 15; + mtx._30 = w << 15; + mtx._31 = h << 15; PushGeometryCommand(0x16, &mtx, 0x10); } @@ -844,7 +844,7 @@ void G3d_SBCRender_00D(G3d_RenderState *renderState, u32) { const G3d_Material *mat = (G3d_Material *) ((u8 *) renderState->materialList + *materialOffset); if (mat->flag & 0x2000) { - const Mat4p *effect_mtx; + const MtxFx44 *effect_mtx; const u8 *p = (const u8 *) mat + sizeof(G3d_Material); if (!(mat->flag & 2)) { @@ -859,7 +859,7 @@ void G3d_SBCRender_00D(G3d_RenderState *renderState, u32) { p += 8; } - G3d_MtxMult44_inline((const Mat4p *) p); // MTX_MULT_4x4 + G3d_MtxMult44_inline((const MtxFx44 *) p); // MTX_MULT_4x4 } } @@ -872,7 +872,7 @@ void G3d_SBCRender_00D(G3d_RenderState *renderState, u32) { } if (!callbackSkip) { - Mat4p mtx; + MtxFx44 mtx; u32 tmp; if (data_027e0208.flags & 1) { @@ -902,7 +902,7 @@ void G3d_SBCRender_00D(G3d_RenderState *renderState, u32) { } PushGeometryCommand(0x16, &mtx, 0x10); - tmp = GX_PACK_TEXCOORD_PARAM((fx32) (mtx.wColumn.x >> 4), (fx32) (mtx.wColumn.y >> 4)); + tmp = GX_PACK_TEXCOORD_PARAM((fx32) (mtx._30 >> 4), (fx32) (mtx._31 >> 4)); PushGeometryCommand(0x22, (u32 *) &tmp, 1); // TEXCOORD } diff --git a/src/000_Second/Actor/ActorUnkSWOB.cpp b/src/000_Second/Actor/ActorUnkSWOB.cpp index e69b26fb..2604723f 100644 --- a/src/000_Second/Actor/ActorUnkSWOB.cpp +++ b/src/000_Second/Actor/ActorUnkSWOB.cpp @@ -91,7 +91,7 @@ void ActorUnkSWOB::func_ov000_0209aa30(void) { data_ov000_020b5214.func_ov000_0206db44(0xA3); temp = *data_027e0ce0->func_01fff148(0); vec2.x = temp.x; - vec2.y = temp.y + FLOAT_TO_FX32(3.0f); + vec2.y = temp.y + FX_F32_TO_FX32(3.0f); vec2.z = temp.z; AStack_7c.mUnk_28 = 0; diff --git a/src/000_Second/Actor/Actor_Derived1.cpp b/src/000_Second/Actor/Actor_Derived1.cpp index 0cac10e5..e1893184 100644 --- a/src/000_Second/Actor/Actor_Derived1.cpp +++ b/src/000_Second/Actor/Actor_Derived1.cpp @@ -86,9 +86,9 @@ void Actor_Derived1::func_ov000_020a8df0(ActorRef param1, unk32 param2) { if (this->mRef != param1) { this->vfunc_B4(); *(u32 *) &this->mUnk_0BC = param1.Get32(); - this->mUnk_0C0.x = 0; - this->mUnk_0C0.y = 0; - this->mUnk_0C0.z = 0; + this->mUnk_0C0.vec.x = 0; + this->mUnk_0C0.vec.y = 0; + this->mUnk_0C0.vec.z = 0; this->mUnk_0B0 |= 1; } } @@ -103,9 +103,9 @@ void Actor_Derived1::func_ov000_020a8e9c(VecFx32 *param1) { fx32 y = param1->y; fx32 x = param1->z; - this->mUnk_0C0.x = x; - this->mUnk_0C0.y = y; - this->mUnk_0C0.z = x; + this->mUnk_0C0.vec.x = x; + this->mUnk_0C0.vec.y = y; + this->mUnk_0C0.vec.z = x; this->mUnk_0BC.Reset(); } diff --git a/src/000_Second/MapObject/MapObject.cpp b/src/000_Second/MapObject/MapObject.cpp index e47428e5..69158f52 100644 --- a/src/000_Second/MapObject/MapObject.cpp +++ b/src/000_Second/MapObject/MapObject.cpp @@ -176,7 +176,7 @@ unk32 MapObject::func_ov000_0209d3b4(unk32 param1, fx32 size) { if (this->mUnk_10 != NULL) { this->mUnk_10->vfunc_10(&spC); } else { - spC.Init(FLOAT_TO_FX32(0.5f)); + spC.Init(FX_F32_TO_FX32(0.5f)); } VecFx32_Add(&spC.pos, &this->mPos, &spC.pos); diff --git a/src/000_Second/MapObject/MapObjectMiniBlocks.cpp b/src/000_Second/MapObject/MapObjectMiniBlocks.cpp index e3f14768..43a9ecdd 100644 --- a/src/000_Second/MapObject/MapObjectMiniBlocks.cpp +++ b/src/000_Second/MapObject/MapObjectMiniBlocks.cpp @@ -45,9 +45,9 @@ bool MapObjectMiniBlocks::Init(void) { } VecFx32 vec; - vec.x = FLOAT_TO_FX32(0.0f); - vec.y = FLOAT_TO_FX32(0.0f); - vec.z = FLOAT_TO_FX32(0.0f); + vec.x = FX_F32_TO_FX32(0.0f); + vec.y = FX_F32_TO_FX32(0.0f); + vec.z = FX_F32_TO_FX32(0.0f); uVar6 = 0; switch (this->mUnk_20.mParams[0]) { @@ -65,13 +65,13 @@ bool MapObjectMiniBlocks::Init(void) { break; default: if (this->mUnk_20.mParams[1] == MiniBlocksVariant_BLKF) { - vec.x = FLOAT_TO_FX32(0.0f); - vec.y = FLOAT_TO_FX32(0.0f); - vec.z = -FLOAT_TO_FX32(0.375f); + vec.x = FX_F32_TO_FX32(0.0f); + vec.y = FX_F32_TO_FX32(0.0f); + vec.z = -FX_F32_TO_FX32(0.375f); } else { - vec.x = FLOAT_TO_FX32(0.0f); - vec.y = FLOAT_TO_FX32(0.0f); - vec.z = -FLOAT_TO_FX32(0.25f); + vec.x = FX_F32_TO_FX32(0.0f); + vec.y = FX_F32_TO_FX32(0.0f); + vec.z = -FX_F32_TO_FX32(0.25f); } break; } @@ -108,9 +108,9 @@ bool MapObjectMiniBlocks::Init(void) { } void MapObjectMiniBlocks::vfunc_14(unk32 param1) { - Mat3p m; + MtxFx33 m; u16 unk_14 = this->mAngle.angle_s; - Mat3p_InitYRotation(&m, SIN(unk_14), COS(unk_14)); + MtxFx33_InitYRotation(&m, SIN(unk_14), COS(unk_14)); this->mUnk_40.vfunc_14(&m, &this->mPos); } diff --git a/src/000_Second/MapObject/MapObjectSwitchStep.cpp b/src/000_Second/MapObject/MapObjectSwitchStep.cpp index 169ba701..d4093acc 100644 --- a/src/000_Second/MapObject/MapObjectSwitchStep.cpp +++ b/src/000_Second/MapObject/MapObjectSwitchStep.cpp @@ -24,13 +24,13 @@ MapObjectProfileSwitchStep::MapObjectProfileSwitchStep() : MapObjectProfileSwitchStep_Base(MapObjectId_SwitchStep) { this->mUnk_D4.mUnk_08 = 0x2DC04009; - this->mUnk_D4.mUnk_0C.x = -FLOAT_TO_FX32(0.5f); - this->mUnk_D4.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_D4.mUnk_0C.z = -FLOAT_TO_FX32(0.5f); + this->mUnk_D4.mUnk_0C.x = -FX_F32_TO_FX32(0.5f); + this->mUnk_D4.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_D4.mUnk_0C.z = -FX_F32_TO_FX32(0.5f); - this->mUnk_D4.mUnk_18.x = FLOAT_TO_FX32(0.5f); - this->mUnk_D4.mUnk_18.y = FLOAT_TO_FX32(0.5f); - this->mUnk_D4.mUnk_18.z = FLOAT_TO_FX32(0.5f); + this->mUnk_D4.mUnk_18.x = FX_F32_TO_FX32(0.5f); + this->mUnk_D4.mUnk_18.y = FX_F32_TO_FX32(0.5f); + this->mUnk_D4.mUnk_18.z = FX_F32_TO_FX32(0.5f); this->mUnk_06 = 1; this->mUnk_0C = 0xC00; diff --git a/src/001_SceneInit/Player/PlayerActorBase_001.cpp b/src/001_SceneInit/Player/PlayerActorBase_001.cpp index 1efb3afc..b12b4fb9 100644 --- a/src/001_SceneInit/Player/PlayerActorBase_001.cpp +++ b/src/001_SceneInit/Player/PlayerActorBase_001.cpp @@ -1,5 +1,3 @@ -#define VECFX32_CTORS //! TODO: remove this hack - #include "Player/PlayerActorBase.hpp" #include "System/SysNew.hpp" #include "Unknown/UnkStruct_027e09a4.hpp" diff --git a/src/001_SceneInit/Player/PlayerActorBase_70_001.cpp b/src/001_SceneInit/Player/PlayerActorBase_70_001.cpp index 059baeff..3147871c 100644 --- a/src/001_SceneInit/Player/PlayerActorBase_70_001.cpp +++ b/src/001_SceneInit/Player/PlayerActorBase_70_001.cpp @@ -33,8 +33,8 @@ PlayerActorBase_70::PlayerActorBase_70(PlayerCharacter character, unk32 param2) mUnk_0DC(this->mIsNotLink == true ? new(HeapIndex_1) PlayerActorBase_70_DC(character, this->mUnk_00C.GetUnk08()->mpModel) : NULL), mUnk_0E0(this->mUnk_00C.GetUnk08(), character), - mUnk_114(param2 == -1 && character == PlayerCharacter_Link ? new(HeapIndex_1) Mat4x3p[PlayerCharacter_Max] : NULL), - mUnk_118(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f)), + mUnk_114(param2 == -1 && character == PlayerCharacter_Link ? new(HeapIndex_1) MtxFx43[PlayerCharacter_Max] : NULL), + mUnk_118(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f)), mUnk_124(false), mUnk_126(0), mUnk_127(false), @@ -49,7 +49,7 @@ PlayerActorBase_70::PlayerActorBase_70(PlayerCharacter character, unk32 param2) mUnk_15C(0x20000) { if (this->mUnk_114 != NULL) { for (u32 i = 0; i < PlayerCharacter_Max; i++) { - Mat4x3p_InitIdentity(&this->mUnk_114[i]); + MtxFx43_InitIdentity(&this->mUnk_114[i]); } } } diff --git a/src/001_SceneInit/SceneInitializers_001.cpp b/src/001_SceneInit/SceneInitializers_001.cpp index ec116eee..e84389c9 100644 --- a/src/001_SceneInit/SceneInitializers_001.cpp +++ b/src/001_SceneInit/SceneInitializers_001.cpp @@ -85,9 +85,9 @@ UnkStruct_027e09a4::UnkStruct_027e09a4(SceneMode mode) : this->mUnk_2C.mSceneIndex = SceneIndex_t_area0; this->mUnk_2C.mUnk_02 = 0x00; - this->mUnk_2C.mUnk_04.x = FLOAT_TO_FX32(0.0f); - this->mUnk_2C.mUnk_04.y = FLOAT_TO_FX32(0.0f); - this->mUnk_2C.mUnk_04.z = FLOAT_TO_FX32(0.0f); + this->mUnk_2C.mUnk_04.x = FX_F32_TO_FX32(0.0f); + this->mUnk_2C.mUnk_04.y = FX_F32_TO_FX32(0.0f); + this->mUnk_2C.mUnk_04.z = FX_F32_TO_FX32(0.0f); this->mUnk_2C.mUnk_10 = 0x00; this->mUnk_40 = this->mUnk_2C; this->mpWarpUnk1 = new(HeapIndex_1) UnkStruct_WarpUnk1(); diff --git a/src/001_SceneInit/UnkStruct_027e09b8_001.cpp b/src/001_SceneInit/UnkStruct_027e09b8_001.cpp index b2f06ce2..3714692b 100644 --- a/src/001_SceneInit/UnkStruct_027e09b8_001.cpp +++ b/src/001_SceneInit/UnkStruct_027e09b8_001.cpp @@ -6,9 +6,9 @@ #include struct UnkStruct_ov000_02073080 { - /* 00 */ STRUCT_PAD(0x00, 0x08); + /* 00 */ PAD(0x00, 0x08); /* 08 */ CutsceneIndex csIndex; - /* 0C */ STRUCT_PAD(0x0C, 0x1C); + /* 0C */ PAD(0x0C, 0x1C); /* 1C */ }; extern "C" void func_ov000_02073080(void *); diff --git a/src/001_SceneInit/UnkStruct_027e0cd8_0C_001.cpp b/src/001_SceneInit/UnkStruct_027e0cd8_0C_001.cpp index dd483eb4..c839a286 100644 --- a/src/001_SceneInit/UnkStruct_027e0cd8_0C_001.cpp +++ b/src/001_SceneInit/UnkStruct_027e0cd8_0C_001.cpp @@ -357,19 +357,19 @@ void UnkStruct_027e0cd8_0C_Base::vfunc_40(u8 spawnIndex) { switch (spawnIndex) { case 0xFB: - pos.z = data_027e0c90.max.z - FLOAT_TO_FX32(0.5f); + pos.z = data_027e0c90.max.z - FX_F32_TO_FX32(0.5f); angle = DEG_TO_ANG(180); break; case 0xFC: - pos.z = data_027e0c90.min.z + FLOAT_TO_FX32(0.5f); + pos.z = data_027e0c90.min.z + FX_F32_TO_FX32(0.5f); angle = DEG_TO_ANG(0); break; case 0xFD: - pos.x = data_027e0c90.max.x - FLOAT_TO_FX32(0.5f); + pos.x = data_027e0c90.max.x - FX_F32_TO_FX32(0.5f); angle = DEG_TO_ANG(270); break; case 0xFE: - pos.x = data_027e0c90.min.x + FLOAT_TO_FX32(0.5f); + pos.x = data_027e0c90.min.x + FX_F32_TO_FX32(0.5f); angle = DEG_TO_ANG(90); break; default: diff --git a/src/001_SceneInit/ZeldaMapBinary.cpp b/src/001_SceneInit/ZeldaMapBinary.cpp index 10f63cc4..6b0a66ea 100644 --- a/src/001_SceneInit/ZeldaMapBinary.cpp +++ b/src/001_SceneInit/ZeldaMapBinary.cpp @@ -300,10 +300,10 @@ BOOL ZMB_ParseActorList(ZMBFileInfos *pFileInfos, ZMBSectionActorList *pSection, if (!iVar6 || pProfile->mUnk_15) { VecFx32 local_24; local_24.x = func_ov000_02080068(posX); - local_24.x += MUL_FX32(INT_TO_FX32(xMod16), 256); + local_24.x += FX_MUL(INT_TO_FX32(xMod16), 256); local_24.z = func_ov000_02080080(posY); - local_24.z += MUL_FX32(INT_TO_FX32(yMod16), 256); + local_24.z += FX_MUL(INT_TO_FX32(yMod16), 256); local_24.y = 0x7FFFEFFF; local_24.y = pDst->vfunc_28(&local_24, 0x01, 0x00); @@ -472,7 +472,7 @@ BOOL ZMB_ParseROOM(ZMBFileInfos *pFileInfos, ZMBSectionROOM *pSection, UnkStruct if (pEntry->unk_10 & 0x008) { SET_FLAG2(pDst->mUnk_128, UnkFlags2_8); - var_r7 += FLOAT_TO_FX32(1.2f); + var_r7 += FX_F32_TO_FX32(1.2f); } else { UNSET_FLAG2(pDst->mUnk_128, UnkFlags2_8); } @@ -569,10 +569,10 @@ BOOL ZMB_ParsePLYR(ZMBFileInfos *pFileInfos, ZMBSectionPLYR *pSection, UnkStruct s32 zMod16 = unk_08 % 16; fx32 z = func_ov000_02080080(tile_z); - z += MUL_FX32(INT_TO_FX32(zMod16), 256); + z += FX_MUL(INT_TO_FX32(zMod16), 256); fx32 x = func_ov000_02080068(tile_x); - x += MUL_FX32(INT_TO_FX32(xMod16), 256); + x += FX_MUL(INT_TO_FX32(xMod16), 256); VecFx32 local_20; local_20.x = x; diff --git a/src/017_CourseExec/Actor/Actor_017.cpp b/src/017_CourseExec/Actor/Actor_017.cpp index 9d7f5099..f006e376 100644 --- a/src/017_CourseExec/Actor/Actor_017.cpp +++ b/src/017_CourseExec/Actor/Actor_017.cpp @@ -104,8 +104,8 @@ void Actor::func_ov017_020bf050(Actor_9C *param1, unk32 param2) { fx16 sin = SIN((u16) (s16) temp_r2); fx16 cos = COS((u16) (s16) temp_r2); - sp0.pos.x += MUL_FX32(sin, size); - sp0.pos.z += MUL_FX32(cos, size); + sp0.pos.x += FX_MUL(sin, size); + sp0.pos.z += FX_MUL(cos, size); func_ov000_0209807c(&sp0); @@ -142,8 +142,8 @@ void Actor::func_ov017_020bf178(Actor_9C *param1, unk32 param2) { fx16 sin = SIN((u16) (s16) temp_r2); fx16 cos = COS((u16) (s16) temp_r2); - sp0.pos.x += MUL_FX32(sin, size); - sp0.pos.z += MUL_FX32(cos, size); + sp0.pos.x += FX_MUL(sin, size); + sp0.pos.z += FX_MUL(cos, size); func_ov000_020980e0(&this->mPos); @@ -164,7 +164,7 @@ void Actor::func_ov017_020bf284(VecFx32 *param1, VecFx32 param2) { sp0 = param2; VecFx32_Add(&sp0, param1, &sp0); - func_01ff93c0(&sp0, FLOAT_TO_FX32(0.5f)); + func_01ff93c0(&sp0, FX_F32_TO_FX32(0.5f)); func_ov000_02098244(&sp0); } @@ -516,8 +516,8 @@ void Actor::func_ov017_020bfb18(Actor_9C *param1) { fx16 sin = SIN((u16) (s16) temp_r2); fx16 cos = COS((u16) (s16) temp_r2); - sp14.pos.x += MUL_FX32(sin, size); - sp14.pos.z += MUL_FX32(cos, size); + sp14.pos.x += FX_MUL(sin, size); + sp14.pos.z += FX_MUL(cos, size); Vec3s sp0; sp0.x = sp8.x; diff --git a/src/017_CourseExec/Actor/code_020c201c_017.cpp b/src/017_CourseExec/Actor/code_020c201c_017.cpp index eef28eba..6ab4c4ef 100644 --- a/src/017_CourseExec/Actor/code_020c201c_017.cpp +++ b/src/017_CourseExec/Actor/code_020c201c_017.cpp @@ -234,7 +234,7 @@ void Actor::func_ov017_020c26f8(unk32 param1, const VecFx32 *param2, unk32 param sp8.y = temp_r5->vfunc_28(&sp8, 0x00, 0x00); } - sp8.y = -FLOAT_TO_FX32(0.5f); + sp8.y = -FX_F32_TO_FX32(0.5f); switch (param1) { case 0: @@ -266,7 +266,7 @@ void Actor::func_ov017_020c28b4(VecFx32 *param1, UnkAngleStruct param2, unk32 pa VecFx16 sp4; sp4.x = SIN((u16) (s16) -param2.angle_s); - sp4.y = FLOAT_TO_FX32(0.0f); + sp4.y = FX_F32_TO_FX32(0.0f); sp4.z = COS((u16) (s16) -param2.angle_s); data_027e0cec->func_ov000_0209ff24(0x8F7, param1, &sp4, param3); diff --git a/src/017_CourseExec/MapObject/MapObjectSwitchStep_017.cpp b/src/017_CourseExec/MapObject/MapObjectSwitchStep_017.cpp index 28651de5..757aa626 100644 --- a/src/017_CourseExec/MapObject/MapObjectSwitchStep_017.cpp +++ b/src/017_CourseExec/MapObject/MapObjectSwitchStep_017.cpp @@ -13,7 +13,7 @@ void MapObjectSwitchStep::vfunc_08() { break; case 1: if (this->mUnk_E8 > 0) { - func_01ff91b8(&sp0, -FLOAT_TO_FX32(0.1f), func_01ffb464(INT_TO_FX32(this->mUnk_E8))); + func_01ff91b8(&sp0, -FX_F32_TO_FX32(0.1f), func_01ffb464(INT_TO_FX32(this->mUnk_E8))); } if (this->mUnk_E8 <= 0) { diff --git a/src/017_CourseExec/Player/PlayerActorBase_70_017.cpp b/src/017_CourseExec/Player/PlayerActorBase_70_017.cpp index 50cc8b3d..c220b27c 100644 --- a/src/017_CourseExec/Player/PlayerActorBase_70_017.cpp +++ b/src/017_CourseExec/Player/PlayerActorBase_70_017.cpp @@ -19,13 +19,13 @@ void PlayerActorBase_70::func_ov017_020bbaa8(VecFx32 *param1, UnkAngleStruct par if (this->mUnk_114 != NULL) { VecFx32 sp4; - func_01ffb714(&this->mUnk_114[PlayerCharacter_Link].wColumn, param1, &sp4); + func_01ffb714((VecFx32 *) &this->mUnk_114[PlayerCharacter_Link]._30, param1, &sp4); VecFx32_Copy(&sp4, &this->mUnk_0E4.mUnk_0C[PlayerCharacter_Link]); - func_01ffb714(&this->mUnk_114[PlayerCharacter_Phantom].wColumn, param1, &sp4); + func_01ffb714((VecFx32 *) &this->mUnk_114[PlayerCharacter_Phantom]._30, param1, &sp4); VecFx32_Copy(&sp4, &this->mUnk_0E4.mUnk_0C[PlayerCharacter_Phantom]); - func_01ffb714(&this->mUnk_114[PlayerCharacter_Zelda].wColumn, param1, &sp4); + func_01ffb714((VecFx32 *) &this->mUnk_114[PlayerCharacter_Zelda]._30, param1, &sp4); VecFx32_Copy(&sp4, &this->mUnk_0E4.mUnk_0C[PlayerCharacter_Zelda]); if (this->mUnk_126 != 0) { @@ -56,7 +56,7 @@ extern unk16 data_ov000_020ab318; extern unk16 data_ov000_020ab31c; struct UnkStruct_ov021_02106c5c { - /* 00 */ STRUCT_PAD(0x00, 0x13); + /* 00 */ PAD(0x00, 0x13); /* 13 */ u8 unk_13; }; extern "C" const UnkStruct_ov021_02106c5c *func_ov021_020ea868(int index); diff --git a/src/017_CourseExec/Player/PlayerLinkActor_017.cpp b/src/017_CourseExec/Player/PlayerLinkActor_017.cpp index 73c76a04..929342b5 100644 --- a/src/017_CourseExec/Player/PlayerLinkActor_017.cpp +++ b/src/017_CourseExec/Player/PlayerLinkActor_017.cpp @@ -32,7 +32,7 @@ unk32 PlayerLinkActor::func_ov017_020bd6e0(bool param1) { return 1; } - if (data_027e0cd8->mUnk_0C->func_ov000_0208217c(&this->mPos, 1)) { + if (data_027e0cd8->mUnk_0C->func_ov000_0208217c(&this->mPos.vec, 1)) { return 2; } @@ -53,7 +53,7 @@ void PlayerLinkActor::func_ov017_020bd758() { void PlayerLinkActor::func_ov017_020bd788(bool param1) { STACK_PAD(0x10); - VecFx32_Copy(&this->mPos, &this->mPrevPos); + VecFx32_Copy(&this->mPos.vec, &this->mPrevPos.vec); if (this->func_ov000_0208d754() != 0) { this->mUnk_138.func_ov000_020609c4(); @@ -91,7 +91,7 @@ void PlayerLinkActor::func_ov017_020bd788(bool param1) { #endif if (cond || this->mUnk_0A0->func_ov000_02091f08(0x0B) || this->mUnk_0A0->func_ov000_02091f08(0x0F)) { - VecFx32_Reset(&this->mVel); + VecFx32_Reset(&this->mVel.vec); } else { if (this->mUnk_09C->mUnk_090 >= 0 && !this->mUnk_0A0->func_ov000_020936c4()) { var_r4 = 3; @@ -115,8 +115,8 @@ void PlayerLinkActor::func_ov017_020bd788(bool param1) { var_r4 = 0; if (this->mUnk_0A0->mUnk_68 != 0x70) { - this->mVel.x = 0; - this->mVel.z = 0; + this->mVel.vec.x = 0; + this->mVel.vec.z = 0; } this->func_ov000_0208cbf0(); @@ -126,7 +126,7 @@ void PlayerLinkActor::func_ov017_020bd788(bool param1) { } this->mUnk_09C->mUnk_098 = 0x1000; - VecFx32_Reset(&this->mAccel); + VecFx32_Reset(&this->mAccel.vec); this->mUnk_0A0->func_ov000_02092648(1); if (this->mUnk_58->Unk78HasValue()) { @@ -140,7 +140,7 @@ void PlayerLinkActor::func_ov017_020bd788(bool param1) { if (var_r4 != -1) { if (!this->mUnk_09C->func_ov017_020bc640(var_r4, true, this->mUnk_0A0->func_ov000_0209360c(), this->mUnk_0A0->func_ov000_02093650(), this->func_ov017_020bd6b8(), - &this->mAccel, &this->mPos, &this->mVel)) { + &this->mAccel.vec, &this->mPos.vec, &this->mVel.vec)) { if (var_r4 != 1 && this->mUnk_0A0->mUnk_68 != 0x16) { this->mUnk_0A0->func_ov000_020921e4(0x16); } @@ -178,7 +178,7 @@ void PlayerLinkActor::func_ov017_020bd788(bool param1) { this->func_ov000_0208cbf0(); this->mUnk_09C->mUnk_098 = 0x1000; - VecFx32_Reset(&this->mAccel); + VecFx32_Reset(&this->mAccel.vec); this->mUnk_0A0->func_ov000_02092648(0); if (this->mUnk_58->Unk78HasValue()) { @@ -196,8 +196,8 @@ void PlayerLinkActor::func_ov017_020bd788(bool param1) { } if (!this->mUnk_09C->func_ov017_020bc640(var_r5_2, param1, this->mUnk_0A0->func_ov000_0209360c(), - this->mUnk_0A0->func_ov000_02093650(), this->func_ov017_020bd6b8(), &this->mAccel, - &this->mPos, &this->mVel)) { + this->mUnk_0A0->func_ov000_02093650(), this->func_ov017_020bd6b8(), + &this->mAccel.vec, &this->mPos.vec, &this->mVel.vec)) { if (var_r5_2 != 1 && this->mUnk_0A0->mUnk_68 != 0x16) { this->mUnk_0A0->func_ov000_020921e4(0x16); } @@ -247,7 +247,7 @@ void PlayerLinkActor::func_ov017_020bdd84(void *param1, unk32 param2) { s8 sp8; bool var_r2; bool temp_r1_2; - Mat4x3p *temp_r4; + MtxFx43 *temp_r4; bool var_r5; //! TODO: figure out param1's type (most likely data_0204a110.mUnk_DF8) @@ -260,10 +260,10 @@ void PlayerLinkActor::func_ov017_020bdd84(void *param1, unk32 param2) { if (var_r5) { if (param2 != 0) { if (this->mUnk_74 != 0) { - this->mUnk_70->func_ov017_020bbef4(&this->mPos, this->mAngle); + this->mUnk_70->func_ov017_020bbef4(&this->mPos.vec, this->mAngle); } } else { - this->mUnk_70->func_ov017_020bbcd8(&this->mPos, this->mAngle); + this->mUnk_70->func_ov017_020bbcd8(&this->mPos.vec, this->mAngle); } if (param1 == NULL && data_0204a110.func_02019514() == 0) { @@ -314,7 +314,7 @@ void PlayerLinkActor::func_ov017_020bdf48(s8 *param1, unk32 param2, void *param3 if (!this->mUnk_0A0->func_ov000_02091f08(0x0D) && param1[1] == 1) { sp4 = this->mUnk_50; - if (!data_027e0998->vfunc_00(&this->mPos, &sp8, &sp4.mUnk_00)) { + if (!data_027e0998->vfunc_00(&this->mPos.vec, &sp8, &sp4.mUnk_00)) { return; } diff --git a/src/017_CourseExec/UnkStackStruct_ov017_020c1104_017.cpp b/src/017_CourseExec/UnkStackStruct_ov017_020c1104_017.cpp index c6249ff6..31764737 100644 --- a/src/017_CourseExec/UnkStackStruct_ov017_020c1104_017.cpp +++ b/src/017_CourseExec/UnkStackStruct_ov017_020c1104_017.cpp @@ -55,7 +55,7 @@ void UnkStackStruct_ov017_020c1104::func_ov017_020c117c(const VecFx32 *param2, u s16 temp_r0_4 = 0x10000 >> *new_var; s32 value2 = var_r7 + (temp_r5 >> 16); - fx32 temp_r2_3 = MUL_FX32(temp_r0_3, COS((u16) (s16) (temp_r0 - ((s16) (value2 * temp_r0_4 + temp_r0_4 / 2))))); + fx32 temp_r2_3 = FX_MUL(temp_r0_3, COS((u16) (s16) (temp_r0 - ((s16) (value2 * temp_r0_4 + temp_r0_4 / 2))))); s16 temp_r0_5 = func_01ffb428(param3 + temp_r2_3, this->unk_0C); u32 temp_r2_4 = ~(0xFF << *(volatile u16 *) &this->unk_10) & ((u16) (1 << *new_var) + (temp_r5 >> 16) + var_r7); diff --git a/src/017_CourseExec/UnkStruct_027e09b4_017.cpp b/src/017_CourseExec/UnkStruct_027e09b4_017.cpp index a601e4af..6f3e9ef4 100644 --- a/src/017_CourseExec/UnkStruct_027e09b4_017.cpp +++ b/src/017_CourseExec/UnkStruct_027e09b4_017.cpp @@ -13,10 +13,10 @@ extern "C" void FlushGfxQueue(); extern "C" void func_ov000_0205dbe4(u16); -extern "C" void func_02024a84(Mat3p *param1); +extern "C" void func_02024a84(MtxFx33 *param1); extern "C" u16 func_01ffbbe0(fx32 x, fx32 z); extern "C" unk32 func_01ff9258(fx32, fx32); -extern "C" void func_01ffcb94(s16, s16, Mat3p *); +extern "C" void func_01ffcb94(s16, s16, MtxFx33 *); extern "C" fx32 func_01ffb66c(unk32, unk32); extern "C" void func_02024fc4(fx16 sin, fx16 cos); @@ -98,7 +98,7 @@ void UnkStruct_027e09b4::func_ov017_020c0a6c(const VecFx32 *param1, s32 param2, } void UnkStruct_027e09b4::func_ov017_020c0b24(const VecFx32 *param1, s32 param2, s32 param3) { - Mat3p sp0; + MtxFx33 sp0; u16 temp_r7 = data_027e09ac->mUnk_014.mUnk_06; unk16 *temp_r0 = data_027e09b0->func_ov000_02072cb4(1); unk32 temp_r8; @@ -136,7 +136,7 @@ void UnkStruct_027e09b4::func_ov017_020c0c50(u16 param1) { s16 temp_ip; s32 var_r1; s16 var_r2; - slong var_lr; + long var_lr; s16 var_r5; s16 var_r6; s32 temp_r7; diff --git a/src/017_CourseExec/UnkStruct_027e0ce0_30_017.cpp b/src/017_CourseExec/UnkStruct_027e0ce0_30_017.cpp index a6f71739..b6464730 100644 --- a/src/017_CourseExec/UnkStruct_027e0ce0_30_017.cpp +++ b/src/017_CourseExec/UnkStruct_027e0ce0_30_017.cpp @@ -58,9 +58,9 @@ void UnkStruct_027e0ce0_30_00::func_ov017_020bbf7c(ItemManager *pItemMgr) { sp2C.mUnk_06 = temp_r8->func_ov000_02078698(); sp2C.mUnk_04 = temp_r8->func_ov000_0207868c(); sp2C.mUnk_02 = temp_r8->mUnk_0CA; - sp2C.mUnk_08 = MUL_FX32(func_01ffb9cc(&temp_r8->mUnk_040, &temp_r8->mUnk_034), data_ov000_020afd0c); + sp2C.mUnk_08 = FX_MUL(func_01ffb9cc(&temp_r8->mUnk_040, &temp_r8->mUnk_034), data_ov000_020afd0c); - sp4C = this->mpPlayer->mPos; + sp4C = this->mpPlayer->mPos.vec; sp4C.y += data_ov000_020afd14; temp_r8->func_ov000_0207834c(&sp4C, &sp2C, data_ov000_020afd08); @@ -105,7 +105,7 @@ void UnkStruct_027e0ce0_30_00::func_ov017_020bbf7c(ItemManager *pItemMgr) { } if (var_r9 != 0) { - this->mUnk_00.y = this->mpZelda->mPos.y + 0x191F; + this->mUnk_00.y = this->mpZelda->mPos.vec.y + 0x191F; return; } @@ -119,10 +119,10 @@ void UnkStruct_027e0ce0_30_00::func_ov017_020bbf7c(ItemManager *pItemMgr) { return; } - func_01ffb714(&this->mpPlayer->mPos, &this->mpZelda->mPos, &sp14); + func_01ffb714(&this->mpPlayer->mPos.vec, &this->mpZelda->mPos.vec, &sp14); sp14.y = 0; - VecFx32_Copy(&this->mpPlayer->mPos, &sp20); + VecFx32_Copy(&this->mpPlayer->mPos.vec, &sp20); sp20.y += data_ov000_020ab4dc[PlayerCharacter_Link].mUnk_66 / 2; if (!data_027e09bc->mUnk_04[0]->func_01ffd43c(&sp4, &sp20, 1)) { @@ -190,13 +190,13 @@ void UnkStruct_027e0ce0_30_00::func_ov017_020bbf7c(ItemManager *pItemMgr) { PlayerLinkActor *temp_r10_2 = this->mpPlayer; if (var_r9 != 0) { - this->mUnk_00.y = this->mpZelda->mPos.y + 0x191F; + this->mUnk_00.y = this->mpZelda->mPos.vec.y + 0x191F; } else { this->mUnk_00.y += data_ov000_020afd14; } if (this->mUnk_18 == 0x0D) { - VecFx32_SubXZ(&this->mUnk_00, &temp_r10_2->mPos, &sp8); + VecFx32_SubXZ(&this->mUnk_00, &temp_r10_2->mPos.vec, &sp8); PlayerLinkActor_9C *ptr = this->mpPlayer->mUnk_90; s16 value1 = func_01ffbbe0(); @@ -210,8 +210,8 @@ void UnkStruct_027e0ce0_30_00::func_ov017_020bbf7c(ItemManager *pItemMgr) { if (!(sp8.x == 0 && sp8.z == 0 ? 1 : 0)) { func_01ff9770(&sp8, temp_r8_5); - this->mUnk_00.x = temp_r10_2->mPos.x + sp8.x; - this->mUnk_00.z = temp_r10_2->mPos.z + sp8.z; + this->mUnk_00.x = temp_r10_2->mPos.vec.x + sp8.x; + this->mUnk_00.z = temp_r10_2->mPos.vec.z + sp8.z; } } } @@ -246,7 +246,7 @@ void UnkStruct_027e0ce0_30_00::func_ov017_020bbf7c(ItemManager *pItemMgr) { this->mUnk_18 = this->mpPlayer->func_ov000_0208dd60(this); if (var_r9 != 0) { - this->mUnk_00.y = this->mpZelda->mPos.y + 0x191F; + this->mUnk_00.y = this->mpZelda->mPos.vec.y + 0x191F; } else { this->mUnk_00.y += data_ov000_020afd14; } diff --git a/src/017_CourseExec/code_020be2ec_017.cpp b/src/017_CourseExec/code_020be2ec_017.cpp index bb592d61..e0abd3a6 100644 --- a/src/017_CourseExec/code_020be2ec_017.cpp +++ b/src/017_CourseExec/code_020be2ec_017.cpp @@ -38,7 +38,7 @@ void UnkStruct_027e0ce0_40_Base_7C::func_ov017_020be2ec(UnkStruct_027e0ce0_40_Ba if (!param2 && param1->mTouchControl.mState.touch && this->func_ov000_020968fc()) { VecFx32 sp4; - func_01ffb974((this->mUnk_14 + FLOAT_TO_FX32(0.5999f)) - param1->mUnk_24.y, ¶m1->mUnk_30, ¶m1->mUnk_24, &sp4); + func_01ffb974((this->mUnk_14 + FX_F32_TO_FX32(0.5999f)) - param1->mUnk_24.y, ¶m1->mUnk_30, ¶m1->mUnk_24, &sp4); data_027e0cec->func_ov000_020a0140(&this->mUnk_08, &sp4); fx32 originalY = func_ov000_0205d524(0, this->mUnk_00)->y; fx32 y = originalY; @@ -47,7 +47,7 @@ void UnkStruct_027e0ce0_40_Base_7C::func_ov017_020be2ec(UnkStruct_027e0ce0_40_Ba y = data_027e0cd8->mUnk_0C->vfunc_28(&sp4, 1, 0); } - func_01ff916c(&this->mUnk_14, ClampValue(y, originalY, originalY + FLOAT_TO_FX32(3.6f)), 0x1000); + func_01ff916c(&this->mUnk_14, ClampValue(y, originalY, originalY + FX_F32_TO_FX32(3.6f)), 0x1000); return; } diff --git a/src/018_StartUp/GameModeStartUp.cpp b/src/018_StartUp/GameModeStartUp.cpp index c1335857..ec86f433 100644 --- a/src/018_StartUp/GameModeStartUp.cpp +++ b/src/018_StartUp/GameModeStartUp.cpp @@ -36,7 +36,7 @@ static u8 data_ov018_020c5bc0; void SysFault::func_ov018_020c4840() { this->mUnk_05 = 0; - func_02027a28(func_0201245c, 0); + func_02027a28((void *) func_0201245c, 0); DC_FlushAll(); this->mUnk_00 = 0; this->mUnk_04 = 0; @@ -55,7 +55,7 @@ void Game::func_ov018_020c48a4() { OS_EnableIrqMask(1); GX_VBlankIntr(1); OS_WakeupThreadDirect(&this->mUnk_1C.mUnk_04); - func_02031e48(func_020131b0); + func_02031e48((void *) func_020131b0); this->TrySetCreateCallback((GameModeCreateCallback) Game::func_ov018_020c4ba8); } @@ -75,8 +75,8 @@ UnkStruct_02049b18::UnkStruct_02049b18() { } void UnkStruct_02011e10::func_ov018_020c4980() { - unk32 arenaLo = OS_GetMainArenaLo(); - unk32 arenaHi = OS_GetMainArenaHi(); + uintptr_t arenaLo = (uintptr_t) OS_GetMainArenaLo(); + uintptr_t arenaHi = (uintptr_t) OS_GetMainArenaHi(); for (int i = 0; i < HeapIndex_Max; i++) { this->mUnk_00[i] = NULL; @@ -107,18 +107,18 @@ void UnkStruct_02011e10::func_ov018_020c4980() { void UnkStruct_02011e10::func_ov018_020c4a5c() { UnkStruct_02011e10_Sub1 *temp_r2; - int temp_r5; - int temp_r7; - int temp_r0; + uintptr_t temp_r5; + uintptr_t temp_r7; + uintptr_t temp_r0; func_020013ac(this->mUnk_00[0]); temp_r2 = this->mUnk_00[0]; temp_r5 = ((uintptr_t) temp_r2->mUnk_1C - (uintptr_t) temp_r2); //! TODO: fake match? - temp_r7 = OS_GetArenaLo(0); + temp_r7 = (uintptr_t) OS_GetArenaLo(0); temp_r7 += temp_r5; - temp_r0 = OS_GetMainArenaHi(); + temp_r0 = (uintptr_t) OS_GetMainArenaHi(); this->mUnk_00[1] = func_02001098(temp_r7, temp_r0 - temp_r7, 2); this->mUnk_5C = func_020011f4(); OS_SetMainArenaLo((void *) temp_r0); diff --git a/src/024_MainGame/Actor/Actor_Derived1_EC_024.cpp b/src/024_MainGame/Actor/Actor_Derived1_EC_024.cpp index fe6024d5..de9595cc 100644 --- a/src/024_MainGame/Actor/Actor_Derived1_EC_024.cpp +++ b/src/024_MainGame/Actor/Actor_Derived1_EC_024.cpp @@ -192,7 +192,7 @@ u16 *Actor_Derived1_EC::func_ov024_020d69d8(VecFx32 *pPos, s16 *pAngle, VecFx32 temp_r4 = func_01ff9258(sp1C.x - pPos->x, sp1C.z - pPos->z); - var_r0 = MUL_FX32(param4, func_02017f54((s16 *) pAngle, sp0)); + var_r0 = FX_MUL(param4, func_02017f54((s16 *) pAngle, sp0)); if (var_r0 < param6) { var_r0 = param6; } @@ -208,8 +208,8 @@ u16 *Actor_Derived1_EC::func_ov024_020d69d8(VecFx32 *pPos, s16 *pAngle, VecFx32 fx16 sin = SIN(angle); fx16 cos = COS(angle); - pVel->x = MUL_FX32(sin, var_r0); - pVel->z = MUL_FX32(cos, var_r0); + pVel->x = FX_MUL(sin, var_r0); + pVel->z = FX_MUL(cos, var_r0); } return &this->mUnk_08; @@ -243,7 +243,7 @@ u16 *Actor_Derived1_EC::func_ov024_020d6b7c(VecFx32 *pPos, s16 *pAngle, VecFx32 temp_r4 = func_01ff9258(sp28.x - pPos->x, sp28.z - pPos->z); - var_r0 = MUL_FX32(param4, func_02017f54((s16 *) pAngle, sp0)); + var_r0 = FX_MUL(param4, func_02017f54((s16 *) pAngle, sp0)); if (var_r0 < param6) { var_r0 = param6; } @@ -263,8 +263,8 @@ u16 *Actor_Derived1_EC::func_ov024_020d6b7c(VecFx32 *pPos, s16 *pAngle, VecFx32 fx16 sin = SIN(angle); fx16 cos = COS(angle); - pVel->x = MUL_FX32(sin, var_r0); - pVel->z = MUL_FX32(cos, var_r0); + pVel->x = FX_MUL(sin, var_r0); + pVel->z = FX_MUL(cos, var_r0); } return &this->mUnk_08; diff --git a/src/024_MainGame/Player/PlayerActor_A0_38_024.cpp b/src/024_MainGame/Player/PlayerActor_A0_38_024.cpp index 5a1c1323..e63e1dc8 100644 --- a/src/024_MainGame/Player/PlayerActor_A0_38_024.cpp +++ b/src/024_MainGame/Player/PlayerActor_A0_38_024.cpp @@ -82,7 +82,7 @@ void PlayerLinkActor_A0_38_18::vfunc_00() { Vec2us temp2; temp1.x = data_ov024_020d8228.x; temp1.y = data_ov024_020d8228.y; - temp2.x = (temp_r6 + 0x18) + ROUND_FX32(MUL_FX32(SIN(this->mUnk_10->mUnk_30), FLOAT_TO_FX32(16.0f))); + temp2.x = (temp_r6 + 0x18) + ROUND_FX32(FX_MUL(SIN(this->mUnk_10->mUnk_30), FX_F32_TO_FX32(16.0f))); temp2.y = temp_r7 - 0x18; temp2.y = temp2.y & 0xFFFF; //! TODO: fake match? diff --git a/src/024_MainGame/TitleCard/UnkTitleCardSystem1_024.cpp b/src/024_MainGame/TitleCard/UnkTitleCardSystem1_024.cpp index afebaa14..c6c61489 100644 --- a/src/024_MainGame/TitleCard/UnkTitleCardSystem1_024.cpp +++ b/src/024_MainGame/TitleCard/UnkTitleCardSystem1_024.cpp @@ -557,8 +557,8 @@ void UnkStruct_ov024_020d8694_188::vfunc_00() { void UnkStruct_ov024_020d8694_188::vfunc_04(unk8 *param1) { MtxFx22 local; - local = data_027e0120; - local.w = func_01ffb428(0x1000, this->mUnk_144.func_0201ec30()); + local = data_027e0120; + local._11 = func_01ffb428(0x1000, this->mUnk_144.func_0201ec30()); UnkDataStruct1 local_30(&local, 0x40); this->func_ov024_020cb654(param1, &local_30); diff --git a/src/024_MainGame/Train/UnkDataStruct4.cpp b/src/024_MainGame/Train/UnkDataStruct4.cpp index 320db72e..e8fce303 100644 --- a/src/024_MainGame/Train/UnkDataStruct4.cpp +++ b/src/024_MainGame/Train/UnkDataStruct4.cpp @@ -79,8 +79,8 @@ void UnkDataStruct4::func_ov024_020d258c(u32 sceneIndex, u8 roomIndex) { void UnkDataStruct4::func_ov024_020d26b0(unk32 param1) { fx32 pos1 = INT_TO_FX32(param1); - fx32 pos3 = MUL_FX32(pos1 >> 1, INT_TO_FX32(this->mUnk_06)); - fx32 pos2 = MUL_FX32(pos1 >> 1, INT_TO_FX32(this->mUnk_04)); + fx32 pos3 = FX_MUL(pos1 >> 1, INT_TO_FX32(this->mUnk_06)); + fx32 pos2 = FX_MUL(pos1 >> 1, INT_TO_FX32(this->mUnk_04)); this->mUnk_08 = pos1; this->mUnk_0C = pos2; diff --git a/src/024_MainGame/Train/UnkTrainSystem1_024.cpp b/src/024_MainGame/Train/UnkTrainSystem1_024.cpp index e40ecb67..1cab243e 100644 --- a/src/024_MainGame/Train/UnkTrainSystem1_024.cpp +++ b/src/024_MainGame/Train/UnkTrainSystem1_024.cpp @@ -109,8 +109,8 @@ void UnkTrainSystem1::func_ov024_020d562c(const VecFx32 *param1, fx32 param2) { if (data_ov024_020d86a8.pInstance->mUnk_00_1 == 0) { UnkStruct_027e09bc *ptr = data_027e09bc; fx32 temp = this->mUnk_00 + this->mUnk_04; - fx32 temp_r1 = MUL_FX32(temp, param2); - new_var3 = MUL_FX32(param2, 0x266); + fx32 temp_r1 = FX_MUL(temp, param2); + new_var3 = FX_MUL(param2, 0x266); new_var5 = param1->z; new_var6 = param1->y + new_var3; @@ -134,9 +134,9 @@ void UnkTrainSystem1::func_ov024_020d562c(const VecFx32 *param1, fx32 param2) { temp_r1_3.z -= param1->z; temp_r1_3.y -= param1->y; - sp14.x = MUL_FX32(temp_r1_3.x, 0x2E1); - sp14.y = MUL_FX32(temp_r1_3.y, 0x2E1); - sp14.z = MUL_FX32(temp_r1_3.z, 0x2E1); + sp14.x = FX_MUL(temp_r1_3.x, 0x2E1); + sp14.y = FX_MUL(temp_r1_3.y, 0x2E1); + sp14.z = FX_MUL(temp_r1_3.z, 0x2E1); sp20 = sp14; diff --git a/src/024_MainGame/Train/UnkTrainSystem2_024.cpp b/src/024_MainGame/Train/UnkTrainSystem2_024.cpp index fef5d556..3fcbf228 100644 --- a/src/024_MainGame/Train/UnkTrainSystem2_024.cpp +++ b/src/024_MainGame/Train/UnkTrainSystem2_024.cpp @@ -8,8 +8,8 @@ #include "Unknown/UnkStruct_027e0d00.hpp" #include "Unknown/UnkStruct_ov000_020b5214.hpp" -extern "C" void func_01ffcb94(unk16, unk16, Mat3p *); -extern "C" void func_01ffa60c(const Mat3p *, Mat3p *, Mat3p *); +extern "C" void func_01ffcb94(unk16, unk16, MtxFx33 *); +extern "C" void func_01ffa60c(const MtxFx33 *, MtxFx33 *, MtxFx33 *); const UnkStruct_ov024_020d86a8 data_ov024_020d78bc = {0}; @@ -68,7 +68,7 @@ void UnkTrainSystem2::func_ov024_020d5990() { } } -void UnkTrainSystem2::func_ov024_020d5afc(const Mat3p *param1, const VecFx32 *param2, unk32 param3) { +void UnkTrainSystem2::func_ov024_020d5afc(const MtxFx33 *param1, const VecFx32 *param2, unk32 param3) { if (this->mUnk_00 <= 0) { return; } @@ -77,11 +77,11 @@ void UnkTrainSystem2::func_ov024_020d5afc(const Mat3p *param1, const VecFx32 *pa return; } - fx32 scale = MUL_FX32(this->mUnk_00, param3); + fx32 scale = FX_MUL(this->mUnk_00, param3); this->SetModel(); if (gpCargoManager->mUnk_18 > 0) { - Mat3p auStack_40; + MtxFx33 auStack_40; VecFx32 temp; func_01ffcb94(this->mUnk_64, this->mUnk_66, &auStack_40); func_01ffa60c(param1, &auStack_40, &auStack_40); diff --git a/src/026_Train/code_02102924.cpp b/src/026_Train/code_02102924.cpp index dec99758..55f80a8c 100644 --- a/src/026_Train/code_02102924.cpp +++ b/src/026_Train/code_02102924.cpp @@ -16,7 +16,7 @@ static TrainSpeedPreset data_ov026_02135fec[TrainPresetType_Max] = { .unk_30 = 143, .unk_34 = 5, .unk_38 = 30, - .unk_3C = FLOAT_TO_FX32(225.0f), + .unk_3C = FX_F32_TO_FX32(225.0f), }, // TrainPresetType_DarkRealmNormal { @@ -31,7 +31,7 @@ static TrainSpeedPreset data_ov026_02135fec[TrainPresetType_Max] = { .unk_30 = 377, .unk_34 = 5, .unk_38 = 30, - .unk_3C = FLOAT_TO_FX32(225.0f), + .unk_3C = FX_F32_TO_FX32(225.0f), }, // TrainPresetType_DarkRealmLightTear { @@ -46,7 +46,7 @@ static TrainSpeedPreset data_ov026_02135fec[TrainPresetType_Max] = { .unk_30 = 0, .unk_34 = 0, .unk_38 = 0, - .unk_3C = FLOAT_TO_FX32(225.0f), + .unk_3C = FX_F32_TO_FX32(225.0f), }, // TrainPresetType_DarkRealmLightTearRope { @@ -61,7 +61,7 @@ static TrainSpeedPreset data_ov026_02135fec[TrainPresetType_Max] = { .unk_30 = 0, .unk_34 = 0, .unk_38 = 0, - .unk_3C = FLOAT_TO_FX32(225.0f), + .unk_3C = FX_F32_TO_FX32(225.0f), }, // TrainPresetType_DarkRealmFight { @@ -76,7 +76,7 @@ static TrainSpeedPreset data_ov026_02135fec[TrainPresetType_Max] = { .unk_30 = 0, .unk_34 = 0, .unk_38 = 30, - .unk_3C = FLOAT_TO_FX32(81.0f), + .unk_3C = FX_F32_TO_FX32(81.0f), }, // TrainPresetType_5 { @@ -91,7 +91,7 @@ static TrainSpeedPreset data_ov026_02135fec[TrainPresetType_Max] = { .unk_30 = 143, .unk_34 = 5, .unk_38 = 30, - .unk_3C = FLOAT_TO_FX32(81.0f), + .unk_3C = FX_F32_TO_FX32(81.0f), }, }; diff --git a/src/031_Land/Actor/ActorBlast.cpp b/src/031_Land/Actor/ActorBlast.cpp index 11e24d1d..c7358457 100644 --- a/src/031_Land/Actor/ActorBlast.cpp +++ b/src/031_Land/Actor/ActorBlast.cpp @@ -10,7 +10,7 @@ struct UnkStruct_ov031_020e5d18_00 { /* 00 */ Actor *mUnk_00; - /* 04 */ STRUCT_PAD(0x04, 0x18); + /* 04 */ PAD(0x04, 0x18); /* 18 */ }; @@ -27,19 +27,19 @@ Actor *ActorProfileBlast::Create() { ActorProfileBlast::ActorProfileBlast() : ActorProfile(ActorId_Blast) { - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_04.pos); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_04.pos); } // non-matching bool ActorBlast_E8::vfunc_0C(const UnkStruct_ov031_020e54d4 *param1, unk32 *param2, unk32 param3) {} ActorBlast::ActorBlast() : - mUnk_94(FLOAT_TO_FX32(0.625f)), + mUnk_94(FX_F32_TO_FX32(0.625f)), mUnk_98(0, 24), mUnk_E8(this) {} bool ActorBlast::Init(unk32 param1) { - this->mPos.y += FLOAT_TO_FX32(0.5f); + this->mPos.y += FX_F32_TO_FX32(0.5f); this->mUnk_C8 = *this->mUnk_34; VecFx32_Add(&this->mUnk_C8.pos, &this->mPos, &this->mUnk_C8.pos); @@ -51,11 +51,11 @@ bool ActorBlast::Init(unk32 param1) { data_027e09a8->func_ov000_02071eac(&this->mPos); if (this->mUnk_5C.mParams[1] == 0x1) { - this->mUnk_F4 = FLOAT_TO_FX32(0.2f); - this->mUnk_F0 = FLOAT_TO_FX32(1.5f); + this->mUnk_F4 = FX_F32_TO_FX32(0.2f); + this->mUnk_F0 = FX_F32_TO_FX32(1.5f); } else { - this->mUnk_F4 = FLOAT_TO_FX32(0.1f); - this->mUnk_F0 = FLOAT_TO_FX32(1.0f); + this->mUnk_F4 = FX_F32_TO_FX32(0.1f); + this->mUnk_F0 = FX_F32_TO_FX32(1.0f); } data_027e09bc->mUnk_04[2]->func_ov000_0207a1e0(0x6); @@ -98,13 +98,13 @@ void ActorBlast::Update() { this->mUnk_D8.size = newVal; } else { this->mUnk_94 = f0; - this->mUnk_C8.size = ~FLOAT_TO_FX32(0.0f); + this->mUnk_C8.size = ~FX_F32_TO_FX32(0.0f); } if (this->mUnk_98.HasExpired()) { this->func_ov000_020984d0(); return; } - if (this->mUnk_C8.size <= FLOAT_TO_FX32(0.0f)) { + if (this->mUnk_C8.size <= FX_F32_TO_FX32(0.0f)) { return; } this->mUnk_9C.mUnk_0C = this->mUnk_C8; @@ -142,7 +142,7 @@ void ActorBlast::vfunc_24() { } fx32 ActorBlast::func_ov031_020e3b94() { - return FLOAT_TO_FX32(0.5f); + return FX_F32_TO_FX32(0.5f); } void ActorBlast::func_ov031_020e3b9c(Actor *spawner, unk16 param1, unk16 param2) { diff --git a/src/031_Land/Actor/ActorBomb.cpp b/src/031_Land/Actor/ActorBomb.cpp index aee2a623..02d474fb 100644 --- a/src/031_Land/Actor/ActorBomb.cpp +++ b/src/031_Land/Actor/ActorBomb.cpp @@ -19,7 +19,7 @@ struct UnkStruct_ov031_020e5d18_00 { /* 00 */ Actor *mUnk_00; - /* 04 */ STRUCT_PAD(0x04, 0x18); + /* 04 */ PAD(0x04, 0x18); /* 18 */ }; @@ -72,7 +72,7 @@ Actor *ActorProfileBomb::Create() { ActorProfileBomb::ActorProfileBomb() : ActorProfile(ActorId_Bomb) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.2999f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.4f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.2999f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.4f)); } G3d_Model *ActorBomb::func_ov031_020e1540(u16 param1) { @@ -283,11 +283,11 @@ void ActorBomb::func_ov031_020e1b7c() { return; } fx32 delta = this->mUnk_1EA.GetRemainingTime(); - this->mUnk_0F4.mUnk_04.mUnk_04 = FLOAT_TO_FX32(1.5f) - delta * FLOAT_TO_FX32(0.01985f); + this->mUnk_0F4.mUnk_04.mUnk_04 = FX_F32_TO_FX32(1.5f) - delta * FX_F32_TO_FX32(0.01985f); this->mUnk_0F4.func_01ffc3b4(); if (delta > 0x0) { - func_01ff9218(&this->mUnk_1D8, FLOAT_TO_FX32(1.3f), func_01ffb464((u32) delta << 0xC)); + func_01ff9218(&this->mUnk_1D8, FX_F32_TO_FX32(1.3f), func_01ffb464((u32) delta << 0xC)); } if (!this->mUnk_1EA.HasExpired()) { return; @@ -310,7 +310,7 @@ void ActorBomb::func_ov031_020e1b7c() { void ActorBomb::func_ov031_020e1d18() { this->func_ov000_02098838(); VecFx32_Add(&this->mPos, &this->mUnk_1CC, &this->mPos); - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_1CC); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_1CC); } void ActorBomb::func_ov031_020e1d48() { @@ -319,7 +319,7 @@ void ActorBomb::func_ov031_020e1d48() { } bool ActorBomb::func_ov031_020e1d58() { - return this->mUnk_154.pos.y >= FLOAT_TO_FX32(0.2999f); + return this->mUnk_154.pos.y >= FX_F32_TO_FX32(0.2999f); } bool ActorBomb::func_ov031_020e1d74() { @@ -349,9 +349,9 @@ void ActorBomb::func_ov031_020e1da0() { this->func_ov000_020984d0(); return; } - if (this->mUnk_180.mUnk_0C.z >= FLOAT_TO_FX32(-0.1003f)) { + if (this->mUnk_180.mUnk_0C.z >= FX_F32_TO_FX32(-0.1003f)) { this->mUnk_2C = 0x0; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mVel); func_01ffb974(-0x29, &this->mUnk_180.mUnk_0C, &this->mVel, &this->mVel); } else { func_01ff9218(&this->mUnk_2C, data_ov000_020aecf8, 0x800); @@ -469,8 +469,8 @@ void ActorBomb::func_ov031_020e20d8() { void ActorBomb::func_ov031_020e20fc() {} void ActorBomb::func_ov031_020e2100() { - fx32 newY = this->mPos.y - FLOAT_TO_FX32(0.0125f); - newY -= FLOAT_TO_FX32(0.1875f); + fx32 newY = this->mPos.y - FX_F32_TO_FX32(0.0125f); + newY -= FX_F32_TO_FX32(0.1875f); this->mUnk_1E9 = 0x50; this->mUnk_2C = 0x0; @@ -480,11 +480,11 @@ void ActorBomb::func_ov031_020e2100() { } void ActorBomb::func_ov031_020e2134() { - fx32 newZ = MUL_FX32(this->mVel.z, FLOAT_TO_FX32(0.3f)); - fx32 newX = MUL_FX32(this->mVel.x, FLOAT_TO_FX32(0.3f)); + fx32 newZ = FX_MUL(this->mVel.z, FX_F32_TO_FX32(0.3f)); + fx32 newX = FX_MUL(this->mVel.x, FX_F32_TO_FX32(0.3f)); this->mVel.x = newX; - this->mVel.y = FLOAT_TO_FX32(-0.0102f); + this->mVel.y = FX_F32_TO_FX32(-0.0102f); this->mVel.z = newZ; VecFx32_Copy(&this->mPos, &this->mPrevPos); @@ -525,7 +525,7 @@ void ActorBomb::vfunc_2C(Actor_vfunc_30 *param1) { func_01ffc5a0(&this->mUnk_094, this->mUnk_1D8, this->mAngle, &this->mPos); VecFx32 sp0C; - VecFx32_Init(this->mPos.x, this->mPos.y + FLOAT_TO_FX32(0.4f), this->mPos.z, &sp0C); + VecFx32_Init(this->mPos.x, this->mPos.y + FX_F32_TO_FX32(0.4f), this->mPos.z, &sp0C); if (this->mState == ActorBombState_6) { return; @@ -587,7 +587,7 @@ bool ActorBomb::Drop(ActorGrabParams grabParams, const VecFx32 *pVel) { VecFx32 sp0C = *this->Actor::func_ov000_0209853c(param1); - this->mUnk_154.pos.y = sp0C.y + FLOAT_TO_FX32(0.4f) - this->mPos.y; + this->mUnk_154.pos.y = sp0C.y + FX_F32_TO_FX32(0.4f) - this->mPos.y; this->mPrevPos.x = sp0C.x; this->mPrevPos.z = sp0C.z; } else { @@ -595,7 +595,7 @@ bool ActorBomb::Drop(ActorGrabParams grabParams, const VecFx32 *pVel) { if (actor != NULL) { VecFx32 sp00 = actor->mPos; - this->mUnk_154.pos.y = sp00.y + FLOAT_TO_FX32(0.4f) - this->mPos.y; + this->mUnk_154.pos.y = sp00.y + FX_F32_TO_FX32(0.4f) - this->mPos.y; this->mPrevPos.x = sp00.x; this->mPrevPos.z = sp00.z; } @@ -618,25 +618,25 @@ bool ActorBomb::func_ov031_020e25bc() { bool ActorBomb::func_ov031_020e262c() { VecFx32_Copy(&this->mPos, &this->mUnk_19C.mUnk_0C.pos); - this->mUnk_19C.mUnk_0C.size = FLOAT_TO_FX32(0.4f); + this->mUnk_19C.mUnk_0C.size = FX_F32_TO_FX32(0.4f); data_027e09c0->func_ov000_0207e58c(this->mRef, 0x0, 0xC, &this->mUnk_19C); return true; } void ActorBomb::func_ov031_020e2680(VecFx32 *param1) { - if (this->mVel.y == FLOAT_TO_FX32(0.0f)) { + if (this->mVel.y == FX_F32_TO_FX32(0.0f)) { return; } - if (param1->x == FLOAT_TO_FX32(0.0f) && param1->y == FLOAT_TO_FX32(0.0f) && param1->z == FLOAT_TO_FX32(0.0f)) { + if (param1->x == FX_F32_TO_FX32(0.0f) && param1->y == FX_F32_TO_FX32(0.0f) && param1->z == FX_F32_TO_FX32(0.0f)) { return; } VecFx32 sp0C = this->mVel; VecFx32 sp00 = this->mVel; - if (VecFx32_Dot(param1, &sp00) >= FLOAT_TO_FX32(0.0f)) { + if (VecFx32_Dot(param1, &sp00) >= FX_F32_TO_FX32(0.0f)) { return; } @@ -645,8 +645,8 @@ void ActorBomb::func_ov031_020e2680(VecFx32 *param1) { func_01ff94cc(&sp00, param1, &sp0C); VecFx32_TryNormalize(&sp00); - this->mVel.x = MUL_FX32(sp00.x, MUL_FX32(velLength, FLOAT_TO_FX32(0.2f))); - this->mVel.z = MUL_FX32(sp00.z, MUL_FX32(velLength, FLOAT_TO_FX32(0.2f))); + this->mVel.x = FX_MUL(sp00.x, FX_MUL(velLength, FX_F32_TO_FX32(0.2f))); + this->mVel.z = FX_MUL(sp00.z, FX_MUL(velLength, FX_F32_TO_FX32(0.2f))); } void ActorBomb::func_ov031_020e2780(VecFx32 *param1) { @@ -657,13 +657,13 @@ void ActorBomb::func_ov031_020e2780(VecFx32 *param1) { } fx32 dot = VecFx32_Dot(&sp00, &this->mVel); - if (dot >= FLOAT_TO_FX32(0.0f)) { + if (dot >= FX_F32_TO_FX32(0.0f)) { return; } - func_01ffb974(ROUND_FX32(dot * FLOAT_TO_FX32(-1.2002f)), &sp00, &this->mVel, &this->mVel); - this->mVel.x = ROUND_FX32(this->mVel.x * FLOAT_TO_FX32(0.75f)); - this->mVel.z = ROUND_FX32(this->mVel.z * FLOAT_TO_FX32(0.75f)); + func_01ffb974(ROUND_FX32(dot * FX_F32_TO_FX32(-1.2002f)), &sp00, &this->mVel, &this->mVel); + this->mVel.x = ROUND_FX32(this->mVel.x * FX_F32_TO_FX32(0.75f)); + this->mVel.z = ROUND_FX32(this->mVel.z * FX_F32_TO_FX32(0.75f)); } // non-matching @@ -683,13 +683,13 @@ fx32 ActorBomb::func_ov031_020e2820(UnkStruct_ov031_Items_00 *param1) { VecFx32 sp18 = sp3C; if (VecFx32_TryNormalize(&sp18) != 0x0) { - while (sp3CLength != FLOAT_TO_FX32(0.0f)) { - if (sp3CLength > FLOAT_TO_FX32(0.5f)) { - func_01ffb974(FLOAT_TO_FX32(0.5f), &sp18, &sp24, &sp24); - sp3CLength -= FLOAT_TO_FX32(0.5f); + while (sp3CLength != FX_F32_TO_FX32(0.0f)) { + if (sp3CLength > FX_F32_TO_FX32(0.5f)) { + func_01ffb974(FX_F32_TO_FX32(0.5f), &sp18, &sp24, &sp24); + sp3CLength -= FX_F32_TO_FX32(0.5f); } else { func_01ffb974(sp3CLength, &sp18, &sp24, &sp24); - sp3CLength = FLOAT_TO_FX32(0.0f); + sp3CLength = FX_F32_TO_FX32(0.0f); } func_01ffe6c4(&sp60, this->mRef, &sp24, &sp30, (s16) this->mUnk_44, &this->mPos, param1); @@ -719,13 +719,13 @@ fx32 ActorBomb::func_ov031_020e295c(UnkStruct_ov031_Items_00 *param1) { VecFx32 sp18 = sp3C; if (VecFx32_TryNormalize(&sp18) != 0x0) { - while (sp3CLength != FLOAT_TO_FX32(0.0f)) { - if (sp3CLength > FLOAT_TO_FX32(0.5f)) { - func_01ffb974(FLOAT_TO_FX32(0.5f), &sp18, &sp24, &sp24); - sp3CLength -= FLOAT_TO_FX32(0.5f); + while (sp3CLength != FX_F32_TO_FX32(0.0f)) { + if (sp3CLength > FX_F32_TO_FX32(0.5f)) { + func_01ffb974(FX_F32_TO_FX32(0.5f), &sp18, &sp24, &sp24); + sp3CLength -= FX_F32_TO_FX32(0.5f); } else { func_01ffb974(sp3CLength, &sp18, &sp24, &sp24); - sp3CLength = FLOAT_TO_FX32(0.0f); + sp3CLength = FX_F32_TO_FX32(0.0f); } func_01ffe6c4(&sp60, this->mRef, &sp24, &sp30, (s16) this->mUnk_44, &this->mPos, param1); @@ -742,7 +742,7 @@ void ActorBomb::func_ov031_020e2a9c() { UnkStruct_ov031_020e5d18_00 s0C; s0C.mUnk_00 = NULL; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_180.mUnk_0C); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_180.mUnk_0C); func_01ffe6c4(&s0C, this->mRef, &this->mPos, &this->mPrevPos, (s16) this->mUnk_44, &this->mPos, &this->mUnk_180); @@ -802,15 +802,15 @@ void ActorBomb::func_ov031_020e2c2c() { } ++this->mUnk_1E8; - this->mVel.y = MUL_FX32(-this->mVel.y, FLOAT_TO_FX32(0.6f)); - this->mVel.x = MUL_FX32(this->mVel.x, FLOAT_TO_FX32(0.2f)); - this->mVel.z = MUL_FX32(this->mVel.z, FLOAT_TO_FX32(0.2f)); + this->mVel.y = FX_MUL(-this->mVel.y, FX_F32_TO_FX32(0.6f)); + this->mVel.x = FX_MUL(this->mVel.x, FX_F32_TO_FX32(0.2f)); + this->mVel.z = FX_MUL(this->mVel.z, FX_F32_TO_FX32(0.2f)); if (this->mUnk_1E8 <= 0x3) { return; } - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mVel); this->SetState(ActorBombState_0); return; } @@ -824,7 +824,7 @@ void ActorBomb::func_ov031_020e2c2c() { ActorBomb_180::ActorBomb_180(Actor *param1) : mUnk_08(param1) { - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_0C); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_0C); this->mUnk_18 = 0x0; } diff --git a/src/031_Land/Actor/ActorHeart.cpp b/src/031_Land/Actor/ActorHeart.cpp index 27c8d924..8d0f3d23 100644 --- a/src/031_Land/Actor/ActorHeart.cpp +++ b/src/031_Land/Actor/ActorHeart.cpp @@ -11,15 +11,15 @@ typedef struct { unk16 mUnk_04; unk16 mUnk_06; unk16 mUnk_08; - STRUCT_PAD(0x0A, 0x14); + PAD(0x0A, 0x14); unk16 mUnk_14; - STRUCT_PAD(0x16, 0x18); + PAD(0x16, 0x18); unk16 mUnk_18; - STRUCT_PAD(0x1A, 0x1C); + PAD(0x1A, 0x1C); unk16 mUnk_1C; - STRUCT_PAD(0x1E, 0x28); + PAD(0x1E, 0x28); unk16 mUnk_28; - STRUCT_PAD(0x2A, 0x3C); + PAD(0x2A, 0x3C); } UnkStruct_ov031_020eeee8; extern "C" void func_01ffce1c(unk16 *, unk16 *); @@ -43,7 +43,7 @@ Actor *ActorProfileHeart::Create() { ActorProfileHeart::ActorProfileHeart() : ActorProfile(ActorId_Heart) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.25)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.25)); } void ActorHeart::func_ov031_020eed64(ActorRef *pOutRef, const VecFx32 *pPos, u32 params, ActorRef ref) { @@ -74,9 +74,9 @@ ActorHeart::ActorHeart() : mUnk_C4(0), mUnk_C8(this) { - this->mUnk_EC.x = FLOAT_TO_FX32(0.0); - this->mUnk_EC.y = FLOAT_TO_FX32(0.0); - this->mUnk_EC.z = FLOAT_TO_FX32(0.0); + this->mUnk_EC.x = FX_F32_TO_FX32(0.0); + this->mUnk_EC.y = FX_F32_TO_FX32(0.0); + this->mUnk_EC.z = FX_F32_TO_FX32(0.0); this->mUnk_98.mUnk_04 = 0x13100; this->mUnk_40 = &this->mUnk_C8; @@ -189,13 +189,13 @@ void ActorHeart::Update() { this->func_ov000_02098910(0, 0x10); } if (this->mUnk_46 & 0x3) { - this->mVel.y = FLOAT_TO_FX32(0.0); + this->mVel.y = FX_F32_TO_FX32(0.0); } VecFx32_Add(&this->mPos, &this->mUnk_EC, &this->mPos); - this->mUnk_EC.x = FLOAT_TO_FX32(0.0); - this->mUnk_EC.y = FLOAT_TO_FX32(0.0); - this->mUnk_EC.z = FLOAT_TO_FX32(0.0); + this->mUnk_EC.x = FX_F32_TO_FX32(0.0); + this->mUnk_EC.y = FX_F32_TO_FX32(0.0); + this->mUnk_EC.z = FX_F32_TO_FX32(0.0); } extern unk32 data_ov000_020aecf8; @@ -254,7 +254,7 @@ void ActorHeart::func_ov031_020ef208() { } void ActorHeart::func_ov031_020ef2ec() { - this->mVel.y = FLOAT_TO_FX32(0.25); + this->mVel.y = FX_F32_TO_FX32(0.25); } void ActorHeart::func_ov031_020ef2f8() { @@ -279,9 +279,9 @@ void ActorHeart::func_ov031_020ef334() { } void ActorHeart::func_ov031_020ef35c() { - this->mVel.x = FLOAT_TO_FX32(0.0); - this->mVel.y = FLOAT_TO_FX32(0.0); - this->mVel.z = FLOAT_TO_FX32(0.0); + this->mVel.x = FX_F32_TO_FX32(0.0); + this->mVel.y = FX_F32_TO_FX32(0.0); + this->mVel.z = FX_F32_TO_FX32(0.0); if (!this->mUnk_BE && this->mTimer.GetRemainingTime() > 180) { this->mTimer.Set(0, 180); } @@ -305,29 +305,29 @@ void ActorHeart::func_ov031_020ef3d0() { if (!GET_FLAG(this->mFlags, ActorFlag_5)) { return; } - this->mVel.x = FLOAT_TO_FX32(0.0); - this->mVel.y = FLOAT_TO_FX32(0.0); - this->mVel.z = FLOAT_TO_FX32(0.0); + this->mVel.x = FX_F32_TO_FX32(0.0); + this->mVel.y = FX_F32_TO_FX32(0.0); + this->mVel.z = FX_F32_TO_FX32(0.0); this->mUnk_98.mUnk_04 |= 0x1000; this->SetState(ActorHeartState_1); } void ActorHeart::func_ov031_020ef430() { - this->mVel.x = FLOAT_TO_FX32(0.0); - this->mVel.y = FLOAT_TO_FX32(0.0); - this->mVel.z = FLOAT_TO_FX32(0.0); + this->mVel.x = FX_F32_TO_FX32(0.0); + this->mVel.y = FX_F32_TO_FX32(0.0); + this->mVel.z = FX_F32_TO_FX32(0.0); } void ActorHeart::func_ov031_020ef444() {} void ActorHeart::func_ov031_020ef448() { - this->mVel.x = FLOAT_TO_FX32(0.0); - this->mVel.z = FLOAT_TO_FX32(0.0); + this->mVel.x = FX_F32_TO_FX32(0.0); + this->mVel.z = FX_F32_TO_FX32(0.0); } typedef struct { - STRUCT_PAD(0x00, 0xE8); + PAD(0x00, 0xE8); VecFx32 mUnk_E8; } UnkActor_02ef458; @@ -376,11 +376,11 @@ void ActorHeart::func_ov031_020ef570() { this->mUnk_B8 += 0x666; - this->mVel.x = MUL_FX32(SIN((u16) this->mUnk_B8), 0x40); - this->mVel.z = FLOAT_TO_FX32(0.0); + this->mVel.x = FX_MUL(SIN((u16) this->mUnk_B8), 0x40); + this->mVel.z = FX_F32_TO_FX32(0.0); - if (this->mVel.y <= FLOAT_TO_FX32(-0.005) - 1) { - this->mVel.y = FLOAT_TO_FX32(-0.005) - 1; + if (this->mVel.y <= FX_F32_TO_FX32(-0.005) - 1) { + this->mVel.y = FX_F32_TO_FX32(-0.005) - 1; } } @@ -394,13 +394,13 @@ void ActorHeart::vfunc_2C(Actor_vfunc_30 *param1) { } iStack_20 = this->mPos; - iStack_20.y += FLOAT_TO_FX32(0.03113); + iStack_20.y += FX_F32_TO_FX32(0.03113); this->func_ov017_020bf5c4(&iStack_20, 0x400, 0x400, 0x1F, 0); func_ov000_0205c1f0(&auStack_30, 0x10); iStack_2c = this->mPos; - iStack_2c.y += FLOAT_TO_FX32(0.33); + iStack_2c.y += FX_F32_TO_FX32(0.33); func_ov000_0205c204(&auStack_30, &iStack_2c, 0xCCD, 0xCCD, 0x1F); } diff --git a/src/031_Land/Actor/ActorItemBoomerang.cpp b/src/031_Land/Actor/ActorItemBoomerang.cpp index 2fe8501f..94508478 100644 --- a/src/031_Land/Actor/ActorItemBoomerang.cpp +++ b/src/031_Land/Actor/ActorItemBoomerang.cpp @@ -44,21 +44,21 @@ ActorItemBoomerang::ActorItemBoomerang() : bool ActorItemBoomerang::Init(unk32 param1) { this->mUnk_CC.mUnk_30.func_ov031_020e45fc(); - this->mUnk_A0.mUnk_0C.Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(-0.1003f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.4f)); + this->mUnk_A0.mUnk_0C.Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(-0.1003f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.4f)); - this->mUnk_10C.x = FLOAT_TO_FX32(0.0f); - this->mUnk_10C.y = FLOAT_TO_FX32(-0.1003f); - this->mUnk_10C.z = FLOAT_TO_FX32(0.0f); - this->mUnk_118 = FLOAT_TO_FX32(0.0f); + this->mUnk_10C.x = FX_F32_TO_FX32(0.0f); + this->mUnk_10C.y = FX_F32_TO_FX32(-0.1003f); + this->mUnk_10C.z = FX_F32_TO_FX32(0.0f); + this->mUnk_118 = FX_F32_TO_FX32(0.0f); this->func_ov031_020e5034(0x0); unk16 sin = SIN((u16) this->mAngle.angle_s); unk16 cos = COS((u16) this->mAngle.angle_s); - this->mVel.x = MUL_FX32(sin, FLOAT_TO_FX32(0.5f)); - this->mVel.z = MUL_FX32(cos, FLOAT_TO_FX32(0.5f)); - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_MUL(sin, FX_F32_TO_FX32(0.5f)); + this->mVel.z = FX_MUL(cos, FX_F32_TO_FX32(0.5f)); + this->mVel.y = FX_F32_TO_FX32(0.0f); return true; } @@ -78,9 +78,9 @@ void ActorItemBoomerang::func_ov031_020e49b0(unk32 param1) { if (this->mState == ActorItemBoomerangState_1) { return; } - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); data_027e0d2c->func_ov031_020d95b4(); this->SetState(ActorItemBoomerangState_1); @@ -103,7 +103,7 @@ void ActorItemBoomerang::Update() { bool var2 = false; switch (this->mState) { case ActorItemBoomerangState_0: { - this->mUnk_A0.mUnk_0C.Init(this->mPos.x, this->mPos.y, this->mPos.z, FLOAT_TO_FX32(0.3f)); + this->mUnk_A0.mUnk_0C.Init(this->mPos.x, this->mPos.y, this->mPos.z, FX_F32_TO_FX32(0.3f)); data_027e09c0->func_ov000_0207e58c(this->mRef, 0xC, 0x8, &this->mUnk_A0); @@ -133,14 +133,14 @@ void ActorItemBoomerang::Update() { unk32 vecLength = VecFx32_Length(&this->mVel); unk32 lengthModified = (vecLength << 0xA) + 0x800; unk32 sp18 = lengthModified; - func_01ff916c(&sp18, 0x0, MUL_FX32(vecLength, lengthModified)); + func_01ff916c(&sp18, 0x0, FX_MUL(vecLength, lengthModified)); func_01ffb714(&sp6C, &this->mPos, &this->mVel); func_01ff97c8(&this->mPos, sp18 + 0x200); } if (sp14.type != 0) { this->mUnk_CC.mUnk_0C.pos.z = this->mPos.z; - this->mUnk_CC.mUnk_0C.pos.y = this->mPos.y + FLOAT_TO_FX32(-0.1003f); + this->mUnk_CC.mUnk_0C.pos.y = this->mPos.y + FX_F32_TO_FX32(-0.1003f); this->mUnk_CC.mUnk_0C.size = 0xA000; this->mUnk_CC.mUnk_0C.pos.x = this->mPos.x; data_027e09c0->func_ov000_0207e58c(this->mRef, 0xC, 0x8, &this->mUnk_CC); @@ -177,7 +177,7 @@ void ActorItemBoomerang::Update() { } case ActorItemBoomerangState_1: { - this->mUnk_A0.mUnk_0C.Init(this->mPos.x, this->mPos.y, this->mPos.z, FLOAT_TO_FX32(0.3f)); + this->mUnk_A0.mUnk_0C.Init(this->mPos.x, this->mPos.y, this->mPos.z, FX_F32_TO_FX32(0.3f)); data_027e09c0->func_ov000_0207e58c(this->mRef, 0xC, 0x8, &this->mUnk_A0); Actor *sp24; /* actor* ? */ @@ -335,8 +335,8 @@ void ActorItemBoomerang_CC::vfunc_10(Actor *actor) { // non-matching bool ActorItemBoomerang_CC::vfunc_0C(Actor *actor, VecFx32 *param2) { if (actor != NULL) { - if (actor->mRef.Get32() == this->mUnk_2C && actor->mVel.x == FLOAT_TO_FX32(0.0f) && - actor->mVel.y == FLOAT_TO_FX32(0.0f) && actor->mVel.z == FLOAT_TO_FX32(0.0f)) { + if (actor->mRef.Get32() == this->mUnk_2C && actor->mVel.x == FX_F32_TO_FX32(0.0f) && + actor->mVel.y == FX_F32_TO_FX32(0.0f) && actor->mVel.z == FX_F32_TO_FX32(0.0f)) { this->mUnk_2C = 0x0; return UnkStruct_ov031_Items_01::vfunc_0C(actor, param2); } @@ -346,9 +346,9 @@ bool ActorItemBoomerang_CC::vfunc_0C(Actor *actor, VecFx32 *param2) { void ActorItemBoomerang_Unknown::func_ov031_020e45fc() { this->mUnk_00 = 0x0; - this->mUnk_04.x = FLOAT_TO_FX32(-0.1003f); - this->mUnk_04.y = FLOAT_TO_FX32(0.0f); - this->mUnk_04.z = FLOAT_TO_FX32(0.3f); + this->mUnk_04.x = FX_F32_TO_FX32(-0.1003f); + this->mUnk_04.y = FX_F32_TO_FX32(0.0f); + this->mUnk_04.z = FX_F32_TO_FX32(0.3f); } ActorItemBoomerang_11C::ActorItemBoomerang_11C(ActorItemBoomerang *param1) : diff --git a/src/031_Land/Actor/ActorItemDrop.cpp b/src/031_Land/Actor/ActorItemDrop.cpp index a16936c9..8f64e219 100644 --- a/src/031_Land/Actor/ActorItemDrop.cpp +++ b/src/031_Land/Actor/ActorItemDrop.cpp @@ -91,15 +91,15 @@ void ActorItemDrop::func_ov031_020f9f8c(ActorRef *pOutRef, const VecFx32 *pPos, ActorItemDrop::ActorItemDrop() : mUnk_AE(0, 6), - mUnk_D8(FLOAT_TO_FX32(0.5f)), + mUnk_D8(FX_F32_TO_FX32(0.5f)), mUnk_DC(0), mUnk_E0(0), mUnk_E4(this), mUnk_108(0x0) { - this->mUnk_10C.x = FLOAT_TO_FX32(0.0f); - this->mUnk_10C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_10C.z = FLOAT_TO_FX32(0.0f); + this->mUnk_10C.x = FX_F32_TO_FX32(0.0f); + this->mUnk_10C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_10C.z = FX_F32_TO_FX32(0.0f); this->mUnk_118 = false; this->mUnk_119 = false; @@ -107,7 +107,7 @@ ActorItemDrop::ActorItemDrop() : case ActorId_ArrowDrop: if (data_027e0ce0->mUnk_2C->HasItem(ItemFlag_Bow)) { this->mItemTypeId = ItemDropType_Arrow; - this->mUnk_D8 = FLOAT_TO_FX32(0.5f); + this->mUnk_D8 = FX_F32_TO_FX32(0.5f); } else { this->mItemTypeId = ItemDropType_Unknown; } @@ -115,14 +115,14 @@ ActorItemDrop::ActorItemDrop() : case ActorId_BombDrop: if (data_027e0ce0->mUnk_2C->HasItem(ItemFlag_Bombs)) { this->mItemTypeId = ItemDropType_Bomb; - this->mUnk_D8 = FLOAT_TO_FX32(0.3f); + this->mUnk_D8 = FX_F32_TO_FX32(0.3f); } else { this->mItemTypeId = ItemDropType_Unknown; } break; case ActorId_RedPotionDrop: this->mItemTypeId = ItemDropType_RedPotion; - this->mUnk_D8 = FLOAT_TO_FX32(0.4f); + this->mUnk_D8 = FX_F32_TO_FX32(0.4f); this->mUnk_119 = true; break; case ActorId_TreasureDrop: @@ -153,7 +153,7 @@ ActorItemDrop::ActorItemDrop() : } this->mItemTypeId = itemType; - this->mUnk_D8 = FLOAT_TO_FX32(0.3f); + this->mUnk_D8 = FX_F32_TO_FX32(0.3f); this->mUnk_119 = true; break; default: @@ -252,13 +252,13 @@ void ActorItemDrop::func_ov031_020fa260() { } if (this->mUnk_46 & 3) { - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); } VecFx32_Add(&this->mPos, &this->mUnk_10C, &this->mPos); - this->mUnk_10C.x = FLOAT_TO_FX32(0.0f); - this->mUnk_10C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_10C.z = FLOAT_TO_FX32(0.0f); + this->mUnk_10C.x = FX_F32_TO_FX32(0.0f); + this->mUnk_10C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_10C.z = FX_F32_TO_FX32(0.0f); } static PTMF data_ov031_02114be8[ActorItemDropState_Max] = { @@ -288,7 +288,7 @@ void ActorItemDrop::func_ov031_020fa468() {} void ActorItemDrop::func_ov031_020fa46c() { func_ov000_02098838(); - if (this->mVel.y > FLOAT_TO_FX32(0.0f)) { + if (this->mVel.y > FX_F32_TO_FX32(0.0f)) { return; } @@ -319,9 +319,9 @@ void ActorItemDrop::func_ov031_020fa4a0() { } void ActorItemDrop::func_ov031_020fa524() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); if (!this->mUnk_118 && this->mTimer.GetRemainingTime() > 180) { this->mTimer.Set(0, 180); @@ -346,9 +346,9 @@ void ActorItemDrop::func_ov031_020fa568() { this->func_ov000_02098838(); if (this->mUnk_46 & 0x3) { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_108 = 0x0; } @@ -367,31 +367,31 @@ void ActorItemDrop::func_ov031_020fa5f0() { this->func_ov017_020bf9c8(gpActorManager->func_01fff3b4(this->mUnk_DC)); if (GET_FLAG(this->mFlags, ActorFlag_5)) { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_B4.mUnk_04 |= 0x1000; this->SetState(ActorItemDropState_1); } } void ActorItemDrop::func_ov031_020fa650() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } void ActorItemDrop::func_ov031_020fa664() {} void ActorItemDrop::func_ov031_020fa668() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } class UnkActor_ov031_020fa678 : public Actor { public: /* 000 (base) */ - /* 94 */ STRUCT_PAD(0x94, 0xE8); + /* 94 */ PAD(0x94, 0xE8); /* E8 */ VecFx32 mUnk_E8; }; @@ -408,9 +408,9 @@ void ActorItemDrop::func_ov031_020fa678() { void ActorItemDrop::func_ov031_020fa6c8() { this->mTimer.Reset(); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_4A[0] = 0x0; this->mUnk_44 = 0x0; @@ -475,7 +475,7 @@ void ActorItemDrop::vfunc_2C(Actor_vfunc_30 *param1) { } vec1 = this->mPos; - vec1.y += FLOAT_TO_FX32(0.03113); + vec1.y += FX_F32_TO_FX32(0.03113); this->func_ov017_020bf5c4(&vec1, 0x400, 0x400, 0x1F, 0x0); func_ov000_0205c1f0(&value, data_ov031_02110bc8[this->mItemTypeId]); diff --git a/src/031_Land/Actor/ActorItemFlower.cpp b/src/031_Land/Actor/ActorItemFlower.cpp index f896240d..0d3631e6 100644 --- a/src/031_Land/Actor/ActorItemFlower.cpp +++ b/src/031_Land/Actor/ActorItemFlower.cpp @@ -37,7 +37,7 @@ Actor *ActorProfileItemFlower::Create() { ActorProfileItemFlower::ActorProfileItemFlower() : ActorProfile(ActorId_ItemFlower) { - this->mUnk_04.size = FLOAT_TO_FX32(0.25f); + this->mUnk_04.size = FX_F32_TO_FX32(0.25f); } ActorItemFlower::ActorItemFlower() : @@ -112,7 +112,7 @@ void ActorItemFlower::func_ov031_020f1230() { data_027e09a8->func_ov000_02071eac(&this->mPos); VecFx32 vecSp08; - VecFx32_Init(this->mPos.x, this->mPos.y + FLOAT_TO_FX32(0.5f), this->mPos.z, &vecSp08); + VecFx32_Init(this->mPos.x, this->mPos.y + FX_F32_TO_FX32(0.5f), this->mPos.z, &vecSp08); data_027e0cec->func_ov000_0209feac(0x875, &vecSp08, 0x4, 0x0, 0x0); data_027e0cec->func_ov000_0209feac(0x876, &vecSp08, 0x4, 0x0, 0x0); diff --git a/src/031_Land/Actor/ActorItemTornado.cpp b/src/031_Land/Actor/ActorItemTornado.cpp index 16e67a20..01798c8b 100644 --- a/src/031_Land/Actor/ActorItemTornado.cpp +++ b/src/031_Land/Actor/ActorItemTornado.cpp @@ -34,7 +34,7 @@ Actor *ActorProfileItemTornado::Create() { ActorProfileItemTornado::ActorProfileItemTornado() : ActorProfile(ActorId_ItemTornado) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.25f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.20f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.25f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.20f)); } // non-matching @@ -65,11 +65,11 @@ bool ActorItemTornado::Init(unk32 param1) { this->mUnk_34 = &data_ov031_02112fdc; this->mUnk_194.mUnk_04 = this->mRef; - this->mUnk_194.mUnk_0C.Init(this->mPos.x, this->mPos.y + FLOAT_TO_FX32(0.85f), this->mPos.z, FLOAT_TO_FX32(0.8f)); + this->mUnk_194.mUnk_0C.Init(this->mPos.x, this->mPos.y + FX_F32_TO_FX32(0.85f), this->mPos.z, FX_F32_TO_FX32(0.8f)); - this->mVel.x = MUL_FX32(SIN(tmp), 0x385); - this->mVel.z = MUL_FX32(COS(tmp), 0x385); - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_MUL(SIN(tmp), 0x385); + this->mVel.z = FX_MUL(COS(tmp), 0x385); + this->mVel.y = FX_F32_TO_FX32(0.0f); return true; } @@ -210,9 +210,9 @@ void ActorItemTornado::func_ov031_020e5d18(unk32 param1) { return; } if (this->mUnk_1CC == 0x0) { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_1CC = 0x1; } } @@ -222,7 +222,8 @@ void ActorItemTornado::Update() { void ActorItemTornado::vfunc_24() { if (!this->mUnk_1CE && this->mState != ActorItemTornadoState_2 && - (this->mVel.x != FLOAT_TO_FX32(0.0f) || this->mVel.y != FLOAT_TO_FX32(0.0f) || this->mVel.z != FLOAT_TO_FX32(0.0f))) { + (this->mVel.x != FX_F32_TO_FX32(0.0f) || this->mVel.y != FX_F32_TO_FX32(0.0f) || + this->mVel.z != FX_F32_TO_FX32(0.0f))) { return; } this->func_ov031_020e5d18(0x1); @@ -238,10 +239,10 @@ void ActorItemTornado::vfunc_2C(Actor_vfunc_30 *param1) { } unk32 var_r0 = this->mUnk_1DC; unk32 var_r1; - if (var_r0 == FLOAT_TO_FX32(1.0f)) { + if (var_r0 == FX_F32_TO_FX32(1.0f)) { var_r1 = 0x1F; } else { - var_r0 = var_r0 * 0x1F + FLOAT_TO_FX32(0.5f); + var_r0 = var_r0 * 0x1F + FX_F32_TO_FX32(0.5f); var_r1 = var_r0 >> 0xC; if (var_r1 > 0x1F) { var_r1 = 0x1F; @@ -265,7 +266,7 @@ void ActorItemTornado::vfunc_2C(Actor_vfunc_30 *param1) { VecFx32 vec = this->mPos; if (this->mState == ActorItemTornadoState_0) { - vec.y += ROUND_FX32(((FLOAT_TO_FX32(1.0f) - this->mUnk_1DC) << 0xC)); + vec.y += ROUND_FX32(((FX_F32_TO_FX32(1.0f) - this->mUnk_1DC) << 0xC)); } data_027e0958->func_ov000_02058fc4(&this->mUnk_17C, &vec); } @@ -300,7 +301,7 @@ bool ActorItemTornado::func_ov031_020e6340(VecFx32 *param1, unk16 param2, unk16 this->mUnk_1CC = param2; this->mUnk_1D6 = param3; this->mUnk_1CE = true; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mVel); return true; } diff --git a/src/031_Land/Actor/ActorPot.cpp b/src/031_Land/Actor/ActorPot.cpp index 188d63a6..869d0cae 100644 --- a/src/031_Land/Actor/ActorPot.cpp +++ b/src/031_Land/Actor/ActorPot.cpp @@ -36,7 +36,7 @@ Actor *ActorProfilePot::Create() { ActorProfilePot::ActorProfilePot() : ActorProfile(ActorId_NTUB) { - this->mUnk_04.size = FLOAT_TO_FX32(0.5f); + this->mUnk_04.size = FX_F32_TO_FX32(0.5f); } ActorPot::ActorPot() : diff --git a/src/031_Land/Actor/ActorRollingStone.cpp b/src/031_Land/Actor/ActorRollingStone.cpp index 13e36c83..955cd3ce 100644 --- a/src/031_Land/Actor/ActorRollingStone.cpp +++ b/src/031_Land/Actor/ActorRollingStone.cpp @@ -10,7 +10,7 @@ #include "Unknown/UnkStruct_027e0d38.hpp" #include "Unknown/UnkStruct_027e0d8c.hpp" -extern "C" Mat3p data_027e0130; +extern "C" MtxFx33 data_027e0130; extern "C" unk32 data_ov000_020aecf8; extern "C" VecFx32 data_ov031_02110b98; @@ -19,7 +19,7 @@ extern "C" VecFx32 data_ov031_02110bb0; extern "C" VecFx32 data_ov031_02110bbc; extern "C" void func_01ff916c(unk32 *, unk32, unk32); -extern "C" void func_01ffa60c(const Mat3p *, Mat3p *, Mat3p *); +extern "C" void func_01ffa60c(const MtxFx33 *, MtxFx33 *, MtxFx33 *); extern "C" unk32 func_01ffb9cc(VecFx32 *, VecFx32 *); extern "C" unk8 func_02017e8c(unk16 *); @@ -59,7 +59,7 @@ Actor *ActorProfileRollingStone::Create() { ActorProfileRollingStone::ActorProfileRollingStone() : ActorProfile_Derived1(ActorId_RollingStone) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.8f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.8f)); } // non-matching @@ -115,10 +115,10 @@ ActorRollingStone::ActorRollingStone() : } bool ActorRollingStone::Init(unk32 param1) { - this->mUnk_13C.Init(FLOAT_TO_FX32(0.8f)); + this->mUnk_13C.Init(FX_F32_TO_FX32(0.8f)); if (data_027e09a4->mUnk_00.sceneIndex == SceneIndex_f_flame) { - this->mUnk_13C.Init(FLOAT_TO_FX32(0.75f)); + this->mUnk_13C.Init(FX_F32_TO_FX32(0.75f)); } this->mUnk_34 = &this->mUnk_13C; @@ -129,7 +129,7 @@ bool ActorRollingStone::Init(unk32 param1) { switch (this->mUnk_5C.mParams[0]) { case 0x1: - this->mPos.y += FLOAT_TO_FX32(3.6f); + this->mPos.y += FX_F32_TO_FX32(3.6f); if (this->mUnk_5C.mUnk_1A[0] == 0) { this->SetState(ActorRollingStoneState_2); break; @@ -175,7 +175,7 @@ void ActorRollingStone::SetState(ActorState state) { void ActorRollingStone::func_ov031_020f8880() { VecFx32 vec = this->mPos; - vec.y += FLOAT_TO_FX32(0.8f); + vec.y += FX_F32_TO_FX32(0.8f); data_027e0cec->func_ov000_0209feac(0x8AF, &vec, 0x4, 0x0, 0x0); data_027e0cec->func_ov000_0209feac(0x8B0, &vec, 0x4, 0x0, 0x0); @@ -191,10 +191,10 @@ void ActorRollingStone::vfunc_2C(Actor_vfunc_30 *param1) { return; } VecFx32 sp18; - VecFx32_Init(this->mPos.x, this->mPos.y + FLOAT_TO_FX32(0.8f), this->mPos.z, &sp18); + VecFx32_Init(this->mPos.x, this->mPos.y + FX_F32_TO_FX32(0.8f), this->mPos.z, &sp18); VecFx32 spC; - VecFx32_Init(FLOAT_TO_FX32(1.0f), FLOAT_TO_FX32(1.0f), FLOAT_TO_FX32(1.0f), &spC); + VecFx32_Init(FX_F32_TO_FX32(1.0f), FX_F32_TO_FX32(1.0f), FX_F32_TO_FX32(1.0f), &spC); this->mUnk_94.vfunc_10(&spC, &this->mUnk_10C, &sp18); @@ -237,7 +237,7 @@ void ActorRollingStone::func_ov031_020f8a58() { return; } - if (this->mPos.y <= FLOAT_TO_FX32(-5.0002)) { + if (this->mPos.y <= FX_F32_TO_FX32(-5.0002)) { this->func_ov000_020984d0(); return; } @@ -256,19 +256,19 @@ void ActorRollingStone::func_ov031_020f8b58() { switch (((u32) (this->mUnk_5C.mInitialAngle + 0x2000) << 0x10) >> 0x1E) { case 0x1: - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.x = FLOAT_TO_FX32(0.105f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.105f); + this->mVel.z = FX_F32_TO_FX32(0.0f); break; case 0x3: - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.x = FLOAT_TO_FX32(-0.1052f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(-0.1052f); + this->mVel.z = FX_F32_TO_FX32(0.0f); break; default: - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.105f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.105f); break; } this->func_ov031_020f9af4(); @@ -297,14 +297,14 @@ void ActorRollingStone::func_ov031_020f8bc4() { unk16 sinValue = SIN((u16) this->mAngle.angle_s); unk16 cosValue = COS((u16) this->mAngle.angle_s); - sp38.x = MUL_FX32(sinValue, FLOAT_TO_FX32(1.0f)); - sp38.z = MUL_FX32(cosValue, FLOAT_TO_FX32(1.0f)); - sp38.y = FLOAT_TO_FX32(0.0f); + sp38.x = FX_MUL(sinValue, FX_F32_TO_FX32(1.0f)); + sp38.z = FX_MUL(cosValue, FX_F32_TO_FX32(1.0f)); + sp38.y = FX_F32_TO_FX32(0.0f); Cylinder sp28; this->vfunc_10(&sp28); - sp28.pos.z += FLOAT_TO_FX32(0.05f); + sp28.pos.z += FX_F32_TO_FX32(0.05f); if (data_027e09c0->func_ov000_0207e458(0x2, 0x1B, &sp28.pos, 0x2, &sp38, this->mRef)) { return; @@ -409,11 +409,11 @@ void ActorRollingStone::func_ov031_020f9018() { fx32 angle = ((u32) (this->mAngle.angle_s + DEG_TO_ANG(45)) << 0x10) >> 0x1E; if (angle == 0x1 || angle == 0x3) { - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } else { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); } } @@ -423,12 +423,12 @@ void ActorRollingStone::func_ov031_020f9050() { fx32 angle = ((u32) (this->mAngle.angle_s + DEG_TO_ANG(45)) << 0x10) >> 0x1E; if (angle == 0x1 || angle == 0x3) { - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); func_01ff916c(&this->mVel.x, 0x0, 0x10); } else { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); func_01ff916c(&this->mVel.z, 0x0, 0x10); } @@ -443,13 +443,13 @@ void ActorRollingStone::func_ov031_020f9050() { angle = ((u32) (this->mAngle.angle_s + DEG_TO_ANG(45)) << 0x10) >> 0x1E; if (angle == 0x1 || angle == 0x3) { - if (this->mVel.x != FLOAT_TO_FX32(0.0f)) { + if (this->mVel.x != FX_F32_TO_FX32(0.0f)) { return; } this->SetState(ActorRollingStoneState_9); return; } - if (this->mVel.z != FLOAT_TO_FX32(0.0f)) { + if (this->mVel.z != FX_F32_TO_FX32(0.0f)) { return; } this->SetState(ActorRollingStoneState_9); @@ -457,9 +457,9 @@ void ActorRollingStone::func_ov031_020f9050() { void ActorRollingStone::func_ov031_020f916c() { this->mUnk_2C = 0x0; - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_44 = 0xBF; if (!this->mUnk_159) { @@ -499,14 +499,14 @@ void ActorRollingStone::func_ov031_020f9250() { } this->mUnk_AC.func_ov000_02097bec(); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); - this->mUnk_13C.pos.x = FLOAT_TO_FX32(0.0f); - this->mUnk_13C.pos.y = FLOAT_TO_FX32(0.5f); - this->mUnk_13C.pos.z = FLOAT_TO_FX32(0.0f); - this->mUnk_13C.size = FLOAT_TO_FX32(0.5f); + this->mUnk_13C.pos.x = FX_F32_TO_FX32(0.0f); + this->mUnk_13C.pos.y = FX_F32_TO_FX32(0.5f); + this->mUnk_13C.pos.z = FX_F32_TO_FX32(0.0f); + this->mUnk_13C.size = FX_F32_TO_FX32(0.5f); this->mUnk_44 = (s16) this->mUnk_44 & ~0x20; } @@ -536,19 +536,19 @@ void ActorRollingStone::func_ov031_020f9340() { switch (angle) { case 0x1: - this->mVel.x = FLOAT_TO_FX32(0.105f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.105f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); break; case 0x3: - this->mVel.x = FLOAT_TO_FX32(-0.1052f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(-0.1052f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); break; default: - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.105f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.105f); break; } @@ -570,7 +570,7 @@ void ActorRollingStone::func_ov031_020f93bc() { return; } } - if (this->mPos.y <= FLOAT_TO_FX32(-5.0002f)) { + if (this->mPos.y <= FX_F32_TO_FX32(-5.0002f)) { this->func_ov000_020984d0(); return; } @@ -584,19 +584,19 @@ void ActorRollingStone::func_ov031_020f9494() { switch ((u32) (this->mUnk_5C.mInitialAngle + DEG_TO_ANG(45)) << 0x10 >> 0x1E) { case 0x1: - this->mVel.x = FLOAT_TO_FX32(0.105f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.105f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); break; case 0x3: - this->mVel.x = FLOAT_TO_FX32(-0.1052f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(-0.1052f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); break; default: - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.105f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.105f); break; } this->func_ov031_020f9af4(); @@ -632,14 +632,14 @@ void ActorRollingStone::func_ov031_020f9554() { unk16 sinValue = SIN((u16) this->mAngle.angle_s); unk16 cosValue = COS((u16) this->mAngle.angle_s); - sp38.x = MUL_FX32(sinValue, FLOAT_TO_FX32(0.25f)); - sp38.y = FLOAT_TO_FX32(0.0f); - sp38.z = MUL_FX32(cosValue, FLOAT_TO_FX32(0.25f)); + sp38.x = FX_MUL(sinValue, FX_F32_TO_FX32(0.25f)); + sp38.y = FX_F32_TO_FX32(0.0f); + sp38.z = FX_MUL(cosValue, FX_F32_TO_FX32(0.25f)); Cylinder sp28; this->vfunc_10(&sp28); - sp28.pos.z += FLOAT_TO_FX32(0.05f); + sp28.pos.z += FX_F32_TO_FX32(0.05f); if (data_027e09c0->func_ov000_0207e458(0x2, 0x1B, &sp28.pos, 0x2, &sp38, this->mRef)) { return; @@ -665,21 +665,21 @@ void ActorRollingStone::func_ov031_020f9554() { } void ActorRollingStone::func_ov031_020f97cc() { - Mat3p sp00; + MtxFx33 sp00; switch ((u32) (this->mUnk_5C.mInitialAngle + DEG_TO_ANG(45)) << 0x10 >> 0x1E) { case 0x1: case 0x3: { fx32 diffX = this->mPos.x - this->mPrevPos.x; - fx32 angleX = -MUL_FX32(diffX, FLOAT_TO_FX32(2.6668f)); - Mat3p_InitZRotation(&sp00, SIN((u16) angleX), COS((u16) angleX)); + fx32 angleX = -FX_MUL(diffX, FX_F32_TO_FX32(2.6668f)); + MtxFx33_InitZRotation(&sp00, SIN((u16) angleX), COS((u16) angleX)); break; } case 0x0: case 0x2: { fx32 diffZ = this->mPos.z - this->mPrevPos.z; - fx32 angleZ = MUL_FX32(diffZ, FLOAT_TO_FX32(2.6668f)); - Mat3p_InitXRotation(&sp00, SIN((u16) angleZ), COS((u16) angleZ)); + fx32 angleZ = FX_MUL(diffZ, FX_F32_TO_FX32(2.6668f)); + MtxFx33_InitXRotation(&sp00, SIN((u16) angleZ), COS((u16) angleZ)); break; } default: @@ -691,56 +691,56 @@ void ActorRollingStone::func_ov031_020f97cc() { void ActorRollingStone::func_ov031_020f98e4() { unk16 sp00 = this->mAngle.angle_s; - Mat3p sp34; + MtxFx33 sp34; switch (func_02017e8c(&sp00)) { case 0x2: case 0x6: { fx32 diffX = this->mPos.x - this->mPrevPos.x; - fx32 angleX = -MUL_FX32(diffX, FLOAT_TO_FX32(2.6668f)); - Mat3p_InitZRotation(&sp34, SIN((u16) angleX), COS((u16) angleX)); + fx32 angleX = -FX_MUL(diffX, FX_F32_TO_FX32(2.6668f)); + MtxFx33_InitZRotation(&sp34, SIN((u16) angleX), COS((u16) angleX)); break; } case 0x0: case 0x4: { fx32 diffZ = this->mPos.z - this->mPrevPos.z; - fx32 angleZ = MUL_FX32(diffZ, FLOAT_TO_FX32(2.6668f)); - Mat3p_InitXRotation(&sp34, SIN((u16) angleZ), COS((u16) angleZ)); + fx32 angleZ = FX_MUL(diffZ, FX_F32_TO_FX32(2.6668f)); + MtxFx33_InitXRotation(&sp34, SIN((u16) angleZ), COS((u16) angleZ)); break; } case 0x5: { VecFx32 sp28 = data_ov031_02110b98; unk32 ret = func_01ffb9cc(&this->mPrevPos, &this->mPos); - fx32 angleRet1 = -MUL_FX32(ret, FLOAT_TO_FX32(2.6668f)); + fx32 angleRet1 = -FX_MUL(ret, FX_F32_TO_FX32(2.6668f)); - Mat3p_func_01ff8248(&sp34, &sp28, SIN((u16) angleRet1), COS((u16) angleRet1)); + MtxFx33_func_01ff8248(&sp34, &sp28, SIN((u16) angleRet1), COS((u16) angleRet1)); break; } case 0x1: { VecFx32 sp1C = data_ov031_02110ba4; unk32 ret2 = func_01ffb9cc(&this->mPrevPos, &this->mPos); - fx32 angleRet2 = MUL_FX32(ret2, FLOAT_TO_FX32(2.6668f)); + fx32 angleRet2 = FX_MUL(ret2, FX_F32_TO_FX32(2.6668f)); - Mat3p_func_01ff8248(&sp34, &sp1C, SIN((u16) angleRet2), COS((u16) angleRet2)); + MtxFx33_func_01ff8248(&sp34, &sp1C, SIN((u16) angleRet2), COS((u16) angleRet2)); break; } case 0x7: { VecFx32 sp10 = data_ov031_02110bb0; unk32 ret3 = func_01ffb9cc(&this->mPrevPos, &this->mPos); - fx32 angleRet3 = MUL_FX32(ret3, FLOAT_TO_FX32(2.6668f)); + fx32 angleRet3 = FX_MUL(ret3, FX_F32_TO_FX32(2.6668f)); - Mat3p_func_01ff8248(&sp34, &sp10, SIN((u16) angleRet3), COS((u16) angleRet3)); + MtxFx33_func_01ff8248(&sp34, &sp10, SIN((u16) angleRet3), COS((u16) angleRet3)); break; } case 0x3: { VecFx32 sp04 = data_ov031_02110bbc; unk32 ret4 = func_01ffb9cc(&this->mPrevPos, &this->mPos); - fx32 angleRet4 = -MUL_FX32(ret4, FLOAT_TO_FX32(2.6668f)); + fx32 angleRet4 = -FX_MUL(ret4, FX_F32_TO_FX32(2.6668f)); - Mat3p_func_01ff8248(&sp34, &sp04, SIN((u16) angleRet4), COS((u16) angleRet4)); + MtxFx33_func_01ff8248(&sp34, &sp04, SIN((u16) angleRet4), COS((u16) angleRet4)); break; } default: @@ -754,7 +754,7 @@ void ActorRollingStone::func_ov031_020f9af4() {} // non-matching void ActorRollingStone::func_ov031_020f9af8() { - const fx32 y = this->mPos.y + FLOAT_TO_FX32(0.4f); + const fx32 y = this->mPos.y + FX_F32_TO_FX32(0.4f); const fx32 x = this->mPos.x; const fx32 z = this->mPos.z; @@ -781,7 +781,7 @@ bool ActorRollingStone::func_ov031_020f9ba4() { sp18.y = this->mPos.y - pVec->y; sp18.z = this->mPos.z - pVec->z; - return VecFx32_Length(&sp18) > FLOAT_TO_FX32(8.0f); + return VecFx32_Length(&sp18) > FX_F32_TO_FX32(8.0f); } VecFx32 *pVec1 = data_027e0ce0->func_01fff148(0x0); @@ -802,7 +802,7 @@ bool ActorRollingStone::func_ov031_020f9ba4() { sp18.z = z; } - return VecFx32_Length(&sp18) > FLOAT_TO_FX32(8.0f); + return VecFx32_Length(&sp18) > FX_F32_TO_FX32(8.0f); } void ActorRollingStone::func_ov031_020f9cc0() { diff --git a/src/031_Land/Actor/ActorRupee.cpp b/src/031_Land/Actor/ActorRupee.cpp index 43be9058..8e2cc372 100644 --- a/src/031_Land/Actor/ActorRupee.cpp +++ b/src/031_Land/Actor/ActorRupee.cpp @@ -465,7 +465,7 @@ void ActorRupee::func_ov031_020e9638() { this->mUnk_4A[0] = 0; } - this->mPos.y -= FLOAT_TO_FX32(1.2); + this->mPos.y -= FX_F32_TO_FX32(1.2); } // non-matching diff --git a/src/031_Land/Actor/ActorShotArrow.cpp b/src/031_Land/Actor/ActorShotArrow.cpp index 23700c46..545c95f0 100644 --- a/src/031_Land/Actor/ActorShotArrow.cpp +++ b/src/031_Land/Actor/ActorShotArrow.cpp @@ -15,6 +15,7 @@ #include "Unknown/UnkStruct_027e0ce0.hpp" #include "Unknown/UnkStruct_027e0cec.hpp" #include "Unknown/UnkStruct_027e0d30.hpp" +#include "nitro/fx.h" typedef struct UnkResourceStruct2 { /* 00 */ unk32 mUnk_00; @@ -32,42 +33,42 @@ typedef struct { } UnkStruct_020f374c; typedef struct { - /* 00 */ STRUCT_PAD(0x00, 0x04); + /* 00 */ PAD(0x00, 0x04); /* 04 */ ActorRef mUnk_04; /* 08 */ unk32 mUnk_08; - /* 0C */ Mat4x3p *mUnk_0C; + /* 0C */ MtxFx43 *mUnk_0C; /* 10 */ VecFx32 mUnk_10; /* 1C */ VecFx32 mUnk_1C; /* 28 */ } UnkStruct_020f38b0; typedef struct { - /* 00 */ STRUCT_PAD(0x00, 0x04); + /* 00 */ PAD(0x00, 0x04); /* 04 */ Cylinder mUnk_04; /* 14 */ VecFx32 mUnk_14; /* 20 */ } UnkStruct_020f3c38; typedef struct { - /* 000 */ STRUCT_PAD(0x0, 0x25B); + /* 000 */ PAD(0x0, 0x25B); /* 25B */ bool mUnk_25B; /* 25C */ } UnkStruct_ov060_02163ff4; typedef struct { - /* 0C */ Mat3p mUnk_0C; - /* 30 */ Mat3p mUnk_30; + /* 0C */ MtxFx33 mUnk_0C; + /* 30 */ MtxFx33 mUnk_30; /* 54 */ VecFx32 mUnk_54; - /* 60 */ Mat3p mUnk_60; - /* 84 */ Mat4x3p mUnk_84; - /* B4 */ Mat4x3p mUnk_B4; + /* 60 */ MtxFx33 mUnk_60; + /* 84 */ MtxFx43 mUnk_84; + /* B4 */ MtxFx43 mUnk_B4; /* E4 */ VecFx32 mUnk_E4; /* F0 */ fx32 mUnk_F0; } UnkStack_ov031_020f2310; struct UnkStruct_020f1b04 { /* 0C */ Actor *mUnk_0C; - /* 10 */ STRUCT_PAD(0x10, 0x24); + /* 10 */ PAD(0x10, 0x24); /* 24 */ }; @@ -78,7 +79,7 @@ extern "C" char data_ov031_02110b4c[0x10]; // = "arrow_s"; extern "C" char data_ov031_02110b5c[0x14]; // = "ef_arrowB"; extern "C" char data_ov031_02110b08[0x34]; // = "ef_arrowB"; -extern Mat4x3p data_027e0964; +extern MtxFx43 data_027e0964; extern ActorUnkIWTS *data_027e0d80; extern bool data_ov060_02163fe0; extern UnkStruct_ov060_02163ff4 data_ov060_02163ff4; @@ -89,9 +90,9 @@ extern "C" void func_01ff93c0(VecFx32 *, unk32); extern "C" void func_01ff94cc(VecFx32 *, VecFx32 *, VecFx32 *); extern "C" void func_01ff95a0(VecFx32 *, unk16); extern "C" void func_01ff9638(VecFx32 *vec, s16 angle); -extern "C" void func_01ffa7a0(VecFx32 *, Mat3p *, VecFx32 *); -extern "C" void func_01ffa9e8(Mat4x3p *, Mat4x3p *); -extern "C" void func_01ffad5c(Mat4x3p *, Mat4x3p *, Mat4x3p *); +extern "C" void func_01ffa7a0(VecFx32 *, MtxFx33 *, VecFx32 *); +extern "C" void func_01ffa9e8(MtxFx43 *, MtxFx43 *); +extern "C" void func_01ffad5c(MtxFx43 *, MtxFx43 *, MtxFx43 *); extern "C" void func_01ffb714(VecFx32 *, VecFx32 *, VecFx32 *); extern "C" fx16 func_01ffbbe0(fx32, fx32); extern "C" bool func_01ffccf4(Cylinder *, VecFx32 *, VecFx32 *, unk32 *); @@ -102,9 +103,9 @@ extern "C" bool func_ov000_0205aeac(); extern "C" void func_ov000_0207b6c0(); extern "C" unk32 func_ov000_0207df88(unk32 *, Cylinder *, unk32); extern "C" void func_ov075_02160864(ActorShotArrow *, unk32); -extern "C" void GX_func_02024a84(Mat3p *param1); -extern "C" void CopySingle288(Mat4x3p *, Mat3p *); -extern "C" void func_01ffa60c(const Mat3p *, Mat3p *, Mat3p *); +extern "C" void GX_func_02024a84(MtxFx33 *param1); +extern "C" void CopySingle288(MtxFx43 *, MtxFx33 *); +extern "C" void func_01ffa60c(const MtxFx33 *, MtxFx33 *, MtxFx33 *); MapObjectProfile_Derived2_20_Base *func_ov031_020f1404() { return data_027e0ce0->mUnk_1C->mUnk_08[PlayerCharacter_Link][1]; @@ -118,7 +119,7 @@ Actor *ActorProfileShotArrow::Create() { ActorProfileShotArrow::ActorProfileShotArrow() : ActorProfile(ActorId_ShotArrow) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.2f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.2f)); } ActorShotArrow::ActorShotArrow() : @@ -174,8 +175,8 @@ bool ActorShotArrow::Init(unk32 param1) { fx32 cos_value = COS((u16) this->mAngle.angle_s); this->mUnk_2C = 0; - this->mVel.x = MUL_FX32(sin_value, 1024); - this->mVel.z = MUL_FX32(cos_value, 1024); + this->mVel.x = FX_MUL(sin_value, 1024); + this->mVel.z = FX_MUL(cos_value, 1024); this->mVel.y = 0; this->mUnk_16C = VecFx32_Length(&this->mVel); @@ -191,7 +192,7 @@ bool ActorShotArrow::Init(unk32 param1) { this->mUnk_194.mUnk_04 = this->mRef.Get32(); VecFx32_Copy(&this->mPos, &this->mUnk_194.mUnk_0C.pos); - this->mUnk_194.mUnk_0C.size = FLOAT_TO_FX32(0.20f); + this->mUnk_194.mUnk_0C.size = FX_F32_TO_FX32(0.20f); this->mUnk_44 = 0x1F; return true; } @@ -299,9 +300,9 @@ void ActorShotArrow::func_ov031_020f1a64() { fx16 sin_value = SIN(this->mAngle.angle_u); fx16 cos_value = COS(this->mAngle.angle_u); - this->mVel.x = MUL_FX32(sin_value, value_func_020f2270); - this->mVel.z = MUL_FX32(cos_value, value_func_020f2270); - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_MUL(sin_value, value_func_020f2270); + this->mVel.z = FX_MUL(cos_value, value_func_020f2270); + this->mVel.y = FX_F32_TO_FX32(0.0f); } // non-matching @@ -341,9 +342,9 @@ void ActorShotArrow::func_ov031_020f1b04() { } void ActorShotArrow::func_ov031_020f1c24() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->func_ov031_020f2794(0x1); this->mUnk_174 = 0x1555; @@ -385,9 +386,9 @@ void ActorShotArrow::func_ov031_020f1c7c() { } void ActorShotArrow::func_ov031_020f1dd4() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->func_ov031_020f2794(0x1); this->mUnk_174 = 0x1555; @@ -432,9 +433,9 @@ void ActorShotArrow::func_ov031_020f1e3c() { } void ActorShotArrow::func_ov031_020f1f54() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->func_ov031_020f2794(0x1); this->mUnk_174 = 0x1555; @@ -482,7 +483,7 @@ void ActorShotArrow::func_ov031_020f20bc() { } this->mUnk_176 += -0x11C7; - this->mVel.y -= FLOAT_TO_FX32(0.002f); + this->mVel.y -= FX_F32_TO_FX32(0.002f); this->func_ov000_02098838(); @@ -541,10 +542,10 @@ void ActorShotArrow::func_ov031_020f2280() { } void ActorShotArrow::func_ov031_020f229c() { - this->mUnk_168 = MUL_FX32(this->mUnk_168 + this->mUnk_16C, FLOAT_TO_FX32(0.8f)); + this->mUnk_168 = FX_MUL(this->mUnk_168 + this->mUnk_16C, FX_F32_TO_FX32(0.8f)); } -void ActorShotArrow::func_ov031_020f22d4(Mat3p *param1, VecFx32 *param2) { +void ActorShotArrow::func_ov031_020f22d4(MtxFx33 *param1, VecFx32 *param2) { func_0200eab0(this->mUnk_A0.mpModel, 0x0, this->mUnk_25E); this->mUnk_A0.vfunc_14(param1, param2); } @@ -564,11 +565,11 @@ void ActorShotArrow::vfunc_2C(Actor_vfunc_30 *param1) { u8 var5 = 0x1F; if (this->mUnk_170 < (s16) 0x10) { - var4 = FLOAT_TO_FX32(this->mUnk_170); + var4 = FX_F32_TO_FX32(this->mUnk_170); } if (this->mUnk_172 < (s16) 0x10) { - var5 = FLOAT_TO_FX32(this->mUnk_170); + var5 = FX_F32_TO_FX32(this->mUnk_170); } if (var4 == 0) { @@ -578,7 +579,7 @@ void ActorShotArrow::vfunc_2C(Actor_vfunc_30 *param1) { func_0200eab0(this->mUnk_94.mpModel, 0x0, var4); if (this->mState == ActorShotArrowState_2 && this->mUnk_224 != NULL) { - Mat4x3p_InitXRotation(&stack.mUnk_84, SIN((u16) this->mUnk_174), COS((u16) this->mUnk_174)); + MtxFx43_InitXRotation(&stack.mUnk_84, SIN((u16) this->mUnk_174), COS((u16) this->mUnk_174)); func_01ffad5c(this->mUnk_224, &data_027e0964, &stack.mUnk_B4); func_01ffad5c(&stack.mUnk_84, &this->mUnk_228, &stack.mUnk_84); @@ -587,7 +588,7 @@ void ActorShotArrow::vfunc_2C(Actor_vfunc_30 *param1) { CopySingle288(&stack.mUnk_B4, &stack.mUnk_60); VecFx32_Copy(&this->mPos, &this->mPrevPos); - VecFx32_Copy(&stack.mUnk_B4.wColumn, &this->mPos); + VecFx32_Copy((VecFx32 *) &stack.mUnk_B4._30, &this->mPos); this->mUnk_94.vfunc_14(&stack.mUnk_60, &this->mPos); @@ -595,16 +596,16 @@ void ActorShotArrow::vfunc_2C(Actor_vfunc_30 *param1) { this->func_ov031_020f2654(&stack.mUnk_60); } } else { - VecFx32_Copy(&this->mPos, &stack.mUnk_30.zColumn); + VecFx32_Copy(&this->mPos, (VecFx32 *) &stack.mUnk_30._20); - Mat3p_InitYRotation(&stack.mUnk_30, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); - Mat3p_InitXRotation(&stack.mUnk_30, SIN((u16) (s16) (this->mUnk_174 + this->mUnk_176)), - COS((u16) (s16) (this->mUnk_174 + this->mUnk_176))); + MtxFx33_InitYRotation(&stack.mUnk_30, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); + MtxFx33_InitXRotation(&stack.mUnk_30, SIN((u16) (s16) (this->mUnk_174 + this->mUnk_176)), + COS((u16) (s16) (this->mUnk_174 + this->mUnk_176))); func_01ffa60c(&stack.mUnk_0C, &stack.mUnk_30, &stack.mUnk_30); // should have if/else structure - stack.mUnk_54.y = MUL_FX32(FLOAT_TO_FX32(0.2f), SIN(this->mUnk_174 + this->mUnk_176)); + stack.mUnk_54.y = FX_MUL(FX_F32_TO_FX32(0.2f), SIN(this->mUnk_174 + this->mUnk_176)); this->mUnk_94.vfunc_14(&stack.mUnk_30, &stack.mUnk_54); @@ -621,7 +622,7 @@ void ActorShotArrow::vfunc_2C(Actor_vfunc_30 *param1) { } // non-matching -void ActorShotArrow::func_ov031_020f2654(Mat3p *param1) {} +void ActorShotArrow::func_ov031_020f2654(MtxFx33 *param1) {} void ActorShotArrow::func_ov031_020f2794(unk16 param1) { switch (param1) { @@ -674,9 +675,9 @@ void ActorShotArrow::func_ov031_020f28ac() { } if (!func_ov000_0205cbc4(this->mUnk_140.mUnk_0C.Get32(), &vec2)) { - vec1.x = FLOAT_TO_FX32(0.0f); - vec1.y = FLOAT_TO_FX32(0.0f); - vec1.z = FLOAT_TO_FX32(0.0f); + vec1.x = FX_F32_TO_FX32(0.0f); + vec1.y = FX_F32_TO_FX32(0.0f); + vec1.z = FX_F32_TO_FX32(0.0f); } else { func_01ffb714(&this->mPos, &vec2, &vec1); } @@ -781,9 +782,9 @@ void ActorShotArrow::func_ov031_020f2bec() { void ActorShotArrow::func_ov031_020f2c08(unk16 param1) { VecFx32 vel; - this->mVel.x = MUL_FX32(SIN((u16) this->mAngle.angle_s), param1); - this->mVel.z = MUL_FX32(COS((u16) this->mAngle.angle_s), param1); - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_MUL(SIN((u16) this->mAngle.angle_s), param1); + this->mVel.z = FX_MUL(COS((u16) this->mAngle.angle_s), param1); + this->mVel.y = FX_F32_TO_FX32(0.0f); vel = this->mVel; func_01ff93c0(&vel, -0x1000); @@ -824,14 +825,14 @@ void ActorShotArrow::func_ov031_020f2cac(VecFx32 *param1, bool param2) { if (param2) { pos = this->mPos; - this->mPos.x -= FLOAT_TO_FX32(SIN((u16) this->mAngle.angle_s)); - this->mPos.z -= FLOAT_TO_FX32(COS((u16) this->mAngle.angle_s)); + this->mPos.x -= FX_F32_TO_FX32(SIN((u16) this->mAngle.angle_s)); + this->mPos.z -= FX_F32_TO_FX32(COS((u16) this->mAngle.angle_s)); data_027e09a8->func_ov000_02071eac(&this->mPos); data_027e09a8->func_ov000_02071b30(0x8D7B, &pos, 0x0); - vec.x = (fx16) FLOAT_TO_FX32(SIN((u16) (this->mAngle.angle_s - 0x8000))); - vec.y = (fx16) FLOAT_TO_FX32(0.0f); - vec.z = (fx16) FLOAT_TO_FX32(COS((u16) (this->mAngle.angle_s - 0x8000))); + vec.x = (fx16) FX_F32_TO_FX32(SIN((u16) (this->mAngle.angle_s - 0x8000))); + vec.y = (fx16) FX_F32_TO_FX32(0.0f); + vec.z = (fx16) FX_F32_TO_FX32(COS((u16) (this->mAngle.angle_s - 0x8000))); data_027e0cec->func_ov000_0209feac(0x804, &pos, 0x2, 0x0, 0x0); data_027e0cec->func_ov000_0209ff24(0x805, &pos, &vec, 2); @@ -859,7 +860,7 @@ void ActorShotArrow::func_ov031_020f2f5c(VecFx32 *param1) { bool ActorShotArrow::func_ov031_020f2f9c() { VecFx32_Copy(&this->mPos, &this->mUnk_194.mUnk_0C.pos); - this->mUnk_194.mUnk_0C.size = FLOAT_TO_FX32(0.2f); + this->mUnk_194.mUnk_0C.size = FX_F32_TO_FX32(0.2f); data_027e09c0->func_ov000_0207e58c(this->mRef, 0x3, data_ov031_02110b01[this->mUnk_5C.mParams[1]], &this->mUnk_194); return true; } @@ -867,41 +868,41 @@ bool ActorShotArrow::func_ov031_020f2f9c() { // non-matching void ActorShotArrow::func_ov031_020f3000() { VecFx32 vec; - Mat3p m1; - Mat3p m2; + MtxFx33 m1; + MtxFx33 m2; - vec.x = FLOAT_TO_FX32(0.0f); - vec.y = FLOAT_TO_FX32(0.0f); - vec.z = FLOAT_TO_FX32(0.4f); + vec.x = FX_F32_TO_FX32(0.0f); + vec.y = FX_F32_TO_FX32(0.0f); + vec.z = FX_F32_TO_FX32(0.4f); - Mat3p_InitYRotation(&m1, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); - Mat3p_InitXRotation(&m2, SIN((u16) (s16) (this->mUnk_174 + this->mUnk_176)), - COS((u16) (s16) (this->mUnk_174 + this->mUnk_176))); + MtxFx33_InitYRotation(&m1, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); + MtxFx33_InitXRotation(&m2, SIN((u16) (s16) (this->mUnk_174 + this->mUnk_176)), + COS((u16) (s16) (this->mUnk_174 + this->mUnk_176))); func_01ffa60c(&m2, &m1, &m1); func_01ffa7a0(&vec, &m1, &vec); - vec.y = MUL_FX32(vec.y, 0x800); + vec.y = FX_MUL(vec.y, 0x800); VecFx32_Add(&vec, &this->mPos, &vec); VecFx32_Copy(&vec, &this->mUnk_1DC.mUnk_00); } -void ActorShotArrow::func_ov031_020f311c(Mat4x3p *param1) { - Mat4x3p m1; - Mat4x3p m2; +void ActorShotArrow::func_ov031_020f311c(MtxFx43 *param1) { + MtxFx43 m1; + MtxFx43 m2; UNSET_FLAG(this->mFlags, ActorFlag_Visible); this->mUnk_224 = param1; if (param1 != NULL) { - Mat4x3p_InitXRotation(&m1, SIN((u16) this->mUnk_176), COS((u16) this->mUnk_176)); - Mat4x3p_InitYRotation(&m2, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); + MtxFx43_InitXRotation(&m1, SIN((u16) this->mUnk_176), COS((u16) this->mUnk_176)); + MtxFx43_InitYRotation(&m2, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); func_01ffad5c(&m1, &m2, &m1); - VecFx32_Copy(&this->mPos, &m1.wColumn); + VecFx32_Copy(&this->mPos, (VecFx32 *) &m1._30); func_01ffad5c(this->mUnk_224, &data_027e0964, &m2); func_01ffa9e8(&m2, &m2); @@ -947,9 +948,9 @@ bool ActorShotArrow::func_ov031_020f3258(u16 param1) { ActorShotArrow_178::ActorShotArrow_178(ActorShotArrow *param1) { this->mUnk_08 = param1; - this->mUnk_0C.x = FLOAT_TO_FX32(0.0f); - this->mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_0C.z = FLOAT_TO_FX32(0.0f); + this->mUnk_0C.x = FX_F32_TO_FX32(0.0f); + this->mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_0C.z = FX_F32_TO_FX32(0.0f); this->mUnk_18 = 0; } @@ -958,7 +959,7 @@ ActorShotArrow_178::~ActorShotArrow_178() { } void ActorShotArrow_178::func_ov031_020f3304() { - this->mUnk_18 = FLOAT_TO_FX32(0.0f); + this->mUnk_18 = FX_F32_TO_FX32(0.0f); } // non-matching @@ -1009,15 +1010,15 @@ void ActorShotArrow_194::func_ov031_020f374c(Actor *actor) { unk32 temp = func_01ff9258(stack.mUnk_00.x, stack.mUnk_00.z); //! @bug: stack.mUnk_18 is used uninitialized? - if (temp > stack.mUnk_0C.size && stack.mUnk_0C.size > FLOAT_TO_FX32(0.15f)) { - fx32 temp_r5 = (temp - stack.mUnk_0C.size) + FLOAT_TO_FX32(0.15f); + if (temp > stack.mUnk_0C.size && stack.mUnk_0C.size > FX_F32_TO_FX32(0.15f)) { + fx32 temp_r5 = (temp - stack.mUnk_0C.size) + FX_F32_TO_FX32(0.15f); u16 value = (u32) (s16) (s32) func_01ffbbe0(stack.mUnk_00.x, stack.mUnk_00.z); fx16 sin = SIN(value); fx16 cos = COS(value); - stack.mUnk_28.x += MUL_FX32(sin, temp_r5); - stack.mUnk_28.z += MUL_FX32(cos, temp_r5); + stack.mUnk_28.x += FX_MUL(sin, temp_r5); + stack.mUnk_28.z += FX_MUL(cos, temp_r5); } this->mUnk_2C->func_ov031_020f2f5c(&stack.mUnk_28); diff --git a/src/031_Land/Actor/ActorUnkEFSB.cpp b/src/031_Land/Actor/ActorUnkEFSB.cpp index 1cffe1df..875ef0c5 100644 --- a/src/031_Land/Actor/ActorUnkEFSB.cpp +++ b/src/031_Land/Actor/ActorUnkEFSB.cpp @@ -54,11 +54,11 @@ void ActorUnkEFSB::vfunc_54(unk32 param1) { void ActorUnkEFSB::vfunc_2C(Actor_vfunc_30 *param1) { VecFx32 vec; - VecFx32_Init(FLOAT_TO_FX32(1.0f), FLOAT_TO_FX32(1.0f), FLOAT_TO_FX32(1.0f), &vec); + VecFx32_Init(FX_F32_TO_FX32(1.0f), FX_F32_TO_FX32(1.0f), FX_F32_TO_FX32(1.0f), &vec); vec.z = func_01ffb428(this->mUnk_1B0, 0x8000); VecFx32 sp0 = this->mPos; - sp0.y += FLOAT_TO_FX32(0.85f); + sp0.y += FX_F32_TO_FX32(0.85f); this->mUnk_098.func_01ffc634(&vec, this->mAngle, &sp0); } diff --git a/src/031_Land/Actor/ActorUnkFLEN.cpp b/src/031_Land/Actor/ActorUnkFLEN.cpp index 57da0cf8..76a106f7 100644 --- a/src/031_Land/Actor/ActorUnkFLEN.cpp +++ b/src/031_Land/Actor/ActorUnkFLEN.cpp @@ -12,7 +12,7 @@ Actor *ActorProfileUnkFLEN::Create() { ActorProfileUnkFLEN::ActorProfileUnkFLEN() : ActorProfile(ActorId_FLEN) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.0f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.0f)); } ActorUnkFLEN::ActorUnkFLEN() : @@ -86,7 +86,7 @@ bool ActorUnkFLEN::func_ov031_020f81f8() { actorParams.mInitialAngle = this->mAngle.angle_s; VecFx32_Copy(&this->mPos, &actorParams.mInitialPos); - actorParams.mInitialPos.y += FLOAT_TO_FX32(5.0f); + actorParams.mInitialPos.y += FX_F32_TO_FX32(5.0f); u16 index = this->mUnk_5C.mParams[0]; actorParams.mParams[0] = data_ov031_02110b90[index]; diff --git a/src/031_Land/Actor/ActorUnkNFSP.cpp b/src/031_Land/Actor/ActorUnkNFSP.cpp index cdb40d4d..bee0611f 100644 --- a/src/031_Land/Actor/ActorUnkNFSP.cpp +++ b/src/031_Land/Actor/ActorUnkNFSP.cpp @@ -8,7 +8,7 @@ class ActorUnkNFSP_vfunc_54 : public Actor { public: /* 000 (base) */ - /* 094 */ STRUCT_PAD(0x94, 0x2B0); + /* 094 */ PAD(0x94, 0x2B0); /* 2B0 */ unk32 mUnk_2B0; /* 2B4 */ }; @@ -16,7 +16,7 @@ public: class ActorUnkNFSP_ov031_020fb9b4 : public Actor { public: /* 00 (base) */ - /* 94 */ STRUCT_PAD(0x94, 0xE8); + /* 94 */ PAD(0x94, 0xE8); /* E8 */ VecFx32 mUnk_E8; /* F4 */ }; @@ -31,7 +31,7 @@ Actor *ActorProfileUnkNFSP::Create() { ActorProfileUnkNFSP::ActorProfileUnkNFSP() : ActorProfile_Derived1(ActorId_NFSP) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.4f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.4f)); } ActorUnkNFSP::ActorUnkNFSP() : @@ -107,7 +107,7 @@ void ActorUnkNFSP::func_ov031_020fb9b4() { VecFx32 vec = actor->mUnk_E8; data_027e0ce0->func_01fff148(0x0); - vec.z -= FLOAT_TO_FX32(1.0f); + vec.z -= FX_F32_TO_FX32(1.0f); VecFx32_Copy(&vec, &this->mPos); #if IS_JP diff --git a/src/031_Land/Actor/ActorUnkRMTG.cpp b/src/031_Land/Actor/ActorUnkRMTG.cpp index 203bbd6f..e92b7c78 100644 --- a/src/031_Land/Actor/ActorUnkRMTG.cpp +++ b/src/031_Land/Actor/ActorUnkRMTG.cpp @@ -20,8 +20,8 @@ ActorUnkRMTG::ActorUnkRMTG() : mUnk_94(NULL) {} bool ActorUnkRMTG::Init(unk32 param1) { - this->mPos.x -= FLOAT_TO_FX32(0.5f); - this->mPos.z -= FLOAT_TO_FX32(0.5f); + this->mPos.x -= FX_F32_TO_FX32(0.5f); + this->mPos.z -= FX_F32_TO_FX32(0.5f); UnkStruct_027e0cd8_0C_Base *data = data_027e0cd8->mUnk_0C; diff --git a/src/031_Land/Actor/ActorUnkROCK.cpp b/src/031_Land/Actor/ActorUnkROCK.cpp index f0e6c769..70c2e3a7 100644 --- a/src/031_Land/Actor/ActorUnkROCK.cpp +++ b/src/031_Land/Actor/ActorUnkROCK.cpp @@ -6,7 +6,7 @@ #include "Unknown/UnkStruct_027e09b4.hpp" #include "Unknown/UnkStruct_027e09c0.hpp" -extern "C" Mat3p data_027e0130; +extern "C" MtxFx33 data_027e0130; static MapObject_10_Pot data_ov031_021166b8; @@ -19,10 +19,10 @@ Actor *ActorProfileUnkROCK::Create() { // non-matching ActorProfileUnkROCK::ActorProfileUnkROCK() : ActorProfileUnkROCK_Base(ActorId_ROCK) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.5f)); - VecFx32_Init(FLOAT_TO_FX32(7.0017f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_D8.mUnk_0C); - this->mUnk_D8.mUnk_18 = FLOAT_TO_FX32(0.6f); - this->mUnk_D8.mUnk_1C = FLOAT_TO_FX32(1.2f); + this->mUnk_04.Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.5f)); + VecFx32_Init(FX_F32_TO_FX32(7.0017f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_D8.mUnk_0C); + this->mUnk_D8.mUnk_18 = FX_F32_TO_FX32(0.6f); + this->mUnk_D8.mUnk_1C = FX_F32_TO_FX32(1.2f); } ActorUnkROCK::ActorUnkROCK() : @@ -96,10 +96,10 @@ void ActorUnkROCK::vfunc_2C(Actor_vfunc_30 *param1) { return; } VecFx32 vecSp18; - VecFx32_Init(FLOAT_TO_FX32(1.2f), FLOAT_TO_FX32(1.2f), FLOAT_TO_FX32(1.2f), &vecSp18); + VecFx32_Init(FX_F32_TO_FX32(1.2f), FX_F32_TO_FX32(1.2f), FX_F32_TO_FX32(1.2f), &vecSp18); VecFx32 vecSp0C = this->mPos; - vecSp0C.y += FLOAT_TO_FX32(0.8f); + vecSp0C.y += FX_F32_TO_FX32(0.8f); this->mUnk_94.vfunc_10(&vecSp18, &data_027e0130, &vecSp0C); diff --git a/src/031_Land/Actor/ActorUnkSCCN.cpp b/src/031_Land/Actor/ActorUnkSCCN.cpp index cd2d109f..670f4f5d 100644 --- a/src/031_Land/Actor/ActorUnkSCCN.cpp +++ b/src/031_Land/Actor/ActorUnkSCCN.cpp @@ -35,7 +35,7 @@ bool ActorUnkSCCN::Init(unk32 param1) { this->mPos.y = data_0C->vfunc_28(&this->mPos, 0x1, 0x0); VecFx32 vec3; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &vec3); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &vec3); vec3.x = -this->mPos.x; vec3.z = -this->mPos.z; diff --git a/src/031_Land/Actor/ActorUnkSKDO.cpp b/src/031_Land/Actor/ActorUnkSKDO.cpp index e94a3a05..76cd47be 100644 --- a/src/031_Land/Actor/ActorUnkSKDO.cpp +++ b/src/031_Land/Actor/ActorUnkSKDO.cpp @@ -26,7 +26,7 @@ bool ActorUnkSKDO::Init(unk32 param1) { void ActorUnkSKDO::Setup() { ActorUnkSKDO_ov031_02115ce8 stack(MapObjectId_SKDI); stack.mUnk_08 = this->mPos; - stack.mUnk_14 = FLOAT_TO_FX32(2.0f); + stack.mUnk_14 = FX_F32_TO_FX32(2.0f); MapObject **mapObject = gpMapObjManager->func_01fff520(&stack, gpMapObjManager->mMapObjTable); diff --git a/src/031_Land/Actor/ActorUnkSWBM.cpp b/src/031_Land/Actor/ActorUnkSWBM.cpp index 54a0053e..2e6684ab 100644 --- a/src/031_Land/Actor/ActorUnkSWBM.cpp +++ b/src/031_Land/Actor/ActorUnkSWBM.cpp @@ -16,10 +16,11 @@ struct UnkStruct_ov031_020e5d18_00 { extern "C" void func_01ffe6c4(Actor **, ActorRef, VecFx32 *, VecFx32 *, s32, VecFx32 *, UnkStruct_ov031_Items_00_Base *); extern "C" bool func_ov000_02080998(VecFx32 *); -extern "C" void /*GX_*/ func_02024a84(Mat3p *param1); +extern "C" void /*GX_*/ func_02024a84(MtxFx33 *param1); extern "C" void FlushGfxQueue(); -static const Cylinder data_ov031_02113114(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.35f)); +static const Cylinder data_ov031_02113114(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), + FX_F32_TO_FX32(0.35f)); // non-matching bool ActorUnkSWBM_94::vfunc_08(const UnkStruct_ov031_020f3310 *param1, unk32 param2) { @@ -39,7 +40,7 @@ bool ActorUnkSWBM_98::vfunc_0C(Actor *param1, VecFx32 *vector) { u16 angle = this->mUnk_2C->mAngle.angle_s; vector->x = SIN(angle); - vector->y = FLOAT_TO_FX32(0.0f); + vector->y = FX_F32_TO_FX32(0.0f); vector->z = COS(angle); return retValue; } @@ -74,10 +75,10 @@ void ActorUnkSWBM_C8::vfunc_00(unk32 param1, unk32 param2) { } REG_GFX_FIFO_TEXTURE_PALETTE = ((u32) (textureParam[0x8].y << 0x10) >> 0xD) >> (4 - var_r2); - Mat3p mat; + MtxFx33 mat; u16 angle = actor->mAngle.angle_s; - Mat3p_InitYRotation(&mat, SIN(angle), COS(angle)); + MtxFx33_InitYRotation(&mat, SIN(angle), COS(angle)); s16 var_r8 = 0xB33; s32 var_r9 = 0x1F - ((0xE - actor->mUnk_0E0) * 2); @@ -104,8 +105,8 @@ Actor *ActorProfileUnkSWBM::Create() { ActorProfileUnkSWBM::ActorProfileUnkSWBM() : ActorProfile(ActorId_SWBM) { - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_04.pos); - this->mUnk_04.size = FLOAT_TO_FX32(0.35f); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_04.pos); + this->mUnk_04.size = FX_F32_TO_FX32(0.35f); } ActorUnkSWBM::ActorUnkSWBM() : @@ -125,11 +126,11 @@ bool ActorUnkSWBM::Init(unk32 param1) { this->mUnk_34 = (Cylinder *) &data_ov031_02113114; VecFx32_Copy(&this->mPos, &this->mUnk_098.mUnk_0C.pos); - this->mUnk_098.mUnk_0C.size = FLOAT_TO_FX32(0.35f); + this->mUnk_098.mUnk_0C.size = FX_F32_TO_FX32(0.35f); - this->mVel.x = MUL_FX32(SIN((u16) this->mAngle.angle_s), 0xB33); - this->mVel.z = MUL_FX32(COS((u16) this->mAngle.angle_s), 0xB33); - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_MUL(SIN((u16) this->mAngle.angle_s), 0xB33); + this->mVel.z = FX_MUL(COS((u16) this->mAngle.angle_s), 0xB33); + this->mVel.y = FX_F32_TO_FX32(0.0f); return true; } @@ -165,7 +166,7 @@ void ActorUnkSWBM::func_ov031_020e6d80(unk32 param1) { s16 angle = this->mAngle.angle_s - DEG_TO_ANG(180); vecSp08.x = SIN((u16) angle); - vecSp08.y = FLOAT_TO_FX32(0.0f); + vecSp08.y = FX_F32_TO_FX32(0.0f); vecSp08.z = COS((u16) angle); data_027e0cec->func_ov000_0209ff24(0x8E1, &this->mPos, &vecSp08, 0x1); @@ -272,7 +273,7 @@ void ActorUnkSWBM::vfunc_24() { } // non-matching -void ActorUnkSWBM::func_ov031_020e718c(VecFx32 *param0, Mat3p *param1, s32 param2, s16 param3, u16 param4, s16 param5) { +void ActorUnkSWBM::func_ov031_020e718c(VecFx32 *param0, MtxFx33 *param1, s32 param2, s16 param3, u16 param4, s16 param5) { if (param2 <= 0) { return; } diff --git a/src/031_Land/Actor/ActorUnkTGTZ.cpp b/src/031_Land/Actor/ActorUnkTGTZ.cpp index 5a2c3c7f..7551f38d 100644 --- a/src/031_Land/Actor/ActorUnkTGTZ.cpp +++ b/src/031_Land/Actor/ActorUnkTGTZ.cpp @@ -10,11 +10,11 @@ extern "C" bool func_01ff916c(void *, int, int); extern "C" void func_01ff9638(VecFx32 *, s16); -extern "C" void func_01ffa7a0(VecFx32 *, Mat3p *, VecFx32 *); +extern "C" void func_01ffa7a0(VecFx32 *, MtxFx33 *, VecFx32 *); extern "C" void func_ov000_02072fd0(UnkStackStruct1 *); #if IS_JP -static const Vec3p data_ov031_02116344(FLOAT_TO_FX32(1.5f), FLOAT_TO_FX32(2.0f), FLOAT_TO_FX32(0.0f)); +static const VecFx32Cpp data_ov031_02116344(FX_F32_TO_FX32(1.5f), FX_F32_TO_FX32(2.0f), FX_F32_TO_FX32(0.0f)); #else static unk32 data_ov031_02114584[0x2] = {0}; static const char *data_ov031_021145a4 = "target"; @@ -30,7 +30,7 @@ Actor *ActorProfileUnkTGTZ::Create() { ActorProfileUnkTGTZ::ActorProfileUnkTGTZ() : ActorProfile_Derived1(ActorId_TGTZ) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(2.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.5f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(2.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.5f)); } // non-matching @@ -44,14 +44,14 @@ ActorUnkTGTZ::ActorUnkTGTZ() : mUnk_1B8(0x0), mUnk_1BC(-0x1), mUnk_1C0(0, 0), - mUnk_1C4(FLOAT_TO_FX32(0.0f)), + mUnk_1C4(FX_F32_TO_FX32(0.0f)), mUnk_1CC(0x0), mUnk_1D0(0, 0), mUnk_1D4(0x0), mUnk_1D6(0x0), mUnk_1D8(false), mUnk_1DC(0x0) { - Mat3p_InitIdentity(&this->mUnk_190); + MtxFx33_InitIdentity(&this->mUnk_190); this->func_ov000_0209862c(0x0); } @@ -61,9 +61,9 @@ void ActorUnkTGTZ::func_ov031_020f6984() {} // non-matching bool ActorUnkTGTZ::Init(unk32 param1) { if (this->mUnk_5C.mUnk_1A[0] != 0x0) { - this->mPos.y = MUL_FX32(this->mUnk_5C.mUnk_1A[0] << 0xC, 0x1333); + this->mPos.y = FX_MUL(this->mUnk_5C.mUnk_1A[0] << 0xC, 0x1333); } - Mat3p_InitYRotation(&this->mUnk_190, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); + MtxFx33_InitYRotation(&this->mUnk_190, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); data_ov031_02116b58.func_ov000_0205fc20(0x5D, 0x32, NULL, NULL); ((UnkStruct_ov019_020d24c8_28_258_00 *) GET_PROFILE(ActorProfileUnkNTTZ))->func_ov000_0205fc20(0x5D, 0x31, NULL, NULL); @@ -131,7 +131,7 @@ void ActorUnkTGTZ::Update() { stack.mUnk_0C.x = this->mPos.x; stack.mUnk_0C.y = this->mPos.y; stack.mUnk_0C.z = this->mPos.z; - stack.mUnk_0C.y = this->mPos.y + FLOAT_TO_FX32(1.0f); + stack.mUnk_0C.y = this->mPos.y + FX_F32_TO_FX32(1.0f); this->mUnk_1BC = data_027e09b8->func_ov000_02073388(&stack, 0x0); this->func_ov031_020f6f20(0x1); break; @@ -206,7 +206,7 @@ void ActorUnkTGTZ::Update() { if (this->mUnk_1CC == 0x1) { ActorUnkNTTZ *actor = this->mUnk_1B4; VecFx32 vecSp0C = actor->mPos; - vecSp0C.y = this->mPos.y + this->mUnk_1C4 + FLOAT_TO_FX32(1.5f); + vecSp0C.y = this->mPos.y + this->mUnk_1C4 + FX_F32_TO_FX32(1.5f); VecFx32 vecSp00 = vecSp0C; VecFx32_Init(vecSp00.x, vecSp00.y, vecSp00.z, &actor->mPos); @@ -254,7 +254,7 @@ void ActorUnkTGTZ::func_ov031_020f6f20(unk32 param1) { switch (param1) { case 0x0: this->mUnk_1BC = -0x1; - this->mUnk_1C4 = FLOAT_TO_FX32(3.0f); + this->mUnk_1C4 = FX_F32_TO_FX32(3.0f); UNSET_FLAG(this->mFlags, ActorFlag_Visible); this->func_ov031_020f6e5c(this->mUnk_1DC); this->mUnk_1DC = 0x0; @@ -269,7 +269,7 @@ void ActorUnkTGTZ::func_ov031_020f6f20(unk32 param1) { } case 0x2: { this->mUnk_1BC = -0x1; - this->mUnk_1C4 = FLOAT_TO_FX32(0.0f); + this->mUnk_1C4 = FX_F32_TO_FX32(0.0f); SET_FLAG(this->mFlags, ActorFlag_Visible); VecFx32 vec1; @@ -281,7 +281,7 @@ void ActorUnkTGTZ::func_ov031_020f6f20(unk32 param1) { func_01ffa7a0(pVec, &this->mUnk_190, &vec1); #endif - vec1.y -= FLOAT_TO_FX32(0.5f); + vec1.y -= FX_F32_TO_FX32(0.5f); this->func_ov031_020f7358(); @@ -304,7 +304,7 @@ void ActorUnkTGTZ::func_ov031_020f6f20(unk32 param1) { break; } case 0x3: - this->mUnk_1C4 = FLOAT_TO_FX32(-1.0002f); + this->mUnk_1C4 = FX_F32_TO_FX32(-1.0002f); SET_FLAG(this->mFlags, ActorFlag_Visible); this->mUnk_1D0.Set(0, this->mUnk_1D4); break; @@ -316,7 +316,7 @@ void ActorUnkTGTZ::func_ov031_020f6f20(unk32 param1) { SET_FLAG(this->mFlags, ActorFlag_Visible); break; case 0x6: - this->mUnk_1C4 = FLOAT_TO_FX32(1.0f); + this->mUnk_1C4 = FX_F32_TO_FX32(1.0f); this->mUnk_1D0.Set(0, this->mUnk_1D6); break; default: @@ -370,10 +370,10 @@ void ActorUnkTGTZ::vfunc_2C(Actor_vfunc_30 *param1) { VecFx32 vec1; if (this->mUnk_1CC == 0x0) { - VecFx32_Init(-this->mUnk_1C4, FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &vec1); + VecFx32_Init(-this->mUnk_1C4, FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &vec1); func_01ff9638(&vec1, this->mAngle.angle_s); } else { - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &vec1); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &vec1); func_01ff9638(&vec1, this->mAngle.angle_s); vec1.y = this->mUnk_1C4; } diff --git a/src/031_Land/Actor/ActorUnkTLKT.cpp b/src/031_Land/Actor/ActorUnkTLKT.cpp index 90413b49..a3432b8d 100644 --- a/src/031_Land/Actor/ActorUnkTLKT.cpp +++ b/src/031_Land/Actor/ActorUnkTLKT.cpp @@ -144,7 +144,7 @@ void ActorUnkTLKT::vfunc_60(ActorState state) { this->mUnk_04 = data_027e09b8->func_ov000_02073388(&unkSp00, 0x0); break; case ActorUnkTLKTState_4: - data_027e0d34->func_ov031_020d9854(&this->mPos, FLOAT_TO_FX32(0.5f)); + data_027e0d34->func_ov031_020d9854(&this->mPos, FX_F32_TO_FX32(0.5f)); break; default: break; diff --git a/src/031_Land/Actor/ActorUnkZLSL_ZSRS.cpp b/src/031_Land/Actor/ActorUnkZLSL_ZSRS.cpp index 0d415543..7850b885 100644 --- a/src/031_Land/Actor/ActorUnkZLSL_ZSRS.cpp +++ b/src/031_Land/Actor/ActorUnkZLSL_ZSRS.cpp @@ -142,9 +142,9 @@ ActorProfileUnkZLSL::ActorProfileUnkZLSL() : this->mUnk_04.size = 0x666; this->mUnk_1C = 0x1000; this->mUnk_1A = 0x1800; - this->mUnk_04.pos.x = FLOAT_TO_FX32(0.0f); - this->mUnk_04.pos.z = FLOAT_TO_FX32(0.0f); - this->mUnk_04.pos.y = FLOAT_TO_FX32(0.5f); + this->mUnk_04.pos.x = FX_F32_TO_FX32(0.0f); + this->mUnk_04.pos.z = FX_F32_TO_FX32(0.0f); + this->mUnk_04.pos.y = FX_F32_TO_FX32(0.5f); this->mUnk_18 = 0x0; } @@ -212,14 +212,14 @@ void ActorUnkZLSL::func_ov031_020ea7a8() { VecFx32_Copy(&this->mPos, &this->mUnk_2878); - this->mUnk_2888 = FLOAT_TO_FX32(0.0f); + this->mUnk_2888 = FX_F32_TO_FX32(0.0f); this->mUnk_288C = 0x0; this->mUnk_2C = 0x0; this->mUnk_286A = 0x0; this->mUnk_286C = 0x0; - this->mUnk_28B0.x = FLOAT_TO_FX32(0.0f); - this->mUnk_28B0.y = FLOAT_TO_FX32(0.0f); - this->mUnk_28B0.z = FLOAT_TO_FX32(0.0f); + this->mUnk_28B0.x = FX_F32_TO_FX32(0.0f); + this->mUnk_28B0.y = FX_F32_TO_FX32(0.0f); + this->mUnk_28B0.z = FX_F32_TO_FX32(0.0f); this->mUnk_28BC = 0x0; this->mUnk_28C0 = 0x0; this->mUnk_28C4 = 0x0; @@ -300,8 +300,8 @@ void ActorUnkZLSL::Update() { } void ActorUnkZLSL::func_ov031_020eaa68() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->vfunc_98(0x0); } @@ -310,10 +310,10 @@ void ActorUnkZLSL::func_ov031_020eaa68() { void ActorUnkZLSL::func_ov031_020eaa88() {} void ActorUnkZLSL::func_ov031_020eaa8c() { - this->mUnk_2890 = FLOAT_TO_FX32(0.0f); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mUnk_2890 = FX_F32_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_2900 |= 0x1; if ((this->mUnk_2900 & 0x4) != 0x0) { @@ -344,24 +344,24 @@ void ActorUnkZLSL::func_ov031_020eab40(unk32 param1) { VecFx32 oVec; func_01ffb714(&this->mPos, pVec, &oVec); - oVec.y = FLOAT_TO_FX32(0.0f); + oVec.y = FX_F32_TO_FX32(0.0f); VecFx32_TryNormalize(&oVec); func_01ff93c0(&oVec, param1); - oVec.y += FLOAT_TO_FX32(0.5f); + oVec.y += FX_F32_TO_FX32(0.5f); VecFx32_Add(&vec, &oVec, &vec); func_01ffb714(&vec, &this->mPos, &oVec); - func_01ff93c0(&oVec, FLOAT_TO_FX32(0.05f)); + func_01ff93c0(&oVec, FX_F32_TO_FX32(0.05f)); VecFx32_Add(&this->mVel, &oVec, &this->mVel); - func_01ff93c0(&this->mVel, FLOAT_TO_FX32(0.8f)); + func_01ff93c0(&this->mVel, FX_F32_TO_FX32(0.8f)); - if (VecFx32_Length(&this->mVel) > FLOAT_TO_FX32(0.1001f)) { + if (VecFx32_Length(&this->mVel) > FX_F32_TO_FX32(0.1001f)) { VecFx32_TryNormalize(&this->mVel); - func_01ff93c0(&this->mVel, FLOAT_TO_FX32(0.1001f)); + func_01ff93c0(&this->mVel, FX_F32_TO_FX32(0.1001f)); } VecFx32 *pVec2 = this->func_ov000_0209853c(0x0); @@ -371,9 +371,9 @@ void ActorUnkZLSL::func_ov031_020eab40(unk32 param1) { void ActorUnkZLSL::func_ov031_020eac64() { this->mUnk_2884 = 0x0; this->mUnk_2888 = this->mPos.y; - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_0B0 |= 0x1; if ((this->mUnk_0B0 & 0x2) != 0x0) { @@ -394,9 +394,9 @@ void ActorUnkZLSL::func_ov031_020eace0() { void ActorUnkZLSL::func_ov031_020ead0c() { this->mUnk_2888 = this->mPos.y; - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); if (this->mUnk_094.mUnk_0C->vfunc_30() != 0x1) { if (this->mUnk_094.mUnk_0C->vfunc_30() != 0x0) { @@ -428,13 +428,13 @@ void ActorUnkZLSL::func_ov031_020ead7c() { this->mUnk_28E4 = this->func_ov031_020ee2c8(); this->func_ov031_020ec6d8(true); - this->mUnk_28A4.x = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.y = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.z = FLOAT_TO_FX32(0.0f); + this->mUnk_28A4.x = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.y = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.z = FX_F32_TO_FX32(0.0f); this->mUnk_2884 = 0x0; - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mTimer.Set(0, 10); this->mUnk_2884 = 0x0; this->mUnk_2888 = 0x0; @@ -475,10 +475,10 @@ void ActorUnkZLSL::func_ov031_020eb188() { func_02015300(&this->mUnk_094.mUnk_0C->vfunc_10()->mUnk_04); this->mUnk_4A[0] = 0x0; - this->mUnk_2888 = FLOAT_TO_FX32(0.3f); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.y = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mUnk_2888 = FX_F32_TO_FX32(0.3f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_2900 |= 0x1; VecFx32_Copy(&this->mPos, &this->mUnk_2878); } @@ -514,15 +514,15 @@ bool ActorUnkZLSL::func_ov031_020eb2b0(VecFx32 *param1, unk32 param2) { } void ActorUnkZLSL::func_ov031_020eb5f8() { - this->mUnk_28A4.x = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.y = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.z = FLOAT_TO_FX32(0.0f); + this->mUnk_28A4.x = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.y = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.z = FX_F32_TO_FX32(0.0f); this->func_ov031_020ec6d8(true); } class ActorUnkZLSL_020eb61ec_16C_vfunc_10 { public: - /* 00 */ STRUCT_PAD(0x00, 0x04); + /* 00 */ PAD(0x00, 0x04); /* 04 */ UnkStruct_PlayerGet_50 mUnk_04; }; @@ -542,7 +542,7 @@ public: class ActorUnkZLSL_020eb61ec : public Actor { public: /* 000 (base) */ - /* 094 */ STRUCT_PAD(0x94, 0x16C); + /* 094 */ PAD(0x94, 0x16C); /* 16C */ ActorUnkZLSL_020eb61ec_16C mUnk_16C; }; @@ -582,7 +582,7 @@ void ActorUnkZLSL::func_ov031_020eb61c() { } this->mAngle = func_02016958(&this->mPos, &vec); VecFx32_Copy(&this->mPos, &vec); - vec.y += FLOAT_TO_FX32(0.5f); + vec.y += FX_F32_TO_FX32(0.5f); VecFx32_Copy(&vec, &this->mUnk_28F4); this->func_ov031_020ed4e4(0x5, 0x93F); @@ -594,7 +594,7 @@ void ActorUnkZLSL::func_ov031_020eb61c() { this->func_ov031_020eb188(); } VecFx32_Copy(&this->mPos, &vec); - vec.y += FLOAT_TO_FX32(0.5f); + vec.y += FX_F32_TO_FX32(0.5f); VecFx32_Copy(&vec, &this->mUnk_28F4); this->func_ov031_020ed4e4(0x5, 0x93F); @@ -602,9 +602,9 @@ void ActorUnkZLSL::func_ov031_020eb61c() { case 0x4: if (this->func_ov031_020eb2b0(&actor->mPos, 0xA000)) { data_027e09a8->func_ov000_02071bd4(0x8D5B, &this->mPos, 0x0); - this->mUnk_28A4.x = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.y = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.z = FLOAT_TO_FX32(0.0f); + this->mUnk_28A4.x = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.y = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.z = FX_F32_TO_FX32(0.0f); actor->func_ov071_0215414c(); ++this->mUnk_286E; data_027e0cec->func_ov000_020a0110(&this->mUnk_2828); @@ -627,9 +627,9 @@ void ActorUnkZLSL::func_ov031_020eb61c() { case 0x6: if (this->mTimer.HasExpired()) { data_027e09b8->func_ov000_020732fc(this->mUnk_28C8); - this->mUnk_28A4.x = FLOAT_TO_FX32(1.0f); - this->mUnk_28A4.y = FLOAT_TO_FX32(1.0f); - this->mUnk_28A4.z = FLOAT_TO_FX32(1.0f); + this->mUnk_28A4.x = FX_F32_TO_FX32(1.0f); + this->mUnk_28A4.y = FX_F32_TO_FX32(1.0f); + this->mUnk_28A4.z = FX_F32_TO_FX32(1.0f); this->vfunc_58(ActorUnkZLSLState_8); } this->func_ov031_020ed4e4(0x5, 0x93F); @@ -639,9 +639,9 @@ void ActorUnkZLSL::func_ov031_020eb61c() { } void ActorUnkZLSL::func_ov031_020eba58() { - this->mUnk_28A4.x = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.y = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.z = FLOAT_TO_FX32(0.0f); + this->mUnk_28A4.x = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.y = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.z = FX_F32_TO_FX32(0.0f); this->func_ov031_020ec6d8(true); this->mUnk_0B0 |= 0x8; } @@ -735,9 +735,9 @@ void ActorUnkZLSL::func_ov031_020eba8c() { return; } - this->mUnk_28A4.x = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.y = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.z = FLOAT_TO_FX32(0.0f); + this->mUnk_28A4.x = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.y = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.z = FX_F32_TO_FX32(0.0f); actor->func_ov071_0215414c(); @@ -761,9 +761,9 @@ void ActorUnkZLSL::func_ov031_020eba8c() { } data_027e09b8->func_ov000_020732fc(this->mUnk_28C8); - this->mUnk_28A4.x = FLOAT_TO_FX32(1.0f); - this->mUnk_28A4.y = FLOAT_TO_FX32(1.0f); - this->mUnk_28A4.z = FLOAT_TO_FX32(1.0f); + this->mUnk_28A4.x = FX_F32_TO_FX32(1.0f); + this->mUnk_28A4.y = FX_F32_TO_FX32(1.0f); + this->mUnk_28A4.z = FX_F32_TO_FX32(1.0f); this->vfunc_58(ActorUnkZLSLState_8); break; @@ -773,9 +773,9 @@ void ActorUnkZLSL::func_ov031_020eba8c() { } void ActorUnkZLSL::func_ov031_020ebfd8() { - this->mUnk_28A4.x = FLOAT_TO_FX32(1.0f); - this->mUnk_28A4.y = FLOAT_TO_FX32(1.0f); - this->mUnk_28A4.z = FLOAT_TO_FX32(1.0f); + this->mUnk_28A4.x = FX_F32_TO_FX32(1.0f); + this->mUnk_28A4.y = FX_F32_TO_FX32(1.0f); + this->mUnk_28A4.z = FX_F32_TO_FX32(1.0f); this->func_ov031_020ec6d8(false); this->mAngle = func_02016958(&this->mPos, this->func_ov000_0209853c(0x0)); this->func_ov031_020eb188(); @@ -786,8 +786,8 @@ void ActorUnkZLSL::func_ov031_020ec028() { } void ActorUnkZLSL::func_ov031_020ec034() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->vfunc_98(0x1); } @@ -795,8 +795,8 @@ void ActorUnkZLSL::func_ov031_020ec034() { void ActorUnkZLSL::func_ov031_020ec058() {} void ActorUnkZLSL::func_ov031_020ec05c() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); if (this->func_ov000_020a9248(0x2000) == 0x0) { this->vfunc_98(0x1); @@ -813,9 +813,9 @@ void ActorUnkZLSL::func_ov031_020ec0a8() { } void ActorUnkZLSL::func_ov031_020ec0d4() { - this->mUnk_28A4.x = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.y = FLOAT_TO_FX32(0.0f); - this->mUnk_28A4.z = FLOAT_TO_FX32(0.0f); + this->mUnk_28A4.x = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.y = FX_F32_TO_FX32(0.0f); + this->mUnk_28A4.z = FX_F32_TO_FX32(0.0f); UNSET_FLAG(this->mFlags, ActorFlag_Visible); @@ -849,18 +849,18 @@ void ActorUnkZLSL::func_ov031_020ec170() { } void ActorUnkZLSL::vfunc_2C(Actor_vfunc_30 *param1) { - Mat3p sp00; - if (this->mUnk_28A4.x == FLOAT_TO_FX32(0.0f) && this->mUnk_28A4.y == FLOAT_TO_FX32(0.0f) && - this->mUnk_28A4.z == FLOAT_TO_FX32(0.0f)) { + MtxFx33 sp00; + if (this->mUnk_28A4.x == FX_F32_TO_FX32(0.0f) && this->mUnk_28A4.y == FX_F32_TO_FX32(0.0f) && + this->mUnk_28A4.z == FX_F32_TO_FX32(0.0f)) { return; } switch (this->mUnk_2874) { case false: - Mat3p_InitYRotation(&sp00, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); + MtxFx33_InitYRotation(&sp00, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); this->mUnk_1620.vfunc_10(&this->mUnk_28A4, &sp00, &this->mPos); break; case true: - Mat3p_InitYRotation(&sp00, SIN(1), COS(0)); + MtxFx33_InitYRotation(&sp00, SIN(1), COS(0)); this->mUnk_276C.vfunc_10(&this->mUnk_28A4, &sp00, &this->mPos); break; default: @@ -1031,7 +1031,7 @@ void ActorUnkZLSL::func_ov031_020ec6d8(bool param1) { } void ActorUnkZLSL::vfunc_6C() { - if (!this->mUnk_2874 && this->mUnk_28A4.z == FLOAT_TO_FX32(1.0f)) { + if (!this->mUnk_2874 && this->mUnk_28A4.z == FX_F32_TO_FX32(1.0f)) { this->vfunc_58(ActorUnkZLSLState_4); return; } @@ -1039,7 +1039,7 @@ void ActorUnkZLSL::vfunc_6C() { } void ActorUnkZLSL::vfunc_70() { - if (!this->mUnk_2874 && this->mUnk_28A4.z == FLOAT_TO_FX32(1.0f)) { + if (!this->mUnk_2874 && this->mUnk_28A4.z == FX_F32_TO_FX32(1.0f)) { this->vfunc_58(ActorUnkZLSLState_4); return; } @@ -1064,7 +1064,7 @@ bool ActorUnkZLSL::vfunc_88() { if (this->func_ov031_020ee724()) { return true; } - if (!this->mUnk_2874 && this->mUnk_28A4.z == FLOAT_TO_FX32(1.0f)) { + if (!this->mUnk_2874 && this->mUnk_28A4.z == FX_F32_TO_FX32(1.0f)) { return true; } if (this->mState != ActorUnkZLSLState_10) { @@ -1159,9 +1159,9 @@ void ActorUnkZLSL::func_ov031_020ecbe0() { func_01fff17c(sp, data_027e0ce0, 0x0); - sp[1] = sp[0] + FLOAT_TO_FX32(2.6668f); + sp[1] = sp[0] + FX_F32_TO_FX32(2.6668f); func_020169d4(&this->mPos, this->func_ov000_0209853c(0x0), ((fx16 *) sp + 1), data_ov031_021135f4); - this->mPos.y += FLOAT_TO_FX32(0.5f); + this->mPos.y += FX_F32_TO_FX32(0.5f); this->mPrevPos.x = this->mPos.x; this->mPrevPos.y = this->mPos.y; this->mPrevPos.z = this->mPos.z; @@ -1173,7 +1173,7 @@ extern "C" unk32 func_01ffb9cc(VecFx32 *, VecFx32 *); class ActorUnkZLSL_020ecc68 : public Actor { public: /* 000 (base) */ - /* 094 */ STRUCT_PAD(0x94, 0x530); + /* 094 */ PAD(0x94, 0x530); /* 530 */ unk32 mUnk_530; }; @@ -1320,7 +1320,7 @@ void ActorUnkZLSL::vfunc_A4() { } VecFx32 sp00 = this->mPos; - sp00.y = sp00.y + this->mYOffset - FLOAT_TO_FX32(0.5f); + sp00.y = sp00.y + this->mYOffset - FX_F32_TO_FX32(0.5f); func_01ffb714(&sp0C, &sp00, &sp0C); int angle = this->mAngle.angle_s; diff --git a/src/031_Land/MapObject/MapObjectBombFlower.cpp b/src/031_Land/MapObject/MapObjectBombFlower.cpp index c52f8453..236a2fe9 100644 --- a/src/031_Land/MapObject/MapObjectBombFlower.cpp +++ b/src/031_Land/MapObject/MapObjectBombFlower.cpp @@ -38,15 +38,15 @@ MapObjectBombFlower::MapObjectBombFlower() : SET_FLAG(this->mFlags, MapObjFlag_8); if (this->mUnk_20.mParams[1] == 0x1) { - this->mPos.x += FLOAT_TO_FX32(0.5f); + this->mPos.x += FX_F32_TO_FX32(0.5f); } this->mUnk_40 = ActorId_Bomb; this->mUnk_C0.mUnk_08 = (unk32) 0x80007006; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_C0.mUnk_0C); - this->mUnk_C0.mUnk_18 = FLOAT_TO_FX32(0.5f); - this->mUnk_C0.mUnk_1C = FLOAT_TO_FX32(1.2f); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_C0.mUnk_0C); + this->mUnk_C0.mUnk_18 = FX_F32_TO_FX32(0.5f); + this->mUnk_C0.mUnk_1C = FX_F32_TO_FX32(1.2f); this->mUnk_10 = &this->mUnk_C0; SET_FLAG(this->mFlags, MapObjFlag_6); @@ -175,7 +175,7 @@ bool MapObjectBombFlower::SetState(MapObjState state, unk32 param2) { this->mUnk_C0.mUnk_04 &= 0xFD; this->mUnk_C0.mUnk_08 |= 0xA800000; UNSET_FLAG(this->mFlags, MapObjFlag_9); - this->mUnk_B4 = FLOAT_TO_FX32(0.0f); + this->mUnk_B4 = FX_F32_TO_FX32(0.0f); this->mUnk_B8.Set(0, 180); break; @@ -189,7 +189,7 @@ bool MapObjectBombFlower::SetState(MapObjState state, unk32 param2) { this->mUnk_C0.mUnk_04 |= 0x2; this->mUnk_C0.mUnk_08 &= ~0xA800000; SET_FLAG(this->mFlags, MapObjFlag_9); - this->mUnk_B4 = FLOAT_TO_FX32(1.0f); + this->mUnk_B4 = FX_F32_TO_FX32(1.0f); break; case MapObjBombFlowerState_3: diff --git a/src/031_Land/MapObject/MapObjectChestBase.cpp b/src/031_Land/MapObject/MapObjectChestBase.cpp index d1e618d7..48e0973b 100644 --- a/src/031_Land/MapObject/MapObjectChestBase.cpp +++ b/src/031_Land/MapObject/MapObjectChestBase.cpp @@ -109,23 +109,23 @@ void MapObjectChestBase::Setup() { pUVar5 = data_027e0cd8->mUnk_0C; - sp48.x = FLOAT_TO_FX32(0.0f); - sp48.y = FLOAT_TO_FX32(0.0f); - sp48.z = FLOAT_TO_FX32(0.0f); + sp48.x = FX_F32_TO_FX32(0.0f); + sp48.y = FX_F32_TO_FX32(0.0f); + sp48.z = FX_F32_TO_FX32(0.0f); - sp3C.x = FLOAT_TO_FX32(0.0f); - sp3C.y = FLOAT_TO_FX32(0.0f); - sp3C.z = FLOAT_TO_FX32(0.0f); + sp3C.x = FX_F32_TO_FX32(0.0f); + sp3C.y = FX_F32_TO_FX32(0.0f); + sp3C.z = FX_F32_TO_FX32(0.0f); - sp18.x = FLOAT_TO_FX32(0.5f); - sp18.y = FLOAT_TO_FX32(0.0f); - sp18.z = FLOAT_TO_FX32(0.5f); + sp18.x = FX_F32_TO_FX32(0.5f); + sp18.y = FX_F32_TO_FX32(0.0f); + sp18.z = FX_F32_TO_FX32(0.5f); func_01ffb714(&sp48, &sp18, &sp48); - spC.x = FLOAT_TO_FX32(0.5f); - spC.y = FLOAT_TO_FX32(1.0f); - spC.z = FLOAT_TO_FX32(0.5f); + spC.x = FX_F32_TO_FX32(0.5f); + spC.y = FX_F32_TO_FX32(1.0f); + spC.z = FX_F32_TO_FX32(0.5f); VecFx32_Add((VecFx32 *) &sp3C, &spC, (VecFx32 *) &sp3C); @@ -138,12 +138,12 @@ void MapObjectChestBase::Setup() { temp_r0.x--; if (pUVar5->func_01ffedf4((Vec2bCpp *) &temp_r0) > iVar2 || gpMapObjManager->func_01fff498(local_5e) != NULL) { - sp48.x -= FLOAT_TO_FX32(0.5f); + sp48.x -= FX_F32_TO_FX32(0.5f); } temp_r0.x += 3; if (pUVar5->func_01ffedf4((Vec2bCpp *) &temp_r0) > iVar2 || gpMapObjManager->func_01fff498(local_5e) != NULL) { - sp3C.x += FLOAT_TO_FX32(0.5f); + sp3C.x += FX_F32_TO_FX32(0.5f); } } else { Vec2bCpp temp_r0(this->mUnk_3A.x, this->mUnk_3A.y); @@ -154,12 +154,12 @@ void MapObjectChestBase::Setup() { // local_5e.y += 2; if (gpMapObjManager->func_ov000_0209c3a8(&temp_r0) == MapObjectId_MiniBlocks) { - sp48.x -= FLOAT_TO_FX32(0.5f); + sp48.x -= FX_F32_TO_FX32(0.5f); } // temp_r0.x += 3; if (gpMapObjManager->func_ov000_0209c3a8(&temp_r0) == MapObjectId_MiniBlocks) { - sp3C.x += FLOAT_TO_FX32(0.5f); + sp3C.x += FX_F32_TO_FX32(0.5f); } } @@ -167,7 +167,7 @@ void MapObjectChestBase::Setup() { if (gpMapObjManager->func_ov000_0209c3a8(&local_62) == MapObjectId_MiniBlocks && iVar2 == pUVar5->func_01ffedf4(&local_62)) { - sp48.z -= FLOAT_TO_FX32(0.5f); + sp48.z -= FX_F32_TO_FX32(0.5f); } if (data_027e09a4->CurrentSceneIndex() == SceneIndex_d_flame) { @@ -178,7 +178,7 @@ void MapObjectChestBase::Setup() { local_64.y = local_66.y - 1; if (iVar2 > pUVar5->func_01ffedf4(&local_64) && iVar2 > pUVar5->func_01ffedf4(&local_66)) { - sp3C.y += FLOAT_TO_FX32(1.0f); + sp3C.y += FX_F32_TO_FX32(1.0f); } } diff --git a/src/031_Land/MapObject/MapObjectDoorBase.cpp b/src/031_Land/MapObject/MapObjectDoorBase.cpp index 9c3f6caa..353d3f1d 100644 --- a/src/031_Land/MapObject/MapObjectDoorBase.cpp +++ b/src/031_Land/MapObject/MapObjectDoorBase.cpp @@ -27,30 +27,30 @@ UnkStruct_ov031_02117210 data_ov031_02117210; UnkStruct_ov019_020d24c8_28_258_00 data_ov031_02117204(NULL, 0); UnkStruct_ov031_02117210::UnkStruct_ov031_02117210() { - this->mUnk_00[0].mUnk_0C.x = -FLOAT_TO_FX32(1.0f); - this->mUnk_00[0].mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_00[0].mUnk_0C.z = -FLOAT_TO_FX32(0.35f); - this->mUnk_00[0].mUnk_18.x = FLOAT_TO_FX32(1.0f); - this->mUnk_00[0].mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_00[0].mUnk_18.z = FLOAT_TO_FX32(0.35f); + this->mUnk_00[0].mUnk_0C.x = -FX_F32_TO_FX32(1.0f); + this->mUnk_00[0].mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_00[0].mUnk_0C.z = -FX_F32_TO_FX32(0.35f); + this->mUnk_00[0].mUnk_18.x = FX_F32_TO_FX32(1.0f); + this->mUnk_00[0].mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_00[0].mUnk_18.z = FX_F32_TO_FX32(0.35f); this->mUnk_00[0].mUnk_04 &= 0xFE; this->mUnk_00[0].mUnk_08 = 0x7009; - this->mUnk_00[1].mUnk_0C.x = -FLOAT_TO_FX32(1.0f); - this->mUnk_00[1].mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_00[1].mUnk_0C.z = -FLOAT_TO_FX32(1.35f); - this->mUnk_00[1].mUnk_18.x = FLOAT_TO_FX32(1.0f); - this->mUnk_00[1].mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_00[1].mUnk_18.z = FLOAT_TO_FX32(0.35f); + this->mUnk_00[1].mUnk_0C.x = -FX_F32_TO_FX32(1.0f); + this->mUnk_00[1].mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_00[1].mUnk_0C.z = -FX_F32_TO_FX32(1.35f); + this->mUnk_00[1].mUnk_18.x = FX_F32_TO_FX32(1.0f); + this->mUnk_00[1].mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_00[1].mUnk_18.z = FX_F32_TO_FX32(0.35f); this->mUnk_00[1].mUnk_04 &= 0xFE; this->mUnk_00[1].mUnk_08 = 0x7009; - this->mUnk_00[2].mUnk_0C.x = -FLOAT_TO_FX32(0.35f); - this->mUnk_00[2].mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_00[2].mUnk_0C.z = -FLOAT_TO_FX32(1.0f); - this->mUnk_00[2].mUnk_18.x = FLOAT_TO_FX32(0.35f); - this->mUnk_00[2].mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_00[2].mUnk_18.z = FLOAT_TO_FX32(1.0f); + this->mUnk_00[2].mUnk_0C.x = -FX_F32_TO_FX32(0.35f); + this->mUnk_00[2].mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_00[2].mUnk_0C.z = -FX_F32_TO_FX32(1.0f); + this->mUnk_00[2].mUnk_18.x = FX_F32_TO_FX32(0.35f); + this->mUnk_00[2].mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_00[2].mUnk_18.z = FX_F32_TO_FX32(1.0f); this->mUnk_00[2].mUnk_04 &= 0xFE; this->mUnk_00[2].mUnk_08 = 0x7009; } @@ -84,12 +84,12 @@ MapObjectDoorBase::MapObjectDoorBase() : void MapObjectDoorBase::func_ov031_020fbf10(bool param1, bool param2) { if (this->IsOrientedVertically()) { - this->mPos.z += FLOAT_TO_FX32(0.5f); + this->mPos.z += FX_F32_TO_FX32(0.5f); Vec2bCpp local_16(1, 2); this->func_ov000_0209d2f0(5, 1, &local_16); } else { - this->mPos.x += FLOAT_TO_FX32(0.5f); + this->mPos.x += FX_F32_TO_FX32(0.5f); Vec2bCpp local_18(2, 1); this->func_ov000_0209d2f0(5, 1, &local_18); } @@ -280,19 +280,19 @@ void MapObjectDoorBase::vfunc_0C() { void MapObjectDoorBase::vfunc_60() { switch (this->mState) { case MapObjDoorBaseState_0: - if (!this->mUnk_86 && !GET_FLAG(this->mFlags, MapObjFlag_1) && this->mUnk_6C <= FLOAT_TO_FX32(0.5f)) { + if (!this->mUnk_86 && !GET_FLAG(this->mFlags, MapObjFlag_1) && this->mUnk_6C <= FX_F32_TO_FX32(0.5f)) { this->func_ov031_020fcf0c(1); } this->vfunc_54(); break; case MapObjDoorBaseState_2: - if (this->mUnk_86 && !GET_FLAG(this->mFlags, MapObjFlag_1) && this->mUnk_6C <= FLOAT_TO_FX32(0.5f)) { + if (this->mUnk_86 && !GET_FLAG(this->mFlags, MapObjFlag_1) && this->mUnk_6C <= FX_F32_TO_FX32(0.5f)) { this->func_ov031_020fcf0c(1); this->vfunc_58(); } break; case MapObjDoorBaseState_5: - if (GET_FLAG(this->mFlags, MapObjFlag_1) && this->mUnk_6C >= FLOAT_TO_FX32(0.5f)) { + if (GET_FLAG(this->mFlags, MapObjFlag_1) && this->mUnk_6C >= FX_F32_TO_FX32(0.5f)) { this->func_ov031_020fcf0c(0); } break; @@ -321,7 +321,7 @@ void MapObjectDoorBase::vfunc_5C(MapObjState state, unk32 param2) { this->mUnk_82 = 0; this->mUnk_84 = 0x0D; this->mUnk_80 = - (MUL_FX32(INT_TO_FX32(this->mUnk_7A), func_01ffb428(this->mUnk_6C, 0x1000)) + FLOAT_TO_FX32(0.5f)) >> 12; + (FX_MUL(INT_TO_FX32(this->mUnk_7A), func_01ffb428(this->mUnk_6C, 0x1000)) + FX_F32_TO_FX32(0.5f)) >> 12; this->vfunc_50(); @@ -394,7 +394,7 @@ void MapObjectDoorBase::vfunc_5C(MapObjState state, unk32 param2) { this->vfunc_7C(); this->mUnk_80 = - (MUL_FX32(INT_TO_FX32(this->mUnk_78), func_01ffb428(0x1000 - this->mUnk_6C, 0x1000)) + FLOAT_TO_FX32(0.5f)) >> + (FX_MUL(INT_TO_FX32(this->mUnk_78), func_01ffb428(0x1000 - this->mUnk_6C, 0x1000)) + FX_F32_TO_FX32(0.5f)) >> 12; if (this->mUnk_8A) { @@ -532,7 +532,7 @@ struct stack_struct { /* 08 */ }; -extern "C" void func_01ff9fbc(Mat2p *, unk32, Mat2p *); +extern "C" void func_01ff9fbc(MtxFx22 *, unk32, MtxFx22 *); extern fx16 data_0203f964[]; void MapObjectDoorBase::func_ov031_020fcb78(s8 *param1) { @@ -557,12 +557,12 @@ void MapObjectDoorBase::func_ov031_020fcb78(s8 *param1) { sp4 = *(ActorRef *) &this->mUnk_38; if (data_027e0998->vfunc_00(&this->mPos, &sp10, &sp4) && uVar4 != 0) { - Mat2p m; + MtxFx22 m; if (this->IsOrientedVertically()) { - Mat2p_InitRotation(&m, data_0203f964[0], data_0203f964[1]); + MtxFx22_InitRotation(&m, data_0203f964[0], data_0203f964[1]); } else { - Mat2p_InitIdentity(&m); + MtxFx22_InitIdentity(&m); } func_01ff9fbc(&m, data_027e0998->func_ov000_02061a70(), &m); @@ -639,12 +639,12 @@ void MapObjectDoorBase::vfunc_84(unk32 param1, VecFx32 *param2, unk16 *param3) { *param3 = this->mAngle.angle_s; if (param1 != 0) { - local_20.x = MUL_FX32(SIN((u16) this->mAngle.angle_s), 0x1000); - local_20.z = MUL_FX32(COS((u16) this->mAngle.angle_s), 0x1000); + local_20.x = FX_MUL(SIN((u16) this->mAngle.angle_s), 0x1000); + local_20.z = FX_MUL(COS((u16) this->mAngle.angle_s), 0x1000); local_20.y = 0; } else { - local_20.x = MUL_FX32(SIN((u16) this->mAngle.angle_s), 0xC00); - local_20.z = MUL_FX32(COS((u16) this->mAngle.angle_s), 0xC00); + local_20.x = FX_MUL(SIN((u16) this->mAngle.angle_s), 0xC00); + local_20.z = FX_MUL(COS((u16) this->mAngle.angle_s), 0xC00); local_20.y = 0; *param3 += -DEG_TO_ANG(180); @@ -695,7 +695,7 @@ void MapObjectDoorBase::vfunc2_08() { bool result = data_027e0ce0->func_01fff1a4(); temp_r0 = this->mPos.x; temp_r1 = this->mPos.y; - temp_r2 = this->mPos.z - FLOAT_TO_FX32(3.0f); + temp_r2 = this->mPos.z - FX_F32_TO_FX32(3.0f); if (!result) { this->mUnk_4C.x = temp_r0; @@ -708,7 +708,7 @@ void MapObjectDoorBase::vfunc2_08() { return; } - this->mUnk_4C.x = temp_r0 - FLOAT_TO_FX32(1.0f); + this->mUnk_4C.x = temp_r0 - FX_F32_TO_FX32(1.0f); this->mUnk_4C.y = temp_r1; this->mUnk_4C.z = temp_r2; @@ -716,9 +716,9 @@ void MapObjectDoorBase::vfunc2_08() { // *temp_r3_2 = this->mUnk_4A; data_027e0ce0->func_ov000_0208bbd4(this->mUnk_04, &this->mUnk_4C, this->mUnk_4A); - this->mUnk_5C.x = this->mPos.x + FLOAT_TO_FX32(1.0f); + this->mUnk_5C.x = this->mPos.x + FX_F32_TO_FX32(1.0f); this->mUnk_5C.y = this->mPos.y; - this->mUnk_5C.z = this->mPos.z - FLOAT_TO_FX32(3.0f); + this->mUnk_5C.z = this->mPos.z - FX_F32_TO_FX32(3.0f); this->mUnk_5A = this->mUnk_4A; // temp_r2_2 = sp - 4; diff --git a/src/031_Land/MapObject/MapObjectDoorClick.cpp b/src/031_Land/MapObject/MapObjectDoorClick.cpp index 52b845c2..bc2bdfc0 100644 --- a/src/031_Land/MapObject/MapObjectDoorClick.cpp +++ b/src/031_Land/MapObject/MapObjectDoorClick.cpp @@ -5,7 +5,7 @@ #include "Unknown/UnkStruct_027e0cec.hpp" extern "C" f32 func_02039f04(unk32); -extern "C" void func_01ffaf74(VecFx32 *, Mat4x3p *, VecFx32 *); +extern "C" void func_01ffaf74(VecFx32 *, MtxFx43 *, VecFx32 *); extern "C" void func_01ffcfcc(VecFx32 *, VecFx32 *, VecFx32 *); extern "C" unk32 func_01ffb428(unk32, unk32); extern "C" unk32 func_01ffb464(unk32 param1); @@ -222,12 +222,12 @@ void MapObjectDoorClick::vfunc_14(unk32 param1) { sVar2 = (s16) mul; u16 angle = (u16) sVar2; - Mat3p m; + MtxFx33 m; VecFx32 local_48; VecFx32 temp; - Mat3p_InitYRotation(&m, SIN(angle), COS(angle)); - temp.x = this->mPos.x - FLOAT_TO_FX32(1.0f) + this->mUnk_70; + MtxFx33_InitYRotation(&m, SIN(angle), COS(angle)); + temp.x = this->mPos.x - FX_F32_TO_FX32(1.0f) + this->mUnk_70; temp.z = this->mPos.z; temp.y = this->mPos.y; local_48.x = temp.x; @@ -236,8 +236,8 @@ void MapObjectDoorClick::vfunc_14(unk32 param1) { this->mUnk_94.vfunc_14(&m, &local_48); u16 var = (-0x8000 - sVar2); - Mat3p_InitYRotation(&m, SIN(var), COS(var)); - temp.x = this->mPos.x + FLOAT_TO_FX32(1.0f) - this->mUnk_70; + MtxFx33_InitYRotation(&m, SIN(var), COS(var)); + temp.x = this->mPos.x + FX_F32_TO_FX32(1.0f) - this->mUnk_70; temp.z = this->mPos.z; temp.y = this->mPos.y; local_48.x = temp.x; @@ -259,7 +259,7 @@ void MapObjectDoorClick::vfunc_5C(MapObjState state, unk32 param2) { case MapObjDoorClickState_3: { this->vfunc_7C(); - u16 result = ROUND_FX32(MUL_FX32(func_01ffb428(0x1000 - this->mUnk_6C, 0x1000), INT_TO_FX32(this->mUnk_78))); + u16 result = ROUND_FX32(FX_MUL(func_01ffb428(0x1000 - this->mUnk_6C, 0x1000), INT_TO_FX32(this->mUnk_78))); this->mUnk_80 = result; if (this->mUnk_8A) { @@ -355,7 +355,7 @@ void MapObjectDoorClick::vfunc_78(void) { VecFx32 local_30; VecFx32 VStack_3c; VecFx32 VStack_48; - Mat4x3p m; + MtxFx43 m; VecFx32 local_84; VecFx32 local_90; @@ -364,26 +364,26 @@ void MapObjectDoorClick::vfunc_78(void) { temp.z = this->mPos.z; temp.y = this->mPos.y; - local_24.x = temp.x - FLOAT_TO_FX32(0.999f); + local_24.x = temp.x - FX_F32_TO_FX32(0.999f); local_24.y = temp.y; local_24.z = temp.z; - local_30.x = temp.x + FLOAT_TO_FX32(0.999f); + local_30.x = temp.x + FX_F32_TO_FX32(0.999f); local_30.y = temp.y; local_30.z = temp.z; f32 div = func_02039f04(this->mUnk_6C) / 4096.0f; s16 angle = 21845.0f * div; - Mat4x3p_InitYRotation(&m, SIN((u16) angle), COS((u16) angle)); + MtxFx43_InitYRotation(&m, SIN((u16) angle), COS((u16) angle)); - local_84.x = FLOAT_TO_FX32(1.0f); + local_84.x = FX_F32_TO_FX32(1.0f); local_84.y = 0; local_84.z = 0; local_90.x = 0; local_90.y = 0; - local_90.z = FLOAT_TO_FX32(0.3299f); + local_90.z = FX_F32_TO_FX32(0.3299f); func_01ffaf74(&local_90, &m, &local_90); func_01ffaf74(&local_84, &m, &local_84); diff --git a/src/031_Land/MapObject/MapObjectDoorDangerSpawn.cpp b/src/031_Land/MapObject/MapObjectDoorDangerSpawn.cpp index 27bb22f6..02d23c52 100644 --- a/src/031_Land/MapObject/MapObjectDoorDangerSpawn.cpp +++ b/src/031_Land/MapObject/MapObjectDoorDangerSpawn.cpp @@ -15,7 +15,7 @@ #include "versions.h" extern "C" unk32 func_01ffb428(unk32, unk32); -extern "C" void func_01ffaf74(VecFx32 *, Mat4x3p *, VecFx32 *); +extern "C" void func_01ffaf74(VecFx32 *, MtxFx43 *, VecFx32 *); extern "C" void func_01ff93c0(VecFx32 *, fx32); extern unk32 data_ov031_02110c00[]; @@ -283,7 +283,7 @@ void MapObjectDoorDangerSpawn::vfunc_5C(MapObjState state, unk32 param2) { this->mUnk_8B = 1; } - u16 result = ROUND_FX32(MUL_FX32(func_01ffb428(0x1000 - this->mUnk_6C, 0x1000), INT_TO_FX32(this->mUnk_78))); + u16 result = ROUND_FX32(FX_MUL(func_01ffb428(0x1000 - this->mUnk_6C, 0x1000), INT_TO_FX32(this->mUnk_78))); this->mUnk_80 = result; if (this->mUnk_8A) { @@ -553,8 +553,8 @@ void MapObjectDoorDangerSpawn::vfunc_18(s8 *param1) { } void MapObjectDoorDangerSpawn::vfunc_14(unk32 param1) { - Mat3p m; - Mat3p_InitYRotation(&m, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); + MtxFx33 m; + MtxFx33_InitYRotation(&m, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); VecFx32 pos(this->mPos); pos.y += -(this->mUnk_6C * 2); @@ -592,7 +592,7 @@ void MapObjectDoorDangerSpawn::vfunc_74(void) { VecFx32 local_34; VecFx32 local_40; VecFx32 local_4c; - Mat4x3p m; + MtxFx43 m; fx32 b33 = 0xB33; @@ -618,7 +618,7 @@ void MapObjectDoorDangerSpawn::vfunc_74(void) { var_r5 = 0; } - Mat4x3p_InitYRotation(&m, SIN(var_r5), COS(var_r5)); + MtxFx43_InitYRotation(&m, SIN(var_r5), COS(var_r5)); func_01ffaf74(&local_40, &m, &local_40); func_01ffaf74(&local_4c, &m, &local_4c); @@ -692,12 +692,12 @@ void MapObjectDoorDangerSpawn::vfunc_84(unk32 param1, VecFx32 *param2, unk16 *pa *param3 = this->mAngle.angle_s; iVar1 = this->mAngle.angle_s + DEG_TO_ANG(30); if (param1 != 0) { - local_24.x = MUL_FX32(SIN((u16) iVar1), 0x1666); - local_24.z = MUL_FX32(COS((u16) iVar1), 0x1666); + local_24.x = FX_MUL(SIN((u16) iVar1), 0x1666); + local_24.z = FX_MUL(COS((u16) iVar1), 0x1666); local_24.y = 0; } else { - local_24.x = MUL_FX32(SIN((u16) iVar1), 0x10CD); - local_24.z = MUL_FX32(COS((u16) iVar1), 0x10CD); + local_24.x = FX_MUL(SIN((u16) iVar1), 0x10CD); + local_24.z = FX_MUL(COS((u16) iVar1), 0x10CD); local_24.y = 0; *param3 += DEG_TO_ANG(180); @@ -708,12 +708,12 @@ void MapObjectDoorDangerSpawn::vfunc_84(unk32 param1, VecFx32 *param2, unk16 *pa this->mUnk_5A = this->mAngle.angle_s; iVar1 = this->mAngle.angle_s - DEG_TO_ANG(30); if (param1 != 0) { - local_30.x = MUL_FX32(SIN((u16) iVar1), 0x1666); - local_30.z = MUL_FX32(COS((u16) iVar1), 0x1666); + local_30.x = FX_MUL(SIN((u16) iVar1), 0x1666); + local_30.z = FX_MUL(COS((u16) iVar1), 0x1666); local_30.y = 0; } else { - local_30.x = MUL_FX32(SIN((u16) iVar1), 0x10CD); - local_30.z = MUL_FX32(COS((u16) iVar1), 0x10CD); + local_30.x = FX_MUL(SIN((u16) iVar1), 0x10CD); + local_30.z = FX_MUL(COS((u16) iVar1), 0x10CD); local_30.y = 0; this->mUnk_5A += DEG_TO_ANG(180); } @@ -731,7 +731,7 @@ void MapObjectDoorDangerSpawn::func_ov031_020fe5fc(VecFx32 *param1, MapObjectDoo VecFx32 pos; VecFx32_Init(temp.x + piVar2->x, temp.y + piVar2->y, temp.z + piVar2->z, &pos); - func_01ff93c0(&pos, FLOAT_TO_FX32(0.5f)); + func_01ff93c0(&pos, FX_F32_TO_FX32(0.5f)); *param1 = pos; } else { VecFx32 *piVar4 = data_027e0ce0->func_01fff148(0); diff --git a/src/031_Land/MapObject/MapObjectDoorKey.cpp b/src/031_Land/MapObject/MapObjectDoorKey.cpp index 0e316ec8..75f5d404 100644 --- a/src/031_Land/MapObject/MapObjectDoorKey.cpp +++ b/src/031_Land/MapObject/MapObjectDoorKey.cpp @@ -5,7 +5,7 @@ #include "Unknown/UnkStruct_027e0cec.hpp" extern "C" f32 func_02039f04(unk32); -extern "C" void func_01ffaf74(VecFx32 *, Mat4x3p *, VecFx32 *); +extern "C" void func_01ffaf74(VecFx32 *, MtxFx43 *, VecFx32 *); const UnkStruct_ov031_021150b0 data_ov031_02115184(0x1E66); @@ -66,12 +66,12 @@ void MapObjectDoorKey::vfunc_14(unk32 param1) { sVar2 = (s16) mul; u16 angle = (u16) sVar2; - Mat3p m; + MtxFx33 m; VecFx32 local_48; VecFx32 temp; - Mat3p_InitYRotation(&m, SIN(angle), COS(angle)); - temp.x = this->mPos.x - FLOAT_TO_FX32(1.0f) + this->mUnk_70; + MtxFx33_InitYRotation(&m, SIN(angle), COS(angle)); + temp.x = this->mPos.x - FX_F32_TO_FX32(1.0f) + this->mUnk_70; temp.z = this->mPos.z; temp.y = this->mPos.y; local_48.x = temp.x; @@ -80,8 +80,8 @@ void MapObjectDoorKey::vfunc_14(unk32 param1) { this->mUnk_94.vfunc_14(&m, &local_48); u16 var = (-0x8000 - sVar2); - Mat3p_InitYRotation(&m, SIN(var), COS(var)); - temp.x = this->mPos.x + FLOAT_TO_FX32(1.0f) - this->mUnk_70; + MtxFx33_InitYRotation(&m, SIN(var), COS(var)); + temp.x = this->mPos.x + FX_F32_TO_FX32(1.0f) - this->mUnk_70; temp.z = this->mPos.z; temp.y = this->mPos.y; local_48.x = temp.x; @@ -178,7 +178,7 @@ void MapObjectDoorKey::vfunc_78(void) { VecFx32 local_30; VecFx32 VStack_3c; VecFx32 VStack_48; - Mat4x3p m; + MtxFx43 m; VecFx32 local_84; VecFx32 local_90; @@ -187,26 +187,26 @@ void MapObjectDoorKey::vfunc_78(void) { temp.z = this->mPos.z; temp.y = this->mPos.y; - local_24.x = temp.x - FLOAT_TO_FX32(0.999f); + local_24.x = temp.x - FX_F32_TO_FX32(0.999f); local_24.y = temp.y; local_24.z = temp.z; - local_30.x = temp.x + FLOAT_TO_FX32(0.999f); + local_30.x = temp.x + FX_F32_TO_FX32(0.999f); local_30.y = temp.y; local_30.z = temp.z; f32 div = func_02039f04(this->mUnk_6C) / 4096.0f; s16 angle = 16384.0f * div; - Mat4x3p_InitYRotation(&m, SIN((u16) angle), COS((u16) angle)); + MtxFx43_InitYRotation(&m, SIN((u16) angle), COS((u16) angle)); - local_84.x = FLOAT_TO_FX32(1.0f); + local_84.x = FX_F32_TO_FX32(1.0f); local_84.y = 0; local_84.z = 0; local_90.x = 0; local_90.y = 0; - local_90.z = FLOAT_TO_FX32(0.3299f); + local_90.z = FX_F32_TO_FX32(0.3299f); func_01ffaf74(&local_90, &m, &local_90); func_01ffaf74(&local_84, &m, &local_84); diff --git a/src/031_Land/MapObject/MapObjectDoorSwitch.cpp b/src/031_Land/MapObject/MapObjectDoorSwitch.cpp index 3151cd3d..75b8f9ab 100644 --- a/src/031_Land/MapObject/MapObjectDoorSwitch.cpp +++ b/src/031_Land/MapObject/MapObjectDoorSwitch.cpp @@ -5,7 +5,7 @@ #include "Unknown/UnkStruct_027e0cec.hpp" #include "versions.h" -extern "C" void func_01ffaf74(VecFx32 *, Mat4x3p *, VecFx32 *); +extern "C" void func_01ffaf74(VecFx32 *, MtxFx43 *, VecFx32 *); extern "C" fx32 func_01ffb464(fx32); extern "C" void func_01ff9218(fx32 *, fx32, fx32); @@ -25,7 +25,7 @@ MapObjectProfileDoorSwitch::MapObjectProfileDoorSwitch() : MapObjectDoorSwitch::MapObjectDoorSwitch() : mUnk_094(NULL) { - this->mUnkPos = FLOAT_TO_FX32(0.0f); + this->mUnkPos = FX_F32_TO_FX32(0.0f); #if IS_JP this->mUnk_140 = false; @@ -51,25 +51,25 @@ bool MapObjectDoorSwitch::Init(void) { } #endif - this->mUnk_0F4.mUnk_0C.x = -FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_0F4.mUnk_0C.z = -FLOAT_TO_FX32(1.35f); + this->mUnk_0F4.mUnk_0C.x = -FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_0F4.mUnk_0C.z = -FX_F32_TO_FX32(1.35f); - this->mUnk_0F4.mUnk_18.x = FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_0F4.mUnk_18.z = FLOAT_TO_FX32(0.35f); + this->mUnk_0F4.mUnk_18.x = FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_0F4.mUnk_18.z = FX_F32_TO_FX32(0.35f); this->mUnk_0F4.mUnk_04 &= ~0x01; this->mUnk_0F4.mUnk_08 = 0x7009; #if IS_JP - this->mUnk_118.mUnk_0C.x = -FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_118.mUnk_0C.z = -FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_0C.x = -FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_118.mUnk_0C.z = -FX_F32_TO_FX32(1.0f); - this->mUnk_118.mUnk_18.x = FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_118.mUnk_18.z = FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_18.x = FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_118.mUnk_18.z = FX_F32_TO_FX32(1.0f); this->mUnk_118.mUnk_04 &= ~0x01; this->mUnk_118.mUnk_08 = 0x7009; @@ -114,9 +114,9 @@ bool MapObjectDoorSwitch::vfunc_6C(void) { void MapObjectDoorSwitch::vfunc_14(unk32 param1) { u16 angle = this->mAngle.angle_s; - Mat3p m; + MtxFx33 m; - Mat3p_InitYRotation(&m, SIN(angle), COS(angle)); + MtxFx33_InitYRotation(&m, SIN(angle), COS(angle)); VecFx32 local_40(this->mPos); local_40.y -= this->mUnk_6C * 2; @@ -132,10 +132,10 @@ void MapObjectDoorSwitch::vfunc_74(void) { VecFx32 local_2c; VecFx32_Init(0, 0, 0x666, &local_2c); - Mat4x3p m; + MtxFx43 m; u16 angle = this->mAngle.angle_s; - Mat4x3p_InitYRotation(&m, SIN(angle), COS(angle)); + MtxFx43_InitYRotation(&m, SIN(angle), COS(angle)); func_01ffaf74(&local_2c, &m, &local_2c); VecFx32_Add(&local_20, &local_2c, &local_20); @@ -159,15 +159,15 @@ void MapObjectDoorSwitch::vfunc_50(void) { u16 uVar1 = this->GetDirection(); if (!this->IsOrientedVertically()) { - this->mUnkPos = FLOAT_TO_FX32(0.35f); + this->mUnkPos = FX_F32_TO_FX32(0.35f); - this->mUnk_0F4.mUnk_0C.x = -FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_0F4.mUnk_0C.z = FLOAT_TO_FX32(0.35f); + this->mUnk_0F4.mUnk_0C.x = -FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_0F4.mUnk_0C.z = FX_F32_TO_FX32(0.35f); - this->mUnk_0F4.mUnk_18.x = FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_0F4.mUnk_18.z = FLOAT_TO_FX32(0.35f); + this->mUnk_0F4.mUnk_18.x = FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_0F4.mUnk_18.z = FX_F32_TO_FX32(0.35f); return; } @@ -176,36 +176,36 @@ void MapObjectDoorSwitch::vfunc_50(void) { } if (uVar1 == 3) { - this->mUnkPos = FLOAT_TO_FX32(0.35f); + this->mUnkPos = FX_F32_TO_FX32(0.35f); - this->mUnk_118.mUnk_0C.x = FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_118.mUnk_0C.z = -FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_0C.x = FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_118.mUnk_0C.z = -FX_F32_TO_FX32(1.0f); - this->mUnk_118.mUnk_18.x = FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_118.mUnk_18.z = FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_18.x = FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_118.mUnk_18.z = FX_F32_TO_FX32(1.0f); } else { - this->mUnkPos = -FLOAT_TO_FX32(0.35f); + this->mUnkPos = -FX_F32_TO_FX32(0.35f); - this->mUnk_118.mUnk_0C.x = -FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_118.mUnk_0C.z = -FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_0C.x = -FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_118.mUnk_0C.z = -FX_F32_TO_FX32(1.0f); - this->mUnk_118.mUnk_18.x = -FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_118.mUnk_18.z = FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_18.x = -FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_118.mUnk_18.z = FX_F32_TO_FX32(1.0f); } #else - this->mUnkPos = FLOAT_TO_FX32(0.35f); + this->mUnkPos = FX_F32_TO_FX32(0.35f); - this->mUnk_0F4.mUnk_0C.x = -FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_0F4.mUnk_0C.z = FLOAT_TO_FX32(0.35f); + this->mUnk_0F4.mUnk_0C.x = -FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_0F4.mUnk_0C.z = FX_F32_TO_FX32(0.35f); - this->mUnk_0F4.mUnk_18.x = FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_0F4.mUnk_18.z = FLOAT_TO_FX32(0.35f); + this->mUnk_0F4.mUnk_18.x = FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_0F4.mUnk_18.z = FX_F32_TO_FX32(0.35f); #endif } @@ -221,17 +221,17 @@ void MapObjectDoorSwitch::vfunc_54(void) { if (!this->IsOrientedVertically()) { if (this->mUnk_80 > 0) { - func_01ff9218(&this->mUnkPos, -FLOAT_TO_FX32(1.35f), func_01ffb464(INT_TO_FX32(this->mUnk_80))); + func_01ff9218(&this->mUnkPos, -FX_F32_TO_FX32(1.35f), func_01ffb464(INT_TO_FX32(this->mUnk_80))); } fx32 temp_118 = this->mUnkPos; - this->mUnk_0F4.mUnk_0C.x = -FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_0C.y = FLOAT_TO_FX32(0.0f); + this->mUnk_0F4.mUnk_0C.x = -FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_0C.y = FX_F32_TO_FX32(0.0f); this->mUnk_0F4.mUnk_0C.z = temp_118; - this->mUnk_0F4.mUnk_18.x = FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_0F4.mUnk_18.z = FLOAT_TO_FX32(0.35f); + this->mUnk_0F4.mUnk_18.x = FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_0F4.mUnk_18.z = FX_F32_TO_FX32(0.35f); return; } @@ -243,42 +243,42 @@ void MapObjectDoorSwitch::vfunc_54(void) { if (uVar1 == 3) { if (this->mUnk_80 > 0) { - func_01ff9218(&this->mUnkPos, -FLOAT_TO_FX32(0.35f), func_01ffb464(INT_TO_FX32(this->mUnk_80))); + func_01ff9218(&this->mUnkPos, -FX_F32_TO_FX32(0.35f), func_01ffb464(INT_TO_FX32(this->mUnk_80))); } this->mUnk_118.mUnk_0C.x = this->mUnkPos; - this->mUnk_118.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_118.mUnk_0C.z = -FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_118.mUnk_0C.z = -FX_F32_TO_FX32(1.0f); - this->mUnk_118.mUnk_18.x = FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_118.mUnk_18.z = FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_18.x = FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_118.mUnk_18.z = FX_F32_TO_FX32(1.0f); } else { if (this->mUnk_80 > 0) { - func_01ff9218(&this->mUnkPos, FLOAT_TO_FX32(0.35f), func_01ffb464(INT_TO_FX32(this->mUnk_80))); + func_01ff9218(&this->mUnkPos, FX_F32_TO_FX32(0.35f), func_01ffb464(INT_TO_FX32(this->mUnk_80))); } - this->mUnk_118.mUnk_0C.x = -FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_118.mUnk_0C.z = -FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_0C.x = -FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_118.mUnk_0C.z = -FX_F32_TO_FX32(1.0f); this->mUnk_118.mUnk_18.x = this->mUnkPos; - this->mUnk_118.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_118.mUnk_18.z = FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_118.mUnk_18.z = FX_F32_TO_FX32(1.0f); } #else if (this->mUnk_80 > 0) { - func_01ff9218(&this->mUnkPos, -FLOAT_TO_FX32(1.35f), func_01ffb464(INT_TO_FX32(this->mUnk_80))); + func_01ff9218(&this->mUnkPos, -FX_F32_TO_FX32(1.35f), func_01ffb464(INT_TO_FX32(this->mUnk_80))); } fx32 temp_118 = this->mUnkPos; - this->mUnk_0F4.mUnk_0C.x = -FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_0C.y = FLOAT_TO_FX32(0.0f); + this->mUnk_0F4.mUnk_0C.x = -FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_0C.y = FX_F32_TO_FX32(0.0f); this->mUnk_0F4.mUnk_0C.z = temp_118; - this->mUnk_0F4.mUnk_18.x = FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_0F4.mUnk_18.z = FLOAT_TO_FX32(0.35f); + this->mUnk_0F4.mUnk_18.x = FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_0F4.mUnk_18.z = FX_F32_TO_FX32(0.35f); #endif } @@ -289,32 +289,32 @@ void MapObjectDoorSwitch::vfunc_58(void) { } if (!this->IsOrientedVertically()) { - this->mUnk_0F4.mUnk_0C.x = -FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_0F4.mUnk_0C.z = -FLOAT_TO_FX32(1.35f); + this->mUnk_0F4.mUnk_0C.x = -FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_0F4.mUnk_0C.z = -FX_F32_TO_FX32(1.35f); - this->mUnk_0F4.mUnk_18.x = FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_0F4.mUnk_18.z = FLOAT_TO_FX32(0.35f); + this->mUnk_0F4.mUnk_18.x = FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_0F4.mUnk_18.z = FX_F32_TO_FX32(0.35f); } else { if (this->mUnk_141) { - this->mUnk_118.mUnk_0C.x = -FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_118.mUnk_0C.z = -FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_0C.x = -FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_118.mUnk_0C.z = -FX_F32_TO_FX32(1.0f); - this->mUnk_118.mUnk_18.x = FLOAT_TO_FX32(0.35f); - this->mUnk_118.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_118.mUnk_18.z = FLOAT_TO_FX32(1.0f); + this->mUnk_118.mUnk_18.x = FX_F32_TO_FX32(0.35f); + this->mUnk_118.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_118.mUnk_18.z = FX_F32_TO_FX32(1.0f); } } #else - this->mUnk_0F4.mUnk_0C.x = -FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_0C.y = FLOAT_TO_FX32(0.0f); - this->mUnk_0F4.mUnk_0C.z = -FLOAT_TO_FX32(1.35f); + this->mUnk_0F4.mUnk_0C.x = -FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_0C.y = FX_F32_TO_FX32(0.0f); + this->mUnk_0F4.mUnk_0C.z = -FX_F32_TO_FX32(1.35f); - this->mUnk_0F4.mUnk_18.x = FLOAT_TO_FX32(1.0f); - this->mUnk_0F4.mUnk_18.y = FLOAT_TO_FX32(2.4f); - this->mUnk_0F4.mUnk_18.z = FLOAT_TO_FX32(0.35f); + this->mUnk_0F4.mUnk_18.x = FX_F32_TO_FX32(1.0f); + this->mUnk_0F4.mUnk_18.y = FX_F32_TO_FX32(2.4f); + this->mUnk_0F4.mUnk_18.z = FX_F32_TO_FX32(0.35f); #endif } diff --git a/src/031_Land/MapObject/MapObjectGrass.cpp b/src/031_Land/MapObject/MapObjectGrass.cpp index 140cecb4..0380eb91 100644 --- a/src/031_Land/MapObject/MapObjectGrass.cpp +++ b/src/031_Land/MapObject/MapObjectGrass.cpp @@ -15,9 +15,9 @@ MapObject *MapObjectProfileGrass::Create() { MapObjectProfileGrass::MapObjectProfileGrass() : MapObjectProfilePot_Base(MapObjectId_Grass, MapObjectId_Grass) { this->mUnk_D4.mUnk_08 = 0x2A807003; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_D4.mUnk_0C); - this->mUnk_D4.mUnk_18 = FLOAT_TO_FX32(0.35f); - this->mUnk_D4.mUnk_1C = FLOAT_TO_FX32(1.0f); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_D4.mUnk_0C); + this->mUnk_D4.mUnk_18 = FX_F32_TO_FX32(0.35f); + this->mUnk_D4.mUnk_1C = FX_F32_TO_FX32(1.0f); this->mUnk_D4.mUnk_04 &= 0xFD; this->mUnk_06 = -0x1; this->mUnk_1E &= ~0x1; @@ -25,7 +25,7 @@ MapObjectProfileGrass::MapObjectProfileGrass() : MapObjectGrass::MapObjectGrass() : mUnk_58(0x0), - mUnk_5C(FLOAT_TO_FX32(0.0f)), + mUnk_5C(FX_F32_TO_FX32(0.0f)), mUnk_64(-1) { this->mUnk_62 = 0x0; this->mUnk_60 = 0x0; @@ -65,18 +65,18 @@ bool MapObjectGrass::vfunc_38(MapObjState state, unk32 param2) { this->mState = state; switch (this->mState) { case MapObjGrassState_0: - this->mUnk_5C = FLOAT_TO_FX32(0.0f); + this->mUnk_5C = FX_F32_TO_FX32(0.0f); if (param2 != 0) { this->func_ov031_021018a4(0x0); } break; case MapObjGrassState_2: this->mUnk_58 = 0x0; - this->mUnk_5C = FLOAT_TO_FX32(0.0f); + this->mUnk_5C = FX_F32_TO_FX32(0.0f); VecFx32 vec; for (unk32 i = 0; i < ARRAY_LEN(this->mUnk_40); ++i) { - VecFx32_Init(this->mUnk_40[i].x, this->mUnk_40[i].y + FLOAT_TO_FX32(0.35f), this->mUnk_40[i].z, &vec); + VecFx32_Init(this->mUnk_40[i].x, this->mUnk_40[i].y + FX_F32_TO_FX32(0.35f), this->mUnk_40[i].z, &vec); VecFx32_Add(&vec, &this->mPos, &vec); this->vfunc_3C(&vec); } @@ -89,11 +89,11 @@ bool MapObjectGrass::vfunc_38(MapObjState state, unk32 param2) { this->func_ov031_021018a4(0x1); break; case MapObjGrassState_1: - this->mUnk_5C = FLOAT_TO_FX32(0.0f); + this->mUnk_5C = FX_F32_TO_FX32(0.0f); this->mUnk_58 = 0x0; break; case MapObjGrassState_3: - this->mUnk_5C = FLOAT_TO_FX32(0.0f); + this->mUnk_5C = FX_F32_TO_FX32(0.0f); this->func_ov031_021018a4(0x1); break; default: diff --git a/src/031_Land/MapObject/MapObjectPot.cpp b/src/031_Land/MapObject/MapObjectPot.cpp index 8509f567..049e0a66 100644 --- a/src/031_Land/MapObject/MapObjectPot.cpp +++ b/src/031_Land/MapObject/MapObjectPot.cpp @@ -27,10 +27,10 @@ MapObjectProfilePot::MapObjectProfilePot() : this->mUnk_0E = 0x0; this->mUnk_D4.mUnk_08 = 0x7007; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_D4.mUnk_0C); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_D4.mUnk_0C); - this->mUnk_D4.mUnk_18 = FLOAT_TO_FX32(0.5f); - this->mUnk_D4.mUnk_1C = FLOAT_TO_FX32(1.2f); + this->mUnk_D4.mUnk_18 = FX_F32_TO_FX32(0.5f); + this->mUnk_D4.mUnk_1C = FX_F32_TO_FX32(1.2f); this->mUnk_06 = 0x0; this->mUnk_0C = 0x1000; } @@ -51,7 +51,7 @@ MapObjectPot::MapObjectPot() : } void MapObjectPot::Setup() { - this->mPos.y = INT_MAX - FLOAT_TO_FX32(1.0f); + this->mPos.y = INT_MAX - FX_F32_TO_FX32(1.0f); this->mPos.y = func_01ffe868(&this->mPos, 0x1, 0x0); } diff --git a/src/031_Land/MapObject/MapObjectUnkSKDI.cpp b/src/031_Land/MapObject/MapObjectUnkSKDI.cpp index 810ee895..44cb1d26 100644 --- a/src/031_Land/MapObject/MapObjectUnkSKDI.cpp +++ b/src/031_Land/MapObject/MapObjectUnkSKDI.cpp @@ -85,8 +85,8 @@ bool MapObjectUnkSKDI::Init() { } this->mUnk_0D4.mUnk_08 = (var1 & ~0x7000) | 0x7000; - VecFx32_Init(FLOAT_TO_FX32(-0.5002f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(-0.5002f), &this->mUnk_0D4.mUnk_0C); - VecFx32_Init(FLOAT_TO_FX32(0.5f), FLOAT_TO_FX32(1.2f), FLOAT_TO_FX32(0.5f), &this->mUnk_0D4.mUnk_18); + VecFx32_Init(FX_F32_TO_FX32(-0.5002f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(-0.5002f), &this->mUnk_0D4.mUnk_0C); + VecFx32_Init(FX_F32_TO_FX32(0.5f), FX_F32_TO_FX32(1.2f), FX_F32_TO_FX32(0.5f), &this->mUnk_0D4.mUnk_18); if (this->mUnk_07C == 0x0) { this->func_ov031_02106190(); @@ -158,9 +158,9 @@ void MapObjectUnkSKDI::func_ov031_0210643c(unk32 param1) { this->func_ov031_02106678(MapObjUnkSKDIState_0, 0x0); break; case MapObjUnkSKDIState_1: - if (this->func_ov000_0209d3b4(0x0, FLOAT_TO_FX32(2.0f)) != 0x0) { + if (this->func_ov000_0209d3b4(0x0, FX_F32_TO_FX32(2.0f)) != 0x0) { VecFx32 vec; - VecFx32_Init(this->mPos.x, this->mPos.y + FLOAT_TO_FX32(1.25f), this->mPos.z, &vec); + VecFx32_Init(this->mPos.x, this->mPos.y + FX_F32_TO_FX32(1.25f), this->mPos.z, &vec); UnkStruct_027e0cec *data = data_027e0cec; for (ActorBomb_unk *ptr = this->mUnk_04C; ptr != this->mUnk_04C + ARRAY_LEN(this->mUnk_04C); ++ptr) { data->func_ov000_020a0140(ptr, &vec); @@ -213,7 +213,7 @@ void MapObjectUnkSKDI::func_ov031_02106678(MapObjState state, unk32 param2) { return; } this->mState = state; - VecFx32_Init(this->mPos.x, this->mPos.y + FLOAT_TO_FX32(1.25f), this->mPos.z, &sp48); + VecFx32_Init(this->mPos.x, this->mPos.y + FX_F32_TO_FX32(1.25f), this->mPos.z, &sp48); switch (this->mState) { case MapObjUnkSKDIState_0: @@ -316,7 +316,7 @@ void MapObjectUnkSKDI::func_ov031_02106a70() { class ActorUnk_MapObjectUnkSKDI_vfunc_1C : public Actor { public: /* 000 (base) */ - /* 094 */ STRUCT_PAD(0x094, 0x128); + /* 094 */ PAD(0x094, 0x128); /* 128 */ unk32 mUnk_128; /* 12C */ }; diff --git a/src/031_Land/MapObject/MapObjectUnkSWHT.cpp b/src/031_Land/MapObject/MapObjectUnkSWHT.cpp index 08bcc3e4..698ca18c 100644 --- a/src/031_Land/MapObject/MapObjectUnkSWHT.cpp +++ b/src/031_Land/MapObject/MapObjectUnkSWHT.cpp @@ -27,9 +27,9 @@ MapObject *MapObjectProfileUnkSWHT::Create() { MapObjectProfileUnkSWHT::MapObjectProfileUnkSWHT() : MapObjectProfilePot_Base(MapObjectId_SWHT, MapObjectId_SWHT) { this->mUnk_D4.mUnk_08 = 0x84007009; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_D4.mUnk_0C); - this->mUnk_D4.mUnk_18 = FLOAT_TO_FX32(0.35f); - this->mUnk_D4.mUnk_1C = FLOAT_TO_FX32(1.2f); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_D4.mUnk_0C); + this->mUnk_D4.mUnk_18 = FX_F32_TO_FX32(0.35f); + this->mUnk_D4.mUnk_1C = FX_F32_TO_FX32(1.2f); this->mUnk_06 = 0x0; this->mUnk_0C = 0x1333; this->mUnk_20.mUnk_15 = 0x1; diff --git a/src/032_MapA1/Actor/ActorFleeingSpinut.cpp b/src/032_MapA1/Actor/ActorFleeingSpinut.cpp index 64694393..4b1958da 100644 --- a/src/032_MapA1/Actor/ActorFleeingSpinut.cpp +++ b/src/032_MapA1/Actor/ActorFleeingSpinut.cpp @@ -1,5 +1,3 @@ -#define VECFX32_CTORS - #include "Actor/ActorFleeingSpinut.hpp" #include "Actor/ActorUnkKEYN.hpp" @@ -30,7 +28,7 @@ struct UnkStruct_ov032_02122908 { UnkStruct_ov032_02122908 *data_ov032_02122908; UnkStruct_ov019_020d24c8_28_258_00_Derived1 data_ov032_0212290c; UnkStruct_ov019_020d24c8_28_258_00_Derived1 data_ov032_02122924; // @11142 Eur -static const VecFx32 data_ov032_021223a8(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f)); +static const VecFx32Cpp data_ov032_021223a8(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f)); static ActorUnkZLSL_AnimationTag data_ov032_021223b4 = {.index = 0, .name = "walk", .unknown = 0x0}; static ActorUnkZLSL_AnimationTag data_ov032_021223cc = {.index = 1, .name = "discover", .unknown = 0x1}; @@ -62,7 +60,7 @@ Actor *ActorProfileFleeingSpinut::Create() { ActorProfileFleeingSpinut::ActorProfileFleeingSpinut() : ActorProfile_ov000_020b3018(ActorId_FleeingSpinut, ActorId_Spinut) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.4f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.4f)); } ActorFleeingSpinut::ActorFleeingSpinut() : @@ -87,7 +85,7 @@ ActorFleeingSpinut::ActorFleeingSpinut() : this->Actor::func_ov000_0209862c(0x4); SET_FLAG(this->mFlags, ActorFlag_9); - this->mUnk_A4 = &data_ov032_021223a8; + this->mUnk_A4 = &data_ov032_021223a8.vec; if (this->func_ov032_0211be04()) { UNSET_FLAG(this->mFlags, ActorFlag_16); @@ -136,7 +134,7 @@ void ActorFleeingSpinut::Update() { this->Actor::func_ov000_02098b8c(0x0, NULL); if (this->mUnk_46 & 0x1) { - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); } if (this->mUnk_224) { @@ -216,8 +214,8 @@ void ActorFleeingSpinut::vfunc_30(Actor_vfunc_30 *param1) { VecFx32 sp08 = this->mPos; - sp08.x += FLOAT_TO_FX32(2.5f); - sp08.z -= FLOAT_TO_FX32(2.5f); + sp08.x += FX_F32_TO_FX32(2.5f); + sp08.z -= FX_F32_TO_FX32(2.5f); Vec2s sp04; @@ -285,8 +283,8 @@ void ActorFleeingSpinut::func_ov032_0211bea8() { void ActorFleeingSpinut::func_ov032_0211bf84() { this->mUnk_110.vfunc_1C(data_ov032_021223b4, 0x1000, 0x19A, 0x0); this->mTimer.Set(0, 15); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } void ActorFleeingSpinut::func_ov032_0211bffc() { @@ -308,8 +306,8 @@ void ActorFleeingSpinut::func_ov032_0211bffc() { void ActorFleeingSpinut::func_ov032_0211c07c() { this->mUnk_110.vfunc_1C(data_ov032_021223cc, 0x1000, 0x19A, 0x0); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); data_027e09a8->func_ov000_02071b30(0x9837, &this->mPos, 0x0); } @@ -370,8 +368,8 @@ void ActorFleeingSpinut::func_ov032_0211c2c4() { this->mUnk_110.vfunc_1C(data_ov032_021223b4, 0x1000, 0x19A, 0x0); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } void ActorFleeingSpinut::func_ov032_0211c340() { @@ -397,8 +395,8 @@ void ActorFleeingSpinut::func_ov032_0211c444() { data_027e09a8->func_ov000_02071b30(0x9837, &this->mPos, 0x0); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_224 = false; } @@ -422,8 +420,8 @@ void ActorFleeingSpinut::func_ov032_0211c53c() { this->mTimer.Set(0, 10); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } void ActorFleeingSpinut::func_ov032_0211c5cc() { @@ -467,8 +465,8 @@ void ActorFleeingSpinut::func_ov032_0211c73c() { this->mUnk_110.vfunc_1C(data_ov032_021223b4, 0x1000, 0x19A, 0x0); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } void ActorFleeingSpinut::func_ov032_0211c7bc() { @@ -554,10 +552,10 @@ bool ActorFleeingSpinut::func_ov032_0211cab8(unk32 param1, unk32 param2) { return false; } -// non-matching (MUL_FX32 etc.) +// non-matching (FX_MUL etc.) void ActorFleeingSpinut::func_ov032_0211cb2c() { if (this->mUnk_110.vfunc_30() != 0x1) { - if (this->mUnk_21C <= FLOAT_TO_FX32(0.0f)) { + if (this->mUnk_21C <= FX_F32_TO_FX32(0.0f)) { this->mUnk_220 = 0x0; return; } @@ -568,20 +566,20 @@ void ActorFleeingSpinut::func_ov032_0211cb2c() { } fx32 value = this->mUnk_110.vfunc_28()->mUnk_08; - if (FLOAT_TO_FX32(1.0f) < value && value < FLOAT_TO_FX32(16.0f)) { - value -= FLOAT_TO_FX32(1.0f); - this->mUnk_21C = MUL_FX32(value + ROUND_FX32(-MUL_FX32(value, value) * 0x92492493), 0x3B4); + if (FX_F32_TO_FX32(1.0f) < value && value < FX_F32_TO_FX32(16.0f)) { + value -= FX_F32_TO_FX32(1.0f); + this->mUnk_21C = FX_MUL(value + ROUND_FX32(-FX_MUL(value, value) * 0x92492493), 0x3B4); return; } - this->mUnk_21C = FLOAT_TO_FX32(0.0f); + this->mUnk_21C = FX_F32_TO_FX32(0.0f); } ActorFleeingSpinut_1EC::ActorFleeingSpinut_1EC() : mUnk_00(0x0), mUnk_04(NULL), mUnk_08(NULL), - mUnk_1C(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f)), + mUnk_1C(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f)), mUnk_2C(0x0) { this->mUnk_0C = 0x0; this->mUnk_10 = 0x0; @@ -612,16 +610,16 @@ extern "C" fx32 func_02017f54(s16 *, UnkAngleStruct); u16 *ActorFleeingSpinut_1EC::func_ov032_0211cd60(VecFx32 *param1, s16 *param2, VecFx32 *param3, unk32 param4, unk32 param5, unk32 param6) { if (param6 == 0x0 || this->mUnk_04 == NULL) { - param3->z = FLOAT_TO_FX32(0.0f); - param3->x = FLOAT_TO_FX32(0.0f); + param3->z = FX_F32_TO_FX32(0.0f); + param3->x = FX_F32_TO_FX32(0.0f); return &this->mUnk_28; } this->mUnk_28 = 0x0; if (this->func_ov032_0211d920(param1)) { - param3->z = FLOAT_TO_FX32(0.0f); - param3->x = FLOAT_TO_FX32(0.0f); + param3->z = FX_F32_TO_FX32(0.0f); + param3->x = FX_F32_TO_FX32(0.0f); this->mUnk_28 |= 0x1; return &this->mUnk_28; } @@ -637,7 +635,7 @@ u16 *ActorFleeingSpinut_1EC::func_ov032_0211cd60(VecFx32 *param1, s16 *param2, V func_01ffb714(&sp10, &sp10, &sp1C); VecFx32 sp04; - func_01ffb714(&sp10, &this->mUnk_1C, &sp04); + func_01ffb714(&sp10, &this->mUnk_1C.vec, &sp04); fx16 sp00 = (fx32) func_01ffbbe0(sp10.x, sp10.z); @@ -775,7 +773,7 @@ void ActorFleeingSpinut_1EC::func_ov032_0211d80c() { void ActorFleeingSpinut_1EC::func_ov032_0211d830(UnkStruct_027e0960_TableEntry_04 *param1) { this->mUnk_08 = this->mUnk_04; if (this->mUnk_04 != NULL) { - this->mUnk_04->vfunc_0C(&this->mUnk_1C); + this->mUnk_04->vfunc_0C(&this->mUnk_1C.vec); } this->mUnk_04 = param1; } diff --git a/src/032_MapA1/Actor/ActorKeese.cpp b/src/032_MapA1/Actor/ActorKeese.cpp index 80003a09..bc3bf859 100644 --- a/src/032_MapA1/Actor/ActorKeese.cpp +++ b/src/032_MapA1/Actor/ActorKeese.cpp @@ -1,5 +1,3 @@ -#define VECFX32_CTORS - #include "Actor/ActorKeese.hpp" #include "Actor/ActorManager.hpp" @@ -27,7 +25,7 @@ extern "C" bool func_02016b8c(VecFx32 *, VecFx32 *, unk32, UnkAngleStruct, unk32 extern "C" s8 func_ov000_02059da4(UnkStruct_027e0960_TableEntry *, VecFx32 *param1); -static const VecFx32 data_ov032_021224d8(FLOAT_TO_FX32(1.7f), FLOAT_TO_FX32(0.5f), FLOAT_TO_FX32(1.7f)); +static const VecFx32Cpp data_ov032_021224d8(FX_F32_TO_FX32(1.7f), FX_F32_TO_FX32(0.5f), FX_F32_TO_FX32(1.7f)); static ActorUnkZLSL_AnimationTag data_ov032_021224e4 = {.index = 0, .name = "fly"}; static ActorUnkZLSL_AnimationTag data_ov032_021224fc = {.index = 0, .name = "keeth", .unknown = 1}; static PTMF data_ov032_0212258c[ActorKeeseState_Max] = { @@ -63,7 +61,7 @@ Actor *ActorProfileKeese::Create() { ActorProfileKeese::ActorProfileKeese() : ActorProfile_Derived1(ActorId_Keese) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.4f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.4f)); this->vfunc_04()->mUnk_15 = 0x1; } @@ -89,7 +87,7 @@ ActorKeese::ActorKeese() : mUnk_2A4(0x0), mUnk_2A8(0x0), mUnk_2AC(this), - mUnk_2C4(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f)), + mUnk_2C4(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f)), mUnk_2D0(NULL), mUnk_2D4(0x0) { this->Actor::func_ov000_0209862c(0x4); @@ -97,19 +95,19 @@ ActorKeese::ActorKeese() : SET_FLAGS(this->mFlags, ActorFlag_6, ActorFlag_9); *(s16 *) &this->mUnk_44 &= ~0x20; - this->mUnk_A4 = &data_ov032_021224d8; + this->mUnk_A4 = &data_ov032_021224d8.vec; } ActorKeese_2AC::ActorKeese_2AC(ActorKeese *param1) : mUnk_08(param1), - mUnk_0C(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f)) {} + mUnk_0C(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f)) {} ActorKeese_2AC::~ActorKeese_2AC() { this->mUnk_08 = NULL; } bool ActorKeese_2AC::vfunc_08(const UnkStruct_ov031_020f3310 *param1, unk32 param2) { - VecFx16_Copy2VecFx32(¶m1->mUnk_08, &this->mUnk_0C); + VecFx16_Copy2VecFx32(¶m1->mUnk_08, &this->mUnk_0C.vec); return this->UnkStruct_ov031_Items_00::vfunc_08(param1, param2); } @@ -165,7 +163,7 @@ void ActorKeese::func_ov032_0211e0d4(s16 param1, unk32 param2) { UnkStruct_027e0cec *data = data_027e0cec; for (ActorKeese_284 *ptr = this->mUnk_284; ptr != this->mUnk_284 + ARRAY_LEN(this->mUnk_284); ++ptr) { - data->func_ov000_020a0140(ptr, &this->mUnk_2C4); + data->func_ov000_020a0140(ptr, &this->mUnk_2C4.vec); } if (param2 != 0x0) { @@ -182,7 +180,7 @@ void ActorKeese::func_ov032_0211e0d4(s16 param1, unk32 param2) { this->mUnk_27C = 0x877; this->mUnk_280 = 0x2; - data_027e0cec->func_ov000_020a0140(&this->mUnk_278, &this->mUnk_2C4); + data_027e0cec->func_ov000_020a0140(&this->mUnk_278, &this->mUnk_2C4.vec); if (param2 != 0x0) { data_027e09a8->func_ov000_02071b30(0x9822, &this->mPos, 0x0); @@ -203,13 +201,13 @@ void ActorKeese::func_ov032_0211e308() { case 0x1: { UnkStruct_027e0cec *data = data_027e0cec; for (ActorKeese_284 *ptr = this->mUnk_284; ptr != this->mUnk_284 + ARRAY_LEN(this->mUnk_284); ++ptr) { - data->func_ov000_020a0140(ptr, &this->mUnk_2C4); + data->func_ov000_020a0140(ptr, &this->mUnk_2C4.vec); } break; } case 0x2: - data_027e0cec->func_ov000_020a0140(&this->mUnk_278, &this->mUnk_2C4); + data_027e0cec->func_ov000_020a0140(&this->mUnk_278, &this->mUnk_2C4.vec); break; default: @@ -287,7 +285,7 @@ void ActorKeese::Update() { this->func_ov032_0211e308(); if (this->mUnk_46 & 1) { - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); } if ((this->mUnk_120.vfunc_28()->func_02015080(0x1000) != 0 || this->mUnk_120.vfunc_28()->func_02015080(0x9000) != 0) && @@ -369,7 +367,7 @@ void ActorKeese::func_ov032_0211e9ec() { void ActorKeese::func_ov032_0211eb60() { if (this->mUnk_46 & 0x1C) { - this->mAngle = func_01ffbbe0(this->mUnk_2AC.mUnk_0C.x, this->mUnk_2AC.mUnk_0C.z); + this->mAngle = func_01ffbbe0(this->mUnk_2AC.mUnk_0C.vec.x, this->mUnk_2AC.mUnk_0C.vec.z); } this->mAngle += this->mUnk_2A8; @@ -427,7 +425,7 @@ void ActorKeese::func_ov032_0211f0a8() { this->SetState(ActorKeeseState_8); } else { if (this->mTimer.HasExpired() && (this->mUnk_46 & 0x1C)) { - this->mAngle = func_01ffbbe0(this->mUnk_2AC.mUnk_0C.x, this->mUnk_2AC.mUnk_0C.z); + this->mAngle = func_01ffbbe0(this->mUnk_2AC.mUnk_0C.vec.x, this->mUnk_2AC.mUnk_0C.vec.z); this->SetState(ActorKeeseState_0); } else if (func_01ff9258(this->mUnk_5C.mInitialPos.x - this->mPos.x, this->mUnk_5C.mInitialPos.z - this->mPos.z) < 0x800) { @@ -503,7 +501,7 @@ void ActorKeese::func_ov032_0211f3ac() { this->mUnk_248.func_ov000_02097bec(); - this->mUnk_120.vfunc_28()->mUnk_04 = FLOAT_TO_FX32(1.2f); + this->mUnk_120.vfunc_28()->mUnk_04 = FX_F32_TO_FX32(1.2f); this->mUnk_2C = 0x7B; } @@ -513,7 +511,7 @@ void ActorKeese::func_ov032_0211f404() { if (GET_FLAG(this->mFlags, ActorFlag_5)) { if (this->mUnk_48 <= 0x0) { this->Actor::func_ov000_020984d0(); - this->Actor::func_ov017_020bf3e0(0x1, FLOAT_TO_FX32(0.0f)); + this->Actor::func_ov017_020bf3e0(0x1, FX_F32_TO_FX32(0.0f)); this->Actor_Derived2::func_ov000_020997c4(0x0); } else { @@ -538,7 +536,7 @@ void ActorKeese::func_ov032_0211f4a4() { this->mUnk_248.func_ov000_02097bec(); - this->mUnk_120.vfunc_28()->mUnk_04 = FLOAT_TO_FX32(0.8f); + this->mUnk_120.vfunc_28()->mUnk_04 = FX_F32_TO_FX32(0.8f); } void ActorKeese::func_ov032_0211f50c() { @@ -566,7 +564,7 @@ void ActorKeese::func_ov032_0211f58c() { this->vfunc_44(); if (GET_FLAG(this->mFlags, ActorFlag_5)) { - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_248.mUnk_10); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_248.mUnk_10); this->mUnk_268.func_ov000_02099a0c(); @@ -604,7 +602,7 @@ void ActorKeese::func_ov032_0211f804() { case 0x1: { if (this->mTimer.HasExpired()) { VecFx32 vec = this->mPos; - vec.y -= FLOAT_TO_FX32(1.0f); + vec.y -= FX_F32_TO_FX32(1.0f); Actor::func_ov017_020c26f8(0x2, &vec, 0x1, true); diff --git a/src/032_MapA1/Actor/ActorSpinut.cpp b/src/032_MapA1/Actor/ActorSpinut.cpp index 7f5a6470..1139ffcf 100644 --- a/src/032_MapA1/Actor/ActorSpinut.cpp +++ b/src/032_MapA1/Actor/ActorSpinut.cpp @@ -1,5 +1,3 @@ -#define VECFX32_CTORS - #include "Actor/ActorSpinut.hpp" #include "Actor/ActorManager.hpp" @@ -30,7 +28,7 @@ extern "C" Actor *func_02016fbc(ActorId, VecFx32 *, unk32); extern "C" bool func_ov000_0205adfc(VecFx32 *, VecFx32 *); extern "C" void func_ov000_020986b4(s16 *param1, Actor_Derived2 *param2, unk32 param3); -static const VecFx32 data_ov032_02122160(FLOAT_TO_FX32(1.7f), FLOAT_TO_FX32(0.5f), FLOAT_TO_FX32(1.7f)); +static const VecFx32Cpp data_ov032_02122160(FX_F32_TO_FX32(1.7f), FX_F32_TO_FX32(0.5f), FX_F32_TO_FX32(1.7f)); static ActorUnkZLSL_AnimationTag data_ov032_02122184 = {.index = 0, .name = "walk", .unknown = 0x0}; static ActorUnkZLSL_AnimationTag data_ov032_0212219c = {.index = 1, .name = "discover", .unknown = 0x1}; static ActorUnkZLSL_AnimationTag data_ov032_0212216c = {.index = 0, .name = "KURI", .unknown = 0x1}; @@ -73,7 +71,7 @@ Actor *ActorProfileSpinut::Create() { ActorProfileSpinut::ActorProfileSpinut() : ActorProfile_Derived1(ActorId_Spinut) { - this->mUnk_04.Init(FLOAT_TO_FX32(0.4f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.4f)); this->vfunc_04()->mUnk_15 = true; } @@ -93,7 +91,7 @@ ActorSpinut::ActorSpinut() : this->mUnk_228.mUnk_04 |= 0x8000; this->mUnk_294 = true; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_288); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_288); this->mUnk_38 = &this->mUnk_258.mUnk_00; this->mUnk_38->mUnk_08 = 0x01; @@ -101,13 +99,13 @@ ActorSpinut::ActorSpinut() : this->mUnk_296.value = 0; this->mUnk_296.max = 0; - VecFx32_Init(FLOAT_TO_FX32(1.0f), FLOAT_TO_FX32(1.0f), FLOAT_TO_FX32(1.0f), &this->mUnk_27C); + VecFx32_Init(FX_F32_TO_FX32(1.0f), FX_F32_TO_FX32(1.0f), FX_F32_TO_FX32(1.0f), &this->mUnk_27C); this->func_ov000_0209862c(0x4); SET_FLAG(this->mFlags, ActorFlag_9); - this->mUnk_A4 = &data_ov032_02122160; + this->mUnk_A4 = &data_ov032_02122160.vec; } ActorSpinut::~ActorSpinut() {} @@ -201,7 +199,7 @@ void ActorSpinut::Update() { this->Actor::func_ov000_02098b8c(0x1, &this->mUnk_268); if (this->mUnk_46 & 0x1) { - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); } if (this->func_ov032_0211b17c()) { @@ -286,8 +284,8 @@ void ActorSpinut::vfunc_2C(Actor_vfunc_30 *param1) { } void ActorSpinut::func_ov032_02119990() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_264 = 0x3800; this->mUnk_110.vfunc_1C(data_ov032_02122184, 0x1000, 0x19A, 0x0); @@ -316,8 +314,8 @@ void ActorSpinut::func_ov032_02119a0c() { if (func_01ff930c(&this->mAngle.angle_s, this->mUnk_224, 0x71C)) { u16 angle = this->mAngle.angle_u; - this->mVel.x = MUL_FX32(SIN(angle), this->mUnk_220); - this->mVel.z = MUL_FX32(COS(angle), this->mUnk_220); + this->mVel.x = FX_MUL(SIN(angle), this->mUnk_220); + this->mVel.z = FX_MUL(COS(angle), this->mUnk_220); if (this->func_ov032_0211b064(0x0)) { this->SetState(ActorSpinutState_1); @@ -343,8 +341,8 @@ void ActorSpinut::func_ov032_02119be8() { data_027e09a8->func_ov000_02071b30(0x9836, &this->mPos, 0x0); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } // non-matching @@ -379,8 +377,8 @@ void ActorSpinut::func_ov032_02119c80() { void ActorSpinut::func_ov032_02119d7c() { this->mUnk_110.vfunc_1C(data_ov032_02122184, 0x1000, 0x19A, 0x0); this->mTimer.Set(0, 20); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } // non-matching @@ -413,8 +411,8 @@ void ActorSpinut::func_ov032_02119e90() { } this->mUnk_220 = 0x0; - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } // non-matching (case 1) @@ -434,7 +432,7 @@ void ActorSpinut::func_ov032_02119f40() { } this->mUnk_220 = 0x148; - this->mUnk_110.vfunc_28()->mUnk_04 = FLOAT_TO_FX32(2.5f); + this->mUnk_110.vfunc_28()->mUnk_04 = FX_F32_TO_FX32(2.5f); ++this->mUnk_218; break; } @@ -461,7 +459,7 @@ void ActorSpinut::func_ov032_02119f40() { } this->mUnk_220 = 0x0; - this->mUnk_110.vfunc_28()->mUnk_04 = FLOAT_TO_FX32(1.0f); + this->mUnk_110.vfunc_28()->mUnk_04 = FX_F32_TO_FX32(1.0f); this->SetState(ActorSpinutState_9); break; @@ -473,8 +471,8 @@ void ActorSpinut::func_ov032_02119f40() { } u16 angle = this->mAngle.angle_u; - this->mVel.x = MUL_FX32(SIN(angle), this->mUnk_220); - this->mVel.z = MUL_FX32(COS(angle), this->mUnk_220); + this->mVel.x = FX_MUL(SIN(angle), this->mUnk_220); + this->mVel.z = FX_MUL(COS(angle), this->mUnk_220); this->func_ov032_0211b1e0(); } @@ -493,8 +491,8 @@ void ActorSpinut::func_ov032_0211a140() { this->mUnk_21C = var; - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mTimer.Set(0, 30); } @@ -518,18 +516,18 @@ void ActorSpinut::func_ov032_0211a52c() { fx32 cosValue = COS((u16) this->mAngle.angle_s); this->mUnk_220 = val; - this->mVel.x = MUL_FX32(sinValue, val); - this->mVel.z = MUL_FX32(cosValue, val); + this->mVel.x = FX_MUL(sinValue, val); + this->mVel.z = FX_MUL(cosValue, val); if (val > 0x0) { return; } - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_220 = 0x0; - this->mUnk_110.vfunc_28()->mUnk_04 = FLOAT_TO_FX32(1.0f); + this->mUnk_110.vfunc_28()->mUnk_04 = FX_F32_TO_FX32(1.0f); ++this->mUnk_218; break; } @@ -549,7 +547,7 @@ void ActorSpinut::func_ov032_0211a52c() { data_027e0cec->func_ov000_0209feac(0x880, &this->mPos, 0x2, 0x0, 0x0); this->mUnk_110.vfunc_28()->mUnk_02 = 0x0; - this->mUnk_110.vfunc_28()->mUnk_08 = FLOAT_TO_FX32(0.0f); + this->mUnk_110.vfunc_28()->mUnk_08 = FX_F32_TO_FX32(0.0f); data_027e09a8->func_ov000_02071b30(0x9836, &this->mPos, 0x0); @@ -613,8 +611,8 @@ void ActorSpinut::func_ov032_0211a86c() { void ActorSpinut::func_ov032_0211a950() { this->mUnk_110.vfunc_1C(data_ov032_02122184, 0x1000, 0x19A, 0x0); this->mTimer.Set(0, 20); - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); } void ActorSpinut::func_ov032_0211a9c8() { @@ -674,7 +672,7 @@ void ActorSpinut::func_ov032_0211abc0() { } this->mUnk_38->mUnk_08 = 0x1; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_228.mUnk_10); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_228.mUnk_10); this->mUnk_248.func_ov000_02099a0c(); @@ -684,8 +682,8 @@ void ActorSpinut::func_ov032_0211abc0() { } void ActorSpinut::func_ov032_0211ac20() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mTimer.Set(0, 10); this->mUnk_110.vfunc_1C(data_ov032_02122184, 0x1000, 0x19A, 0x0); } @@ -710,8 +708,8 @@ void ActorSpinut::func_ov032_0211ac94() { } void ActorSpinut::func_ov032_0211ad40() { - this->mVel.x = FLOAT_TO_FX32(0.0f); - this->mVel.z = FLOAT_TO_FX32(0.0f); + this->mVel.x = FX_F32_TO_FX32(0.0f); + this->mVel.z = FX_F32_TO_FX32(0.0f); this->mUnk_110.vfunc_1C(data_ov032_02122184, 0x1000, 0x19A, 0x0); this->mUnk_296.Set(0, gRandom.Next32(14)); } @@ -809,8 +807,8 @@ void ActorSpinut::func_ov032_0211b1e0() { // non-matching void ActorSpinut::func_ov032_0211b298() { if (this->mUnk_110.vfunc_30() != 0x1) { - if (this->mUnk_288.y <= FLOAT_TO_FX32(0.0f)) { - this->mUnk_288.z = FLOAT_TO_FX32(0.0f); + if (this->mUnk_288.y <= FX_F32_TO_FX32(0.0f)) { + this->mUnk_288.z = FX_F32_TO_FX32(0.0f); return; } @@ -822,13 +820,13 @@ void ActorSpinut::func_ov032_0211b298() { fx32 value = this->mUnk_110.vfunc_28()->mUnk_08; - if (value > FLOAT_TO_FX32(1.0f) && value < FLOAT_TO_FX32(16.0f)) { - value -= FLOAT_TO_FX32(1.0f); - this->mUnk_288.y = MUL_FX32(value + MUL_FX32(-MUL_FX32(value, value), 0x92492493), 0x3B4); + if (value > FX_F32_TO_FX32(1.0f) && value < FX_F32_TO_FX32(16.0f)) { + value -= FX_F32_TO_FX32(1.0f); + this->mUnk_288.y = FX_MUL(value + FX_MUL(-FX_MUL(value, value), 0x92492493), 0x3B4); return; } - this->mUnk_288.y = FLOAT_TO_FX32(0.0f); + this->mUnk_288.y = FX_F32_TO_FX32(0.0f); } void ActorSpinut::func_ov032_0211b37c(Actor *thisx, Actor_vfunc_30 *param1) { @@ -894,7 +892,7 @@ void ActorSpinut::vfunc_54(unk32 param1) { } ActorSpinut_268::ActorSpinut_268() { - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_08); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_08); } ActorSpinut_268::~ActorSpinut_268() {} diff --git a/src/032_MapA1/MapObject/MapObjectUnkSWSW.cpp b/src/032_MapA1/MapObject/MapObjectUnkSWSW.cpp index e3e0edf2..c11fcf12 100644 --- a/src/032_MapA1/MapObject/MapObjectUnkSWSW.cpp +++ b/src/032_MapA1/MapObject/MapObjectUnkSWSW.cpp @@ -1,5 +1,3 @@ -#define VECFX32_CTORS - #include "MapObject/MapObjectUnkSWSW.hpp" #include "profile.hpp" @@ -35,8 +33,8 @@ MapObjectProfileUnkSWSW::MapObjectProfileUnkSWSW() : MapObjectProfileUnkSWSW_Base(MapObjectId_SWSW) { this->mUnk_D4.mUnk_08 = 0x7007; - VecFx32_Init(FLOAT_TO_FX32(-0.5002f), FLOAT_TO_FX32(-1.0002), FLOAT_TO_FX32(-1.0002), &this->mUnk_D4.mUnk_0C); - VecFx32_Init(FLOAT_TO_FX32(0.5f), FLOAT_TO_FX32(1.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_D4.mUnk_18); + VecFx32_Init(FX_F32_TO_FX32(-0.5002f), FX_F32_TO_FX32(-1.0002), FX_F32_TO_FX32(-1.0002), &this->mUnk_D4.mUnk_0C); + VecFx32_Init(FX_F32_TO_FX32(0.5f), FX_F32_TO_FX32(1.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_D4.mUnk_18); this->mUnk_D4.mUnk_04 |= 0x2; this->mUnk_06 = -0x1; @@ -60,14 +58,14 @@ MapObjectUnkSWSW_40::MapObjectUnkSWSW_40(G3d_Model *pModel) : void MapObjectUnkSWSW_40::vfunc_1C(UnkSystem4_vfunc_1C *param1) { if (param1->mUnk_00[0x1] == this->mUnk_60) { param1->mUnk_B4->mUnk_00 &= ~0x2; - Mat3p_InitXRotation(¶m1->mUnk_B4->mUnk_28, SIN((u16) this->mUnk_68), COS((u16) this->mUnk_68)); + MtxFx33_InitXRotation(¶m1->mUnk_B4->mUnk_28, SIN((u16) this->mUnk_68), COS((u16) this->mUnk_68)); } if (param1->mUnk_00[0x1] != this->mUnk_64) { return; } param1->mUnk_B4->mUnk_00 &= ~0x2; - Mat3p_InitXRotation(¶m1->mUnk_B4->mUnk_28, SIN((u16) this->mUnk_6A), COS((u16) this->mUnk_6A)); + MtxFx33_InitXRotation(¶m1->mUnk_B4->mUnk_28, SIN((u16) this->mUnk_6A), COS((u16) this->mUnk_6A)); } struct UnkStruct_ov032_021210a0 { @@ -100,7 +98,7 @@ void MapObjectUnkSWSW_40::func_ov032_021210a0(fx32 param1) { MapObjectUnkSWSW::MapObjectUnkSWSW() : mUnk_040(G3d_GetUnkPtr(GET_PROFILE_20_50(MapObjectProfileUnkSWSW), &data_ov032_02121ef4)), mUnk_0AC(&this->mUnk_0CC, NULL), - mUnk_0EC(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.5f), FLOAT_TO_FX32(-0.4202f)), + mUnk_0EC(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.5f), FX_F32_TO_FX32(-0.4202f)), mUnk_0F8(NULL), mUnk_0FC(0x4), mUnk_100(0, 0), @@ -119,11 +117,11 @@ bool MapObjectUnkSWSW::Init() { func_01ffedac(&sp00, &this->mPos); if (data_027e0cd8_0C->func_ov000_02080180(&sp00) == 0x14) { - this->mPos.y = FLOAT_TO_FX32(0.0f); + this->mPos.y = FX_F32_TO_FX32(0.0f); } if (this->mUnk_20.mParams[2] != 0x0) { - this->mPos.y += MUL_FX32(this->mUnk_20.mParams[2] << 0xC, 0x1333); + this->mPos.y += FX_MUL(this->mUnk_20.mParams[2] << 0xC, 0x1333); } this->mUnk_0AC.mpModel = this->mUnk_040.mpModel; @@ -155,7 +153,8 @@ bool MapObjectUnkSWSW::Init() { if (this->mUnk_20.mParams[0] == 0x0) { VecFx32 sp04; - VecFx32_Init(this->mPos.x + this->mUnk_0EC.x, this->mPos.y + this->mUnk_0EC.y, this->mPos.z + this->mUnk_0EC.z, &sp04); + VecFx32_Init(this->mPos.x + this->mUnk_0EC.vec.x, this->mPos.y + this->mUnk_0EC.vec.y, + this->mPos.z + this->mUnk_0EC.vec.z, &sp04); ActorUnkNSSW *actorNSSW = this->func_ov032_02121dc8(&sp04); this->mUnk_0F8 = actorNSSW; @@ -163,7 +162,7 @@ bool MapObjectUnkSWSW::Init() { this->vfunc_3C(0x0); - this->mUnk_108 = FLOAT_TO_FX32(0.0f); + this->mUnk_108 = FX_F32_TO_FX32(0.0f); this->MapObject::func_ov000_0209d2c4(0x1, true); @@ -173,7 +172,7 @@ bool MapObjectUnkSWSW::Init() { } else { this->vfunc_3C(0x2); - this->mUnk_108 = FLOAT_TO_FX32(1.0f); + this->mUnk_108 = FX_F32_TO_FX32(1.0f); this->MapObject::func_ov000_0209d2c4(0x0, true); @@ -213,10 +212,10 @@ void MapObjectUnkSWSW::vfunc_08() { VecFx32_Normalize(&sp48, &sp48); VecFx32 sp3C; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(1.0f), &sp3C); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(1.0f), &sp3C); bool var_r5 = false; - if (VecFx32_Dot(&sp48, &sp3C) > FLOAT_TO_FX32(0.4f)) { + if (VecFx32_Dot(&sp48, &sp3C) > FX_F32_TO_FX32(0.4f)) { s16 param = (s16) func_01ffbbe0(sp48.x, sp48.z); func_01ff91b8(&this->mUnk_10C, param, 0x333); @@ -264,8 +263,8 @@ void MapObjectUnkSWSW::vfunc_08() { VecFx32 sp18; VecFx32 sp0C; if (this->mUnk_100.HasReachedMax()) { - VecFx32_Init(this->mPos.x + this->mUnk_0EC.x, this->mPos.y + this->mUnk_0EC.y, this->mPos.z + this->mUnk_0EC.z, - &sp30); + VecFx32_Init(this->mPos.x + this->mUnk_0EC.vec.x, this->mPos.y + this->mUnk_0EC.vec.y, + this->mPos.z + this->mUnk_0EC.vec.z, &sp30); sp18 = sp30; ActorUnkNSSW *actorNSSW = this->mUnk_0F8; @@ -279,9 +278,9 @@ void MapObjectUnkSWSW::vfunc_08() { this->vfunc_3C(0x0); } else { - fx32 z = this->mPos.z + this->mUnk_0EC.z + + fx32 z = this->mPos.z + this->mUnk_0EC.vec.z + func_02015a18(this->mUnk_100.max << 0xC, 0, -0x1000, 0, this->mUnk_100.value << 0xC, 0, 0); - VecFx32_Init(this->mPos.x + this->mUnk_0EC.x, this->mPos.y + this->mUnk_0EC.y, z, &sp24); + VecFx32_Init(this->mPos.x + this->mUnk_0EC.vec.x, this->mPos.y + this->mUnk_0EC.vec.y, z, &sp24); sp0C = sp24; @@ -356,8 +355,8 @@ bool MapObjectUnkSWSW::vfunc_1C(ActorRef param1, unk32 param2, VecFx32 *param3) VecFx32 sp14; VecFx32 sp08; - VecFx32_Init(this->mPos.x + this->mUnk_0EC.x, this->mPos.y + this->mUnk_0EC.y, this->mPos.z + this->mUnk_0EC.z, - &sp14); + VecFx32_Init(this->mPos.x + this->mUnk_0EC.vec.x, this->mPos.y + this->mUnk_0EC.vec.y, + this->mPos.z + this->mUnk_0EC.vec.z, &sp14); sp08 = sp14; ActorUnkNSSW *nssw114 = this->mUnk_114; @@ -443,8 +442,8 @@ void MapObjectUnkSWSW::vfunc_3C(unk32 param1) { VecFx32 sp0C; VecFx32 sp00; - VecFx32_Init(this->mPos.x + this->mUnk_0EC.x, this->mPos.y + this->mUnk_0EC.y, this->mPos.z + this->mUnk_0EC.z, - &sp0C); + VecFx32_Init(this->mPos.x + this->mUnk_0EC.vec.x, this->mPos.y + this->mUnk_0EC.vec.y, + this->mPos.z + this->mUnk_0EC.vec.z, &sp0C); ActorUnkNSSW *actorNSSW = this->func_ov032_02121dc8(&sp0C); this->mUnk_0F8 = actorNSSW; @@ -453,8 +452,8 @@ void MapObjectUnkSWSW::vfunc_3C(unk32 param1) { this->mUnk_100.Set(0, 40); this->mUnk_0AC.func_ov000_020577f8(0x1000); - VecFx32_Init(this->mPos.x + this->mUnk_0EC.x, this->mPos.y + this->mUnk_0EC.y, - this->mPos.z + this->mUnk_0EC.z - FLOAT_TO_FX32(1.0f), &sp18); + VecFx32_Init(this->mPos.x + this->mUnk_0EC.vec.x, this->mPos.y + this->mUnk_0EC.vec.y, + this->mPos.z + this->mUnk_0EC.vec.z - FX_F32_TO_FX32(1.0f), &sp18); sp00 = sp18; ActorUnkNSSW *nssw0F8 = this->mUnk_0F8; @@ -478,14 +477,15 @@ void MapObjectUnkSWSW::vfunc_3C(unk32 param1) { void MapObjectUnkSWSW::vfunc_14(unk32 param1) { VecFx32 vec; - VecFx32_Init(this->mPos.x + this->mUnk_0EC.x, this->mPos.y + this->mUnk_0EC.y, this->mPos.z + this->mUnk_0EC.z, &vec); + VecFx32_Init(this->mPos.x + this->mUnk_0EC.vec.x, this->mPos.y + this->mUnk_0EC.vec.y, this->mPos.z + this->mUnk_0EC.vec.z, + &vec); this->mUnk_040.func_01ffc6d4(this->mAngle, &vec); } struct UnkStack_ov032_02121dc8 { /* 00 */ ActorRef ref; - /* 04 */ STRUCT_PAD(0x04, 0x08); + /* 04 */ PAD(0x04, 0x08); /* 08 */ }; diff --git a/src/063_Shrine/Actor/ActorUnkCANS.cpp b/src/063_Shrine/Actor/ActorUnkCANS.cpp index efe0a715..1eead5d3 100644 --- a/src/063_Shrine/Actor/ActorUnkCANS.cpp +++ b/src/063_Shrine/Actor/ActorUnkCANS.cpp @@ -38,7 +38,7 @@ extern ActorUnkZLSL_AnimationTag data_ov063_02163098; extern ActorUnkZLSL_AnimationTag data_ov063_021630b0; extern VecFx32 data_027e07d4; -extern Mat4x3p data_027e0964; +extern MtxFx43 data_027e0964; extern UnkStruct_027e09c0 *data_027e09c0; extern "C" void func_01ff916c(unk32 *param1, unk32 param2, unk32 param3); @@ -46,7 +46,7 @@ extern "C" unk32 func_01ff9258(unk32, unk32); extern "C" unk32 func_01ff930c(s16 *, unk16, unk32); extern "C" void func_01ff9638(VecFx32 *param1, fx16 param2); extern "C" fx32 func_01ff9a5c(VecFx32 *, VecFx32 *, VecFx32 *); -extern "C" void func_01ffad5c(Mat4x3p *, Mat4x3p *, Mat4x3p *); +extern "C" void func_01ffad5c(MtxFx43 *, MtxFx43 *, MtxFx43 *); extern "C" fx32 func_01ffb428(unk32, unk32); extern "C" void func_01ffb714(VecFx32 *, VecFx32 *, VecFx32 *); extern "C" unk32 func_01ffbbe0(fx32 param1, fx32 param2); @@ -72,7 +72,7 @@ extern "C" unk32 func_ov000_02098d7c(ActorUnkCANS *param1, UnkStruct_ov063_02162 extern "C" void func_ov026_020f46a8(Actor *param1, VecFx32 *param2, bool param3); #endif -extern "C" void G3d_GetCurrentMtx(Mat4x3p *mtx1, Mat3p *mtx2); +extern "C" void G3d_GetCurrentMtx(MtxFx43 *mtx1, MtxFx33 *mtx2); const Cylinder data_ov063_02162e90(0, 0x99A, 0, 0x99A); @@ -130,8 +130,8 @@ unk32 UnkStruct_ov063_02162e88::vfunc_04(ActorRef param1, unk32 param2, unk32 pa if (ret4 != NULL && ret4->GetActorId() == ActorId_ShotArrow) { u16 angle = ((ActorUnkCANS *) mUnk_20)->mAngle.angle_s; - fx32 sin_val = MUL_FX32(SIN(angle), FLOAT_TO_FX32(1.f)); - fx32 cos_val = MUL_FX32(COS(angle), FLOAT_TO_FX32(1.f)); + fx32 sin_val = FX_MUL(SIN(angle), FX_F32_TO_FX32(1.f)); + fx32 cos_val = FX_MUL(COS(angle), FX_F32_TO_FX32(1.f)); VecFx32 vec; // VecFx32_Init doesn't match vec.x = sin_val; @@ -473,8 +473,8 @@ void ActorUnkCANS::func_ov063_02158b98(void) { func_01ff916c(&mUnk_270, mUnk_276 * 0xCD, 0xCD); u16 angle = (fx16) (fx32) (mUnk_26C + 0x4000); - mVel.x = MUL_FX32(SIN(angle), mUnk_270); - mVel.z = MUL_FX32(COS(angle), mUnk_270); + mVel.x = FX_MUL(SIN(angle), mUnk_270); + mVel.z = FX_MUL(COS(angle), mUnk_270); if (this->func_ov063_0215a514() != 0) { this->func_ov063_02158448(8); @@ -513,8 +513,8 @@ void ActorUnkCANS::func_ov063_02158db0(void) { VecFx32 vec = {mPos.x, mPos.y, mPos.z}; - vec.x = MUL_FX32(SIN((u16) mUnk_26C), ret1); - vec.z = MUL_FX32(COS((u16) mUnk_26C), mPos.z); + vec.x = FX_MUL(SIN((u16) mUnk_26C), ret1); + vec.z = FX_MUL(COS((u16) mUnk_26C), mPos.z); unk32 param2 = func_01ff9a5c(data_027e0ce0->func_01fff148(0), &mPos, &vec) < threshold ? 0 : mUnk_276 * 0x3AE; @@ -523,8 +523,8 @@ void ActorUnkCANS::func_ov063_02158db0(void) { s16 iVar5b = mUnk_26C + 0x4000; fx32 sin_val = SIN((u16) iVar5b); fx32 cos_val = COS((u16) iVar5b); - mVel.x = MUL_FX32(sin_val, mUnk_270); - mVel.z = MUL_FX32(cos_val, mUnk_270); + mVel.x = FX_MUL(sin_val, mUnk_270); + mVel.z = FX_MUL(cos_val, mUnk_270); if (this->func_ov063_0215a514()) { this->func_ov063_02158448(8); @@ -616,8 +616,8 @@ void ActorUnkCANS::func_ov063_02159258(void) { fx16 angle = mUnk_26C + DEG_TO_ANG(90); fx32 sin_val = SIN((u16) angle); fx32 cos_val = COS((u16) angle); - mVel.x = MUL_FX32(sin_val, val); - mVel.z = MUL_FX32(cos_val, val); + mVel.x = FX_MUL(sin_val, val); + mVel.z = FX_MUL(cos_val, val); if (!mUnk_270 && this->func_ov063_0215a514()) { this->func_ov063_02158448(8); @@ -709,12 +709,12 @@ void ActorUnkCANS::func_ov063_02159784(void) { fx32 yDiff = data_027e0ce0->func_01fff148(0)->y - mPos.y; fx32 yDiffAbs = ABS(yDiff); - if (yDiffAbs < FLOAT_TO_FX32(.5f)) + if (yDiffAbs < FX_F32_TO_FX32(.5f)) #endif { Cylinder vec1; - vec1.Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(1.2f)); + vec1.Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(1.2f)); this->func_ov063_0215a5a0(&vec1.pos); @@ -767,14 +767,14 @@ void ActorUnkCANS::func_ov063_021599e4(void) { } func_01ff916c(&mUnk_270, mUnk_276 * 0x19A, 0xCD); - fx16 angle1 = mUnk_26C - FLOAT_TO_FX32(8.f); - fx16 angle2 = mUnk_26C + FLOAT_TO_FX32(4.f); + fx16 angle1 = mUnk_26C - FX_F32_TO_FX32(8.f); + fx16 angle2 = mUnk_26C + FX_F32_TO_FX32(4.f); u64 sin_val1 = SIN((u16) angle1); s64 cos_val1 = COS((u16) angle1); s64 sin_val2 = SIN((u16) angle2); s64 cos_val2 = COS((u16) angle2); - mVel.x = MUL_FX32(sin_val1, FLOAT_TO_FX32(0.02f)) + MUL_FX32(sin_val2, mUnk_270); // *0.02f <=> / 50 - mVel.z = MUL_FX32(cos_val1, FLOAT_TO_FX32(0.02f)) + MUL_FX32(cos_val2, mUnk_270); + mVel.x = FX_MUL(sin_val1, FX_F32_TO_FX32(0.02f)) + FX_MUL(sin_val2, mUnk_270); // *0.02f <=> / 50 + mVel.z = FX_MUL(cos_val1, FX_F32_TO_FX32(0.02f)) + FX_MUL(cos_val2, mUnk_270); if (this->func_ov063_0215a514()) { this->func_ov063_02158448(8); @@ -796,12 +796,12 @@ void ActorUnkCANS::func_ov063_02159ca8(void) { mAngle--; } - mUnk_26C += -FLOAT_TO_FX32(8.f); + mUnk_26C += -FX_F32_TO_FX32(8.f); } void ActorUnkCANS::func_ov063_02159d68(void) { if (this->func_ov063_0215a514()) { - mUnk_26C += -FLOAT_TO_FX32(8.f); + mUnk_26C += -FX_F32_TO_FX32(8.f); } if (!func_01ff930c(&mAngle.angle_s, mUnk_26C, 0x71C)) { @@ -860,7 +860,7 @@ void ActorUnkCANS::func_ov063_02159ec0(void) { mUnk_224.func_ov000_02099a0c(); - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &mUnk_200.mUnk_10); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &mUnk_200.mUnk_10); this->func_ov063_02158448(4); @@ -878,19 +878,19 @@ unk32 ActorUnkCANS::func_ov063_02159f3c(unk32 param1) { return false; } - fx32 factor = FLOAT_TO_FX32(10.f); + fx32 factor = FX_F32_TO_FX32(10.f); - fx16 angle1 = mUnk_26C - FLOAT_TO_FX32(4.f); - s32 sin_val1 = MUL_FX32(SIN((u16) angle1), factor); - s32 cos_val1 = MUL_FX32(COS((u16) angle1), factor); - fx16 angle2 = mUnk_26C + FLOAT_TO_FX32(4.f); - s32 sin_val2 = MUL_FX32(SIN((u16) angle2), factor); - s32 cos_val2 = MUL_FX32(COS((u16) angle2), factor); + fx16 angle1 = mUnk_26C - FX_F32_TO_FX32(4.f); + s32 sin_val1 = FX_MUL(SIN((u16) angle1), factor); + s32 cos_val1 = FX_MUL(COS((u16) angle1), factor); + fx16 angle2 = mUnk_26C + FX_F32_TO_FX32(4.f); + s32 sin_val2 = FX_MUL(SIN((u16) angle2), factor); + s32 cos_val2 = FX_MUL(COS((u16) angle2), factor); VecFx32 vec1; // = {mPos.x, mPos.y, mPos.z}; // VecFx32_Copy(&mPos, &vec1); - // VecFx32_Init(mPos.x + MUL_FX32(sin_val1, factor), mPos.y, mPos.z + - // MUL_FX32(cos_val1, factor), &vec1); vec1.y = mPos.y; + // VecFx32_Init(mPos.x + FX_MUL(sin_val1, factor), mPos.y, mPos.z + + // FX_MUL(cos_val1, factor), &vec1); vec1.y = mPos.y; vec1.y = mPos.y; vec1.x = mPos.x; vec1.z = mPos.z; @@ -899,7 +899,7 @@ unk32 ActorUnkCANS::func_ov063_02159f3c(unk32 param1) { VecFx32 vec2; // = {*(volatile fx32 *) &mPos.x, *(volatile fx32 *) &mPos.y, *(volatile fx32 *) &mPos.z}; // VecFx32_Copy(&mPos, &vec2); - // VecFx32_Init(mPos.x + MUL_FX32(sin_val2, factor), mPos.y, mPos.z + MUL_FX32(cos_val2, factor), &vec2); + // VecFx32_Init(mPos.x + FX_MUL(sin_val2, factor), mPos.y, mPos.z + FX_MUL(cos_val2, factor), &vec2); // vec2.y = mPos.y; vec2.x = mPos.x; vec2.y = mPos.y; @@ -948,8 +948,8 @@ unk32 ActorUnkCANS::func_ov063_0215a0f0(void) { fx16 angle = mUnk_26C; s32 sin_val = SIN((u16) angle); s32 cos_val = COS((u16) angle); - s16 sin_mul = MUL_FX32(sin_val, 0x4000); - s16 cos_mul = MUL_FX32(cos_val, 0x4000); + s16 sin_mul = FX_MUL(sin_val, 0x4000); + s16 cos_mul = FX_MUL(cos_val, 0x4000); VecFx32 vec; //= {mPos.x, mPos.y, mPos.z}; vec.y = mPos.y; vec.x = mPos.x + sin_mul + sin_val; @@ -1100,22 +1100,20 @@ void ActorUnkCANS::vfunc_10(Cylinder *param1) { if (this->mUnk_268 != NULL) { fx16 angle = this->mAngle.angle_s; VecFx32 pos; - VecFx32_Init(FLOAT_TO_FX32(0.25f), 0, 0, &pos); + VecFx32_Init(FX_F32_TO_FX32(0.25f), 0, 0, &pos); func_01ff9638(&pos, angle); VecFx32_Add(¶m1->pos, &pos, ¶m1->pos); } } -// non-matching void ActorUnkCANS::func_ov063_0215a678(ActorUnkCANS *actor, UnkStruct_func_ov063_0215a678 *param2) { ModelRender *modelRender = param2->mUnk_04; - u8 var1; + if (actor->mUnk_268 == NULL) { - var1 = 0; + func_0200eab0(modelRender->mpModel, actor->mUnk_0B0.mUnk_6C, 0x00); } else { - var1 = 0x1F; + func_0200eab0(modelRender->mpModel, actor->mUnk_0B0.mUnk_6C, 0x1F); } - func_0200eab0(modelRender->mpModel, actor->mUnk_0B0.mUnk_6C, var1); unk32 var2 = param2->mUnk_08 & 0x10 ? param2->mUnk_AE : -1; if (var2 == actor->mUnk_0B0.mUnk_70) { @@ -1129,16 +1127,15 @@ void ActorUnkCANS::func_ov063_0215a678(ActorUnkCANS *actor, UnkStruct_func_ov063 return; } - Mat4x3p matx1; - Mat4x3p matx2; + MtxFx43 matx1; + MtxFx43 matx2; G3d_GetCurrentMtx(&matx1, NULL); func_01ffad5c(&matx1, &data_027e0964, &matx2); VecFx32 vec; - // VecFx32_Copy(&matx2.wColumn, &actor->mUnk_250); - vec.x = matx2.wColumn.x; - vec.z = matx2.wColumn.z; - vec.y = matx2.wColumn.y; + vec.x = matx2._30; + vec.z = matx2._32; + vec.y = matx2._31; actor->mUnk_250.x = vec.x; actor->mUnk_250.y = vec.y; actor->mUnk_250.z = vec.z; @@ -1160,15 +1157,15 @@ void ActorUnkCANS::func_ov063_0215a678(ActorUnkCANS *actor, UnkStruct_func_ov063 return; } - Mat4x3p matx3; - Mat4x3p matx4; + MtxFx43 matx3; + MtxFx43 matx4; G3d_GetCurrentMtx(&matx3, NULL); func_01ffad5c(&matx3, &data_027e0964, &matx4); VecFx32 vec; - vec.x = matx4.wColumn.x; - vec.z = matx4.wColumn.z; - vec.y = matx4.wColumn.y; + vec.x = matx4._30; + vec.z = matx4._32; + vec.y = matx4._31; actor->mUnk_25C = vec.x; actor->mUnk_260 = vec.y; actor->mUnk_264 = vec.z; diff --git a/src/063_Shrine/Actor/ActorUnkCASE.cpp b/src/063_Shrine/Actor/ActorUnkCASE.cpp index aa65d524..19a27dc3 100644 --- a/src/063_Shrine/Actor/ActorUnkCASE.cpp +++ b/src/063_Shrine/Actor/ActorUnkCASE.cpp @@ -1,5 +1,3 @@ -#define VECFX32_CTORS //! TODO: remove this hack - #include "Actor/ActorUnkCASE.hpp" #include "Actor/Actor.hpp" #include "Actor/ActorId.hpp" @@ -23,10 +21,10 @@ extern const Actor_Derived2_A8_PTR data_ov063_02162558; extern const void *data_ov063_02162568; -extern Mat4x3p data_027e0964; -extern "C" void func_01ffa60c(const Mat3p *, Mat3p *, Mat3p *); -extern "C" void func_01ffa7a0(VecFx32 *, Mat3p *, VecFx32 *); -extern "C" void func_01ffad5c(Mat4x3p *, Mat4x3p *, Mat4x3p *); +extern MtxFx43 data_027e0964; +extern "C" void func_01ffa60c(const MtxFx33 *, MtxFx33 *, MtxFx33 *); +extern "C" void func_01ffa7a0(VecFx32 *, MtxFx33 *, VecFx32 *); +extern "C" void func_01ffad5c(MtxFx43 *, MtxFx43 *, MtxFx43 *); extern "C" void func_01ffb714(VecFx32 *, VecFx32 *, VecFx32 *); extern "C" u16 func_01ffbbe0(fx32 x, fx32 z); @@ -36,7 +34,7 @@ extern u16 data_ov000_020aed00; extern "C" void func_ov000_0207b70c(ActorUnkCASE_174 *param1, Actor *param2); // Other -extern "C" void G3d_GetCurrentMtx(Mat4x3p *mtx1, Mat3p *mtx2); +extern "C" void G3d_GetCurrentMtx(MtxFx43 *mtx1, MtxFx33 *mtx2); struct UnkStruct_data_ov063_021630c8 { /* 00 */ unk32 mUnk_00; @@ -219,7 +217,7 @@ void ActorUnkCASE::func_ov063_0215afb8(void) { return; } - //! INFO: Actually a Mat3p, this is only used to allow a "batched" copy (all 9 elements at a time, not 3 by 3) + //! INFO: Actually a MtxFx33, this is only used to allow a "batched" copy (all 9 elements at a time, not 3 by 3) struct Fx32Array9 { fx32 array[9]; }; @@ -274,11 +272,11 @@ void ActorUnkCASE::func_ov063_0215b1bc(void) { mVel.z = 0; VecFx32 vec; - VecFx32_Init(0, 0, FLOAT_TO_FX32(1.0f), &vec); + VecFx32_Init(0, 0, FX_F32_TO_FX32(1.0f), &vec); func_01ffa7a0(&vec, &mUnk_1A4, &vec); s16 angle = func_01ffbbe0(vec.x, vec.z); - Mat3p_InitYRotation(&mUnk_1A4, SIN((u16) angle), COS((u16) angle)); + MtxFx33_InitYRotation(&mUnk_1A4, SIN((u16) angle), COS((u16) angle)); } void ActorUnkCASE::func_ov063_0215b244(void) { @@ -360,7 +358,7 @@ void ActorUnkCASE::Update() { x_neg = vec2->x; } else if (mState == 5) { VecFx32 vec1; - vec1 = mUnk_1CC; + vec1 = mUnk_1CC.vec; func_01ffb714(&vec1, &mPos, &vec1); z = vec1.z; @@ -372,7 +370,7 @@ void ActorUnkCASE::Update() { ((VecFx16 *) &mUnk_150.mUnk_0E)->z = z; vec2 = data_027e0ce0->func_01fff148(0); - vec_base = &mUnk_1CC; + vec_base = &mUnk_1CC.vec; z_pos = vec_base->z; z_neg = vec2->z; x_pos = vec_base->x; @@ -434,9 +432,9 @@ void ActorUnkCASE::vfunc_2C(Actor_vfunc_30 *param1) { fx32 sin_val = SIN((u16) mUnk_1C8); fx32 cos_val = COS((u16) mUnk_1C8); - Mat3p mat2; - Mat3p mat1; - Mat3p_InitZRotation(&mat1, sin_val, cos_val); + MtxFx33 mat2; + MtxFx33 mat1; + MtxFx33_InitZRotation(&mat1, sin_val, cos_val); func_01ffa60c(&mat1, &mUnk_1A4, &mat2); mUnk_0B0.vfunc_14(&mat2, &mPos); @@ -560,16 +558,16 @@ void ActorUnkCASE::func_ov063_0215b99c(ActorUnkCASE *param1, UnkStruct_func_ov06 return; } - Mat4x3p matx1, matx2; + MtxFx43 matx1, matx2; G3d_GetCurrentMtx(&matx1, NULL); func_01ffad5c(&matx1, &data_027e0964, &matx2); // VecFx32_Copy(&matx2.wColumn, ¶m1->mUnk_1CC); - fx32 x = matx2.wColumn.x; - fx32 z = matx2.wColumn.z; - fx32 y = matx2.wColumn.y; - param1->mUnk_1CC.x = x; - param1->mUnk_1CC.y = y; - param1->mUnk_1CC.z = z; + fx32 x = matx2._30; + fx32 z = matx2._32; + fx32 y = matx2._31; + param1->mUnk_1CC.vec.x = x; + param1->mUnk_1CC.vec.y = y; + param1->mUnk_1CC.vec.z = z; param2->mUnk_92 = 2; var2[0x25] = 2; diff --git a/src/063_Shrine/Actor/ActorUnkRBLS.cpp b/src/063_Shrine/Actor/ActorUnkRBLS.cpp index 0f06fc57..08a47d42 100644 --- a/src/063_Shrine/Actor/ActorUnkRBLS.cpp +++ b/src/063_Shrine/Actor/ActorUnkRBLS.cpp @@ -23,8 +23,8 @@ ActorUnkRBLS::ActorUnkRBLS() : mUnk_F4(&mUnk_94, GET_PROFILE(ActorProfileUnkRBLS)->vfunc_04()) {} bool ActorUnkRBLS::Init(unk32 param1) { - this->mPos.x -= FLOAT_TO_FX32(0.5f); - this->mPos.z -= FLOAT_TO_FX32(0.5f); + this->mPos.x -= FX_F32_TO_FX32(0.5f); + this->mPos.z -= FX_F32_TO_FX32(0.5f); this->mPos.y = 0; func_ov000_02099f64(&this->mUnk_F4, data_ov063_02163740, 0x1000); this->mUnk_F4.vfunc_3C(); diff --git a/src/063_Shrine/MapObject/MapObjectUnkLTRW.cpp b/src/063_Shrine/MapObject/MapObjectUnkLTRW.cpp index d1b09228..789aa560 100644 --- a/src/063_Shrine/MapObject/MapObjectUnkLTRW.cpp +++ b/src/063_Shrine/MapObject/MapObjectUnkLTRW.cpp @@ -39,10 +39,10 @@ MapObject *MapObjectProfileUnkLTRW::Create() { MapObjectProfileUnkLTRW::MapObjectProfileUnkLTRW() : MapObjectProfileUnkLTRW_Base(MapObjectId_LTRW, MapObjectId_LTRW) { mUnk_D4.mUnk_08 = 0x04007007; - VecFx32_Init(data_ov063_021639c4.vec.x - FLOAT_TO_FX32(.6f), data_ov063_021639c4.vec.y, - data_ov063_021639c4.vec.z - FLOAT_TO_FX32(.4f), &mUnk_D4.mUnk_0C); - VecFx32_Init(data_ov063_021639c4.vec.x + FLOAT_TO_FX32(.6f), data_ov063_021639c4.vec.y + FLOAT_TO_FX32(1.2f), - data_ov063_021639c4.vec.z + FLOAT_TO_FX32(.4f), &mUnk_D4.mUnk_18); + VecFx32_Init(data_ov063_021639c4.vec.x - FX_F32_TO_FX32(.6f), data_ov063_021639c4.vec.y, + data_ov063_021639c4.vec.z - FX_F32_TO_FX32(.4f), &mUnk_D4.mUnk_0C); + VecFx32_Init(data_ov063_021639c4.vec.x + FX_F32_TO_FX32(.6f), data_ov063_021639c4.vec.y + FX_F32_TO_FX32(1.2f), + data_ov063_021639c4.vec.z + FX_F32_TO_FX32(.4f), &mUnk_D4.mUnk_18); mUnk_06 = 1; mUnk_0C = 0x1333; } @@ -54,8 +54,8 @@ MapObjectUnkLTRW::MapObjectUnkLTRW() : mUnk_A8() {} bool MapObjectUnkLTRW::Init() { - mPos.x -= FLOAT_TO_FX32(.5f); - mPos.z -= FLOAT_TO_FX32(.5f); + mPos.x -= FX_F32_TO_FX32(.5f); + mPos.z -= FX_F32_TO_FX32(.5f); mUnk_10 = GET_PROFILE_D4(MapObjectProfileUnkLTRW); SET_FLAG(mFlags, MapObjFlag_9); mUnk_18[0] = 0x10; diff --git a/src/063_Shrine/MapObject/MapObjectUnkMTJR.cpp b/src/063_Shrine/MapObject/MapObjectUnkMTJR.cpp index 74bbbd7c..ce836d98 100644 --- a/src/063_Shrine/MapObject/MapObjectUnkMTJR.cpp +++ b/src/063_Shrine/MapObject/MapObjectUnkMTJR.cpp @@ -22,8 +22,8 @@ MapObjectProfileUnkMTJR::MapObjectProfileUnkMTJR() : mUnk_D4.mUnk_08 = 0x7009; VecFx32_Init(0, 0, 0, &mUnk_D4.mUnk_0C); - mUnk_D4.mUnk_18.x = FLOAT_TO_FX32(0.7f); - mUnk_D4.mUnk_18.y = FLOAT_TO_FX32(2.4f); + mUnk_D4.mUnk_18.x = FX_F32_TO_FX32(0.7f); + mUnk_D4.mUnk_18.y = FX_F32_TO_FX32(2.4f); mUnk_06 = -1; UNSET_FLAG2(mUnk_1E, 0x0); @@ -42,8 +42,8 @@ bool MapObjectUnkMTJR::Init() { return false; } - mPos.x += FLOAT_TO_FX32(.5f); - mPos.z += FLOAT_TO_FX32(.5f); + mPos.x += FX_F32_TO_FX32(.5f); + mPos.z += FX_F32_TO_FX32(.5f); mUnk_10 = GET_PROFILE_D4(MapObjectProfileUnkMTJR); mUnk_AC = 0x86F; mUnk_B0 = 4; @@ -55,9 +55,9 @@ bool MapObjectUnkMTJR::Init() { // non-matching void MapObjectUnkMTJR::vfunc_08() { if (mUnk_A0 == 0) { - fx32 tmp_x = mPos.x - FLOAT_TO_FX32(1.f) + (fx32) gRandom.Next32(0); + fx32 tmp_x = mPos.x - FX_F32_TO_FX32(1.f) + (fx32) gRandom.Next32(0); fx32 tmp_y = mPos.y + (fx32) gRandom.Next32(0x1801); - fx32 tmp_z = mPos.z - FLOAT_TO_FX32(1.f) + (fx32) gRandom.Next32(0); + fx32 tmp_z = mPos.z - FX_F32_TO_FX32(1.f) + (fx32) gRandom.Next32(0); VecFx32 stack_vec = {tmp_x, tmp_y, tmp_z}; data_027e0cec->func_ov000_020a0220(&mUnk_A8, &stack_vec); } diff --git a/src/063_Shrine/MapObject/MapObjectUnkSTAT.cpp b/src/063_Shrine/MapObject/MapObjectUnkSTAT.cpp index e5cd37f6..30b6f484 100644 --- a/src/063_Shrine/MapObject/MapObjectUnkSTAT.cpp +++ b/src/063_Shrine/MapObject/MapObjectUnkSTAT.cpp @@ -65,7 +65,7 @@ bool MapObjectUnkSTAT::Init(void) { this->func_ov063_0215fc40(val); if (mUnk_20.mParams[2] == 1) { - mPos.x += FLOAT_TO_FX32(.5f); + mPos.x += FX_F32_TO_FX32(.5f); } return true; diff --git a/src/071_Tower/Actor/ActorTearLight.cpp b/src/071_Tower/Actor/ActorTearLight.cpp index b7c595d5..e195aa1c 100644 --- a/src/071_Tower/Actor/ActorTearLight.cpp +++ b/src/071_Tower/Actor/ActorTearLight.cpp @@ -25,7 +25,7 @@ public: class UnkActor_ov071_0215ffbc : public Actor { public: /* 00 (base) */ - /* 94 */ STRUCT_PAD(0x94, 0xE8); + /* 94 */ PAD(0x94, 0xE8); /* E8 */ VecFx32 mUnk_E8; }; @@ -58,7 +58,7 @@ ActorProfileTearLight::ActorProfileTearLight() : ActorProfile_Derived1(ActorId_TearLight) { this->mUnk_18 = 0x0; this->mUnk_1A = 0x1000; - this->mUnk_04.Init(FLOAT_TO_FX32(0.4f)); + this->mUnk_04.Init(FX_F32_TO_FX32(0.4f)); } // non-matching @@ -78,7 +78,7 @@ ActorTearLight::ActorTearLight() : this->mUnk_44 = 0xA3; SET_FLAG(this->mFlags, ActorFlag_13); this->mUnk_168.mUnk_04 = 0x13010; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mUnk_094); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mUnk_094); } // non-matching @@ -129,7 +129,7 @@ void ActorTearLight::vfunc_24() { this->mTimer.Update(); if (this->mTimer.value == 20) { this->func_ov071_0215fca4(); - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mVel); this->mUnk_1B8 = 0x0; SET_FLAG(this->mFlags, ActorFlag_Visible); return; @@ -150,11 +150,11 @@ void ActorTearLight::vfunc_2C(Actor_vfunc_30 *param1) { if (!this->func_01fff5d0(param1, 0x0)) { return; } - Mat3p matrix; - Mat3p_InitYRotation(&matrix, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); + MtxFx33 matrix; + MtxFx33_InitYRotation(&matrix, SIN((u16) this->mAngle.angle_s), COS((u16) this->mAngle.angle_s)); VecFx32 vecC = this->mPos; - vecC.y += FLOAT_TO_FX32(0.5f); + vecC.y += FX_F32_TO_FX32(0.5f); this->mUnk_0A4.vfunc_10(&data_ov071_02164bd4, &matrix, &vecC); @@ -189,7 +189,7 @@ void ActorTearLight::func_ov071_0215f824() { default: if (this->func_ov017_020beeec(0x4000)) { VecFx32 vec = this->mPos; - vec.y += FLOAT_TO_FX32(0.5f); + vec.y += FX_F32_TO_FX32(0.5f); UnkStruct_027e0cec *data = data_027e0cec; for (ActorTearLight_204 *playerGet = this->mUnk_204; playerGet != this->mUnk_204 + ARRAY_LEN(this->mUnk_204); ++playerGet) { @@ -245,14 +245,14 @@ void ActorTearLight::func_ov071_0215f92c() { } fx32 temp_r1 = this->mVel.y; bool temp_gt = temp_r1 > -0x800; - this->mVel.y = FLOAT_TO_FX32(0.0f); + this->mVel.y = FX_F32_TO_FX32(0.0f); if (!temp_gt) { - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.25f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.25f), FX_F32_TO_FX32(0.0f), &this->mVel); } else if (temp_r1 >= 0xFFFFFE66) { this->func_ov071_0215fd04(); } else { fx32 temp_r1_2 = (0 - temp_r1) * 3; - VecFx32_Init(FLOAT_TO_FX32(0.0f), (temp_r1_2 + ((u32) (temp_r1_2 >> 1) >> 0x1E)) >> 2, FLOAT_TO_FX32(0.0f), + VecFx32_Init(FX_F32_TO_FX32(0.0f), (temp_r1_2 + ((u32) (temp_r1_2 >> 1) >> 0x1E)) >> 2, FX_F32_TO_FX32(0.0f), &this->mVel); } } @@ -312,7 +312,7 @@ void ActorTearLight::func_ov071_0215fca4() { this->mTimer.Reset(); - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.25f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.25f), FX_F32_TO_FX32(0.0f), &this->mVel); this->mUnk_4A[0] = 0x0; this->mUnk_44 = 0xA3; @@ -336,7 +336,7 @@ void ActorTearLight::func_ov071_0215fd04() { } this->mTimer.Reset(); - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mVel); this->mUnk_44 = 0; if (var_z) { this->mUnk_18C = false; @@ -350,7 +350,7 @@ void ActorTearLight::func_ov071_0215fd80() { this->func_ov071_0215f7f4(ActorUnkSZKUState_3); this->mTimer.Reset(); - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mVel); this->mUnk_4A[0] = 0x0; this->mUnk_44 = 0x0; @@ -365,7 +365,7 @@ void ActorTearLight::func_ov071_0215fdd4() { this->mTimer.Reset(); this->mUnk_4A[0] = 0x0; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mVel); this->vfunc_40(); @@ -382,7 +382,7 @@ void ActorTearLight::func_ov071_0215fdd4() { void ActorTearLight::func_ov071_0215fe54() { this->func_ov071_0215f7f4(ActorUnkSZKUState_6); this->mUnk_2C = 0x0; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mVel); this->mUnk_160 = data_ov071_02164d00; } @@ -391,7 +391,7 @@ void ActorTearLight::func_ov071_0215fe54() { void ActorTearLight::func_ov071_0215fe94() { this->func_ov071_0215f7f4(ActorUnkSZKUState_7); this->mUnk_2C = 0x0; - VecFx32_Init(FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), FLOAT_TO_FX32(0.0f), &this->mVel); + VecFx32_Init(FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), FX_F32_TO_FX32(0.0f), &this->mVel); this->mUnk_160 = data_ov071_02164d08; } diff --git a/src/084_BossFlame/Actor/ActorUnkIWTS.cpp b/src/084_BossFlame/Actor/ActorUnkIWTS.cpp index 75daaf3a..e0a634c2 100644 --- a/src/084_BossFlame/Actor/ActorUnkIWTS.cpp +++ b/src/084_BossFlame/Actor/ActorUnkIWTS.cpp @@ -49,7 +49,7 @@ void ActorUnkIWTS::func_ov084_02152cd8(void) {} void ActorUnkIWTS::func_ov084_02152cec(void) {} void ActorUnkIWTS::func_ov084_02152d10(void) {} void ActorUnkIWTS::func_ov084_02153018(void) {} -bool ActorUnkIWTS::func_ov084_02153064(ActorRef *, Mat4x3p **) {} +bool ActorUnkIWTS::func_ov084_02153064(ActorRef *, MtxFx43 **) {} void ActorUnkIWTS::func_ov084_021530d4(void) {} void ActorUnkIWTS::func_ov084_0215315c(void) {} void ActorUnkIWTS::func_ov084_02153194(void) {} diff --git a/src/101_SceneInitLand/UnkStruct_027e0ce0_40_101.cpp b/src/101_SceneInitLand/UnkStruct_027e0ce0_40_101.cpp index a0db5ad8..0149d1e7 100644 --- a/src/101_SceneInitLand/UnkStruct_027e0ce0_40_101.cpp +++ b/src/101_SceneInitLand/UnkStruct_027e0ce0_40_101.cpp @@ -127,16 +127,16 @@ void UnkStruct_027e0ce0_40::func_ov101_02183024(const UnkStruct_ov001_020c40f4 * //! TODO: fake match? switch ((u32) ((sp40.mUnk_0C + 0x2000) << 0x10) >> 0x1E) { case 0x03: - sp34.z += FLOAT_TO_FX32(0.5f); + sp34.z += FX_F32_TO_FX32(0.5f); break; case 0x01: - sp34.z -= FLOAT_TO_FX32(0.5f); + sp34.z -= FX_F32_TO_FX32(0.5f); break; case 0x02: - sp34.x -= FLOAT_TO_FX32(0.5f); + sp34.x -= FX_F32_TO_FX32(0.5f); break; case 0x00: - sp34.x += FLOAT_TO_FX32(0.5f); + sp34.x += FX_F32_TO_FX32(0.5f); break; default: break; @@ -156,16 +156,16 @@ void UnkStruct_027e0ce0_40::func_ov101_02183024(const UnkStruct_ov001_020c40f4 * //! TODO: fake match? switch ((u32) ((sp1C.mUnk_0C + 0x2000) << 0x10) >> 0x1E) { case 0x03: - sp10.z -= FLOAT_TO_FX32(0.5f); + sp10.z -= FX_F32_TO_FX32(0.5f); break; case 0x01: - sp10.z += FLOAT_TO_FX32(0.5f); + sp10.z += FX_F32_TO_FX32(0.5f); break; case 0x02: - sp10.x += FLOAT_TO_FX32(0.5f); + sp10.x += FX_F32_TO_FX32(0.5f); break; case 0x00: - sp10.x -= FLOAT_TO_FX32(0.5f); + sp10.x -= FX_F32_TO_FX32(0.5f); break; default: break; diff --git a/src/102_CourseExecLand/MapObjectUnkPTFL_102.cpp b/src/102_CourseExecLand/MapObjectUnkPTFL_102.cpp index 9754c959..f5a357d9 100644 --- a/src/102_CourseExecLand/MapObjectUnkPTFL_102.cpp +++ b/src/102_CourseExecLand/MapObjectUnkPTFL_102.cpp @@ -143,7 +143,7 @@ void MapObjectUnkPTFL::vfunc_0C() { } void MapObjectUnkPTFL::vfunc_14(unk32 param1) { - Mat4p sp44; + MtxFx44 sp44; VecFx32 sp38; VecFx32 sp2C; VecFx32 sp20; @@ -180,9 +180,9 @@ void MapObjectUnkPTFL::vfunc_14(unk32 param1) { sp2C.z = 0x1000; PushGeometryCommand(0x1B, &sp2C, 3); - Mat4p_InitIdentity(&sp44); - sp44.zColumn.z = 0x10000; - sp44.wColumn.w = 0x10000; + MtxFx44_InitIdentity(&sp44); + sp44._23 = 0x10000; + sp44._33 = 0x10000; PushGeometryCommand(0x18, &sp44, 0x10); spC = 2; PushGeometryCommand(0x10, &spC, 1); @@ -217,7 +217,7 @@ void MapObjectUnkPTFL::func_ov102_0218419c() { VecFx32 sp5C; VecFx32 sp50; VecFx32 sp44; - Mat3p sp20; + MtxFx33 sp20; u32 sp1C; u32 sp18; s32 temp_r0_3; @@ -228,30 +228,30 @@ void MapObjectUnkPTFL::func_ov102_0218419c() { if (this->mState == 1) { sp68.x = (this->mUnk_5A << 0xB) + 0x52; - sp68.y = FLOAT_TO_FX32(0.0f); - sp68.z = FLOAT_TO_FX32(0.0f); + sp68.y = FX_F32_TO_FX32(0.0f); + sp68.z = FX_F32_TO_FX32(0.0f); PushGeometryCommand(0x1C, &sp68, 3); temp_r0_3 = INT_TO_FX32(this->mUnk_5A); - sp5C.x = MUL_FX32(temp_r0_3, FLOAT_TO_FX32(0.54f)); - sp5C.y = FLOAT_TO_FX32(1.0f); - sp5C.z = MUL_FX32(temp_r0_3, FLOAT_TO_FX32(1.04f)); + sp5C.x = FX_MUL(temp_r0_3, FX_F32_TO_FX32(0.54f)); + sp5C.y = FX_F32_TO_FX32(1.0f); + sp5C.z = FX_MUL(temp_r0_3, FX_F32_TO_FX32(1.04f)); PushGeometryCommand(0x1B, &sp5C, 3); } else { sp50.x = this->mUnk_5A << 0xB; - sp50.y = FLOAT_TO_FX32(0.0f); - sp50.z = FLOAT_TO_FX32(0.0f); + sp50.y = FX_F32_TO_FX32(0.0f); + sp50.z = FX_F32_TO_FX32(0.0f); PushGeometryCommand(0x1C, &sp50, 3); temp_r7 = INT_TO_FX32(this->mUnk_5A); - sp44.x = MUL_FX32(temp_r7, FLOAT_TO_FX32(0.5f)); - sp44.y = FLOAT_TO_FX32(1.0f); - sp44.z = MUL_FX32(temp_r7, FLOAT_TO_FX32(1.0f)); + sp44.x = FX_MUL(temp_r7, FX_F32_TO_FX32(0.5f)); + sp44.y = FX_F32_TO_FX32(1.0f); + sp44.z = FX_MUL(temp_r7, FX_F32_TO_FX32(1.0f)); PushGeometryCommand(0x1B, &sp44, 3); } temp_r1_3 = (u16) (this->mUnk_54 - 0x8000); - Mat3p_InitZRotation(&sp20, SIN(temp_r1_3), COS(temp_r1_3)); + MtxFx33_InitZRotation(&sp20, SIN(temp_r1_3), COS(temp_r1_3)); PushGeometryCommand(0x1A, &sp20, 9); @@ -271,7 +271,7 @@ void MapObjectUnkPTFL::func_ov102_021843b4() { VecFx32 sp5C; VecFx32 sp50; VecFx32 sp44; - Mat3p sp20; + MtxFx33 sp20; u32 sp1C; u32 sp18; s32 temp_r0_3; @@ -281,29 +281,29 @@ void MapObjectUnkPTFL::func_ov102_021843b4() { if (this->mState == 1) { sp68.x = (-this->mUnk_5A << 0xB) - 0x52; - sp68.y = FLOAT_TO_FX32(0.0f); - sp68.z = FLOAT_TO_FX32(0.0f); + sp68.y = FX_F32_TO_FX32(0.0f); + sp68.z = FX_F32_TO_FX32(0.0f); PushGeometryCommand(0x1C, &sp68, 3); temp_r0_3 = INT_TO_FX32(this->mUnk_5A); - sp5C.x = MUL_FX32(temp_r0_3, FLOAT_TO_FX32(0.54f)); - sp5C.y = FLOAT_TO_FX32(1.0f); - sp5C.z = MUL_FX32(temp_r0_3, FLOAT_TO_FX32(1.04f)); + sp5C.x = FX_MUL(temp_r0_3, FX_F32_TO_FX32(0.54f)); + sp5C.y = FX_F32_TO_FX32(1.0f); + sp5C.z = FX_MUL(temp_r0_3, FX_F32_TO_FX32(1.04f)); PushGeometryCommand(0x1B, &sp5C, 3); } else { sp50.x = -this->mUnk_5A << 0xB; - sp50.y = FLOAT_TO_FX32(0.0f); - sp50.z = FLOAT_TO_FX32(0.0f); + sp50.y = FX_F32_TO_FX32(0.0f); + sp50.z = FX_F32_TO_FX32(0.0f); PushGeometryCommand(0x1C, &sp50, 3); temp_r7 = INT_TO_FX32(this->mUnk_5A); - sp44.x = MUL_FX32(temp_r7, FLOAT_TO_FX32(0.5f)); - sp44.y = FLOAT_TO_FX32(1.0f); - sp44.z = MUL_FX32(temp_r7, FLOAT_TO_FX32(1.0f)); + sp44.x = FX_MUL(temp_r7, FX_F32_TO_FX32(0.5f)); + sp44.y = FX_F32_TO_FX32(1.0f); + sp44.z = FX_MUL(temp_r7, FX_F32_TO_FX32(1.0f)); PushGeometryCommand(0x1B, &sp44, 3); } - Mat3p_InitZRotation(&sp20, -SIN(this->mUnk_54), COS(this->mUnk_54)); + MtxFx33_InitZRotation(&sp20, -SIN(this->mUnk_54), COS(this->mUnk_54)); PushGeometryCommand(0x1A, &sp20, 9); diff --git a/src/102_CourseExecLand/MapObjectUnkSAND_102.cpp b/src/102_CourseExecLand/MapObjectUnkSAND_102.cpp index c78172e0..1ec5add2 100644 --- a/src/102_CourseExecLand/MapObjectUnkSAND_102.cpp +++ b/src/102_CourseExecLand/MapObjectUnkSAND_102.cpp @@ -13,7 +13,7 @@ extern MapObject_10 data_ov031_02118aec; extern MapObject_10 data_ov031_02118aa4; struct UnkStruct_ov031_021189d0 { - /* 00 */ STRUCT_PAD(0x00, 0x70); + /* 00 */ PAD(0x00, 0x70); /* 70 */ BMDSectionModel *unk_70; }; extern UnkStruct_ov031_021189d0 data_ov031_021189d0; diff --git a/src/102_CourseExecLand/UnkStruct_027e0ce0_40_102.cpp b/src/102_CourseExecLand/UnkStruct_027e0ce0_40_102.cpp index c05fd98b..75da2559 100644 --- a/src/102_CourseExecLand/UnkStruct_027e0ce0_40_102.cpp +++ b/src/102_CourseExecLand/UnkStruct_027e0ce0_40_102.cpp @@ -10,7 +10,7 @@ #include "Unknown/UnkStruct_ov000_020b51b8.hpp" #include "Unknown/UnkStruct_ov000_020b5214.hpp" -extern "C" void func_01ffaf74(VecFx32 *, Mat4x3p *, VecFx32 *); +extern "C" void func_01ffaf74(VecFx32 *, MtxFx43 *, VecFx32 *); extern "C" unk32 func_01ffb6a8(unk32, unk32); extern "C" void func_ov095_0217aa88(void *, unk16 *, unk32, UnkAngleStruct); extern "C" void func_ov095_0217aaa8(void *, unk16 *, unk32); @@ -18,13 +18,13 @@ extern "C" void func_ov031_020dcea4(void *, UnkStruct_027e0ce0_40_Base_78 *, Unk extern "C" void func_ov000_0205d65c(void *, VecFx32 *, VecFx32 *, UnkAngleStruct); extern Vec2s data_ov031_02112b54; -void PlayerActorBase_74::func_ov102_02182c20(unk32 param1, Mat4x3p *param2) { +void PlayerActorBase_74::func_ov102_02182c20(unk32 param1, MtxFx43 *param2) { this->mUnk_04[param1].x = this->mUnk_1C[param1].x; this->mUnk_04[param1].y = this->mUnk_1C[param1].y; this->mUnk_04[param1].z = this->mUnk_1C[param1].z; VecFx32 sp0; - VecFx32_Init(FLOAT_TO_FX32(0.15f), FLOAT_TO_FX32(0.05f), FLOAT_TO_FX32(0.0f), &sp0); + VecFx32_Init(FX_F32_TO_FX32(0.15f), FX_F32_TO_FX32(0.05f), FX_F32_TO_FX32(0.0f), &sp0); func_01ffaf74(&sp0, param2, &this->mUnk_1C[param1]); } @@ -69,8 +69,8 @@ bool PlayerActorBase_74::UnknownInline1(u32 index, VecFx32 *pVec) { return false; } -void PlayerActorBase_74::func_ov102_02182c84(bool param1, unk32 param2, UnkAngleStruct param3, Mat4x3p *param4, - Mat4x3p *param5) { +void PlayerActorBase_74::func_ov102_02182c84(bool param1, unk32 param2, UnkAngleStruct param3, MtxFx43 *param4, + MtxFx43 *param5) { func_ov102_02182c20(0, param4); func_ov102_02182c20(1, param5); diff --git a/src/112_PlayerSceneChange/PlayerSceneChange.cpp b/src/112_PlayerSceneChange/PlayerSceneChange.cpp index df85a689..7f2c7b52 100644 --- a/src/112_PlayerSceneChange/PlayerSceneChange.cpp +++ b/src/112_PlayerSceneChange/PlayerSceneChange.cpp @@ -13,16 +13,19 @@ extern "C" void func_ov000_0205ca74(unk32); extern "C" void func_ov000_0205d65c(void *, VecFx32 *, VecFx32 *, u32); +#define SIN2(table, n) ((table)[2 * ((n) >> 4)]) +#define COS2(table, n) ((table)[2 * ((n) >> 4) + 1]) + PlayerSceneChange::PlayerSceneChange() : mUnk_54(false) { this->mUnk_68 = this->mUnk_2C->mUnk_14C; this->mUnk_6C = -1; #if __MWERKS__ - this->mUnk_70.coords = this->mUnk_34->coords; + this->mUnk_70.values = this->mUnk_34->values; this->mUnk_7C = 0; - this->mUnk_80.coords = this->mUnk_34->coords; + this->mUnk_80.values = this->mUnk_34->values; this->mUnk_8C = 0; #else this->mUnk_70.x = this->mUnk_34->x; @@ -142,20 +145,20 @@ void PlayerSceneChange::vfunc_0C(UnkStruct_PlayerGet_vfunc_0C_param1 *param1) { switch (this->mUnk_68) { case 0x08: - this->mUnk_70.x = temp_r8->x + MUL_FX32(data_02040964[0], FLOAT_TO_FX32(2.0f)); - this->mUnk_70.z = temp_r8->z + MUL_FX32(data_02040964[1], FLOAT_TO_FX32(2.0f)); + this->mUnk_70.x = temp_r8->x + FX_MUL(data_02040964[0], FX_F32_TO_FX32(2.0f)); + this->mUnk_70.z = temp_r8->z + FX_MUL(data_02040964[1], FX_F32_TO_FX32(2.0f)); break; case 0x09: - this->mUnk_70.x = temp_r8->x + MUL_FX32(data_0203e964[0], FLOAT_TO_FX32(2.0f)); - this->mUnk_70.z = temp_r8->z + MUL_FX32(data_0203e964[1], FLOAT_TO_FX32(2.0f)); + this->mUnk_70.x = temp_r8->x + FX_MUL(data_0203e964[0], FX_F32_TO_FX32(2.0f)); + this->mUnk_70.z = temp_r8->z + FX_MUL(data_0203e964[1], FX_F32_TO_FX32(2.0f)); break; case 0x22: - this->mUnk_70.x = temp_r8->x + MUL_FX32(data_02041964[0], FLOAT_TO_FX32(2.0f)); - this->mUnk_70.z = temp_r8->z + MUL_FX32(data_02041964[1], FLOAT_TO_FX32(2.0f)); + this->mUnk_70.x = temp_r8->x + FX_MUL(data_02041964[0], FX_F32_TO_FX32(2.0f)); + this->mUnk_70.z = temp_r8->z + FX_MUL(data_02041964[1], FX_F32_TO_FX32(2.0f)); break; case 0x23: - this->mUnk_70.x = temp_r8->x + MUL_FX32(data_0203f964[0], FLOAT_TO_FX32(2.0f)); - this->mUnk_70.z = temp_r8->z + MUL_FX32(data_0203f964[1], FLOAT_TO_FX32(2.0f)); + this->mUnk_70.x = temp_r8->x + FX_MUL(data_0203f964[0], FX_F32_TO_FX32(2.0f)); + this->mUnk_70.z = temp_r8->z + FX_MUL(data_0203f964[1], FX_F32_TO_FX32(2.0f)); break; default: if (this->mUnk_2C->mUnk_150.type_index == 0x1000) { @@ -175,13 +178,13 @@ void PlayerSceneChange::vfunc_0C(UnkStruct_PlayerGet_vfunc_0C_param1 *param1) { switch (pDRTY->mUnk_CC) { case 1: - this->mUnk_AE = FLOAT_TO_FX32(-5.778f); + this->mUnk_AE = FX_F32_TO_FX32(-5.778f); break; case 2: - this->mUnk_AE = FLOAT_TO_FX32(5.7778f); + this->mUnk_AE = FX_F32_TO_FX32(5.7778f); break; default: - this->mUnk_AE = FLOAT_TO_FX32(-8.0002f); + this->mUnk_AE = FX_F32_TO_FX32(-8.0002f); break; } } @@ -265,13 +268,13 @@ void PlayerSceneChange::vfunc_0C(UnkStruct_PlayerGet_vfunc_0C_param1 *param1) { case 0x21: case 0x25: case 0x33: - this->mUnk_7C = FLOAT_TO_FX32(1 / 2); + this->mUnk_7C = FX_F32_TO_FX32(1 / 2); break; case 0x19: - this->mUnk_7C = FLOAT_TO_FX32(0.3f); + this->mUnk_7C = FX_F32_TO_FX32(0.3f); break; default: - this->mUnk_7C = FLOAT_TO_FX32(0.8f); + this->mUnk_7C = FX_F32_TO_FX32(0.8f); break; } @@ -363,8 +366,8 @@ void PlayerSceneChange::vfunc_0C(UnkStruct_PlayerGet_vfunc_0C_param1 *param1) { case 0x16: case 0x1C: pVec = this->mUnk_34; - pVec->x += MUL_FX32(FLOAT_TO_FX32(-1.1003f), SIN2(pSinCosTable, this->mUnk_40->mUnk_00)); - pVec->z += MUL_FX32(FLOAT_TO_FX32(-1.1003f), COS2(pSinCosTable, this->mUnk_40->mUnk_00)); + pVec->x += FX_MUL(FX_F32_TO_FX32(-1.1003f), SIN2(pSinCosTable, this->mUnk_40->mUnk_00)); + pVec->z += FX_MUL(FX_F32_TO_FX32(-1.1003f), COS2(pSinCosTable, this->mUnk_40->mUnk_00)); break; case 0x08: case 0x09: @@ -385,8 +388,8 @@ void PlayerSceneChange::vfunc_0C(UnkStruct_PlayerGet_vfunc_0C_param1 *param1) { case 0x22: case 0x23: pVec = this->mUnk_34; - pVec->x += MUL_FX32(FLOAT_TO_FX32(-1.9001f), SIN2(pSinCosTable, this->mUnk_40->mUnk_00)); - pVec->z += MUL_FX32(FLOAT_TO_FX32(-1.9001f), COS2(pSinCosTable, this->mUnk_40->mUnk_00)); + pVec->x += FX_MUL(FX_F32_TO_FX32(-1.9001f), SIN2(pSinCosTable, this->mUnk_40->mUnk_00)); + pVec->z += FX_MUL(FX_F32_TO_FX32(-1.9001f), COS2(pSinCosTable, this->mUnk_40->mUnk_00)); break; case 0x0F: case 0x10: @@ -398,13 +401,13 @@ void PlayerSceneChange::vfunc_0C(UnkStruct_PlayerGet_vfunc_0C_param1 *param1) { case 0x24: case 0x25: pVec = this->mUnk_34; - pVec->x += MUL_FX32(FLOAT_TO_FX32(-1.0002f), SIN2(pSinCosTable, this->mUnk_40->mUnk_00)); - pVec->z += MUL_FX32(FLOAT_TO_FX32(-1.0002f), COS2(pSinCosTable, this->mUnk_40->mUnk_00)); + pVec->x += FX_MUL(FX_F32_TO_FX32(-1.0002f), SIN2(pSinCosTable, this->mUnk_40->mUnk_00)); + pVec->z += FX_MUL(FX_F32_TO_FX32(-1.0002f), COS2(pSinCosTable, this->mUnk_40->mUnk_00)); break; default: // pVec = this->mUnk_34; - // pVec->x += MUL_FX32(FLOAT_TO_FX32(-1.7001f), SIN2(pSinCosTable, this->mUnk_40->mUnk_00)); - // pVec->z += MUL_FX32(FLOAT_TO_FX32(-1.7001f), COS2(pSinCosTable, this->mUnk_40->mUnk_00)); + // pVec->x += FX_MUL(FX_F32_TO_FX32(-1.7001f), SIN2(pSinCosTable, this->mUnk_40->mUnk_00)); + // pVec->z += FX_MUL(FX_F32_TO_FX32(-1.7001f), COS2(pSinCosTable, this->mUnk_40->mUnk_00)); break; } @@ -454,10 +457,10 @@ void PlayerSceneChange::vfunc_0C(UnkStruct_PlayerGet_vfunc_0C_param1 *param1) { case 0x1C: case 0x33: case 0x3B: - this->mUnk_7C = FLOAT_TO_FX32(0.5f); + this->mUnk_7C = FX_F32_TO_FX32(0.5f); break; default: - this->mUnk_7C = FLOAT_TO_FX32(0.8f); + this->mUnk_7C = FX_F32_TO_FX32(0.8f); break; } @@ -574,8 +577,8 @@ void PlayerSceneChange::vfunc_10(unk32 param1, unk32 param2) { fx16 sin = SIN2(data_0203feb0, value); fx16 cos = COS2(data_0203feb0, value); - this->mUnk_70.x += MUL_FX32(sin, 0x19A); - this->mUnk_70.z += MUL_FX32(cos, 0x19A); + this->mUnk_70.x += FX_MUL(sin, 0x19A); + this->mUnk_70.z += FX_MUL(cos, 0x19A); break; } @@ -598,8 +601,8 @@ void PlayerSceneChange::vfunc_10(unk32 param1, unk32 param2) { fx16 sin = SIN2(data_0203feb0, this->mUnk_40->mUnk_00); fx16 cos = COS2(data_0203feb0, this->mUnk_40->mUnk_00); - this->mUnk_70.x += MUL_FX32(sin, 0x19A); - this->mUnk_70.z += MUL_FX32(cos, 0x19A); + this->mUnk_70.x += FX_MUL(sin, 0x19A); + this->mUnk_70.z += FX_MUL(cos, 0x19A); } break; default: @@ -715,8 +718,8 @@ void PlayerSceneChange::vfunc_10(unk32 param1, unk32 param2) { this->mUnk_98 = -1; fx16 sin = SIN2(data_0203feb0, this->mUnk_40->mUnk_00); fx16 cos = COS2(data_0203feb0, this->mUnk_40->mUnk_00); - this->mUnk_70.x += MUL_FX32(sin, FLOAT_TO_FX32(2.0f)); - this->mUnk_70.z += MUL_FX32(cos, FLOAT_TO_FX32(2.0f)); + this->mUnk_70.x += FX_MUL(sin, FX_F32_TO_FX32(2.0f)); + this->mUnk_70.z += FX_MUL(cos, FX_F32_TO_FX32(2.0f)); this->mUnk_AD = true; return; } else { diff --git a/src/Main/Game/Game.cpp b/src/Main/Game/Game.cpp index 1c77680f..db660df4 100644 --- a/src/Main/Game/Game.cpp +++ b/src/Main/Game/Game.cpp @@ -19,7 +19,7 @@ extern "C" void func_020132c8(); extern "C" void func_020132dc(); extern "C" void func_02013354(); extern "C" void func_0201328c(); -extern Mat3p gGeomMatrix; +extern MtxFx33 gGeomMatrix; void Game::func_02013370(unk32 param1) { data_0204a110.func_02018c78(param1); @@ -95,7 +95,7 @@ void Game::Run() { data_027e0208.mUnk_0E4 = 0; data_027e0208.mUnk_0E8 = 0; - Mat3p_InitIdentity(&gGeomMatrix); + MtxFx33_InitIdentity(&gGeomMatrix); data_027e0208.mUnk_0FC = 0; FlushGfxQueue(); this->mpCurrentGameMode->vfunc_18(); @@ -133,7 +133,7 @@ void Game::Run() { } { - int enabled = OS_DisableInterrupts_Irq(); + int enabled = OS_DisableInterrupts(); this->mUnk_1C.func_02013e18((void *) func_020132dc, 0); REG_GFX_FIFO_SWAP_BUFFERS = 3; OS_RestoreInterrupts(enabled); diff --git a/src/Main/Main.cpp b/src/Main/Main.cpp index a45d5562..d86051ac 100644 --- a/src/Main/Main.cpp +++ b/src/Main/Main.cpp @@ -89,7 +89,7 @@ extern "C" void Entry(void) { } // non-matching -void *func_0200093c(unk32 param1, u32 *param2, unk32 param3) { +void *func_0200093c(unk32 param1, uint *param2, unk32 param3) { u32 *p = param2 + param3; while (param2 < p) { diff --git a/src/Main/Player/TouchControl.cpp b/src/Main/Player/TouchControl.cpp index fe4e4546..9e2008d2 100644 --- a/src/Main/Player/TouchControl.cpp +++ b/src/Main/Player/TouchControl.cpp @@ -1,6 +1,7 @@ #include "Player/TouchControl.hpp" -#include +#include "global.h" +#include #include // non-matching diff --git a/src/Main/System/OverlayManager.cpp b/src/Main/System/OverlayManager.cpp index 147a76d1..89c5890e 100644 --- a/src/Main/System/OverlayManager.cpp +++ b/src/Main/System/OverlayManager.cpp @@ -26,8 +26,8 @@ struct OverlaySetup { extern OverlaySetup gOverlaySetups[]; extern u32 *data_027e0ce0[]; -extern "C" void func_ov007_02102850(u32 **); -extern "C" void func_ov007_021028a0(u32 **); +extern "C" void func_ov007_02102850(uint **); +extern "C" void func_ov007_021028a0(uint **); THUMB_BEGIN diff --git a/src/Main/System/SysNew.cpp b/src/Main/System/SysNew.cpp index 2bb286e8..e988b704 100644 --- a/src/Main/System/SysNew.cpp +++ b/src/Main/System/SysNew.cpp @@ -3,8 +3,8 @@ extern "C" { void *func_02001654(void *); void *func_020145b0(UnkId *, s32); -void *func_020010c0(void *, size_t, u32); -void *func_02001308(void *, size_t, u32); +void *func_020010c0(void *, size_t, uint); +void *func_02001308(void *, size_t, uint); UnkId *func_02001488(void); UnkId *func_02014704(); UnkId *func_020011c8(UnkId *, void *); @@ -14,7 +14,7 @@ unk32 func_020011f4(void *); } extern char *data_0204372c[]; -void *SysNew(UnkStruct_02011e10_Sub1 *param1, u32 length, u32 idLength) { +void *SysNew(UnkStruct_02011e10_Sub1 *param1, uint length, uint idLength) { void *newPtr = NULL; switch (param1->mId) { @@ -67,7 +67,7 @@ void *func_02011f30(s32 length) { return func_02011f10(length); } -void *operator new(size_t length, u32 id, u32 idLength) { +void *operator new(size_t length, uint id, uint idLength) { void *pvVar1; UnkStruct_02011e10_Sub1 *pUVar5;