From a29f3e05184f396ffa341eb0f8f126fdcc8de876 Mon Sep 17 00:00:00 2001 From: Lol Bozo Date: Sun, 25 Aug 2024 21:42:00 -0400 Subject: [PATCH] Prescale Clq matched --- config/symbol_addrs.txt | 2 +- src/P2/util.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/symbol_addrs.txt b/config/symbol_addrs.txt index 3481b08c..301df985 100644 --- a/config/symbol_addrs.txt +++ b/config/symbol_addrs.txt @@ -795,7 +795,7 @@ GRandInRange__Fff = 0x1EAAE0; // type:func GRandGaussian = 0x1EAB48; // type:func FFloatsNear__Ffff = 0x1EAC68; // type:func CSolveQuadratic = 0x1EACA0; // type:func -PrescaleClq = 0x1EAD30; // type:func +PrescaleClq__FP3CLQffT0 = 0x1EAD30; // type:func CalculateSinCos__FfPfT1 = 0x1EAD88; // type:func GTrunc = 0x1EAE78; // type:func GTrunc1 = 0x1EAF28; // type:func diff --git a/src/P2/util.c b/src/P2/util.c index be73c27e..9ebe1d7e 100644 --- a/src/P2/util.c +++ b/src/P2/util.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -103,7 +104,12 @@ int FFloatsNear(float g1,float g2,float gEpsilon) INCLUDE_ASM(const s32, "P2/util", CSolveQuadratic); -INCLUDE_ASM(const s32, "P2/util", PrescaleClq); +void PrescaleClq(CLQ *pclqSrc, float ru, float du, CLQ *pclqDst) +{ + pclqDst->w = pclqSrc->w * ru * ru; + pclqDst->v = (pclqSrc->w + pclqSrc->w) * ru * du + pclqSrc->v * ru; + pclqDst->u = pclqSrc->w * du * du + pclqSrc->v * du + pclqSrc->u; +} INCLUDE_ASM(const s32, "P2/util", CalculateSinCos__FfPfT1);