From 397468fc0f5c87b8753bc2be58e8b648dbc7f3af Mon Sep 17 00:00:00 2001 From: ariahiro64 Date: Mon, 11 Sep 2023 19:05:58 -0400 Subject: [PATCH] actualy_bipass_lookuptable --- src/libultra/gu/coss.c | 5 +++++ src/libultra/gu/sins.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libultra/gu/coss.c b/src/libultra/gu/coss.c index 0eb8b5e65d..b92704593e 100644 --- a/src/libultra/gu/coss.c +++ b/src/libultra/gu/coss.c @@ -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 } diff --git a/src/libultra/gu/sins.c b/src/libultra/gu/sins.c index 636b76bd66..0310ca5840 100644 --- a/src/libultra/gu/sins.c +++ b/src/libultra/gu/sins.c @@ -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; @@ -22,4 +27,5 @@ s16 sins(u16 angle) { } else { return value; } +#endif }