From bcde07a97822158e9ae3f5699b33936d6b6f4447 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sun, 20 Mar 2016 13:24:26 +0600 Subject: [PATCH] Don't skip buffer height calculation in gDPFillRectangle. Fixed regression in Super Robot Spirits: Crash rankings option in HLE. #909 --- src/gDP.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/gDP.cpp b/src/gDP.cpp index e4edda0d..97662e09 100644 --- a/src/gDP.cpp +++ b/src/gDP.cpp @@ -755,29 +755,26 @@ void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry ) if (gDP.fillColor.color == DepthClearColor) { gDPFillRDRAM(gDP.colorImage.address, ulx, uly, lrx, lry, gDP.colorImage.width, gDP.colorImage.size, gDP.fillColor.color); render.clearDepthBuffer(uly, lry); - return; } } else if (gDP.fillColor.color == DepthClearColor && gDP.otherMode.cycleType == G_CYC_FILL) { depthBufferList().saveBuffer(gDP.colorImage.address); gDPFillRDRAM(gDP.colorImage.address, ulx, uly, lrx, lry, gDP.colorImage.width, gDP.colorImage.size, gDP.fillColor.color); render.clearDepthBuffer(uly, lry); - return; + } else { + frameBufferList().setBufferChanged(); + f32 fillColor[4]; + gDPGetFillColor(fillColor); + + if (gDP.otherMode.cycleType == G_CYC_FILL) { + if ((ulx == 0) && (uly == 0) && (lrx == gDP.scissor.lrx) && (lry == gDP.scissor.lry)) { + gDPFillRDRAM(gDP.colorImage.address, ulx, uly, lrx, lry, gDP.colorImage.width, gDP.colorImage.size, gDP.fillColor.color); + render.clearColorBuffer(fillColor); + } else + render.drawRect(ulx, uly, lrx, lry, fillColor); + } else + render.drawRect(ulx, uly, lrx, lry, fillColor); } - frameBufferList().setBufferChanged(); - - f32 fillColor[4]; - gDPGetFillColor(fillColor); - if (gDP.otherMode.cycleType == G_CYC_FILL) { - if ((ulx == 0) && (uly == 0) && (lrx == gDP.scissor.lrx) && (lry == gDP.scissor.lry)) { - gDPFillRDRAM(gDP.colorImage.address, ulx, uly, lrx, lry, gDP.colorImage.width, gDP.colorImage.size, gDP.fillColor.color); - render.clearColorBuffer(fillColor); - return; - } - } - - render.drawRect(ulx, uly, lrx, lry, fillColor); - if (gDP.otherMode.cycleType == G_CYC_FILL) { if (lry > (u32)gDP.scissor.lry) gDP.colorImage.height = (u32)max(gDP.colorImage.height, (u32)gDP.scissor.lry);