diff --git a/UnleashedRecomp/game.cpp b/UnleashedRecomp/game.cpp index b605763..88f600c 100644 --- a/UnleashedRecomp/game.cpp +++ b/UnleashedRecomp/game.cpp @@ -25,9 +25,15 @@ bool CameraAspectRatioMidAsmHook(PPCRegister& r31) auto pCamera = (SWA::CCamera*)g_memory.Translate(r31.u32); auto newAspectRatio = (float)Window::s_width / (float)Window::s_height; - // Dynamically adjust aspect ratio to window dimensions. + // Dynamically adjust horizontal aspect ratio to window dimensions. pCamera->m_HorzAspectRatio = newAspectRatio; + if (auto s_pVertAspectRatio = (be*)g_memory.Translate(0x82028FE0)) + { + // Dynamically adjust vertical aspect ratio for VERT+. + *s_pVertAspectRatio = 2.0f * atan(tan(45.0f / 2.0f) * (m_baseAspectRatio / newAspectRatio)); + } + // Jump to 4:3 code for VERT+ adjustments if using a narrow aspect ratio. return newAspectRatio < m_baseAspectRatio; } @@ -43,7 +49,7 @@ void CameraBoostAspectRatioMidAsmHook(PPCRegister& r31, PPCRegister& f0) } else { - // Use vertical FOV for normal aspect ratios. + // Use vertical FOV for wide aspect ratios. f0.f32 = pCamera->m_VertFieldOfView; } }