From 1fe669b0a9a5aa78796c18dbada54f0f11fbbabf Mon Sep 17 00:00:00 2001 From: sTc2201 Date: Thu, 17 Aug 2023 15:34:16 +0200 Subject: [PATCH] Add support for 1070 --- source/TimecycEditor.cpp | 11 +++++++++++ source/Utils.h | 18 ++++++++++++++++++ source/main.cpp | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/source/TimecycEditor.cpp b/source/TimecycEditor.cpp index 1c6b952..cfc2cd6 100644 --- a/source/TimecycEditor.cpp +++ b/source/TimecycEditor.cpp @@ -18,6 +18,17 @@ void TimecycEditor::Initialize(const uint8_t *baseAddress) SET_TIME_ONE_DAY_BACK = (SET_TIME_ONE_DAY_BACKT*)(baseAddress + 0x5CB0D0); break; + case 1070: + mTimeCycle = (Timecycle*)(baseAddress + 0xDF6080); + mHour = (int32_t*)(baseAddress + 0xDD5300); + mMinutes = (int32_t*)(baseAddress + 0xDD52FC); + mTimerLength = (uint32_t*)(baseAddress + 0xDD5304); + FORCE_WEATHER_NOW = (FORCE_WEATHER_NOWT*)(baseAddress + 0x5E41D0); + RELEASE_WEATHER = (RELEASE_WEATHERT*)(baseAddress + 0x5E4240); + SET_TIME_ONE_DAY_FORWARD = (SET_TIME_ONE_DAY_FORWARDT*)(baseAddress + 0x765060); + SET_TIME_ONE_DAY_BACK = (SET_TIME_ONE_DAY_BACKT*)(baseAddress + 0x7650A0); + break; + case 1080: mTimeCycle = (Timecycle*)(baseAddress + 0xFF1150); mHour = (int32_t*)(baseAddress + 0xD51694); diff --git a/source/Utils.h b/source/Utils.h index 19f4f3b..4923a96 100644 --- a/source/Utils.h +++ b/source/Utils.h @@ -43,6 +43,11 @@ namespace Utils return true; break; + case 0x01000700: + gameVersion = 1070; + return true; + break; + case 0x01000800: gameVersion = 1080; return true; @@ -111,6 +116,19 @@ namespace Utils return true; break; + case 1070: + d3d9Device = (IDirect3DDevice9*)(baseAddress + 0x148AB48); + + if(*(int32_t*)d3d9Device == NULL) + { + return false; + } + + memcpy(vtable, **(void***)d3d9Device, 119 * 4); + + return true; + break; + case 1080: d3d9Device = (IDirect3DDevice9*)(baseAddress + 0x1345630); diff --git a/source/main.cpp b/source/main.cpp index e190076..19f00f1 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -219,7 +219,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) if(!Utils::GetGameVersion(gameVersion)) { - logStream << "In Game Timecyc Editor only supports patch 4 and 8 - " << std::to_string(gameVersion); + logStream << "In Game Timecyc Editor only supports patch 4, 7 and 8 - " << std::to_string(gameVersion); Log::Error(logStream.str()); return false;