From 7abf593da33880bb796806402ee1e0ffdb3dd924 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 15 May 2021 20:43:05 +0700 Subject: [PATCH] Set m_cleared to false in FrameBuffer::copyRdram(). m_cleared means that the RDRAM buffer contains only fillcolor. It should be false after copyRdram() since from now the buffer validity check should work with m_RdramCopy. It Fixes Kirby 64 broken level selection, #2491 Without this fix, the level selection is broken when copy color to RDRAM is disabled --- src/BufferCopy/ColorBufferToRDRAM.cpp | 3 --- src/FrameBuffer.cpp | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/BufferCopy/ColorBufferToRDRAM.cpp b/src/BufferCopy/ColorBufferToRDRAM.cpp index 67a9f288..13d02505 100644 --- a/src/BufferCopy/ColorBufferToRDRAM.cpp +++ b/src/BufferCopy/ColorBufferToRDRAM.cpp @@ -224,7 +224,6 @@ void ColorBufferToRDRAM::_copy(u32 _startAddress, u32 _endAddress, bool _sync) m_pCurFrameBuffer->m_copiedToRdram = true; m_pCurFrameBuffer->copyRdram(); - m_pCurFrameBuffer->m_cleared = false; m_pCurFrameBuffer->cleanUp(); @@ -282,6 +281,4 @@ void copyWhiteToRDRAM(FrameBuffer * _pBuffer) } _pBuffer->m_copiedToRdram = true; _pBuffer->copyRdram(); - - _pBuffer->m_cleared = false; } diff --git a/src/FrameBuffer.cpp b/src/FrameBuffer.cpp index 3e39fc29..98e8388f 100644 --- a/src/FrameBuffer.cpp +++ b/src/FrameBuffer.cpp @@ -218,6 +218,9 @@ void FrameBuffer::copyRdram() const u32 height = _cutHeight(m_startAddress, m_height, stride); if (height == 0) return; + + m_cleared = false; + const u32 dataSize = stride * height; // Auxiliary frame buffer @@ -235,7 +238,6 @@ void FrameBuffer::copyRdram() else pData[start++] = 0; } - m_cleared = false; m_fingerprint = true; return; }