GS: Saturate DISPLAY heights and limit max height

This commit is contained in:
refractionpcsx2 2022-04-03 12:51:45 +01:00
parent 3d171686b5
commit bae2c9c1d8
2 changed files with 7 additions and 35 deletions

View File

@ -36521,12 +36521,6 @@ SLUS-20217:
name: "Arctic Thunder"
region: "NTSC-U"
compat: 5
patches:
2B2E1535:
content: |-
author=kozarovv
// Set proper height for in game videos. Prevent videos being displayed doubled vertically.
patch=1,EE,0013345C,word,240701c0
SLUS-20218:
name: "Stunt GP"
region: "NTSC-U"
@ -36592,12 +36586,6 @@ SLUS-20229:
name: "Jonny Moseley - Mad Trix"
region: "NTSC-U"
compat: 5
patches:
AE94FAF8:
content: |-
author=refraction
comment=Fixes interlacing for videos
patch=1,EE,0024a6f0,word,24030003
SLUS-20230:
name: "Max Payne"
region: "NTSC-U"

View File

@ -380,31 +380,15 @@ void GSState::SaturateOutputSize(GSVector4i& r)
const bool is_ntsc = videomode == GSVideoMode::NTSC;
const bool is_pal = videomode == GSVideoMode::PAL;
//Some games (such as Pool Paradise) use alternate line reading and provide a massive height which is really half.
if (r.height() > 640 && (is_ntsc || is_pal))
{
r.bottom = r.top + (r.height() / 2);
return;
}
const auto& SMODE2 = m_regs->SMODE2;
const auto& PMODE = m_regs->PMODE;
// Limit games to standard NTSC resolutions. games with 512X512 (PAL resolution) on NTSC video mode produces black border on the bottom.
// 512 X 448 is the resolution generally used by NTSC, saturating the height value seems to get rid of the black borders.
// Though it's quite a bad hack as it affects binaries which are patched to run on a non-native video mode.
const bool interlaced_field = SMODE2.INT && !SMODE2.FFMD;
const bool single_frame_output = SMODE2.INT && SMODE2.FFMD && (PMODE.EN1 ^ PMODE.EN2);
const bool unsupported_output_size = r.height() > 448 && r.width() < 640;
const bool saturate =
m_NTSC_Saturation &&
is_ntsc &&
(interlaced_field || single_frame_output) &&
unsupported_output_size;
if (saturate)
r.bottom = r.top + 448;
const int res_multi = (SMODE2.INT + 1);
// Pixels only get drawn so quick so oversizing of the DISPLAY is ignored when rasterized.
// Non-Interlaced pictures can only do half the number of lines (double strike)
if (is_ntsc)
r.bottom = r.top + std::min(r.height(), 224 * res_multi);
else if (is_pal)
r.bottom = r.top + std::min(r.height(), 256 * res_multi);
}
GSVector4i GSState::GetDisplayRect(int i)