summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorAetias <aetias@outlook.com>2025-02-16 16:07:22 +0100
committerAetias <aetias@outlook.com>2025-02-16 16:07:22 +0100
commit83bdfdb8925d84d85b36ffbe69f256cc87da8116 (patch)
tree9ad569a2300e9d7e0d7f09f01bf9a2e7ba84e1ce /libs
parentd057996378f1235c67d93014595e9fd929a4efb6 (diff)
PlayerControl: Decomp 68%
Diffstat (limited to 'libs')
-rw-r--r--libs/nds/include/nds/math.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/nds/include/nds/math.h b/libs/nds/include/nds/math.h
index aaaf52fe..6cb1d524 100644
--- a/libs/nds/include/nds/math.h
+++ b/libs/nds/include/nds/math.h
@@ -8,6 +8,8 @@
extern "C" {
#endif
+#define ABS(x) ((x) < 0 ? -(x) : (x))
+
// Q20.12 fixed point number
typedef s32 q20;
// Q4.12 fixed point number
@@ -19,6 +21,7 @@ typedef s16 q4;
#define FLOAT_TO_Q19(n) ((s32) (((n) * 8192 + 1)))
#define ROUND_Q20(n) (((s32) (n) + 0x800) >> 12)
#define MUL_Q20(a, b) (q20)((((s64) (a)) * ((s64) (b)) + 0x800) >> 12)
+#define DIV_Q20(a, b) (((a) << 12) / (b))
#define DEG_TO_ANG(n) ((n) * 0x10000 / 360)
#define SIN(n) (gSinCosTable[2 * ((n) >> 4)])