mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +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:
parent
b136d05a3d
commit
42e75032fb
11
VI.cpp
11
VI.cpp
|
@ -31,8 +31,8 @@ void VI_UpdateSize()
|
||||||
const u32 vEnd = _SHIFTR( *REG.VI_V_START, 0, 10 );
|
const u32 vEnd = _SHIFTR( *REG.VI_V_START, 0, 10 );
|
||||||
const u32 vStart = _SHIFTR( *REG.VI_V_START, 16, 10 );
|
const u32 vStart = _SHIFTR( *REG.VI_V_START, 16, 10 );
|
||||||
const bool interlacedPrev = VI.interlaced;
|
const bool interlacedPrev = VI.interlaced;
|
||||||
const u32 widthPrev = VI.width;
|
if (VI.width > 0)
|
||||||
const u32 heightPrev = VI.height;
|
VI.widthPrev = VI.width;
|
||||||
|
|
||||||
VI.real_height = vEnd > vStart ? (((vEnd - vStart) >> 1) * vScale) >> 10 : 0;
|
VI.real_height = vEnd > vStart ? (((vEnd - vStart) >> 1) * vScale) >> 10 : 0;
|
||||||
VI.width = *REG.VI_WIDTH;
|
VI.width = *REG.VI_WIDTH;
|
||||||
|
@ -66,10 +66,9 @@ void VI_UpdateSize()
|
||||||
// const int fsaa = ((*REG.VI_STATUS) >> 8) & 3;
|
// const int fsaa = ((*REG.VI_STATUS) >> 8) & 3;
|
||||||
// const int divot = ((*REG.VI_STATUS) >> 4) & 1;
|
// const int divot = ((*REG.VI_STATUS) >> 4) & 1;
|
||||||
|
|
||||||
FrameBufferList & fbList = frameBufferList();
|
if (config.frameBufferEmulation.enable && ((interlacedPrev != VI.interlaced) || (VI.width > 0 && VI.width != VI.widthPrev))) {
|
||||||
FrameBuffer * pBuffer = fbList.findBuffer(VI.lastOrigin);
|
FrameBufferList & fbList = frameBufferList();
|
||||||
if (config.frameBufferEmulation.enable && ((interlacedPrev != VI.interlaced) || (pBuffer != NULL && pBuffer->m_width != VI.width))) {
|
fbList.removeBuffers(VI.widthPrev);
|
||||||
fbList.removeBuffers(widthPrev);
|
|
||||||
fbList.removeBuffers(VI.width);
|
fbList.removeBuffers(VI.width);
|
||||||
depthBufferList().destroy();
|
depthBufferList().destroy();
|
||||||
depthBufferList().init();
|
depthBufferList().init();
|
||||||
|
|
5
VI.h
5
VI.h
|
@ -4,14 +4,13 @@
|
||||||
|
|
||||||
struct VIInfo
|
struct VIInfo
|
||||||
{
|
{
|
||||||
u32 width;
|
u32 width, widthPrev, height, real_height;
|
||||||
u32 height, real_height;
|
|
||||||
f32 rwidth, rheight;
|
f32 rwidth, rheight;
|
||||||
u32 lastOrigin;
|
u32 lastOrigin;
|
||||||
bool interlaced;
|
bool interlaced;
|
||||||
|
|
||||||
VIInfo() :
|
VIInfo() :
|
||||||
width(0), height(0), real_height(0),
|
width(0), widthPrev(0), height(0), real_height(0),
|
||||||
lastOrigin(-1), interlaced(false)
|
lastOrigin(-1), interlaced(false)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user