Skip to content

Commit

Permalink
Allow copy color buffer to RDRAM when current buffer is null.
Browse files Browse the repository at this point in the history
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 bbc71c3 to fix problem "Snowboard Kids causes segmentation fault #477"
Now Snowboard Kids does not crash here.
  • Loading branch information
gonetz committed Feb 19, 2022
1 parent 0032bbf commit d73c155
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BufferCopy/ColorBufferToRDRAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d73c155

Please sign in to comment.