diff --git a/MarathonRecomp/app.cpp b/MarathonRecomp/app.cpp index 272522297..63e86753f 100644 --- a/MarathonRecomp/app.cpp +++ b/MarathonRecomp/app.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -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); } diff --git a/MarathonRecomp/patches/player_patches.cpp b/MarathonRecomp/patches/player_patches.cpp index 493307f5f..7b132d088 100644 --- a/MarathonRecomp/patches/player_patches.cpp +++ b/MarathonRecomp/patches/player_patches.cpp @@ -1,3 +1,4 @@ +#include "player_patches.h" #include #include #include @@ -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()) + { + for (int i = 0; i < 4; i++) + pGameMode->m_pGameImp->m_PlayerData[i].LifeCount = 99; + } + } +} diff --git a/MarathonRecomp/patches/player_patches.h b/MarathonRecomp/patches/player_patches.h new file mode 100644 index 000000000..ee19e50d5 --- /dev/null +++ b/MarathonRecomp/patches/player_patches.h @@ -0,0 +1,7 @@ +#pragma once + +class PlayerPatches +{ +public: + static void Update(); +}; diff --git a/MarathonRecomp/user/config_def.h b/MarathonRecomp/user/config_def.h index f683e3468..0f57e2388 100644 --- a/MarathonRecomp/user/config_def.h +++ b/MarathonRecomp/user/config_def.h @@ -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);