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

Correct FrameBuffer::isValid - do not update m_validityChecked when isValid called from VI_UpdateScreen

Fixed Broken Pokemon stadium 2 in-game portraits #1149
This commit is contained in:
Sergey Lipskiy 2016-10-05 15:39:41 +07:00
parent fc8c65f81b
commit ce5abcb21b
5 changed files with 10 additions and 8 deletions

View File

@ -239,11 +239,13 @@ void FrameBuffer::copyRdram()
memcpy(m_RdramCopy.data(), RDRAM + m_startAddress, dataSize);
}
bool FrameBuffer::isValid() const
bool FrameBuffer::isValid(bool _forceCheck) const
{
if (m_validityChecked == video().getBuffersSwapCount())
return true; // Already checked
m_validityChecked = video().getBuffersSwapCount();
if (!_forceCheck) {
if (m_validityChecked == video().getBuffersSwapCount())
return true; // Already checked
m_validityChecked = video().getBuffersSwapCount();
}
const u32 * const pData = (const u32*)RDRAM;

View File

@ -22,7 +22,7 @@ struct FrameBuffer
CachedTexture * getTextureBG(u32 _t);
void setBufferClearParams(u32 _fillcolor, s32 _ulx, s32 _uly, s32 _lrx, s32 _lry);
void copyRdram();
bool isValid() const;
bool isValid(bool _forceCheck) const;
bool _isMarioTennisScoreboard() const;
bool isAuxiliary() const;

View File

@ -115,7 +115,7 @@ void VI_UpdateScreen()
FrameBuffer * pBuffer = frameBufferList().findBuffer(*REG.VI_ORIGIN);
if (pBuffer == nullptr)
gDP.changed |= CHANGED_CPU_FB_WRITE;
else if (!FBInfo::fbInfo.isSupported() && !pBuffer->isValid()) {
else if (!FBInfo::fbInfo.isSupported() && !pBuffer->isValid(true)) {
gDP.changed |= CHANGED_CPU_FB_WRITE;
if (config.frameBufferEmulation.copyToRDRAM == 0)
pBuffer->copyRdram();

View File

@ -413,7 +413,7 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes)
}
if (bRes) {
bRes = pBuffer->isValid();
bRes = pBuffer->isValid(false);
if (!bRes)
fbList.removeBuffer(pBuffer->m_startAddress);
}

View File

@ -2130,7 +2130,7 @@ void _loadBGImage(const uObjScaleBg * _bgInfo, bool _loadScale)
return;
}
if (!pBuffer->isValid()) {
if (!pBuffer->isValid(false)) {
frameBufferList().removeBuffer(pBuffer->m_startAddress);
return;
}