From 0d8b4e89fa595efa3f71d2b9c64ad61312dcf19f Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Fri, 6 Mar 2015 18:25:29 +0600 Subject: [PATCH] Limit calculated VI.height by maximal value. Fixed screen size in Lode Runner, #186 --- VI.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/VI.cpp b/VI.cpp index 188f6d8b..7df68a40 100644 --- a/VI.cpp +++ b/VI.cpp @@ -50,10 +50,16 @@ void VI_UpdateSize() VI.width = min((u32)((hEnd - hStart)*xScale), *REG.VI_WIDTH); const bool isPAL = (*REG.VI_V_SYNC & 0x3ff) > 550; - if (isPAL && (vEnd - vStart) > 480) + if (isPAL && (vEnd - vStart) > 480) { VI.height = (u32)(VI.real_height*1.0041841f); - else + if (VI.height > 576) + VI.height = VI.real_height = 576; + } + else { VI.height = (u32)(VI.real_height*1.0126582f); + if (VI.height > 480) + VI.height = VI.real_height = 480; + } if (VI.height % 2 == 1) --VI.height;