From 617f52d2ed4f1dd3ced0207f8bd73d9ab14b1dde Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Sun, 12 Jan 2025 16:50:05 +0300 Subject: [PATCH] Add cutscene aspect ratio option. --- UnleashedRecomp/locale/config_locale.cpp | 16 ++++++++++++++++ UnleashedRecomp/patches/aspect_ratio_patches.cpp | 2 +- UnleashedRecomp/ui/options_menu.cpp | 1 + UnleashedRecomp/user/config.h | 13 +++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/UnleashedRecomp/locale/config_locale.cpp b/UnleashedRecomp/locale/config_locale.cpp index cb823eb3..ff08e571 100644 --- a/UnleashedRecomp/locale/config_locale.cpp +++ b/UnleashedRecomp/locale/config_locale.cpp @@ -294,6 +294,22 @@ CONFIG_DEFINE_LOCALE(XboxColorCorrection) { ELanguage::English, { "Xbox Color Correction", "Use the warm tint from the Xbox version of the game." } } }; +CONFIG_DEFINE_LOCALE(CutsceneAspectRatio) +{ + { ELanguage::English, { "Cutscene Aspect Ratio", "" } } +}; + +CONFIG_DEFINE_ENUM_LOCALE(ECutsceneAspectRatio) +{ + { + ELanguage::English, + { + { ECutsceneAspectRatio::Original, { "ORIGINAL", "" } }, + { ECutsceneAspectRatio::Unlocked, { "UNLOCKED", "" } }, + } + } +}; + CONFIG_DEFINE_LOCALE(UIScaleMode) { { ELanguage::English, { "UI Scale Mode", "Change how the UI scales to the display." } } diff --git a/UnleashedRecomp/patches/aspect_ratio_patches.cpp b/UnleashedRecomp/patches/aspect_ratio_patches.cpp index 65213f08..2e3cf000 100644 --- a/UnleashedRecomp/patches/aspect_ratio_patches.cpp +++ b/UnleashedRecomp/patches/aspect_ratio_patches.cpp @@ -1050,7 +1050,7 @@ void ViewRingXMidAsmHook(PPCRegister& f1, PPCVRegister& v62) PPC_FUNC_IMPL(__imp__sub_82B8AA40); PPC_FUNC(sub_82B8AA40) { - bool shouldDrawLetterbox = g_aspectRatio < WIDE_ASPECT_RATIO; + bool shouldDrawLetterbox = Config::CutsceneAspectRatio != ECutsceneAspectRatio::Unlocked && g_aspectRatio < WIDE_ASPECT_RATIO; PPC_STORE_U8(ctx.r3.u32, shouldDrawLetterbox); if (shouldDrawLetterbox) diff --git a/UnleashedRecomp/ui/options_menu.cpp b/UnleashedRecomp/ui/options_menu.cpp index c1727b31..793d0c48 100644 --- a/UnleashedRecomp/ui/options_menu.cpp +++ b/UnleashedRecomp/ui/options_menu.cpp @@ -917,6 +917,7 @@ static void DrawConfigOptions() DrawConfigOption(rowCount++, yOffset, &Config::GITextureFiltering, true); DrawConfigOption(rowCount++, yOffset, &Config::MotionBlur, true); DrawConfigOption(rowCount++, yOffset, &Config::XboxColorCorrection, true); + DrawConfigOption(rowCount++, yOffset, &Config::CutsceneAspectRatio, true); DrawConfigOption(rowCount++, yOffset, &Config::UIScaleMode, true); break; diff --git a/UnleashedRecomp/user/config.h b/UnleashedRecomp/user/config.h index 9c8c7ded..0a9a2033 100644 --- a/UnleashedRecomp/user/config.h +++ b/UnleashedRecomp/user/config.h @@ -258,6 +258,18 @@ CONFIG_DEFINE_ENUM_TEMPLATE(EMotionBlur) { "Enhanced", EMotionBlur::Enhanced } }; +enum class ECutsceneAspectRatio : uint32_t +{ + Original, + Unlocked +}; + +CONFIG_DEFINE_ENUM_TEMPLATE(ECutsceneAspectRatio) +{ + { "Original", ECutsceneAspectRatio::Original }, + { "Unlocked", ECutsceneAspectRatio::Unlocked } +}; + enum class EUIScaleMode : uint32_t { Edge, @@ -661,6 +673,7 @@ public: CONFIG_DEFINE_ENUM("Video", EDepthOfFieldQuality, DepthOfFieldQuality, EDepthOfFieldQuality::Auto); CONFIG_DEFINE_ENUM_LOCALISED("Video", EMotionBlur, MotionBlur, EMotionBlur::Original); CONFIG_DEFINE_LOCALISED("Video", bool, XboxColorCorrection, false); + CONFIG_DEFINE_ENUM_LOCALISED("Video", ECutsceneAspectRatio, CutsceneAspectRatio, ECutsceneAspectRatio::Original); CONFIG_DEFINE_ENUM_LOCALISED("Video", EUIScaleMode, UIScaleMode, EUIScaleMode::Edge); CONFIG_DEFINE_HIDDEN("Exports", bool, AllowCancellingUnleash, false);