2013-09-03 01:10:08 +04:00
|
|
|
; Calendar for KolibriOS
|
2006-01-03 12:43:31 +03:00
|
|
|
;
|
2013-09-08 18:17:38 +04:00
|
|
|
; v1.5 - time redesign by Heavyiron
|
|
|
|
; v1.2 - v1.55 - new desighn and functionality by Leency
|
2013-09-03 01:10:08 +04:00
|
|
|
; v1.1 - add change time support by DedOK
|
|
|
|
; v1.0 - written in pure assembler by Ivushkin Andrey aka Willow
|
|
|
|
; also - diamond, spraid, fedesco
|
2006-01-03 12:43:31 +03:00
|
|
|
;
|
2013-09-03 01:10:08 +04:00
|
|
|
; Created: November 1, 2004
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
2013-09-06 02:19:50 +04:00
|
|
|
use32
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2013-09-06 02:19:50 +04:00
|
|
|
org 0x0
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2013-09-06 02:19:50 +04:00
|
|
|
db 'MENUET01'
|
|
|
|
dd 0x01
|
|
|
|
dd START
|
|
|
|
dd I_END
|
|
|
|
dd 0x1000
|
|
|
|
dd 0x1000
|
|
|
|
dd 0x0
|
|
|
|
dd 0x0
|
|
|
|
include '..\..\..\macros.inc'
|
2006-01-03 12:43:31 +03:00
|
|
|
include 'lang.inc'
|
2013-09-03 01:10:08 +04:00
|
|
|
include 'data.inc'
|
2007-05-10 17:48:35 +04:00
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
2013-09-04 01:16:37 +04:00
|
|
|
macro ShowFocus field,reg
|
2006-01-03 12:43:31 +03:00
|
|
|
{
|
|
|
|
local .nofocus, .exit
|
|
|
|
cmp [focus],field
|
|
|
|
jne .nofocus
|
|
|
|
if reg eq
|
2013-09-05 00:59:29 +04:00
|
|
|
mov ecx,COL_ACTIVE_TEXT
|
2006-01-03 12:43:31 +03:00
|
|
|
else
|
2013-09-05 00:59:29 +04:00
|
|
|
mov reg,COL_ACTIVE_TEXT
|
2006-01-03 12:43:31 +03:00
|
|
|
end if
|
|
|
|
jmp .exit
|
|
|
|
.nofocus:
|
|
|
|
if reg eq
|
2013-09-04 01:16:37 +04:00
|
|
|
mov ecx,COL_DROPDOWN_T
|
2006-01-03 12:43:31 +03:00
|
|
|
else
|
2013-09-04 01:16:37 +04:00
|
|
|
mov reg,COL_DROPDOWN_T
|
2006-01-03 12:43:31 +03:00
|
|
|
end if
|
|
|
|
.exit:
|
|
|
|
}
|
|
|
|
|
2013-09-04 01:16:37 +04:00
|
|
|
macro GetSkinHeight
|
|
|
|
{
|
|
|
|
mov eax,48
|
|
|
|
mov ebx,4
|
|
|
|
int 0x40
|
|
|
|
}
|
2013-09-03 01:10:08 +04:00
|
|
|
|
2013-09-06 02:19:50 +04:00
|
|
|
macro DrawRect color1,color2,color3,color4 ; pizdec... but optimized well
|
|
|
|
{
|
|
|
|
; top border-outer
|
|
|
|
push ebx
|
|
|
|
push ecx
|
|
|
|
mov eax,13
|
|
|
|
mov bx,DATE_BUTTON_WIDTH
|
|
|
|
mov edx,color1
|
|
|
|
mov cx,1
|
|
|
|
mcall
|
|
|
|
; left border-outer
|
|
|
|
mov bx,1
|
|
|
|
mov cx,DATE_BUTTON_HEIGHT
|
|
|
|
mcall
|
|
|
|
; top border-inner
|
|
|
|
mov edx,color2
|
|
|
|
add ebx,1 shl 16
|
|
|
|
add ecx,1 shl 16
|
|
|
|
mov bx,DATE_BUTTON_WIDTH-1
|
|
|
|
mov cx,1
|
|
|
|
; left border-inner
|
|
|
|
mcall
|
|
|
|
mov bx,1
|
|
|
|
mov cx,DATE_BUTTON_HEIGHT-2
|
|
|
|
mcall
|
|
|
|
; inner
|
|
|
|
mov edx,color3
|
|
|
|
add ebx,1 shl 16
|
|
|
|
add ecx,1 shl 16
|
|
|
|
mov bx,DATE_BUTTON_WIDTH-4
|
|
|
|
mov cx,DATE_BUTTON_HEIGHT-4
|
|
|
|
mcall
|
|
|
|
; bottom border-inner
|
|
|
|
mov edx,color4
|
|
|
|
add ebx,DATE_BUTTON_WIDTH shl 16
|
|
|
|
sub ebx,4 shl 16
|
|
|
|
mov bx,1
|
|
|
|
mov cx,DATE_BUTTON_HEIGHT-3
|
|
|
|
mcall
|
|
|
|
; rgiht border-outer
|
|
|
|
mov edx,color2
|
|
|
|
add ebx,1 shl 16
|
|
|
|
sub ecx,1 shl 16
|
|
|
|
add cx,1
|
|
|
|
mcall
|
|
|
|
; bottom border-outer
|
|
|
|
mov edx,color2
|
|
|
|
pop ecx
|
|
|
|
pop ebx
|
|
|
|
add ecx,DATE_BUTTON_HEIGHT shl 16
|
|
|
|
sub ecx,1 shl 16
|
|
|
|
add ebx,1 shl 16
|
|
|
|
mov cx,1
|
|
|
|
mcall
|
|
|
|
; left border-outer
|
|
|
|
mov edx,color4
|
|
|
|
add ebx,1 shl 16
|
|
|
|
sub ecx,1 shl 16
|
|
|
|
sub bx,2
|
|
|
|
mcall
|
|
|
|
}
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
str2int:
|
|
|
|
xor eax,eax
|
|
|
|
lodsb
|
|
|
|
mov ebx,eax
|
|
|
|
shr ebx,4
|
|
|
|
and eax,0xf
|
|
|
|
imul ebx,10
|
|
|
|
add al,bl
|
|
|
|
ret
|
|
|
|
|
2013-09-06 02:19:50 +04:00
|
|
|
START:
|
2006-01-03 12:43:31 +03:00
|
|
|
mcall 29
|
|
|
|
mov [datestr],eax
|
|
|
|
mov esi,datestr
|
|
|
|
call str2int
|
|
|
|
add eax,1900
|
|
|
|
mov [Year],eax
|
|
|
|
call str2int
|
|
|
|
dec eax
|
|
|
|
mov [Month],eax
|
|
|
|
call str2int
|
|
|
|
mov [day_sel],eax
|
|
|
|
test byte[esi],0
|
|
|
|
jnz .no2000
|
|
|
|
add [Year],100
|
2013-09-06 02:19:50 +04:00
|
|
|
mov eax,[Year]
|
|
|
|
mov [curYear], eax
|
|
|
|
mov eax,[Month]
|
|
|
|
mov [curMonth], eax
|
|
|
|
mov eax,[day_sel]
|
|
|
|
mov [curDay], eax
|
2006-01-03 12:43:31 +03:00
|
|
|
.no2000:
|
2013-09-06 02:19:50 +04:00
|
|
|
jmp upd
|
|
|
|
red:
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2013-09-03 01:10:08 +04:00
|
|
|
call draw_window
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2013-09-06 02:19:50 +04:00
|
|
|
still:
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2013-09-04 01:16:37 +04:00
|
|
|
mcall 23,50 ; wait here for event
|
2006-01-03 12:43:31 +03:00
|
|
|
.evt:
|
|
|
|
mov ebp,[focus]
|
2013-09-06 02:19:50 +04:00
|
|
|
cmp eax,1
|
|
|
|
je red
|
|
|
|
cmp eax,2
|
|
|
|
je key
|
|
|
|
cmp eax,3
|
|
|
|
je button
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
|
2007-04-06 03:52:49 +04:00
|
|
|
call draw_clock
|
|
|
|
|
2013-09-06 02:19:50 +04:00
|
|
|
jmp still
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
|
2013-09-04 01:16:37 +04:00
|
|
|
key:
|
|
|
|
mcall 2 ; get pressed key
|
2006-01-03 12:43:31 +03:00
|
|
|
cmp ah,9
|
|
|
|
jne no_tab
|
|
|
|
.tab:
|
|
|
|
cmp ebp,FOCUSABLE
|
2013-09-05 00:59:29 +04:00
|
|
|
JAE foc_cycle
|
2006-01-03 12:43:31 +03:00
|
|
|
inc [focus]
|
|
|
|
upd:
|
|
|
|
call calculate
|
|
|
|
jmp red
|
|
|
|
foc_cycle:
|
|
|
|
mov [focus],2
|
|
|
|
jmp upd
|
|
|
|
no_tab:
|
|
|
|
push eax
|
|
|
|
shr eax,8
|
|
|
|
mov ecx,12
|
|
|
|
mov edi,Fkeys
|
|
|
|
repne scasb
|
|
|
|
pop eax
|
|
|
|
jnz .noFkey
|
|
|
|
sub edi,Fkeys+1
|
|
|
|
mov [Month],edi
|
|
|
|
jmp upd
|
|
|
|
.noFkey:
|
|
|
|
cmp ebp,2
|
|
|
|
jne .nomonth
|
|
|
|
cmp ah,177
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
je noclose.drop
|
2006-01-03 12:43:31 +03:00
|
|
|
jmp still
|
|
|
|
.nomonth:
|
|
|
|
cmp ebp,3
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
je noy_up.year_evt
|
2013-09-05 00:59:29 +04:00
|
|
|
cmp ebp,4
|
2006-01-03 12:43:31 +03:00
|
|
|
jne still
|
|
|
|
mov ebx,[day_sel]
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
cmp ah,176 ; left arrow
|
|
|
|
jb still
|
2006-01-03 12:43:31 +03:00
|
|
|
cmp ah,179
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
ja still
|
2006-01-03 12:43:31 +03:00
|
|
|
shr eax,8
|
|
|
|
sub eax,176
|
|
|
|
movsx ecx,byte[day_bounds+eax*2]
|
|
|
|
movzx eax,byte[day_bounds+eax*2+1]
|
|
|
|
add ecx,ebx
|
|
|
|
test eax,eax
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
jz .chk0
|
2006-01-03 12:43:31 +03:00
|
|
|
cmp ecx,eax
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
ja still
|
2006-01-03 12:43:31 +03:00
|
|
|
.ok:
|
|
|
|
mov [day_sel],ecx
|
|
|
|
call draw_days
|
2013-09-06 02:19:50 +04:00
|
|
|
jmp still
|
2006-01-03 12:43:31 +03:00
|
|
|
.chk0:
|
|
|
|
cmp ecx,eax
|
|
|
|
jle still
|
|
|
|
jmp .ok
|
|
|
|
|
|
|
|
day_bounds db -1,0,7,0,-7,0,1,0 ; left,down,up,right
|
|
|
|
|
2013-09-04 01:16:37 +04:00
|
|
|
button:
|
2013-09-06 02:19:50 +04:00
|
|
|
mcall 17
|
2006-01-03 12:43:31 +03:00
|
|
|
movzx ebx,ah
|
|
|
|
cmp ah,200
|
|
|
|
jbe nodayselect
|
|
|
|
sub ah,200
|
|
|
|
mov byte[day_sel],ah
|
|
|
|
cmp ebp,5
|
|
|
|
jne .redraw
|
|
|
|
call draw_days
|
|
|
|
jmp still
|
|
|
|
.redraw:
|
2013-09-05 00:59:29 +04:00
|
|
|
mov [focus],4
|
2006-01-03 12:43:31 +03:00
|
|
|
jmp red
|
|
|
|
nodayselect:
|
|
|
|
cmp ah,100
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
jb no_list
|
2006-01-03 12:43:31 +03:00
|
|
|
sub ah,100
|
|
|
|
mov byte[Month],ah
|
|
|
|
mov [focus],2
|
|
|
|
jmp upd
|
|
|
|
no_list:
|
2013-09-06 02:19:50 +04:00
|
|
|
cmp ah,1
|
|
|
|
jne noclose
|
2006-01-03 12:43:31 +03:00
|
|
|
close:
|
2013-09-06 02:19:50 +04:00
|
|
|
mcall -1 ; clore programm
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
noclose:
|
2007-04-06 03:52:49 +04:00
|
|
|
|
|
|
|
cmp ah,72
|
|
|
|
je plus_he
|
|
|
|
|
|
|
|
cmp ah,73
|
|
|
|
je plus_hd
|
|
|
|
|
|
|
|
cmp ah,74
|
|
|
|
je minus_he
|
|
|
|
|
|
|
|
cmp ah,75
|
|
|
|
je minus_hd
|
|
|
|
|
|
|
|
cmp ah,76
|
|
|
|
je plus_me
|
|
|
|
|
|
|
|
cmp ah,77
|
|
|
|
je plus_md
|
|
|
|
|
|
|
|
cmp ah,78
|
|
|
|
je minus_me
|
|
|
|
|
|
|
|
cmp ah,79
|
|
|
|
je minus_md
|
|
|
|
|
|
|
|
cmp ah,80
|
|
|
|
je reset
|
|
|
|
|
2007-05-10 17:48:35 +04:00
|
|
|
cmp ah,81
|
|
|
|
je set_date
|
2007-04-06 03:52:49 +04:00
|
|
|
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
cmp ah,2 ; drop down list
|
2006-01-03 12:43:31 +03:00
|
|
|
jne no_dropdn
|
|
|
|
.drop:
|
|
|
|
mov [focus],2
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
cmp [dropped],al ; ==0
|
2006-01-03 12:43:31 +03:00
|
|
|
jne red
|
|
|
|
call draw_window
|
|
|
|
mov edx,1 shl 31+231
|
|
|
|
mov ecx,31
|
|
|
|
mov eax,8
|
|
|
|
.bremove:
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
dec edx
|
|
|
|
loop .bremove
|
|
|
|
call draw_dropdown
|
|
|
|
jmp still
|
|
|
|
no_dropdn:
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
cmp ah,3 ; year -1
|
2006-01-03 12:43:31 +03:00
|
|
|
jne noy_dn
|
|
|
|
year_dec:
|
|
|
|
dec [Year]
|
2013-09-05 00:59:29 +04:00
|
|
|
mov [focus],3
|
2006-01-03 12:43:31 +03:00
|
|
|
jmp upd
|
|
|
|
noy_dn:
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
cmp ah,4 ; year+1
|
2006-01-03 12:43:31 +03:00
|
|
|
jne noy_up
|
|
|
|
year_inc:
|
|
|
|
inc [Year]
|
2013-09-05 00:59:29 +04:00
|
|
|
mov [focus],3
|
2006-01-03 12:43:31 +03:00
|
|
|
jmp upd
|
|
|
|
noy_up:
|
|
|
|
cmp ah,5
|
|
|
|
jne noy_click
|
|
|
|
mov [focus],3
|
|
|
|
call draw_window
|
|
|
|
.still:
|
|
|
|
mcall 10
|
|
|
|
cmp eax,2
|
|
|
|
jne still.evt
|
|
|
|
mcall 2
|
|
|
|
.year_evt:
|
2013-09-05 00:59:29 +04:00
|
|
|
cmp ah,176
|
|
|
|
je year_dec
|
|
|
|
cmp ah,179
|
|
|
|
je year_inc
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
mov ebx,10
|
|
|
|
cmp ah,9
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
je key.tab
|
|
|
|
cmp ah,8 ; backspace
|
2006-01-03 12:43:31 +03:00
|
|
|
jne .nobsp
|
|
|
|
mov eax,[Year]
|
|
|
|
xor edx,edx
|
|
|
|
div ebx
|
|
|
|
.ch_year:
|
|
|
|
mov [Year],eax
|
|
|
|
call draw_year
|
|
|
|
jmp .still
|
|
|
|
.nobsp:
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
cmp ah,13 ; enter
|
|
|
|
je upd
|
2006-01-03 12:43:31 +03:00
|
|
|
cmp ah,182
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
jne .noclear ; del
|
2006-01-03 12:43:31 +03:00
|
|
|
xor eax,eax
|
|
|
|
jmp .ch_year
|
|
|
|
.noclear:
|
|
|
|
cmp ah,48
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
jb .still
|
2006-01-03 12:43:31 +03:00
|
|
|
cmp ah,57
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
ja .still
|
2006-01-03 12:43:31 +03:00
|
|
|
cmp [Year],1000
|
|
|
|
jae .still
|
|
|
|
shr eax,8
|
|
|
|
lea ecx,[eax-48]
|
|
|
|
mov eax,[Year]
|
|
|
|
imul eax,ebx
|
|
|
|
add eax,ecx
|
|
|
|
jmp .ch_year
|
|
|
|
noy_click:
|
|
|
|
cmp ah,10
|
2013-09-06 02:19:50 +04:00
|
|
|
jne START
|
2006-01-03 12:43:31 +03:00
|
|
|
xor [new_style],1
|
|
|
|
jmp upd
|
|
|
|
|
|
|
|
|
2007-04-06 03:52:49 +04:00
|
|
|
reset:
|
2013-09-05 00:59:29 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
|
|
|
shl ecx,16
|
|
|
|
shr ecx,16
|
2013-09-05 00:59:29 +04:00
|
|
|
mcall 22,0x00000000
|
2007-04-06 03:52:49 +04:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
plus_hd:
|
2013-09-04 01:16:37 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
|
|
|
add ecx,1
|
2013-09-04 01:16:37 +04:00
|
|
|
mcall 22,0x00000000
|
2007-04-06 03:52:49 +04:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
plus_he:
|
2013-09-04 01:16:37 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
|
|
|
add ecx,16
|
2013-09-04 01:16:37 +04:00
|
|
|
mcall 22,0x00000000
|
2007-04-06 03:52:49 +04:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
minus_hd:
|
2013-09-04 01:16:37 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
|
|
|
sub ecx,1
|
2013-09-05 00:59:29 +04:00
|
|
|
mcall 22,0x00000000
|
2007-04-06 03:52:49 +04:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
minus_he:
|
2013-09-05 00:59:29 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
|
|
|
sub ecx,16
|
2013-09-05 00:59:29 +04:00
|
|
|
mcall 22,0x00000000
|
2007-04-06 03:52:49 +04:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
plus_md:
|
2013-09-05 00:59:29 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
|
|
|
add ecx,256
|
2013-09-05 00:59:29 +04:00
|
|
|
mcall 22,0x00000000
|
2007-04-06 03:52:49 +04:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
plus_me:
|
2013-09-03 01:10:08 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
|
|
|
add ecx,4096
|
2013-09-03 01:10:08 +04:00
|
|
|
mcall 22,0x00000000
|
2007-04-06 03:52:49 +04:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
minus_md:
|
2013-09-03 01:10:08 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
|
|
|
sub ecx,256
|
2013-09-03 01:10:08 +04:00
|
|
|
mcall 22,0x00000000
|
2007-04-06 03:52:49 +04:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
minus_me:
|
2013-09-03 01:10:08 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
|
|
|
sub ecx,4096
|
2013-09-03 01:10:08 +04:00
|
|
|
mcall 22,0x00000000
|
2007-04-06 03:52:49 +04:00
|
|
|
jmp still
|
|
|
|
|
2007-05-10 17:48:35 +04:00
|
|
|
set_date:
|
|
|
|
mov eax,0x00000000
|
|
|
|
mov ebx,[day_sel]
|
|
|
|
call additem
|
|
|
|
shl eax,8
|
|
|
|
mov ebx,[Month]
|
|
|
|
add ebx,1
|
|
|
|
call additem
|
|
|
|
shl eax,8
|
|
|
|
mov ebx,[Year]
|
|
|
|
call additem
|
|
|
|
mov ecx,eax
|
2013-09-05 00:59:29 +04:00
|
|
|
mcall 22,1
|
2013-09-08 18:17:38 +04:00
|
|
|
jmp START
|
2007-05-10 17:48:35 +04:00
|
|
|
|
|
|
|
additem:
|
|
|
|
add eax,1
|
|
|
|
daa
|
|
|
|
sub ebx,1
|
|
|
|
cmp ebx,0
|
|
|
|
jne additem
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
; *********************************************
|
2013-09-08 18:17:38 +04:00
|
|
|
; ******* DRAW WINDOW *******
|
2006-01-03 12:43:31 +03:00
|
|
|
; *********************************************
|
|
|
|
|
2007-04-06 03:52:49 +04:00
|
|
|
draw_clock:
|
|
|
|
|
2013-09-03 01:10:08 +04:00
|
|
|
mcall 3
|
2007-04-06 03:52:49 +04:00
|
|
|
mov ecx,eax
|
2013-09-08 18:17:38 +04:00
|
|
|
mcall 47,0x00020100, ,195*65536+287,0x50000000,COL_WINDOW_BG
|
2007-04-06 03:52:49 +04:00
|
|
|
|
|
|
|
shr ecx,8
|
2013-09-07 09:27:08 +04:00
|
|
|
add edx,22*65536
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
|
|
|
|
|
|
|
shr ecx,8
|
2013-09-07 09:27:08 +04:00
|
|
|
add edx,22*65536
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
|
|
|
ret
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
draw_window:
|
|
|
|
|
2013-09-04 01:16:37 +04:00
|
|
|
mcall 12,1
|
2013-09-08 18:17:38 +04:00
|
|
|
mcall 48,5 ;get screen size
|
|
|
|
mov ecx, ebx
|
|
|
|
sub ecx, WIN_H
|
|
|
|
shl ecx, 16
|
|
|
|
add ecx, WIN_H
|
|
|
|
mov ebx, eax
|
|
|
|
sub eax, WIN_W
|
|
|
|
shl ebx, 16
|
|
|
|
add ebx, WIN_W
|
|
|
|
mcall 0,,,COL_WINDOW_BG, ,title ; define window
|
2013-09-04 01:16:37 +04:00
|
|
|
GetSkinHeight
|
|
|
|
mov ecx, eax
|
|
|
|
shl ecx, 16
|
|
|
|
add ecx, 43
|
|
|
|
mcall 13,B_WBAR_X, ,COL_TOOLBAR_BG ; draw toolbar background
|
2006-01-03 12:43:31 +03:00
|
|
|
call draw_week
|
2013-09-08 18:17:38 +04:00
|
|
|
mcall 8,193*65536+8,272*65536+10,72,COL_DATE_BUTTONS
|
|
|
|
mov ebx,202*65536+8
|
|
|
|
inc edx ;73
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-08 18:17:38 +04:00
|
|
|
mov ebx,193*65536+8
|
2013-09-07 09:27:08 +04:00
|
|
|
mov ecx,298*65536+10
|
2013-09-08 18:17:38 +04:00
|
|
|
inc edx ;74
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-08 18:17:38 +04:00
|
|
|
mov ebx,202*65536+8
|
|
|
|
inc edx ;75
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-08 18:17:38 +04:00
|
|
|
mov ebx,215*65536+8
|
2013-09-07 09:27:08 +04:00
|
|
|
mov ecx,272*65536+10
|
2013-09-08 18:17:38 +04:00
|
|
|
inc edx ;76
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-08 18:17:38 +04:00
|
|
|
mov ebx,224*65536+8
|
|
|
|
inc edx ;77
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-08 18:17:38 +04:00
|
|
|
mov ebx,215*65536+8
|
2013-09-07 09:27:08 +04:00
|
|
|
mov ecx,298*65536+10
|
2013-09-08 18:17:38 +04:00
|
|
|
inc edx ;78
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-08 18:17:38 +04:00
|
|
|
mov ebx,224*65536+8
|
|
|
|
inc edx ;79
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-08 18:17:38 +04:00
|
|
|
mov ebx,237*65536+21
|
2013-09-07 09:27:08 +04:00
|
|
|
mov ecx,273*65536+35
|
2013-09-08 18:17:38 +04:00
|
|
|
inc edx ;80
|
2013-09-07 09:27:08 +04:00
|
|
|
or edx,0x40000000
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-08 18:17:38 +04:00
|
|
|
mov ebx,25*65536+110
|
2013-09-03 01:10:08 +04:00
|
|
|
mov ecx,285*65536+22
|
2013-09-04 01:16:37 +04:00
|
|
|
mov esi,COL_DATE_BUTTONS
|
2013-09-07 09:27:08 +04:00
|
|
|
mov edx,81
|
2007-05-10 17:48:35 +04:00
|
|
|
mcall
|
|
|
|
|
2013-09-04 01:16:37 +04:00
|
|
|
mov esi,COL_MONTH_YEAR_B ; new style
|
2006-01-03 12:43:31 +03:00
|
|
|
mov edx,10
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
or edx,1 shl 29+1 shl 30
|
2006-01-03 12:43:31 +03:00
|
|
|
mov ebx,B_NS_X
|
|
|
|
mov ecx,B_NS_Y
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
add edx,1-1 shl 29
|
|
|
|
mov ebx,B_TODAY_X+8*(today_end-today_msg)
|
|
|
|
mov ecx,B_TODAY_Y
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
mov ecx,B_Y
|
|
|
|
mov ebx,B_MONTH_X
|
|
|
|
mov edx,2
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-04 01:16:37 +04:00
|
|
|
mov ebx,B_SPIN_X ; <
|
2006-01-03 12:43:31 +03:00
|
|
|
inc edx
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2013-09-04 01:16:37 +04:00
|
|
|
add ebx,61 shl 16 ; >
|
2006-01-03 12:43:31 +03:00
|
|
|
inc edx
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
call draw_days
|
|
|
|
|
2013-09-06 02:19:50 +04:00
|
|
|
; draw text in window
|
2013-09-08 18:17:38 +04:00
|
|
|
mcall 4,157*65536+287,0x80000000,sys_text
|
|
|
|
mcall ,211*65536+287,,separator
|
|
|
|
mcall ,233*65536+287
|
|
|
|
mcall ,185*65536+274, ,plus
|
|
|
|
mcall ,185*65536+300, ,minus
|
|
|
|
mcall , 35*65536+292,0x00000000,set_date_t,15 ;set date text
|
2007-04-06 03:52:49 +04:00
|
|
|
|
2013-09-07 09:27:08 +04:00
|
|
|
|
2013-09-06 02:19:50 +04:00
|
|
|
mov ecx,0x10ddeeff
|
2006-01-03 12:43:31 +03:00
|
|
|
mov edx,n_style
|
|
|
|
mov esi,ns_end-n_style
|
|
|
|
mov ebx,B_NS
|
|
|
|
cmp [new_style],1
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
je .high
|
2006-01-03 12:43:31 +03:00
|
|
|
mov ecx,0xa0a0a0
|
|
|
|
jmp .int
|
|
|
|
.high:
|
2013-09-03 01:10:08 +04:00
|
|
|
mov ecx,COL_NEW_STYLE_T
|
2006-01-03 12:43:31 +03:00
|
|
|
.int:
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
2013-09-03 01:10:08 +04:00
|
|
|
mov ecx,COL_GO_TODAY_T
|
2006-01-03 12:43:31 +03:00
|
|
|
mov edx,today_msg
|
|
|
|
mov ebx,B_TODAY
|
|
|
|
mov esi,today_end-today_msg
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
mov ebx,B_SPIN
|
|
|
|
mov edx,spinner
|
2013-09-04 01:16:37 +04:00
|
|
|
mov esi,12
|
2013-09-05 00:59:29 +04:00
|
|
|
mov ecx,COL_DROPDOWN_T
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
mov edx,[Month]
|
|
|
|
movzx esi,byte[month_name]
|
|
|
|
imul edx,esi
|
|
|
|
add edx,month_name+1
|
|
|
|
mov ebx,B_MONTH
|
|
|
|
ShowFocus 2
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
call draw_year
|
2013-09-08 23:50:52 +04:00
|
|
|
call draw_clock
|
2006-01-03 12:43:31 +03:00
|
|
|
mov [dropped],0
|
2013-09-03 01:10:08 +04:00
|
|
|
mcall 12,2
|
2013-09-04 01:16:37 +04:00
|
|
|
ret
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
draw_year:
|
2013-09-03 01:10:08 +04:00
|
|
|
mcall 8,B_YEAR_X,B_Y,5,COL_MONTH_YEAR_B
|
2006-01-03 12:43:31 +03:00
|
|
|
ShowFocus 3,esi
|
|
|
|
mcall 47,0x40001,Year,B_YEAR
|
|
|
|
ret
|
|
|
|
|
|
|
|
draw_dropdown:
|
|
|
|
mov [dropped],1
|
|
|
|
push [Month]
|
|
|
|
pop [focus]
|
|
|
|
add [focus],100
|
|
|
|
mov ecx,12
|
|
|
|
mov edx,100
|
|
|
|
push dword month_name+1
|
|
|
|
push dword B_DROP
|
|
|
|
push dword B_Y+16 shl 16
|
|
|
|
.ddd_loop:
|
|
|
|
mov edi,edx
|
|
|
|
push ecx
|
2013-09-04 01:16:37 +04:00
|
|
|
mov esi,COL_DROPDOWN_BG
|
|
|
|
mcall 8,B_MONTH_X,[esp+4]
|
2006-01-03 12:43:31 +03:00
|
|
|
shr eax,1
|
|
|
|
mov ebx,[esp+8]
|
|
|
|
xchg edx,[esp+12]
|
|
|
|
movzx esi,byte[month_name]
|
|
|
|
ShowFocus edi
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
add edx,esi
|
|
|
|
xchg edx,[esp+12]
|
|
|
|
add dword[esp+8],16
|
|
|
|
add dword[esp+4],16 shl 16
|
|
|
|
inc edx
|
|
|
|
pop ecx
|
|
|
|
loop .ddd_loop
|
|
|
|
add esp,12
|
|
|
|
ret
|
|
|
|
|
|
|
|
draw_week:
|
|
|
|
mov eax,13
|
|
|
|
mov ebx,B_WBAR_X
|
|
|
|
mov ecx,B_WBAR_Y
|
2013-09-03 01:10:08 +04:00
|
|
|
mov edx,COL_WEEKDAY_BG
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
movzx esi,byte[week_days]
|
|
|
|
movzx edi,byte[week_days+1]
|
|
|
|
mov ebx,B_WEEK
|
|
|
|
mov ecx,7
|
|
|
|
mov edx,week_days+2
|
|
|
|
mov eax,4
|
|
|
|
.week:
|
|
|
|
push ecx
|
|
|
|
cmp ecx,edi
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
je .holiday
|
2006-01-03 12:43:31 +03:00
|
|
|
mov ecx,0x10000000
|
|
|
|
jmp .noholiday
|
|
|
|
.holiday:
|
|
|
|
mov ecx,0x10cc1010
|
|
|
|
.noholiday:
|
2007-04-06 03:52:49 +04:00
|
|
|
mcall
|
2006-01-03 12:43:31 +03:00
|
|
|
add edx,esi
|
|
|
|
add ebx,B_WX_SHIFT
|
|
|
|
pop ecx
|
|
|
|
loop .week
|
|
|
|
ret
|
|
|
|
|
|
|
|
draw_days:
|
|
|
|
call count_days
|
|
|
|
cmp ecx,[day_sel]
|
|
|
|
jae .ok
|
|
|
|
mov [day_sel],ecx
|
|
|
|
.ok:
|
|
|
|
mov [number],0
|
|
|
|
mov eax,47
|
|
|
|
mov edx,B_DAYS_Y
|
2013-09-04 01:16:37 +04:00
|
|
|
mov ebx,0x10001
|
2006-01-03 12:43:31 +03:00
|
|
|
mov edi,[firstday]
|
|
|
|
.dayloop:
|
|
|
|
push ecx
|
|
|
|
movzx edx,dx
|
|
|
|
mov esi,edi
|
|
|
|
shl esi,21
|
2013-09-04 01:16:37 +04:00
|
|
|
lea edx,[edx+esi+34 shl 16]
|
2006-01-03 12:43:31 +03:00
|
|
|
mov ecx,edi
|
|
|
|
add cl,[week_days+1]
|
|
|
|
cmp ecx,7
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
je .holiday
|
2013-09-06 02:19:50 +04:00
|
|
|
mov esi,0x10313138 ; COL_DATE_TEXT
|
2006-01-03 12:43:31 +03:00
|
|
|
jmp .noholiday
|
|
|
|
.holiday:
|
|
|
|
mov esi,0x10cc1010
|
|
|
|
.noholiday:
|
|
|
|
mov ecx,number
|
|
|
|
inc dword[ecx]
|
|
|
|
pusha
|
|
|
|
mov ebx,edx
|
2013-09-06 02:19:50 +04:00
|
|
|
mov bx,DATE_BUTTON_WIDTH-1
|
2013-09-03 01:10:08 +04:00
|
|
|
sub ebx,8 shl 16
|
2006-01-03 12:43:31 +03:00
|
|
|
shrd ecx,edx,16
|
2013-09-06 02:19:50 +04:00
|
|
|
mov cx,DATE_BUTTON_HEIGHT-1
|
2013-09-03 01:10:08 +04:00
|
|
|
sub ecx,12 shl 16
|
2006-01-03 12:43:31 +03:00
|
|
|
mov edx,[number]
|
|
|
|
cmp edx,[day_sel]
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
je .draw_sel
|
2013-09-03 01:10:08 +04:00
|
|
|
mov esi,COL_DATE_BUTTONS
|
2006-01-03 12:43:31 +03:00
|
|
|
jmp .draw_but
|
2013-09-06 02:19:50 +04:00
|
|
|
.draw_sel: ;draw selected button
|
|
|
|
add edx,1 shl 30
|
|
|
|
add edx,200+1 shl 29
|
|
|
|
mcall 8
|
2013-09-05 00:59:29 +04:00
|
|
|
cmp [focus],4
|
2013-09-06 02:19:50 +04:00
|
|
|
jne .not_active
|
|
|
|
DrawRect COL_DATE_ACTIVE_1,COL_DATE_ACTIVE_2,COL_DATE_ACTIVE_3,COL_DATE_ACTIVE_4
|
2013-09-06 21:06:53 +04:00
|
|
|
jmp .out
|
2013-09-06 02:19:50 +04:00
|
|
|
.not_active:
|
|
|
|
DrawRect COL_DATE_INACTIVE_1,COL_DATE_INACTIVE_2,COL_DATE_INACTIVE_3,COL_DATE_INACTIVE_4
|
2013-09-06 21:06:53 +04:00
|
|
|
jmp .out
|
2013-09-06 02:19:50 +04:00
|
|
|
.draw_but: ;draw non selected button
|
2006-01-03 12:43:31 +03:00
|
|
|
add edx,200+1 shl 29
|
2013-09-04 01:16:37 +04:00
|
|
|
mcall 8
|
2013-09-06 02:19:50 +04:00
|
|
|
mov eax,[Year]
|
|
|
|
cmp [curYear],eax
|
|
|
|
jne .out
|
|
|
|
mov eax,[Month]
|
|
|
|
cmp [curMonth],eax
|
|
|
|
jne .out
|
|
|
|
mov eax,[number]
|
|
|
|
cmp [curDay],eax
|
|
|
|
jne .out
|
2013-09-06 21:06:53 +04:00
|
|
|
mov edx,0xff0000
|
|
|
|
mov bx,DATE_BUTTON_WIDTH-2
|
|
|
|
mov cx,2
|
|
|
|
add ebx,1 shl 16
|
|
|
|
add ecx,27 shl 16
|
|
|
|
mcall 13
|
2013-09-06 02:19:50 +04:00
|
|
|
.out:
|
2013-09-04 01:16:37 +04:00
|
|
|
mov eax, [number]
|
|
|
|
xor edx, edx
|
|
|
|
mov ecx, 10
|
|
|
|
div ecx
|
|
|
|
mov [remainder], edx
|
|
|
|
mov [quotient], eax
|
|
|
|
popa
|
|
|
|
|
|
|
|
;first number
|
|
|
|
mov ecx,quotient
|
|
|
|
mcall
|
2013-09-03 01:10:08 +04:00
|
|
|
add edx,1 shl 16
|
|
|
|
mcall
|
|
|
|
sub edx,1 shl 16
|
2013-09-04 01:16:37 +04:00
|
|
|
|
|
|
|
;second number
|
|
|
|
mov ecx,remainder
|
|
|
|
add edx,9 shl 16
|
|
|
|
mcall
|
|
|
|
add edx,1 shl 16
|
|
|
|
mcall
|
|
|
|
sub edx,10 shl 16
|
|
|
|
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
pop ecx
|
|
|
|
inc edi
|
|
|
|
cmp edi,7
|
|
|
|
jne .nowrap
|
|
|
|
xor edi,edi
|
|
|
|
add dx,B_DAYS_SHIFT
|
|
|
|
.nowrap:
|
|
|
|
loop .eloop
|
|
|
|
jmp .ex
|
|
|
|
.eloop:
|
|
|
|
jmp .dayloop
|
|
|
|
.ex:
|
|
|
|
ret
|
|
|
|
|
|
|
|
count_days: ; ecx -days in month
|
|
|
|
call is_leap_year
|
|
|
|
mov ecx,[Month]
|
|
|
|
mov eax,1
|
|
|
|
movzx ecx,byte[day_count+ecx]
|
|
|
|
add ecx,28
|
|
|
|
cmp eax,[leap_year]
|
|
|
|
jne .noleap
|
|
|
|
cmp eax,[Month]
|
|
|
|
jne .noleap
|
|
|
|
inc ecx
|
|
|
|
.noleap:
|
|
|
|
mov [day_bounds+3],cl
|
|
|
|
mov [day_bounds+7],cl
|
|
|
|
ret
|
|
|
|
|
|
|
|
is_leap_year:
|
|
|
|
mov [leap_year],0
|
|
|
|
mov eax,[Year]
|
|
|
|
mov bl,100
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
div bl ; ah=Year mod 100, al=Year%100
|
2006-01-03 12:43:31 +03:00
|
|
|
test ah,ah
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
jz .century
|
|
|
|
shr ax,8 ; ax - last 2 digits
|
2006-01-03 12:43:31 +03:00
|
|
|
.century:
|
|
|
|
test al,11b
|
|
|
|
jnz .noleap
|
|
|
|
inc [leap_year]
|
|
|
|
.noleap:
|
|
|
|
ret
|
|
|
|
|
|
|
|
calculate:
|
|
|
|
mov ebx,[Year]
|
|
|
|
mov eax,[Month]
|
|
|
|
sub eax,2
|
|
|
|
jge .nojf
|
|
|
|
dec ebx
|
|
|
|
add eax,12
|
|
|
|
.nojf:
|
|
|
|
add eax,4
|
|
|
|
xor edx,edx
|
|
|
|
mov ecx,153
|
|
|
|
imul cx
|
|
|
|
mov ecx,5
|
|
|
|
div cx
|
|
|
|
inc eax
|
|
|
|
mov ecx,365
|
|
|
|
imul ecx,ebx
|
|
|
|
add eax,ecx
|
|
|
|
mov ecx,ebx
|
|
|
|
shr ecx,2
|
|
|
|
add eax,ecx
|
|
|
|
dec eax
|
|
|
|
cmp [new_style],0
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
je .nonew
|
2006-01-03 12:43:31 +03:00
|
|
|
add eax,2
|
|
|
|
xchg eax,ebx
|
|
|
|
mov ecx,100
|
|
|
|
xor edx,edx
|
|
|
|
div cx
|
|
|
|
sub ebx,eax
|
|
|
|
shr eax,2
|
|
|
|
add ebx,eax
|
|
|
|
.nonew:
|
|
|
|
add ebx,5
|
|
|
|
mov eax,ebx
|
|
|
|
xor edx,edx
|
|
|
|
movzx ebx,byte[week_days+1]
|
|
|
|
sub eax,ebx
|
|
|
|
inc eax
|
|
|
|
mov ebx,7
|
|
|
|
div bx
|
|
|
|
mov [firstday],edx
|
|
|
|
ret
|
|
|
|
|
2013-09-04 01:16:37 +04:00
|
|
|
I_END:
|