From 2fa93982eaba47857e0f3b87c405c8a6e439fcef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 2 Apr 2023 18:29:57 +0200 Subject: [PATCH 1/3] Add support for integer scale factor for display This is mainly useful if you want an authentic pixellated look with 1x rendering (or software) and nearest display filter. It'll simply round down the auto-scaled sized to the nearest integer scale factor, configuring exactly which one isn't that interesting since they all are gonna look good. Fixes #17093 --- Core/Config.cpp | 1 + Core/Config.h | 1 + GPU/Common/PresentationCommon.cpp | 9 +++++++-- Tools/langtool/Cargo.lock | 8 ++++---- UI/DisplayLayoutScreen.cpp | 13 ++++++++++--- assets/lang/ar_AE.ini | 1 + assets/lang/az_AZ.ini | 1 + assets/lang/bg_BG.ini | 1 + assets/lang/ca_ES.ini | 1 + assets/lang/cz_CZ.ini | 1 + assets/lang/da_DK.ini | 1 + assets/lang/de_DE.ini | 1 + assets/lang/dr_ID.ini | 1 + assets/lang/en_US.ini | 1 + assets/lang/es_ES.ini | 1 + assets/lang/es_LA.ini | 1 + assets/lang/fa_IR.ini | 1 + assets/lang/fi_FI.ini | 1 + assets/lang/fr_FR.ini | 1 + assets/lang/gl_ES.ini | 1 + assets/lang/gr_EL.ini | 1 + assets/lang/he_IL.ini | 1 + assets/lang/he_IL_invert.ini | 1 + assets/lang/hr_HR.ini | 1 + assets/lang/hu_HU.ini | 1 + assets/lang/id_ID.ini | 1 + assets/lang/it_IT.ini | 1 + assets/lang/ja_JP.ini | 1 + assets/lang/jv_ID.ini | 1 + assets/lang/ko_KR.ini | 1 + assets/lang/lo_LA.ini | 1 + assets/lang/lt-LT.ini | 1 + assets/lang/ms_MY.ini | 1 + assets/lang/nl_NL.ini | 1 + assets/lang/no_NO.ini | 1 + assets/lang/pl_PL.ini | 1 + assets/lang/pt_BR.ini | 1 + assets/lang/pt_PT.ini | 1 + assets/lang/ro_RO.ini | 1 + assets/lang/ru_RU.ini | 1 + assets/lang/sv_SE.ini | 1 + assets/lang/tg_PH.ini | 1 + assets/lang/th_TH.ini | 1 + assets/lang/tr_TR.ini | 1 + assets/lang/uk_UA.ini | 1 + assets/lang/vi_VN.ini | 1 + assets/lang/zh_CN.ini | 1 + assets/lang/zh_TW.ini | 1 + 48 files changed, 66 insertions(+), 9 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 1debc46920..2aba48a42d 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -870,6 +870,7 @@ static const ConfigSetting graphicsSettings[] = { ConfigSetting("DisplayOffsetX", &g_Config.fDisplayOffsetX, 0.5f, true, true), ConfigSetting("DisplayOffsetY", &g_Config.fDisplayOffsetY, 0.5f, true, true), ConfigSetting("DisplayScale", &g_Config.fDisplayScale, 1.0f, true, true), + ConfigSetting("DisplayIntegerScale", &g_Config.bDisplayIntegerScale, false, true, true), ConfigSetting("DisplayAspectRatio", &g_Config.fDisplayAspectRatio, 1.0f, true, true), ConfigSetting("DisplayStretch", &g_Config.bDisplayStretch, false, true, true), diff --git a/Core/Config.h b/Core/Config.h index 17c5197a97..e42a385f31 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -174,6 +174,7 @@ public: float fDisplayOffsetX; float fDisplayOffsetY; float fDisplayScale; // Relative to the most constraining axis (x or y). + bool bDisplayIntegerScale; // Snaps scaling to integer scale factors in raw pixels. float fDisplayAspectRatio; // Stored relative to the PSP's native ratio, so 1.0 is the normal pixel aspect ratio. bool bImmersiveMode; // Mode on Android Kitkat 4.4 and later that hides the back button etc. diff --git a/GPU/Common/PresentationCommon.cpp b/GPU/Common/PresentationCommon.cpp index f346226f12..ac3cc52ba1 100644 --- a/GPU/Common/PresentationCommon.cpp +++ b/GPU/Common/PresentationCommon.cpp @@ -74,7 +74,7 @@ void CenterDisplayOutputRect(FRect *rc, float origW, float origH, const FRect &f bool rotated = rotation == ROTATION_LOCKED_VERTICAL || rotation == ROTATION_LOCKED_VERTICAL180; - bool stretch = g_Config.bDisplayStretch; + bool stretch = g_Config.bDisplayStretch && !g_Config.bDisplayIntegerScale; float offsetX = g_Config.fDisplayOffsetX; float offsetY = g_Config.fDisplayOffsetY; @@ -87,7 +87,7 @@ void CenterDisplayOutputRect(FRect *rc, float origW, float origH, const FRect &f // Ye olde 1080p hack, new version: If everything is setup to exactly cover the screen (defaults), and the screen display aspect ratio is 16:9, // stretch the PSP's aspect ratio veeery slightly to fill it completely. - if (scale == 1.0f && offsetX == 0.5f && offsetY == 0.5f && aspectRatioAdjust == 1.0f) { + if (scale == 1.0f && offsetX == 0.5f && offsetY == 0.5f && aspectRatioAdjust == 1.0f && !g_Config.bDisplayIntegerScale) { if (fabsf(frame.w / frame.h - 16.0f / 9.0f) < 0.0001f) { aspectRatioAdjust = (frame.w / frame.h) / (480.0f / 272.0f); } @@ -122,6 +122,11 @@ void CenterDisplayOutputRect(FRect *rc, float origW, float origH, const FRect &f outH = scaledHeight; } + if (g_Config.bDisplayIntegerScale) { + outW = std::max(1.0f, floorf(outW / 480.0f)) * 480.0f; + outH = outW / origRatio; + } + if (IsVREnabled()) { rc->x = 0; rc->y = 0; diff --git a/Tools/langtool/Cargo.lock b/Tools/langtool/Cargo.lock index 70ea905488..095720ff2a 100644 --- a/Tools/langtool/Cargo.lock +++ b/Tools/langtool/Cargo.lock @@ -106,18 +106,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "1d0dd4be24fcdcfeaa12a432d588dc59bbad6cad3510c67e74a2b6b2fc950564" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] diff --git a/UI/DisplayLayoutScreen.cpp b/UI/DisplayLayoutScreen.cpp index 791dc8c414..0ed5ea43da 100644 --- a/UI/DisplayLayoutScreen.cpp +++ b/UI/DisplayLayoutScreen.cpp @@ -241,14 +241,19 @@ void DisplayLayoutScreen::CreateViews() { if (!IsVREnabled()) { auto stretch = new CheckBox(&g_Config.bDisplayStretch, gr->T("Stretch")); + stretch->SetDisabledPtr(&g_Config.bDisplayIntegerScale); rightColumn->Add(stretch); PopupSliderChoiceFloat *aspectRatio = new PopupSliderChoiceFloat(&g_Config.fDisplayAspectRatio, 0.5f, 2.0f, gr->T("Aspect Ratio"), screenManager()); rightColumn->Add(aspectRatio); - aspectRatio->SetDisabledPtr(&g_Config.bDisplayStretch); + aspectRatio->SetEnabledFunc([]() { + return !g_Config.bDisplayStretch && !g_Config.bDisplayIntegerScale; + }); aspectRatio->SetHasDropShadow(false); aspectRatio->SetLiveUpdate(true); + rightColumn->Add(new CheckBox(&g_Config.bDisplayIntegerScale, gr->T("Integer scale factor"))); + #if PPSSPP_PLATFORM(ANDROID) // Hide insets option if no insets, or OS too old. if (System_GetPropertyInt(SYSPROP_SYSTEMVERSION) >= 28 && @@ -295,8 +300,10 @@ void DisplayLayoutScreen::CreateViews() { leftColumn->Add(new Spacer(24.0f)); } - static const char *bufFilters[] = { "Linear", "Nearest", }; - leftColumn->Add(new PopupMultiChoice(&g_Config.iBufFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), gr->GetName(), screenManager())); + if (!IsVREnabled()) { + static const char *bufFilters[] = { "Linear", "Nearest", }; + leftColumn->Add(new PopupMultiChoice(&g_Config.iBufFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), gr->GetName(), screenManager())); + } Draw::DrawContext *draw = screenManager()->getDrawContext(); diff --git a/assets/lang/ar_AE.ini b/assets/lang/ar_AE.ini index 03851d3694..f53e557cb3 100644 --- a/assets/lang/ar_AE.ini +++ b/assets/lang/ar_AE.ini @@ -509,6 +509,7 @@ High = ‎عالي Hybrid = ‎هجين Hybrid + Bicubic = ‎هجين + تكعيب Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Internal resolution Lazy texture caching = Lazy texture caching (speedup) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/az_AZ.ini b/assets/lang/az_AZ.ini index ca7c57a8a7..97e89fb72d 100644 --- a/assets/lang/az_AZ.ini +++ b/assets/lang/az_AZ.ini @@ -501,6 +501,7 @@ High = High Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Internal resolution Lazy texture caching = Lazy texture caching (speedup) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/bg_BG.ini b/assets/lang/bg_BG.ini index 0ee29c2fa1..569d0e7844 100644 --- a/assets/lang/bg_BG.ini +++ b/assets/lang/bg_BG.ini @@ -501,6 +501,7 @@ High = High Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Вътрешна резолюция Lazy texture caching = Мързеливо текстурно кеширане (ускорява) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/ca_ES.ini b/assets/lang/ca_ES.ini index fc0eff76bd..7c260279ca 100644 --- a/assets/lang/ca_ES.ini +++ b/assets/lang/ca_ES.ini @@ -501,6 +501,7 @@ High = Alta Hybrid = Híbrid Hybrid + Bicubic = Híbrid i bicúbic Ignore camera notch when centering = Ignora la notch de la càmera usant el centre d'imatge. +Integer scale factor = Integer scale factor Internal Resolution = Resolució interna Lazy texture caching = Memòria cau de textures diferit (ràpid) Lazy texture caching Tip = Ràpid, però puc provocar problemes als textos d'alguns jocs diff --git a/assets/lang/cz_CZ.ini b/assets/lang/cz_CZ.ini index 0850a50a82..46926a2a79 100644 --- a/assets/lang/cz_CZ.ini +++ b/assets/lang/cz_CZ.ini @@ -501,6 +501,7 @@ High = Vysoká Hybrid = Hybridní Hybrid + Bicubic = Hybridní + Bikubická Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Vnitřní rozlišení Lazy texture caching = Líné ukládání textur do mezipaměti (zrychlení) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/da_DK.ini b/assets/lang/da_DK.ini index 0deb860f5e..52144f762f 100644 --- a/assets/lang/da_DK.ini +++ b/assets/lang/da_DK.ini @@ -500,6 +500,7 @@ High = Høj Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubisk Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Intern opløsning Lazy texture caching = Træg textur caching (hurtigere) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/de_DE.ini b/assets/lang/de_DE.ini index 5fed08040e..66e66a23f9 100644 --- a/assets/lang/de_DE.ini +++ b/assets/lang/de_DE.ini @@ -500,6 +500,7 @@ High = Hoch Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bikubisch Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Interne Auflösung Lazy texture caching = Träges Textur-Caching (schneller) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/dr_ID.ini b/assets/lang/dr_ID.ini index 95041f345c..03b014fe1a 100644 --- a/assets/lang/dr_ID.ini +++ b/assets/lang/dr_ID.ini @@ -501,6 +501,7 @@ High = High Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Internal resolution Lazy texture caching = Lazy texture caching (speedup) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/en_US.ini b/assets/lang/en_US.ini index cb75ad6227..ff96b94931 100644 --- a/assets/lang/en_US.ini +++ b/assets/lang/en_US.ini @@ -525,6 +525,7 @@ High = High Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Internal resolution Lazy texture caching = Lazy texture caching (speedup) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/es_ES.ini b/assets/lang/es_ES.ini index c3212ec6f6..b9b5744d15 100644 --- a/assets/lang/es_ES.ini +++ b/assets/lang/es_ES.ini @@ -500,6 +500,7 @@ High = Alta Hybrid = Híbrido Hybrid + Bicubic = Híbrido y bicúbico Ignore camera notch when centering = Ignorar notch de la cámara usando centrado de imagen. +Integer scale factor = Integer scale factor Internal Resolution = Resolución interna Lazy texture caching = Caché de texturas diferido (rápido) Lazy texture caching Tip = Rápido, pero puedo provocar problemas en los textos de algunos juegos diff --git a/assets/lang/es_LA.ini b/assets/lang/es_LA.ini index 129b2e5175..17f1320676 100644 --- a/assets/lang/es_LA.ini +++ b/assets/lang/es_LA.ini @@ -500,6 +500,7 @@ High = Alta Hybrid = Híbrido Hybrid + Bicubic = Híbrido + bicúbico Ignore camera notch when centering = Ignorar muesca de la cámara al centrar +Integer scale factor = Integer scale factor Internal Resolution = Resolución interna Lazy texture caching = Caché de texturas diferido (rápido) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/fa_IR.ini b/assets/lang/fa_IR.ini index 1656074114..0c8fa54d41 100644 --- a/assets/lang/fa_IR.ini +++ b/assets/lang/fa_IR.ini @@ -500,6 +500,7 @@ High = ‎زیاد Hybrid = ‎Hybrid (ترکیبی) Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = ‎رزولوشن داخلی Lazy texture caching = ‎کش کردن تکسچر های ماندگار (افزایش سرعت) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/fi_FI.ini b/assets/lang/fi_FI.ini index 68991bc328..4310f68574 100644 --- a/assets/lang/fi_FI.ini +++ b/assets/lang/fi_FI.ini @@ -501,6 +501,7 @@ High = High Hybrid = Hybridi Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Internal resolution Lazy texture caching = Lazy texture caching (speedup) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/fr_FR.ini b/assets/lang/fr_FR.ini index 49a7288770..0c7bb6610f 100644 --- a/assets/lang/fr_FR.ini +++ b/assets/lang/fr_FR.ini @@ -501,6 +501,7 @@ High = Haute Hybrid = Hybride Hybrid + Bicubic = Hybride + Bicubique Ignore camera notch when centering = Ignorer l'encoche de la caméra lors du centrage +Integer scale factor = Integer scale factor Internal Resolution = Définition interne Lazy texture caching = Mise en cache paresseuse des textures (gain de vitesse) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/gl_ES.ini b/assets/lang/gl_ES.ini index 911e94a099..ea689f02ae 100644 --- a/assets/lang/gl_ES.ini +++ b/assets/lang/gl_ES.ini @@ -501,6 +501,7 @@ High = Alta Hybrid = Híbrido Hybrid + Bicubic = Híbrido + Bicúbico Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Resolución interna Lazy texture caching = Caché de texturas diferido (rápido) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/gr_EL.ini b/assets/lang/gr_EL.ini index 5abcded47c..b8b8452c29 100644 --- a/assets/lang/gr_EL.ini +++ b/assets/lang/gr_EL.ini @@ -501,6 +501,7 @@ High = Υψηλή Hybrid = Υβριδική Hybrid + Bicubic = Υβριδική + Διακυβική Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Εσωτερική Ανάλυση Lazy texture caching = Τεμπέλικη προσωρινή μνήμη υφών (ταχύτερο) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/he_IL.ini b/assets/lang/he_IL.ini index b53230ac96..a48a49fbcd 100644 --- a/assets/lang/he_IL.ini +++ b/assets/lang/he_IL.ini @@ -501,6 +501,7 @@ High = High Hybrid = היברידי Hybrid + Bicubic = היברידי + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Internal resolution Lazy texture caching = Lazy texture caching (speedup) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/he_IL_invert.ini b/assets/lang/he_IL_invert.ini index 498dcdad0d..a79296552d 100644 --- a/assets/lang/he_IL_invert.ini +++ b/assets/lang/he_IL_invert.ini @@ -501,6 +501,7 @@ High = High Hybrid = ידירביה Hybrid + Bicubic = ידירביה + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Internal resolution Lazy texture caching = Lazy texture caching (speedup) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/hr_HR.ini b/assets/lang/hr_HR.ini index 0b04b28661..f265035cbc 100644 --- a/assets/lang/hr_HR.ini +++ b/assets/lang/hr_HR.ini @@ -501,6 +501,7 @@ High = Visoko Hybrid = Hibrid Hybrid + Bicubic = Hibrid + Bikubični Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Unutarnja rezolucija Lazy texture caching = Lijeno teksturno predmemoriranje (ubrzanje) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/hu_HU.ini b/assets/lang/hu_HU.ini index 70126bd913..c83882a2dc 100644 --- a/assets/lang/hu_HU.ini +++ b/assets/lang/hu_HU.ini @@ -501,6 +501,7 @@ High = Magas Hybrid = Hibrid Hybrid + Bicubic = Hibrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Belső felbontás Lazy texture caching = Lusta textúra gyorsítótárazás (gyorsítás) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/id_ID.ini b/assets/lang/id_ID.ini index d43ba497a0..b020c6a681 100644 --- a/assets/lang/id_ID.ini +++ b/assets/lang/id_ID.ini @@ -501,6 +501,7 @@ High = Tinggi Hybrid = Hibrida Hybrid + Bicubic = Hibrida + Bikubik Ignore camera notch when centering = Abaikan pandangan kamera saat sedang fokus +Integer scale factor = Integer scale factor Internal Resolution = Resolusi internal Lazy texture caching = Perlambatan penembolokan tekstur (mempercepat) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/it_IT.ini b/assets/lang/it_IT.ini index e78f9b2092..7593d9e703 100644 --- a/assets/lang/it_IT.ini +++ b/assets/lang/it_IT.ini @@ -502,6 +502,7 @@ High = Alta Hybrid = Ibrido Hybrid + Bicubic = Ibrido + Bicubico Ignore camera notch when centering = Ignora il notch della foto camera durante il centramento +Integer scale factor = Integer scale factor Internal Resolution = Risoluzione Interna Lazy texture caching = Caching lenta delle texture (velocizza) Lazy texture caching Tip = Veloce, ma può causare problemi di testo in alcuni giochi diff --git a/assets/lang/ja_JP.ini b/assets/lang/ja_JP.ini index affe890a4b..ac03a1b1db 100644 --- a/assets/lang/ja_JP.ini +++ b/assets/lang/ja_JP.ini @@ -501,6 +501,7 @@ High = 高 Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = インカメラ液晶部分を画面センタリング領域に含めない +Integer scale factor = Integer scale factor Internal Resolution = 内部解像度 Lazy texture caching = テクスチャキャッシュを遅延させる (高速化) Lazy texture caching Tip = 高速化するが いくつかのゲームでテキスト表示が崩れる場合があります diff --git a/assets/lang/jv_ID.ini b/assets/lang/jv_ID.ini index 8931f65f45..27e4cf0e6a 100644 --- a/assets/lang/jv_ID.ini +++ b/assets/lang/jv_ID.ini @@ -500,6 +500,7 @@ High = Dhuwur Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Resolusi internal Lazy texture caching = Caching tektur puguh (Luwih cepet) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/ko_KR.ini b/assets/lang/ko_KR.ini index 7001fd30cb..3834f53691 100644 --- a/assets/lang/ko_KR.ini +++ b/assets/lang/ko_KR.ini @@ -498,6 +498,7 @@ High = 높음 Hybrid = 혼합 Hybrid + Bicubic = 혼합 + 고등차수보간 Ignore camera notch when centering = 센터링 시 카메라 노치 무시 +Integer scale factor = Integer scale factor Internal Resolution = 내부 해상도 Lazy texture caching = 레이지 텍스처 캐싱 (속도 상승) Lazy texture caching Tip = 더 빠르지만 몇몇 게임에서 텍스트 문제를 일으킬 수 있음 diff --git a/assets/lang/lo_LA.ini b/assets/lang/lo_LA.ini index 2bf159d9bc..94eefc8bc6 100644 --- a/assets/lang/lo_LA.ini +++ b/assets/lang/lo_LA.ini @@ -500,6 +500,7 @@ High = ສູງ Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = ຄວາມລະອຽດພາຍໃນ Lazy texture caching = ແຄດພື້ນຜິວແບບຫຍາບ (ໄວຂຶ້ນ) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/lt-LT.ini b/assets/lang/lt-LT.ini index d5e1f78adb..f3f033a377 100644 --- a/assets/lang/lt-LT.ini +++ b/assets/lang/lt-LT.ini @@ -501,6 +501,7 @@ High = Aukšta Hybrid = Hybridas Hybrid + Bicubic = Hybridas + "Bicubic" Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Vidinė rezoliucija Lazy texture caching = "Tingus" tekstūrų spartinimas (greičio didintojas) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/ms_MY.ini b/assets/lang/ms_MY.ini index ed9e286f62..f496891d2a 100644 --- a/assets/lang/ms_MY.ini +++ b/assets/lang/ms_MY.ini @@ -501,6 +501,7 @@ High = High Hybrid = Hibrid Hybrid + Bicubic = Hibrid + Bikubik Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Resolusi dalaman Lazy texture caching = Pengkuki tekstur ringkas (tingkatkan kelajuan) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/nl_NL.ini b/assets/lang/nl_NL.ini index 73f3bfd964..6a4c6742b4 100644 --- a/assets/lang/nl_NL.ini +++ b/assets/lang/nl_NL.ini @@ -501,6 +501,7 @@ High = Hoog Hybrid = Hybride Hybrid + Bicubic = Hybride + bicubisch Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Interne resolutie Lazy texture caching = Texturecaching reduceren (sneller) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/no_NO.ini b/assets/lang/no_NO.ini index 715516d893..78ad6bf5f3 100644 --- a/assets/lang/no_NO.ini +++ b/assets/lang/no_NO.ini @@ -501,6 +501,7 @@ High = High Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Internal resolution Lazy texture caching = Lazy texture caching (speedup) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/pl_PL.ini b/assets/lang/pl_PL.ini index 93230b473e..fd5dcec423 100644 --- a/assets/lang/pl_PL.ini +++ b/assets/lang/pl_PL.ini @@ -501,6 +501,7 @@ High = Wysokie Hybrid = Hybrydowe Hybrid + Bicubic = Hybrydowe + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Rozdzielczość wewnętrzna Lazy texture caching = Leniwa pamięć tekstur (przyśpieszenie) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/pt_BR.ini b/assets/lang/pt_BR.ini index c93a14a39b..cd88ff6d99 100644 --- a/assets/lang/pt_BR.ini +++ b/assets/lang/pt_BR.ini @@ -525,6 +525,7 @@ High = Alta Hybrid = Híbrido Hybrid + Bicubic = Híbrido + Bi-cúbico Ignore camera notch when centering = Ignora o nível da câmera quando centralizar +Integer scale factor = Integer scale factor Internal Resolution = Resolução interna Lazy texture caching = Cache preguiçoso da textura (mais rápido) Lazy texture caching Tip = Mais rápido mas pode causar problemas no texto em alguns jogos diff --git a/assets/lang/pt_PT.ini b/assets/lang/pt_PT.ini index d88325d86e..56221c3f60 100644 --- a/assets/lang/pt_PT.ini +++ b/assets/lang/pt_PT.ini @@ -525,6 +525,7 @@ High = Alta Hybrid = Híbrido Hybrid + Bicubic = Híbrido + Bi-cúbico Ignore camera notch when centering = Ignora o nível da câmera quando centralizar +Integer scale factor = Integer scale factor Internal Resolution = Resolução interna Lazy texture caching = Cache preguiçoso da textura (mais rápido) Lazy texture caching Tip = Mais rápido mas pode causar problemas no texto em alguns jogos diff --git a/assets/lang/ro_RO.ini b/assets/lang/ro_RO.ini index bc30e4bed2..0b04bd5296 100644 --- a/assets/lang/ro_RO.ini +++ b/assets/lang/ro_RO.ini @@ -501,6 +501,7 @@ High = Înalt Hybrid = Hibrid Hybrid + Bicubic = Hibrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Rezoluție internă Lazy texture caching = Stocare de texturi leneșă (mărire viteză) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/ru_RU.ini b/assets/lang/ru_RU.ini index 790ee31ecb..a2364fc9de 100644 --- a/assets/lang/ru_RU.ini +++ b/assets/lang/ru_RU.ini @@ -501,6 +501,7 @@ High = Высокое Hybrid = Гибридный Hybrid + Bicubic = Гибридный + бикубический Ignore camera notch when centering = Игнорировать челку камеры при центрировании +Integer scale factor = Integer scale factor Internal Resolution = Внутренние разрешение Lazy texture caching = Ленивое кэширование текстур (быстрее) Lazy texture caching Tip = Быстрее, но может вызвать проблемы с текстом в некоторых играх diff --git a/assets/lang/sv_SE.ini b/assets/lang/sv_SE.ini index 9bc12b9f16..85d76ddf75 100644 --- a/assets/lang/sv_SE.ini +++ b/assets/lang/sv_SE.ini @@ -501,6 +501,7 @@ High = High Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignorera kamerahål vid centrering +Integer scale factor = Integer scale factor Internal Resolution = Intern upplösning Lazy texture caching = Lazy texture caching (speedup) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/tg_PH.ini b/assets/lang/tg_PH.ini index 207a5ad4bc..381f26eeab 100644 --- a/assets/lang/tg_PH.ini +++ b/assets/lang/tg_PH.ini @@ -500,6 +500,7 @@ High = Mataas Hybrid = Hybrid Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Resolusyong Internal Lazy texture caching = Lazy texture caching (pampa-bilis) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/th_TH.ini b/assets/lang/th_TH.ini index cd18ed6ba4..3a6f4d3a6f 100644 --- a/assets/lang/th_TH.ini +++ b/assets/lang/th_TH.ini @@ -500,6 +500,7 @@ High = สูง Hybrid = ไฮบริด Hybrid + Bicubic = ไฮบริด + ไบคิวบิค Ignore camera notch when centering = ละเว้นตำแหน่งจอแหว่งเพื่อปรับภาพให้อยู่ตรงกลาง +Integer scale factor = Integer scale factor Internal Resolution = ความละเอียดภายใน Lazy texture caching = แคชพื้นผิวแบบหยาบ (เร็วขึ้น) Lazy texture caching Tip = เร็วขึ้น แต่อาจจะทำให้ฟ้อนต์ตัวหนังสือไม่แสดงผลในบางเกม diff --git a/assets/lang/tr_TR.ini b/assets/lang/tr_TR.ini index c7d2ad7a90..f373785e9f 100644 --- a/assets/lang/tr_TR.ini +++ b/assets/lang/tr_TR.ini @@ -503,6 +503,7 @@ High = Yüksek Hybrid = Hibrit Hybrid + Bicubic = Hibrit + Bikübik Ignore camera notch when centering = Merkezleme sırasında kamera çentiğini yoksay +Integer scale factor = Integer scale factor Internal Resolution = İç çözünürlük Lazy texture caching = Yavaş doku önbellekleme (hızlandırır) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/uk_UA.ini b/assets/lang/uk_UA.ini index d4420858a0..85c93832bf 100644 --- a/assets/lang/uk_UA.ini +++ b/assets/lang/uk_UA.ini @@ -501,6 +501,7 @@ High = Висока Hybrid = Гібридний Hybrid + Bicubic = Гібридний + Бікубічний Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Внутрішнє розширення Lazy texture caching = Кешування текстур Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/vi_VN.ini b/assets/lang/vi_VN.ini index a4a89a1734..5ea70e2283 100644 --- a/assets/lang/vi_VN.ini +++ b/assets/lang/vi_VN.ini @@ -501,6 +501,7 @@ High = Cao Hybrid = Hybrid (hỗn hợp) Hybrid + Bicubic = Hybrid + Bicubic Ignore camera notch when centering = Ignore camera notch when centering +Integer scale factor = Integer scale factor Internal Resolution = Độ phân giải bên trong Lazy texture caching = Bộ nhớ đệm lazy texture (tăng tốc) Lazy texture caching Tip = Faster, but can cause text problems in a few games diff --git a/assets/lang/zh_CN.ini b/assets/lang/zh_CN.ini index 9816ad0076..6029e45d53 100644 --- a/assets/lang/zh_CN.ini +++ b/assets/lang/zh_CN.ini @@ -501,6 +501,7 @@ High = 高质量 Hybrid = 混合 Hybrid + Bicubic = 混合+双三次 Ignore camera notch when centering = 忽略摄像头挖孔 +Integer scale factor = Integer scale factor Internal Resolution = 内部分辨率 Lazy texture caching = 减少缓存存取(提速) Lazy texture caching Tip = 更快, 在一些游戏里引起文字渲染错误 diff --git a/assets/lang/zh_TW.ini b/assets/lang/zh_TW.ini index f91808f864..5e291af1d3 100644 --- a/assets/lang/zh_TW.ini +++ b/assets/lang/zh_TW.ini @@ -501,6 +501,7 @@ High = 高 Hybrid = 混合 Hybrid + Bicubic = 混合 + 雙立方 Ignore camera notch when centering = 置中時忽略相機凹口 +Integer scale factor = Integer scale factor Internal Resolution = 內部解析度 Lazy texture caching = 消極式紋理快取 (加速) Lazy texture caching Tip = 更快,但在某些遊戲中可能會造成文字問題 From d223d3c31648c9d576426c2f4a3a406749f34cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 2 Apr 2023 22:27:31 +0200 Subject: [PATCH 2/3] Rename CenterDisplayOutputRect to CalculateDisplayOutputRect --- Core/HLE/sceIo.cpp | 2 +- GPU/Common/FramebufferManagerCommon.cpp | 2 +- GPU/Common/GPUStateUtils.cpp | 2 +- GPU/Common/PresentationCommon.cpp | 6 +++--- GPU/Common/PresentationCommon.h | 2 +- UI/DisplayLayoutScreen.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 8b85bce7c5..0127c86271 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -2046,7 +2046,7 @@ static u32 sceIoDevctl(const char *name, int cmd, u32 argAddr, int argLen, u32 o return 0; case EMULATOR_DEVCTL__GET_ASPECT_RATIO: if (Memory::IsValidAddress(outPtr)) { - // TODO: Share code with CenterDisplayOutputRect to take a few more things into account. + // TODO: Share code with CalculateDisplayOutputRect to take a few more things into account. // I have a planned further refactoring. float ar; if (g_Config.bDisplayStretch) { diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index d5a81de09c..60a7fd5a63 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -1192,7 +1192,7 @@ void FramebufferManagerCommon::DrawPixels(VirtualFramebuffer *vfb, int dstX, int flags = flags | DRAWTEX_TO_BACKBUFFER; FRect frame = GetScreenFrame(pixelWidth_, pixelHeight_); FRect rc; - CenterDisplayOutputRect(&rc, 480.0f, 272.0f, frame, ROTATION_LOCKED_HORIZONTAL); + CalculateDisplayOutputRect(&rc, 480.0f, 272.0f, frame, ROTATION_LOCKED_HORIZONTAL); SetViewport2D(rc.x, rc.y, rc.w, rc.h); draw_->SetScissorRect(0, 0, pixelWidth_, pixelHeight_); } diff --git a/GPU/Common/GPUStateUtils.cpp b/GPU/Common/GPUStateUtils.cpp index d223283e3f..bf88169454 100644 --- a/GPU/Common/GPUStateUtils.cpp +++ b/GPU/Common/GPUStateUtils.cpp @@ -583,7 +583,7 @@ void ConvertViewportAndScissor(bool useBufferedRendering, float renderWidth, flo float pixelH = PSP_CoreParameter().pixelHeight; FRect frame = GetScreenFrame(pixelW, pixelH); FRect rc; - CenterDisplayOutputRect(&rc, 480, 272, frame, ROTATION_LOCKED_HORIZONTAL); + CalculateDisplayOutputRect(&rc, 480, 272, frame, ROTATION_LOCKED_HORIZONTAL); displayOffsetX = rc.x; displayOffsetY = rc.y; renderWidth = rc.w; diff --git a/GPU/Common/PresentationCommon.cpp b/GPU/Common/PresentationCommon.cpp index ac3cc52ba1..7ad8ee9db0 100644 --- a/GPU/Common/PresentationCommon.cpp +++ b/GPU/Common/PresentationCommon.cpp @@ -68,7 +68,7 @@ FRect GetScreenFrame(float pixelWidth, float pixelHeight) { return rc; } -void CenterDisplayOutputRect(FRect *rc, float origW, float origH, const FRect &frame, int rotation) { +void CalculateDisplayOutputRect(FRect *rc, float origW, float origH, const FRect &frame, int rotation) { float outW; float outH; @@ -368,7 +368,7 @@ bool PresentationCommon::BuildPostShader(const ShaderInfo * shaderInfo, const Sh // If the current shader uses output res (not next), we will use output res for it. FRect rc; FRect frame = GetScreenFrame((float)pixelWidth_, (float)pixelHeight_); - CenterDisplayOutputRect(&rc, 480.0f, 272.0f, frame, g_Config.iInternalScreenRotation); + CalculateDisplayOutputRect(&rc, 480.0f, 272.0f, frame, g_Config.iInternalScreenRotation); nextWidth = (int)rc.w; nextHeight = (int)rc.h; } @@ -644,7 +644,7 @@ void PresentationCommon::CopyToOutput(OutputFlags flags, int uvRotation, float u pixelWidth /= 2; } FRect rc; - CenterDisplayOutputRect(&rc, 480.0f, 272.0f, frame, uvRotation); + CalculateDisplayOutputRect(&rc, 480.0f, 272.0f, frame, uvRotation); if (GetGPUBackend() == GPUBackend::DIRECT3D9) { rc.x -= 0.5f; diff --git a/GPU/Common/PresentationCommon.h b/GPU/Common/PresentationCommon.h index 981c707b05..1bb4ff008a 100644 --- a/GPU/Common/PresentationCommon.h +++ b/GPU/Common/PresentationCommon.h @@ -48,7 +48,7 @@ struct FRect { }; FRect GetScreenFrame(float pixelWidth, float pixelHeight); -void CenterDisplayOutputRect(FRect *rc, float origW, float origH, const FRect &frame, int rotation); +void CalculateDisplayOutputRect(FRect *rc, float origW, float origH, const FRect &frame, int rotation); namespace Draw { class Buffer; diff --git a/UI/DisplayLayoutScreen.cpp b/UI/DisplayLayoutScreen.cpp index 0ed5ea43da..2f2c528286 100644 --- a/UI/DisplayLayoutScreen.cpp +++ b/UI/DisplayLayoutScreen.cpp @@ -134,7 +134,7 @@ void DisplayLayoutScreen::DrawBackground(UIContext &dc) { // TODO: Clean this up a bit, this GetScreenFrame/CenterDisplay combo is too common. FRect screenFrame = GetScreenFrame(g_display.pixel_xres, g_display.pixel_yres); FRect rc; - CenterDisplayOutputRect(&rc, 480.0f, 272.0f, screenFrame, g_Config.iInternalScreenRotation); + CalculateDisplayOutputRect(&rc, 480.0f, 272.0f, screenFrame, g_Config.iInternalScreenRotation); dc.Flush(); ImageID bg = ImageID("I_PSP_DISPLAY"); From c08c711006b80998763142234cfc98827d1ff6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 2 Apr 2023 22:35:51 +0200 Subject: [PATCH 3/3] Fix portrait mode integer scaling --- GPU/Common/PresentationCommon.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/GPU/Common/PresentationCommon.cpp b/GPU/Common/PresentationCommon.cpp index 7ad8ee9db0..4d2e2fa2d2 100644 --- a/GPU/Common/PresentationCommon.cpp +++ b/GPU/Common/PresentationCommon.cpp @@ -123,7 +123,11 @@ void CalculateDisplayOutputRect(FRect *rc, float origW, float origH, const FRect } if (g_Config.bDisplayIntegerScale) { - outW = std::max(1.0f, floorf(outW / 480.0f)) * 480.0f; + float wDim = 480.0f; + if (rotated) { + wDim = 272.0f; + } + outW = std::max(1.0f, floorf(outW / wDim)) * wDim; outH = outW / origRatio; }