Merge pull request #1281 from PCSX2-Alpha/NTSC_saturation

GSDX: Remove some unnecessary/dubious hacks
This commit is contained in:
Gregory Hainaut 2016-04-21 09:28:30 +02:00
commit cb8088216b
4 changed files with 11 additions and 36 deletions

View File

@ -215,15 +215,6 @@ bool GSRenderer::Merge(int field)
if(!en[i] || !tex[i]) continue; if(!en[i] || !tex[i]) continue;
GSVector4i r = fr[i]; GSVector4i r = fr[i];
// overscan hack
if(dr[i].height() > 512) // hmm
{
int y = GetDeviceSize(i).y;
r.bottom = r.top + y;
}
GSVector4 scale = GSVector4(tex[i]->GetScale()).xyxy(); GSVector4 scale = GSVector4(tex[i]->GetScale()).xyxy();
src[i] = GSVector4(r) * scale / GSVector4(tex[i]->GetSize()).xyxy(); src[i] = GSVector4(r) * scale / GSVector4(tex[i]->GetSize()).xyxy();

View File

@ -44,6 +44,7 @@ GSState::GSState()
{ {
m_nativeres = theApp.GetConfig("upscale_multiplier",1) == 1; m_nativeres = theApp.GetConfig("upscale_multiplier",1) == 1;
m_mipmap = !!theApp.GetConfig("mipmap", 1); m_mipmap = !!theApp.GetConfig("mipmap", 1);
m_NTSC_Saturation = !!theApp.GetConfig("NTSC_Saturation", true);
s_n = 0; s_n = 0;
s_dump = !!theApp.GetConfig("dump", 0); s_dump = !!theApp.GetConfig("dump", 0);
@ -379,11 +380,10 @@ GSVector4i GSState::GetFrameRect(int i)
int w = r.width(); int w = r.width();
int h = r.height(); int h = r.height();
// NTSC: Saturate higher height values for games which have CRTC width lower than 640. // Limit games to standard NTSC resolutions. games with 512X512 (PAL resolution) on NTSC video mode produces black border on the bottom.
// Some NTSC mode games request higher height values for accurate display size / position when width is 640 // 512 X 448 is the resolution generally used by NTSC, saturating the height value seems to get rid of the black borders.
// Testcases : PS logo (640x512) , Resident Evil:CVX (640x480). potentially more test cases... // Though it's quite a bad hack as it affects binaries which are patched to run on a non-native video mode.
if (Vmode_NTSC && h > 448 && w < 640 && m_NTSC_Saturation)
if (Vmode_NTSC && h > 448 && w < 640)
h = 448; h = 448;
if (m_regs->SMODE2.INT && m_regs->SMODE2.FFMD && h > 1) if (m_regs->SMODE2.INT && m_regs->SMODE2.FFMD && h > 1)
@ -429,21 +429,9 @@ GSVector2i GSState::GetDeviceSize(int i)
//Fixme : Just slightly better than the hack above //Fixme : Just slightly better than the hack above
if(m_regs->SMODE2.INT && m_regs->SMODE2.FFMD && h > 1) if(m_regs->SMODE2.INT && m_regs->SMODE2.FFMD && h > 1)
{
if (IsEnabled(0) || IsEnabled(1))
{
h >>= 1; h >>= 1;
}
}
//Fixme: These games elude the code above, worked with the old hack
else if(m_game.title == CRC::SilentHill2 || m_game.title == CRC::SilentHill3)
{
h /= 2;
}
return GSVector2i(w, h); return GSVector2i(w, h);
} }
bool GSState::IsEnabled(int i) bool GSState::IsEnabled(int i)

View File

@ -195,12 +195,13 @@ public:
GSDrawingContext* m_context; GSDrawingContext* m_context;
GSPerfMon m_perfmon; GSPerfMon m_perfmon;
uint32 m_crc; uint32 m_crc;
CRC::Game m_game;
GSDump m_dump;
int m_options; int m_options;
int m_frameskip; int m_frameskip;
bool m_crcinited; bool m_crcinited;
bool m_framelimit; bool m_framelimit;
CRC::Game m_game; bool m_NTSC_Saturation;
GSDump m_dump;
bool m_nativeres; bool m_nativeres;
bool m_mipmap; bool m_mipmap;

View File

@ -376,7 +376,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
{ {
int multiplier = m_renderer->GetUpscaleMultiplier(); int multiplier = m_renderer->GetUpscaleMultiplier();
if(multiplier > 1) // it's limited to a maximum of 4 on reading the config if(multiplier > 1)
{ {
dst->m_texture->SetScale(GSVector2((float)multiplier, (float)multiplier)); dst->m_texture->SetScale(GSVector2((float)multiplier, (float)multiplier));
} }
@ -387,11 +387,6 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
int ww = (int)(fr.left + m_renderer->GetDisplayRect().width()); int ww = (int)(fr.left + m_renderer->GetDisplayRect().width());
int hh = (int)(fr.top + m_renderer->GetDisplayRect().height()); int hh = (int)(fr.top + m_renderer->GetDisplayRect().height());
if(hh <= m_renderer->GetDeviceSize().y / 2)
{
hh *= 2;
}
// Gregory: I'm sure this sillyness is related to the usage of a 32bits // Gregory: I'm sure this sillyness is related to the usage of a 32bits
// buffer as a 16 bits format. In this case the height of the buffer is // buffer as a 16 bits format. In this case the height of the buffer is
// multiplyed by 2 (Hence a scissor bigger than the RT) // multiplyed by 2 (Hence a scissor bigger than the RT)
@ -403,7 +398,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
hh = 512; hh = 512;
} }
if(ww > 0 && hh > 0) if(ww && hh)
{ {
dst->m_texture->SetScale(GSVector2((float)w / ww, (float)h / hh)); dst->m_texture->SetScale(GSVector2((float)w / ww, (float)h / hh));
} }