summaryrefslogtreecommitdiffstats
path: root/src/core/Timer.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-04-26 21:03:15 +0200
committerSergeanur <s.anureev@yandex.ua>2020-04-26 21:03:15 +0200
commitf0890b11122291a22d6a65f349281cf1aed49bd0 (patch)
tree3b418b522c5fd097abac916693e59808ea4f5b4f /src/core/Timer.cpp
parentMore japanese (diff)
parentRemove little hack (diff)
downloadre3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.gz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.bz2
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.lz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.xz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.zst
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.zip
Diffstat (limited to '')
-rw-r--r--src/core/Timer.cpp59
1 files changed, 19 insertions, 40 deletions
diff --git a/src/core/Timer.cpp b/src/core/Timer.cpp
index fda862f1..aca7c1dc 100644
--- a/src/core/Timer.cpp
+++ b/src/core/Timer.cpp
@@ -1,38 +1,32 @@
-#include <windows.h>
+#define WITHWINDOWS
#include "common.h"
-#include "patcher.h"
+
#include "DMAudio.h"
#include "Record.h"
#include "Timer.h"
-uint32 &CTimer::m_snTimeInMilliseconds = *(uint32*)0x885B48;
-uint32 &CTimer::m_snTimeInMillisecondsPauseMode = *(uint32*)0x5F7614;
-uint32 &CTimer::m_snTimeInMillisecondsNonClipped = *(uint32*)0x9412E8;
-uint32 &CTimer::m_snPreviousTimeInMilliseconds = *(uint32*)0x8F29E4;
-uint32 &CTimer::m_FrameCounter = *(uint32*)0x9412EC;
-float &CTimer::ms_fTimeScale = *(float*)0x8F2C20;
-float &CTimer::ms_fTimeStep = *(float*)0x8E2CB4;
-float &CTimer::ms_fTimeStepNonClipped = *(float*)0x8E2C4C;
-bool &CTimer::m_UserPause = *(bool*)0x95CD7C;
-bool &CTimer::m_CodePause = *(bool*)0x95CDB1;
+uint32 CTimer::m_snTimeInMilliseconds;
+uint32 CTimer::m_snTimeInMillisecondsPauseMode = 1;
+uint32 CTimer::m_snTimeInMillisecondsNonClipped;
+uint32 CTimer::m_snPreviousTimeInMilliseconds;
+uint32 CTimer::m_FrameCounter;
+float CTimer::ms_fTimeScale;
+float CTimer::ms_fTimeStep;
+float CTimer::ms_fTimeStepNonClipped;
+bool CTimer::m_UserPause;
+bool CTimer::m_CodePause;
-//UInt32 oldPcTimer;
-uint32 &oldPcTimer = *(uint32*)0x9434F4;
+uint32 oldPcTimer;
-//UInt32 suspendPcTimer;
-uint32 &suspendPcTimer = *(uint32*)0x62A308;
+uint32 suspendPcTimer;
-//UInt32 _nCyclesPerMS = 1;
-uint32 &_nCyclesPerMS = *(uint32*)0x5F7610;
+uint32 _nCyclesPerMS = 1;
-//LARGE_INTEGER _oldPerfCounter;
-LARGE_INTEGER &_oldPerfCounter = *(LARGE_INTEGER*)0x62A310;
+LARGE_INTEGER _oldPerfCounter;
-//LARGE_INTEGER perfSuspendCounter;
-LARGE_INTEGER &perfSuspendCounter = *(LARGE_INTEGER*)0x62A318;
+LARGE_INTEGER perfSuspendCounter;
-//UInt32 suspendDepth;
-uint32 &suspendDepth = *(uint32*)0x62A320;
+uint32 suspendDepth;
#ifdef FIX_BUGS
double frameTime;
@@ -144,7 +138,7 @@ void CTimer::Update(void)
if ( !CRecordDataForGame::IsPlayingBack() )
{
- ms_fTimeStep = min(3.0f, ms_fTimeStep);
+ ms_fTimeStep = Min(3.0f, ms_fTimeStep);
if ( (m_snTimeInMilliseconds - m_snPreviousTimeInMilliseconds) > 60 )
m_snTimeInMilliseconds = m_snPreviousTimeInMilliseconds + 60;
@@ -231,18 +225,3 @@ uint32 CTimer::GetCyclesPerFrame()
return 20;
}
-#if 1
-STARTPATCHES
- InjectHook(0x4ACE60, CTimer::Initialise, PATCH_JUMP);
- InjectHook(0x4ACF60, CTimer::Shutdown, PATCH_JUMP);
- InjectHook(0x4ACF70, CTimer::Update, PATCH_JUMP);
- InjectHook(0x4AD310, CTimer::Suspend, PATCH_JUMP);
- InjectHook(0x4AD370, CTimer::Resume, PATCH_JUMP);
- InjectHook(0x4AD3F0, CTimer::GetCyclesPerMillisecond, PATCH_JUMP);
- InjectHook(0x4AD410, CTimer::GetCurrentTimeInCycles, PATCH_JUMP);
- InjectHook(0x4AD450, CTimer::GetIsSlowMotionActive, PATCH_JUMP);
- InjectHook(0x4AD480, CTimer::Stop, PATCH_JUMP);
- InjectHook(0x4AD490, CTimer::StartUserPause, PATCH_JUMP);
- InjectHook(0x4AD4A0, CTimer::EndUserPause, PATCH_JUMP);
-ENDPATCHES
-#endif