Skip to content

Commit

Permalink
Merge branch 'sTc2201-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
akifle47 committed Aug 18, 2023
2 parents 07deb63 + 1fe669b commit 2c072ec
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
11 changes: 11 additions & 0 deletions source/TimecycEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 18 additions & 0 deletions source/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ namespace Utils
return true;
break;

case 0x01000700:
gameVersion = 1070;
return true;
break;

case 0x01000800:
gameVersion = 1080;
return true;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2c072ec

Please sign in to comment.