Skip to content

Commit 5f43c07

Browse files
committed
RestorePauseMissionText
Signed-off-by: Isaac Marovitz <[email protected]>
1 parent c0dd704 commit 5f43c07

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

MarathonRecomp/api/Marathon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "Sonicteam/HUDCALLBACK.h"
3737
#include "Sonicteam/HUDLimitTime.h"
3838
#include "Sonicteam/HUDLoading.h"
39+
#include "Sonicteam/HUDPause.h"
3940
#include "Sonicteam/HUDMainDisplay.h"
4041
#include "Sonicteam/HUDMainMenu.h"
4142
#include "Sonicteam/HUDMessageWindow.h"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/SoX/Engine/Task.h>
5+
6+
namespace Sonicteam
7+
{
8+
class HUDPause : public SoX::Engine::Task
9+
{
10+
public:
11+
MARATHON_INSERT_PADDING(0xAC);
12+
be<float> m_TextPriority;
13+
MARATHON_INSERT_PADDING(0x44);
14+
bool m_ShowMissionWindow;
15+
};
16+
}

MarathonRecomp/patches/misc_patches.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,22 @@ PPC_FUNC(sub_824A6EA8)
117117
__imp__sub_824A6EA8(ctx, base);
118118
}
119119

120+
// Sonicteam::HUDPause::ProcessMessage
121+
PPC_FUNC_IMPL(__imp__sub_824EF788);
122+
PPC_FUNC(sub_824EF788)
123+
{
124+
if (Config::RestorePauseMissionText)
125+
reinterpret_cast<Sonicteam::HUDPause*>(base + ctx.r3.u32)->m_ShowMissionWindow = true;
126+
127+
__imp__sub_824EF788(ctx, base);
128+
}
129+
130+
// The mission text is drawn at a lower priority
131+
// than the mission box by default. 1001.0f is the
132+
// priority value used by the rest of the pause menu.
133+
void PauseTask_SetMissionTextPriority(PPCRegister& priority)
134+
{
135+
priority.f64 = 1001.0f;
136+
}
137+
120138
void NOP() {}

MarathonRecomp/user/config_def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreContextualHUDColours, false);
8787
CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreChaosSpearFlips, false);
8888
CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreChaosBoostJump, false);
8989
CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreChainJumpFlips, false);
90+
CONFIG_DEFINE_HIDDEN("Codes", bool, RestorePauseMissionText, false);
9091
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableEdgeGrabLeftover, false);
9192
CONFIG_DEFINE_HIDDEN("Codes", bool, TailsGauge, false);
9293
CONFIG_DEFINE_HIDDEN("Codes", bool, PlayerDebugMode, false);

MarathonRecompLib/config/Marathon.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,3 +568,8 @@ registers = ["f31", "f1"]
568568
name = "HUDWindow_Callback"
569569
address = 0x824FA088
570570
registers = ["f1", "f31"]
571+
572+
[[midasm_hook]]
573+
name = "PauseTask_SetMissionTextPriority"
574+
address = 0x82509AEC
575+
registers = ["f1"]

0 commit comments

Comments
 (0)