From 5a32c3fba49cbe62f1f6447d681ac6717c032f99 Mon Sep 17 00:00:00 2001 From: booto Date: Thu, 3 Sep 2015 03:57:03 +0800 Subject: [PATCH] VideoCommon: xfb height calculation adjusted Baten Kaitos allocates its XFBs from a tagged heap structure. With the old calculation, too many lines were being written so the tag of the allocation after the XFB was being corrupted. Fixes crash mentioned in this comment: https://code.google.com/p/dolphin-emu/issues/detail?id=7734#c6 --- Source/Core/VideoCommon/BPStructs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index b4d3cce959..cacb005143 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -241,7 +241,7 @@ static void BPWritten(const BPCmd& bp) else yScale = (float)bpmem.dispcopyyscale / 256.0f; - float num_xfb_lines = ((bpmem.copyTexSrcWH.y + 1.0f) * yScale); + float num_xfb_lines = 1.0f + bpmem.copyTexSrcWH.y * yScale; u32 height = static_cast(num_xfb_lines); if (height > MAX_XFB_HEIGHT)