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

Update end address of the current frame buffer in gDPFullSync().

Fixed Ogre Battle 64 Opening Splash Screens Flicker. #1868

Details

Problem: frame buffer end address set to minimal when buffer is allocated.
It is updated on next call of gDPSetColorImage.
In case of Ogre Battle 64 Opening next call of gDPSetColorImage occurs in next frame.
VI can't find the buffer because REG.VI_ORIGIN points on buffer with some offset,
which in this case is larger than diff between start and end address.
VI allocates new buffer, which eventually replaces the current one and flickering happens.

Solution: update current buffer's end address in gDPFullSync()
to ensure that it will be correct at the moment when VI will search for buffer to draw.
This commit is contained in:
Sergey Lipskiy 2018-08-27 22:35:30 +07:00
parent 62b8103e46
commit cec0f2fc05

View File

@ -844,11 +844,15 @@ void gDPFullSync()
dwnd().getDrawer().flush();
FrameBuffer * pCurrentBuffer = frameBufferList().getCurrent();
if (pCurrentBuffer != nullptr)
pCurrentBuffer->updateEndAddress();
const bool sync = config.frameBufferEmulation.copyToRDRAM == Config::ctSync;
if ((config.frameBufferEmulation.copyToRDRAM != Config::ctDisable || (config.generalEmulation.hacks & hack_subscreen) != 0) &&
!FBInfo::fbInfo.isSupported() &&
frameBufferList().getCurrent() != nullptr &&
!frameBufferList().getCurrent()->isAuxiliary()
pCurrentBuffer != nullptr &&
!pCurrentBuffer->isAuxiliary()
)
FrameBuffer_CopyToRDRAM(gDP.colorImage.address, sync);