mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Software backend: make TEV rounding match hardware.
Formulas stolen from gxtest. (Not sure how "==" got turned into "!=", but I'm pretty confident the patched version is correct.)
This commit is contained in:
parent
12d7ffac13
commit
5e1c6aba33
@ -185,8 +185,9 @@ void Tev::DrawColorRegular(TevStageCombiner::ColorCombiner &cc, const InputRegTy
|
||||
|
||||
s32 temp = InputReg.a * (256 - c) + (InputReg.b * c);
|
||||
temp <<= m_ScaleLShiftLUT[cc.shift];
|
||||
temp += (cc.shift != 3) ? 0 : (cc.op == 1) ? 127 : 128;
|
||||
temp = cc.op ? (-temp >> 8) : (temp >> 8);
|
||||
temp += (cc.shift == 3) ? 0 : (cc.op == 1) ? 127 : 128;
|
||||
temp >>= 8;
|
||||
temp = cc.op ? -temp : temp;
|
||||
|
||||
s32 result = ((InputReg.d + m_BiasLUT[cc.bias]) << m_ScaleLShiftLUT[cc.shift]) + temp;
|
||||
result = result >> m_ScaleRShiftLUT[cc.shift];
|
||||
|
Loading…
x
Reference in New Issue
Block a user