Implement 'Corrected' aspect ratio from Beetle PSX

This commit is contained in:
DarthMew 2022-05-27 16:56:00 +02:00
commit e15a184c86
2 changed files with 8 additions and 14 deletions

View file

@ -497,17 +497,11 @@ float GPU::GetDisplayAspectRatio() const
if (relative_width <= 0 || relative_height <= 0)
return 4.0f / 3.0f;
if (m_GPUSTAT.pal_mode)
{
relative_width /= static_cast<float>(PAL_HORIZONTAL_ACTIVE_END - PAL_HORIZONTAL_ACTIVE_START);
relative_height /= static_cast<float>(PAL_VERTICAL_ACTIVE_END - PAL_VERTICAL_ACTIVE_START);
}
else
{
relative_width /= static_cast<float>(NTSC_HORIZONTAL_ACTIVE_END - NTSC_HORIZONTAL_ACTIVE_START);
relative_height /= static_cast<float>(NTSC_VERTICAL_ACTIVE_END - NTSC_VERTICAL_ACTIVE_START);
}
return (relative_width / relative_height) * (4.0f / 3.0f);
float corrected_ar = (4.0f / 3.0f) * (2560.0f / 2800.0f);
corrected_ar *= (m_GPUSTAT.pal_mode ? 288.0f / (288.0f + g_settings.display_line_end_offset - g_settings.display_line_start_offset) :
240.0f / (240.0f + g_settings.display_line_end_offset - g_settings.display_line_start_offset));
return corrected_ar;
}
else if (g_settings.display_aspect_ratio == DisplayAspectRatio::PAR1_1)
{

View file

@ -805,11 +805,11 @@ struct retro_core_option_v2_definition option_defs_us[] = {
{ "19:9", "19:9" },
{ "20:9", "20:9" },
{ "Custom", "Custom"},
{ "Auto", "Auto (Game Native)" },
{ "PAR 1:1", "PAR 1:1" },
{ "Auto", "Corrected" },
{ "PAR 1:1", "PAR 1:1 (Uncorrected)" },
{ NULL, NULL },
},
"4:3"
"Auto"
},
{
"duckstation_Display.CustomAspectRatioNumerator",