1
1

ICON2, @PANEL: changes to perform self-reposition on screen resolution change

@PANEL: display of up to 255 running applications (from Mario79)
VRR: don't kill applications on screen resolution change
GRSCREEN: don't set up system colors (they're taken from skin file now)
DESKTOP: added ability to change window skins 'on the fly' (with preview)

git-svn-id: svn://kolibrios.org@51 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Mihail Semenyako (mike.dld) 2006-03-04 11:44:33 +00:00
parent aa9b0bc44b
commit df5b0209d7
8 changed files with 2506 additions and 2505 deletions
programs
desktop/trunk
grscreen/trunk
icon/trunk
panel/trunk
vrr/trunk

View File

@ -1,9 +1,10 @@
; ;
; UNIFORM WINDOW COLOURS ; UNIFORM WINDOW COLOURS & SKIN
; ;
; Compile with FASM for Menuet ; Compile with FASM for Menuet
; ;
; < russian edition by Ivan Poddubny > ; < russian edition by Ivan Poddubny >
; < skin selection by Mike Semenyako >
; ;
;****************************************************************************** ;******************************************************************************
@ -13,15 +14,55 @@
dd 1 ; header version dd 1 ; header version
dd START ; start address dd START ; start address
dd I_END ; file size dd I_END ; file size
dd 20000h ; memory dd 28000h ; memory
dd 10000h ; stack pointer (0x10000+ - work area for os) dd 10000h ; stack pointer (0x10000+ - work area for os)
dd 0;,0 ; parameters, reserved dd 0;,0 ; parameters, reserved
include 'lang.inc' include 'lang.inc'
include 'macros.inc' include 'macros.inc'
;****************************************************************************** ;******************************************************************************
struct SKIN_HEADER
.ident dd ?
.version dd ?
.params dd ?
.buttons dd ?
.bitmaps dd ?
ends
struct SKIN_PARAMS
.skin_height dd ?
.margin.right dw ?
.margin.left dw ?
.margin.bottom dw ?
.margin.top dw ?
.colors.inner dd ?
.colors.outer dd ?
.colors.frame dd ?
.colors_1.inner dd ?
.colors_1.outer dd ?
.colors_1.frame dd ?
.dtp.size dd ?
.dtp.data db 40 dup (?)
ends
struct SKIN_BUTTONS
.type dd ?
.pos:
.left dw ?
.top dw ?
.size:
.width dw ?
.height dw ?
ends
struct SKIN_BITMAPS
.kind dw ?
.type dw ?
.data dd ?
ends
START: ; start of execution START: ; start of execution
@ -32,14 +73,14 @@ START: ; start of execution
int 0x40 int 0x40
cld cld
mov esi, default_file mov esi,default_skn
mov edi, fname mov edi,fname
mov ecx, default_file.size mov ecx,default_skn.size
rep movsb rep movsb
mov [skin_info.fname],0
mov [skin_info.workarea],0x10000
call load_skin_file
mov [read_info.address], color_table
mov [read_info.workarea], 0x10000
mov [read_info.start_block], 0
red: red:
call draw_window ; at first, draw the window call draw_window ; at first, draw the window
@ -71,6 +112,25 @@ still:
mov eax,17 ; get id mov eax,17 ; get id
int 0x40 int 0x40
cmp ah,11 ; read string
jne no_string
call read_string
jmp still
no_string:
cmp ah,12 ; load file
jne no_load
call load_file
call draw_window
jmp still
no_load:
cmp ah,13 ; save file
jne no_save
call save_file
jmp still
no_save:
cmp ah,14 ; set 3d buttons cmp ah,14 ; set 3d buttons
jne no_3d jne no_3d
mov eax,48 mov eax,48
@ -91,8 +151,9 @@ still:
jmp still jmp still
no_flat: no_flat:
cmp ah,51 ; apply cmp ah,16 ; apply
jne no_apply jne no_apply
apply_direct:
mov eax,48 mov eax,48
mov ebx,2 mov ebx,2
mov ecx,color_table mov ecx,color_table
@ -104,6 +165,22 @@ still:
int 0x40 int 0x40
no_apply: no_apply:
cmp ah,17 ; load skin file
jne no_load_skin
call load_skin_file
call draw_window
jmp still
no_load_skin:
cmp ah,18 ; apply skin
jne no_apply_skin
cmp [skin_info.fname],0
je no_apply_skin
mcall 48,8,skin_info
call draw_window
jmp still
no_apply_skin:
cmp ah,31 cmp ah,31
jb no_new_colour jb no_new_colour
cmp ah,41 cmp ah,41
@ -124,25 +201,6 @@ still:
int 0x40 int 0x40
noid1: noid1:
cmp ah,11 ; read string
jne no_string
call read_string
jmp still
no_string:
cmp ah,12 ; load file
jne no_load
call load_file
call draw_window
jmp still
no_load:
cmp ah,13 ; save file
jne no_save
call save_file
jmp still
no_save:
jmp still jmp still
@ -174,9 +232,9 @@ draw_cursor:
cmp ebx,32 cmp ebx,32
jbe no_color jbe no_color
cmp ebx,280 ; CHANGE COLOR cmp ebx,266 ; CHANGE COLOR
jb no_color jb no_color
cmp ebx,280+20*3 cmp ebx,266+20*3
jg no_color jg no_color
cmp ecx,30+128 cmp ecx,30+128
@ -184,7 +242,7 @@ draw_cursor:
cmp ecx,30 cmp ecx,30
jb no_color jb no_color
sub ebx,280 sub ebx,266
mov eax,ebx mov eax,ebx
cdq cdq
mov ebx,20 mov ebx,20
@ -211,11 +269,47 @@ draw_cursor:
load_file: load_file:
pushad pushad
mov [read_info.mode], 0 mov [read_info.mode] ,0
mov [read_info.blocks], 1 mov [read_info.start_block],0
mov [read_info.blocks] ,1
mov [read_info.address] ,color_table
mov [read_info.workarea] ,0x10000
mcall 58, read_info mcall 58, read_info
call draw_colours popad
ret
load_skin_file:
pushad
mov [read_info.mode] ,0
mov [read_info.start_block],0
mov [read_info.blocks] ,64
mov [read_info.address] ,0x20000
mov [read_info.workarea] ,0x10000
mcall 58, read_info
cmp dword[0x20000+SKIN_HEADER.ident],'SKIN'
jne @f
mov esi,fname
mov edi,skin_info.fname
mov ecx,257
rep movsb
mov esi,0x20000
mov edi,0x18000
mov ecx,0x8000/4
rep movsd
mov ebp,0x18000
mov esi,[ebp+SKIN_HEADER.params]
add esi,ebp
lea esi,[esi+SKIN_PARAMS.dtp.data]
mov edi,color_table
mov ecx,10
rep movsd
@@:
popad popad
ret ret
@ -224,8 +318,10 @@ ret
save_file: save_file:
pushad pushad
mov [write_info.mode], 1 mov [write_info.mode] ,1
mov [write_info.bytes2write], 10*4 mov [write_info.bytes2write],10*4
mov [write_info.address] ,color_table
mov [write_info.workarea] ,0x10000
mcall 58, write_info mcall 58, write_info
popad popad
@ -238,7 +334,7 @@ read_string:
mov edi,fname mov edi,fname
mov al,'_' mov al,'_'
mov ecx,54 mov ecx,87
cld cld
rep stosb rep stosb
@ -270,13 +366,13 @@ read_string:
call print_text call print_text
inc edi inc edi
cmp edi, fname+54 cmp edi, fname+87
jne f11 jne f11
read_done: read_done:
mov ecx, fname mov ecx, fname
add ecx, 55 add ecx, 88
sub ecx, edi sub ecx, edi
mov eax, 0 mov eax, 0
cld cld
@ -292,12 +388,12 @@ read_string:
print_text: print_text:
pushad pushad
mpack ebx, 16, 6*54+4 mpack ebx,15,6*87+4
mpack ecx, 234, 10 mpack ecx,(30+18*10+2),11
mcall 13, , , [w_work] mcall 13,,,[w_work]
mpack ebx, 17, 235 mpack ebx,17,(30+18*10+4)
mcall 4, , [w_work_text], fname, 54 mcall 4,,[w_work_text],fname,87
popad popad
ret ret
@ -308,13 +404,13 @@ draw_color:
pusha pusha
mov eax,13 mov eax,13
mov ebx,280*65536+60 mov ebx,266*65536+60
mov ecx,170*65536+30 mov ecx,170*65536+30
mov edx,[color] mov edx,[color]
int 0x40 int 0x40
; mov eax,13 ; mov eax,13
mov ebx,280*65536+60 mov ebx,266*65536+60
mov ecx,200*65536+10 mov ecx,200*65536+10
mov edx,[w_work] mov edx,[w_work]
int 0x40 int 0x40
@ -322,7 +418,7 @@ draw_color:
mov eax,47 mov eax,47
mov ebx,0+1*256+8*65536 mov ebx,0+1*256+8*65536
mov ecx,[color] mov ecx,[color]
mov edx,280*65536+201 mov edx,272*65536+201
mov esi,[w_work_text] mov esi,[w_work_text]
int 0x40 int 0x40
@ -338,12 +434,12 @@ draw_colours:
mov esi,color_table mov esi,color_table
mov ebx,225*65536+32 mov ebx,225*65536+32
mov ecx,37*65536+12 mov ecx,32*65536+12
newcol: newcol:
mov eax,13 mov eax,13
mov edx,[esi] mov edx,[esi]
int 0x40 int 0x40
add ecx,20*65536 add ecx,18*65536
add esi,4 add esi,4
cmp esi,color_table+4*9 cmp esi,color_table+4*9
jbe newcol jbe newcol
@ -353,6 +449,189 @@ draw_colours:
ret ret
draw_framerect: ; ebx,ecx
push ebx ecx
add bx,[esp+6]
mov cx,[esp+2]
dec ebx
mcall 38
add cx,[esp]
rol ecx,16
add cx,[esp]
sub ecx,0x00010001
mcall
mov ebx,[esp+4]
mov ecx,[esp]
mov bx,[esp+6]
add cx,[esp+2]
dec ecx
mcall
add bx,[esp+4]
rol ebx,16
add bx,[esp+4]
sub ebx,0x00010001
mcall
add esp,8
ret
find_bitmap:
mov edi,[ebp+SKIN_HEADER.bitmaps]
add edi,ebp
xor ebx,ebx
.lp1: cmp dword[edi],0
je .lp2
cmp dword[edi+0],eax
jne @f
mov ebx,[edi+SKIN_BITMAPS.data]
add ebx,ebp
mov ecx,[ebx-2]
mov cx,[ebx+4]
add ebx,8
.lp2: ret
@@: add edi,8
jmp .lp1
draw_skin:
mcall 13,<345,206>,<20,191>,0x00FFFFFF
mov ebp,0x18000
mov edi,[ebp+SKIN_HEADER.params]
add edi,ebp
mpack ebx,345+45,150
mpack ecx,20+10,140
mov edx,[edi+SKIN_PARAMS.colors_1.outer]
call draw_framerect
mpack ebx,345+45+4,150-8
mpack ecx,20+10+4,140-8
mov edx,[edi+SKIN_PARAMS.colors_1.inner]
call draw_framerect
mcall 13,<345+45+1,148>,<20+10+1,3>,[edi+SKIN_PARAMS.colors_1.frame]
add ecx,135*65536
mcall
mcall ,<345+45+1,3>,<20+10+1,138>
add ebx,145*65536
mcall
mcall ,<345+45+5,140>,<20+10+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work]
mov eax,0x00000001 ; left, inactive
call find_bitmap
mcall 7,,,<345+45,20+10>
pushd [ebx-8]
mov eax,0x00000003 ; base, inactive
call find_bitmap
pop edx
mov esi,345+45+150-1
sub esi,edx
shl edx,16
add edx,(345+45)*65536+20+10
mcall 7
@@: rol edx,16
add dx,[ebx-8]
cmp dx,si
ja @f
rol edx,16
mcall 7
jmp @b
@@:
mov eax,0x00000002 ; oper, inactive
call find_bitmap
mov edx,ecx
shr edx,16
neg edx
shl edx,16
add edx,(345+45+150)*65536+20+10
mcall 7
mov ebp,0x18000
mov edi,[ebp+SKIN_HEADER.params]
add edi,ebp
mov eax,dword[edi+SKIN_PARAMS.margin.left-2]
mov ax,word[edi+SKIN_PARAMS.skin_height]
sub ax,[edi+SKIN_PARAMS.margin.bottom]
shr ax,1
add ax,[edi+SKIN_PARAMS.margin.top]
add ax,-4
push eax
lea ebx,[eax+(345+45)*65536+20+10]
mcall 4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size
;---------------------------------------------------------
mov edi,[ebp+SKIN_HEADER.params]
add edi,ebp
mpack ebx,345+10,150
mpack ecx,20+40,140
mov edx,[edi+SKIN_PARAMS.colors.outer]
call draw_framerect
mpack ebx,345+10+4,150-8
mpack ecx,20+40+4,140-8
mov edx,[edi+SKIN_PARAMS.colors.inner]
call draw_framerect
mcall 13,<345+10+1,148>,<20+40+1,3>,[edi+SKIN_PARAMS.colors.frame]
add ecx,135*65536
mcall
mcall ,<345+10+1,3>,<20+40+1,138>
add ebx,145*65536
mcall
mcall ,<345+10+5,140>,<20+40+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work]
mov eax,0x00010001 ; left, inactive
call find_bitmap
mcall 7,,,<345+10,20+40>
pushd [ebx-8]
mov eax,0x00010003 ; base, inactive
call find_bitmap
pop edx
mov esi,345+10+150-1
sub esi,edx
shl edx,16
add edx,(345+10)*65536+20+40
mcall 7
@@: rol edx,16
add dx,[ebx-8]
cmp dx,si
ja @f
rol edx,16
mcall 7
jmp @b
@@:
mov eax,0x00010002 ; oper, inactive
call find_bitmap
mov edx,ecx
shr edx,16
neg edx
shl edx,16
add edx,(345+10+150)*65536+20+40
mcall 7
mov ebp,0x18000
mov edi,[ebp+SKIN_HEADER.params]
add edi,ebp
pop eax
lea ebx,[eax+(345+10)*65536+20+40]
mcall 4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size
;----------------------------------------------------------------------
mov edi,[ebp+SKIN_HEADER.buttons]
add edi,ebp
.lp1: cmp dword[edi],0
je .lp2
mov ebx,dword[edi+SKIN_BUTTONS.left-2]
mov bx,[edi+SKIN_BUTTONS.width]
mov ecx,dword[edi+SKIN_BUTTONS.top-2]
mov cx,[edi+SKIN_BUTTONS.height]
add ebx,(345+10+150)*65536
add ecx,(20+40)*65536
dec ebx
dec ecx
mcall 8,,,0x40000000
add edi,12
jmp .lp1
.lp2: ret
; ********************************************* ; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ******** ; ******* WINDOW DEFINITIONS AND DRAW ********
@ -380,8 +659,8 @@ draw_window:
; DRAW WINDOW ; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window mov eax,0 ; function 0 : define and draw window
mov ebx,110*65536+360 ; [x start] *65536 + [x size] mov ebx,110*65536+555 ; [x start] *65536 + [x size]
mov ecx,50*65536+300 ; [y start] *65536 + [y size] mov ecx,50*65536+255 ; [y start] *65536 + [y size]
mov edx,[w_work] ; color of work area RRGGBB,8->color mov edx,[w_work] ; color of work area RRGGBB,8->color
or edx,0x02000000 or edx,0x02000000
mov esi,[w_grab] ; color of grab bar RRGGBB,8->color gl mov esi,[w_grab] ; color of grab bar RRGGBB,8->color gl
@ -401,60 +680,81 @@ end if
int 0x40 int 0x40
; CLOSE BUTTON ; CLOSE BUTTON
mov eax,8 ; function 8 : define and draw button mov eax,8 ; function 8 : define and draw button
mov ebx,(360-19)*65536+12 ; [x start] *65536 + [x size] mov ebx,(555-19)*65536+12 ; [x start] *65536 + [x size]
mov ecx,4*65536+12 ; [y start] *65536 + [y size] mov ecx,4*65536+12 ; [y start] *65536 + [y size]
mov edx,1 ; button id mov edx,1 ; button id
mov esi,[w_grab_button] ; button color RRGGBB mov esi,[w_grab_button] ; button color RRGGBB
int 0x40 int 0x40
if lang eq ru
load_w = (5*2+6*9)
save_w = (5*2+6*9)
flat_w = (5*2+6*7)
apply_w = (5*2+6*9)
else
load_w = (5*2+6*6)
save_w = (5*2+6*6)
flat_w = (5*2+6*4)
apply_w = (5*2+6*7)
end if
; mov eax,8 ; FILENAME BUTTON ; mov eax,8 ; FILENAME BUTTON
mov ebx,280*65536+60 mov ebx,5*65536+545
mov ecx,250*65536+14 mov ecx,212*65536+10
mov edx,11 mov edx,0x4000000B
int 0x40
; mov eax,8 ; LOAD BUTTON
mov ebx,15*65536+load_w
mov ecx,(30+18*11)*65536+14
mov edx,12
mov esi,[w_work_button] mov esi,[w_work_button]
int 0x40 int 0x40
; mov eax,8 ; SAVE BUTTON ; mov eax,8 ; SAVE BUTTON
mov ebx,280*65536+29 add ebx,(load_w+2)*65536-load_w+save_w
mov ecx,270*65536+14
mov edx,12
int 0x40
; mov eax,8 ; LOAD BUTTON
add ebx,30*65536
inc edx inc edx
int 0x40 int 0x40
; mov eax,8 ; 3D ; mov eax,8 ; 3D
mov ebx,15*65536+35 mov ebx,(340-t1.size*6-13)*65536+(5*2+6*4)
mov ecx,275*65536+14
inc edx inc edx
int 0x40 int 0x40
; mov eax,8 ; FLAT ; mov eax,8 ; FLAT
if lang eq ru add ebx,(5*2+6*4+2)*65536-(5*2+6*4)+flat_w
add ebx,40*65536+7
else
add ebx,40*65536
end if
inc edx inc edx
int 0x40 int 0x40
; mov eax,8 ; APPLY BUTTON
add ebx,(flat_w+6+2)*65536-flat_w+apply_w
inc edx
int 0x40
; mov eax,8 ; LOAD SKIN BUTTON
mov ebx,(336+(555-335)/2-t2.size*6/2)*65536+load_w
inc edx
int 0x40
; mov eax,8 ; APPLY SKIN BUTTON
add ebx,(load_w+6+2)*65536-load_w+apply_w
inc edx
int 0x40
mov eax, 4 mov eax, 4
mov ebx, 281*65536+254 mov ebx, (339-t1.size*6-12)*65536+(30+18*11+4)
mov ecx, [w_work_button_text] mov ecx, [w_work_button_text]
mov edx, t1 mov edx, t1
mov esi, t1.size mov esi, t1.size
int 0x40 int 0x40
; mov eax, 4 mov ebx,(336+(555-335)/2-t2.size*6/2)*65536+(30+18*11+4)
mov ebx, 277*65536+274 mov edx,t2
mov edx, t2 mov esi,t2.size
mov esi, t2.size
int 0x40 int 0x40
mov eax,38 ; R G B COLOR GLIDES mov eax,38 ; R G B COLOR GLIDES
mov ebx,280*65536+300 ;295 mov ebx,266*65536+285
mov ecx,30*65536+30 mov ecx,30*65536+30
mov edx,0xff0000 mov edx,0xff0000
.newl: .newl:
@ -476,37 +776,50 @@ end if
mov edx,31 ; BUTTON ROW mov edx,31 ; BUTTON ROW
mov ebx,15*65536+200 mov ebx,15*65536+200
mov ecx,35*65536+14 mov ecx,30*65536+14
mov esi,[w_work_button] mov esi,[w_work_button]
newb: newb:
mov eax,8 mov eax,8
int 0x40 int 0x40
add ecx,20*65536 add ecx,18*65536
inc edx inc edx
cmp edx,40 cmp edx,40
jbe newb jbe newb
; mov eax,8 ; APPLY BUTTON mov ebx,15*65536+34 ; ROW OF TEXTS
add ecx,20*65536
mov edx,51
int 0x40
mov ebx,20*65536+39 ; ROW OF TEXTS
mov ecx,[w_work_button_text] mov ecx,[w_work_button_text]
mov edx,text mov edx,text
mov esi,32 mov esi,32
newline: newline:
mov eax,4 mov eax,4
int 0x40 int 0x40
add ebx,20 add ebx,18
add edx,32 add edx,32
cmp [edx],byte 'x' cmp [edx],byte 'x'
jne newline jne newline
call draw_colours call draw_colours
mcall 13,<5,546>,<212,11>,[w_work]
mcall 13,<337,7>,<2,250>,[w_frame]
shr edx,1
and edx,0x007F7F7F
mcall 38,<336,336>,<20,250>
add ebx,0x00080008
mcall
sub ebx,0x00040004
mcall ,,<0,255>
mcall ,<5,550>,<211,211>
add ecx,0x000C000C
mcall
call print_text call print_text
cmp dword[0x18000+SKIN_HEADER.ident],'SKIN'
jne @f
call draw_skin
@@:
mov eax,12 ; function 12:tell os about windowdraw mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw mov ebx,2 ; 2, end of draw
int 0x40 int 0x40
@ -528,8 +841,7 @@ lsz text,\
ru, ' ’…Š‘’ <20><EFBFBD>Ž—…‰ Ž<>ˆ ',\ ru, ' ’…Š‘’ <20><EFBFBD>Ž—…‰ Ž<>ˆ ',\
ru, ' ƒ<>€”ˆŠ€ <20><EFBFBD>Ž—…‰ Ž<>ˆ ',\ ru, ' ƒ<>€”ˆŠ€ <20><EFBFBD>Ž—…‰ Ž<>ˆ ',\
ru, ' ',\ ru, ' ',\
ru, ' <20><>ˆŒ…<C592>ˆœ ',\ ru, ' ‡€ƒ<E282AC>“‡ˆœ Ž•<C5BD><EFBFBD>ˆœ ',\
ru, ' 3D <20>ŽŠ ',\
ru, 'x',\ ru, 'x',\
en, ' WINDOW FRAME ',\ en, ' WINDOW FRAME ',\
en, ' WINDOW GRAB BAR ',\ en, ' WINDOW GRAB BAR ',\
@ -542,25 +854,27 @@ lsz text,\
en, ' WINDOW WORK AREA TEXT ',\ en, ' WINDOW WORK AREA TEXT ',\
en, ' WINDOW WORK AREA GRAPH ',\ en, ' WINDOW WORK AREA GRAPH ',\
en, ' ',\ en, ' ',\
en, ' APPLY CHANGES ',\ en, ' LOAD SAVE ',\
en, ' 3D FLAT ',\
en, 'x' en, 'x'
lsz t2,\
ru, ' ‡€ƒ<E282AC> Ž•<C5BD> ',\
en, ' LOAD SAVE '
lsz t1,\ lsz t1,\
ru, ' ”€‰‹ ',\ ru, ' 3D <20>ŽŠˆ<20><>ˆŒ…<C592>ˆœ ',\
en, ' FILENAME ' en, ' 3D FLAT APPLY '
lsz t2,\
ru, ' ‡€ƒ<E282AC>“‡ˆœ <20><>ˆŒ…<C592>ˆœ ',\
en, ' LOAD APPLY ',\
lsz test_text,\
ru, '‡ £®«®¢®ª',\
en, 'Caption'
lsz labelt,\ lsz labelt,\
ru, '<27><E28098>Ž‰Š€ –‚…’Ž‚',\ ru, '<27><E28098>Ž‰Š€ –‚…’Ž‚',\
en, 'DESKTOP COLOURS - DEFINE COLOR AND CLICK ON TARGET' en, 'DESKTOP COLOURS - DEFINE COLOR AND CLICK ON TARGET'
sz default_skn, '/RD/1/DEFAULT.SKN',0
sz default_file, '/RD/1/DEFAULT.DTP'
color dd 0 color dd 0
@ -583,6 +897,14 @@ virtual at read_info
.workarea dd ? .workarea dd ?
end virtual end virtual
skin_info:
.mode dd ?
.start_block dd ?
.blocks dd ?
.address dd ?
.workarea dd ?
.fname rb 256+1
app_colours: app_colours:
w_frame dd ? w_frame dd ?

View File

@ -197,17 +197,30 @@ macro mov arg1,arg2
} }
macro struct name ; structure definition helper
macro struct name, [arg]
{ {
virtual at 0 common
name name name@struct equ name
sizeof.#name = $ - name struc name arg {
end virtual
} }
; structures used in MeOS macro struct_helper name
struc process_information
{ {
match xname,name
\{
virtual at 0
xname xname
sizeof.#xname = $ - xname
name equ sizeof.#xname
end virtual
\}
}
ends fix } struct_helper name@struct
; structures used in MeOS
struct process_information
.cpu_usage dd ? ; +0 .cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4 .window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6 .window_stack_value dw ? ; +6
@ -222,11 +235,9 @@ struc process_information
.y_size dd ? ; +46 .y_size dd ? ; +46
.slot_state dw ? ; +50 .slot_state dw ? ; +50
rb (1024-52) rb (1024-52)
} ends
struct process_information
struc system_colors struct system_colors
{
.frame dd ? .frame dd ?
.grab dd ? .grab dd ?
.grab_button dd ? .grab_button dd ?
@ -237,8 +248,7 @@ struc system_colors
.work_button_text dd ? .work_button_text dd ?
.work_text dd ? .work_text dd ?
.work_graph dd ? .work_graph dd ?
} ends
struct system_colors
; constants ; constants

View File

@ -30,12 +30,6 @@ include "macros.inc"
db "MenuetOS RE #8",13,10 db "MenuetOS RE #8",13,10
START: START:
; load system colors
mcall 58, read_info
; set system colors
mcall 48, 2, sc, sizeof.system_colors
; set stretch backgound ; set stretch backgound
mcall 15, 4, 2 mcall 15, 4, 2
@ -96,14 +90,6 @@ START:
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
read_info:
.mode dd 0
.start_block dd 0
.blocks dd 1
.address dd sc
.workarea dd work_area
.path db "/rd/1/myblue.dtp",0
start_info: start_info:
.mode dd 16 .mode dd 16
dd 0 dd 0
@ -122,9 +108,6 @@ boot db 'BOOT',0
I_END: I_END:
;rd 256 ;rd 256
sc system_colors
rb 512-40
align 32 align 32
work_area: work_area:

View File

@ -0,0 +1,328 @@
; GIF LITE v2.0 by Willow
; Written in pure assembler by Ivushkin Andrey aka Willow
;
; This include file will contain functions to handle GIF image format
;
; Created: August 15, 2004
; Last changed: September 9, 2004
; Change COLOR_ORDER in your program
; if colors are displayed improperly
if ~ (COLOR_ORDER in <MENUETOS,OTHER>)
; This message may not appear under MenuetOS, so watch...
display 'Please define COLOR_ORDER: MENUETOS or OTHER',13,10
end if
; virtual structure, used internally
struc GIF_list
{
.NextImg rd 1
.Left rw 1
.Top rw 1
.Width rw 1
.Height rw 1
}
struc GIF_info
{
.Left rw 1
.Top rw 1
.Width rw 1
.Height rw 1
}
_null fix 0x1000
; ****************************************
; FUNCTION GetGIFinfo - retrieve Nth image info
; ****************************************
; in:
; esi - pointer to image list header
; ecx - image_index (0...img_count-1)
; edi - pointer to GIF_info structure to be filled
; out:
; eax - pointer to RAW data, or 0, if error
GetGIFinfo:
push esi ecx edi
xor eax,eax
jecxz .eloop
.lp:
mov esi,[esi]
test esi,esi
jz .error
loop .lp
.eloop:
add esi,4
movsd
movsd
mov eax,esi
.error:
pop edi ecx esi
ret
; ****************************************
; FUNCTION ReadGIF - unpacks GIF image
; ****************************************
; in:
; esi - pointer to GIF file in memory
; edi - pointer to output image list
; eax - pointer to work area (MIN 16 KB!)
; out:
; eax - 0, all OK;
; eax - 1, invalid signature;
; eax >=8, unsupported image attributes
;
; ecx - number of images
ReadGIF:
push esi edi
mov [.table_ptr],eax
mov [.cur_info],edi
xor eax,eax
mov [.globalColor],eax
mov [.img_count],eax
inc eax
cmp dword[esi],'GIF8'
jne .er ; signature
mov ecx,[esi+0xa]
inc eax
add esi,0xd
mov edi,esi
bt ecx,7
jnc .nextblock
mov [.globalColor],esi
call .Gif_skipmap
.nextblock:
cmp byte[edi],0x21
jne .noextblock
inc edi
cmp byte[edi],0xf9 ; Graphic Control Ext
jne .no_gc
add edi,7
jmp .nextblock
.no_gc:
cmp byte[edi],0xfe ; Comment Ext
jne .no_comm
inc edi
.block_skip:
movzx eax,byte[edi]
lea edi,[edi+eax+1]
cmp byte[edi],0
jnz .block_skip
inc edi
jmp .nextblock
.no_comm:
cmp byte[edi],0xff ; Application Ext
jne .nextblock
add edi,13
jmp .block_skip
.noextblock:
cmp byte[edi],0x2c ; image beginning
jne .er
inc [.img_count]
inc edi
mov esi,[.cur_info]
add esi,4
xchg esi,edi
movsd
movsd
push edi
movzx ecx,word[esi]
inc esi
bt ecx,7
jc .uselocal
push [.globalColor]
mov edi,esi
jmp .setPal
.uselocal:
call .Gif_skipmap
push esi
.setPal:
movzx ecx,byte[edi]
inc ecx
mov [.codesize],ecx
dec ecx
pop [.Palette]
lea esi,[edi+1]
mov edi,[.table_ptr]
xor eax,eax
cld
lodsb ; eax - block_count
add eax,esi
mov [.block_ofs],eax
mov [.bit_count],8
mov eax,1
shl eax,cl
mov [.CC],eax
inc eax
mov [.EOI],eax
lea ecx,[eax-1]
mov eax, _null shl 16
.filltable:
stosd
inc eax
loop .filltable
pop edi
mov [.img_start],edi
.reinit:
mov edx,[.EOI]
inc edx
push [.codesize]
pop [.compsize]
call .Gif_get_sym
cmp eax,[.CC]
je .reinit
call .Gif_output
.cycle:
movzx ebx,ax
call .Gif_get_sym
cmp eax,edx
jae .notintable
cmp eax,[.CC]
je .reinit
cmp eax,[.EOI]
je .end
call .Gif_output
.add:
push eax
mov eax,[.table_ptr]
mov [eax+edx*4],ebx
pop eax
cmp edx,0xFFF
jae .cycle
inc edx
bsr ebx,edx
cmp ebx,[.compsize]
jne .noinc
inc [.compsize]
.noinc:
jmp .cycle
.notintable:
push eax
mov eax,ebx
call .Gif_output
push ebx
movzx eax,bx
call .Gif_output
pop ebx eax
jmp .add
.er:
pop edi
jmp .ex
.end:
mov eax,[.cur_info]
mov [eax],edi
mov [.cur_info],edi
add esi,2
xchg esi,edi
.nxt:
cmp byte[edi],0
jnz .continue
inc edi
jmp .nxt
.continue:
cmp byte[edi],0x3b
jne .nextblock
xor eax,eax
stosd
mov ecx,[.img_count]
.ex:
pop edi esi
ret
.Gif_skipmap:
; in: ecx - image descriptor, esi - pointer to colormap
; out: edi - pointer to area after colormap
and ecx,111b
inc ecx ; color map size
mov ebx,1
shl ebx,cl
lea ebx,[ebx*2+ebx]
lea edi,[esi+ebx]
ret
.Gif_get_sym:
mov ecx,[.compsize]
push ecx
xor eax,eax
.shift:
ror byte[esi],1
rcr eax,1
dec [.bit_count]
jnz .loop1
inc esi
cmp esi,[.block_ofs]
jb .noblock
push eax
xor eax,eax
lodsb
test eax,eax
jnz .nextbl
mov eax,[.EOI]
sub esi,2
add esp,8
jmp .exx
.nextbl:
add eax,esi
mov [.block_ofs],eax
pop eax
.noblock:
mov [.bit_count],8
.loop1:
loop .shift
pop ecx
rol eax,cl
.exx:
xor ecx,ecx
ret
.Gif_output:
push esi eax edx
mov edx,[.table_ptr]
.next:
push word[edx+eax*4]
mov ax,word[edx+eax*4+2]
inc ecx
cmp ax,_null
jnz .next
shl ebx,16
mov bx,[esp]
.loop2:
pop ax
lea esi,[eax+eax*2]
add esi,[.Palette]
if COLOR_ORDER eq MENUETOS
mov esi,[esi]
bswap esi
shr esi,8
mov [edi],esi
add edi,3
else
movsw
movsb
end if
loop .loop2
pop edx eax esi
ret
.globalColor rd 1
.img_count rd 1
.cur_info rd 1 ; image table pointer
.img_start rd 1
.codesize rd 1
.compsize rd 1
.bit_count rd 1
.CC rd 1
.EOI rd 1
.Palette rd 1
.block_ofs rd 1
.table_ptr rd 1

File diff suppressed because it is too large Load Diff

View File

@ -7,28 +7,28 @@
use32 use32
org 0x0 org 0x0
db 'MENUET01' ; 8 byte id db 'MENUET01' ; 8 byte id
dd 0x01 ; required OS version dd 0x01 ; required OS version
dd START ; program start dd START ; program start
dd I_END ; program image size dd I_END ; program image size
dd 0xB000 ; reguired amount of memory - 64 Kb dd 0xB000 ; reguired amount of memory - 64 Kb
dd 0xA000 ; esp dd 0xA000 ; esp
dd 0x0,0x0 ; param, icon dd 0x0,0x0 ; param, icon
include 'lang.inc' include 'lang.inc'
include 'macros.inc' include 'macros.inc'
width dd 305 width dd 305
buttons dd 1 ; 0 no frames ; 1 frames buttons dd 1 ; 0 no frames ; 1 frames
soften_up dd 1 ; 0 no ; 1 yes soften_up dd 1 ; 0 no ; 1 yes
soften_down dd 0 ; 0 no ; 1 yes soften_down dd 0 ; 0 no ; 1 yes
minimize_left dd 1 minimize_left dd 1
minimize_right dd 1 minimize_right dd 1
icons_position dd 95 icons_position dd 95
menu_enable dd 1 menu_enable dd 1
setup_enable dd 0 setup_enable dd 0
graph_text dd 1 graph_text dd 1
soften_middle dd 1 ; 0 no ; 1 yes soften_middle dd 1 ; 0 no ; 1 yes
icons dd 1 ; 0 defaults ; 1 activate icons dd 1 ; 0 defaults ; 1 activate
dat db 'PANEL DAT' dat db 'PANEL DAT'
@ -61,19 +61,19 @@ begin:
mov ah,al mov ah,al
and al,100000b and al,100000b
cmp al,100000b cmp al,100000b
je change_start_end je change_start_end
mov al,ah mov al,ah
and al,10000b and al,10000b
cmp al,10000b cmp al,10000b
je change_start_end je change_start_end
mov al,ah mov al,ah
and al,1000b and al,1000b
cmp al,1000b cmp al,1000b
je change_key_lang_1 je change_key_lang_1
mov al,ah mov al,ah
and al,100b and al,100b
cmp al,100b cmp al,100b
je change_key_lang_1 je change_key_lang_1
mov al,ah mov al,ah
and al,1111b and al,1111b
cmp al,11b cmp al,11b
@ -90,7 +90,7 @@ change_key_lang_1:
mov al,ah mov al,ah
and al,11b and al,11b
cmp al,01b cmp al,01b
je change_key_lang je change_key_lang
cmp al,10b cmp al,10b
jne begin jne begin
change_key_lang: change_key_lang:
@ -124,6 +124,7 @@ start_end:
start_menu: start_menu:
mcall 18,12 mcall 18,12
mov [button_presssed_alt],eax mov [button_presssed_alt],eax
mov [draw_window_1],1
; mov ecx,eax ; mov ecx,eax
; mcall 47,0x40100, ,10 shl 16+5,0 ; mcall 47,0x40100, ,10 shl 16+5,0
; mov eax,ecx ; mov eax,ecx
@ -159,11 +160,32 @@ start_menu:
je start_menu_application je start_menu_application
cmp ah,83 ;62 cmp ah,83 ;62
je kill_active_application je kill_active_application
cmp ah,71 ;179
jne no_test_179
cmp [page_list],15
je @f
inc [page_list]
mov [draw_window_1],1
@@:
jmp begin
no_test_179:
cmp ah,72 ;180
jne no_test_180
cmp [page_list],0
je @f
dec [page_list]
mov [draw_window_1],1
@@:
jmp begin
no_test_180:
jmp begin jmp begin
button_presssed_alt dd 0 button_presssed_alt dd 0
active_process dd 0 active_process dd 0
my_process dd 0 my_process dd 0
calendar_music: calendar_music:
@ -188,21 +210,21 @@ menu_music:
mcall 55,eax, , ,menumusic mcall 55,eax, , ,menumusic
ret ret
chlangmusic: db 0x82,0x60,0x83,0x65,0x82,0x60,0 chlangmusic: db 0x82,0x60,0x83,0x65,0x82,0x60,0
syslangmusic: db 0x82,0x65,0x83,0x70,0x82,0x65,0 syslangmusic: db 0x82,0x65,0x83,0x70,0x82,0x65,0
menumusic: db 0x82,0x50,0x84,0x48,0x82,0x50,0x84,0x53,0x82,0x51,0 menumusic: db 0x82,0x50,0x84,0x48,0x82,0x50,0x84,0x53,0x82,0x51,0
activatemusic: db 0x83,0x30,0x85,0x60,0 activatemusic: db 0x83,0x30,0x85,0x60,0
buttonmusic: db 0x85,0x25,0x85,0x40,0 buttonmusic: db 0x85,0x25,0x85,0x40,0
sysmetermusic: db 0x85,0x35,0x85,0x45,0 sysmetermusic: db 0x85,0x35,0x85,0x45,0
setupmusic: db 0x85,0x40,0x85,0x50,0 setupmusic: db 0x85,0x40,0x85,0x50,0
calendarmusic: db 0x85,0x37,0x85,0x48,0 calendarmusic: db 0x85,0x37,0x85,0x48,0
; .exit: mcall -1 ; .exit: mcall -1
@ -224,7 +246,7 @@ START:
mov eax,0 mov eax,0
new_number: new_number:
cmp [esi],byte ';' cmp [esi],byte ';'
je number_ready je number_ready
imul eax,10 imul eax,10
movzx ebx,byte [esi] movzx ebx,byte [esi]
sub ebx,'0' sub ebx,'0'
@ -239,10 +261,13 @@ START:
cmp [esi],byte 'x' cmp [esi],byte 'x'
jne new_number jne new_number
mcall 48,5 mcall 14
mov ecx,eax mov [screen_size],eax
lea edx,[ebx-PANEL_HEIGHT-1]
mcall 48,6 mcall 48,5
mov ecx,eax
lea edx,[ebx-PANEL_HEIGHT-1]
mcall 48,6
call set_variables call set_variables
@ -272,26 +297,42 @@ still:
mov ebx, 20 mov ebx, 20
int 0x40 int 0x40
cmp eax,1 ; redraw ? cmp eax,1 ; redraw ?
jz red jz red
cmp eax,3 ; button ? cmp eax,3 ; button ?
jz button jz button
jmp still jmp still
red: ; redraw window red: ; redraw window
mcall 14
movzx ecx,ax
mov edx,eax
shr edx,16
cmp [screen_size.height],ax
jne @f
rol eax,16
cmp [screen_size.width],ax
je .lp1
rol eax,16
@@: mov [screen_size],eax
sub ecx,PANEL_HEIGHT
mcall 67,0,,,PANEL_HEIGHT
.lp1:
call draw_window call draw_window
call draw_info call draw_info
jmp still jmp still
button: ; button button: ; button
mov eax,17 mov eax,17
int 0x40 int 0x40
cmp ah,50 cmp ah,50
jb no_activate jb no_activate
cmp ah,70 cmp ah,70
jg no_activate jg no_activate
movzx ecx,byte ah movzx ecx,byte ah
sub ecx,52 sub ecx,52
@ -308,13 +349,13 @@ still:
no_activate: no_activate:
cmp ah,101 ; minimize to left cmp ah,101 ; minimize to left
je left_button je left_button
cmp ah,102 ; minimize to right cmp ah,102 ; minimize to right
je right_button je right_button
cmp ah,byte 1 ; start/terminate menu cmp ah,byte 1 ; start/terminate menu
jnz noselect jnz noselect
call menu_handler call menu_handler
; cmp [music_type],0 ; cmp [music_type],0
@ -323,7 +364,7 @@ still:
jmp still jmp still
noselect: noselect:
cmp ah,byte 2 ; start calendar cmp ah,byte 2 ; start calendar
jnz noid15 ;noclock jnz noid15 ;noclock
mov eax, 19 mov eax, 19
mov ebx, file6 mov ebx, file6
@ -410,7 +451,7 @@ still:
jmp red jmp red
noid19: noid19:
cmp ah,20 ; start system setup cmp ah,20 ; start system setup
jnz noid20 jnz noid20
mov eax, 19 mov eax, 19
mov ebx, file_sys mov ebx, file_sys
@ -419,6 +460,26 @@ still:
call setup_music call setup_music
noid20: noid20:
cmp ah,21
jnz noid21
cmp [page_list],15
je @f
inc [page_list]
jmp red
@@:
jmp still
noid21:
cmp ah,22
jnz noid22
cmp [page_list],0
je @f
dec [page_list]
jmp red
@@:
jmp still
noid22:
jmp still jmp still
@ -449,6 +510,16 @@ draw_running_applications:
mov edi,0 mov edi,0
mov ecx,2 mov ecx,2
mov [contrast],0 mov [contrast],0
mov eax,[max_applications]
mov ebx,[page_list]
xor edx,edx
mul ebx
cmp eax,0
je @f
inc eax
@@:
mov [draw_start_position],eax
newpr: newpr:
@ -460,19 +531,26 @@ draw_running_applications:
push ecx push ecx
cmp eax,ecx cmp eax,ecx
jb norpl2 jb norpl2
cmp byte [0x8000+10], '@' cmp byte [0x8000+10], '@'
je norpl je norpl
cmp [0x8000+11],dword 'CON ' cmp [0x8000+10],dword 'ICON'
je norpl jne .noicon
cmp dword[0x8000+42],51
jne .noicon
cmp dword[0x8000+46],51
je norpl
.noicon:
cmp [0x8000+11],dword 'ENU ' cmp [0x8000+11],dword 'ENU '
je norpl je norpl
; cmp [0x8000+12],dword 'NEL ' ; cmp [0x8000+12],dword 'NEL '
; je norpl ; je norpl
cmp [0x8000+10],dword ' ' cmp [0x8000+10],dword ' '
je norpl je norpl
dec [draw_start_position]
cmp [draw_start_position],0
jg norpl
mov eax,13 mov eax,13
mov ebx,edi mov ebx,edi
inc ebx inc ebx
@ -504,7 +582,7 @@ draw_running_applications:
inc [contrast] inc [contrast]
and [contrast],1 and [contrast],1
cmp [contrast],1 cmp [contrast],1
je contrast1 je contrast1
mov edx,0x88ff mov edx,0x88ff
jmp contrast2 jmp contrast2
contrast1: contrast1:
@ -549,7 +627,7 @@ contrast2:
inc ecx inc ecx
cmp edi,[max_applications] cmp edi,[max_applications]
jb newpr jb newpr
nompr: nompr:
@ -562,6 +640,16 @@ contrast2:
calculate_applications: calculate_applications:
mov eax,[max_applications]
mov ebx,[page_list]
xor edx,edx
mul ebx
cmp eax,0
je @f
inc eax
@@:
mov [draw_start_position],eax
mov edi,app_list mov edi,app_list
mov ecx,20 mov ecx,20
mov eax,0xff mov eax,0xff
@ -578,15 +666,25 @@ calculate_applications:
int 0x40 int 0x40
cmp byte [0x8000+10], '@' cmp byte [0x8000+10], '@'
je cnorpl je cnorpl
cmp [0x8000+10],dword 'ICON'
jne .noicon
cmp dword[0x8000+42],51
jne .noicon
cmp dword[0x8000+46],51
je cnorpl
.noicon:
cmp [0x8000+11],dword 'CON ' cmp [0x8000+11],dword 'CON '
je cnorpl je cnorpl
cmp [0x8000+11],dword 'ENU ' cmp [0x8000+11],dword 'ENU '
je cnorpl je cnorpl
; cmp [0x8000+12],dword 'NEL ' ; cmp [0x8000+12],dword 'NEL '
; je cnorpl ; je cnorpl
cmp [0x8000+10],dword ' ' cmp [0x8000+10],dword ' '
je cnorpl je cnorpl
dec [draw_start_position]
cmp [draw_start_position],0
jg cnorpl
mov [app_list+edi*4],ecx mov [app_list+edi*4],ecx
@ -615,19 +713,19 @@ draw_application_buttons:
cmp eax,639 cmp eax,639
jne now1 jne now1
mov [max_applications],7 ;6 mov [max_applications],7 ;6
now1: now1:
cmp eax,799 cmp eax,799
jne now2 jne now2
mov [max_applications],10 ;8 mov [max_applications],9 ;10 ;8
now2: now2:
cmp eax,1023 cmp eax,1023
jne now3 jne now3
mov [max_applications],13 ;8 mov [max_applications],12 ;13 ;8
now3: now3:
cmp eax,1279 cmp eax,1279
jne now4 jne now4
mov [max_applications],18 ;8 mov [max_applications],17 ;18 ;8
now4: now4:
mov edi,1 mov edi,1
@ -636,14 +734,14 @@ draw_application_buttons:
mov eax,8 mov eax,8
mov ebx,edi mov ebx,edi
shl ebx,16 shl ebx,16
imul ebx,6*10 ;13 imul ebx,6*10 ;13
add ebx,15*65536+10*6-1 ;13 add ebx,15*65536+10*6-1 ;13
mov ecx,1*65536+17 mov ecx,1*65536+17
mov edx,edi mov edx,edi
add edx,51 add edx,51
cmp [buttons],1 cmp [buttons],1
je bufr je bufr
or edx,0x60000000 or edx,0x60000000
bufr: bufr:
mov esi,[wcolor] mov esi,[wcolor]
sub ebx,11 shl 16 sub ebx,11 shl 16
@ -679,7 +777,7 @@ draw_small_right:
mov edx,[wcolor] mov edx,[wcolor]
mov esi,edx mov esi,edx
mov edi,edx mov edi,edx
or edx, 0x01000000 or edx, 0x01000000
int 0x40 int 0x40
mov eax,8 mov eax,8
@ -724,11 +822,11 @@ draw_small_left:
mov edx,[wcolor] mov edx,[wcolor]
mov esi,edx mov esi,edx
mov edi,edx mov edi,edx
or edx, 0x01000000 or edx, 0x01000000
int 0x40 int 0x40
cmp [graph_text],1 cmp [graph_text],1
je nos4 je nos4
mov eax,8 mov eax,8
mov ebx,0*65536+9 mov ebx,0*65536+9
@ -843,7 +941,7 @@ left_button:
cmp ah,1 cmp ah,1
jne no_full jne no_full
mov eax, 14 ; get screen max x & max y mov eax, 14 ; get screen max x & max y
int 0x40 int 0x40
mov edx, eax mov edx, eax
shr edx, 16 shr edx, 16
@ -882,7 +980,7 @@ set_variables:
no_frames: no_frames:
mov eax,48 ; 3d button look mov eax,48 ; 3d button look
mov ebx,1 mov ebx,1
mov ecx,1 mov ecx,1
int 0x40 int 0x40
@ -930,7 +1028,7 @@ draw_flag:
sub ebx,2 sub ebx,2
mov ecx, 5 shl 16+11 mov ecx, 5 shl 16+11
cmp [type_lang],1 cmp [type_lang],1
je label_1 je label_1
mov edx,0xff ;[wcolor] mov edx,0xff ;[wcolor]
jmp label_2 jmp label_2
label_1: label_1:
@ -941,7 +1039,7 @@ label_2:
popad popad
shl ebx,16 shl ebx,16
add ebx,7 ;24 add ebx,7 ;24
mov ecx,[bte] ; color mov ecx,[bte] ; color
@ -988,7 +1086,7 @@ draw_window:
mov [running_applications],-1 mov [running_applications],-1
mov [checks],-1 mov [checks],-1
mov eax, 12 ; tell os about redraw mov eax, 12 ; tell os about redraw
mov ebx, 1 mov ebx, 1
int 0x40 int 0x40
@ -1001,11 +1099,11 @@ draw_window:
mov eax, [system_colours+4*6] mov eax, [system_colours+4*6]
mov [wcolor], eax mov [wcolor], eax
mov eax,14 ; get screen max x & max y mov eax,14 ; get screen max x & max y
int 0x40 int 0x40
cmp [width],0 cmp [width],0
je no_def_width je no_def_width
and eax,0xffff and eax,0xffff
mov ebx,[width] mov ebx,[width]
shl ebx,16 shl ebx,16
@ -1024,11 +1122,11 @@ draw_window:
mov cx,PANEL_HEIGHT mov cx,PANEL_HEIGHT
add ecx,20*65536 add ecx,20*65536
no_text_1: no_text_1:
mov eax, 0 ; DEFINE AND DRAW WINDOW mov eax, 0 ; DEFINE AND DRAW WINDOW
mov edx, [wcolor] mov edx, [wcolor]
or edx, 0x01000000 ; do not draw the window or edx, 0x01000000 ; do not draw the window
mov esi, [wcolor] mov esi, [wcolor]
or esi, 0x01000000 ; unmovable window or esi, 0x01000000 ; unmovable window
mov edi, [wcolor] mov edi, [wcolor]
int 0x40 int 0x40
@ -1041,6 +1139,7 @@ draw_window:
mov eax,38 mov eax,38
cmp [soften_up],1 cmp [soften_up],1
jne no_su jne no_su
and edx,0x00FFFFFF
int 0x40 int 0x40
no_su: no_su:
@ -1053,13 +1152,14 @@ draw_window:
add edi,[b_size_y] add edi,[b_size_y]
add ecx,edi add ecx,edi
sub ecx,3*65536+3 sub ecx,3*65536+3
and edx,0x00FFFFFF
int 0x40 int 0x40
no_sd: no_sd:
popa popa
add ecx,1*65536+1 add ecx,1*65536+1
cmp cx,5 cmp cx,5
jb newline jb newline
cmp [soften_middle],1 cmp [soften_middle],1
jne no_sm jne no_sm
@ -1073,16 +1173,17 @@ draw_window:
add esi,4 add esi,4
mov eax,38 mov eax,38
and edx,0x00FFFFFF
int 0x40 int 0x40
add ecx,1*65536+1 add ecx,1*65536+1
cmp cx,15 cmp cx,15
jb newline3 jb newline3
no_sm: no_sm:
cmp [minimize_left],1 cmp [minimize_left],1
jne no_mleft jne no_mleft
mov eax,8 ; ABS LEFT mov eax,8 ; ABS LEFT
mov ebx,0 *65536+9 mov ebx,0 *65536+9
mov ecx,1 *65536 mov ecx,1 *65536
add ecx,[b_size_y] add ecx,[b_size_y]
@ -1091,7 +1192,7 @@ draw_window:
add edx,[button_frames] add edx,[button_frames]
mov esi,[wcolor] mov esi,[wcolor]
int 0x40 int 0x40
mov eax,4 ; HIDE TEXT mov eax,4 ; HIDE TEXT
mov ebx,2*65536+17 mov ebx,2*65536+17
cmp [graph_text],1 cmp [graph_text],1
jne no_y1 jne no_y1
@ -1114,7 +1215,7 @@ draw_window:
shl eax,16 shl eax,16
mov ebx,eax mov ebx,eax
add ebx,67 add ebx,67
mov eax,8 ; ABS RIGHT mov eax,8 ; ABS RIGHT
mov ecx,1 *65536 mov ecx,1 *65536
add ecx,[b_size_y] add ecx,[b_size_y]
dec ecx dec ecx
@ -1169,7 +1270,7 @@ draw_menuet_icon:
jne no_menu jne no_menu
mov eax, 8 ; M BUTTON mov eax, 8 ; M BUTTON
mov ebx, 10*65536 + 47 mov ebx, 10*65536 + 47
cmp [minimize_left], 0 cmp [minimize_left], 0
jne @f jne @f
@ -1200,7 +1301,7 @@ draw_menuet_icon:
mov ecx,4 shl 16+11 mov ecx,4 shl 16+11
int 0x40 int 0x40
mov ebx,58 shl 16+1 mov ebx,58 shl 16+1
mov ecx,6 shl 16+7 mov ecx,6 shl 16+7
int 0x40 int 0x40
; mov ebx,66 shl 16+1 ; mov ebx,66 shl 16+1
; mov ecx,9 shl 16+1 ; mov ecx,9 shl 16+1
@ -1238,7 +1339,7 @@ draw_menuet_icon:
mov eax,[wcolor] mov eax,[wcolor]
mov [m_icon+4],eax mov [m_icon+4],eax
mov eax,6 ; load file mov eax,6 ; load file
mov ebx,m_bmp mov ebx,m_bmp
mov ecx,0 mov ecx,0
mov edx,200000 mov edx,200000
@ -1257,13 +1358,13 @@ draw_menuet_icon:
mov cl,[edi] mov cl,[edi]
cmp cl,10 cmp cl,10
jb nopix jb nopix
mov cl,[edi+1] mov cl,[edi+1]
cmp cl,10 cmp cl,10
jb nopix jb nopix
mov cl,[edi+2] mov cl,[edi+2]
cmp cl,10 cmp cl,10
jb nopix jb nopix
pusha pusha
cmp [minimize_left],0 cmp [minimize_left],0
@ -1325,7 +1426,7 @@ draw_program_icons:
mov bx,39 mov bx,39
pop edx pop edx
add edx,[button_frames] add edx,[button_frames]
or edx, 0x20000000 or edx, 0x20000000
mov eax,8 mov eax,8
int 0x40 int 0x40
popa popa
@ -1334,7 +1435,7 @@ draw_program_icons:
add ecx,48 add ecx,48
mov [iconf+6],cl mov [iconf+6],cl
mov eax,6 ; load file mov eax,6 ; load file
mov ebx,iconf mov ebx,iconf
mov ecx,0 mov ecx,0
mov edx,200000 mov edx,200000
@ -1345,22 +1446,22 @@ draw_program_icons:
mov ebx,32 mov ebx,32
mov edi,image+51+32*33*3 mov edi,image+51+32*33*3
np2: ; new pixel of file np2: ; new pixel of file
mov edx,[edi] mov edx,[edi]
and edx,0xffffff and edx,0xffffff
cmp eax,3 ; Y draw limits cmp eax,3 ; Y draw limits
jb nopix2 jb nopix2
cmp eax,36 cmp eax,36
jg nopix2 jg nopix2
cmp ebx,38 ; X draw limits cmp ebx,38 ; X draw limits
jg nopix2 jg nopix2
cmp ebx,2 cmp ebx,2
jb nopix2 jb nopix2
cmp edx,0 cmp edx,0
jz nopix2 jz nopix2
cmp [graph_text],1 cmp [graph_text],1
jne no_icon_text jne no_icon_text
@ -1458,7 +1559,7 @@ draw_info: ; draw cpu usage, time, date
mov eax,3 mov eax,3
int 0x40 int 0x40
cmp eax,[ptime] cmp eax,[ptime]
jz _ret jz _ret
mov [ptime],eax mov [ptime],eax
call draw_cpu_usage call draw_cpu_usage
@ -1487,7 +1588,7 @@ draw_info: ; draw cpu usage, time, date
int 0x40 int 0x40
mov eax,26 ; check for change in time or country mov eax,26 ; check for change in time or country
mov ebx,5 mov ebx,5
int 0x40 int 0x40
mov edx,eax mov edx,eax
@ -1501,7 +1602,7 @@ draw_info: ; draw cpu usage, time, date
and eax,0xffff and eax,0xffff
add edx,eax add edx,eax
cmp edx,[checks] cmp edx,[checks]
je _ret je _ret
mov [checks],edx mov [checks],edx
mov ebx,[maxx] mov ebx,[maxx]
@ -1509,7 +1610,7 @@ draw_info: ; draw cpu usage, time, date
shl ebx,16 shl ebx,16
add ebx,33 ;;84 ;;64 add ebx,33 ;;84 ;;64
mov eax,8 ; time/date button mov eax,8 ; time/date button
mov ecx,3 *65536 mov ecx,3 *65536
add ecx,[b_size_y] add ecx,[b_size_y]
; dec ecx ; dec ecx
@ -1538,19 +1639,28 @@ draw_info: ; draw cpu usage, time, date
mov esi,[wcolor] mov esi,[wcolor]
int 0x40 int 0x40
sub ebx,17 shl 16 sub ebx,17 shl 16
inc edx ;button 17 inc edx ;button 17
int 0x40 int 0x40
add ebx,33 shl 16 add ebx,33 shl 16
mov bx,8 mov bx,8
inc edx ;button 18 inc edx ;button 18
int 0x40 int 0x40
sub ebx,47 shl 16 sub ebx,47 shl 16
mov bx,10 mov bx,10
inc edx ;button 19 inc edx ;button 19
int 0x40 int 0x40
sub ebx,14 shl 16 sub ebx,14 shl 16
inc edx ;button 20 inc edx ;button 20
int 0x40 int 0x40
sub ebx,12 shl 16
mov bx,8
mov ecx,6 shl 16+10
inc edx ;button 21
int 0x40
sub ebx,18 shl 16
inc edx ;button 22
int 0x40
; flags ; flags
mov eax,26 mov eax,26
@ -1607,7 +1717,7 @@ draw_info: ; draw cpu usage, time, date
; cmp [music_type],0 ; cmp [music_type],0
; jne dalshe ; jne dalshe
cmp [sound_flag],0 cmp [sound_flag],0
je dalshe je dalshe
sub ebx,8 shl 16 sub ebx,8 shl 16
ror ebx,16 ror ebx,16
@ -1655,6 +1765,45 @@ dalshe:
add ebx,1 shl 16 add ebx,1 shl 16
int 0x40 int 0x40
mov edx,0
mov eax,13
mov ebx,[maxx]
sub ebx,134
shl ebx,16
mov bx,9
mov ecx,6 shl 16+11
int 0x40
sub ebx,18 shl 16
int 0x40
add ebx,19 shl 16
sub bx,2
mov ecx,7 shl 16+9
mov edx,0xffffff
int 0x40
sub ebx,18 shl 16
int 0x40
mov eax,4
mov edx,page_a1
mov ebx,[maxx]
sub ebx,150
shl ebx,16
mov bx,8
mov esi,4
int 0x40
add ebx,1 shl 16
int 0x40
mov eax,47
mov ebx,0x10100
mov ecx,[page_list]
mov edx,[maxx]
sub edx,141
shl edx,16
mov dx,7
mov esi,0xffffff
int 0x40
; sub ebx,14 shl 16 ; sub ebx,14 shl 16
; mov bx,7 ; mov bx,7
; mov edx,turn_text ; mov edx,turn_text
@ -1699,7 +1848,7 @@ dalshe:
; mov edx,[wcolor] ; mov edx,[wcolor]
; int 0x40 ; int 0x40
mov eax,3 ; get time mov eax,3 ; get time
int 0x40 int 0x40
movzx ebx,al movzx ebx,al
@ -1728,7 +1877,7 @@ dalshe:
no_y3: no_y3:
mov edx,[esp] ; __:_X mov edx,[esp] ; __:_X
and edx,15 and edx,15
mov eax,4 mov eax,4
add ebx,10*65536 add ebx,10*65536
@ -1736,7 +1885,7 @@ dalshe:
mov esi,1 mov esi,1
int 0x40 int 0x40
pop edx ; __:X_ pop edx ; __:X_
shr edx,4 shr edx,4
and edx,15 and edx,15
mov eax,4 mov eax,4
@ -1745,7 +1894,7 @@ dalshe:
mov esi,1 mov esi,1
int 0x40 int 0x40
mov edx,[esp] ; _X:__ mov edx,[esp] ; _X:__
and edx,15 and edx,15
mov eax,4 mov eax,4
sub ebx,11*65536 sub ebx,11*65536
@ -1753,7 +1902,7 @@ dalshe:
mov esi,1 mov esi,1
int 0x40 int 0x40
pop edx ; X_:__ pop edx ; X_:__
shr edx,4 shr edx,4
and edx,15 and edx,15
mov eax,4 mov eax,4
@ -1857,30 +2006,27 @@ draw_cpu_usage:
ret ret
; DATA ; DATA
stripe: stripe:
dd -0x010101 dd -0x010101
dd -0x010101 dd -0x010101
dd -0x020202 dd -0x020202
dd -0x010101 dd -0x010101
dd -0x000000 dd -0x000000
dd 0x000000 dd 0x000000
dd 0x010101 dd 0x010101
dd 0x020202 dd 0x020202
dd 0x010101 dd 0x010101
dd 0x010101 dd 0x010101
m_icon: m_icon:
dd 0x0 dd 0x0
dd 0x808080 dd 0x808080
dd 0x000000 dd 0x000000
dd 0x000000 dd 0x000000
dd 0xffffff dd 0xffffff
lsz m_text,\ lsz m_text,\
@ -1896,10 +2042,10 @@ type_lang db 0
sound_flag db 0 sound_flag db 0
button_frames dd 0x0 button_frames dd 0x0
checks dd -1 checks dd -1
hidetext db 0x11,0x10,0x1e hidetext db 0x11,0x10,0x1e
iconf db 'MBAR_IX BMP' iconf db 'MBAR_IX BMP'
m_bmp db 'MENUET BMP' m_bmp db 'MENUET BMP'
sysmeter db 'SYSMETER ' sysmeter db 'SYSMETER '
file_end db 'END ' file_end db 'END '
@ -1912,8 +2058,8 @@ turn_text db '><'
;file4 db 'TINYPAD ' ;file4 db 'TINYPAD '
;file4_par db 'COPYING.TXT',0 ;file4_par db 'COPYING.TXT',0
;file5 db 'MFASM ' ;file5 db 'MFASM '
file6 db 'CALENDAR ' file6 db 'CALENDAR '
gpl db 'GPL' gpl db 'GPL'
chlang db 'LANG',0 chlang db 'LANG',0
syslang db 'SLAN',0 syslang db 'SLAN',0
@ -1923,25 +2069,35 @@ contrast db 0
running_applications dd 0x100 running_applications dd 0x100
max_applications dd 11 max_applications dd 11
page_list dd 0
draw_start_position dd 0
draw_window_1 db 0
b_size_y: dd 0x0 b_size_y: dd 0x0
ysi dd 0 ysi dd 0
small_draw dd 0x0 small_draw dd 0x0
ptime dd 0x0 ptime dd 0x0
maxx dd 0x0 maxx dd 0x0
text db '0123456789' text db '0123456789'
bte dd 0xccddee page_a1 db '< >'
bte dd 0xccddee
wcolor dd 0x506070 wcolor dd 0x506070
sec db ': ' sec db ': '
pros db ' ' pros db ' '
db ' ' db ' '
screenxy dd 0x0 screenxy dd 0x0
stcount dd 0x0 stcount dd 0x0
I_END: I_END:
screen_size:
.height dw ?
.width dw ?
area9 rb 100 area9 rb 100
system_colours rd 10 system_colours rd 10
app_list rd 50 app_list rd 50

File diff suppressed because it is too large Load Diff

View File

@ -258,12 +258,10 @@ restore_mode:
push eax push eax
push ebx push ebx
push edx push edx
call kill_all
mov eax,21 mov eax,21
mov ebx,13 mov ebx,13
mov ecx,4 mov ecx,4
int 40h int 40h
call ref_screen
pop edx pop edx
pop ecx pop ecx
pop eax pop eax
@ -279,7 +277,6 @@ set_my_mode:
mov eax,[currvm] mov eax,[currvm]
mov [oldvm],eax mov [oldvm],eax
mov [currvm],edx mov [currvm],edx
call kill_all
pop edx pop edx
push edx push edx
mov eax,21 mov eax,21
@ -289,7 +286,6 @@ set_my_mode:
pop edx pop edx
pop ebx pop ebx
pop ecx pop ecx
call ref_screen
retn retn
; IN: eax = 0/1 - -/+ 1Hz ; IN: eax = 0/1 - -/+ 1Hz
@ -307,23 +303,6 @@ inc_dec_rate:
pop ebx pop ebx
retn retn
ref_screen:
push eax
push ebx
push ecx
mov eax,5
mov ebx,100
int 40h
mov eax,19
mov ebx,strt
xor ecx,ecx
int 40h
pop ecx
pop ebx
pop eax
retn
get_pid: get_pid:
mov eax,9 mov eax,9
mov ebx,buffer mov ebx,buffer
@ -353,28 +332,6 @@ get_vert_rate:
mov [currvm],ecx mov [currvm],ecx
retn retn
kill_all:
call get_pid
mov ecx,[totp]
ka_loc_00:
push ecx
push ecx
mov eax,9
mov ebx,buffer
int 40h
pop ecx
mov eax,[mypid]
cmp eax,[ebx+30]
je ka_loc_02
mov eax,18
mov ebx,2
int 40h
ka_loc_02:
pop ecx
loop ka_loc_00
retn
get_initial_videomode: get_initial_videomode:
retn retn