mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-08-17 21:03:21 -04:00
37 lines
537 B
C
37 lines
537 B
C
#include <ultra64.h>
|
|
#include "constants.h"
|
|
#include "game/acosasin.h"
|
|
#include "bss.h"
|
|
#include "data.h"
|
|
#include "types.h"
|
|
|
|
f32 acosf(f32 value)
|
|
{
|
|
s16 intval;
|
|
|
|
if (value >= 1) {
|
|
intval = 32767;
|
|
} else if (value <= -1) {
|
|
intval = -32767;
|
|
} else {
|
|
intval = value * 32767.0f;
|
|
}
|
|
|
|
return acos(intval) * M_PI / 65535.0f;
|
|
}
|
|
|
|
f32 asinf(f32 value)
|
|
{
|
|
s16 intval;
|
|
|
|
if (value >= 1) {
|
|
intval = 32767;
|
|
} else if (value <= -1) {
|
|
intval = -32767;
|
|
} else {
|
|
intval = value * 32767.0f;
|
|
}
|
|
|
|
return asin(intval) * M_PI / 65535.0f;
|
|
}
|