mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
ok this makes a *lot* more sense
This commit is contained in:
parent
8f450faa56
commit
3f42215602
@ -84,19 +84,9 @@ 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
|
||||||
{
|
this->zquo = ((z1 - z0) >> 1) / xdiff << 1;
|
||||||
// remainder is unused for this path
|
this->zcounter = z0;
|
||||||
this->zquo = ((z1 - z0) >> 1) / xdiff << 1;
|
|
||||||
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
|
||||||
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user