@@ -25,85 +25,60 @@ void SonicCamera_RotationSpeedFix(PPCRegister& f0, PPCRegister& deltaTime, PPCRe
2525 f0.f64 = float ((f0.f64 * (deltaTime.f64 * (1.0 / (deltaTime.f64 * 60.0 )))) + f13.f64 );
2626}
2727
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)
28+ bool ObjTarzan_VolatileBranch (PPCRegister& r30)
4629{
47- if (Config::FPS <= 60.0 )
48- return ;
30+ if (Config::FPS <= 60 .0f )
31+ return false ;
4932
50- r_value .f64 = r_delta. f64 ;
33+ return r30 .f64 >= 0 ;
5134}
52- void FixTPJRopeHFR5LFS (PPCRegister& r_value, PPCRegister& r_delta)
53- {
54- if (Config::FPS <= 60.0 )
55- return ;
5635
57- r_value.f64 = r_delta.f64 ;
58- }
59- void FixTPJRopeHFR6LFS (PPCRegister& r_value, PPCRegister& r_delta)
36+ void ObjTarzan_PatchStaticDeltaTime (PPCRegister& value, PPCRegister& delta)
6037{
61- if (Config::FPS <= 60.0 )
38+ if (Config::FPS <= 60 .0f )
6239 return ;
6340
64- r_value .f64 = r_delta .f64 ;
41+ value .f64 = delta .f64 ;
6542}
6643
67- // force to save
68- void FixTPJRopeHFR7EXTRA (PPCRegister& r_value, PPCRegister& r_value2, PPCRegister& r_stack)
44+ void ObjTarzan_PatchDeltaTimeArgument (PPCRegister& value, PPCRegister& value2, PPCRegister& stack)
6945{
70- if (Config::FPS <= 60.0 )
46+ if (Config::FPS <= 60 .0f )
7147 return ;
7248
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 );
49+ auto deltaTime = *(be<double >*)g_memory.Translate (stack.u32 + 0x90 + 0x420 - 0x88 );
8450
85- };
51+ value.f64 = deltaTime;
52+ value2.f64 = deltaTime;
53+ }
8654
87- // SonicTeam::TPJ
55+ // Sonicteam::ObjTarzan::Update
8856PPC_FUNC_IMPL (__imp__sub_8232D770);
8957PPC_FUNC (sub_8232D770)
9058{
91- if (Config::FPS <= 60.0 )
59+ if (Config::FPS <= 60 .0f )
9260 {
9361 __imp__sub_8232D770 (ctx, base);
9462 return ;
9563 }
9664
97- auto pTPJ = (TPJ_POINT *)(base + ctx.r3 .u32 );
98- auto delta = ctx.f1 .f64 ;
99- PPCRegister _r4 = ctx.f1 ;
65+ struct TarzanPoint
66+ {
67+ MARATHON_INSERT_PADDING (0x4C );
68+ be<float > m_Time;
69+ MARATHON_INSERT_PADDING (0xB0 );
70+ };
71+
72+ auto pTarzanPoint = (TarzanPoint*)(base + ctx.r3 .u32 );
73+ auto deltaTime = ctx.f1 .f64 ;
74+
75+ if (deltaTime > 1.0 )
76+ deltaTime = 1.0 ;
10077
101- if (delta > 1.0 )
102- delta = 1.0 ;
10378 do
10479 {
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 );
80+ GuestToHostFunction< void >(sub_8232D288, pTarzanPoint, ctx. f1 . u64 , deltaTime, deltaTime, deltaTime);
81+ pTarzanPoint-> m_Time = pTarzanPoint-> m_Time - deltaTime ;
82+ }
83+ while (pTarzanPoint ->m_Time >= deltaTime );
10984}
0 commit comments