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

fix problem with validity ckecking in Zelda OOT

problem: the game writes data below our fingerprint
solution: just check if the fingerprint is still there and ignore the
data below
This commit is contained in:
purplemarshmallow 2015-07-21 13:32:52 +02:00 committed by Sergey Lipskiy
parent d30d813b18
commit e617177958

View File

@ -269,7 +269,7 @@ void FrameBuffer::copyRdram()
u32 start = m_startAddress >> 2;
u32 * pData = (u32*)RDRAM;
for (u32 i = 0; i < twoPercent; ++i)
pData[start++] = m_startAddress;
pData[start++] = m_fillcolor;
}
}
@ -295,6 +295,20 @@ bool FrameBuffer::isValid() const
}
return wrongPixels < (m_endAddress - m_startAddress) / 400; // treshold level 1% of dwords
} else if (!m_RdramCopy.empty()) {
if (m_width != VI.width && config.frameBufferEmulation.validityCheckMethod == Config::vcFingerprint) {
// Auxiliary frame buffer
//check if our fingerprint is still there
const u32 stride = m_width << m_size >> 1;
const u32 height = _cutHeight(m_startAddress, m_height, stride);
const u32 dataSize = stride * height;
const u32 color = m_fillcolor & 0xFFFEFFFE;
const u32 twoPercent = dataSize / 200;;
u32 start = m_startAddress >> 2;
for (u32 i = 0; i < twoPercent; ++i)
if ((pData[start++] & 0xFFFEFFFE) != color)
return false;
return true;
}
const u32 * const pCopy = (const u32*)m_RdramCopy.data();
const u32 size = m_RdramCopy.size();
const u32 size_dwords = size >> 2;