gameclock fix

This commit is contained in:
theoddone33
2001-04-28 17:30:50 +00:00
parent 89169c29c8
commit 3155406147
2 changed files with 21 additions and 17 deletions

View File

@@ -2115,28 +2115,21 @@ NEWSYM GotoHomepage
popad
ret
EXTSYM SystemTimewHour
EXTSYM SystemTimewMinute
EXTSYM SystemTimewSecond
NEWSYM GetTimeInSeconds
push dword SystemTime
call [GetLocalTime]
movzx eax,word [SystemTime.wHour]
call GetLocalTime
movzx eax,word [SystemTimewHour]
mov ebx,60
mul ebx
movzx ebx,word [SystemTime.wMinute]
movzx ebx,word [SystemTimewMinute]
add eax,ebx
mov ebx,60
mul ebx
movzx ebx,word [SystemTime.wSecond]
movzx ebx,word [SystemTimewSecond]
add eax,ebx
ret
SystemTime:
.wYear dw 0
.wMonth dw 0
.wDayOfWeek dw 0
.wDay dw 0
.wHour dw 0
.wMinute dw 0
.wSecond dw 0
.wMilliseconds dw 0
NEWSYM WinIntRFAsmEnd

View File

@@ -2,6 +2,7 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <time.h>
#include "SDL.h"
#else // __WIN32__
#include <windows.h>
@@ -1713,9 +1714,19 @@ void ZsnesPage()
}
#ifdef __LINUX__
void GetLocalTime(void *pointer)
short SystemTimewHour;
short SystemTimewMinute;
short SystemTimewSecond;
void GetLocalTime()
{
STUB_FUNCTION;
time_t current;
struct tm *timeptr;
time (&current);
timeptr = localtime(&current);
SystemTimewHour = timeptr->tm_hour;
SystemTimewMinute = timeptr->tm_min;
SystemTimewSecond = timeptr->tm_sec;
}
#endif