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
@ -83,21 +83,11 @@ private:
|
||||
|
||||
// calculate quotient and remainder for Z interpolation
|
||||
if (!dir && !wbuffer && xdiff != 0)
|
||||
{
|
||||
if (z0 < z1)
|
||||
{
|
||||
// remainder is unused for this path
|
||||
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
|
||||
// low-order bits cleared (0-6 along X, 1-6 along Y)
|
||||
@ -204,17 +194,7 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
// these algorithms are weiiird but i can't argue with the results
|
||||
if (z0 < z1)
|
||||
{
|
||||
zcounter += zquo;
|
||||
return zcounter;
|
||||
}
|
||||
else
|
||||
{
|
||||
zcounter -= zquo;
|
||||
return zcounter;
|
||||
}
|
||||
return zcounter += zquo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user