Get_Date now actually returns proper day and month on Win32 and SDL.

This commit is contained in:
n-a-c-h
2004-12-30 19:50:58 +00:00
parent 24fd064c63
commit 95983ca23a
2 changed files with 25 additions and 7 deletions

View File

@@ -432,8 +432,18 @@ NEWSYM Get_TimeDate
NEWSYM Get_Date NEWSYM Get_Date
; dl = day, dh = month, cx = year ; dl = day, dh = month, cx = year
mov dx,0 pushad
mov cx,0 call GetDate
mov [TempVarSeek],eax
popad
mov eax,[TempVarSeek]
movzx edx,al ;Move day into edx, day is in BCD
shr edx,4 ;Chop off the second digit
imul edx,10 ;Multiply first digit by 10, since we want decimal
and al,0xF ;Remove first BCD digit
add dl,al ;Add second digit to first*10
mov dh,ah ;Copy month
;Year still isn't done yet, although I don't think we use it anywhere -Nach
ret ret
NEWSYM Get_File_Date NEWSYM Get_File_Date

View File

@@ -482,12 +482,20 @@ NEWSYM Get_TimeDate
NEWSYM Get_Date NEWSYM Get_Date
; dl = day, dh = month, cx = year ; dl = day, dh = month, cx = year
mov dx,0 pushad
mov cx,0 call GetDate
; mov ah,2Ah mov [TempVarSeek],eax
; int 21h popad
mov eax,[TempVarSeek]
movzx edx,al ;Move day into edx, day is in BCD
shr edx,4 ;Chop off the second digit
imul edx,10 ;Multiply first digit by 10, since we want decimal
and al,0xF ;Remove first BCD digit
add dl,al ;Add second digit to first*10
mov dh,ah ;Copy month
;Year still isn't done yet, although I don't think we use it anywhere -Nach
ret ret
NEWSYM Get_File_Date NEWSYM Get_File_Date
mov [ZFFTimeFName],edx mov [ZFFTimeFName],edx
pushad pushad