38static inline float __pure
fipr(
float x,
float y,
float z,
float w,
39 float a,
float b,
float c,
float d) {
40 return __fipr(x, y, z, w, a, b, c, d);
48 return __fipr_magnitude_sqr(x, y, z, w);
56static inline float __pure
fsin(
float r) {
65static inline __pure
float fcos(
float r) {
74static inline __pure
float ftan(
float r) {
83static inline __pure
float fisin(
int d) {
92static inline __pure
float ficos(
int d) {
101static inline float __pure
fitan(
int d) {
109static inline float __pure
fsqrt(
float f) {
116static inline float __pure
frsqrt(
float f) {
129static inline void fsincos(
float f,
float *s,
float *c) {
130 __fsincos(f, *s, *c);
142static inline void fsincosr(
float f,
float *s,
float *c) {
143 __fsincosr(f, *s, *c);
171 uint8_t hp = (uint8_t)(h * 255.0f);
173 uint8_t k2 = (uint8_t)(hp * __fsin(t));
174 uint8_t k3 = (uint8_t)(hp * __fcos(t));
175 uint8_t qp = (uint8_t)((q / (2 *
F_PI)) * 255.0f);
177 return (k1 << 24) | (k2 << 16) | (k3 << 8) | qp;
184#if __STDC_VERSION__ >= 199901L || !defined(__GNUC__)
185extern float fipr(
float x,
float y,
float z,
float w,
float a,
float b,
float c,
188extern float fsin(
float r);
189extern float fcos(
float r);
190extern float ftan(
float r);
191extern float fisin(
int d);
192extern float ficos(
int d);
193extern float fitan(
int d);
194extern float fsqrt(
float f);
195extern float frsqrt(
float f);
196extern void fsincos(
float f,
float *s,
float *c);
197extern void fsincosr(
float f,
float *s,
float *c);
Various common macros used throughout the codebase.
Base definitions for the DC's special math instructions.
static float __pure frsqrt(float f)
Definition fmath.h:116
static uint32_t __pure pvr_pack_bump(float h, float t, float q)
Calculate the offset color value for a set of bumpmap parameters.
Definition fmath.h:170
static float __pure fipr_magnitude_sqr(float x, float y, float z, float w)
Floating point inner product w/self (square of vector magnitude)
Definition fmath.h:47
static void fsincosr(float f, float *s, float *c)
Calculate the sine and cosine of a value in radians.
Definition fmath.h:142
static void fsincos(float f, float *s, float *c)
Calculate the sine and cosine of a value in degrees.
Definition fmath.h:129
static float __pure fsqrt(float f)
Floating point square root.
Definition fmath.h:109
static __pure float ficos(int d)
Integer cosine.
Definition fmath.h:92
static float __pure fipr(float x, float y, float z, float w, float a, float b, float c, float d)
Floating point inner product.
Definition fmath.h:38
static float __pure fsin(float r)
Floating point sine.
Definition fmath.h:56
static __pure float fcos(float r)
Floating point cosine.
Definition fmath.h:65
static float __pure fitan(int d)
Integer tangent.
Definition fmath.h:101
static __pure float ftan(float r)
Floating point tangent.
Definition fmath.h:74
static __pure float fisin(int d)
Integer sine.
Definition fmath.h:83
#define F_PI
PI constant (if you don't want full math.h)
Definition fmath_base.h:32
static uint32_t("Please see purupuru_effect_t for modern equivalent.") PURUPURU_EFFECT2_UINTENSITY(uint8_t x)
Definition purupuru.h:96