From 8220f6772bdc728e23f0886601fd282063ca6f55 Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Sun, 9 Feb 2025 17:43:09 +0000 Subject: [PATCH] CHudPause_patches: fix achievements prompt appearing over PS3 loading --- UnleashedRecomp/api/SWA/System/ApplicationDocument.h | 4 +++- UnleashedRecomp/patches/CHudPause_patches.cpp | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UnleashedRecomp/api/SWA/System/ApplicationDocument.h b/UnleashedRecomp/api/SWA/System/ApplicationDocument.h index faf00b3..2194971 100644 --- a/UnleashedRecomp/api/SWA/System/ApplicationDocument.h +++ b/UnleashedRecomp/api/SWA/System/ApplicationDocument.h @@ -71,7 +71,8 @@ namespace SWA boost::shared_ptr m_spMatrixNodeRoot; SWA_INSERT_PADDING(0x14); CGammaController m_GammaController; - SWA_INSERT_PADDING(0x1C); + boost::shared_ptr m_spLoading; + SWA_INSERT_PADDING(0x14); boost::shared_ptr m_spAchievementManager; boost::shared_ptr m_spDatabaseTree; Hedgehog::Base::CSharedString m_Field10C; @@ -104,6 +105,7 @@ namespace SWA SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_Field74, 0x74); SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spMatrixNodeRoot, 0x84); SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_GammaController, 0xA0); + SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spLoading, 0xE0); SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spAchievementManager, 0xFC); SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spDatabaseTree, 0x104); SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_Field10C, 0x10C); diff --git a/UnleashedRecomp/patches/CHudPause_patches.cpp b/UnleashedRecomp/patches/CHudPause_patches.cpp index c04bd95..50e0d54 100644 --- a/UnleashedRecomp/patches/CHudPause_patches.cpp +++ b/UnleashedRecomp/patches/CHudPause_patches.cpp @@ -24,6 +24,9 @@ void CHudPauseAddOptionsItemMidAsmHook(PPCRegister& pThis) bool InjectMenuBehaviour(uint32_t pThis, uint32_t count) { + if (App::s_isLoading) + return true; + auto pHudPause = (SWA::CHudPause*)g_memory.Translate(pThis); auto cursorIndex = *(be*)g_memory.Translate(4 * (*(be*)g_memory.Translate(pThis + 0x19C) + 0x68) + pThis); @@ -116,6 +119,12 @@ bool CHudPauseMiscInjectOptionsMidAsmHook(PPCRegister& pThis) PPC_FUNC_IMPL(__imp__sub_824B0930); PPC_FUNC(sub_824B0930) { + if (App::s_isLoading) + { + __imp__sub_824B0930(ctx, base); + return; + } + auto pHudPause = (SWA::CHudPause*)g_memory.Translate(ctx.r3.u32); auto pInputState = SWA::CInputState::GetInstance();