1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Correct VI.width calculation when hEnd is zero.

Corrected commit 42fe2ddf09 since it brokes background in F1 Pole Position, #263
This commit is contained in:
Sergey Lipskiy 2015-03-01 20:54:42 +06:00
parent 686690f919
commit 97c9fecd8c

7
VI.cpp
View File

@ -37,7 +37,12 @@ void VI_UpdateSize()
VI.interlaced = (*REG.VI_STATUS & 0x40) != 0;
const bool isPAL = (*REG.VI_V_SYNC & 0x3ff) > 550;
VI.width = hEnd == 0 ? 0 : (u32)floor((hEnd - (isPAL ? 128 : 108))* xScale + 0.5f);
if (hEnd != 0)
VI.width = (u32)floor((hEnd - (isPAL ? 128 : 108))* xScale + 0.5f);
else if (!VI.interlaced)
VI.width = *REG.VI_WIDTH;
else
VI.width = 0;
#if 0
const f32 yScale = _FIXED2FLOAT(vScale, 10);