From 92fdc15aa337eb21310ef89d211a53352084904f Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 8 Jun 2013 14:05:02 +1000 Subject: [PATCH] Implemented field order detection for PAL games. Fixes the shaking of the screen when XFB is enabled with a PAL game. Fixes issue 6316. --- Source/Core/Core/Src/HW/VideoInterface.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Src/HW/VideoInterface.cpp b/Source/Core/Core/Src/HW/VideoInterface.cpp index 5e7299586c..e5d32a9a8f 100644 --- a/Source/Core/Core/Src/HW/VideoInterface.cpp +++ b/Source/Core/Core/Src/HW/VideoInterface.cpp @@ -804,11 +804,9 @@ static void BeginField(FieldType field) u32 fbWidth = m_HorizontalStepping.FieldSteps * 16; u32 fbHeight = (m_HorizontalStepping.FbSteps / m_HorizontalStepping.FieldSteps) * m_VerticalTimingRegister.ACV; - // TODO: Are the "Bottom Field" and "Top Field" registers actually more - // like "First Field" and "Second Field" registers? There's an important - // difference because NTSC and PAL have opposite field orders. - - u32 xfbAddr = (field == FIELD_LOWER) ? GetXFBAddressBottom() : GetXFBAddressTop(); + // NTSC and PAL have opposite field orders. + FieldType order = (m_DisplayControlRegister.FMT == 0) ? FIELD_LOWER : FIELD_UPPER; + u32 xfbAddr = (field == order) ? GetXFBAddressBottom() : GetXFBAddressTop(); static const char* const fieldTypeNames[] = { "Progressive", "Upper", "Lower" };