From 16406bb1b080ab8f4710f9657a5cc56264afb742 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Fri, 23 Sep 2016 12:05:48 +0700 Subject: [PATCH] Fixed Majora's mask in-game pictures look incorrect with software depth buffer #1131 --- src/BufferCopy/DepthBufferToRDRAM.cpp | 4 ++++ src/FrameBufferInfo.cpp | 10 ++++------ src/RSP.cpp | 2 +- src/gDP.cpp | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/BufferCopy/DepthBufferToRDRAM.cpp b/src/BufferCopy/DepthBufferToRDRAM.cpp index 78268669..e7411086 100644 --- a/src/BufferCopy/DepthBufferToRDRAM.cpp +++ b/src/BufferCopy/DepthBufferToRDRAM.cpp @@ -210,6 +210,8 @@ bool DepthBufferToRDRAM::_copy(u32 _startAddress, u32 _endAddress) bool DepthBufferToRDRAM::copyToRDRAM(u32 _address) { + if (config.frameBufferEmulation.copyDepthToRDRAM == Config::cdSoftwareRender) + return true; if (!_prepareCopy(_address, false)) return false; @@ -219,6 +221,8 @@ bool DepthBufferToRDRAM::copyToRDRAM(u32 _address) bool DepthBufferToRDRAM::copyChunkToRDRAM(u32 _address) { + if (config.frameBufferEmulation.copyDepthToRDRAM == Config::cdSoftwareRender) + return true; if (!_prepareCopy(_address, true)) return false; diff --git a/src/FrameBufferInfo.cpp b/src/FrameBufferInfo.cpp index da90d2e4..50e7e32e 100644 --- a/src/FrameBufferInfo.cpp +++ b/src/FrameBufferInfo.cpp @@ -54,12 +54,10 @@ namespace FBInfo { return; if (pBuffer->m_isDepthBuffer) { - if (config.frameBufferEmulation.copyDepthToRDRAM != Config::cdSoftwareRender) { - if (config.frameBufferEmulation.fbInfoReadDepthChunk != 0) - FrameBuffer_CopyDepthBufferChunk(address); - else if (pBuffer != m_pReadBuffer) - FrameBuffer_CopyDepthBuffer(address); - } + if (config.frameBufferEmulation.fbInfoReadDepthChunk != 0) + FrameBuffer_CopyDepthBufferChunk(address); + else if (pBuffer != m_pReadBuffer) + FrameBuffer_CopyDepthBuffer(address); } else { if (config.frameBufferEmulation.fbInfoReadColorChunk != 0) FrameBuffer_CopyChunkToRDRAM(address); diff --git a/src/RSP.cpp b/src/RSP.cpp index 016c459a..07a1fd4d 100644 --- a/src/RSP.cpp +++ b/src/RSP.cpp @@ -216,7 +216,7 @@ void RSP_ProcessDList() } } - if (config.frameBufferEmulation.copyDepthToRDRAM == Config::cdCopyFromVRam) { + if (config.frameBufferEmulation.copyDepthToRDRAM != Config::cdDisable) { if ((config.generalEmulation.hacks & hack_rectDepthBufferCopyCBFD) != 0) { ; // do nothing } else if ((config.generalEmulation.hacks & hack_rectDepthBufferCopyPD) != 0) { diff --git a/src/gDP.cpp b/src/gDP.cpp index 186f54d3..12907deb 100644 --- a/src/gDP.cpp +++ b/src/gDP.cpp @@ -924,7 +924,7 @@ void gDPFullSync() FrameBuffer_CopyToRDRAM(gDP.colorImage.address, sync); if (RSP.bLLE) { - if (config.frameBufferEmulation.copyDepthToRDRAM == Config::cdCopyFromVRam && !FBInfo::fbInfo.isSupported()) + if (config.frameBufferEmulation.copyDepthToRDRAM != Config::cdDisable && !FBInfo::fbInfo.isSupported()) FrameBuffer_CopyDepthBuffer(gDP.colorImage.address); }