diff --git a/MarathonRecomp/api/Marathon.h b/MarathonRecomp/api/Marathon.h index b25d8d34d..cd825eb62 100644 --- a/MarathonRecomp/api/Marathon.h +++ b/MarathonRecomp/api/Marathon.h @@ -138,6 +138,7 @@ #include "Sonicteam/StdImageFilters/BurnoutBlurFilter.h" #include "Sonicteam/StdImageFilters/SingleTechniqueFilter.h" #include "Sonicteam/System/CreateStatic.h" +#include "Sonicteam/System/Diagnostics/Perfomance.h" #include "Sonicteam/System/Singleton.h" #include "Sonicteam/TextBook.h" #include "Sonicteam/TextBookMgr.h" diff --git a/MarathonRecomp/api/Sonicteam/System/Diagnostics/Perfomance.h b/MarathonRecomp/api/Sonicteam/System/Diagnostics/Perfomance.h new file mode 100644 index 000000000..9e5f2c031 --- /dev/null +++ b/MarathonRecomp/api/Sonicteam/System/Diagnostics/Perfomance.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#include + +namespace Sonicteam::System::Diagnostics +{ + class Perfomance : public Singleton> + { + public: + be m_LastFrequency; + }; +} diff --git a/MarathonRecomp/patches/fps_patches.cpp b/MarathonRecomp/patches/fps_patches.cpp index 85a6ce82a..cbb4d7552 100644 --- a/MarathonRecomp/patches/fps_patches.cpp +++ b/MarathonRecomp/patches/fps_patches.cpp @@ -1,5 +1,6 @@ #include #include +#include constexpr double REFERENCE_DELTA_TIME = 1.0 / 60.0; @@ -148,6 +149,26 @@ void PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime(PPCRegister& message, PPCReg deltaTime.f64 = pMessage->DeltaTime; } +void ParticleHFR_82670658(PPCRegister& f1,PPCRegister& stack) +{ + f1.f64 = App::s_deltaTime; +} + +void ParticleHFR_8266A418_1(PPCRegister& f31,PPCRegister& stack) +{ + f31.f64 = App::s_deltaTime; +} + +void ParticleHFR_82673F88(PPCRegister& f13,PPCRegister& stack) +{ + f13.f64 = App::s_deltaTime; +} + +void ParticleHFR_82674550(PPCRegister& f13,PPCRegister& stack) +{ + f13.f64 = App::s_deltaTime; +} + // Allocate more space to store the previous loading // time for this instance of Sonicteam::HUDLoading. void HUDLoadingAlloc(PPCRegister& r3) diff --git a/MarathonRecompLib/config/Marathon.toml b/MarathonRecompLib/config/Marathon.toml index beb75ac4b..4f5fcc89a 100644 --- a/MarathonRecompLib/config/Marathon.toml +++ b/MarathonRecompLib/config/Marathon.toml @@ -509,6 +509,36 @@ name = "PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime" address = 0x8219B660 registers = ["r28", "f31"] +# ParticleHFR_826454C8 +[[midasm_hook]] +name = "NOP" +address = 0x82645518 +jump_address = 0x8264551C + +[[midasm_hook]] +name = "ParticleHFR_82670658" +address = 0x82670724 +registers = ["f1", "r1"] +after_instruction = true + +[[midasm_hook]] +name = "ParticleHFR_8266A418_1" +address = 0x8266A57C +registers = ["f31", "r1"] +after_instruction = true + +[[midasm_hook]] +name = "ParticleHFR_82673F88" +address = 0x8267402C +registers = ["f13", "r1"] +after_instruction = true + +[[midasm_hook]] +name = "ParticleHFR_82674550" +address = 0x826747FC +registers = ["f13", "r1"] +after_instruction = true + [[midasm_hook]] name = "HUDLoadingAlloc" address = 0x824FAE14