Skip to content
Closed
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
3 changes: 3 additions & 0 deletions MarathonRecomp/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <kernel/function.h>
#include <os/process.h>
#include <os/logger.h>
#include <patches/player_patches.h>
#include <ui/game_window.h>
#include <user/config.h>
#include <user/paths.h>
Expand Down Expand Up @@ -87,6 +88,8 @@ PPC_FUNC(sub_825EA610)
// Allow variable FPS when config is not 60 FPS.
App::s_pApp->m_pDoc->m_VFrame = Config::FPS != 60;

PlayerPatches::Update();

__imp__sub_825EA610(ctx, base);
}

Expand Down
13 changes: 13 additions & 0 deletions MarathonRecomp/patches/player_patches.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "player_patches.h"
#include <api/Marathon.h>
#include <cpu/guest_stack_var.h>
#include <os/logger.h>
Expand Down Expand Up @@ -70,3 +71,15 @@ PPC_FUNC(sub_8220F330)

__imp__sub_8220F330(ctx, base);
}

void PlayerPatches::Update()
{
if (Config::AlwaysHave99Lives)
{
if (auto pGameMode = App::s_pApp->m_pDoc->GetDocMode<Sonicteam::GameMode>())
{
for (int i = 0; i < 4; i++)
pGameMode->m_pGameImp->m_PlayerData[i].LifeCount = 99;
}
}
}
7 changes: 7 additions & 0 deletions MarathonRecomp/patches/player_patches.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

class PlayerPatches
{
public:
static void Update();
};
1 change: 1 addition & 0 deletions MarathonRecomp/user/config_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ CONFIG_DEFINE_ENUM_LOCALISED("Video", ECSMTextureFiltering, CSMTextureFiltering,
CONFIG_DEFINE_ENUM_LOCALISED("Video", ECutsceneAspectRatio, CutsceneAspectRatio, ECutsceneAspectRatio::Original);
CONFIG_DEFINE_ENUM_LOCALISED("Video", EUIAlignmentMode, UIAlignmentMode, EUIAlignmentMode::Edge);

CONFIG_DEFINE_HIDDEN("Codes", bool, AlwaysHave99Lives, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDWMRoundedCorners, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, DisableTitleInputDelay, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, HUDToggleKey, false);
Expand Down
Loading