Skip to content

Commit

Permalink
Merge branch 'Bozo-working' of https://github.com/LordBozo/sly1 into …
Browse files Browse the repository at this point in the history
…Bozo-working
  • Loading branch information
LordBozo committed Aug 7, 2024
2 parents ba55d12 + 990f716 commit 363d593
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion include/sce/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ extern "C"
float fmodf(float x, float y);
}

#endif // MATH_H
#endif // MATH_H
6 changes: 3 additions & 3 deletions src/P2/bis.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ INCLUDE_ASM(const s32, "P2/bis", Read__18CBinaryInputStreamiPv);

void CBinaryInputStream::Align(int n)
{
int iVar1 = ((int)m_pb + (n - 1)) & -n;
m_cb -= (iVar1 - (int)m_pb);
m_pb = (byte*)iVar1;
int pbAligned = ((int)m_pb + (n - 1)) & -n;
m_cb -= (pbAligned - (int)m_pb);
m_pb = (byte*)pbAligned;
}

uchar CBinaryInputStream::U8Read()
Expand Down
54 changes: 27 additions & 27 deletions src/P2/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ static const float PI = 3.14159265359f;

float RadNormalize(float rad)
{
if ((rad < -PI) || (PI < rad))
if ((rad < -PI) || (PI < rad))
{
float modpos = GModPositive(rad + PI, 2 * PI);
rad = modpos - PI;
Expand All @@ -23,22 +23,22 @@ INCLUDE_ASM(const s32, "P2/util", func_001EA720);

float RadSmooth(float radCur, float radTarget, float dt, SMP *psmp, float *pdradNext)
{
float fVar1;
fVar1 = RadNormalize(radTarget - radCur);
fVar1 = GSmooth(0.0, fVar1, dt, psmp, pdradNext);
fVar1 = RadNormalize(radCur + fVar1);
return fVar1;
float result;

result = RadNormalize(radTarget - radCur);
result = GSmooth(0.0, result, dt, psmp, pdradNext);
result = RadNormalize(radCur + result);
return result;
}

float RadSmoothA(float radCur, float dradCur, float radTarget, float dt, SMPA *psmpa, float *pdradNext)
{
float fVar1;
float result;

fVar1 = RadNormalize(radTarget - radCur);
fVar1 = GSmoothA(0.0, dradCur, fVar1, dt, psmpa, pdradNext);
fVar1 = RadNormalize(radCur + fVar1);
return fVar1;
result = RadNormalize(radTarget - radCur);
result = GSmoothA(0.0, dradCur, result, dt, psmpa, pdradNext);
result = RadNormalize(radCur + result);
return result;
}

INCLUDE_ASM(const s32, "P2/util", PosSmooth);
Expand All @@ -48,7 +48,7 @@ INCLUDE_ASM(const s32, "P2/util", SmoothMatrix);
const int PRIME_MOD = 0x95675;

// Generates a random integer in the range [nLow, nHi]
int NRandInRange(int nLow, int nHi)
int NRandInRange(int nLow, int nHi)
{
if (nLow == nHi)
{
Expand Down Expand Up @@ -91,13 +91,13 @@ int FFloatsNear(float g1,float g2,float gEpsilon)
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;
}

Expand All @@ -113,12 +113,12 @@ INCLUDE_ASM(const s32, "P2/util", GTrunc1);

float GModPositive(float gDividend, float gDivisor)
{
float result = fmodf(gDividend, gDivisor);
if (result < 0.0f)
{
result += gDivisor;
}
return result;
float result = fmodf(gDividend, gDivisor);
if (result < 0.0f)
{
result += gDivisor;
}
return result;
}

void FitClq(float g0, float g1, float u, float gU, CLQ *pclq)
Expand Down Expand Up @@ -153,17 +153,17 @@ float GLimitLm(struct LM* plm, float g)

int SgnCompareG(float *pg1,float *pg2)
{
int iVar1;
iVar1 = 1;
int result;

result = 1;
if (*pg1 > *pg2)
{
return iVar1;
return result;
}
iVar1 = -1;
result = -1;
if(*pg2 > *pg1)
{
return iVar1;
return result;
}
return 0;
}
Expand Down

0 comments on commit 363d593

Please sign in to comment.