Fixed timer

This commit is contained in:
pagefault
2001-05-22 19:12:12 +00:00
parent 83118af42e
commit 07d20b5600
2 changed files with 14 additions and 16 deletions

View File

@@ -176,7 +176,7 @@ EXTSYM numlockptr
%ifdef __WIN32__
EXTSYM CheckPriority
EXTSYM CheckAlwaysOnTop
EXTSYM ReInitTimer
EXTSYM RestartTimer
%endif
%ifdef __LINUX__
EXTSYM numlockptr
@@ -3321,7 +3321,7 @@ DisplayBoxes:
%ifdef __WIN32__
pushad
call CheckPriority
call ReInitTimer
call RestartTimer
popad
%endif
jmp .finstuff

View File

@@ -39,6 +39,7 @@ DWORD FullScreen = 0;
DWORD Moving= 0;
DWORD SoundBufferSize=1024*18;
DWORD FirstSound=1;
DWORD CurrentTimer=0;
int AllowDefault=0;
int SoundEnabled=1;
@@ -219,20 +220,6 @@ extern "C" void MinimizeWindow()
IsMinimized = TRUE;
}
extern "C" void ReInitTimer()
{
if (AlternateTimer == 0)
{
QueryPerformanceCounter((LARGE_INTEGER*)&start);
QueryPerformanceCounter((LARGE_INTEGER*)&start2);
}
else
{
start = timeGetTime();
start2 = timeGetTime();
}
}
extern "C" BYTE MouseWheel;
BOOL InputRead(void)
@@ -2281,6 +2268,17 @@ void WinUpdateDevices()
}
extern "C" void DosExit();
extern "C" void RestartTimer()
{
if (CurrentTimer != AlternateTimer)
{
MessageBox(hMainWindow, "ZSNESW must be restarted to use this option", "Info", MB_OK);
DosExit();
}
}
int GetMouseX(void)
{
char message1[256];