GS: Auto adjust aspect when using Offsets + Overscan

This commit is contained in:
refractionpcsx2 2022-06-05 18:47:30 +01:00
parent e234fb32d9
commit 66c25b3cb6
2 changed files with 6 additions and 5 deletions

View File

@ -568,7 +568,7 @@ void GSRenderer::VSync(u32 field, bool registers_written)
{
HostDisplay* const display = g_gs_device->GetDisplay();
const GSVector4 draw_rect(CalculateDrawRect(display->GetWindowWidth(), display->GetWindowHeight(),
current->GetWidth(), current->GetHeight(), display->GetDisplayAlignment(), display->UsesLowerLeftOrigin(), GetVideoMode() == GSVideoMode::SDTV_480P));
current->GetWidth(), current->GetHeight(), display->GetDisplayAlignment(), display->UsesLowerLeftOrigin(), GetVideoMode() == GSVideoMode::SDTV_480P || (GSConfig.PCRTCOverscan && GSConfig.PCRTCOffsets)));
const u64 current_time = Common::Timer::GetCurrentValue();
const float shader_time = static_cast<float>(Common::Timer::ConvertValueToSeconds(current_time - m_shader_time_start));
@ -767,7 +767,8 @@ void GSRenderer::PresentCurrentFrame()
{
HostDisplay* const display = g_gs_device->GetDisplay();
const GSVector4 draw_rect(CalculateDrawRect(display->GetWindowWidth(), display->GetWindowHeight(),
current->GetWidth(), current->GetHeight(), display->GetDisplayAlignment(), display->UsesLowerLeftOrigin(), GetVideoMode() == GSVideoMode::SDTV_480P));
current->GetWidth(), current->GetHeight(), display->GetDisplayAlignment(), display->UsesLowerLeftOrigin(), GetVideoMode() == GSVideoMode::SDTV_480P || (GSConfig.PCRTCOverscan && GSConfig.PCRTCOffsets)));
const u64 current_time = Common::Timer::GetCurrentValue();
const float shader_time = static_cast<float>(Common::Timer::ConvertValueToSeconds(current_time - m_shader_time_start));
@ -784,7 +785,7 @@ void GSRenderer::PresentCurrentFrame()
bool GSRenderer::BeginCapture(std::string& filename)
{
return m_capture.BeginCapture(GetTvRefreshRate(), GetInternalResolution(), GetCurrentAspectRatioFloat(GetVideoMode() == GSVideoMode::SDTV_480P), filename);
return m_capture.BeginCapture(GetTvRefreshRate(), GetInternalResolution(), GetCurrentAspectRatioFloat(GetVideoMode() == GSVideoMode::SDTV_480P || (GSConfig.PCRTCOverscan && GSConfig.PCRTCOffsets)), filename);
}
void GSRenderer::EndCapture()
@ -887,7 +888,7 @@ bool GSRenderer::SaveSnapshotToMemory(u32 width, u32 height, std::vector<u32>* p
return false;
GSVector4 draw_rect(CalculateDrawRect(width, height, current->GetWidth(), current->GetHeight(),
HostDisplay::Alignment::LeftOrTop, false, GetVideoMode() == GSVideoMode::SDTV_480P));
HostDisplay::Alignment::LeftOrTop, false, GetVideoMode() == GSVideoMode::SDTV_480P || (GSConfig.PCRTCOverscan && GSConfig.PCRTCOffsets)));
u32 draw_width = static_cast<u32>(draw_rect.z - draw_rect.x);
u32 draw_height = static_cast<u32>(draw_rect.w - draw_rect.y);
if (draw_width > width)

View File

@ -358,7 +358,7 @@ void VMManager::RequestDisplaySize(float scale /*= 0.0f*/)
switch (GSConfig.AspectRatio)
{
case AspectRatioType::RAuto4_3_3_2:
if (GSgetDisplayMode() == GSVideoMode::SDTV_480P)
if (GSgetDisplayMode() == GSVideoMode::SDTV_480P || (GSConfig.PCRTCOverscan && GSConfig.PCRTCOffsets))
x_scale = (3.0f / 2.0f) / (static_cast<float>(iwidth) / static_cast<float>(iheight));
else
x_scale = (4.0f / 3.0f) / (static_cast<float>(iwidth) / static_cast<float>(iheight));