kh1/include/common_math.h
Noah McQueen 4af0c0ca3a
xball (#47)
* xball

* Slightly adjusted math, added sqrt inline, more matches
2024-06-28 02:28:36 +09:00

16 lines
397 B
C

#include "common.h"
// Kingdom Hearts universally uses a slightly incorrect value for Pi (3.1415927)
#define PI 3.1415928f
f32 cosf(f32);
f32 atan2f(f32, f32);
/// inline asm sqrt to bypass fastmath flag, avoids optimizations not present in final binary
static inline f32 _sqrtf(f32 arg) {
f32 result;
__asm__ volatile("sqrt.s %0, %1" : "=f"(result) : " f"(arg));
return result;
}