diff --git a/android/app/src/main/res/values/arrays.xml b/android/app/src/main/res/values/arrays.xml index efe1d5ae2..996635e6c 100644 --- a/android/app/src/main/res/values/arrays.xml +++ b/android/app/src/main/res/values/arrays.xml @@ -94,6 +94,8 @@ 19:9 21:9 8:7 + 5:4 + 3:2 2:1 (VRAM 1:1) 1:1 PAR 1:1 @@ -105,6 +107,8 @@ 19:9 21:9 8:7 + 5:4 + 3:2 2:1 (VRAM 1:1) 1:1 PAR 1:1 diff --git a/src/core/gte.cpp b/src/core/gte.cpp index c9dd2eb5d..3b81c1809 100644 --- a/src/core/gte.cpp +++ b/src/core/gte.cpp @@ -639,6 +639,14 @@ static void RTPS(const s16 V[3], u8 shift, bool lm, bool last) Sx = ((((s64(result) * s64(REGS.IR1)) * s64(7)) / s64(6)) + s64(REGS.OFX)); break; + case DisplayAspectRatio::R5_4: + Sx = ((((s64(result) * s64(REGS.IR1)) * s64(16)) / s64(15)) + s64(REGS.OFX)); + break; + + case DisplayAspectRatio::R3_2: + Sx = ((((s64(result) * s64(REGS.IR1)) * s64(8)) / s64(9)) + s64(REGS.OFX)); + break; + case DisplayAspectRatio::R2_1: Sx = ((((s64(result) * s64(REGS.IR1)) * s64(2)) / s64(3)) + s64(REGS.OFX)); break; @@ -723,6 +731,14 @@ static void RTPS(const s16 V[3], u8 shift, bool lm, bool last) precise_x = (precise_x * 7.0f) / 6.0f; break; + case DisplayAspectRatio::R5_4: + precise_x = (precise_x * 16.0f) / 15.0f; + break; + + case DisplayAspectRatio::R3_2: + precise_x = (precise_x * 8.0f) / 9.0f; + break; + case DisplayAspectRatio::R2_1: precise_x = (precise_x * 2.0f) / 3.0f; break; diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 3dd9f51d0..5451601aa 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -616,10 +616,11 @@ const char* Settings::GetDisplayCropModeDisplayName(DisplayCropMode crop_mode) return s_display_crop_mode_display_names[static_cast(crop_mode)]; } -static std::array s_display_aspect_ratio_names = { - {"4:3", "16:9", "16:10", "19:9", "21:9", "8:7", "2:1 (VRAM 1:1)", "1:1", "PAR 1:1"}}; -static constexpr std::array s_display_aspect_ratio_values = { - {4.0f / 3.0f, 16.0f / 9.0f, 16.0f / 10.0f, 19.0f / 9.0f, 21.0f / 9.0f, 8.0f / 7.0f, 2.0f / 1.0f, 1.0f, -1.0f}}; +static std::array s_display_aspect_ratio_names = { + {"4:3", "16:9", "16:10", "19:9", "21:9", "8:7", "5:4", "3:2", "2:1 (VRAM 1:1)", "1:1", "PAR 1:1"}}; +static constexpr std::array s_display_aspect_ratio_values = { + {4.0f / 3.0f, 16.0f / 9.0f, 16.0f / 10.0f, 19.0f / 9.0f, 21.0f / 9.0f, 8.0f / 7.0f, 5.0f / 4.0f, 3.0f / 2.0f, + 2.0f / 1.0f, 1.0f, -1.0f}}; std::optional Settings::ParseDisplayAspectRatio(const char* str) { diff --git a/src/core/types.h b/src/core/types.h index f70d2eb5f..d3fca8b69 100644 --- a/src/core/types.h +++ b/src/core/types.h @@ -91,6 +91,8 @@ enum class DisplayAspectRatio : u8 R19_9, R21_9, R8_7, + R5_4, + R3_2, R2_1, R1_1, PAR1_1, diff --git a/src/duckstation-libretro/libretro_host_interface.cpp b/src/duckstation-libretro/libretro_host_interface.cpp index 158083bd8..57fa7528f 100644 --- a/src/duckstation-libretro/libretro_host_interface.cpp +++ b/src/duckstation-libretro/libretro_host_interface.cpp @@ -710,6 +710,8 @@ static std::array s_option_definitions = {{ {"19:9", "19:9"}, {"21:9", "21:9"}, {"8:7", "8:7"}, + {"5:4", "5:4"}, + {"3:2", "3:2"}, {"2:1 (VRAM 1:1)", "2:1 (VRAM 1:1)"}, {"1:1", "1:1"}, {"PAR 1:1", "PAR 1:1"}},