From f4952a4d827c4b4cca85e06a549f0e7cccb0f382 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:38:02 +0300 Subject: [PATCH] Fix post process scaling for narrow aspect ratios. --- UnleashedRecomp/gpu/video.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index a4a65852..c19372c1 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -5093,19 +5093,16 @@ void PostProcessResolutionFix(PPCRegister& r4, PPCRegister& f1, PPCRegister& f2) { auto device = reinterpret_cast*>(g_memory.Translate(r4.u32)); + // TODO: Scale only by height in world map, as VERT+ adjustment does not get applied there. uint32_t width = device[46].get(); uint32_t height = device[47].get(); + double aspectRatio = double(width) / double(height); -#if 0 - // TODO: Figure out why this breaks for height > weight double factor; - if (width > height) + if (aspectRatio >= WIDE_ASPECT_RATIO) factor = 720.0 / double(height); else factor = 1280.0 / double(width); -#else - double factor = 720.0 / double(height); -#endif f1.f64 *= factor; f2.f64 *= factor;