Settings: Add 20:9 display aspect ratio

This commit is contained in:
Connor McLaughlin 2021-01-14 00:45:46 +10:00
parent d44de3a9dc
commit ffa3744b3b
8 changed files with 21 additions and 7 deletions

View file

@ -49,6 +49,7 @@
<item>16:9</item> <item>16:9</item>
<item>16:10</item> <item>16:10</item>
<item>19:9</item> <item>19:9</item>
<item>20:9</item>
<item>21:9</item> <item>21:9</item>
<item>32:9</item> <item>32:9</item>
<item>8:7</item> <item>8:7</item>

View file

@ -49,6 +49,7 @@
<item>16:9</item> <item>16:9</item>
<item>16:10</item> <item>16:10</item>
<item>19:9</item> <item>19:9</item>
<item>20:9</item>
<item>21:9</item> <item>21:9</item>
<item>32:9</item> <item>32:9</item>
<item>8:7</item> <item>8:7</item>

View file

@ -49,6 +49,7 @@
<item>16:9</item> <item>16:9</item>
<item>16:10</item> <item>16:10</item>
<item>19:9</item> <item>19:9</item>
<item>20:9</item>
<item>21:9</item> <item>21:9</item>
<item>32:9</item> <item>32:9</item>
<item>8:7</item> <item>8:7</item>

View file

@ -93,6 +93,7 @@
<item>16:9</item> <item>16:9</item>
<item>16:10</item> <item>16:10</item>
<item>19:9</item> <item>19:9</item>
<item>20:9</item>
<item>21:9</item> <item>21:9</item>
<item>32:9</item> <item>32:9</item>
<item>8:7</item> <item>8:7</item>
@ -108,6 +109,7 @@
<item>16:9</item> <item>16:9</item>
<item>16:10</item> <item>16:10</item>
<item>19:9</item> <item>19:9</item>
<item>20:9</item>
<item>21:9</item> <item>21:9</item>
<item>32:9</item> <item>32:9</item>
<item>8:7</item> <item>8:7</item>

View file

@ -631,6 +631,10 @@ static void RTPS(const s16 V[3], u8 shift, bool lm, bool last)
Sx = ((((s64(result) * s64(REGS.IR1)) * s64(12)) / s64(19)) + s64(REGS.OFX)); Sx = ((((s64(result) * s64(REGS.IR1)) * s64(12)) / s64(19)) + s64(REGS.OFX));
break; break;
case DisplayAspectRatio::R20_9:
Sx = ((((s64(result) * s64(REGS.IR1)) * s64(3)) / s64(5)) + s64(REGS.OFX));
break;
case DisplayAspectRatio::R21_9: case DisplayAspectRatio::R21_9:
Sx = ((((s64(result) * s64(REGS.IR1)) * s64(9)) / s64(16)) + s64(REGS.OFX)); Sx = ((((s64(result) * s64(REGS.IR1)) * s64(9)) / s64(16)) + s64(REGS.OFX));
break; break;
@ -728,6 +732,10 @@ static void RTPS(const s16 V[3], u8 shift, bool lm, bool last)
precise_x = (precise_x * 12.0f) / 19.0f; precise_x = (precise_x * 12.0f) / 19.0f;
break; break;
case DisplayAspectRatio::R20_9:
precise_x = (precise_x * 3.0f) / 5.0f;
break;
case DisplayAspectRatio::R21_9: case DisplayAspectRatio::R21_9:
precise_x = (precise_x * 9.0f) / 16.0f; precise_x = (precise_x * 9.0f) / 16.0f;
break; break;

View file

@ -697,12 +697,12 @@ const char* Settings::GetDisplayCropModeDisplayName(DisplayCropMode crop_mode)
return s_display_crop_mode_display_names[static_cast<int>(crop_mode)]; return s_display_crop_mode_display_names[static_cast<int>(crop_mode)];
} }
static std::array<const char*, 13> s_display_aspect_ratio_names = { static std::array<const char*, 14> s_display_aspect_ratio_names = {
{TRANSLATABLE("DisplayAspectRatio", "Auto (Game Native)"), "4:3", "16:9", "16:10", "19:9", "21:9", "32:9", "8:7", {TRANSLATABLE("DisplayAspectRatio", "Auto (Game Native)"), "4:3", "16:9", "16:10", "19:9", "20:9", "21:9", "32:9",
"5:4", "3:2", "2:1 (VRAM 1:1)", "1:1", "PAR 1:1"}}; "8:7", "5:4", "3:2", "2:1 (VRAM 1:1)", "1:1", "PAR 1:1"}};
static constexpr std::array<float, 13> s_display_aspect_ratio_values = { static constexpr std::array<float, 14> 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, {-1.0f, 4.0f / 3.0f, 16.0f / 9.0f, 16.0f / 10.0f, 19.0f / 9.0f, 20.0f / 9.0f, 64.0f / 27.0f, 32.0f / 9.0f,
3.0f / 2.0f, 2.0f / 1.0f, 1.0f, -1.0f}}; 8.0f / 7.0f, 5.0f / 4.0f, 3.0f / 2.0f, 2.0f / 1.0f, 1.0f, -1.0f}};
std::optional<DisplayAspectRatio> Settings::ParseDisplayAspectRatio(const char* str) std::optional<DisplayAspectRatio> Settings::ParseDisplayAspectRatio(const char* str)
{ {

View file

@ -98,6 +98,7 @@ enum class DisplayAspectRatio : u8
R16_9, R16_9,
R16_10, R16_10,
R19_9, R19_9,
R20_9,
R21_9, R21_9,
R32_9, R32_9,
R8_7, R8_7,

View file

@ -108,7 +108,7 @@ private:
enum : u32 enum : u32
{ {
GAME_LIST_CACHE_SIGNATURE = 0x45434C47, GAME_LIST_CACHE_SIGNATURE = 0x45434C47,
GAME_LIST_CACHE_VERSION = 20 GAME_LIST_CACHE_VERSION = 21
}; };
using DatabaseMap = std::unordered_map<std::string, GameListDatabaseEntry>; using DatabaseMap = std::unordered_map<std::string, GameListDatabaseEntry>;