Skip to content

Commit c0dd704

Browse files
ReimousTHReimousTHIsaacMarovitz
authored
Fix Particle Framerate for HFR (#160)
* Initial * Particle HFR * Update Marathon.toml --------- Co-authored-by: ReimousTH <[email protected]> Co-authored-by: Isaac Marovitz <[email protected]>
1 parent e979917 commit c0dd704

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

MarathonRecomp/api/Marathon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
#include "Sonicteam/StdImageFilters/BurnoutBlurFilter.h"
139139
#include "Sonicteam/StdImageFilters/SingleTechniqueFilter.h"
140140
#include "Sonicteam/System/CreateStatic.h"
141+
#include "Sonicteam/System/Diagnostics/Perfomance.h"
141142
#include "Sonicteam/System/Singleton.h"
142143
#include "Sonicteam/TextBook.h"
143144
#include "Sonicteam/TextBookMgr.h"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#include <Sonicteam/System/Singleton.h>
4+
#include <Sonicteam/System/CreateStatic.h>
5+
6+
namespace Sonicteam::System::Diagnostics
7+
{
8+
class Perfomance : public Singleton<Perfomance, 0x82D3B210, CreateStatic<Perfomance, 0x82581C88>>
9+
{
10+
public:
11+
be<uint64_t> m_LastFrequency;
12+
};
13+
}

MarathonRecomp/patches/fps_patches.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <api/Marathon.h>
22
#include <user/config.h>
3+
#include <app.h>
34

45
constexpr double REFERENCE_DELTA_TIME = 1.0 / 60.0;
56

@@ -148,6 +149,26 @@ void PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime(PPCRegister& message, PPCReg
148149
deltaTime.f64 = pMessage->DeltaTime;
149150
}
150151

152+
void ParticleHFR_82670658(PPCRegister& f1,PPCRegister& stack)
153+
{
154+
f1.f64 = App::s_deltaTime;
155+
}
156+
157+
void ParticleHFR_8266A418_1(PPCRegister& f31,PPCRegister& stack)
158+
{
159+
f31.f64 = App::s_deltaTime;
160+
}
161+
162+
void ParticleHFR_82673F88(PPCRegister& f13,PPCRegister& stack)
163+
{
164+
f13.f64 = App::s_deltaTime;
165+
}
166+
167+
void ParticleHFR_82674550(PPCRegister& f13,PPCRegister& stack)
168+
{
169+
f13.f64 = App::s_deltaTime;
170+
}
171+
151172
// Allocate more space to store the previous loading
152173
// time for this instance of Sonicteam::HUDLoading.
153174
void HUDLoadingAlloc(PPCRegister& r3)

MarathonRecompLib/config/Marathon.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,36 @@ name = "PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime"
509509
address = 0x8219B660
510510
registers = ["r28", "f31"]
511511

512+
# ParticleHFR_826454C8
513+
[[midasm_hook]]
514+
name = "NOP"
515+
address = 0x82645518
516+
jump_address = 0x8264551C
517+
518+
[[midasm_hook]]
519+
name = "ParticleHFR_82670658"
520+
address = 0x82670724
521+
registers = ["f1", "r1"]
522+
after_instruction = true
523+
524+
[[midasm_hook]]
525+
name = "ParticleHFR_8266A418_1"
526+
address = 0x8266A57C
527+
registers = ["f31", "r1"]
528+
after_instruction = true
529+
530+
[[midasm_hook]]
531+
name = "ParticleHFR_82673F88"
532+
address = 0x8267402C
533+
registers = ["f13", "r1"]
534+
after_instruction = true
535+
536+
[[midasm_hook]]
537+
name = "ParticleHFR_82674550"
538+
address = 0x826747FC
539+
registers = ["f13", "r1"]
540+
after_instruction = true
541+
512542
[[midasm_hook]]
513543
name = "HUDLoadingAlloc"
514544
address = 0x824FAE14

0 commit comments

Comments
 (0)