From df8c6110849d699053f7a67079e11ccf3e504000 Mon Sep 17 00:00:00 2001 From: gabest11 Date: Fri, 19 Jun 2009 13:03:59 +0000 Subject: [PATCH] GSdx: trying to fix gaps between sprites that may still appear with d3d in native res git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1402 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSCapture.cpp | 11 ++++++++--- plugins/GSdx/GSCrc.cpp | 1 + plugins/GSdx/GSCrc.h | 1 + plugins/GSdx/GSRenderer.cpp | 2 ++ plugins/GSdx/GSRendererHW.h | 4 ++-- plugins/GSdx/GSSettingsDlg.cpp | 1 + plugins/GSdx/res/tfx10.fx | 9 ++++++++- plugins/GSdx/res/tfx9.fx | 9 ++++++++- 8 files changed, 31 insertions(+), 7 deletions(-) diff --git a/plugins/GSdx/GSCapture.cpp b/plugins/GSdx/GSCapture.cpp index cf42560cc0..685141bd93 100644 --- a/plugins/GSdx/GSCapture.cpp +++ b/plugins/GSdx/GSCapture.cpp @@ -167,7 +167,7 @@ GSSource : public CBaseFilter, private CCritSec, public IGSSource } }; - CAutoPtr m_output; + GSSourceOutputPin* m_output; public: @@ -178,12 +178,17 @@ public: , m_atpf(10000000i64 / fps) , m_now(0) { - m_output.Attach(new GSSourceOutputPin(m_size, m_atpf, this, this, hr)); + m_output = new GSSourceOutputPin(m_size, m_atpf, this, this, hr); // FIXME if(fps == 60) m_atpf = 166834; // = 10000000i64 / 59.94 } + virtual ~GSSource() + { + delete m_output; + } + DECLARE_IUNKNOWN; int GetPinCount() @@ -193,7 +198,7 @@ public: CBasePin* GetPin(int n) { - return n == 0 ? m_output.m_p : NULL; + return n == 0 ? m_output : NULL; } // IGSSource diff --git a/plugins/GSdx/GSCrc.cpp b/plugins/GSdx/GSCrc.cpp index 7e27702525..dce65c2aa9 100644 --- a/plugins/GSdx/GSCrc.cpp +++ b/plugins/GSdx/GSCrc.cpp @@ -29,6 +29,7 @@ CRC::Game CRC::m_games[] = {0x42E05BAF, TomoyoAfter, JP}, {0x7800DC84, Clannad, JP}, {0xA6167B59, Lamune, JP}, + {0xDDB59F46, KyuuketsuKitanMoonties, JP}, {0xa39517ab, FFX, EU}, {0xa39517ae, FFX, FR}, {0x941bb7d9, FFX, DE}, diff --git a/plugins/GSdx/GSCrc.h b/plugins/GSdx/GSCrc.h index b47362e690..c0695d191e 100644 --- a/plugins/GSdx/GSCrc.h +++ b/plugins/GSdx/GSCrc.h @@ -31,6 +31,7 @@ public: TomoyoAfter, Clannad, Lamune, + KyuuketsuKitanMoonties, FFX, FFX2, FFXII, diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index 288974c0f8..03a96686c9 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -35,6 +35,8 @@ GSRenderer::GSRenderer(uint8* base, bool mt, void (*irq)(), GSDevice* dev) m_aa1 = !!theApp.GetConfig("aa1", 0); m_blur = !!theApp.GetConfig("blur", 0); + if(m_nativeres) m_filter = 2; + s_n = 0; s_dump = !!theApp.GetConfig("dump", 0); s_save = !!theApp.GetConfig("save", 0); diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index f58aa4e787..af3bfefa6c 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -494,9 +494,9 @@ protected: #pragma endregion - #pragma region tomoyo after, clannad, lamune (palette uploaded in a point list, pure genius...) + #pragma region palette uploaded in a point list, pure genius... - if(m_game.title == CRC::TomoyoAfter || m_game.title == CRC::Clannad || m_game.title == CRC::Lamune) + if(m_game.title == CRC::TomoyoAfter || m_game.title == CRC::Clannad || m_game.title == CRC::Lamune || m_game.title == CRC::KyuuketsuKitanMoonties) { if(prim == GS_POINTLIST && !PRIM->TME) { diff --git a/plugins/GSdx/GSSettingsDlg.cpp b/plugins/GSdx/GSSettingsDlg.cpp index 023c473456..3142679119 100644 --- a/plugins/GSdx/GSSettingsDlg.cpp +++ b/plugins/GSdx/GSSettingsDlg.cpp @@ -211,6 +211,7 @@ void GSSettingsDlg::UpdateControls() EnableWindow(GetDlgItem(m_hWnd, IDC_RESY), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_RESY_EDIT), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_NATIVERES), hw); + EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_LOGZ), dx9 && hw); EnableWindow(GetDlgItem(m_hWnd, IDC_FBA), dx9 && hw); EnableWindow(GetDlgItem(m_hWnd, IDC_AA1), sw); diff --git a/plugins/GSdx/res/tfx10.fx b/plugins/GSdx/res/tfx10.fx index 529e528ab7..c0a3a87906 100644 --- a/plugins/GSdx/res/tfx10.fx +++ b/plugins/GSdx/res/tfx10.fx @@ -46,8 +46,15 @@ VS_OUTPUT vs_main(VS_INPUT input) } VS_OUTPUT output; + + // pos -= 0.05 (1/320 pixel) helps avoiding rounding problems (integral part of pos is usually 5 digits, 0.05 is about as low as we can go) + // example: ceil(afterseveralvertextransformations(y = 133)) => 134 => line 133 stays empty + // input granularity is 1/16 pixel, anything smaller than that won't step drawing up/left by one pixel + // example: 133.0625 (133 + 1/16) should start from line 134, ceil(133.0625 - 0.05) still above 133 + + float4 p = float4(input.p, input.z, 0) - float4(0.05f, 0.05f, 0, 0); - output.p = float4(input.p, input.z, 0) * VertexScale - VertexOffset; + output.p = p * VertexScale - VertexOffset; if(VS_TME == 1) { diff --git a/plugins/GSdx/res/tfx9.fx b/plugins/GSdx/res/tfx9.fx index c7a2c57896..0c1062fec8 100644 --- a/plugins/GSdx/res/tfx9.fx +++ b/plugins/GSdx/res/tfx9.fx @@ -38,8 +38,15 @@ VS_OUTPUT vs_main(VS_INPUT input) } VS_OUTPUT output; + + // pos -= 0.05 (1/320 pixel) helps avoiding rounding problems (integral part of pos is usually 5 digits, 0.05 is about as low as we can go) + // example: ceil(afterseveralvertextransformations(y = 133)) => 134 => line 133 stays empty + // input granularity is 1/16 pixel, anything smaller than that won't step drawing up/left by one pixel + // example: 133.0625 (133 + 1/16) should start from line 134, ceil(133.0625 - 0.05) still above 133 + + float4 p = input.p - float4(0.05f, 0.05f, 0, 0); - output.p = input.p * VertexScale - VertexOffset; + output.p = p * VertexScale - VertexOffset; if(VS_LOGZ == 1) {