From 3b332f3a125acc9122f4c2e6b033c24e3a3fefd0 Mon Sep 17 00:00:00 2001 From: rogerman Date: Sat, 20 Jun 2015 01:32:32 +0000 Subject: [PATCH] GPU: - Fix HOFS bug when reading back the 3D framebuffer. Tested in Nanostray 2 by explosions that cause the screen to shake. (Regression from r5210.) --- desmume/src/GPU.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index c139f511f..c427220a1 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -2231,7 +2231,7 @@ PLAIN_CLEAR: { gpu->currBgNum = 0; - const u16 hofs = (u16)_gpuDstPitchIndex[gpu->getHOFS(layerNum)]; + const u16 hofs = (u16)( ((float)gpu->getHOFS(layerNum) * _gpuWidthScale) + 0.5f ); u16 *oldDstLine = dstLine; for (size_t lineIndex = 0; lineIndex < _gpuDstLineCount[l]; lineIndex++, dstLine += _gpuFramebufferWidth)