1
0
mirror of synced 2025-02-01 04:15:50 +01:00

- SR3 Pause will now freeze timer until un-paused

This commit is contained in:
Aaron M 2021-09-15 16:55:42 +12:00
parent db441edb0a
commit 429ec65f78
2 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,21 @@
#include <StdInc.h>
#include "Utility/GameDetect.h"
#include "Utility/InitFunction.h"
#include "Functions/Global.h"
#include "Utility/Helper.h"
bool PauseGameFixInit;
static DWORD TimerValue;
void PauseGameFixes(Helpers* helpers)
{
if (GameDetect::currentGame == GameID::SR3)
{
if (!PauseGameFixInit)
{
PauseGameFixInit = true;
TimerValue = helpers->ReadIntPtr(0x9C4A07, false);
}
helpers->WriteIntPtr(0x9C4A07, TimerValue, false);
}
}

View File

@ -5,6 +5,7 @@
#include "Utility/Hooking.Patterns.h"
#include <shlwapi.h>
#include <Windows.h>
#include "Utility/Helper.h"
#include <TlHelp32.h>
#include "mmeapi.h"
@ -27,6 +28,8 @@ static char PauseKeyChar[256];
static char ExitKeyChar[256];
static int PauseKeyValue;
static int ExitKeyValue;
extern bool PauseGameFixInit;
extern void PauseGameFixes(Helpers* helpers);
void *__cdecl memcpy_0(void *a1, const void *a2, size_t a3)
{
@ -108,6 +111,8 @@ static BOOL SuspendProcess(DWORD ProcessId, bool Suspend)
DisableGhosting = true;
DisableProcessWindowsGhosting();
}
PauseGameFixes(0);
#ifndef _DEBUG
if (GetAsyncKeyState(ExitKeyValue))
{
@ -120,6 +125,7 @@ static BOOL SuspendProcess(DWORD ProcessId, bool Suspend)
if (SuspendPressedOff)
{
SuspendPressedOff = false;
PauseGameFixInit = false;
waveOutSetVolume(NULL, dwVolume);
SuspendProcess(ProcessID, false);
break;
@ -130,7 +136,7 @@ static BOOL SuspendProcess(DWORD ProcessId, bool Suspend)
if (SuspendPressedOn)
SuspendPressedOff = true;
}
Sleep(64);
Sleep(16);
}
}
CloseHandle(hThread);