From d8a93a3aa3934ee0ab752f9dc4973446b42416fb Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Fri, 3 Oct 2014 13:28:11 +0700 Subject: [PATCH] Correct frame buffer height calculation. Fixed Mario Tennis (E). The RDP frame buffer height is 256, VI buffer height is 221. The actual height of the picture is 221, so with frame buffer height 256 viewport settings becomes wrong and the picture moves atop. --- gDP.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gDP.cpp b/gDP.cpp index 5425a712..01b78ec7 100644 --- a/gDP.cpp +++ b/gDP.cpp @@ -263,9 +263,10 @@ void gDPSetColorImage( u32 format, u32 size, u32 width, u32 address ) u32 height = 1; if (width == VI.width) height = VI.height; - else if (width == gDP.scissor.lrx && width == gSP.viewport.width) + else if (width == gDP.scissor.lrx && width == gSP.viewport.width) { height = max(gDP.scissor.lry, gSP.viewport.height); - else if (width == gDP.scissor.lrx) + height = min(height, VI.height); + } else if (width == gDP.scissor.lrx) height = gDP.scissor.lry; else height = gSP.viewport.height;