11#include < api/Marathon.h>
22#include < user/config.h>
3- #include < app.h>
43
54// Sonicteam::SoX::Physics::Havok::WorldHavok::Update
65PPC_FUNC_IMPL (__imp__sub_82587AA8);
@@ -25,85 +24,60 @@ void SonicCamera_RotationSpeedFix(PPCRegister& f0, PPCRegister& deltaTime, PPCRe
2524 f0.f64 = float ((f0.f64 * (deltaTime.f64 * (1.0 / (deltaTime.f64 * 60.0 )))) + f13.f64 );
2625}
2726
28-
29- bool FixTPJRopeHFR2BNE (PPCRegister& r30)
30- {
31- if (Config::FPS > 60.0 )
32- return r30.f64 >= 0 ;
33- else
34- return false ; // original
35- }
36-
37- void FixTPJRopeHFR3LFS (PPCRegister& r_value, PPCRegister& r_delta)
38- {
39- if (Config::FPS <= 60.0 )
40- return ;
41-
42- r_value.f64 = r_delta.f64 ;
43- }
44- // Not finished
45- void FixTPJRopeHFR4LFS (PPCRegister& r_value, PPCRegister& r_delta)
27+ bool ObjTarzan_VolatileBranch (PPCRegister& r30)
4628{
47- if (Config::FPS <= 60.0 )
48- return ;
29+ if (Config::FPS <= 60 .0f )
30+ return false ;
4931
50- r_value .f64 = r_delta. f64 ;
32+ return r30 .f64 >= 0 ;
5133}
52- void FixTPJRopeHFR5LFS (PPCRegister& r_value, PPCRegister& r_delta)
53- {
54- if (Config::FPS <= 60.0 )
55- return ;
5634
57- r_value.f64 = r_delta.f64 ;
58- }
59- void FixTPJRopeHFR6LFS (PPCRegister& r_value, PPCRegister& r_delta)
35+ void ObjTarzan_PatchStaticDeltaTime (PPCRegister& value, PPCRegister& delta)
6036{
61- if (Config::FPS <= 60.0 )
37+ if (Config::FPS <= 60 .0f )
6238 return ;
6339
64- r_value .f64 = r_delta .f64 ;
40+ value .f64 = delta .f64 ;
6541}
6642
67- // force to save
68- void FixTPJRopeHFR7EXTRA (PPCRegister& r_value, PPCRegister& r_value2, PPCRegister& r_stack)
43+ void ObjTarzan_PatchDeltaTimeArgument (PPCRegister& value, PPCRegister& value2, PPCRegister& stack)
6944{
70- if (Config::FPS <= 60.0 )
45+ if (Config::FPS <= 60 .0f )
7146 return ;
7247
73- auto deltaTime = *(be<double >*)g_memory.Translate (r_stack.u32 + 0x90 + 0x420 - 0x88 );
74- r_value.f64 = deltaTime;
75- r_value2.f64 = deltaTime;
76- }
77-
78- // no Tarzan Class implementation, because Fixture in gauge patch o-o
79- struct TPJ_POINT
80- {
81- MARATHON_INSERT_PADDING (0x4C );
82- be<float > m_Time;
83- MARATHON_INSERT_PADDING (0xB0 );
48+ auto deltaTime = *(be<double >*)g_memory.Translate (stack.u32 + 0x90 + 0x420 - 0x88 );
8449
85- };
50+ value.f64 = deltaTime;
51+ value2.f64 = deltaTime;
52+ }
8653
87- // SonicTeam::TPJ
54+ // Sonicteam::ObjTarzan::UpdatePoint (speculatory)
8855PPC_FUNC_IMPL (__imp__sub_8232D770);
8956PPC_FUNC (sub_8232D770)
9057{
91- if (Config::FPS <= 60.0 )
58+ if (Config::FPS <= 60 .0f )
9259 {
9360 __imp__sub_8232D770 (ctx, base);
9461 return ;
9562 }
9663
97- auto pTPJ = (TPJ_POINT *)(base + ctx.r3 .u32 );
98- auto delta = ctx.f1 .f64 ;
99- PPCRegister _r4 = ctx.f1 ;
64+ struct TarzanPoint
65+ {
66+ MARATHON_INSERT_PADDING (0x4C );
67+ be<float > m_Time;
68+ MARATHON_INSERT_PADDING (0xB0 );
69+ };
70+
71+ auto pTarzanPoint = (TarzanPoint*)(base + ctx.r3 .u32 );
72+ auto deltaTime = ctx.f1 .f64 ;
73+
74+ if (deltaTime > 1.0 )
75+ deltaTime = 1.0 ;
10076
101- if (delta > 1.0 )
102- delta = 1.0 ;
10377 do
10478 {
105- // f1,f2,f3
106- GuestToHostFunction< void >(sub_8232D288, pTPJ, _r4. u64 ,delta,delta,delta) ;
107- pTPJ-> m_Time = pTPJ-> m_Time - delta;
108- } while (pTPJ ->m_Time >= delta );
79+ GuestToHostFunction< void >(sub_8232D288, pTarzanPoint, ctx. f1 . u64 , deltaTime, deltaTime, deltaTime);
80+ pTarzanPoint-> m_Time = pTarzanPoint-> m_Time - deltaTime ;
81+ }
82+ while (pTarzanPoint ->m_Time >= deltaTime );
10983}
0 commit comments