From 8945e13e76647ba9c4a6b985a1fb1a97288d618c Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Fri, 13 Mar 2015 16:42:36 +0600 Subject: [PATCH] Correct VI.width calculation. Fixed screen distortion in Excite Bike 64 --- VI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VI.cpp b/VI.cpp index 7d12afc8..474fbe96 100644 --- a/VI.cpp +++ b/VI.cpp @@ -47,7 +47,7 @@ void VI_UpdateSize() if (VI.real_height % 2 == 1) --VI.real_height; } else if (hEnd != 0 && *REG.VI_WIDTH != 0) - VI.width = min((u32)((hEnd - hStart)*xScale), *REG.VI_WIDTH); + VI.width = min((u32)floorf((hEnd - hStart)*xScale + 0.5f), *REG.VI_WIDTH); const bool isPAL = (*REG.VI_V_SYNC & 0x3ff) > 550; if (isPAL && (vEnd - vStart) > 480) {