From b7534015e0ea316c043188e08c8d25910b4e5ae4 Mon Sep 17 00:00:00 2001 From: Margen67 Date: Sat, 19 Dec 2020 12:44:50 -0800 Subject: [PATCH] Use proper 21:9 aspect ratio, add 32:9 --- android/app/src/main/res/values-it/arrays.xml | 1 + android/app/src/main/res/values-nl/arrays.xml | 1 + android/app/src/main/res/values-pt-rBR/arrays.xml | 1 + android/app/src/main/res/values/arrays.xml | 2 ++ src/core/gte.cpp | 12 ++++++++++-- src/core/settings.cpp | 8 ++++---- src/core/types.h | 1 + src/duckstation-libretro/libretro_host_interface.cpp | 1 + 8 files changed, 21 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/res/values-it/arrays.xml b/android/app/src/main/res/values-it/arrays.xml index 3929fdc59..417d93627 100644 --- a/android/app/src/main/res/values-it/arrays.xml +++ b/android/app/src/main/res/values-it/arrays.xml @@ -50,6 +50,7 @@ 16:10 19:9 21:9 + 32:9 8:7 5:4 3:2 diff --git a/android/app/src/main/res/values-nl/arrays.xml b/android/app/src/main/res/values-nl/arrays.xml index fb7e7753e..9b7f2af00 100644 --- a/android/app/src/main/res/values-nl/arrays.xml +++ b/android/app/src/main/res/values-nl/arrays.xml @@ -50,6 +50,7 @@ 16:10 19:9 21:9 + 32:9 8:7 5:4 3:2 diff --git a/android/app/src/main/res/values-pt-rBR/arrays.xml b/android/app/src/main/res/values-pt-rBR/arrays.xml index 11587784a..ef02a535e 100644 --- a/android/app/src/main/res/values-pt-rBR/arrays.xml +++ b/android/app/src/main/res/values-pt-rBR/arrays.xml @@ -50,6 +50,7 @@ 16:10 19:9 21:9 + 32:9 8:7 5:4 3:2 diff --git a/android/app/src/main/res/values/arrays.xml b/android/app/src/main/res/values/arrays.xml index 2968741d5..72d1c53e5 100644 --- a/android/app/src/main/res/values/arrays.xml +++ b/android/app/src/main/res/values/arrays.xml @@ -94,6 +94,7 @@ 16:10 19:9 21:9 + 32:9 8:7 5:4 3:2 @@ -108,6 +109,7 @@ 16:10 19:9 21:9 + 32:9 8:7 5:4 3:2 diff --git a/src/core/gte.cpp b/src/core/gte.cpp index d4e04e5b3..16224789b 100644 --- a/src/core/gte.cpp +++ b/src/core/gte.cpp @@ -632,7 +632,11 @@ static void RTPS(const s16 V[3], u8 shift, bool lm, bool last) break; case DisplayAspectRatio::R21_9: - Sx = ((((s64(result) * s64(REGS.IR1)) * s64(4)) / s64(7)) + s64(REGS.OFX)); + Sx = ((((s64(result) * s64(REGS.IR1)) * s64(9)) / s64(16)) + s64(REGS.OFX)); + break; + + case DisplayAspectRatio::R32_9: + Sx = ((((s64(result) * s64(REGS.IR1)) * s64(3)) / s64(8)) + s64(REGS.OFX)); break; case DisplayAspectRatio::R8_7: @@ -725,7 +729,11 @@ static void RTPS(const s16 V[3], u8 shift, bool lm, bool last) break; case DisplayAspectRatio::R21_9: - precise_x = (precise_x * 4.0f) / 7.0f; + precise_x = (precise_x * 9.0f) / 16.0f; + break; + + case DisplayAspectRatio::R32_9: + precise_x = (precise_x * 3.0f) / 8.0f; break; case DisplayAspectRatio::R8_7: diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 63c802b70..a73facbe5 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -625,11 +625,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 = {{"Auto (Game Native)", "4:3", "16:9", "16:10", - "19:9", "21:9", "8:7", "5:4", "3:2", +static std::array s_display_aspect_ratio_names = {{"Auto (Game Native)", "4:3", "16:9", "16:10", + "19:9", "21:9", "32: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 = { - {-1.0f, 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, +static constexpr std::array s_display_aspect_ratio_values = { + {-1.0f, 4.0f / 3.0f, 16.0f / 9.0f, 16.0f / 10.0f, 19.0f / 9.0f, 64.0f / 27.0f, 32.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 84653dfbe..7a3d37152 100644 --- a/src/core/types.h +++ b/src/core/types.h @@ -91,6 +91,7 @@ enum class DisplayAspectRatio : u8 R16_10, R19_9, R21_9, + R32_9, R8_7, R5_4, R3_2, diff --git a/src/duckstation-libretro/libretro_host_interface.cpp b/src/duckstation-libretro/libretro_host_interface.cpp index 5068f9191..b807522db 100644 --- a/src/duckstation-libretro/libretro_host_interface.cpp +++ b/src/duckstation-libretro/libretro_host_interface.cpp @@ -710,6 +710,7 @@ static std::array s_option_definitions = {{ {"16:10", "16:10"}, {"19:9", "19:9"}, {"21:9", "21:9"}, + {"32:9", "32:9"}, {"8:7", "8:7"}, {"5:4", "5:4"}, {"3:2", "3:2"},