From 5dee597d9b602d5e8b640f565ab7eab48ebb56da Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Wed, 25 Apr 2012 08:46:51 +0000 Subject: [PATCH] GSdx: Auto interlace mode, no more flickering! :p git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5178 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSRenderer.cpp | 18 +++++++++++++----- plugins/GSdx/GSSettingsDlg.cpp | 2 +- plugins/GSdx/GSdx.cpp | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index 2d11c33e5d..daf9605745 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -249,10 +249,18 @@ bool GSRenderer::Merge(int field) if(m_regs->SMODE2.INT && m_interlace > 0) { - int field2 = 1 - ((m_interlace - 1) & 1); - int mode = (m_interlace - 1) >> 1; - - m_dev->Interlace(ds, field ^ field2, mode, tex[1] ? tex[1]->GetScale().y : tex[0]->GetScale().y); + if (m_interlace == 7 && m_regs->SMODE2.FFMD == 1) // Auto interlace enabled / Odd frame interlace setting + { + int field2 = 0; + int mode = 2; + m_dev->Interlace(ds, field ^ field2, mode, tex[1] ? tex[1]->GetScale().y : tex[0]->GetScale().y); + } + else + { + int field2 = 1 - ((m_interlace - 1) & 1); + int mode = (m_interlace - 1) >> 1; + m_dev->Interlace(ds, field ^ field2, mode, tex[1] ? tex[1]->GetScale().y : tex[0]->GetScale().y); + } } if(m_shadeboost) @@ -515,7 +523,7 @@ void GSRenderer::KeyEvent(GSKeyEventData* e) switch(e->key) { case VK_F5: - m_interlace = (m_interlace + 7 + step) % 7; + m_interlace = (m_interlace + 8 + step) % 8; printf("GSdx: Set deinterlace mode to %d (%s).\n", (int)m_interlace, theApp.m_gs_interlace.at(m_interlace).name.c_str()); return; case VK_F6: diff --git a/plugins/GSdx/GSSettingsDlg.cpp b/plugins/GSdx/GSSettingsDlg.cpp index e1ac03731d..deaad50046 100644 --- a/plugins/GSdx/GSSettingsDlg.cpp +++ b/plugins/GSdx/GSSettingsDlg.cpp @@ -94,7 +94,7 @@ void GSSettingsDlg::OnInit() } ComboBoxInit(IDC_RENDERER, renderers, theApp.GetConfig("Renderer", 0)); - ComboBoxInit(IDC_INTERLACE, theApp.m_gs_interlace, theApp.GetConfig("Interlace", 0)); + ComboBoxInit(IDC_INTERLACE, theApp.m_gs_interlace, theApp.GetConfig("Interlace", 7)); // 7 = "auto", detects interlace based on SMODE2 register ComboBoxInit(IDC_ASPECTRATIO, theApp.m_gs_aspectratio, theApp.GetConfig("AspectRatio", 1)); ComboBoxInit(IDC_UPSCALE_MULTIPLIER, theApp.m_gs_upscale_multiplier, theApp.GetConfig("upscale_multiplier", 1)); diff --git a/plugins/GSdx/GSdx.cpp b/plugins/GSdx/GSdx.cpp index 88885b0a0d..8289c57c40 100644 --- a/plugins/GSdx/GSdx.cpp +++ b/plugins/GSdx/GSdx.cpp @@ -124,6 +124,7 @@ GSdxApp::GSdxApp() m_gs_interlace.push_back(GSSetting(4, "Bob bff", "use blend if shaking")); m_gs_interlace.push_back(GSSetting(5, "Blend tff", "slight blur, 1/2 fps")); m_gs_interlace.push_back(GSSetting(6, "Blend bff", "slight blur, 1/2 fps")); + m_gs_interlace.push_back(GSSetting(7, "Auto", "")); m_gs_aspectratio.push_back(GSSetting(0, "Stretch", "")); m_gs_aspectratio.push_back(GSSetting(1, "4:3", ""));