From 009d3fbcf7e1e3ea94656b5233e0bc96fa7b5a5b Mon Sep 17 00:00:00 2001 From: Made Date: Fri, 1 May 2020 18:59:48 +0200 Subject: decompile FX.s, FX_atan.s and partially decompile FX_ves.s --- include/fx.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 include/fx.h (limited to 'include') 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 -- cgit v1.2.3