Skip to content

Commit 9c41fc1

Browse files
author
ReimousTH
committed
Particle HFR
1 parent 832c838 commit 9c41fc1

6 files changed

Lines changed: 48 additions & 3 deletions

File tree

MarathonRecomp/api/Marathon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
#include "Sonicteam/TextEntity.h"
144144
#include "Sonicteam/TextFontPicture.h"
145145
#include "Sonicteam/TextFontPictureMgr.h"
146+
#include "Sonicteam/System/Diagnostic/Perfomance.h"
146147
#include "Sonicteam/TitleTask.h"
147148
#include "boost/smart_ptr/make_shared_object.h"
148149
#include "boost/smart_ptr/shared_ptr.h"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma once
2+
3+
#include <Sonicteam/System/Singleton.h>
4+
#include <Sonicteam/System/CreateStatic.h>
5+
6+
namespace Sonicteam::System::Diagnostic
7+
{
8+
9+
class Perfomance:public Singleton<Perfomance,0x82D3B210,CreateStatic<Perfomance,0x82581C88>>
10+
{
11+
public:
12+
be<uint64_t> m_LastFrequency;
13+
};
14+
}

MarathonRecomp/app.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ void App::Exit()
3030
std::_Exit(0);
3131
}
3232

33+
double App::GetDelta()
34+
{
35+
return 0.0;
36+
}
37+
3338
// Sonicteam::AppMarathon::AppMarathon
3439
PPC_FUNC_IMPL(__imp__sub_8262A568);
3540
PPC_FUNC(sub_8262A568)

MarathonRecomp/app.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ class App
2222

2323
static void Restart(std::vector<std::string> restartArgs = {});
2424
static void Exit();
25+
26+
//GetThreadedDelta
27+
static double GetDelta();
2528
};
2629

MarathonRecomp/patches/fps_patches.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void PlayerObject_ProcessMsgSuckPlayer_FixDeltaTime(PPCRegister& message, PPCReg
122122
auto pMessage = (MsgSuckPlayerEx*)g_memory.Translate(message.u32);
123123

124124
deltaTime.f64 = pMessage->DeltaTime;
125-
125+
}
126126
//not need anything here
127127
void ParticleHFR_826454C8(PPCRegister& f31)
128128
{
@@ -132,10 +132,20 @@ void ParticleHFR_826454C8(PPCRegister& f31)
132132
void ParticleHFR_82670658(PPCRegister& f1,PPCRegister& stack)
133133
{
134134
auto delta = ((be<double>*)(g_memory.Translate(stack.u32 + 0x1A0 - 0x48 - 8)))->get();
135-
f1.f64 = App::s_deltaTime; //find delta normally, someday
135+
f1.f64 = App::s_deltaTime;
136136
}
137137

138138
void ParticleHFR_8266A418_1(PPCRegister& f31,PPCRegister& stack)
139139
{
140-
f31.f64 = App::s_deltaTime; //find delta normally, someday
140+
f31.f64 = App::s_deltaTime;
141+
}
142+
143+
void ParticleHFR_82673F88(PPCRegister& f13,PPCRegister& stack)
144+
{
145+
f13.f64 = App::s_deltaTime;
146+
}
147+
148+
void ParticleHFR_82674550(PPCRegister& f13,PPCRegister& stack)
149+
{
150+
f13.f64 = App::s_deltaTime;
141151
}

MarathonRecompLib/config/Marathon.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,3 +526,15 @@ name = "ParticleHFR_8266A418_1"
526526
address = 0x8266A57C
527527
registers = ["f31","r1"]
528528
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

0 commit comments

Comments
 (0)