update current date in the midnight

git-svn-id: svn://kolibrios.org@7717 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-01-16 10:39:14 +00:00
parent 751e3e3d06
commit 6fa329e5b4

View File

@ -84,7 +84,7 @@ macro DrawRect color1,color2,color3,color4 ; pizdec... but optimized well
add ebx,1 shl 16 add ebx,1 shl 16
add ecx,1 shl 16 add ecx,1 shl 16
mov bx,DATE_BUTTON_WIDTH-4 mov bx,DATE_BUTTON_WIDTH-4
mov cx,DATE_BUTTON_HEIGHT-4 mov cx,DATE_BUTTON_HEIGHT-3
mcall mcall
; bottom border-inner ; bottom border-inner
mov edx,color4 mov edx,color4
@ -140,31 +140,43 @@ str2int:
add al,bl add al,bl
ret ret
START: get_current_date:
mcall 29 mcall 29
mov [datestr],eax mov [datestr],eax
mov esi,datestr mov esi,datestr
call str2int call str2int
add eax,1900 add eax,1900
mov [Year],eax mov [curYear],eax
call str2int call str2int
dec eax dec eax
mov [Month],eax mov [curMonth],eax
call str2int call str2int
mov [day_sel],eax mov [curDay],eax
test byte[esi],0 test byte[esi],0
jnz .no2000 jnz .no2000
add [Year],100 add [curYear],100
mov eax,[Year]
mov [curYear], eax
mov eax,[Month]
mov [curMonth], eax
mov eax,[day_sel]
mov [curDay], eax
.no2000: .no2000:
jmp upd call calculate
red: ret
check_midnight:
mov ebx,[datestr]
mcall 29
cmp eax,ebx
je end_check_midnight
call get_current_date
call draw_days
end_check_midnight:
ret
;===============================================================
START:
call get_current_date
m2m [Year], [curYear]
m2m [Month], [curMonth]
m2m [day_sel], [curDay]
red:
call define_window call define_window
still: still:
@ -179,6 +191,7 @@ still:
cmp eax,3 cmp eax,3
je button je button
call check_midnight
call draw_clock call draw_clock
jmp still jmp still