Skip to content

Commit 6f28493

Browse files
author
ReimousTH
committed
Particle HFR
1 parent 832c838 commit 6f28493

4 files changed

Lines changed: 42 additions & 13 deletions

File tree

MarathonRecomp/api/Marathon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
#include "Sonicteam/StdImageFilters/BurnoutBlurFilter.h"
137137
#include "Sonicteam/StdImageFilters/SingleTechniqueFilter.h"
138138
#include "Sonicteam/System/CreateStatic.h"
139+
#include "Sonicteam/System/Diagnostics/Perfomance.h"
139140
#include "Sonicteam/System/Singleton.h"
140141
#include "Sonicteam/TextBook.h"
141142
#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: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <user/config.h>
33
#include <app.h>
44

5-
65
// Sonicteam::SoX::Physics::Havok::WorldHavok::Update
76
PPC_FUNC_IMPL(__imp__sub_82587AA8);
87
PPC_FUNC(sub_82587AA8)
@@ -122,20 +121,24 @@ void PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime(PPCRegister& message, PPCReg
122121
auto pMessage = (MsgSuckPlayerEx*)g_memory.Translate(message.u32);
123122

124123
deltaTime.f64 = pMessage->DeltaTime;
124+
}
125125

126-
//not need anything here
127-
void ParticleHFR_826454C8(PPCRegister& f31)
126+
void ParticleHFR_82670658(PPCRegister& f1,PPCRegister& stack)
128127
{
128+
f1.f64 = App::s_deltaTime;
129+
}
129130

131+
void ParticleHFR_8266A418_1(PPCRegister& f31,PPCRegister& stack)
132+
{
133+
f31.f64 = App::s_deltaTime;
130134
}
131135

132-
void ParticleHFR_82670658(PPCRegister& f1,PPCRegister& stack)
136+
void ParticleHFR_82673F88(PPCRegister& f13,PPCRegister& stack)
133137
{
134-
auto delta = ((be<double>*)(g_memory.Translate(stack.u32 + 0x1A0 - 0x48 - 8)))->get();
135-
f1.f64 = App::s_deltaTime; //find delta normally, someday
138+
f13.f64 = App::s_deltaTime;
136139
}
137140

138-
void ParticleHFR_8266A418_1(PPCRegister& f31,PPCRegister& stack)
141+
void ParticleHFR_82674550(PPCRegister& f13,PPCRegister& stack)
139142
{
140-
f31.f64 = App::s_deltaTime; //find delta normally, someday
143+
f13.f64 = App::s_deltaTime;
141144
}

MarathonRecompLib/config/Marathon.toml

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

512+
#ParticleHFR_826454C8
512513
[[midasm_hook]]
513-
name = "ParticleHFR_826454C8"
514-
address = 0x82645518
515-
registers = ["f31"]
514+
name = "NOP"
515+
address = 0x82645518
516516
jump_address = 0x8264551C
517517

518518
[[midasm_hook]]
519519
name = "ParticleHFR_82670658"
520520
address = 0x82670724
521-
registers = ["f1","r1"]
521+
registers = ["f1", "r1"]
522522
after_instruction = true
523523

524524
[[midasm_hook]]
525525
name = "ParticleHFR_8266A418_1"
526526
address = 0x8266A57C
527-
registers = ["f31","r1"]
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"]
528540
after_instruction = true

0 commit comments

Comments
 (0)