mirror of
https://github.com/TheOnlyZac/sly1.git
synced 2024-11-22 21:29:55 +00:00
Util Function Match
Matched FFloatsNear in Util.c
This commit is contained in:
parent
df3946a112
commit
8268ade33d
@ -625,7 +625,7 @@ SmoothMatrix = 0x1EA918; // type:func
|
||||
NRandInRange__Fii = 0x1EAA70; // type:func
|
||||
GRandInRange = 0x1EAAE0; // type:func
|
||||
GRandGaussian = 0x1EAB48; // type:func
|
||||
FFloatsNear = 0x1EAC68; // type:func
|
||||
FFloatsNear__Ffff = 0x1EAC68; // type:func
|
||||
CSolveQuadratic = 0x1EACA0; // type:func
|
||||
PrescaleClq = 0x1EAD30; // type:func
|
||||
CalculateSinCos__FfPfT1 = 0x1EAD88; // type:func
|
||||
|
@ -29,7 +29,7 @@ PRE_ELF_PATH = f"{OUTDIR}/{BASENAME}.elf"
|
||||
COMMON_INCLUDES = "-Iinclude -isystem include/sdk/ee -isystem include/gcc"
|
||||
|
||||
CC_DIR = f"{TOOLS_DIR}/cc/bin"
|
||||
COMMON_COMPILE_FLAGS = "-x c++ -V 2.95.2 -O2 -G0"
|
||||
COMMON_COMPILE_FLAGS = "-x c++ -V 2.95.2 -O2 -G0 -ffast-math"
|
||||
|
||||
WINE = "wine"
|
||||
|
||||
|
@ -49,7 +49,22 @@ INCLUDE_ASM(const s32, "P2/util", GRandInRange);
|
||||
|
||||
INCLUDE_ASM(const s32, "P2/util", GRandGaussian);
|
||||
|
||||
INCLUDE_ASM(const s32, "P2/util", FFloatsNear);
|
||||
int FFloatsNear(float g1,float g2,float gEpsilon)
|
||||
{
|
||||
float x = 1.0f;
|
||||
g2 = g1-g2;
|
||||
g1 = g1 > 0.0f ? g1 : -g1;
|
||||
g2 = g2 > 0.0f ? g2 : -g2;
|
||||
x = g1 > x ? g1 : x;
|
||||
|
||||
|
||||
g2 = g2 / x;
|
||||
if(g2 < gEpsilon)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "P2/util", CSolveQuadratic);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user