Shipwright/soh/src/libultra/gu/sins.c
M4xw 39cc86c260 git subrepo clone https://github.com/HarbourMasters/soh.git
subrepo:
  subdir:   "soh"
  merged:   "ba904bbd0"
upstream:
  origin:   "https://github.com/HarbourMasters/soh.git"
  branch:   "master"
  commit:   "ba904bbd0"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-22 02:51:23 +01:00

21 lines
304 B
C

#include "ultra64.h"
#include "sintable.c"
s16 sins(u16 x) {
s16 value;
x >>= 4;
if (x & 0x400) {
value = sintable[0x3FF - (x & 0x3FF)];
} else {
value = sintable[x & 0x3FF];
}
if (x & 0x800) {
return -value;
} else {
return value;
}
}