Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MarathonRecomp/api/Marathon.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "Sonicteam/HUDMainDisplay.h"
#include "Sonicteam/HUDMainMenu.h"
#include "Sonicteam/HUDMessageWindow.h"
#include "Sonicteam/HUDPause.h"
#include "Sonicteam/HUDPopupScreen.h"
#include "Sonicteam/HUDRaderMap.h"
#include "Sonicteam/HUDStageTitle.h"
Expand All @@ -70,6 +71,7 @@
#include "Sonicteam/NoSyncThread.h"
#include "Sonicteam/ObjectVehicle.h"
#include "Sonicteam/ObjectVehicleBike.h"
#include "Sonicteam/PauseTask.h"
#include "Sonicteam/Player/GroundRayListener.h"
#include "Sonicteam/Player/ICollisionListener.h"
#include "Sonicteam/Player/ICollisionListenerTemplate.h"
Expand Down
18 changes: 18 additions & 0 deletions MarathonRecomp/api/Sonicteam/HUDPause.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

#include <Marathon.inl>
#include <Sonicteam/SoX/Engine/Task.h>

namespace Sonicteam
{
class HUDPause : public SoX::RefCountObject, public SoX::Engine::Task
{
public:
xpointer<CsdObject> m_pCsdObject;
MARATHON_INSERT_PADDING(0xA0);
be<float> m_TextPriority;
MARATHON_INSERT_PADDING(0x40);
xpointer<HudTextParts> m_pHudTextRoot;
bool m_ShowMissionWindow;
};
}
13 changes: 13 additions & 0 deletions MarathonRecomp/api/Sonicteam/PauseTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

#include <Marathon.inl>

namespace Sonicteam
{
class PauseTask : public SoX::Engine::Task
{
public:
MARATHON_INSERT_PADDING(0x230);
xpointer<TextEntity> m_pMissionText;
};
}
15 changes: 13 additions & 2 deletions MarathonRecomp/patches/aspect_ratio_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,7 @@ PPC_FUNC_IMPL(__imp__sub_824E11D0);
PPC_FUNC(sub_824E11D0)
{
auto pHUDMainMenu = (Sonicteam::HUDMainMenu*)(base + ctx.r3.u32);
auto pHudTextRoot = pHUDMainMenu->m_pHudTextRoot->m_pNext;
auto pHudTextRoot = pHUDMainMenu->m_pHudTextRoot;

static bool s_preservedTextPositions{};
static float s_multiplayerTextOffsetX{};
Expand Down Expand Up @@ -1708,6 +1708,17 @@ PPC_FUNC(sub_824DCF40)
__imp__sub_824DCF40(ctx, base);
}

// Sonicteam::PauseTask::Update
PPC_FUNC_IMPL(__imp__sub_82509870);
PPC_FUNC(sub_82509870)
{
auto pPauseTask = (Sonicteam::PauseTask*)(base + ctx.r3.u32);

SetTextEntityModifier(pPauseTask->m_pMissionText.get(), CSD_ALIGN_BOTTOM | CSD_SCALE);

__imp__sub_82509870(ctx, base);
}

// Sonicteam::HintWindowTask::Update
PPC_FUNC_IMPL(__imp__sub_824D12F0);
PPC_FUNC(sub_824D12F0)
Expand Down Expand Up @@ -1982,7 +1993,7 @@ const xxHashMap<CsdModifier> g_csdModifiers =
// pausemenu
{ HashStr("sprite/pausemenu/pausemenu/pause_menu"), { CSD_SCALE } },
{ HashStr("sprite/pausemenu/pausemenu/pause_menu_cursor"), { CSD_SCALE } },
{ HashStr("sprite/pausemenu/pausemenu/mission"), { CSD_SCALE } },
{ HashStr("sprite/pausemenu/pausemenu/mission"), { CSD_ALIGN_BOTTOM | CSD_SCALE } },

// radarmap_cover
{ HashStr("sprite/radarmap_cover/radarmap_cover/Scene_0000"), { CSD_RADARMAP | CSD_ALIGN_TOP_RIGHT | CSD_SCALE } },
Expand Down
18 changes: 18 additions & 0 deletions MarathonRecomp/patches/misc_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,22 @@ PPC_FUNC(sub_824A6EA8)
__imp__sub_824A6EA8(ctx, base);
}

// Sonicteam::HUDPause::ProcessMessage
PPC_FUNC_IMPL(__imp__sub_824EF788);
PPC_FUNC(sub_824EF788)
{
if (Config::RestorePauseMissionText)
reinterpret_cast<Sonicteam::HUDPause*>(base + ctx.r3.u32)->m_ShowMissionWindow = true;

__imp__sub_824EF788(ctx, base);
}

// The mission text is drawn at a lower priority
// than the mission box by default. 1001.0f is the
// priority value used by the rest of the pause menu.
void PauseTask_SetMissionTextPriority(PPCRegister& priority)
{
priority.f64 = 1001.0f;
}

void NOP() {}
1 change: 1 addition & 0 deletions MarathonRecomp/user/config_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreChaosBoostJump, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreChainJumpFlips, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreDemoCameraMode, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, RestoreSonicActionGauge, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, RestorePauseMissionText, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, TailsGauge, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, EnableDebugMode, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, MidairControlForMachSpeed, false);
Expand Down
5 changes: 5 additions & 0 deletions MarathonRecompLib/config/Marathon.toml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ name = "SonicGaugeRestorationGaugeFlagFix"
address = 0x822196EC
registers = ["r3","r31"]

[[midasm_hook]]
name = "PauseTask_SetMissionTextPriority"
address = 0x82509AEC
registers = ["f1"]

[[midasm_hook]]
name = "SonicGaugeRestorationGaugeGemSpriteResetFix"
address = 0x82185768
Expand Down
Loading