summaryrefslogtreecommitdiff
path: root/src/math_util.h
diff options
context:
space:
mode:
authorTyler McGavran <tyler.taggerung@gmail.com>2022-01-18 07:46:58 -0500
committerGitHub <noreply@github.com>2022-01-18 05:46:58 -0700
commite413e2ec00236b11a49b3ca4b856318df7d08b4c (patch)
tree73dc041df0749f0f5b33142c51a09e8dd26bc2ad /src/math_util.h
parent5e577b8999ba1ba988609df490499270b74848ff (diff)
Match 4 functions in math_util, do some tidying up of imports for math_util (#144)
* Match func_802B5450, func_802B5F00, func_802B71CC * Match func_802B4FF8 Also do some import fixing Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Diffstat (limited to 'src/math_util.h')
-rw-r--r--src/math_util.h33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/math_util.h b/src/math_util.h
index dde024762..a3f3ae7f4 100644
--- a/src/math_util.h
+++ b/src/math_util.h
@@ -4,25 +4,7 @@
#include <PR/ultratypes.h>
#include "types.h"
-
-/*
- * The sine and cosine tables overlap, but "#define gCosineTable (gSineTable +
- * 0x400)" doesn't give expected codegen; gSineTable and gCosineTable need to
- * be different symbols for code to match. Most likely the tables were placed
- * adjacent to each other, and gSineTable cut short, such that reads overflow
- * into gCosineTable.
- *
- * These kinds of out of bounds reads are undefined behavior, and break on
- * e.g. GCC (which doesn't place the tables next to each other, and probably
- * exploits array sizes for range analysis-based optimizations as well).
- * Thus, for non-IDO compilers we use the standard-compliant version.
- */
-extern f32 gSineTable[];
-#ifdef AVOID_UB
-#define gCosineTable (gSineTable + 0x400)
-#else
-extern f32 gCosineTable[];
-#endif
+#include "trig_tables.h"
//#define sins(x) gSineTable[(u16) (x) >> 4]
//#define coss(x) gCosineTable[(u16) (x) >> 4]
@@ -32,4 +14,17 @@ extern f32 gCosineTable[];
#define sqr(x) ((x) * (x))
+s32 func_802B4FF8(Mat4, s32);
+void mtxf_identity(Mat4);
+void func_802B5398(Mat4, Mat4, s32);
+void func_802B5450(Mat4, Mat4, Mat4);
+void func_802B54EC(Mat4, Mat4, Mat4);
+void mtxf_translate(Mat4, Vec3f);
+void func_802B5F00(Mat4, f32);
+void func_802B71CC(Mat4, Mat4, Mat4);
+void func_802B75F8(Mtx*, Mat4);
+u32 func_802B7830(f32, f32);
+f32 sins(u16);
+f32 coss(u16);
+
#endif // MATH_UTIL_H