diff options
author | Made <made111@gmx.de> | 2020-05-01 18:59:48 +0200 |
---|---|---|
committer | Made <made111@gmx.de> | 2020-05-01 18:59:48 +0200 |
commit | 009d3fbcf7e1e3ea94656b5233e0bc96fa7b5a5b (patch) | |
tree | 1b7bc878715cc3d2f95c74fd3768c8596bcfff97 /include/fx.h | |
parent | 10b569f131fc58959d7c50dd4b07f01a52b5e162 (diff) |
decompile FX.s, FX_atan.s and partially decompile FX_ves.s
Diffstat (limited to 'include/fx.h')
-rw-r--r-- | include/fx.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/fx.h b/include/fx.h new file mode 100644 index 00000000..82938219 --- /dev/null +++ b/include/fx.h @@ -0,0 +1,41 @@ +#ifndef GUARD_FX_H +#define GUARD_FX_H + +#define FX32_INT_MASK 0xFFFFF000 +#define FX32_INT_ABS_MASK 0x7FFFF000 +#define FX32_FRAC_MASK 0x00000FFF + +#define FX32_INT_SHIFT 0xC +#define FX64_INT_SHIFT 0xC + +#define FX32_INT(x) (((x) & FX32_INT_MASK) >> FX32_INT_SHIFT) +#define FX32_INT_ABS(x) (((x) & FX32_INT_ABS_MASK) >> FX32_INT_SHIFT) +#define FX32_FRAC(x) ((x) & FX32_FRAC_MASK) + +struct Vecx32 +{ + s32 x; + s32 y; + s32 z; +}; + +struct Vecx16 +{ + s16 x; + s16 y; + s16 z; +}; + +void FX_Init(); +s32 FX_Modf(s32 x, s32 *iptr); +s32 FX_Inv(s32 x); +u16 FX_Atan(s32 x); +u16 FX_Atan2(s32 x, s32 y); + +//Vec +void VEC_Add(struct Vecx32 *x, struct Vecx32 *y, struct Vecx32 *dst); +void VEC_Subtract(struct Vecx32 *x, struct Vecx32 *y, struct Vecx32 *dst); +void VEC_Fx16Add(struct Vecx16 *x, struct Vecx16 *y, struct Vecx16 *dst); +s32 VEC_DotProduct(struct Vecx32 *x, struct Vecx32 *y); + +#endif //GUARD_FX_H |