diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index 92842396ba..9bbd0cf82a 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -495,6 +495,27 @@ protected: TEX0.PSM = DISPFB.PSM; // TRACE(_T("[%d] GetOutput %d %05x (%d)\n"), (int)m_perfmon.GetFrame(), i, (int)TEX0.TBP0, (int)TEX0.PSM); + + //This routine ups m_width and m_height globally, should games have a bigger native res than the startup values + //(currently 640*512, because of some unknown yet problem with smaller sizes) + int multiplier = upscale_Multiplier(); + if (multiplier > 1) + { + int testh = GetDisplayRect().height() * multiplier; + //on startup testh and testw are 1 for a while (invalid) + if ((testh > m_height) && testh != 1) { + m_height=testh; + //printf("changed height > %d\n", m_height ); + } + else if (testh == 1)return NULL; + + int testw = GetDisplayRect().width() * multiplier; + if ((testw > m_width) && testw != 1 ) { + m_width=testw; + //printf("changed width > %d\n", m_width ); + } + else if (testw == 1)return NULL; + } GSTexture* t = NULL; @@ -533,7 +554,28 @@ protected: void Draw() { if(IsBadFrame(m_skip, m_gamefix_skipdraw)) return; - + + //This routine ups m_width and m_height globally, should games have a bigger native res than the startup values + //(currently 640*512, because of some unknown yet problem with smaller sizes) + int multiplier = upscale_Multiplier(); + if (multiplier > 1) + { + int testh = GetDisplayRect().height() * multiplier; + //on startup testh and testw are 1 for a while (invalid) + if ((testh > m_height) && testh != 1) { + m_height=testh*multiplier; + //printf("changed height > %d\n", m_height ); + } + else if (testh == 1)return; + + int testw = GetDisplayRect().width() * multiplier; + if ((testw > m_width) && testw != 1 ) { + m_width=testw; + //printf("changed width > %d\n", m_width ); + } + else if (testw == 1)return; + } + GSDrawingEnvironment& env = m_env; GSDrawingContext* context = m_context; @@ -724,8 +766,8 @@ public: if (m_upscale_multiplier > 4) m_upscale_multiplier = 1; //use the normal upscale math if (m_upscale_multiplier > 1) { - m_width = 1024 * m_upscale_multiplier; - m_height = 1024 * m_upscale_multiplier; + m_width = 640 * m_upscale_multiplier; //512 is also common, but this is not always detected right. + m_height = 512 * m_upscale_multiplier; //448 is also common, but this is not always detected right. } } m_gamefix_skipdraw = theApp.GetConfig("gamefix_skipdraw", m_gamefix_skipdraw); @@ -747,4 +789,4 @@ public: m_width = 1280; // TODO: uses a 1280px wide 16 bit render target, but this only fixes half of the problem } } -}; +}; \ No newline at end of file diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 99b0e4e40a..587b633aea 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -254,6 +254,7 @@ GSVector4i GSState::GetFrameRect(int i) if(m_regs->SMODE2.INT && m_regs->SMODE2.FFMD && h > 1) h >>= 1; + //Breaks Disgaea2 FMV borders, causes blur in dragon quest 8 r.left = m_regs->DISP[i].DISPFB.DBX; r.top = m_regs->DISP[i].DISPFB.DBY; r.right = r.left + w; diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 2b2e064563..5f8d0111e0 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -190,6 +190,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int hh *= 2; } + //This vp2 fix doesn't work most of the time if(hh < 512 && m_renderer->m_context->SCISSOR.SCAY1 == 511) // vp2 { hh = 512; @@ -470,25 +471,28 @@ void GSTextureCache::IncAge() m_src.m_used = false; - // Clearing of Rendertargets causes flickering in many scene transitions, so let's not :p - //maxage = 4; // ffx intro scene changes leave the old image untouched for a couple of frames and only then start using it + // Clearing of Rendertargets causes flickering in many scene transitions. + // Sigh, this seems to be used to invalidate surfaces. So set a huge maxage to avoid flicker, + // but still invalidate surfaces. (Disgaea 2 fmv when booting the game through the BIOS) + // Original maxage was 4 here, Xenosaga 2 needs at least 240, else it flickers on scene transitions. + maxage = 400; // ffx intro scene changes leave the old image untouched for a couple of frames and only then start using it - //for(int type = 0; type < 2; type++) - //{ - // for(list::iterator i = m_dst[type].begin(); i != m_dst[type].end(); ) - // { - // list::iterator j = i++; + for(int type = 0; type < 2; type++) + { + for(list::iterator i = m_dst[type].begin(); i != m_dst[type].end(); ) + { + list::iterator j = i++; - // Target* t = *j; + Target* t = *j; - // if(++t->m_age > maxage) - // { - // m_dst[type].erase(j); + if(++t->m_age > maxage) + { + m_dst[type].erase(j); - // delete t; - // } - // } - //} + delete t; + } + } + } } //Fixme: Several issues in here. Not handling depth stencil, pitch conversion doesnt work. @@ -1419,4 +1423,4 @@ void GSTextureCache::SourceMap::RemoveAt(Source* s) } delete s; -} +} \ No newline at end of file