diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2020-05-23 16:42:42 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2020-05-23 16:42:42 -0400 |
commit | d1063c084aeac60c98b40c3ef1ea36c9bfbd273a (patch) | |
tree | 7262e604d9f671d61bc2a60d806dd2bbd0bfbef2 /arm9/lib/include/fx.h | |
parent | 67669f6daf3bfe989eaad9322f5ea5706ee572e2 (diff) |
Finish distributing rom2_2.s
Diffstat (limited to 'arm9/lib/include/fx.h')
-rw-r--r-- | arm9/lib/include/fx.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arm9/lib/include/fx.h b/arm9/lib/include/fx.h index e0ba52f3..3df89293 100644 --- a/arm9/lib/include/fx.h +++ b/arm9/lib/include/fx.h @@ -55,6 +55,13 @@ typedef s64 fx64c; #define FX_MUL_FX32_FX64C(a, b) ((fx32)((((a) * (b) + ((fx64)1 << (FX64C_INT_SHIFT - 1))) >> FX64C_INT_SHIFT))) +#define FX_FX16_TO_F32(x) ((f32)((x) / (f32)(1 << FX16_SHIFT))) +#define FX_F32_TO_FX16(x) ((fx16)(((x) > 0) ? \ + (fx16)((x) * (1 << FX16_INT_SHIFT) + 0.5f ) : \ + (fx16)((x) * (1 << FX16_INT_SHIFT) - 0.5f ))) + +#define FX16_CONST(x) FX_F32_TO_FX16(x) + struct Vecx32 { fx32 x; |