summaryrefslogtreecommitdiff
path: root/arm9/lib/src
diff options
context:
space:
mode:
authorMade <made111@gmx.de>2020-05-04 17:48:38 +0200
committerMade <made111@gmx.de>2020-05-04 17:48:38 +0200
commitf4c61411673207da9d6be013674f95eeb07408b5 (patch)
treec2a956201b0f5daa9e84c4a0f0fe89ea04c7147a /arm9/lib/src
parent155f50c9890a93fbc191e078d304c161809e8fc6 (diff)
Add function attributes and remove thumb pragmas
Diffstat (limited to 'arm9/lib/src')
-rw-r--r--arm9/lib/src/FX.c4
-rw-r--r--arm9/lib/src/FX_atan.c4
-rw-r--r--arm9/lib/src/FX_cp.c20
-rw-r--r--arm9/lib/src/FX_mtx22.c8
-rw-r--r--arm9/lib/src/FX_mtx33.c20
-rw-r--r--arm9/lib/src/FX_mtx43.c24
-rw-r--r--arm9/lib/src/FX_mtx44.c21
-rw-r--r--arm9/lib/src/FX_vec.c22
8 files changed, 52 insertions, 71 deletions
diff --git a/arm9/lib/src/FX.c b/arm9/lib/src/FX.c
index f39b1995..4b9c213f 100644
--- a/arm9/lib/src/FX.c
+++ b/arm9/lib/src/FX.c
@@ -2,11 +2,11 @@
#include "main.h"
#include "fx.h"
-void FX_Init(){
+ARM_FUNC void FX_Init(){
return;
}
-fx32 FX_Modf(fx32 x, fx32 *iptr){
+ARM_FUNC fx32 FX_Modf(fx32 x, fx32 *iptr){
if (x >= 0)
{
*iptr = x & 0x7FFFF000;
diff --git a/arm9/lib/src/FX_atan.c b/arm9/lib/src/FX_atan.c
index 085763f8..979895a8 100644
--- a/arm9/lib/src/FX_atan.c
+++ b/arm9/lib/src/FX_atan.c
@@ -4,7 +4,7 @@
extern fx16 FX_AtanTable_[];
-u16 FX_Atan(fx32 x){
+ARM_FUNC u16 FX_Atan(fx32 x){
if (x >= 0)
{
if (x > 0x1000)
@@ -41,7 +41,7 @@ u16 FX_Atan(fx32 x){
}
}
-u16 FX_Atan2(fx32 x, fx32 y){
+ARM_FUNC u16 FX_Atan2(fx32 x, fx32 y){
fx32 result;
u32 positive, bias, denominator, numerator;
if (x > 0)
diff --git a/arm9/lib/src/FX_cp.c b/arm9/lib/src/FX_cp.c
index a5a8d9cb..2ca9d720 100644
--- a/arm9/lib/src/FX_cp.c
+++ b/arm9/lib/src/FX_cp.c
@@ -3,17 +3,17 @@
#include "fx.h"
-fx32 FX_Div(fx32 numerator, fx32 denominator){
+ARM_FUNC fx32 FX_Div(fx32 numerator, fx32 denominator){
FX_DivAsync(numerator, denominator);
return FX_GetDivResult();
}
-fx32 FX_Inv(fx32 x){
+ARM_FUNC fx32 FX_Inv(fx32 x){
FX_InvAsync(x);
return FX_GetDivResult();
}
-fx32 FX_Sqrt(fx32 x){
+ARM_FUNC fx32 FX_Sqrt(fx32 x){
if (x > 0)
{
SETREG16(HW_REG_SQRTCNT, 0x1);
@@ -26,34 +26,34 @@ fx32 FX_Sqrt(fx32 x){
}
}
-fx64c FX_GetDivResultFx64c(){
+ARM_FUNC fx64c FX_GetDivResultFx64c(){
while (READREG16(HW_REG_DIVCNT) & 0x8000);
return READREG64(HW_REG_DIV_RESULT);
}
-fx32 FX_GetDivResult(){
+ARM_FUNC fx32 FX_GetDivResult(){
while (READREG16(HW_REG_DIVCNT) & 0x8000);
return (READREG64(HW_REG_DIV_RESULT) + (1 << (0x14 - 1))) >> 0x14;
}
-void FX_InvAsync(fx32 x){
+ARM_FUNC void FX_InvAsync(fx32 x){
SETREG16(HW_REG_DIVCNT, 0x1);
SETREG64(HW_REG_DIV_NUMER, (fx64)0x00001000 << 32);
SETREG64(HW_REG_DIV_DENOM, (u32)x);
}
-fx32 FX_GetSqrtResult(){
+ARM_FUNC fx32 FX_GetSqrtResult(){
while (READREG16(HW_REG_SQRTCNT) & 0x8000);
return (READREG32(HW_REG_SQRT_RESULT) + (1 << (0xA - 1))) >> 0xA;
}
-void FX_DivAsync(fx32 numerator, fx32 denominator){
+ARM_FUNC void FX_DivAsync(fx32 numerator, fx32 denominator){
SETREG16(HW_REG_DIVCNT, 0x1);
SETREG64(HW_REG_DIV_NUMER, (fx64)numerator << 32);
SETREG64(HW_REG_DIV_DENOM, (u32)denominator);
}
-fx32 FX_DivS32(fx32 numerator, fx32 denominator){
+ARM_FUNC fx32 FX_DivS32(fx32 numerator, fx32 denominator){
SETREG16(HW_REG_DIVCNT, 0x0);
SETREG32(HW_REG_DIV_NUMER, (u32)numerator); //32bit write for some reason
SETREG64(HW_REG_DIV_DENOM, (u32)denominator);
@@ -61,7 +61,7 @@ fx32 FX_DivS32(fx32 numerator, fx32 denominator){
return READREG32(HW_REG_DIV_RESULT);
}
-fx32 FX_ModS32(fx32 num, fx32 mod){
+ARM_FUNC fx32 FX_ModS32(fx32 num, fx32 mod){
SETREG16(HW_REG_DIVCNT, 0x0);
SETREG32(HW_REG_DIV_NUMER, (u32)num); //32bit write for some reason
SETREG64(HW_REG_DIV_DENOM, (u32)mod);
diff --git a/arm9/lib/src/FX_mtx22.c b/arm9/lib/src/FX_mtx22.c
index 19504574..38387c64 100644
--- a/arm9/lib/src/FX_mtx22.c
+++ b/arm9/lib/src/FX_mtx22.c
@@ -2,14 +2,14 @@
#include "main.h"
#include "fx.h"
-void MTX_ScaleApply22(struct Mtx22 *mtx, struct Mtx22 *dst, fx32 x, fx32 y){
+ARM_FUNC void MTX_ScaleApply22(struct Mtx22 *mtx, struct Mtx22 *dst, fx32 x, fx32 y){
dst->_[0] = ((fx64)x * mtx->_[0]) >> FX32_INT_SHIFT;
dst->_[1] = ((fx64)x * mtx->_[1]) >> FX32_INT_SHIFT;
dst->_[2] = ((fx64)y * mtx->_[2]) >> FX32_INT_SHIFT;
dst->_[3] = ((fx64)y * mtx->_[3]) >> FX32_INT_SHIFT;
}
-asm void MTX_Identity22_(struct Mtx22 *mtx){
+ARM_FUNC asm void MTX_Identity22_(struct Mtx22 *mtx){
mov r1, #0x0
mov r2, #0x1000
mov r3, #0x0
@@ -18,8 +18,7 @@ asm void MTX_Identity22_(struct Mtx22 *mtx){
bx lr
}
-#pragma thumb on
-asm void MTX_Rot22_(struct Mtx22 *mtx, fx32 sinphi, fx32 cosphi){
+THUMB_FUNC asm void MTX_Rot22_(struct Mtx22 *mtx, fx32 sinphi, fx32 cosphi){
str r2, [r0, #0x0]
str r1, [r0, #0x4]
neg r1, r1
@@ -27,4 +26,3 @@ asm void MTX_Rot22_(struct Mtx22 *mtx, fx32 sinphi, fx32 cosphi){
str r2, [r0, #0xc]
bx lr
}
-#pragma thumb off
diff --git a/arm9/lib/src/FX_mtx33.c b/arm9/lib/src/FX_mtx33.c
index 391a6104..90beddba 100644
--- a/arm9/lib/src/FX_mtx33.c
+++ b/arm9/lib/src/FX_mtx33.c
@@ -2,7 +2,7 @@
#include "main.h"
#include "fx.h"
-void MTX_ScaleApply33(struct Mtx33 *mtx, struct Mtx33 *dst, fx32 x, fx32 y, fx32 z){
+ARM_FUNC void MTX_ScaleApply33(struct Mtx33 *mtx, struct Mtx33 *dst, fx32 x, fx32 y, fx32 z){
dst->_[0] = ((fx64)x * mtx->_[0]) >> FX32_INT_SHIFT;
dst->_[1] = ((fx64)x * mtx->_[1]) >> FX32_INT_SHIFT;
dst->_[2] = ((fx64)x * mtx->_[2]) >> FX32_INT_SHIFT;
@@ -14,7 +14,7 @@ void MTX_ScaleApply33(struct Mtx33 *mtx, struct Mtx33 *dst, fx32 x, fx32 y, fx32
dst->_[8] = ((fx64)z * mtx->_[8]) >> FX32_INT_SHIFT;
}
-void MTX_Concat33(struct Mtx33 *a, struct Mtx33 *b, struct Mtx33 *c){
+ARM_FUNC void MTX_Concat33(struct Mtx33 *a, struct Mtx33 *b, struct Mtx33 *c){
struct Mtx33 temp;
struct Mtx33 *dst;
fx32 a0, a1, a2;
@@ -57,7 +57,7 @@ void MTX_Concat33(struct Mtx33 *a, struct Mtx33 *b, struct Mtx33 *c){
*c = temp;
}
-void MTX_MultVec33(struct Vecx32 *vec, struct Mtx33 *mtx, struct Vecx32 *dst){
+ARM_FUNC void MTX_MultVec33(struct Vecx32 *vec, struct Mtx33 *mtx, struct Vecx32 *dst){
fx32 x, y, z;
x = vec->x;
y = vec->y;
@@ -67,7 +67,7 @@ void MTX_MultVec33(struct Vecx32 *vec, struct Mtx33 *mtx, struct Vecx32 *dst){
dst->z = ((fx64)x * mtx->_[2] + (fx64)y * mtx->_[5] + (fx64)z * mtx->_[8]) >> FX32_INT_SHIFT;
}
-asm void MTX_Identity33_(struct Mtx33 *mtx){
+ARM_FUNC asm void MTX_Identity33_(struct Mtx33 *mtx){
mov r2, #0x1000
str r2, [r0, #0x20]
mov r3, #0x0
@@ -79,8 +79,7 @@ asm void MTX_Identity33_(struct Mtx33 *mtx){
bx lr
}
-#pragma thumb on
-asm void MTX_RotX33_(struct Mtx33 *mtx, fx32 sinphi, fx32 cosphi){
+THUMB_FUNC asm void MTX_RotX33_(struct Mtx33 *mtx, fx32 sinphi, fx32 cosphi){
mov r3, #0x1
lsl r3, r3, #0xc
str r3, [r0, #0x0]
@@ -96,10 +95,8 @@ asm void MTX_RotX33_(struct Mtx33 *mtx, fx32 sinphi, fx32 cosphi){
str r2, [r0, #0x20]
bx lr
}
-#pragma thumb off
-#pragma thumb on
-asm void MTX_RotY33_(struct Mtx33 *mtx, fx32 sinphi, fx32 cosphi){
+THUMB_FUNC asm void MTX_RotY33_(struct Mtx33 *mtx, fx32 sinphi, fx32 cosphi){
str r2, [r0, #0x0]
str r2, [r0, #0x20]
mov r3, #0x0
@@ -115,10 +112,8 @@ asm void MTX_RotY33_(struct Mtx33 *mtx, fx32 sinphi, fx32 cosphi){
str r3, [r0, #0x10]
bx lr
}
-#pragma thumb off
-#pragma thumb on
-asm void MTX_RotZ33_(struct Mtx33 *mtx, fx32 sinphi, fx32 cosphi){
+THUMB_FUNC asm void MTX_RotZ33_(struct Mtx33 *mtx, fx32 sinphi, fx32 cosphi){
stmia r0!, {r2}
mov r3, #0x0
stmia r0!, {r1,r3}
@@ -132,4 +127,3 @@ asm void MTX_RotZ33_(struct Mtx33 *mtx, fx32 sinphi, fx32 cosphi){
str r1, [r0, #0xc]
bx lr
}
-#pragma thumb off
diff --git a/arm9/lib/src/FX_mtx43.c b/arm9/lib/src/FX_mtx43.c
index 862bd6f2..96ab4062 100644
--- a/arm9/lib/src/FX_mtx43.c
+++ b/arm9/lib/src/FX_mtx43.c
@@ -3,7 +3,7 @@
#include "fx.h"
-void MTX_ScaleApply43(struct Mtx43 *mtx, struct Mtx43 *dst, fx32 x, fx32 y, fx32 z){
+ARM_FUNC void MTX_ScaleApply43(struct Mtx43 *mtx, struct Mtx43 *dst, fx32 x, fx32 y, fx32 z){
//this works because matrices are indexed columns first
MTX_ScaleApply33((struct Mtx33 *)mtx, (struct Mtx33 *)dst, x, y, z);
dst->_[9] = mtx->_[9];
@@ -11,7 +11,7 @@ void MTX_ScaleApply43(struct Mtx43 *mtx, struct Mtx43 *dst, fx32 x, fx32 y, fx32
dst->_[11] = mtx->_[11];
}
-fx32 MTX_Inverse43(struct Mtx43 *mtx, struct Mtx43 *inv){
+ARM_FUNC fx32 MTX_Inverse43(struct Mtx43 *mtx, struct Mtx43 *inv){
struct Mtx43 tempmat;
struct Mtx43 *dst;
fx32 det0, det1, det2, det;
@@ -59,7 +59,7 @@ fx32 MTX_Inverse43(struct Mtx43 *mtx, struct Mtx43 *inv){
return 0;
}
-void MTX_Concat43(struct Mtx43 *a, struct Mtx43 *b, struct Mtx43 *c){
+ARM_FUNC void MTX_Concat43(struct Mtx43 *a, struct Mtx43 *b, struct Mtx43 *c){
struct Mtx43 temp;
struct Mtx43 *dst;
fx32 a0, a1, a2;
@@ -107,7 +107,7 @@ void MTX_Concat43(struct Mtx43 *a, struct Mtx43 *b, struct Mtx43 *c){
*c = temp;
}
-void MTX_MultVec43(struct Vecx32 *vec, struct Mtx43 *mtx, struct Vecx32 *dst){
+ARM_FUNC void MTX_MultVec43(struct Vecx32 *vec, struct Mtx43 *mtx, struct Vecx32 *dst){
fx32 x, y, z;
x = vec->x;
y = vec->y;
@@ -120,7 +120,7 @@ void MTX_MultVec43(struct Vecx32 *vec, struct Mtx43 *mtx, struct Vecx32 *dst){
dst->z += mtx->_[11];
}
-asm void MTX_Identity43_(struct Mtx43 *mtx){
+ARM_FUNC asm void MTX_Identity43_(struct Mtx43 *mtx){
mov r2, #0x1000
mov r3, #0x0
stmia r0!, {r2-r3}
@@ -133,7 +133,7 @@ asm void MTX_Identity43_(struct Mtx43 *mtx){
bx lr
}
-asm void MTX_Copy43To44_(struct Mtx43 *src, struct Mtx44 *dst){
+ARM_FUNC asm void MTX_Copy43To44_(struct Mtx43 *src, struct Mtx44 *dst){
stmdb sp!, {r4}
mov r12, #0x0
ldmia r0!, {r2-r4}
@@ -149,8 +149,7 @@ asm void MTX_Copy43To44_(struct Mtx43 *src, struct Mtx44 *dst){
bx lr
}
-#pragma thumb on
-asm void MTX_Scale43_(struct Mtx43 *dst, fx32 x, fx32 y, fx32 z){
+THUMB_FUNC asm void MTX_Scale43_(struct Mtx43 *dst, fx32 x, fx32 y, fx32 z){
stmia r0!, {r1}
mov r1, #0x0
str r3, [r0, #0x1c]
@@ -163,10 +162,8 @@ asm void MTX_Scale43_(struct Mtx43 *dst, fx32 x, fx32 y, fx32 z){
stmia r0!, {r1-r3}
bx lr
}
-#pragma thumb off
-#pragma thumb on
-asm void MTX_RotX43_(struct Mtx43 *mtx, fx32 sinphi, fx32 cosphi){
+THUMB_FUNC asm void MTX_RotX43_(struct Mtx43 *mtx, fx32 sinphi, fx32 cosphi){
str r1, [r0, #0x14]
neg r1, r1
str r1, [r0, #0x1c]
@@ -183,10 +180,8 @@ asm void MTX_RotX43_(struct Mtx43 *mtx, fx32 sinphi, fx32 cosphi){
stmia r0!, {r1,r3}
bx lr
}
-#pragma thumb off
-#pragma thumb on
-asm void MTX_RotY43_(struct Mtx43 *mtx, fx32 sinphi, fx32 cosphi){
+THUMB_FUNC asm void MTX_RotY43_(struct Mtx43 *mtx, fx32 sinphi, fx32 cosphi){
str r1, [r0, #0x18]
mov r3, #0x0
stmia r0!, {r2-r3}
@@ -201,4 +196,3 @@ asm void MTX_RotY43_(struct Mtx43 *mtx, fx32 sinphi, fx32 cosphi){
stmia r0!, {r1,r3}
bx lr
}
-#pragma thumb off
diff --git a/arm9/lib/src/FX_mtx44.c b/arm9/lib/src/FX_mtx44.c
index 8d158602..8152907d 100644
--- a/arm9/lib/src/FX_mtx44.c
+++ b/arm9/lib/src/FX_mtx44.c
@@ -5,7 +5,7 @@
void MI_Copy48B(void *src, void *dst);
-void MTX_TransApply44(struct Mtx44 *mtx, struct Mtx44 *dst, fx32 x, fx32 y, fx32 z){
+ARM_FUNC void MTX_TransApply44(struct Mtx44 *mtx, struct Mtx44 *dst, fx32 x, fx32 y, fx32 z){
if(mtx != dst)
MI_Copy48B(mtx, dst);
dst->_[12] = mtx->_[12] + (fx32)(((fx64)x * mtx->_[0] + (fx64)y * mtx->_[4] + (fx64)z * mtx->_[8] ) >> FX32_INT_SHIFT);
@@ -14,7 +14,7 @@ void MTX_TransApply44(struct Mtx44 *mtx, struct Mtx44 *dst, fx32 x, fx32 y, fx32
dst->_[15] = mtx->_[15] + (fx32)(((fx64)x * mtx->_[3] + (fx64)y * mtx->_[7] + (fx64)z * mtx->_[11]) >> FX32_INT_SHIFT);
}
-void MTX_Concat44(struct Mtx44 *a, struct Mtx44 *b, struct Mtx44 *c){
+ARM_FUNC void MTX_Concat44(struct Mtx44 *a, struct Mtx44 *b, struct Mtx44 *c){
struct Mtx44 temp;
struct Mtx44 *dst;
fx32 a0, a1, a2, a3;
@@ -73,7 +73,7 @@ void MTX_Concat44(struct Mtx44 *a, struct Mtx44 *b, struct Mtx44 *c){
*c = temp;
}
-asm void MTX_Identity44_(struct Mtx44 *dst){
+ARM_FUNC asm void MTX_Identity44_(struct Mtx44 *dst){
mov r2, #0x1000
mov r3, #0x0
stmia r0!, {r2-r3}
@@ -87,7 +87,7 @@ asm void MTX_Identity44_(struct Mtx44 *dst){
bx lr
}
-asm void MTX_Copy44To43_(struct Mtx44 *src, struct Mtx43 *dst){
+ARM_FUNC asm void MTX_Copy44To43_(struct Mtx44 *src, struct Mtx43 *dst){
ldmia r0!, {r2-r3,r12}
add r0, r0, #0x4
stmia r1!, {r2-r3,r12}
@@ -103,8 +103,8 @@ asm void MTX_Copy44To43_(struct Mtx44 *src, struct Mtx43 *dst){
bx lr
}
-#pragma thumb on
-asm void MTX_RotX44_(struct Mtx44 *mtx, fx32 sinphi, fx32 cosphi){
+
+THUMB_FUNC asm void MTX_RotX44_(struct Mtx44 *mtx, fx32 sinphi, fx32 cosphi){
str r2, [r0, #0x14]
str r2, [r0, #0x28]
str r1, [r0, #0x18]
@@ -124,10 +124,8 @@ asm void MTX_RotX44_(struct Mtx44 *mtx, fx32 sinphi, fx32 cosphi){
str r1, [r0, #0x0]
bx lr
}
-#pragma thumb off
-#pragma thumb on
-asm void MTX_RotY44_(struct Mtx44 *mtx, fx32 sinphi, fx32 cosphi){
+THUMB_FUNC asm void MTX_RotY44_(struct Mtx44 *mtx, fx32 sinphi, fx32 cosphi){
str r2, [r0, #0x0]
str r2, [r0, #0x28]
str r1, [r0, #0x20]
@@ -147,10 +145,8 @@ asm void MTX_RotY44_(struct Mtx44 *mtx, fx32 sinphi, fx32 cosphi){
stmia r0!, {r1-r3}
bx lr
}
-#pragma thumb off
-#pragma thumb on
-asm void MTX_RotZ44_(struct Mtx44 *mtx, fx32 sinphi, fx32 cosphi){
+THUMB_FUNC asm void MTX_RotZ44_(struct Mtx44 *mtx, fx32 sinphi, fx32 cosphi){
str r2, [r0, #0x0]
str r2, [r0, #0x14]
str r1, [r0, #0x4]
@@ -169,4 +165,3 @@ asm void MTX_RotZ44_(struct Mtx44 *mtx, fx32 sinphi, fx32 cosphi){
stmia r0!, {r1-r3}
bx lr
}
-#pragma thumb off
diff --git a/arm9/lib/src/FX_vec.c b/arm9/lib/src/FX_vec.c
index 10a792be..af36fe89 100644
--- a/arm9/lib/src/FX_vec.c
+++ b/arm9/lib/src/FX_vec.c
@@ -2,36 +2,36 @@
#include "main.h"
#include "fx.h"
-void VEC_Add(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
+ARM_FUNC void VEC_Add(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
dst->x = a->x + b->x;
dst->y = a->y + b->y;
dst->z = a->z + b->z;
}
-void VEC_Subtract(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
+ARM_FUNC void VEC_Subtract(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
dst->x = a->x - b->x;
dst->y = a->y - b->y;
dst->z = a->z - b->z;
}
-void VEC_Fx16Add(struct Vecx16 *a, struct Vecx16 *b, struct Vecx16 *dst){
+ARM_FUNC void VEC_Fx16Add(struct Vecx16 *a, struct Vecx16 *b, struct Vecx16 *dst){
dst->x = a->x + b->x;
dst->y = a->y + b->y;
dst->z = a->z + b->z;
}
-fx32 VEC_DotProduct(struct Vecx32 *a, struct Vecx32 *b){
+ARM_FUNC fx32 VEC_DotProduct(struct Vecx32 *a, struct Vecx32 *b){
return ((fx64)a->x * b->x + (fx64)a->y * b->y + (fx64)a->z * b->z + (1 << (FX64_INT_SHIFT - 1))) >> FX64_INT_SHIFT;
}
-fx32 VEC_Fx16DotProduct(struct Vecx16 *a, struct Vecx16 *b){
+ARM_FUNC fx32 VEC_Fx16DotProduct(struct Vecx16 *a, struct Vecx16 *b){
fx32 temp1, temp2;
temp1 = (a->x * b->x) + (a->y * b->y);
temp2 = (a->z * b->z) + (1 << (FX64_INT_SHIFT - 1));
return (fx32)(((fx64)temp1 + temp2) >> FX64_INT_SHIFT);
}
-void VEC_CrossProduct(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
+ARM_FUNC void VEC_CrossProduct(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
fx32 x, y, z;
x = (fx32)(((fx64)a->y * b->z - (fx64)a->z * b->y + (1 << (FX64_INT_SHIFT - 1))) >> FX64_INT_SHIFT);
y = (fx32)(((fx64)a->z * b->x - (fx64)a->x * b->z + (1 << (FX64_INT_SHIFT - 1))) >> FX64_INT_SHIFT);
@@ -41,7 +41,7 @@ void VEC_CrossProduct(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
dst->z = z;
}
-void VEC_Fx16CrossProduct(struct Vecx16 *a, struct Vecx16 *b, struct Vecx16 *dst){
+ARM_FUNC void VEC_Fx16CrossProduct(struct Vecx16 *a, struct Vecx16 *b, struct Vecx16 *dst){
fx32 x, y, z;
x = ((a->y * b->z - a->z * b->y + (1 << (FX64_INT_SHIFT - 1))) >> FX64_INT_SHIFT);
y = ((a->z * b->x - a->x * b->z + (1 << (FX64_INT_SHIFT - 1))) >> FX64_INT_SHIFT);
@@ -51,7 +51,7 @@ void VEC_Fx16CrossProduct(struct Vecx16 *a, struct Vecx16 *b, struct Vecx16 *dst
dst->z = z;
}
-fx32 VEC_Mag(struct Vecx32 *a){
+ARM_FUNC fx32 VEC_Mag(struct Vecx32 *a){
fx64 l2 = (fx64)a->x * a->x;
l2 += (fx64)a->y * a->y;
l2 += (fx64)a->z * a->z;
@@ -61,7 +61,7 @@ fx32 VEC_Mag(struct Vecx32 *a){
return ((fx32)READREG32(HW_REG_SQRT_RESULT) + 1) >> 1;
}
-void VEC_Normalize(struct Vecx32 *a, struct Vecx32 *dst){
+ARM_FUNC void VEC_Normalize(struct Vecx32 *a, struct Vecx32 *dst){
fx64 l2 = (fx64)a->x * a->x;
l2 += (fx64)a->y * a->y;
l2 += (fx64)a->z * a->z;
@@ -81,7 +81,7 @@ void VEC_Normalize(struct Vecx32 *a, struct Vecx32 *dst){
dst->z = (l2 * a->z + (1LL << (0x2D - 1))) >> 0x2D;
}
-void VEC_Fx16Normalize(struct Vecx16 *a, struct Vecx16 *dst){
+ARM_FUNC void VEC_Fx16Normalize(struct Vecx16 *a, struct Vecx16 *dst){
fx64 l2 = a->x * a->x;
l2 += a->y * a->y;
l2 += a->z * a->z;
@@ -101,7 +101,7 @@ void VEC_Fx16Normalize(struct Vecx16 *a, struct Vecx16 *dst){
dst->z = (l2 * a->z + (1LL << (0x2D - 1))) >> 0x2D;
}
-void VEC_MultAdd(fx32 factor, struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
+ARM_FUNC void VEC_MultAdd(fx32 factor, struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
dst->x = (fx32)(((fx64)factor * a->x) >> FX32_INT_SHIFT) + b->x;
dst->y = (fx32)(((fx64)factor * a->y) >> FX32_INT_SHIFT) + b->y;
dst->z = (fx32)(((fx64)factor * a->z) >> FX32_INT_SHIFT) + b->z;