diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index 04a08c3a62..94288e23e1 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -35,9 +35,9 @@ GSRenderer::GSRenderer() m_vsync = !!theApp.GetConfig("vsync", 0); m_nativeres = !!theApp.GetConfig("nativeres", 0); - m_accurateScaleMulti = theApp.GetConfig("accurateScaleMulti", 1); - if(m_nativeres) m_accurateScaleMulti = 1; - else if (m_accurateScaleMulti > 4) m_accurateScaleMulti = 1; + m_upscale_multiplier = theApp.GetConfig("upscale_multiplier", 1); + if(m_nativeres) m_upscale_multiplier = 1; + else if (m_upscale_multiplier > 4) m_upscale_multiplier = 1; m_aa1 = !!theApp.GetConfig("aa1", 0); m_blur = !!theApp.GetConfig("blur", 0); diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index 76084afda5..acbc572e89 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -41,7 +41,7 @@ protected: int m_interlace; int m_aspectratio; int m_filter; - int m_accurateScaleMulti; + int m_upscale_multiplier; bool m_vsync; bool m_nativeres; bool m_aa1; @@ -89,9 +89,9 @@ public: { return !m_nativeres && m_regs->PMODE.EN != 0; // upscale ratio depends on the display size, with no output it may not be set correctly (ps2 logo to game transition) } - virtual int accurateScaleMulti() + virtual int upscale_Multiplier() { - return m_accurateScaleMulti; + return m_upscale_multiplier; } // TODO : Implement proper locking here *if needed* (not sure yet if it is) --air diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index 2d1f72e830..aeaed71a1c 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -32,7 +32,8 @@ class GSRendererHW : public GSRendererT { int m_width; int m_height; - int m_accurateScaleMulti; + int m_upscale_multiplier; + int m_gamefix_skipdraw; int m_skip; bool m_reset; @@ -531,8 +532,8 @@ protected: void Draw() { - if(IsBadFrame(m_skip)) return; - + if(IsBadFrame(m_skip, m_gamefix_skipdraw)) return; + GSDrawingEnvironment& env = m_env; GSDrawingContext* context = m_context; @@ -710,22 +711,24 @@ public: , m_tc(tc) , m_width(1024) , m_height(1024) - , m_accurateScaleMulti(1) + , m_upscale_multiplier(1) , m_skip(0) , m_reset(false) + , m_gamefix_skipdraw (0) { if(!m_nativeres) { m_width = theApp.GetConfig("resx", m_width); m_height = theApp.GetConfig("resy", m_height); - m_accurateScaleMulti = theApp.GetConfig("accurateScaleMulti", m_accurateScaleMulti); - if (m_accurateScaleMulti > 4) m_accurateScaleMulti = 1; //use the normal upscale math - if (m_accurateScaleMulti > 1) + m_upscale_multiplier = theApp.GetConfig("upscale_multiplier", m_upscale_multiplier); + if (m_upscale_multiplier > 4) m_upscale_multiplier = 1; //use the normal upscale math + if (m_upscale_multiplier > 1) { - m_width = 1024 * m_accurateScaleMulti; - m_height = 1024 * m_accurateScaleMulti; + m_width = 1024 * m_upscale_multiplier; + m_height = 1024 * m_upscale_multiplier; } } + m_gamefix_skipdraw = theApp.GetConfig("gamefix_skipdraw", m_gamefix_skipdraw); } virtual ~GSRendererHW() diff --git a/plugins/GSdx/GSSettingsDlg.cpp b/plugins/GSdx/GSSettingsDlg.cpp index 4842e8c289..af93448666 100644 --- a/plugins/GSdx/GSSettingsDlg.cpp +++ b/plugins/GSdx/GSSettingsDlg.cpp @@ -63,7 +63,7 @@ GSSetting GSSettingsDlg::g_aspectratio[] = {2, "16:9", NULL}, }; -GSSetting GSSettingsDlg::g_accurateScaleMulti[] = +GSSetting GSSettingsDlg::g_upscale_multiplier[] = { {1, "1x (Use D3D internal Res)", NULL}, {2, "2x", NULL}, @@ -127,11 +127,11 @@ void GSSettingsDlg::OnInit() ComboBoxInit(IDC_RENDERER, &renderers[0], renderers.size(), theApp.GetConfig("Renderer", 0)); ComboBoxInit(IDC_INTERLACE, g_interlace, countof(g_interlace), theApp.GetConfig("Interlace", 0)); ComboBoxInit(IDC_ASPECTRATIO, g_aspectratio, countof(g_aspectratio), theApp.GetConfig("AspectRatio", 1)); - ComboBoxInit(IDC_ACCURATESCALEMULTI, g_accurateScaleMulti, countof(g_accurateScaleMulti), theApp.GetConfig("accurateScaleMulti", 0)); + ComboBoxInit(IDC_UPSCALE_MULTIPLIER, g_upscale_multiplier, countof(g_upscale_multiplier), theApp.GetConfig("upscale_multiplier", 1)); CheckDlgButton(m_hWnd, IDC_WINDOWED, theApp.GetConfig("windowed", 1)); CheckDlgButton(m_hWnd, IDC_FILTER, theApp.GetConfig("filter", 2)); - CheckDlgButton(m_hWnd, IDC_PALTEX, theApp.GetConfig("paltex", 1)); + CheckDlgButton(m_hWnd, IDC_PALTEX, theApp.GetConfig("paltex", 0)); CheckDlgButton(m_hWnd, IDC_VSYNC, theApp.GetConfig("vsync", 0)); CheckDlgButton(m_hWnd, IDC_LOGZ, theApp.GetConfig("logz", 1)); CheckDlgButton(m_hWnd, IDC_FBA, theApp.GetConfig("fba", 1)); @@ -189,9 +189,13 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code) theApp.SetConfig("AspectRatio", (int)data); } - if(ComboBoxGetSelData(IDC_ACCURATESCALEMULTI, data)) + if(ComboBoxGetSelData(IDC_UPSCALE_MULTIPLIER, data)) { - theApp.SetConfig("accurateScaleMulti", (int)data); + theApp.SetConfig("upscale_multiplier", (int)data); + } + else + { + theApp.SetConfig("upscale_multiplier", 1); } theApp.SetConfig("windowed", (int)IsDlgButtonChecked(m_hWnd, IDC_WINDOWED)); @@ -207,7 +211,8 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code) theApp.SetConfig("resx", (int)SendMessage(GetDlgItem(m_hWnd, IDC_RESX), UDM_GETPOS, 0, 0)); theApp.SetConfig("resy", (int)SendMessage(GetDlgItem(m_hWnd, IDC_RESY), UDM_GETPOS, 0, 0)); theApp.SetConfig("swthreads", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_GETPOS, 0, 0)); - + + //theApp.SetConfig("gamefix_skipdraw", 0); } return __super::OnCommand(hWnd, id, code); @@ -237,7 +242,7 @@ void GSSettingsDlg::UpdateControls() EnableWindow(GetDlgItem(m_hWnd, IDC_RESX_EDIT), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_RESY), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_RESY_EDIT), hw && !native); - EnableWindow(GetDlgItem(m_hWnd, IDC_ACCURATESCALEMULTI), hw && !native); + EnableWindow(GetDlgItem(m_hWnd, IDC_UPSCALE_MULTIPLIER), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_NATIVERES), hw); EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_PALTEX), hw); diff --git a/plugins/GSdx/GSSettingsDlg.h b/plugins/GSdx/GSSettingsDlg.h index 1c2a1e1a79..8403b4f5b2 100644 --- a/plugins/GSdx/GSSettingsDlg.h +++ b/plugins/GSdx/GSSettingsDlg.h @@ -40,5 +40,5 @@ public: static GSSetting g_renderers[]; static GSSetting g_interlace[]; static GSSetting g_aspectratio[]; - static GSSetting g_accurateScaleMulti[]; + static GSSetting g_upscale_multiplier[]; }; \ No newline at end of file diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index d2ffc75557..05d2e0a4ea 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -2413,7 +2413,7 @@ bool GSC_RadiataStories(const GSFrameInfo& fi, int& skip) return true; } -bool GSState::IsBadFrame(int& skip) +bool GSState::IsBadFrame(int& skip, int gamefix_skipdraw) { GSFrameInfo fi; @@ -2481,7 +2481,9 @@ bool GSState::IsBadFrame(int& skip) { if(GSUtil::HasSharedBits(fi.FBP, fi.FPSM, fi.TBP0, fi.TPSM)) { - // skip = 1; + if (gamefix_skipdraw > 0) { + skip = gamefix_skipdraw; + } } // depth textures (bully, mgs3s1 intro) diff --git a/plugins/GSdx/GSState.h b/plugins/GSdx/GSState.h index 6fd0fbc1a5..3ebc631638 100644 --- a/plugins/GSdx/GSState.h +++ b/plugins/GSdx/GSState.h @@ -130,7 +130,7 @@ class GSState : public GSAlignedClass<16> void FlushWrite(); protected: - bool IsBadFrame(int& skip); + bool IsBadFrame(int& skip, int gamefix_skipdraw); typedef void (GSState::*VertexKickPtr)(bool skip); diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index ed5bd2d16b..e3ec6fe451 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -172,7 +172,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int if(m_renderer->CanUpscale()) { - int multiplier = m_renderer->accurateScaleMulti(); + int multiplier = m_renderer->upscale_Multiplier(); if (multiplier > 1) //it's limited to a maximum of 4 on reading the config { dst->m_texture->SetScale(GSVector2((float)multiplier, (float)multiplier)); diff --git a/plugins/GSdx/GSdx.rc b/plugins/GSdx/GSdx.rc index 286e29a076..28f625c8f0 100644 --- a/plugins/GSdx/GSdx.rc +++ b/plugins/GSdx/GSdx.rc @@ -104,7 +104,7 @@ BEGIN CONTROL "Enable output merger blur effect",IDC_BLUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,254,121,10 DEFPUSHBUTTON "OK",IDOK,43,277,50,14 PUSHBUTTON "Cancel",IDCANCEL,96,277,50,14 - COMBOBOX IDC_ACCURATESCALEMULTI,71,145,111,98,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_UPSCALE_MULTIPLIER,71,145,111,98,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Or use Scaling:",IDC_STATIC,7,149,49,8 LTEXT "D3D Enhancements (can cause glitches)",IDC_STATIC,31,118,128,8 LTEXT "Or use original PS2 resolution :",IDC_STATIC,7,164,99,8 diff --git a/plugins/GSdx/resource.h b/plugins/GSdx/resource.h index f6bef92ba8..14637d72a4 100644 --- a/plugins/GSdx/resource.h +++ b/plugins/GSdx/resource.h @@ -35,7 +35,7 @@ #define IDC_ASPECTRATIO 2031 #define IDC_SWTHREADS 2032 #define IDC_SCALE 2033 -#define IDC_ACCURATESCALEMULTI 2033 +#define IDC_UPSCALE_MULTIPLIER 2033 #define IDC_BROWSE 2034 #define IDC_FILENAME 2035 #define IDC_WIDTH 2036