summaryrefslogtreecommitdiff
path: root/include/global.h
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2018-02-11 16:01:59 -0500
committerProjectRevoTPP <projectrevotpp@hotmail.com>2018-02-11 16:01:59 -0500
commit8b8ccbbc41141637297cfe847f1ce62e6139d965 (patch)
tree9aaded6bb8e02ca4d264fccbac307c4cb6efc074 /include/global.h
parent3a70fa1ae461cab27443ac53faec35db1d6b89d3 (diff)
parent9bf6448707a36bf7d530bf932347c1adb508192e (diff)
Merge branch 'master' of https://github.com/pret/pokeruby into visual_studio
Diffstat (limited to 'include/global.h')
-rw-r--r--include/global.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h
index d0af4a4d1..6dd772795 100644
--- a/include/global.h
+++ b/include/global.h
@@ -65,6 +65,15 @@ enum
#define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24))
#define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr)
+// Credits to Made (dolphin emoji)
+#define S16TOPOSFLOAT(val) \
+({ \
+ s16 v = (val); \
+ float f = (float)v; \
+ if(v < 0) f += 65536.0f; \
+ f; \
+})
+
enum
{
VERSION_SAPPHIRE = 1,