From 365baeccb4f9268c5f4d770c14f2ef7cf544788a Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sun, 27 Mar 2016 19:10:45 +1300 Subject: [PATCH] Only force progressive if we are currently in an interlaced video mode The NES games on the Zelda Collecters Edition disk use a XFB which is only 256 pixels wide, but has a stide of 640 pixels. This fits our definition of a interlaced xfb, as a second line of data could fit in the extra space. The solution is to check that we are actually in a interlaced video mode before activating the force progressive hack. --- Source/Core/Core/HW/VideoInterface.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/VideoInterface.cpp b/Source/Core/Core/HW/VideoInterface.cpp index 93075d316c..a191bd25f3 100644 --- a/Source/Core/Core/HW/VideoInterface.cpp +++ b/Source/Core/Core/HW/VideoInterface.cpp @@ -634,7 +634,11 @@ u32 GetTicksPerField() static void BeginField(FieldType field) { - bool interlaced_xfb = ((m_PictureConfiguration.STD / m_PictureConfiguration.WPL)==2); + // Could we fit a second line of data in the stride? + bool potentially_interlaced_xfb = ((m_PictureConfiguration.STD / m_PictureConfiguration.WPL) == 2); + // Are there an odd number of half-lines per field (definition of interlaced video) + bool interlaced_video_mode = (GetHalfLinesPerEvenField() & 1) == 1; + u32 fbStride = m_PictureConfiguration.STD * 16; u32 fbWidth = m_PictureConfiguration.WPL * 16; u32 fbHeight = m_VerticalTimingRegister.ACV; @@ -650,7 +654,7 @@ static void BeginField(FieldType field) xfbAddr = GetXFBAddressTop(); } - if (interlaced_xfb && g_ActiveConfig.bForceProgressive) + if (potentially_interlaced_xfb && interlaced_video_mode && g_ActiveConfig.bForceProgressive) { // Strictly speaking, in interlaced mode, we're only supposed to read // half of the lines of the XFB, and use that to display a field; the