diff --git a/gDP.cpp b/gDP.cpp index 253c66d7..0a02b0fa 100644 --- a/gDP.cpp +++ b/gDP.cpp @@ -544,15 +544,25 @@ bool CheckForFrameBufferTexture(u32 _address, u32 _bytes) if (bRes && pBuffer->m_validityChecked != RSP.DList) { if (pBuffer->m_cleared) { const u32 color = pBuffer->m_fillcolor & 0xFFFEFFFE; - for (u32 i = pBuffer->m_startAddress + 4; i < pBuffer->m_endAddress; i += 4) { - if (((*(u32*)&RDRAM[i]) & 0xFFFEFFFE) != color) { - frameBufferList().removeBuffer(pBuffer->m_startAddress); - bRes = false; - break; + if (pBuffer->m_size > G_IM_SIZ_8b) { + for (u32 i = pBuffer->m_startAddress + 4; i < pBuffer->m_endAddress; i += 4) { + if (((*(u32*)&RDRAM[i]) & 0xFFFEFFFE) != color) { + bRes = false; + break; + } } + } else { + u32 wrongPixels = 0; + for (u32 i = pBuffer->m_startAddress + 4; i < pBuffer->m_endAddress; i += 4) { + if (((*(u32*)&RDRAM[i]) & 0xFFFEFFFE) != color) + ++wrongPixels; + } + bRes = wrongPixels < (pBuffer->m_endAddress - pBuffer->m_startAddress)/100; // treshold level 1% } if (bRes) pBuffer->m_validityChecked = RSP.DList; + else + frameBufferList().removeBuffer(pBuffer->m_startAddress); } else if (pBuffer->m_RdramCrc != 0) { const u32 crc = CRC_Calculate(0xFFFFFFFF, RDRAM + pBuffer->m_startAddress, (VI.width*VI.height) << pBuffer->m_size >> 1); bRes = (pBuffer->m_RdramCrc == crc);