GS: Added automatic 3:2 aspect for 480p mode

This commit is contained in:
refractionpcsx2 2022-04-11 13:35:12 +01:00
parent 48fd68ca87
commit 06e6d12e2f
5 changed files with 21 additions and 16 deletions

View File

@ -94,7 +94,7 @@
</item>
<item>
<property name="text">
<string>Standard (4:3)</string>
<string>Standard (4:3/3:2 Progressive)</string>
</property>
</item>
<item>

View File

@ -422,13 +422,13 @@ GSVector2i GSRenderer::GetInternalResolution()
return m_real_size;
}
static float GetCurrentAspectRatioFloat()
static float GetCurrentAspectRatioFloat(bool is_progressive)
{
static constexpr std::array<float, static_cast<size_t>(AspectRatioType::MaxCount)> ars = { {4.0f / 3.0f, 4.0f / 3.0f, 16.0f / 9.0f} };
return ars[static_cast<u32>(GSConfig.AspectRatio)];
static constexpr std::array<float, static_cast<size_t>(AspectRatioType::MaxCount) + 1> ars = { {4.0f / 3.0f, 4.0f / 3.0f, 16.0f / 9.0f, 3.0f / 2.0f} };
return ars[static_cast<u32>(GSConfig.AspectRatio) + (3u * is_progressive)];
}
static GSVector4 CalculateDrawRect(s32 window_width, s32 window_height, s32 texture_width, s32 texture_height, HostDisplay::Alignment alignment, bool flip_y)
static GSVector4 CalculateDrawRect(s32 window_width, s32 window_height, s32 texture_width, s32 texture_height, HostDisplay::Alignment alignment, bool flip_y, bool is_progressive)
{
const float f_width = static_cast<float>(window_width);
const float f_height = static_cast<float>(window_height);
@ -436,7 +436,12 @@ static GSVector4 CalculateDrawRect(s32 window_width, s32 window_height, s32 text
float targetAr = clientAr;
if (EmuConfig.CurrentAspectRatio == AspectRatioType::R4_3)
targetAr = 4.0f / 3.0f;
{
if (is_progressive)
targetAr = 3.0f / 2.0f;
else
targetAr = 4.0f / 3.0f;
}
else if (EmuConfig.CurrentAspectRatio == AspectRatioType::R16_9)
targetAr = 16.0f / 9.0f;
@ -572,7 +577,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()));
current->GetWidth(), current->GetHeight(), display->GetDisplayAlignment(), display->UsesLowerLeftOrigin(), GetVideoMode() == GSVideoMode::SDTV_480P));
static constexpr ShaderConvert s_shader[5] = {ShaderConvert::COPY, ShaderConvert::SCANLINE,
ShaderConvert::DIAGONAL_FILTER, ShaderConvert::TRIANGULAR_FILTER,
@ -709,7 +714,7 @@ bool GSRenderer::MakeSnapshot(const std::string& path)
bool GSRenderer::BeginCapture(std::string& filename)
{
return m_capture.BeginCapture(GetTvRefreshRate(), GetInternalResolution(), GetCurrentAspectRatioFloat(), filename);
return m_capture.BeginCapture(GetTvRefreshRate(), GetInternalResolution(), GetCurrentAspectRatioFloat(GetVideoMode() == GSVideoMode::SDTV_480P), filename);
}
void GSRenderer::EndCapture()
@ -799,7 +804,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));
HostDisplay::Alignment::LeftOrTop, false, GetVideoMode() == GSVideoMode::SDTV_480P));
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

@ -263,13 +263,13 @@ void Pcsx2Config::CpuOptions::LoadSave(SettingsWrapper& wrap)
const char* Pcsx2Config::GSOptions::AspectRatioNames[] = {
"Stretch",
"4:3",
"4:3/3:2 (Progressive)",
"16:9",
nullptr};
const char* Pcsx2Config::GSOptions::FMVAspectRatioSwitchNames[] = {
"Off",
"4:3",
"4:3/3:2 (Progressive)",
"16:9",
nullptr};

View File

@ -874,7 +874,7 @@ void AppConfig::GSWindowOptions::LoadSave(IniInterface& ini)
static const wxChar* AspectRatioNames[] =
{
L"Stretch",
L"4:3",
L"4:3/3:2 (Progressive)",
L"16:9",
// WARNING: array must be NULL terminated to compute it size
NULL};
@ -886,7 +886,7 @@ void AppConfig::GSWindowOptions::LoadSave(IniInterface& ini)
static const wxChar* FMVAspectRatioSwitchNames[] =
{
L"Off",
L"4:3",
L"4:3/3:2 (Progressive)",
L"16:9",
// WARNING: array must be NULL terminated to compute it size
NULL};

View File

@ -32,13 +32,13 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel(wxWindow* parent)
const wxString aspect_ratio_labels[] =
{
_("Fit to Window/Screen"),
_("Standard (4:3)"),
_("Standard (4:3/3:2 Progressive)"),
_("Widescreen (16:9)")};
const wxString fmv_aspect_ratio_switch_labels[] =
{
_("Off (Default)"),
_("Standard (4:3)"),
_("Standard (4:3/3:2 Progressive)"),
_("Widescreen (16:9)")};
// Warning must match the order of the VsyncMode Enum
@ -74,7 +74,7 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel(wxWindow* parent)
m_check_DclickFullscreen = new pxCheckBox(this, _("Double-click toggles fullscreen mode"));
m_combo_FMVAspectRatioSwitch->SetToolTip(pxEt(L"Off: Disables temporary aspect ratio switch. (It will use the above setting from Aspect Ratio instead of FMV Aspect Ratio Override.)\n\n"
L"4:3: Temporarily switch to a 4:3 aspect ratio while an FMV plays to correctly display an 4:3 FMV.\n\n"
L"4:3: Temporarily switch to a 4:3 aspect ratio while an FMV plays to correctly display an 4:3 FMV. Will use 3:2 is the resolution is 480P\n\n"
L"16:9: Temporarily switch to a 16:9 aspect ratio while an FMV plays to correctly display a widescreen 16:9 FMV."));
m_text_Zoom->SetToolTip(pxEt(L"Zoom = 100: Fit the entire image to the window without any cropping.\n"