diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 5b57e4c7b..988fd1433 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1892,31 +1892,22 @@ void __fastcall LoadGameLevel(BOOL firstflag, int lvldir) // 5CF31D: using guessed type char setlevel; // 679660: using guessed type char gbMaxPlayers; -void __fastcall game_loop(BOOLEAN bStartup) +void __fastcall game_loop(BOOL bStartup) { - int v1; // ecx - int v2; // esi - - v1 = bStartup != 0 ? 0x39 : 0; - v2 = v1 + 3; - if (v1 != -3) { - while (1) { - --v2; - if (!multi_handle_delta()) - break; - timeout_cursor(0); + int i; + + i = bStartup ? 60 : 3; + + while(i--) { + if(!multi_handle_delta()) { + timeout_cursor(TRUE); + break; + } else { + timeout_cursor(FALSE); game_logic(); - if (gbRunGame) { - if (gbMaxPlayers != 1) { - if (nthread_has_500ms_passed(0)) { - if (v2) - continue; - } - } - } - return; } - timeout_cursor(1); + if(!gbRunGame || gbMaxPlayers == 1 || !nthread_has_500ms_passed(TRUE)) + break; } } // 679660: using guessed type char gbMaxPlayers; @@ -1967,7 +1958,7 @@ void __cdecl game_logic() // 525740: using guessed type int PauseMode; // 679660: using guessed type char gbMaxPlayers; -void __fastcall timeout_cursor(BOOLEAN bTimeout) +void __fastcall timeout_cursor(BOOL bTimeout) { if (bTimeout) { if (sgnTimeoutCurs == CURSOR_NONE && !sgbMouseDown) { diff --git a/Source/diablo.h b/Source/diablo.h index 5775e630f..274c3e3ac 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -66,9 +66,9 @@ void __cdecl LoadLvlGFX(); void __cdecl LoadAllGFX(); void __fastcall CreateLevel(int lvldir); void __fastcall LoadGameLevel(BOOL firstflag, int lvldir); -void __fastcall game_loop(BOOLEAN bStartup); +void __fastcall game_loop(BOOL bStartup); void __cdecl game_logic(); -void __fastcall timeout_cursor(BOOLEAN bTimeout); +void __fastcall timeout_cursor(BOOL bTimeout); void __cdecl diablo_color_cyc_logic(); /* data */ diff --git a/Source/nthread.cpp b/Source/nthread.cpp index 1a7b996e1..6ffafed64 100644 --- a/Source/nthread.cpp +++ b/Source/nthread.cpp @@ -288,7 +288,7 @@ void __fastcall nthread_ignore_mutex(BOOL bStart) } // 67975A: using guessed type char sgbThreadIsRunning; -BOOL __fastcall nthread_has_500ms_passed(int unused) +BOOL __fastcall nthread_has_500ms_passed(BOOL unused) { DWORD currentTickCount; // eax int ticksElapsed; // ecx diff --git a/Source/nthread.h b/Source/nthread.h index 9bb5ac51f..c90c7bf8e 100644 --- a/Source/nthread.h +++ b/Source/nthread.h @@ -30,7 +30,7 @@ void __fastcall nthread_start(BOOLEAN set_turn_upper_bit); unsigned int __stdcall nthread_handler(void *a1); void __cdecl nthread_cleanup(); void __fastcall nthread_ignore_mutex(BOOL bStart); -BOOL __fastcall nthread_has_500ms_passed(int unused); +BOOL __fastcall nthread_has_500ms_passed(BOOL unused); /* rdata */