From f7f05072fee29680370b5311a5a910da59945791 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 15 Oct 2023 10:33:05 -0700 Subject: [PATCH] softgpu: Point depthbuf at the first VRAM mirror. --- GPU/Software/SoftGpu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index b385680ebe90..2ca6fa8d8a91 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -1040,7 +1040,9 @@ void SoftGPU::Execute_ZbufPtr(u32 op, u32 diff) { // We assume depthbuf.data won't change while we're drawing. if (diff) { drawEngine_->transformUnit.Flush("depthbuf"); - depthbuf.data = Memory::GetPointerWrite(gstate.getDepthBufAddress()); + // For the pointer, ignore memory mirrors. This also gives some buffer for draws that go outside. + // TODO: Confirm how wrapping is handled in drawing. Adjust if we ever handle VRAM mirrors more accurately. + depthbuf.data = Memory::GetPointerWrite(gstate.getDepthBufAddress() & 0x041FFFF0); } }