summaryrefslogtreecommitdiff
path: root/include/global.h
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@users.noreply.github.com>2021-07-14 14:15:12 -0400
committerGitHub <noreply@github.com>2021-07-14 14:15:12 -0400
commit2162e948d1889cbf5c651b9747dab1194323f2da (patch)
tree57a826d56544031e7193ec180ca003c704efd654 /include/global.h
parent05559a2fcff5262b6a0c694e745e8dbdb5905a10 (diff)
parent6333c3957edf9130ac44ac7fd152a8563621f1a5 (diff)
Merge pull request #831 from PikalaxALT/more_matching
Match more functions
Diffstat (limited to 'include/global.h')
-rw-r--r--include/global.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/global.h b/include/global.h
index 7897e20c2..3a26a2c3e 100644
--- a/include/global.h
+++ b/include/global.h
@@ -96,16 +96,22 @@ enum
})
// Converts a number to Q8.8 fixed-point format
-#define Q_8_8(n) ((s16)((n) * 256))
+#define Q_8_8(n) ((s16)((n) * 256))
// Converts a number from Q8.8 fixed-point format to integer
#define Q_8_8_TO_INT(n) ((s16)((n) >> 8))
// Converts a number to Q4.12 fixed-point format
-#define Q_4_12(n) ((s16)((n) * 4096))
+#define Q_4_12(n) ((s16)((n) * 4096))
// Converts a number from Q4.12 fixed-point format to integer
-#define Q_4_12_TO_INT(n) ((s16)((n) >> 12))
+#define Q_4_12_TO_INT(n) ((s16)((n) >> 12))
+
+// Converts a number to Q24.8 fixed-point format
+#define Q_24_8(n) ((s32)((n) * 256))
+
+// Converts a number from Q24.8 fixed-point format to integer
+#define Q_24_8_TO_INT(x) ((s32)((x) >> 8))
// Credits to Made (dolphin emoji)
#define S16TOPOSFLOAT(val) \