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

Copy auxiliary buffers at fullsync

Do not use fingerprint
This commit is contained in:
purplemarshmallow 2015-10-31 03:36:16 +01:00 committed by Sergey Lipskiy
parent a8aebe4936
commit 15611a7731
3 changed files with 31 additions and 1 deletions

View File

@ -268,7 +268,7 @@ void FrameBuffer::copyRdram()
const u32 dataSize = stride * height;
// Auxiliary frame buffer
if (m_width != VI.width) {
if (m_width != VI.width && config.frameBufferEmulation.copyAuxToRDRAM == 0) {
// Write small amount of data to the start of the buffer.
// This is necessary for auxilary buffers: game can restore content of RDRAM when buffer is not needed anymore
// Thus content of RDRAM on moment of buffer creation will be the same as when buffer becomes obsolete.
@ -538,6 +538,29 @@ void FrameBufferList::saveBuffer(u32 _address, u16 _format, u16 _size, u16 _widt
m_pCurrent->m_postProcessed = false;
}
void FrameBufferList::copyAux()
{
for (FrameBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter) {
if (iter->m_width != VI.width && iter->m_height != VI.height)
FrameBuffer_CopyToRDRAM(iter->m_startAddress);
}
}
void FrameBufferList::removeAux()
{
for (FrameBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter) {
while (iter->m_width != VI.width && iter->m_height != VI.height) {
if (&(*iter) == m_pCurrent) {
m_pCurrent = NULL;
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
iter = m_list.erase(iter);
if (iter == m_list.end())
return;
}
}
}
void FrameBufferList::removeBuffer(u32 _address )
{
for (FrameBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter)

View File

@ -60,6 +60,8 @@ public:
void init();
void destroy();
void saveBuffer(u32 _address, u16 _format, u16 _size, u16 _width, u16 _height, bool _cfb);
void removeAux();
void copyAux();
void removeBuffer(u32 _address);
void removeBuffers(u32 _width);
void attachDepthBuffer();

View File

@ -882,6 +882,11 @@ void gDPTextureRectangleFlip( f32 ulx, f32 uly, f32 lrx, f32 lry, s32 tile, f32
void gDPFullSync()
{
if (config.frameBufferEmulation.copyAuxToRDRAM != 0) {
frameBufferList().copyAux();
frameBufferList().removeAux();
}
if (RSP.bLLE) {
if (config.frameBufferEmulation.copyToRDRAM != Config::ctDisable)
FrameBuffer_CopyToRDRAM(gDP.colorImage.address);