From 740e224bce0ca3b2cb97ce05b7d3dc1432d82e91 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:54:14 +0300 Subject: [PATCH] Fix PlayStation transition animation not rendering. --- UnleashedRecomp/patches/resident_patches.cpp | 8 +++++++- UnleashedRecompLib/config/SWA.toml | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UnleashedRecomp/patches/resident_patches.cpp b/UnleashedRecomp/patches/resident_patches.cpp index 592e0cb9..07ccd07e 100644 --- a/UnleashedRecomp/patches/resident_patches.cpp +++ b/UnleashedRecomp/patches/resident_patches.cpp @@ -17,7 +17,7 @@ PPC_FUNC(sub_824DCF38) if (Config::TimeOfDayTransition == ETimeOfDayTransition::PlayStation) { if (ctx.r4.u32 == SWA::eLoadingDisplayType_WerehogMovie) - ctx.r4.u32 = SWA::eLoadingDisplayType_Arrows; + ctx.r4.u32 = SWA::eLoadingDisplayType_ChangeTimeOfDay; } if (auto pGameDocument = SWA::CGameDocument::GetInstance()) @@ -36,6 +36,12 @@ PPC_FUNC(sub_824DCF38) __imp__sub_824DCF38(ctx, base); } +// The game checks for a bool to render the PS3 transition animation. It's never set so it's presumably a "is PS3" bool. +bool LoadingRenderMidAsmHook() +{ + return Config::TimeOfDayTransition == ETimeOfDayTransition::PlayStation; +} + // SWA::CLoading::Update PPC_FUNC_IMPL(__imp__sub_824DAB60); PPC_FUNC(sub_824DAB60) diff --git a/UnleashedRecompLib/config/SWA.toml b/UnleashedRecompLib/config/SWA.toml index e030ef1c..c5d71e07 100644 --- a/UnleashedRecompLib/config/SWA.toml +++ b/UnleashedRecompLib/config/SWA.toml @@ -802,3 +802,8 @@ registers = ["r3"] name = "ObjBigBarrelSetPositionMidAsmHook" address = 0x8271B5C8 registers = ["r3", "r4"] + +[[midasm_hook]] +name = "LoadingRenderMidAsmHook" +address = 0x824DB734 +jump_address_on_true = 0x824DB738