mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-29 00:59:56 -06:00
ok this makes a *lot* more sense
This commit is contained in:
@ -83,21 +83,11 @@ private:
|
|||||||
|
|
||||||
// calculate quotient and remainder for Z interpolation
|
// calculate quotient and remainder for Z interpolation
|
||||||
if (!dir && !wbuffer && xdiff != 0)
|
if (!dir && !wbuffer && xdiff != 0)
|
||||||
{
|
|
||||||
if (z0 < z1)
|
|
||||||
{
|
{
|
||||||
// remainder is unused for this path
|
// remainder is unused for this path
|
||||||
this->zquo = ((z1 - z0) >> 1) / xdiff << 1;
|
this->zquo = ((z1 - z0) >> 1) / xdiff << 1;
|
||||||
this->zcounter = z0;
|
this->zcounter = z0;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// should optimize down to one divide instruction
|
|
||||||
this->zquo = ((z0 - z1) >> 1) / xdiff << 1;
|
|
||||||
s32 rem = ((z0 - z1) >> 1) % xdiff << 1;
|
|
||||||
this->zcounter = z1 + (zquo * xdiff) + rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// linear mode is used if both W values are equal and have
|
// linear mode is used if both W values are equal and have
|
||||||
// low-order bits cleared (0-6 along X, 1-6 along Y)
|
// low-order bits cleared (0-6 along X, 1-6 along Y)
|
||||||
@ -204,17 +194,7 @@ private:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// these algorithms are weiiird but i can't argue with the results
|
return zcounter += zquo;
|
||||||
if (z0 < z1)
|
|
||||||
{
|
|
||||||
zcounter += zquo;
|
|
||||||
return zcounter;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
zcounter -= zquo;
|
|
||||||
return zcounter;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user