diff --git a/saco/game/game.cpp b/saco/game/game.cpp index 496610d..f01ef65 100644 --- a/saco/game/game.cpp +++ b/saco/game/game.cpp @@ -76,6 +76,13 @@ void CGame::InitGame() //----------------------------------------------------------- +void CGame::StartGame() +{ + // TODO: CGame::StartGame() .text:100A08E0 +} + +//----------------------------------------------------------- + void CGame::sub_100A0060() { // No indication for __thiscall, maybe not part of CGame diff --git a/saco/game/game.h b/saco/game/game.h index 50a6b1d..5d83869 100644 --- a/saco/game/game.h +++ b/saco/game/game.h @@ -36,6 +36,7 @@ public: HWND GetMainWindowHwnd() { return *(HWND *)ADDR_HWND; }; + void StartGame(); void InitGame(); CGame(); diff --git a/saco/main.cpp b/saco/main.cpp index 8907b7d..f598d99 100644 --- a/saco/main.cpp +++ b/saco/main.cpp @@ -34,6 +34,27 @@ CFileSystem *pFileSystem=NULL; void TheGraphicsLoop(); LONG WINAPI exc_handler(_EXCEPTION_POINTERS* exc_inf); +void sub_1009DD50(); + +// polls the game until it's able to run. +void LaunchMonitor(PVOID v) +{ + if(pGame) + pGame->InitGame(); + + while(1) { + if(*(PDWORD)ADDR_ENTRY == 7) { + sub_1009DD50(); + pGame->StartGame(); + break; + } + else { + Sleep(5); + } + } + + ExitThread(0); +} //---------------------------------------------------- @@ -70,7 +91,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) pGame = new CGame(); - //_beginthread((int)sub_100C3A80, 0, 0); + _beginthread(LaunchMonitor,0,NULL); } } else if(DLL_PROCESS_DETACH==fdwReason)