From 832c838bf68153fbeb18f7c0835b2c95fcd56bb2 Mon Sep 17 00:00:00 2001 From: ReimousTH Date: Thu, 11 Sep 2025 17:25:46 +0300 Subject: [PATCH 1/3] Initial --- MarathonRecomp/patches/fps_patches.cpp | 18 ++++++++++++++++++ MarathonRecompLib/config/Marathon.toml | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/MarathonRecomp/patches/fps_patches.cpp b/MarathonRecomp/patches/fps_patches.cpp index bab1067bd..56d4f12a1 100644 --- a/MarathonRecomp/patches/fps_patches.cpp +++ b/MarathonRecomp/patches/fps_patches.cpp @@ -1,5 +1,7 @@ #include #include +#include + // Sonicteam::SoX::Physics::Havok::WorldHavok::Update PPC_FUNC_IMPL(__imp__sub_82587AA8); @@ -120,4 +122,20 @@ void PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime(PPCRegister& message, PPCReg auto pMessage = (MsgSuckPlayerEx*)g_memory.Translate(message.u32); deltaTime.f64 = pMessage->DeltaTime; + +//not need anything here +void ParticleHFR_826454C8(PPCRegister& f31) +{ + +} + +void ParticleHFR_82670658(PPCRegister& f1,PPCRegister& stack) +{ + auto delta = ((be*)(g_memory.Translate(stack.u32 + 0x1A0 - 0x48 - 8)))->get(); + f1.f64 = App::s_deltaTime; //find delta normally, someday +} + +void ParticleHFR_8266A418_1(PPCRegister& f31,PPCRegister& stack) +{ + f31.f64 = App::s_deltaTime; //find delta normally, someday } diff --git a/MarathonRecompLib/config/Marathon.toml b/MarathonRecompLib/config/Marathon.toml index 6bb891b7d..7c7288b22 100644 --- a/MarathonRecompLib/config/Marathon.toml +++ b/MarathonRecompLib/config/Marathon.toml @@ -508,3 +508,21 @@ registers = ["r28", "f1"] name = "PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime" address = 0x8219B660 registers = ["r28", "f31"] + +[[midasm_hook]] +name = "ParticleHFR_826454C8" +address = 0x82645518 +registers = ["f31"] +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 From 6f284932e171aacb308f14209b6351f7e7c38d02 Mon Sep 17 00:00:00 2001 From: ReimousTH Date: Mon, 15 Sep 2025 12:04:04 +0300 Subject: [PATCH 2/3] Particle HFR --- MarathonRecomp/api/Marathon.h | 1 + .../Sonicteam/System/Diagnostics/Perfomance.h | 13 +++++++++++ MarathonRecomp/patches/fps_patches.cpp | 19 +++++++++------- MarathonRecompLib/config/Marathon.toml | 22 ++++++++++++++----- 4 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 MarathonRecomp/api/Sonicteam/System/Diagnostics/Perfomance.h diff --git a/MarathonRecomp/api/Marathon.h b/MarathonRecomp/api/Marathon.h index a6969c222..8b0bb7831 100644 --- a/MarathonRecomp/api/Marathon.h +++ b/MarathonRecomp/api/Marathon.h @@ -136,6 +136,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 56d4f12a1..eddbf251f 100644 --- a/MarathonRecomp/patches/fps_patches.cpp +++ b/MarathonRecomp/patches/fps_patches.cpp @@ -2,7 +2,6 @@ #include #include - // Sonicteam::SoX::Physics::Havok::WorldHavok::Update PPC_FUNC_IMPL(__imp__sub_82587AA8); PPC_FUNC(sub_82587AA8) @@ -122,20 +121,24 @@ void PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime(PPCRegister& message, PPCReg auto pMessage = (MsgSuckPlayerEx*)g_memory.Translate(message.u32); deltaTime.f64 = pMessage->DeltaTime; +} -//not need anything here -void ParticleHFR_826454C8(PPCRegister& f31) +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_82670658(PPCRegister& f1,PPCRegister& stack) +void ParticleHFR_82673F88(PPCRegister& f13,PPCRegister& stack) { - auto delta = ((be*)(g_memory.Translate(stack.u32 + 0x1A0 - 0x48 - 8)))->get(); - f1.f64 = App::s_deltaTime; //find delta normally, someday + f13.f64 = App::s_deltaTime; } -void ParticleHFR_8266A418_1(PPCRegister& f31,PPCRegister& stack) +void ParticleHFR_82674550(PPCRegister& f13,PPCRegister& stack) { - f31.f64 = App::s_deltaTime; //find delta normally, someday + f13.f64 = App::s_deltaTime; } diff --git a/MarathonRecompLib/config/Marathon.toml b/MarathonRecompLib/config/Marathon.toml index 7c7288b22..070da1ce0 100644 --- a/MarathonRecompLib/config/Marathon.toml +++ b/MarathonRecompLib/config/Marathon.toml @@ -509,20 +509,32 @@ name = "PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime" address = 0x8219B660 registers = ["r28", "f31"] +#ParticleHFR_826454C8 [[midasm_hook]] -name = "ParticleHFR_826454C8" -address = 0x82645518 -registers = ["f31"] +name = "NOP" +address = 0x82645518 jump_address = 0x8264551C [[midasm_hook]] name = "ParticleHFR_82670658" address = 0x82670724 -registers = ["f1","r1"] +registers = ["f1", "r1"] after_instruction = true [[midasm_hook]] name = "ParticleHFR_8266A418_1" address = 0x8266A57C -registers = ["f31","r1"] +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 From 03003a2e453922981db3b21403c1a2f42f458da9 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> Date: Thu, 18 Sep 2025 11:56:48 -0400 Subject: [PATCH 3/3] Update Marathon.toml --- MarathonRecompLib/config/Marathon.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MarathonRecompLib/config/Marathon.toml b/MarathonRecompLib/config/Marathon.toml index b76088bea..4f5fcc89a 100644 --- a/MarathonRecompLib/config/Marathon.toml +++ b/MarathonRecompLib/config/Marathon.toml @@ -509,8 +509,7 @@ name = "PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime" address = 0x8219B660 registers = ["r28", "f31"] -#ParticleHFR_826454C8 - +# ParticleHFR_826454C8 [[midasm_hook]] name = "NOP" address = 0x82645518