diff --git a/UnleashedRecomp/patches/camera_patches.cpp b/UnleashedRecomp/patches/camera_patches.cpp index d158cb8e..00061f0e 100644 --- a/UnleashedRecomp/patches/camera_patches.cpp +++ b/UnleashedRecomp/patches/camera_patches.cpp @@ -23,20 +23,20 @@ bool CameraAspectRatioMidAsmHook(PPCRegister& r31) return newAspectRatio < m_baseAspectRatio; } -void CameraBoostAspectRatioMidAsmHook(PPCRegister& r31, PPCRegister& f0) +bool CameraBoostAspectRatioMidAsmHook(PPCRegister& r31, PPCRegister& f0, PPCRegister& f10, PPCRegister& f12) { auto pCamera = (SWA::CCamera*)g_memory.Translate(r31.u32); if (Window::s_width < Window::s_height) { - // Use horizontal FOV for narrow aspect ratios. - f0.f32 = pCamera->m_HorzFieldOfView; + pCamera->m_VertFieldOfView = pCamera->m_HorzFieldOfView + f10.f64; } else { - // Use vertical FOV for wide aspect ratios. - f0.f32 = pCamera->m_VertFieldOfView; + pCamera->m_VertFieldOfView = (f12.f64 / f0.f64) + f10.f64; } + + return true; } PPC_FUNC_IMPL(__imp__sub_824697B0); diff --git a/UnleashedRecompLib/config/SWA.toml b/UnleashedRecompLib/config/SWA.toml index de15070e..85da167a 100644 --- a/UnleashedRecompLib/config/SWA.toml +++ b/UnleashedRecompLib/config/SWA.toml @@ -98,8 +98,9 @@ jump_address_on_false = 0x82468EE0 [[midasm_hook]] name = "CameraBoostAspectRatioMidAsmHook" -address = 0x8246BDA8 -registers = ["r31", "f0"] +address = 0x8246BDA0 +registers = ["r31", "f0", "f10", "f12"] +jump_address_on_true = 0x8246BDAC [[midasm_hook]] name = "CSDAspectRatioMidAsmHook"