From 6fa329e5b4afb771ef017c14e83aab4f14acaec5 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Thu, 16 Jan 2020 10:39:14 +0000 Subject: [PATCH] update current date in the midnight git-svn-id: svn://kolibrios.org@7717 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/calendar/trunk/calendar.asm | 41 ++++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/programs/system/calendar/trunk/calendar.asm b/programs/system/calendar/trunk/calendar.asm index 26d2bb3ae7..e170ae1991 100644 --- a/programs/system/calendar/trunk/calendar.asm +++ b/programs/system/calendar/trunk/calendar.asm @@ -84,7 +84,7 @@ macro DrawRect color1,color2,color3,color4 ; pizdec... but optimized well add ebx,1 shl 16 add ecx,1 shl 16 mov bx,DATE_BUTTON_WIDTH-4 - mov cx,DATE_BUTTON_HEIGHT-4 + mov cx,DATE_BUTTON_HEIGHT-3 mcall ; bottom border-inner mov edx,color4 @@ -140,31 +140,43 @@ str2int: add al,bl ret -START: +get_current_date: mcall 29 mov [datestr],eax mov esi,datestr call str2int add eax,1900 - mov [Year],eax + mov [curYear],eax call str2int dec eax - mov [Month],eax + mov [curMonth],eax call str2int - mov [day_sel],eax + mov [curDay],eax test byte[esi],0 jnz .no2000 - add [Year],100 - mov eax,[Year] - mov [curYear], eax - mov eax,[Month] - mov [curMonth], eax - mov eax,[day_sel] - mov [curDay], eax + add [curYear],100 .no2000: - jmp upd -red: + call calculate +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 still: @@ -179,6 +191,7 @@ still: cmp eax,3 je button + call check_midnight call draw_clock jmp still