diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index b42676f866..04a08c3a62 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -34,6 +34,11 @@ GSRenderer::GSRenderer() m_filter = theApp.GetConfig("filter", 1); 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_aa1 = !!theApp.GetConfig("aa1", 0); m_blur = !!theApp.GetConfig("blur", 0); diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index 40ba69ed7f..76084afda5 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -41,6 +41,7 @@ protected: int m_interlace; int m_aspectratio; int m_filter; + int m_accurateScaleMulti; bool m_vsync; bool m_nativeres; bool m_aa1; @@ -88,6 +89,10 @@ 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() + { + return m_accurateScaleMulti; + } // TODO : Implement proper locking here *if needed* (not sure yet if it is) --air uint8* GetTextureBufferLock() { return m_tex_buff; } diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index 985b447089..2d1f72e830 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -32,6 +32,7 @@ class GSRendererHW : public GSRendererT { int m_width; int m_height; + int m_accurateScaleMulti; int m_skip; bool m_reset; @@ -709,6 +710,7 @@ public: , m_tc(tc) , m_width(1024) , m_height(1024) + , m_accurateScaleMulti(1) , m_skip(0) , m_reset(false) { @@ -716,6 +718,13 @@ public: { 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_width = 1024 * m_accurateScaleMulti; + m_height = 1024 * m_accurateScaleMulti; + } } } diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 34af218cf5..6a8209c56c 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -172,24 +172,33 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int if(m_renderer->CanUpscale()) { - GSVector4i fr = m_renderer->GetFrameRect(); - - int ww = (int)(fr.left + dst->m_TEX0.TBW * 64); - int hh = (int)(fr.top + m_renderer->GetDisplayRect().height()); - - if(hh <= m_renderer->GetDeviceSize().y / 2) + int multiplier = m_renderer->accurateScaleMulti(); + if (multiplier > 1) //it's limited to a maximum of 4 on reading the config { - hh *= 2; + dst->m_texture->SetScale(GSVector2((float)multiplier, (float)multiplier)); } - - if(hh < 512 && m_renderer->m_context->SCISSOR.SCAY1 == 511) // vp2 + else { - hh = 512; - } - if(ww > 0 && hh > 0) - { - dst->m_texture->SetScale(GSVector2((float)w / ww, (float)h / hh)); + GSVector4i fr = m_renderer->GetFrameRect(); + + int ww = (int)(fr.left + dst->m_TEX0.TBW * 64); + int hh = (int)(fr.top + m_renderer->GetDisplayRect().height()); + + if(hh <= m_renderer->GetDeviceSize().y / 2) + { + hh *= 2; + } + + if(hh < 512 && m_renderer->m_context->SCISSOR.SCAY1 == 511) // vp2 + { + hh = 512; + } + + if(ww > 0 && hh > 0) + { + dst->m_texture->SetScale(GSVector2((float)w / ww, (float)h / hh)); + } } }