1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Correct previous width calculation in VI_UpdateSize().

Now buffers removed when old and new VI width is not zero.

Fixed knockout 2000, issue #294
This commit is contained in:
Sergey Lipskiy 2015-04-02 15:47:05 +06:00
parent b136d05a3d
commit 42e75032fb
2 changed files with 7 additions and 9 deletions

11
VI.cpp
View File

@ -31,8 +31,8 @@ void VI_UpdateSize()
const u32 vEnd = _SHIFTR( *REG.VI_V_START, 0, 10 );
const u32 vStart = _SHIFTR( *REG.VI_V_START, 16, 10 );
const bool interlacedPrev = VI.interlaced;
const u32 widthPrev = VI.width;
const u32 heightPrev = VI.height;
if (VI.width > 0)
VI.widthPrev = VI.width;
VI.real_height = vEnd > vStart ? (((vEnd - vStart) >> 1) * vScale) >> 10 : 0;
VI.width = *REG.VI_WIDTH;
@ -66,10 +66,9 @@ void VI_UpdateSize()
// const int fsaa = ((*REG.VI_STATUS) >> 8) & 3;
// const int divot = ((*REG.VI_STATUS) >> 4) & 1;
FrameBufferList & fbList = frameBufferList();
FrameBuffer * pBuffer = fbList.findBuffer(VI.lastOrigin);
if (config.frameBufferEmulation.enable && ((interlacedPrev != VI.interlaced) || (pBuffer != NULL && pBuffer->m_width != VI.width))) {
fbList.removeBuffers(widthPrev);
if (config.frameBufferEmulation.enable && ((interlacedPrev != VI.interlaced) || (VI.width > 0 && VI.width != VI.widthPrev))) {
FrameBufferList & fbList = frameBufferList();
fbList.removeBuffers(VI.widthPrev);
fbList.removeBuffers(VI.width);
depthBufferList().destroy();
depthBufferList().init();

5
VI.h
View File

@ -4,14 +4,13 @@
struct VIInfo
{
u32 width;
u32 height, real_height;
u32 width, widthPrev, height, real_height;
f32 rwidth, rheight;
u32 lastOrigin;
bool interlaced;
VIInfo() :
width(0), height(0), real_height(0),
width(0), widthPrev(0), height(0), real_height(0),
lastOrigin(-1), interlaced(false)
{}
};