From f75d61e6c7c2d2f099fb7e6707d8d245004138f5 Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:56:35 +0000 Subject: [PATCH] Fix Apotos entrance gate first time Chip hint appearing with hints disabled --- UnleashedRecomp/api/SWA.h | 1 + .../api/SWA/Message/MsgRequestHelp.h | 13 +++++++ UnleashedRecomp/patches/misc_patches.cpp | 35 +++++++++++++++---- UnleashedRecompLib/config/SWA.toml | 6 ++++ UnleashedRecompResources | 2 +- 5 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 UnleashedRecomp/api/SWA/Message/MsgRequestHelp.h diff --git a/UnleashedRecomp/api/SWA.h b/UnleashedRecomp/api/SWA.h index fecf2ad7..bf2f5ead 100644 --- a/UnleashedRecomp/api/SWA.h +++ b/UnleashedRecomp/api/SWA.h @@ -86,6 +86,7 @@ #include "SWA/Inspire/InspireTextureAnimationInfo.h" #include "SWA/Inspire/InspireTextureOverlay.h" #include "SWA/Inspire/InspireTextureOverlayInfo.h" +#include "SWA/Message/MsgRequestHelp.h" #include "SWA/Menu/MenuWindowBase.h" #include "SWA/Movie/MovieDisplayer.h" #include "SWA/Movie/MovieManager.h" diff --git a/UnleashedRecomp/api/SWA/Message/MsgRequestHelp.h b/UnleashedRecomp/api/SWA/Message/MsgRequestHelp.h new file mode 100644 index 00000000..3b8ed1ca --- /dev/null +++ b/UnleashedRecomp/api/SWA/Message/MsgRequestHelp.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace SWA::Message +{ + class MsgRequestHelp + { + public: + SWA_INSERT_PADDING(0x1C); + Hedgehog::Base::CSharedString m_Name; + }; +} diff --git a/UnleashedRecomp/patches/misc_patches.cpp b/UnleashedRecomp/patches/misc_patches.cpp index a3189746..12c754c4 100644 --- a/UnleashedRecomp/patches/misc_patches.cpp +++ b/UnleashedRecomp/patches/misc_patches.cpp @@ -109,18 +109,41 @@ PPC_FUNC(sub_82586698) __imp__sub_82586698(ctx, base); } -// Disable only certain hints coming from invisible hints +// SWA::CObjHint::MsgNotifyObjectEvent::Impl +// Disable only certain hints from hint volumes. +// This hook should be used to allow hint volumes specifically to also prevent them from affecting the player. PPC_FUNC_IMPL(__imp__sub_82736E80); PPC_FUNC(sub_82736E80) { // GroupID parameter text auto* groupId = (const char*)(base + PPC_LOAD_U32(ctx.r3.u32 + 0x100)); - // WhiteIsland_ACT1_001 (Windmill Isle Act 1 Night, Start) - // Your friend went off that way, Sonic. - // Quick, let's go after him! - if (!Config::Hints && strcmp(groupId, "WhiteIsland_ACT1_001") != 0) - return; + if (!Config::Hints) + { + // WhiteIsland_ACT1_001 (Windmill Isle Act 1 Night, Start) + // Your friend went off that way, Sonic. Quick, let's go after him! + if (strcmp(groupId, "WhiteIsland_ACT1_001") != 0) + return; + } __imp__sub_82736E80(ctx, base); } + +// SWA::CHelpWindow::MsgRequestHelp::Impl +// Disable only certain hints from other sequences. +// This hook should be used to block hint messages from unknown sources. +PPC_FUNC_IMPL(__imp__sub_824C1E60); +PPC_FUNC(sub_824C1E60) +{ + auto pMsgRequestHelp = (SWA::Message::MsgRequestHelp*)(base + ctx.r4.u32); + + if (!Config::Hints) + { + // s10d_mykETF_c_navi (Town Mykonos Entrance, First Entry) + // Looks like we can get to a bunch of places in the village from here! + if (strcmp(pMsgRequestHelp->m_Name.c_str(), "s10d_mykETF_c_navi") == 0) + return; + } + + __imp__sub_824C1E60(ctx, base); +} diff --git a/UnleashedRecompLib/config/SWA.toml b/UnleashedRecompLib/config/SWA.toml index c31327af..901688c3 100644 --- a/UnleashedRecompLib/config/SWA.toml +++ b/UnleashedRecompLib/config/SWA.toml @@ -112,6 +112,12 @@ name = "DisableHintsMidAsmHook" address = 0x827A2E34 jump_address_on_true = 0x827A2E4C +# Disable Tornado Defense hints +[[midasm_hook]] +name = "DisableHintsMidAsmHook" +address = 0x82AF52BC +jump_address_on_true = 0x82AF52E4 + # Disable Egg Dragoon hint "V_WHG_083" ("That lit-up part on the bottom looks fishy. I'll try aiming for that.") [[midasm_hook]] name = "DisableHintsMidAsmHook" diff --git a/UnleashedRecompResources b/UnleashedRecompResources index 89c82c0a..1375ed71 160000 --- a/UnleashedRecompResources +++ b/UnleashedRecompResources @@ -1 +1 @@ -Subproject commit 89c82c0aa820d3e3b6a1599faccfca8a4697a33c +Subproject commit 1375ed71841dd391be609f9380ec456f2679463b