From 693d486ddbce839fe3dd3be41f3af81e55ec74dd Mon Sep 17 00:00:00 2001 From: David Griswold Date: Wed, 17 Sep 2025 14:12:10 +0300 Subject: [PATCH] Add a new Secondary Display Layout option on android that makes the secondary display honor swap button --- .../src/main/java/org/citra/citra_emu/display/ScreenLayout.kt | 4 +++- src/android/app/src/main/res/values/arrays.xml | 3 +++ src/android/app/src/main/res/values/strings.xml | 1 + src/common/settings.h | 2 +- src/core/frontend/framebuffer_layout.cpp | 3 ++- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/android/app/src/main/java/org/citra/citra_emu/display/ScreenLayout.kt b/src/android/app/src/main/java/org/citra/citra_emu/display/ScreenLayout.kt index c46dcadd8..5d299ed0e 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/display/ScreenLayout.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/display/ScreenLayout.kt @@ -56,7 +56,9 @@ enum class SecondaryDisplayLayout(val int: Int) { NONE(0), TOP_SCREEN(1), BOTTOM_SCREEN(2), - SIDE_BY_SIDE(3); + SIDE_BY_SIDE(3), + + REVERSE_PRIMARY(4); companion object { fun from(int: Int): SecondaryDisplayLayout { diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index 2a08cd546..29845f486 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -37,9 +37,11 @@ @string/emulation_secondary_display_default + @string/emulation_secondary_display_reverse_primary @string/emulation_top_screen @string/emulation_bottom_screen @string/emulation_screen_layout_sidebyside + @@ -50,6 +52,7 @@ 0 + 4 1 2 3 diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 750677fd5..ca54ed6ab 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -477,6 +477,7 @@ Original Default System Default (mirror) + Opposite of Primary Display Custom Layout Background Color The color which appears behind the screens during emulation, represented as an RGB value. diff --git a/src/common/settings.h b/src/common/settings.h index 90922bcff..a31c62581 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -57,7 +57,7 @@ enum class PortraitLayoutOption : u32 { PortraitOriginal }; -enum class SecondaryDisplayLayout : u32 { None, TopScreenOnly, BottomScreenOnly, SideBySide }; +enum class SecondaryDisplayLayout : u32 { None, TopScreenOnly, BottomScreenOnly, SideBySide, ReversePrimary }; /** Defines where the small screen will appear relative to the large screen * when in Large Screen mode */ diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index 918c1454f..7bd731966 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp @@ -305,7 +305,8 @@ FramebufferLayout AndroidSecondaryLayout(u32 width, u32 height) { const Settings::SecondaryDisplayLayout layout = Settings::values.secondary_display_layout.GetValue(); switch (layout) { - + case Settings::SecondaryDisplayLayout::ReversePrimary: + return SingleFrameLayout(width,height,! Settings::values.swap_screen,Settings::values.upright_screen.GetValue()); case Settings::SecondaryDisplayLayout::BottomScreenOnly: return SingleFrameLayout(width, height, true, Settings::values.upright_screen.GetValue()); case Settings::SecondaryDisplayLayout::SideBySide: