Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions source-code/source/plugins/TLAC/Components/Pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ namespace TLAC::Components
Pause::menusets Pause::curMenuSet = MENUSET_MAIN;
std::chrono::time_point<std::chrono::high_resolution_clock> Pause::menuItemMoveTime;
std::vector<uint8_t> Pause::origAetMovOp;
float_t Pause::origDeltaFrameHistory = 0.0f;
int32_t Pause::origDeltaFrameHistoryInt = 0;
uint8_t* Pause::aetMovPatchAddress = (uint8_t*)0x1401703b3;
std::vector<uint8_t> Pause::origFramespeedOp;
uint8_t* Pause::framespeedPatchAddress = (uint8_t*)0x140192D50;
float_t* Pause::deltaFrameHistoryAddress = (float_t*)0x140EDA6C0;
int32_t* Pause::deltaFrameHistoryIntAddress = (int32_t*)0x140EDA6C4;
std::vector<uint8_t> Pause::origAgeageHairOp;
uint8_t* Pause::ageageHairPatchAddress = (uint8_t*)0x14054352c;
std::vector<bool> Pause::streamPlayStates;
Expand Down Expand Up @@ -136,6 +140,12 @@ namespace TLAC::Components
InjectCode(framespeedPatchAddress, { 0x0f, 0x57, 0xc0, 0xc3 }); // XORPS XMM0,XMM0; RET
InjectCode(ageageHairPatchAddress, { 0x0f, 0x57, 0xdb }); // XORPS XMM3,XMM3

origDeltaFrameHistory = *deltaFrameHistoryAddress;
origDeltaFrameHistoryInt = *deltaFrameHistoryIntAddress;

*deltaFrameHistoryAddress = 0.0f;
*deltaFrameHistoryIntAddress = 0;

uint64_t audioMixerAddr = *(uint64_t*)(AUDIO_MAIN_CLASS_ADDRESS + 0x70);
uint64_t audioStreamsAddress = *(uint64_t*)(audioMixerAddr + 0x18);
int nAudioStreams = *(uint64_t*)(audioMixerAddr + 0x20);
Expand Down Expand Up @@ -279,6 +289,9 @@ namespace TLAC::Components
InjectCode(framespeedPatchAddress, origFramespeedOp);
InjectCode(ageageHairPatchAddress, origAgeageHairOp);

*deltaFrameHistoryAddress = origDeltaFrameHistory;
*deltaFrameHistoryIntAddress = origDeltaFrameHistoryInt;

uint64_t audioMixerAddr = *(uint64_t*)(AUDIO_MAIN_CLASS_ADDRESS + 0x70);
uint64_t audioStreamsAddress = *(uint64_t*)(audioMixerAddr + 0x18);
int nAudioStreams = *(uint64_t*)(audioMixerAddr + 0x20);
Expand Down
4 changes: 4 additions & 0 deletions source-code/source/plugins/TLAC/Components/Pause.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ namespace TLAC::Components

static std::vector<uint8_t> origFramespeedOp;
static uint8_t* framespeedPatchAddress;
static float_t origDeltaFrameHistory;
static int32_t origDeltaFrameHistoryInt;
static float_t* deltaFrameHistoryAddress;
static int32_t* deltaFrameHistoryIntAddress;

static std::vector<uint8_t> origAgeageHairOp;
static uint8_t* ageageHairPatchAddress;
Expand Down