mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Copy auxiliary buffers at fullsync
Do not use fingerprint
This commit is contained in:
parent
a8aebe4936
commit
15611a7731
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user