From ccc8587367e35dd45a8543857f75f83c06e33941 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 19 Feb 2022 21:10:20 +0700 Subject: [PATCH] Allow copy color buffer to RDRAM when current buffer is null. Problem: JFG crosshair has incorrect color when FBInfo and Aux buffer copy are enabled. "Aux buffer copy" copies the buffer and removes it. If aux buffer is the current one, the current buffer set to null. FBInfo uses ColorBufferToRDRAM to copy color buffer ti RDRAM. ColorBufferToRDRAM does nothing when current frame buffer is null, so FBInfo can't copy the buffer. Solution: allow copy to RDRAM when current buffer is null. Note: copy to RDRAM when current buffer is null was disabled in commit bbc71c3f0 to fix problem "Snowboard Kids causes segmentation fault #477" Now Snowboard Kids does not crash here. --- src/BufferCopy/ColorBufferToRDRAM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BufferCopy/ColorBufferToRDRAM.cpp b/src/BufferCopy/ColorBufferToRDRAM.cpp index 13d02505..8030d4d0 100644 --- a/src/BufferCopy/ColorBufferToRDRAM.cpp +++ b/src/BufferCopy/ColorBufferToRDRAM.cpp @@ -41,7 +41,7 @@ void ColorBufferToRDRAM::destroy() { bool ColorBufferToRDRAM::_prepareCopy(u32& _startAddress) { - if (VI.width == 0 || frameBufferList().getCurrent() == nullptr) + if (VI.width == 0) return false; FrameBuffer * pBuffer = frameBufferList().findBuffer(_startAddress);