2021-09-15 23:24:19 +00:00
|
|
|
#ifndef ULTRA64_GU_H
|
|
|
|
#define ULTRA64_GU_H
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2023-10-27 14:06:44 +00:00
|
|
|
#include "ultratypes.h"
|
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
#define GU_PI 3.1415926
|
|
|
|
|
2024-08-29 01:30:36 +00:00
|
|
|
#define FTOFIX32(x) (s32)((x) * (f32)0x00010000)
|
|
|
|
#define FIX32TOF(x) ((f32)(x) * (1.0f / (f32)0x00010000))
|
|
|
|
|
2020-07-07 00:15:01 +00:00
|
|
|
#define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5))
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef union du {
|
2023-10-27 14:06:44 +00:00
|
|
|
struct {
|
|
|
|
u32 hi;
|
|
|
|
u32 lo;
|
|
|
|
} word;
|
|
|
|
|
|
|
|
f64 d;
|
|
|
|
} du;
|
|
|
|
|
2024-08-12 07:07:48 +00:00
|
|
|
typedef union fu {
|
2023-10-27 14:06:44 +00:00
|
|
|
u32 i;
|
|
|
|
f32 f;
|
|
|
|
} fu;
|
|
|
|
|
2024-06-19 04:00:23 +00:00
|
|
|
f32 sinf(f32 angle);
|
|
|
|
s16 sins(u16 angle);
|
|
|
|
|
|
|
|
f32 cosf(f32 angle);
|
|
|
|
s16 coss(u16 angle);
|
|
|
|
|
2023-10-27 14:06:44 +00:00
|
|
|
extern f32 __libm_qnan_f;
|
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
#endif
|