Skip to content

Commit 12bc0b4

Browse files
committed
1 parent 66ee094 commit 12bc0b4

File tree

4 files changed

+29
-16
lines changed

4 files changed

+29
-16
lines changed

MarathonRecomp/api/Marathon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "Sonicteam/GameMode.h"
3030
#include "Sonicteam/HUDCALLBACK.h"
3131
#include "Sonicteam/HUDLoading.h"
32+
#include "Sonicteam/HUDPause.h"
3233
#include "Sonicteam/ImageFilter.h"
3334
#include "Sonicteam/MovieObject.h"
3435
#include "Sonicteam/MovieObjectWmv.h"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
5+
namespace Sonicteam
6+
{
7+
class HUDPause : public SoX::Engine::Task
8+
{
9+
public:
10+
MARATHON_INSERT_PADDING(0xAC);
11+
be<float> m_TextPriority;
12+
MARATHON_INSERT_PADDING(0x44);
13+
bool m_ShowMissionWindow;
14+
};
15+
}

MarathonRecomp/patches/misc_patches.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,20 @@ PPC_FUNC(sub_824A6EA8)
114114
__imp__sub_824A6EA8(ctx, base);
115115
}
116116

117-
bool RestorePauseMissionText()
117+
// Sonicteam::HUDPause::ProcessMessage
118+
PPC_FUNC_IMPL(__imp__sub_824EF788);
119+
PPC_FUNC(sub_824EF788)
118120
{
119-
return Config::RestorePauseMissionText;
121+
if (Config::RestorePauseMissionText)
122+
reinterpret_cast<Sonicteam::HUDPause*>(base + ctx.r3.u32)->m_ShowMissionWindow = true;
123+
124+
__imp__sub_824EF788(ctx, base);
120125
}
121126

122-
void RestorePauseMissionText2(PPCRegister& f1)
127+
// The mission text is drawn at a lower priority
128+
// than the mission box by default. 1001.0f is the
129+
// priority value used by the rest of the pause menu.
130+
void PauseTask_SetMissionTextPriority(PPCRegister& priority)
123131
{
124-
if (Config::RestorePauseMissionText)
125-
f1.f64 = 0x15FC;
132+
priority.f64 = 1001.0f;
126133
}

MarathonRecompLib/config/Marathon.toml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,6 @@ registers = ["r31"]
254254
jump_address_on_true = 0x82512C9C
255255

256256
[[midasm_hook]]
257-
name = "RestorePauseMissionText"
258-
address = 0x824F0018
259-
jump_address_on_true = 0x824F001C
260-
261-
[[midasm_hook]]
262-
name = "RestorePauseMissionText"
263-
address = 0x824F02A0
264-
jump_address_on_true = 0x824F02A4
265-
266-
[[midasm_hook]]
267-
name = "RestorePauseMissionText2"
257+
name = "PauseTask_SetMissionTextPriority"
268258
address = 0x82509AEC
269259
registers = ["f1"]

0 commit comments

Comments
 (0)