Skip to content

Commit

Permalink
actualy_bipass_lookuptable
Browse files Browse the repository at this point in the history
  • Loading branch information
ariahiro64 committed Sep 11, 2023
1 parent 92bef06 commit 397468f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/libultra/gu/coss.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#include "global.h"

#include "config.h"
/**
* @param angle binang
* @return cos(angle)*0x7FFF
*/
s16 coss(u16 angle) {
#ifdef DISABLE_SIN_COS_LOOKUP_TABLE
return Math_CosS(angle) * 0x7FFF;
#else
return sins(angle + 0x4000);
#endif
}
8 changes: 7 additions & 1 deletion src/libultra/gu/sins.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#include "ultra64.h"

#include "config.h"
#ifndef DISABLE_SIN_COS_LOOKUP_TABLE
#include "sintable.inc.c"

#endif
/**
* @param angle binang
* @return sin(angle)*0x7FFF
*/
s16 sins(u16 angle) {
#ifdef DISABLE_SIN_COS_LOOKUP_TABLE
return Math_SinS(angle) * 0x7FFF;
#else
s16 value;

angle >>= 4;
Expand All @@ -22,4 +27,5 @@ s16 sins(u16 angle) {
} else {
return value;
}
#endif
}

0 comments on commit 397468f

Please sign in to comment.