summaryrefslogtreecommitdiff
path: root/arm9/lib/NitroSDK/src
diff options
context:
space:
mode:
authorAkira Akashi <rubenru09@aol.com>2021-07-25 20:12:22 +0100
committerGitHub <noreply@github.com>2021-07-25 20:12:22 +0100
commit0c2db8de60375ab8c450ea64320feb22431f43aa (patch)
treeaa1dcc5d2980a74dff1a7bb238f8f1fc56aff323 /arm9/lib/NitroSDK/src
parent68d7aa47cc52ef822220e0e35890863d7cad479f (diff)
parent7e5c80f9b086a0e1df2430a0c0ed2f9eec3a5cb0 (diff)
Merge pull request #414 from PikalaxALT/pikalax_work
[Leak informed] Decompile camera-related code
Diffstat (limited to 'arm9/lib/NitroSDK/src')
-rw-r--r--arm9/lib/NitroSDK/src/FX_vec.c15
-rw-r--r--arm9/lib/NitroSDK/src/GX_g3_util.c2
2 files changed, 8 insertions, 9 deletions
diff --git a/arm9/lib/NitroSDK/src/FX_vec.c b/arm9/lib/NitroSDK/src/FX_vec.c
index 005872ac..18d0939f 100644
--- a/arm9/lib/NitroSDK/src/FX_vec.c
+++ b/arm9/lib/NitroSDK/src/FX_vec.c
@@ -1,15 +1,14 @@
-#include "fx.h"
-
-#include "global.h"
+#include "function_target.h"
#include "registers.h"
+#include "fx.h"
-ARM_FUNC void VEC_Add(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
+ARM_FUNC void VEC_Add(const struct Vecx32 *a, const struct Vecx32 *b, struct Vecx32 *dst){
dst->x = a->x + b->x;
dst->y = a->y + b->y;
dst->z = a->z + b->z;
}
-ARM_FUNC void VEC_Subtract(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
+ARM_FUNC void VEC_Subtract(const struct Vecx32 *a, const struct Vecx32 *b, struct Vecx32 *dst){
dst->x = a->x - b->x;
dst->y = a->y - b->y;
dst->z = a->z - b->z;
@@ -21,7 +20,7 @@ ARM_FUNC void VEC_Fx16Add(struct Vecx16 *a, struct Vecx16 *b, struct Vecx16 *dst
dst->z = (s16)(a->z + b->z);
}
-ARM_FUNC fx32 VEC_DotProduct(struct Vecx32 *a, struct Vecx32 *b){
+ARM_FUNC fx32 VEC_DotProduct(const struct Vecx32 *a, const struct Vecx32 *b){
return (fx32)(((fx64)a->x * b->x + (fx64)a->y * b->y + (fx64)a->z * b->z + (1 << (FX64_INT_SHIFT - 1))) >> FX64_INT_SHIFT);
}
@@ -32,7 +31,7 @@ ARM_FUNC fx32 VEC_Fx16DotProduct(struct Vecx16 *a, struct Vecx16 *b){
return (fx32)(((fx64)temp1 + temp2) >> FX64_INT_SHIFT);
}
-ARM_FUNC void VEC_CrossProduct(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *dst){
+ARM_FUNC void VEC_CrossProduct(const struct Vecx32 *a, const 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);
@@ -62,7 +61,7 @@ ARM_FUNC fx32 VEC_Mag(struct Vecx32 *a){
return ((fx32)reg_CP_SQRT_RESULT + 1) >> 1;
}
-ARM_FUNC void VEC_Normalize(struct Vecx32 *a, struct Vecx32 *dst){
+ARM_FUNC void VEC_Normalize(const 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;
diff --git a/arm9/lib/NitroSDK/src/GX_g3_util.c b/arm9/lib/NitroSDK/src/GX_g3_util.c
index e647f1c7..b4fdd0cc 100644
--- a/arm9/lib/NitroSDK/src/GX_g3_util.c
+++ b/arm9/lib/NitroSDK/src/GX_g3_util.c
@@ -165,7 +165,7 @@ ARM_FUNC void G3i_OrthoW_(fx32 top, fx32 bottom, fx32 left, fx32 right, fx32 nea
}
}
-ARM_FUNC void G3i_LookAt_(struct Vecx32 *a, struct Vecx32 *b, struct Vecx32 *c, u32 load, struct Mtx44 *mtx){
+ARM_FUNC void G3i_LookAt_(const struct Vecx32 *a, const struct Vecx32 *b, const struct Vecx32 *c, BOOL load, struct Mtx43 *mtx){
struct Vecx32 temp, temp1, temp2;
fx32 c1, c2, c3;
vu32 *reg_ptr;