From 7f7718f53224e1a426b457bce317bfc94549c361 Mon Sep 17 00:00:00 2001 From: Doczom Date: Sun, 21 Jan 2024 11:23:12 +0000 Subject: [PATCH] Update headers programs : delete MENUET00 header on 2 programs. Fixed mario2 game : delete using sysfn 6 and added constants Update macro.inc : Added new fields in process_information git-svn-id: svn://kolibrios.org@9971 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/demos/unvwater/trunk/unvwater.asm | 19 +- programs/games/mario2/trunk/MARIO.ASM | 435 +++--- programs/games/pong/trunk/pong.asm | 19 +- programs/macros.inc | 4 +- programs/system/taskbar/trunk/TASKBAR.ASM | 1380 ++++++++++---------- programs/system/taskbar/trunk/ctx_menu.asm | 206 +-- programs/system/taskbar/trunk/drawappl.inc | 272 ++-- programs/system/taskbar/trunk/drawwind.inc | 590 ++++----- programs/system/taskbar/trunk/u_data.inc | 83 +- programs/system/zkey/trunk/ZKEY.ASM | 479 +++---- 10 files changed, 1754 insertions(+), 1733 deletions(-) diff --git a/programs/demos/unvwater/trunk/unvwater.asm b/programs/demos/unvwater/trunk/unvwater.asm index 4a90e8fac8..52705fa489 100644 --- a/programs/demos/unvwater/trunk/unvwater.asm +++ b/programs/demos/unvwater/trunk/unvwater.asm @@ -8,19 +8,12 @@ use32 org 0x0 - ;db 'MENUET00' ; 8 byte id - ;dd 38 ; required os - ;dd STARTAPP ; program start - ;dd I_END ; program image size - ;dd 0x100000 ; required amount of memory - ;dd 0x00000000 ; reserved=no extended header - - db 'MENUET01' - dd 1 - dd STARTAPP - dd I_END - dd MEM - dd STACKTOP + db 'MENUET01' ; header + dd 1 ; version + dd STARTAPP ; program start + dd I_END ; program image size + dd MEM ; size memory for program + dd STACKTOP ; pointer of stack dd 0 dd 0 diff --git a/programs/games/mario2/trunk/MARIO.ASM b/programs/games/mario2/trunk/MARIO.ASM index ef574537e6..c4d56a556a 100644 --- a/programs/games/mario2/trunk/MARIO.ASM +++ b/programs/games/mario2/trunk/MARIO.ASM @@ -7,30 +7,45 @@ use32 org 0x0 + + db 'MENUET01' ; header + dd 1 ; version + dd START ; program start + dd I_END ; image size + dd MEM ; size memory program + dd STACKTOP ; pointer to begin stack pos + dd 0 + dd 0 - db 'MENUET00' ; 8 byte id - dd 38 ; required os - dd START ; program start - dd I_END ; image size - dd 0x100000 ; reguired amount of memory - dd 0x00000000 ; reserved=no extended header - - -empty equ 0x80000 + 0*3*40*40 -build_1 equ 0x80000 + 1*3*40*40 -build_2 equ 0x80000 + 2*3*40*40 -build_3 equ 0x80000 + 3*3*40*40 - -mario_1 equ 0x90000 + 0*3*70*51 -mario_2 equ 0x90000 + 1*3*70*51 -mario_3 equ 0x90000 + 2*3*70*51 -mario_4 equ 0x90000 + 3*3*70*51 -mario_5 equ 0x90000 + 4*3*70*51 -mario_6 equ 0x90000 + 5*3*70*51 -mario_green equ 0x90000 + 6*3*70*51 -loadp equ 0x90000 + 7*3*70*51 - - +res_base = loadp + 0x36 ; offset on array pixel in BMP file +res_width_px = 150 +res_height_px = 35 +res_line_size = (res_width_px*3 + 11b) and not 11b ; 150*3 + 2 + + +block_width = 40 +block_height = 40 +block_line_size = block_width * 3 +block_img_size = block_width * block_height * 3 +block_draw_size = (block_width shl 16) + block_height ; for sysfn 7 +block_count_pixel = block_width * block_height + +mario_width = 50 +mario_height = 70 +mario_line_size = mario_width * 3 +mario_img_size = mario_width * mario_height * 3 +mario_draw_size = (mario_width shl 16) + mario_height +mario_count_pixel = mario_width * mario_height + + +wnd_pos_x = 80 +wnd_pos_y = 20 + +wnd_header_size = 0x16 +wnd_height = 9*block_height + wnd_header_size +wnd_width = 12*block_width + 1 + + START: @@ -46,55 +61,51 @@ START: sta: mov eax,field - mov edx,1*65526+30 - mov [xxyy],dword 1*65536+22 + mov dword[xxyy], 1*65536 + wnd_header_size stl: - cmp [eax],byte ' ' - jnz noempty + cmp byte[eax], ' ' + jnz @f mov ebx,empty - noempty: + @@: - cmp [eax],byte '1' - jnz no1 + cmp byte[eax], '1' + jnz @f mov ebx,build_1 - no1: + @@: - cmp [eax],byte '2' - jnz no2 + cmp byte[eax], '2' + jnz @f mov ebx,build_2 - no2: + @@: - cmp [eax],byte '3' - jnz no3 + cmp byte[eax], '3' + jnz @f mov ebx,build_3 - no3: + @@: pusha mov edx,[xxyy] mov eax,7 ; display image - mov ecx,40*65536+40 + mov ecx, block_draw_size int 0x40 popa - add word [xxyy+2],word 40 - cmp word [xxyy+2],word 40*12+1 - jnz nonewline - mov word [xxyy+2],word 1 - add word [xxyy+0],word 40 - nonewline: + add word [xxyy+2], block_width + cmp word [xxyy+2], block_width*12+1 + jnz .nonewline + + mov word [xxyy+2], 1 + add word [xxyy+0], block_height + .nonewline: add eax,1 - cmp eax,field+12*9 - jz nodraw - jmp stl - - nodraw: - + cmp eax, field.end + jnz stl ; ********* MAIN LOOP *********** @@ -105,15 +116,17 @@ wait_for_event: mov eax,11 ; check for event int 0x40 + cmp eax,1 jz red cmp eax,2 jz key - cmp eax,3 + cmp eax,3 ; check pressed button jnz wait_for_event - - jmp button + mov eax, -1 ; close this program + int 0x40 + red: mov [mariomem],dword 0x0 @@ -128,17 +141,17 @@ wait_for_event: mov eax,2 ; ah <- key int 0x40 - cmp ah,176 + cmp ah,176 ; 'left' jnz key1 mov byte [leftright],byte 1 key1: - cmp ah,179 + cmp ah,179 ; 'right' jnz key2 mov byte [leftright],byte 4 key2: - cmp ah,177 + cmp ah,177 ; 'down' jnz key3 mov al,byte [leftright] mov bl,al @@ -153,57 +166,42 @@ wait_for_event: mov byte [leftright],bl key3: - cmp ah,178 + cmp ah,178 ; 'up' jnz key4 cmp [velocity],dword 0xff jnz key4 mov [velocity],dword 0x110 key4: - - mov eax,71 ;draw caption - mov ebx,1 - mov ecx,title - int 0x40 - - jmp sta ;draw field - + + ; this code using for fix defects drawing(draw in caption area) + mov eax,71 ;draw caption + mov ebx,1 + mov ecx,title + int 0x40 + + jmp sta ;draw field + ;jmp wait_for_event - button: - - mov eax,0xffffffff ; close this program - int 0x40 - - load_graph: pusha - mov eax,6 ; 6 = open file - mov ebx,filename - mov ecx,0 - mov edx,0xFFFFFF - mov esi,loadp - mov edi,0 ; floppy - int 0x40 - - ; empty - + ; empty block init - set in 0x00500f color mov edi,empty - mov ecx,40*40 + mov ecx, block_count_pixel mov eax,0x00500f cld - emptyl: + @@: mov [edi],eax - add edi,3 - loop emptyl + add edi, 3 + loop @b - mov [width],40*3 - mov [width_move],20 - mov [sub_esi],150*3+2 - mov [add_edi],40*3*2 + mov [width], block_line_size + mov [width_move], block_width/2 + mov [height_move], block_height/2 mov [imul_esi],20*3 - mov [base],loadp+18*3+3*150*34+3*98-1 + mov [base], res_base + 3*res_width_px * 34 +3*98-1 mov esi,0 mov edi,build_1 @@ -216,26 +214,24 @@ load_graph: ; build_3 - mov edi,build_3 - mov esi,loadp+18*3+230*3+3*300*69 - mov ecx,40 + mov esi, res_base + 230*3+3*300*69 + mov ecx, block_height build_3l: pusha - mov ecx,3*40 + mov ecx, block_line_size cld rep movsb popa sub esi,300*3 - add edi,40*3 + add edi, block_line_size loop build_3l - mov [width],50*3 - mov [width_move],25 - mov [sub_esi],150*3+2 - mov [add_edi],50*3*2 + mov [width], mario_line_size + mov [width_move], mario_width/2 + mov [height_move], mario_height/2 mov [imul_esi],25*3 - mov [base],loadp+18*3+3*150*34+68 + mov [base], res_base + 3*res_width_px*34 + 68 mov esi,0 mov edi,mario_1 @@ -252,16 +248,21 @@ load_graph: jmp mario_mirror +; copy in [edi], image x2 convert: imul esi,[imul_esi] add esi,[base] ; loadp+18*3+3*150*34+68 - mov ecx,70 - mario_1l: + mov eax, [width] + shl eax, 1 ; *2 + mov ecx, [height_move] ;? + + .new_line: pusha mov ecx,[width_move] - putpix: + + .putpix: ; set 4 pixel: edi, edi+3, edi+width, edi+width+3 mov eax,[esi] mov [edi+00],ax mov [edi+03],ax @@ -278,45 +279,41 @@ convert: mov [edi+ebx],al add esi,3 add edi,6 - loop putpix + loop .putpix popa - sub esi,[sub_esi] - add edi,[add_edi] - loop mario_1l + + sub esi,res_line_size + add edi, eax + loop .new_line ret - -sub_esi dd 0x0 -add_edi dd 0x0 -imul_esi dd 0x0 -base dd 0x0 -width dd 0x0 -width_move dd 0x0 + +imul_esi dd 0 +base dd 0 +width dd 0 +width_move dd 0 +height_move dd 0 mario_mirror: - - + ; mario_green - mov edi,mario_green - mov ecx,70*50 - mario_greenl: + mov ecx, mario_count_pixel + @@: mov [edi],dword 0x00500f - add edi,3 - loop mario_greenl + add edi, 3 + loop @b + ; mario_4 - reverse mario_1 - - ; mario_4 - - mov edi,mario_4 - mov esi,mario_1+49*3 - mov ecx,70 + mov edi, mario_4 + mov esi, mario_1 + (mario_width - 1)*3 + mov ecx, mario_height m4l1: pusha - mov ecx,50 + mov ecx, mario_width m4l2: mov eax,[esi] mov [edi],ax @@ -326,19 +323,20 @@ mario_mirror: sub esi,3 loop m4l2 popa - add esi,50*3 - add edi,50*3 + + add esi, mario_width*3 + add edi, mario_width*3 loop m4l1 - ; mario_5 + ; mario_5 - reverse mario_2 - mov edi,mario_5 - mov esi,mario_2+49*3 - mov ecx,70 + mov edi, mario_5 + mov esi, mario_2 + (mario_width - 1)*3 + mov ecx, mario_height m5l1: pusha - mov ecx,50 + mov ecx, mario_width m5l2: mov eax,[esi] mov [edi],ax @@ -348,19 +346,20 @@ mario_mirror: sub esi,3 loop m5l2 popa - add esi,50*3 - add edi,50*3 + + add esi, mario_width*3 + add edi, mario_width*3 loop m5l1 - ; mario_6 + ; mario_6 - reverse mario_3 - mov edi,mario_6 - mov esi,mario_3+49*3 - mov ecx,70 + mov edi, mario_6 + mov esi, mario_3 + (mario_width - 1)*3 + mov ecx, mario_height m6l1: pusha - mov ecx,50 + mov ecx, mario_width m6l2: mov eax,[esi] mov [edi],ax @@ -370,13 +369,13 @@ mario_mirror: sub esi,3 loop m6l2 popa - add esi,50*3 - add edi,50*3 + + add esi, mario_width*3 + add edi, mario_width*3 loop m6l1 popa - ret @@ -532,7 +531,7 @@ mario_delay: pusha - mov eax,5 ;pause + mov eax,5 ;pause mov ebx,2 int 0x40 @@ -547,129 +546,132 @@ draw_mario: mov eax,[mariomem] cmp eax,[marioxy] - jnz dm1 - + jnz @f + call mario_delay popa - ret - - dm1: - + +@@: mov eax,[marioxy] mov [mariomem],eax - cmp byte [leftright],byte 1 ; go left - jnz no_m_left - jmp m_left - no_m_left: + cmp byte [leftright], 1 ; go left + jz m_left - cmp byte [leftright],byte 4 ; go right - jnz no_m_right - jmp m_right - no_m_right: + cmp byte [leftright], 4 ; go right + jz m_right - cmp byte [leftright],byte 2 ; stand left + cmp byte [leftright], 2 ; stand left jnz no_r_still + mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_1 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay + popa ret + no_r_still: - cmp byte [leftright],byte 3 ; stand right jnz no_l_still + mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_4 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay - - popa - ret + no_l_still: popa ret - - - - + m_left: mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_1 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_2 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_3 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_2 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay popa - ret m_right: @@ -677,64 +679,67 @@ draw_mario: mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_4 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_5 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_6 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay mov eax,7 mov ebx,mario_green - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call advance_mario mov eax,7 mov ebx,mario_5 - mov ecx,50*65536+70 + mov ecx, mario_draw_size mov edx,[marioxy] int 0x40 + call mario_delay popa - ret - - - - - + draw_window: pusha @@ -744,9 +749,9 @@ draw_window: int 0x40 mov eax,0 ; define and draw window - mov ebx,80*65536+480+1 - mov ecx,20*65536+382 - mov edx,0x5466AA88 + mov ebx, (wnd_pos_x shl 16) + wnd_width ;80*65536+480+1 + mov ecx, (wnd_pos_y shl 16) + wnd_height ;20*65536+382 + mov edx,0x5466AA88 ; 4 type window + title + no draw work space mov edi,title int 0x40 @@ -761,9 +766,6 @@ draw_window: ; DATA SECTION -filename: - db 'MARIOALLBMP' - title: db 'SUPER MARIO - USE ARROW KEYS', 0 @@ -778,6 +780,7 @@ field: db '1 1' db '1 1' db '222222222222' +.end: xxyy dd 0x0 @@ -789,9 +792,33 @@ leftright dd 0x0 velocity dd 0x0 - +align 16 +loadp: + file 'MARIOALL.BMP' + I_END: - + +align 0x1000 + +empty: rb block_img_size +build_1: rb block_img_size +build_2: rb block_img_size +build_3: rb block_img_size + +align 0x1000 + +mario_1: rb mario_img_size +mario_2: rb mario_img_size +mario_3: rb mario_img_size +mario_4: rb mario_img_size +mario_5: rb mario_img_size +mario_6: rb mario_img_size +mario_green: rb mario_img_size + + + rb 4096 +STACKTOP: +MEM: diff --git a/programs/games/pong/trunk/pong.asm b/programs/games/pong/trunk/pong.asm index 61b76e2909..437bc2115b 100644 --- a/programs/games/pong/trunk/pong.asm +++ b/programs/games/pong/trunk/pong.asm @@ -20,21 +20,14 @@ CK_UP2 equ 72 CK_DOWN2 equ 80 use32 + org 0x0 - ;org 0x0 - ; - ;db 'MENUET00' ; 8 byte id - ;dd 38 ; required os - ;dd START ; program start - ;dd I_END ; program image size - ;dd 0x2000 ; required amount of memory - ;dd 0x00000000 ; reserved=no extended header db 'MENUET01' - dd 1 - dd START - dd I_END - dd MEM - dd STACKTOP + dd 1 ; version + dd START ; program start + dd I_END ; program image size + dd MEM ; size memory for program + dd STACKTOP ; pointer on stack dd 0 dd 0 diff --git a/programs/macros.inc b/programs/macros.inc index 9674f8a2af..39fb53aa6a 100644 --- a/programs/macros.inc +++ b/programs/macros.inc @@ -465,7 +465,9 @@ struct process_information dw ? ; +52 client_box BOX ; +54 wnd_state db ? ; +70 - rb (1024-71) + event_mask dd ? ; +71 + keyboard_mode db ? ; +75 + rb (1024-76) ends struct system_colors diff --git a/programs/system/taskbar/trunk/TASKBAR.ASM b/programs/system/taskbar/trunk/TASKBAR.ASM index 8291c3bf95..f09cd94406 100644 --- a/programs/system/taskbar/trunk/TASKBAR.ASM +++ b/programs/system/taskbar/trunk/TASKBAR.ASM @@ -1,85 +1,85 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; ; +; ; ; TASK PANEL for KolibriOS - Compile with fasm ; -; ; +; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;------------------------------------------------------------------------------ -; version: 2.25 -; last update: 14/07/2013 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Reinstall screen work area after change screen resolution +; version: 2.25 +; last update: 14/07/2013 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Reinstall screen work area after change screen resolution ;------------------------------------------------------------------------------ -; version: 2.24 -; last update: 16/06/2013 -; changed by: hidnplayr -; changes: Changed keymap hotkeys to only use left alt -; (Right alt has special function on some keyboards) +; version: 2.24 +; last update: 16/06/2013 +; changed by: hidnplayr +; changes: Changed keymap hotkeys to only use left alt +; (Right alt has special function on some keyboards) ;------------------------------------------------------------------------------ -; version: 2.23 -; last update: 26/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Using new f18.23 - minimize all windows +; version: 2.23 +; last update: 26/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Using new f18.23 - minimize all windows ;------------------------------------------------------------------------------ -; version: 2.22 -; last update: 20/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Activation mechanism when trying to run an existing appl. -; Forced redrawing the background after the clean desktop (Win+D) +; version: 2.22 +; last update: 20/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Activation mechanism when trying to run an existing appl. +; Forced redrawing the background after the clean desktop (Win+D) ;------------------------------------------------------------------------------ -; version: 2.2 -; last update: 19/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Support PrintScreen for SCRSHOOT. -; Path to run applications from the INI file. -; Algorithm anti-duplication of applications for run with hotkey. -; Added color selection for the Alt+Tab. -; Alt+Ctrl+ArrowLeft - Page list next -; Alt+Ctrl+ArrowRight - Page list previous +; version: 2.2 +; last update: 19/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Support PrintScreen for SCRSHOOT. +; Path to run applications from the INI file. +; Algorithm anti-duplication of applications for run with hotkey. +; Added color selection for the Alt+Tab. +; Alt+Ctrl+ArrowLeft - Page list next +; Alt+Ctrl+ArrowRight - Page list previous ;------------------------------------------------------------------------------ -; version: 2.1 -; last update: 18/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Added color selection for the text. -; Show "change page list" only if the applications -; does not fit in the panel. -; Display file names up to 11 char previously displ. only 8 char. +; version: 2.1 +; last update: 18/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Added color selection for the text. +; Show "change page list" only if the applications +; does not fit in the panel. +; Display file names up to 11 char previously displ. only 8 char. ;------------------------------------------------------------------------------ -; version: 2.0 -; last update: 17/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: New logic of switching windows (turnoff/restore) -; New logic of button "clear desktop". -; Win+D (restore/clear desktop), Win+R (start RUN application). -; Using the library LibINI to set the parameters. -; New style of panel. Start application Menu with boot options. -; two versions of the location of the panel - -; the bottom of the desktop and on top of the desktop. +; version: 2.0 +; last update: 17/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: New logic of switching windows (turnoff/restore) +; New logic of button "clear desktop". +; Win+D (restore/clear desktop), Win+R (start RUN application). +; Using the library LibINI to set the parameters. +; New style of panel. Start application Menu with boot options. +; two versions of the location of the panel - +; the bottom of the desktop and on top of the desktop. ;------------------------------------------------------------------------------ -; last update: 31/03/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: The program uses only 20 Kb memory is now. -; Code optimizing and refactoring. +; last update: 31/03/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: The program uses only 20 Kb memory is now. +; Code optimizing and refactoring. ;------------------------------------------------------------------------------ format binary as "" - use32 - org 0x0 - db 'MENUET01' ; 8 byte id - dd 0x01 ; header version - dd START ; program start - dd IM_END ; program image size - dd I_END ; reguired amount of memory - 10 Kb - dd stack_top ; esp - dd 0x0 ; boot parameters - dd path ; application pach + use32 + org 0x0 + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; program start + dd IM_END ; program image size + dd I_END ; reguired amount of memory - 10 Kb + dd stack_top ; esp + dd 0x0 ; boot parameters + dd path ; application pach ;------------------------------------------------------------------------------ include 'lang.inc' include '../../../macros.inc' include '../../../proc32.inc' ;include '../../../debug.inc' -include 'MOI.INC' ;раскладки клавиатуры +include 'MOI.INC' ;раскладки клавиатуры include '../../../develop/libraries/box_lib/load_lib.mac' - @use_library ;use load lib macros + @use_library ;use load lib macros ;------------------------------------------------------------------------------ caps_lock_check fix 1 ;------------------------------------------------------------------------------ @@ -93,7 +93,7 @@ else MENU_SIZE = 50 end if CLD_SIZE = 20 -TAB_SIZE = 75 ;60 +TAB_SIZE = 75 ;60 TRAY_SIZE = 140 CLOCK_SIZE = 40 @@ -103,1056 +103,1056 @@ PAGE_LIST_SIZE = 36 ;------------------------------------------------------------------------------ align 4 handle_key: - mcall 18,7 - mov [active_process],eax + mcall 18,7 + mov [active_process],eax - mcall 2 + mcall 2 -; dps "panel key: " -; dph eax -; newline +; dps "panel key: " +; dph eax +; newline - cmp al, 2 - jnz begin_1.ret + cmp al, 2 + jnz begin_1.ret - mov ebx, exec_fileinfo - shr eax, 8 - cmp al, 0 - je prod + mov ebx, exec_fileinfo + shr eax, 8 + cmp al, 0 + je prod - mov [key_r],al - sub [key_r],3 - cmp [key_r],9 - jc alter + mov [key_r],al + sub [key_r],3 + cmp [key_r],9 + jc alter if caps_lock_check - cmp al,58 ;CAPS LOCK DOWN - jne @f + cmp al,58 ;CAPS LOCK DOWN + jne @f - pusha - mcall 26,2,9 - mov ebx,eax - mov eax,2 - mov [draw_flag_certainly],1 - call draw_flag ; language - popa - ret + pusha + mcall 26,2,9 + mov ebx,eax + mov eax,2 + mov [draw_flag_certainly],1 + call draw_flag ; language + popa + ret @@: end if - cmp al, 15 ; Alt+Tab DOWN - jz alt_tab_pressed + cmp al, 15 ; Alt+Tab DOWN + jz alt_tab_pressed - cmp al, 88 ; Ctrl+Alt+F12 - jz start_end_application + cmp al, 88 ; Ctrl+Alt+F12 + jz start_end_application - cmp al, 91 ; RWin DOWN - jz set_win_key_flag + cmp al, 91 ; RWin DOWN + jz set_win_key_flag - cmp al, 92 ; LWin DOWN - jz set_win_key_flag + cmp al, 92 ; LWin DOWN + jz set_win_key_flag - cmp al, 1 ; LCtrl+Esc DOWN - jz set_win_key_flag + cmp al, 1 ; LCtrl+Esc DOWN + jz set_win_key_flag - cmp al, 219 ; RWin UP - jz cut_win_key_flag ;start_menu_application + cmp al, 219 ; RWin UP + jz cut_win_key_flag ;start_menu_application - cmp al, 220 ; LWin UP - jz cut_win_key_flag ;start_menu_application + cmp al, 220 ; LWin UP + jz cut_win_key_flag ;start_menu_application - cmp al, 129 ; LCtrl+Esc UP - jz cut_win_key_flag ;start_menu_application + cmp al, 129 ; LCtrl+Esc UP + jz cut_win_key_flag ;start_menu_application - cmp al, 62 ; Alt+F4 - jz kill_active_application + cmp al, 62 ; Alt+F4 + jz kill_active_application - cmp al, 205 - jz page_list_next + cmp al, 205 + jz page_list_next - cmp al, 203 - jz page_list_prev + cmp al, 203 + jz page_list_prev - cmp al, 69 ; Alt+Shift+NumLock - jz start_mousemul_application + cmp al, 69 ; Alt+Shift+NumLock + jz start_mousemul_application - cmp al, 19 ; Win+R - jz start_run_application + cmp al, 19 ; Win+R + jz start_run_application - cmp al, 32 ; Win+D - jz minimize_all_windows + cmp al, 32 ; Win+D + jz minimize_all_windows - cmp al, 55 ; PrintScreen DOWN - jz start_PrintScreen_application + cmp al, 55 ; PrintScreen DOWN + jz start_PrintScreen_application ;-------------------------------------- align 4 prod: - cmp [current_alt_tab_app], -1 - jz @f + cmp [current_alt_tab_app], -1 + jz @f - test ah, 0x30 ; Alt+Tab UP - jz alt_tab_released + test ah, 0x30 ; Alt+Tab UP + jz alt_tab_released ;-------------------------------------- align 4 @@: ; this is hotkey LCtrl+LShift ;or LShift+RShift - jmp karu + jmp karu ;------------------------------------------------------------------------------ align 4 set_win_key_flag: - mov [win_key_flag],1 - ret + mov [win_key_flag],1 + ret ;------------------------------------------------------------------------------ align 4 cut_win_key_flag: - xor eax,eax - mov [win_key_flag],al - xchg [start_menu_flag],al - test al,al - jz start_menu_application - ret + xor eax,eax + mov [win_key_flag],al + xchg [start_menu_flag],al + test al,al + jz start_menu_application + ret ;------------------------------------------------------------------------------ align 4 change_key_lang: - mov dword [ebx+8], chlang - mcall 70 + mov dword [ebx+8], chlang + mcall 70 ;-------------------------------------- align 4 begin_1: - mov ecx,[active_process] - mcall 18, 3 - mcall 5, 25 + mov ecx,[active_process] + mcall 18, 3 + mcall 5, 25 ;-------------------------------------- align 4 .ret: - ret + ret ;------------------------------------------------------------------------------ align 4 start_end_application: - mov esi,end_name - call algorithm_anti_duplication - test eax,eax - jz @f + mov esi,end_name + call algorithm_anti_duplication + test eax,eax + jz @f - mcall 18,3,edi - ret + mcall 18,3,edi + ret ;-------------------------------------- align 4 @@: - mov ebx, exec_fileinfo - mov dword [ebx+21],end_name - mcall 70 - ret + mov ebx, exec_fileinfo + mov dword [ebx + 21],end_name + mcall 70 + ret ;------------------------------------------------------------------------------ align 4 start_mousemul_application: - mov esi,mousemul_name - call algorithm_anti_duplication - test eax,eax - jz @f - ret + mov esi,mousemul_name + call algorithm_anti_duplication + test eax,eax + jz @f + ret ;-------------------------------------- align 4 @@: - mov ebx, exec_fileinfo - mov dword [ebx+21],mousemul_name - mcall 70 - ret + mov ebx, exec_fileinfo + mov dword [ebx + 21],mousemul_name + mcall 70 + ret ;------------------------------------------------------------------------------ align 4 kill_active_application: - mcall 72,1,3,1 - jmp begin_1.ret + mcall 72,1,3,1 + jmp begin_1.ret ;------------------------------------------------------------------------------ align 4 start_menu_application: - call menu_handler - jmp begin_1.ret + call menu_handler + jmp begin_1.ret ;------------------------------------------------------------------------------ align 4 start_run_application: - cmp [win_key_flag],1 - je @f - ret + cmp [win_key_flag],1 + je @f + ret ;-------------------------------------- align 4 @@: - mov [start_menu_flag],1 + mov [start_menu_flag],1 - mov esi,run_name - call algorithm_anti_duplication - test eax,eax - jz @f + mov esi,run_name + call algorithm_anti_duplication + test eax,eax + jz @f - mcall 18,3,edi - ret + mcall 18,3,edi + ret ;-------------------------------------- align 4 @@: - mov ebx, exec_fileinfo - mov dword [ebx+21], run_name - mcall 70 - jmp begin_1.ret + mov ebx, exec_fileinfo + mov dword [ebx + 21], run_name + mcall 70 + jmp begin_1.ret ;------------------------------------------------------------------------------ align 4 start_PrintScreen_application: - mov esi,printscreen_name - call algorithm_anti_duplication - test eax,eax - jz @f - mcall 18,3,edi - ret + mov esi,printscreen_name + call algorithm_anti_duplication + test eax,eax + jz @f + mcall 18,3,edi + ret ;-------------------------------------- align 4 @@: - mov ebx, exec_fileinfo - mov dword [ebx+21],printscreen_name - mov [ebx+8],dword bootparam_printscreen - mcall 70 - jmp begin_1.ret + mov ebx, exec_fileinfo + mov dword [ebx + 21],printscreen_name + mov [ebx+8],dword bootparam_printscreen + mcall 70 + jmp begin_1.ret ;------------------------------------------------------------------------------ align 4 minimize_all_windows: - cmp [win_key_flag],1 - je @f - ret + cmp [win_key_flag],1 + je @f + ret ;-------------------------------------- align 4 @@: - mov [start_menu_flag],1 - call clean_desktop - ret + mov [start_menu_flag],1 + call clean_desktop + ret ;------------------------------------------------------------------------------ align 4 algorithm_anti_duplication: - cld + cld ;-------------------------------------- align 4 @@: - lodsb - test al,al - jnz @r + lodsb + test al,al + jnz @r ;-------------------------------------- align 4 @@: - std - lodsb - cmp al,'/' - jnz @r - add esi,2 - mov edx,esi + std + lodsb + cmp al,'/' + jnz @r + add esi,2 + mov edx,esi - mov edi,1 + mov edi,1 ;-------------------------------------- align 4 @@: - inc edi - mov ecx,edi - mcall 9,procinfo_window_tabs + inc edi + mov ecx,edi + mcall 9,procinfo_window_tabs - cmp edi,eax - jg .apply_changes + cmp edi,eax + jg .apply_changes - mov esi,edx - mov ecx,11 - add ebx,9 - cld + mov esi,edx + mov ecx,11 + add ebx,9 + cld ;-------------------------------------- align 4 .loop: - lodsb - inc ebx - cmp al,[ebx] - jne @r + lodsb + inc ebx + cmp al,[ebx] + jne @r - loop .loop + loop .loop - mov eax,1 - ret + mov eax,1 + ret ;-------------------------------------- align 4 .apply_changes: - xor eax,eax - ret + xor eax,eax + ret ;------------------------------------------------------------------------------ align 4 page_list_next: - cmp [page_list],50 - je @f + cmp [page_list],50 + je @f - xor eax,eax - cmp [page_list_enable],eax - je @f + xor eax,eax + cmp [page_list_enable],eax + je @f - inc [page_list] - mov [redraw_window_flag],1 + inc [page_list] + mov [redraw_window_flag],1 ;-------------------------------------- align 4 @@: - jmp begin_1.ret + jmp begin_1.ret ;------------------------------------------------------------------------------ align 4 page_list_prev: - xor eax,eax - cmp [page_list],eax - je @f + xor eax,eax + cmp [page_list],eax + je @f - cmp [page_list_enable],eax - je @f + cmp [page_list_enable],eax + je @f - dec [page_list] - mov [redraw_window_flag],1 + dec [page_list] + mov [redraw_window_flag],1 ;-------------------------------------- align 4 @@: - jmp begin_1.ret + jmp begin_1.ret ;------------------------------------------------------------------------------ align 4 alt_tab_pressed: ; handle Alt+Tab and Alt+Shift+Tab - mov ebp, eax - cmp [current_alt_tab_app], -1 - jnz has_alt_tab_app + mov ebp, eax + cmp [current_alt_tab_app], -1 + jnz has_alt_tab_app ; заполняем таблицу приложений, подлежащих переключению - xor edx, edx - mov ebx, procinfo_window_tabs - mov ecx, 1 + xor edx, edx + mov ebx, procinfo_window_tabs + mov ecx, 1 ;-------------------------------------- align 4 .fill: - inc ecx - mcall 9 - call need_window_tab - jz @f + inc ecx + mcall 9 + call need_window_tab + jz @f - cmp edx, 256 - jz @f + cmp edx, 256 + jz @f - mov [alt_tab_list+edx*8], ecx - movzx esi, word [ebx+4] - mov [alt_tab_list+edx*8+4], esi - inc edx + mov [alt_tab_list+edx*8], ecx + movzx esi, word [ebx+4] + mov [alt_tab_list+edx*8+4], esi + inc edx ;-------------------------------------- align 4 @@: - cmp ecx,eax - jb .fill + cmp ecx,eax + jb .fill - mov [alt_tab_list_size], edx - test edx, edx - jz begin_1.ret + mov [alt_tab_list_size], edx + test edx, edx + jz begin_1.ret - mcall 66,4,0,0 ; ловим момент отпускания всех управляющих клавиш - test eax, eax - jnz begin_1.ret + mcall 66,4,0,0 ; ловим момент отпускания всех управляющих клавиш + test eax, eax + jnz begin_1.ret - xor edx, edx - mov eax, [alt_tab_list+4] - xor ecx, ecx - inc ecx + xor edx, edx + mov eax, [alt_tab_list+4] + xor ecx, ecx + inc ecx ;-------------------------------------- align 4 .findmax: - cmp [alt_tab_list+ecx*8+4], eax - jb @f + cmp [alt_tab_list+ecx*8+4], eax + jb @f - mov edx, ecx - mov eax, [alt_tab_list+ecx*8+4] + mov edx, ecx + mov eax, [alt_tab_list+ecx*8+4] ;-------------------------------------- align 4 @@: - inc ecx - cmp ecx, [alt_tab_list_size] - jb .findmax + inc ecx + cmp ecx, [alt_tab_list_size] + jb .findmax - mov [current_alt_tab_app], edx + mov [current_alt_tab_app], edx ;-------------------------------------- align 4 has_alt_tab_app: - mov eax, [current_alt_tab_app] - mov edx, [alt_tab_list+eax*8+4] ; slot - xor ecx, ecx - or eax, -1 - test ebp, 300h - jz .notshift + mov eax, [current_alt_tab_app] + mov edx, [alt_tab_list+eax*8+4] ; slot + xor ecx, ecx + or eax, -1 + test ebp, 300h + jz .notshift - or esi, -1 + or esi, -1 ;-------------------------------------- align 4 .loop1: - cmp [alt_tab_list+ecx*8+4], edx - jbe @f + cmp [alt_tab_list+ecx*8+4], edx + jbe @f - cmp [alt_tab_list+ecx*8+4], esi - jae @f + cmp [alt_tab_list+ecx*8+4], esi + jae @f - mov eax, ecx - mov esi, [alt_tab_list+ecx*8+4] + mov eax, ecx + mov esi, [alt_tab_list+ecx*8+4] ;-------------------------------------- align 4 @@: - inc ecx - cmp ecx, [alt_tab_list_size] - jb .loop1 + inc ecx + cmp ecx, [alt_tab_list_size] + jb .loop1 - cmp eax, -1 - jnz .found + cmp eax, -1 + jnz .found - xor edx, edx - xor ecx, ecx - jmp .loop1 + xor edx, edx + xor ecx, ecx + jmp .loop1 ;-------------------------------------- align 4 .notshift: - xor esi, esi + xor esi, esi ;-------------------------------------- align 4 .loop2: - cmp [alt_tab_list+ecx*8+4], edx - jae @f + cmp [alt_tab_list+ecx*8+4], edx + jae @f - cmp [alt_tab_list+ecx*8+4], esi - jbe @f + cmp [alt_tab_list+ecx*8+4], esi + jbe @f - mov eax, ecx - mov esi, [alt_tab_list+ecx*8+4] + mov eax, ecx + mov esi, [alt_tab_list+ecx*8+4] ;-------------------------------------- align 4 @@: - inc ecx - cmp ecx, [alt_tab_list_size] - jb .loop2 + inc ecx + cmp ecx, [alt_tab_list_size] + jb .loop2 - cmp eax, -1 - jnz .found + cmp eax, -1 + jnz .found - or edx, -1 - xor ecx, ecx - jmp .loop2 + or edx, -1 + xor ecx, ecx + jmp .loop2 ;-------------------------------------- align 4 .found: - mov [current_alt_tab_app], eax - push eax - xor edx, edx - div [max_applications] - mov [page_list], eax - mov edi, app_list - push edi - mov ecx, 20 - or eax, -1 - rep stosd - pop edi - pop ecx - sub ecx, edx + mov [current_alt_tab_app], eax + push eax + xor edx, edx + div [max_applications] + mov [page_list], eax + mov edi, app_list + push edi + mov ecx, 20 + or eax, -1 + rep stosd + pop edi + pop ecx + sub ecx, edx ;-------------------------------------- align 4 @@: - cmp ecx, [alt_tab_list_size] - jae redraw_window_tabs + cmp ecx, [alt_tab_list_size] + jae redraw_window_tabs - mov eax, [alt_tab_list+ecx*8] - stosd - inc ecx - jmp @b + mov eax, [alt_tab_list+ecx*8] + stosd + inc ecx + jmp @b ;-------------------------------------- align 4 alt_tab_released: - mcall 66,5,0,0 ; уже поймали, хватит :) + mcall 66,5,0,0 ; уже поймали, хватит :) - or eax, -1 - xchg eax, [current_alt_tab_app] - mov ecx, [alt_tab_list+eax*8] - mcall 18,3 + or eax, -1 + xchg eax, [current_alt_tab_app] + mov ecx, [alt_tab_list+eax*8] + mcall 18,3 - jmp redraw_window_tabs + jmp redraw_window_tabs ;------------------------------------------------------------------------------ align 4 -active_process dd 0 +active_process dd 0 exit: - mcall -1 + mcall -1 ;------------------------------------------------------------------------------ START: - mcall 68,11 - mcall 66,1,1 + mcall 68,11 + mcall 66,1,1 - mcall 9,process_info_buffer,-1 - mov ecx,[ebx+30] ; PID - mcall 18,21 - mov [my_active_slot],eax ; WINDOW SLOT + mcall 9,process_info_buffer,-1 + mov ecx, [ebx + process_information.PID] ; PID + mcall 18,21 + mov [my_active_slot],eax ; WINDOW SLOT load_libraries l_libs_start,end_l_libs - test eax,eax - jnz exit + test eax,eax + jnz exit - call Get_ini + call Get_ini - mcall 66,4,0,2 ; LShift+RShift - mcall 66,,,33h ; LCtrl+LShift - mcall 66,,88,110h ; Alt+Ctrl+F12 - mcall 66,,91,0h ; RWin DOWN - mcall 66,,92 ; LWin DOWN - mcall 66,,219 ; RWin UP - mcall 66,,220 ; LWin UP - mcall 66,,19,0h ; Win+R DOWN - mcall 66,,32,0h ; Win+D DOWN - mcall 66,,55,10h ; Ctrl+PrintScreen DOWN - mcall 66,,1,30h ; LCtrl+Esc DOWN - mcall 66,,129 ; LCtrl+Esc UP - mcall 66,,62,300h ; Alt+F4 - mcall 66,,2 ; Alt+1 - mcall 66,,3 ; Alt+2 - mcall 66,,4 ; Alt+3 - mcall 66,,5 ; Alt+4 - mcall 66,,6 ; Alt+5 - mcall 66,,7 ; Alt+6 - mcall 66,,8 ; Alt+7 - mcall 66,,9 ; Alt+8 - mcall 66,,10 ; Alt+9 - mcall 66,,15 ; Alt+Tab DOWN - mcall 66,,15,301h ; Alt+Shift+Tab DOWN - mcall 66,,69 ; Alt+Shift+NumLock + mcall 66,4,0,2 ; LShift+RShift + mcall 66,,,33h ; LCtrl+LShift + mcall 66,,88,110h ; Alt+Ctrl+F12 + mcall 66,,91,0h ; RWin DOWN + mcall 66,,92 ; LWin DOWN + mcall 66,,219 ; RWin UP + mcall 66,,220 ; LWin UP + mcall 66,,19,0h ; Win+R DOWN + mcall 66,,32,0h ; Win+D DOWN + mcall 66,,55,10h ; Ctrl+PrintScreen DOWN + mcall 66,,1,30h ; LCtrl+Esc DOWN + mcall 66,,129 ; LCtrl+Esc UP + mcall 66,,62,300h ; Alt+F4 + mcall 66,,2 ; Alt+1 + mcall 66,,3 ; Alt+2 + mcall 66,,4 ; Alt+3 + mcall 66,,5 ; Alt+4 + mcall 66,,6 ; Alt+5 + mcall 66,,7 ; Alt+6 + mcall 66,,8 ; Alt+7 + mcall 66,,9 ; Alt+8 + mcall 66,,10 ; Alt+9 + mcall 66,,15 ; Alt+Tab DOWN + mcall 66,,15,301h ; Alt+Shift+Tab DOWN + mcall 66,,69 ; Alt+Shift+NumLock if caps_lock_check - xor edx,edx - mcall 66,4,58 + xor edx,edx + mcall 66,4,58 end if - mcall 14 - mov [screen_size],eax + mcall 14 + mov [screen_size],eax - call set_work_ares_pf_screen + call set_work_ares_pf_screen - mcall 9,process_info_buffer,-1 - mov ecx,[process_info_buffer+30] - mcall 18,21 - mov [this_slot],eax - mov [max_slot],255 + mcall 9,process_info_buffer,-1 + mov ecx,[process_info_buffer.PID] + mcall 18,21 + mov [this_slot],eax + mov [max_slot],255 ;-------------------------------------- align 4 start_after_minimize: - call draw_window - call draw_running_applications + call draw_window + call draw_running_applications - mcall 23,30 - call load_ini + mcall 23,30 + call load_ini ;------------------------------------------------------------------------------ align 4 still: - call draw_time - call draw_cpu_usage - call draw_running_applications + call draw_time + call draw_cpu_usage + call draw_running_applications - mcall 18,7 ; check if active window changed - cmp eax, [last_active_window] - jz @f + mcall 18,7 ; check if active window changed + cmp eax, [last_active_window] + jz @f ; need_window_tab: ; in: ebx->process info ; out: ZF set <=> do not draw - mov ebx,[last_active_window] - mov [prev_active_window], ebx - mov [last_active_window], eax + mov ebx,[last_active_window] + mov [prev_active_window], ebx + mov [last_active_window], eax - mov ecx, eax - mcall 9,process_info_buffer + mov ecx, eax + mcall 9,process_info_buffer - call need_window_tab - jnz .need_repaint + call need_window_tab + jnz .need_repaint - mcall 9,process_info_buffer,[prev_active_window] - call need_window_tab - jz @f + mcall 9,process_info_buffer,[prev_active_window] + call need_window_tab + jz @f ;-------------------------------------- align 4 .need_repaint: - mov dword [active_window_changed], 1 + mov dword [active_window_changed], 1 ;-------------------------------------- align 4 @@: - mcall 23,20 + mcall 23,20 - push eax - mcall 18,7 - cmp [my_active_slot],eax - je @f + push eax + mcall 18,7 + cmp [my_active_slot],eax + je @f - mov [current_active_slot],eax + mov [current_active_slot],eax ;-------------------------------------- align 4 @@: - pop eax + pop eax - cmp eax,1 ; redraw ? - jz red + cmp eax,1 ; redraw ? + jz red - push eax - mov eax,[redraw_window_flag] - test eax,eax - jz @f + push eax + mov eax,[redraw_window_flag] + test eax,eax + jz @f - call draw_window + call draw_window ;-------------------------------------- align 4 @@: - pop eax + pop eax - cmp eax,2 - jnz @f - call handle_key - jmp .key + cmp eax,2 + jnz @f + call handle_key + jmp .key ;-------------------------------------- align 4 @@: - cmp eax,3 ; button ? - jz button + cmp eax,3 ; button ? + jz button ;-------------------------------------- align 4 .key: - cmp dword [active_window_changed], 0 - jnz red_active + cmp dword [active_window_changed], 0 + jnz red_active - call draw_flag ; language - jmp still + call draw_flag ; language + jmp still ;------------------------------------------------------------------------------ align 4 set_work_ares_pf_screen: ;eax = [xsize]*65536 + [ysize] - mov ecx,eax - shr ecx,16 - and eax,0xFFFF - cmp [place_attachment],1 - je @f + mov ecx,eax + shr ecx,16 + and eax,0xFFFF + cmp [place_attachment],1 + je @f - ror eax,16 - add eax,[height] - rol eax,16 - mov edx,eax - jmp .selected + ror eax,16 + add eax,[height] + rol eax,16 + mov edx,eax + jmp .selected ;-------------------------------------- align 4 @@: - sub eax,[height] - mov edx, eax + sub eax,[height] + mov edx, eax ;-------------------------------------- align 4 .selected: - mcall 48,6 - ret + mcall 48,6 + ret ;------------------------------------------------------------------------------ align 4 red_active: red: - mov dword [active_window_changed], 0 + mov dword [active_window_changed], 0 - mcall 14 - movzx ecx,ax - mov edx,eax - shr edx,16 - cmp [screen_size.height],ax - jne @f + 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 + cmp [screen_size.width],ax + je .lp1 - rol eax,16 + rol eax,16 ;-------------------------------------- align 4 @@: - mov [screen_size],eax + mov [screen_size],eax - push ecx edx - call set_work_ares_pf_screen - pop edx ecx + push ecx edx + call set_work_ares_pf_screen + pop edx ecx - sub ecx,[height] - mcall 67,0,,,[height] + sub ecx,[height] + mcall 67,0,,,[height] ;-------------------------------------- align 4 .lp1: - call draw_window - jmp still + call draw_window + jmp still ;------------------------------------------------------------------------------ align 4 button: - mcall 17 - test eax,0xfffffe00 ; is it close button? (signal from @taskbar) - jz still ; if so - wait for another event, because @taskbar shouldn't be closed + mcall 17 + test eax,0xfffffe00 ; is it close button? (signal from @taskbar) + jz still ; if so - wait for another event, because @taskbar shouldn't be closed - cmp al, 0 - jnz right_mouse + cmp al, 0 + jnz right_mouse - cmp ah,50 - jb no_activate - cmp ah,70 - jg no_activate + cmp ah,50 + jb no_activate + cmp ah,70 + jg no_activate - movzx ecx,byte ah - sub ecx,52 - shl ecx,2 + movzx ecx,byte ah + sub ecx,52 + shl ecx,2 - mov ecx,[app_list+ecx] + mov ecx,[app_list+ecx] - mcall 9,process_info_buffer + mcall 9,process_info_buffer - test [ebx+70],dword 10b ; window is minimized to panel - jnz @f + test [ebx + process_information.wnd_state], byte 10b ; window is minimized to panel + jnz @f - cmp ecx,[current_active_slot] - je .turn_off + cmp ecx,[current_active_slot] + je .turn_off ;-------------------------------------- align 4 @@: - mcall 18,3, - jmp .task_switching + mcall 18,3, + jmp .task_switching ;-------------------------------------- align 4 .turn_off: - mov edx,ecx - mcall 18,22,0 + mov edx,ecx + mcall 18,22,0 ;-------------------------------------- align 4 .task_switching: - mcall 68,1 - jmp still + mcall 68,1 + jmp still ;------------------------------------------------------------------------------ align 4 right_mouse: - cmp ah,50 - jb still + cmp ah,50 + jb still - cmp ah,70 - jg still + cmp ah,70 + jg still - movzx ecx,byte ah - sub ecx,52 + movzx ecx,byte ah + sub ecx,52 - cmp ecx, [app_tab_count] - jge still + cmp ecx, [app_tab_count] + jge still - shl ecx,2 - mcall 37,0 - mov ebx, eax - shr eax, 16 - mov [x_coord], ax - and ebx, 0xFFFF - mov [y_coord], bx + shl ecx,2 + mcall 37,0 + mov ebx, eax + shr eax, 16 + mov [x_coord], ax + and ebx, 0xFFFF + mov [y_coord], bx - mov ecx,[app_list+ecx] ; ecx->selected app.slot - mov [n_slot], ecx - mcall 9,procinfo_for_detect + mov ecx,[app_list+ecx] ; ecx->selected app.slot + mov [n_slot], ecx + mcall 9,procinfo_for_detect - mcall 51,1,context_menu_start,ctx_menu_stack + mcall 51,1,context_menu_start,ctx_menu_stack - mov [ctx_menu_PID], eax - jmp still + mov [ctx_menu_PID], eax + jmp still ;------------------------------------------------------------------------------ align 4 no_activate: - cmp ah,101 ; minimize to left - je left_button + cmp ah,101 ; minimize to left + je left_button - cmp ah,102 ; minimize to right - je right_button + cmp ah,102 ; minimize to right + je right_button - cmp ah, 103 - je clean_desktop_1 ; minimize all windows + cmp ah, 103 + je clean_desktop_1 ; minimize all windows - cmp ah,byte 1 ; start/terminate menu - jnz noselect + cmp ah,byte 1 ; start/terminate menu + jnz noselect - call menu_handler + call menu_handler - jmp still + jmp still ;-------------------------------------- align 4 clean_desktop_1: - call clean_desktop - jmp still + call clean_desktop + jmp still ;-------------------------------------- align 4 noselect: - mov ebx, exec_fileinfo - cmp ah,byte 2 ; start calendar - jnz noid15 ;noclock + mov ebx, exec_fileinfo + cmp ah,byte 2 ; start calendar + jnz noid15 ;noclock - mov esi,calendar_name - call algorithm_anti_duplication - test eax,eax - jz @f + mov esi,calendar_name + call algorithm_anti_duplication + test eax,eax + jz @f - mcall 18,2,edi - jmp still + mcall 18,2,edi + jmp still ;-------------------------------------- align 4 @@: - mov ebx, exec_fileinfo - mov dword [ebx+21], calendar_name - mcall 70 - jmp still + mov ebx, exec_fileinfo + mov dword [ebx+21], calendar_name + mcall 70 + jmp still ;-------------------------------------- align 4 noid15: - cmp ah,16 - jne noid16 + cmp ah,16 + jne noid16 - call karu - call draw_flag ; language - jmp still + call karu + call draw_flag ; language + jmp still ;-------------------------------------- align 4 noid16: - cmp ah,18 - jne noid18 + cmp ah,18 + jne noid18 - mov esi,sysmeter_name - call algorithm_anti_duplication - test eax,eax - jz @f + mov esi,sysmeter_name + call algorithm_anti_duplication + test eax,eax + jz @f - mcall 18,2,edi - jmp still + mcall 18,2,edi + jmp still ;-------------------------------------- align 4 @@: - mov ebx, exec_fileinfo - mov dword [ebx+21], sysmeter_name - mcall 70 - jmp still + mov ebx, exec_fileinfo + mov dword [ebx+21], sysmeter_name + mcall 70 + jmp still ;-------------------------------------- align 4 noid18: - cmp ah,21 - jnz noid21 + cmp ah,21 + jnz noid21 - cmp [page_list],50 - jnc still - inc [page_list] - jmp red + cmp [page_list],50 + jnc still + inc [page_list] + jmp red ;-------------------------------------- align 4 noid21: - cmp ah,22 - jnz still + cmp ah,22 + jnz still - cmp [page_list],0 - je still + cmp [page_list],0 + je still - dec [page_list] - jmp red + dec [page_list] + jmp red ;------------------------------------------------------------------------------ align 4 restore_desktop: - mcall 9,process_info_buffer,-1 - mov [max_slot], eax - mov ecx, 2 - mov edx, 2 + mcall 9,process_info_buffer,-1 + mov [max_slot], eax + mov ecx, 2 + mov edx, 2 ;-------------------------------------- align 4 @@: - mcall 18, 22 - inc edx - cmp edx, [max_slot] - jbe @b - ret + mcall 18, 22 + inc edx + cmp edx, [max_slot] + jbe @b + ret ;------------------------------------------------------------------------------ align 4 clean_desktop: - mcall 18,23 - test eax,eax - jnz @f - call restore_desktop + mcall 18,23 + test eax,eax + jnz @f + call restore_desktop ;-------------------------------------- align 4 @@: - ret + ret ;------------------------------------------------------------------------------ align 4 conversion_HEX_to_ASCII: - ror eax,12 - mov ecx,4 + ror eax,12 + mov ecx,4 ;-------------------------------------- align 4 .loop: - mov bl,al - rol eax,4 - and bl,0xf - cmp bl,0xA ; check for ABCDEF - jae @f + mov bl,al + rol eax,4 + and bl,0xf + cmp bl,0xA ; check for ABCDEF + jae @f - add bl,0x30 ; 0-9 - jmp .store + add bl,0x30 ; 0-9 + jmp .store ;-------------------------------------- align 4 @@: - add bl,0x57 ; A-F + add bl,0x57 ; A-F ;-------------------------------------- align 4 .store: -; dps "param_store: " - mov [edi],bl - inc edi - dec ecx - jnz .loop - ret +; dps "param_store: " + mov [edi],bl + inc edi + dec ecx + jnz .loop + ret ;------------------------------------------------------------------------------ align 4 menu_handler: - mov edi,bootparam + mov edi,bootparam - mov eax,[menu_button_x.start] - call conversion_HEX_to_ASCII + mov eax,[menu_button_x.start] + call conversion_HEX_to_ASCII - mov eax,[menu_button_x.size] - call conversion_HEX_to_ASCII + mov eax,[menu_button_x.size] + call conversion_HEX_to_ASCII - mov eax,[menu_button_y.start] - call conversion_HEX_to_ASCII + mov eax,[menu_button_y.start] + call conversion_HEX_to_ASCII - mov eax,[menu_button_y.size] - call conversion_HEX_to_ASCII + mov eax,[menu_button_y.size] + call conversion_HEX_to_ASCII - mov eax,[height] - call conversion_HEX_to_ASCII + mov eax,[height] + call conversion_HEX_to_ASCII - mov eax,[place_attachment] - call conversion_HEX_to_ASCII + mov eax,[place_attachment] + call conversion_HEX_to_ASCII - xor eax,eax ; terminator for boot parameters string - stosd + xor eax,eax ; terminator for boot parameters string + stosd - mov ebx, exec_fileinfo - mov [ebx+21],dword menu_name - mov [ebx+8],dword bootparam - mcall 70 - mov [ebx+8],dword 0 - ret + mov ebx, exec_fileinfo + mov [ebx+21],dword menu_name + mov [ebx+8],dword bootparam + mcall 70 + mov [ebx+8],dword 0 + ret ;------------------------------------------------------------------------------ align 4 draw_small_right: - pusha - mcall 12,1 + pusha + mcall 12,1 - xor eax,eax - mov edx,[wcolor] - mov esi,edx - mov edi,edx - or edx, 0x01000000 - mcall + xor eax,eax + mov edx,[wcolor] + mov esi,edx + mov edi,edx + or edx, 0x01000000 + mcall - xor ecx,ecx - mov cx,[height] - mcall 8,<0,10>,,1,[wcolor] + xor ecx,ecx + mov cx,[height] + mcall 8,<0,10>,,1,[wcolor] - mov ebx,2*65536 ;+6 - mov bx,[height] - shr bx,1 - sub bx,3 - mov edx,[wcolor] - mov eax,COLOR_CHANGE_MAGNITUDE_2 - call add_color_change_magnitude - mov ecx,edx - mcall 4,,,hidetext,1 + mov ebx,2*65536 ;+6 + mov bx,[height] + shr bx,1 + sub bx,3 + mov edx,[wcolor] + mov eax,COLOR_CHANGE_MAGNITUDE_2 + call add_color_change_magnitude + mov ecx,edx + mcall 4,,,hidetext,1 - mcall 12,2 - popa - ret + mcall 12,2 + popa + ret ;------------------------------------------------------------------------------ align 4 draw_small_left: - pusha - mcall 12,1 + pusha + mcall 12,1 - xor eax,eax - mov edx,[wcolor] - mov esi,edx - mov edi,edx - or edx, 0x01000000 - mcall + xor eax,eax + mov edx,[wcolor] + mov esi,edx + mov edi,edx + or edx, 0x01000000 + mcall - xor ecx,ecx - mov cx,[height] - mcall 8,<0,9>,,1,[wcolor] + xor ecx,ecx + mov cx,[height] + mcall 8,<0,9>,,1,[wcolor] - mov ebx,3*65536 ;+6 - mov bx,[height] - shr bx,1 - sub bx,3 - mov edx,[wcolor] - mov eax,COLOR_CHANGE_MAGNITUDE_2 - call add_color_change_magnitude - mov ecx,edx - mcall 4,,,hidetext+1,1 + mov ebx,3*65536 ;+6 + mov bx,[height] + shr bx,1 + sub bx,3 + mov edx,[wcolor] + mov eax,COLOR_CHANGE_MAGNITUDE_2 + call add_color_change_magnitude + mov ecx,edx + mcall 4,,,hidetext+1,1 - mcall 12,2 - popa - ret + mcall 12,2 + popa + ret ;------------------------------------------------------------------------------ align 4 right_button: - mov [small_draw],dword draw_small_right + mov [small_draw],dword draw_small_right - mcall 14 + mcall 14 - shr eax, 16 - mov ebx, eax - mov ecx, -1 - mov edx, 9 - sub ebx, edx - mov esi, -1 - mcall 67 + shr eax, 16 + mov ebx, eax + mov ecx, -1 + mov edx, 9 + sub ebx, edx + mov esi, -1 + mcall 67 - call draw_small_right - jmp small_wait + call draw_small_right + jmp small_wait ;------------------------------------------------------------------------------ align 4 left_button: - mov [small_draw],dword draw_small_left + mov [small_draw],dword draw_small_left - xor ebx,ebx - mcall 67,,-1,9,-1 + xor ebx,ebx + mcall 67,,-1,9,-1 - call draw_small_left + call draw_small_left ;-------------------------------------- align 4 small_wait: - mcall 10 - cmp eax,1 - jne no_win + mcall 10 + cmp eax,1 + jne no_win - call [small_draw] - jmp small_wait + call [small_draw] + jmp small_wait ;-------------------------------------- align 4 no_win: - cmp eax,2 - jne no_key + cmp eax,2 + jne no_key - call handle_key - jmp small_wait + call handle_key + jmp small_wait ;-------------------------------------- align 4 no_key: - mcall 17 - cmp ah,1 - jne no_full + mcall 17 + cmp ah,1 + jne no_full - mcall 14 ; get screen max x & max y + mcall 14 ; get screen max x & max y - mov edx, eax - shr edx, 16 - xor ebx, ebx - mcall 67,,-1,,-1 ; x0 y0 xs ys + mov edx, eax + shr edx, 16 + xor ebx, ebx + mcall 67,,-1,,-1 ; x0 y0 xs ys - jmp still + jmp still ;-------------------------------------- align 4 no_full: - call menu_handler - jmp small_wait + call menu_handler + jmp small_wait ;------------------------------------------------------------------------------ include 'libini.inc' ;------------------------------------------------------------------------------ diff --git a/programs/system/taskbar/trunk/ctx_menu.asm b/programs/system/taskbar/trunk/ctx_menu.asm index 4e3b2b49c6..352c4d1730 100644 --- a/programs/system/taskbar/trunk/ctx_menu.asm +++ b/programs/system/taskbar/trunk/ctx_menu.asm @@ -1,164 +1,164 @@ -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 context_menu_start: - mcall 40,00100111b - mov ecx, [ctx_menu_PID] - mcall 18,21 - mov ecx, eax - mcall 18,3 - call draw_ctx_menu -;------------------------------------------------------------------------------ + mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE ;00100111b + mov ecx, [ctx_menu_PID] + mcall 18,21 + mov ecx, eax + mcall 18,3 + call draw_ctx_menu +;------------------------------------------------------------------------------ align 4 ctx_menu_still: - mcall 10 - cmp eax, 2 - jz ctx_menu_key + mcall 10 + cmp eax, EV_KEY + jz ctx_menu_key - cmp eax, 3 - jz ctx_menu_button + cmp eax, EV_BUTTON + jz ctx_menu_button - cmp eax, 6 - jz ctx_menu_mouse + cmp eax, EV_MOUSE + jz ctx_menu_mouse - call draw_ctx_menu - jmp ctx_menu_still -;------------------------------------------------------------------------------ + call draw_ctx_menu + jmp ctx_menu_still +;------------------------------------------------------------------------------ align 4 ctx_menu_mouse: - mcall 37,2 - xchg eax,ecx ; Если не одна из кнопок не нажата возвращаемся - ; в главный цикл потока - jecxz ctx_menu_still + mcall 37,2 + xchg eax,ecx ; Если не одна из кнопок не нажата возвращаемся + ; в главный цикл потока + jecxz ctx_menu_still - mcall 37,1 + mcall 37,1 - cmp ax, 0 ; Тут проверяем произошёл-ли клик за пределами окна контекстного - jb ctx_menu_exit ; меню, если за пределами то закрываем контекстное меню + cmp ax, 0 ; Тут проверяем произошёл-ли клик за пределами окна контекстного + jb ctx_menu_exit ; меню, если за пределами то закрываем контекстное меню - cmp ax, 60 ; 41 - ja ctx_menu_exit + cmp ax, 60 ; 41 + ja ctx_menu_exit - shr eax, 16 - cmp ax, 0 - jb ctx_menu_exit + shr eax, 16 + cmp ax, 0 + jb ctx_menu_exit - cmp ax, 133 - ja ctx_menu_exit + cmp ax, 133 + ja ctx_menu_exit - jmp ctx_menu_still -;------------------------------------------------------------------------------ + jmp ctx_menu_still +;------------------------------------------------------------------------------ align 4 ctx_menu_key: - mcall 2 + mcall 2 ;-------------------------------------- align 4 ctx_menu_button: - mcall 17 - cmp ah, 1 - jne @f + mcall 17 + cmp ah, 1 + jne @f -; mov eax, 18 -; mov ebx, 2 -; mov ecx, [n_slot] -; jmp .lllxxx - mcall 18,3,[n_slot] - mcall 72,1,3,1 - mcall 68,1 - jmp ctx_menu_exit +; mov eax, 18 +; mov ebx, 2 +; mov ecx, [n_slot] +; jmp .lllxxx + mcall 18,3,[n_slot] + mcall 72,1,3,1 + mcall 68,1 + jmp ctx_menu_exit ;-------------------------------------- align 4 @@: - cmp ah, 2 - jne ctx_menu_still - mov eax, 18 - mov ebx, 22 - mov edx, [n_slot] - xor ecx, ecx + cmp ah, 2 + jne ctx_menu_still + mov eax, 18 + mov ebx, 22 + mov edx, [n_slot] + xor ecx, ecx - test [procinfo_for_detect+70],byte 2 - setnz cl - add cl, cl + test [procinfo_for_detect.wnd_state],byte 2 + setnz cl + add cl, cl ;-------------------------------------- align 4 .lllxxx: - mcall - jmp ctx_menu_exit + mcall + jmp ctx_menu_exit ;-------------------------------------- align 4 ctx_menu_exit: - or eax,-1 - mcall -;------------------------------------------------------------------------------ + or eax,-1 + mcall +;------------------------------------------------------------------------------ align 4 ;func draw_ctx_menu draw_ctx_menu: - mcall 12, 1 + mcall 12, 1 - xor eax, eax - movzx ebx, [x_coord] - shl ebx, 16 - add ebx, 133 - movzx ecx, [y_coord] - sub ecx, 60 ; 41 - shl ecx, 16 - add ecx, 60 ; 41 - mov esi, [system_colours + 4] ; sc.grab - or esi, 0x81000000 - mcall ,,,[system_colours + 20],,[system_colours+8] + xor eax, eax + movzx ebx, [x_coord] + shl ebx, 16 + add ebx, 133 + movzx ecx, [y_coord] + sub ecx, 60 ; 41 + shl ecx, 16 + add ecx, 60 ; 41 + mov esi, [system_colours.grab] ; sc.grab + or esi, 0x81000000 + mcall ,,,[system_colours.work],,[system_colours.work_dark] - mcall 8,<0,133>,<22,17>,0x40000001 + mcall 8,<0,133>,<22,17>,0x40000001 - inc edx - mcall ,,<40,17> - - mov ecx, [system_colours + 16] ; sc.grab_text - or ecx, 0x10000000 - mcall 4,<32,4>,,ctx_menu_title,ctx_menu_title_end - ctx_menu_title + inc edx + mcall ,,<40,17> + + mov ecx, [system_colours.grab_text] ; sc.grab_text + or ecx, 0x10000000 + mcall 4,<32,4>,,ctx_menu_title,ctx_menu_title_end - ctx_menu_title - add ebx, 1 * 65536 - mcall + add ebx, 1 * 65536 + mcall - mov ecx, [system_colours + 32] ; sc.work_text - or ecx, 0x80000000 - mcall ,<4,28>,,ctx_menu_text + mov ecx, [system_colours.work_text] ; sc.work_text + or ecx, 0x80000000 + mcall ,<4,28>,,ctx_menu_text - mov edx, ctx_menu_text2 + mov edx, ctx_menu_text2 - test byte [procinfo_for_detect+70], 2 - jz @f - mov edx, ctx_menu_text3 + test byte [procinfo_for_detect.wnd_state], 2 + jz @f + mov edx, ctx_menu_text3 ;-------------------------------------- align 4 @@: - add bx, 18 - mcall + add bx, 18 + mcall - mcall 12,2 - ret + mcall 12,2 + ret ;endf -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 -x_coord rw 1 -y_coord rw 1 -n_slot rd 1 -ctx_menu_PID rd 1 -;------------------------------------------------------------------------------ +x_coord rw 1 +y_coord rw 1 +n_slot rd 1 +ctx_menu_PID rd 1 +;------------------------------------------------------------------------------ lsz ctx_menu_text,\ ru, <"X Закрыть Alt + F4",0>,\ en, <"X Close Alt + F4",0>,\ et, <"X Sulge Alt + F4",0>,\ -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ lsz ctx_menu_text2,\ ru, <25," Свернуть ",0>,\ en, <25," Minimize ",0>,\ et, <25," Minimeeri ",0>,\ -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ lsz ctx_menu_text3,\ ru, <24," Восстановить ",0>,\ en, <24," Restore ",0>,\ et, <24," Taasta ",0> -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ ctx_menu_title: - db 'KolibriOS' + db 'KolibriOS' ctx_menu_title_end: -;------------------------------------------------------------------------------ \ No newline at end of file +;------------------------------------------------------------------------------ \ No newline at end of file diff --git a/programs/system/taskbar/trunk/drawappl.inc b/programs/system/taskbar/trunk/drawappl.inc index 2ee0f8886b..f7bd897431 100644 --- a/programs/system/taskbar/trunk/drawappl.inc +++ b/programs/system/taskbar/trunk/drawappl.inc @@ -1,229 +1,229 @@ ;------------------------------------------------------------------------------ align 4 draw_running_applications: - pusha + pusha - cmp [run_appl],dword 0 - je .exit + cmp [run_appl],dword 0 + je .exit - call calculate_applications + call calculate_applications - cmp edi,[running_applications] - jne .noret - popa - ret + cmp edi,[running_applications] + jne .noret + popa + ret ;-------------------------------------- align 4 .noret: - call draw_window - mov [running_applications],edi - call redraw_window_tabs + call draw_window + mov [running_applications],edi + call redraw_window_tabs ;-------------------------------------- align 4 .exit: - popa - ret + popa + ret ;------------------------------------------------------------------------------ align 4 need_window_tab: ; in: ebx->process info ; out: ZF set <=> do not draw - cmp byte [ebx+10], '@' - jz .nodraw + cmp byte [ebx + process_information.process_name], '@' + jz .nodraw ; do not draw undefined (zero-sized) windows - cmp dword [ebx+42], 0 - jnz @f - cmp dword [ebx+46], 0 - jz .nodraw + cmp dword [ebx + process_information.box.width], 0 + jnz @f + cmp dword [ebx + process_information.box.height], 0 + jz .nodraw ;-------------------------------------- align 4 @@: ; do not draw OpenDialog windows - push edi - mov edi, dword [ebx+10] - or edi, 0x20202020 - cmp edi, 'open' - jne @f + push edi + mov edi, dword [ebx + process_information.process_name] + or edi, 0x20202020 + cmp edi, 'open' + jne @f - mov edi, dword [ebx+14] - or edi, 0x20202020 - cmp dword [ebx+14], 'dial' - jne @f + mov edi, dword [ebx + process_information.process_name + 4] + or edi, 0x20202020 + cmp edi, 'dial' + jne @f - pop edi - jmp .nodraw + pop edi + jmp .nodraw ;-------------------------------------- align 4 @@: - pop edi - cmp dword [ebx+10], 'ICON' - jnz @f + pop edi + cmp dword [ebx + process_information.process_name], 'ICON' + jnz @f - cmp [ebx+42], dword 51 - jnz @f + cmp [ebx + process_information.box.width], dword 51 + jnz @f - cmp [ebx+46], dword 51 - jz .nodraw + cmp [ebx + process_information.box.height], dword 51 + jz .nodraw ;-------------------------------------- align 4 @@: - cmp [ebx+10], dword ' ' + cmp dword[ebx + process_information.process_name], ' ' ;-------------------------------------- align 4 .nodraw: - ret + ret ;------------------------------------------------------------------------------ align 4 calculate_applications: - mov eax,[max_applications] - mul [page_list] - test eax,eax - je @f + mov eax,[max_applications] + mul [page_list] + test eax,eax + je @f - inc eax + inc eax ;-------------------------------------- align 4 @@: - mov [draw_start_position],eax + mov [draw_start_position],eax - mov edi,app_list - mov ecx,20 ; show max 20 application ???!!! - mov eax,-1 - cld - rep stosd + mov edi,app_list + mov ecx,20 ; show max 20 application ???!!! + mov eax,-1 + cld + rep stosd - mov edi,0 - mov ecx,2 + mov edi,0 + mov ecx,2 ;-------------------------------------- align 4 cnewpr: - mcall 9,procinfo_window_tabs + mcall 9,procinfo_window_tabs - call need_window_tab - jz cnorpl + call need_window_tab + jz cnorpl - sub [draw_start_position], 1 - jg cnorpl + sub [draw_start_position], 1 + jg cnorpl - mov [app_list+edi*4],ecx - inc edi + mov [app_list+edi*4],ecx + inc edi ;-------------------------------------- align 4 cnorpl: - inc ecx - cmp eax,ecx - jge cnewpr + inc ecx + cmp eax,ecx + jge cnewpr - mov [app_tab_count], edi - ret + mov [app_tab_count], edi + ret ;------------------------------------------------------------------------------ align 4 redraw_window_tabs: - xor edi, edi - mov [contrast], 0 + xor edi, edi + mov [contrast], 0 - push ebp - mcall 18,7 - mov ebp,eax - - call calculate_offset_X + push ebp + mcall 18,7 + mov ebp,eax + + call calculate_offset_X ;-------------------------------------- align 4 .loop: - mov ecx,[app_list+edi*4] - cmp ecx,-1 - jz .done + mov ecx,[app_list+edi*4] + cmp ecx,-1 + jz .done - mov [active_slot_number],ecx - mcall 9,procinfo_window_tabs + mov [active_slot_number],ecx + mcall 9,procinfo_window_tabs - - imul ebx, edi, TAB_SIZE - add ebx,[offset_X] - add ebx,2 - shl ebx,16 - add ebx,TAB_SIZE-2 ;54 + + imul ebx, edi, TAB_SIZE + add ebx,[offset_X] + add ebx,2 + shl ebx,16 + add ebx,TAB_SIZE-2 ;54 - push edi - mov edx,[system_colours.work_button] - xor edi,edi + push edi + mov edx,[system_colours.work_button] + xor edi,edi - cmp ebp,[active_slot_number] ;ecx ; ecx=active slot number - jnz @f + cmp ebp,[active_slot_number] ;ecx ; ecx=active slot number + jnz @f - mov edx,[wcolor] - inc edi + mov edx,[wcolor] + inc edi ;-------------------------------------- align 4 @@: - mov esi,[current_alt_tab_app] - cmp esi,-1 - jz @f + mov esi,[current_alt_tab_app] + cmp esi,-1 + jz @f - cmp ecx,[alt_tab_list+esi*8] - jnz @f + cmp ecx,[alt_tab_list+esi*8] + jnz @f - mov edx,[AltTab_color] ;0xFF8000 ; current select for ALT+Tab + mov edx,[AltTab_color] ;0xFF8000 ; current select for ALT+Tab ;-------------------------------------- align 4 @@: - call calculate_button_y_coordinate_and_size + call calculate_button_y_coordinate_and_size - mov esi,[wcolor] - call draw_appl_button - pop edi + mov esi,[wcolor] + call draw_appl_button + pop edi ;------------------------------------------------------------------------------ - add ebx,4 shl 16 - mov bx,cx ;[height] - shr bx,1 - sub bx,4 - shr ecx,16 - add bx,cx - - mov edx, procinfo_window_tabs+10 - mcall 4,,[system_colours.work_button_text],,11 + add ebx,4 shl 16 + mov bx,cx ;[height] + shr bx,1 + sub bx,4 + shr ecx,16 + add bx,cx + + mov edx, procinfo_window_tabs.process_name + mcall 4,,[system_colours.work_button_text],, sizeof.process_information.process_name ;-------------------------------------- align 4 .nodraw: - inc edi - cmp edi, [max_applications] - jb .loop + inc edi + cmp edi, [max_applications] + jb .loop - mov ecx,[app_list+edi*4] - cmp ecx,-1 - jz .done + mov ecx,[app_list+edi*4] + cmp ecx,-1 + jz .done - xor eax,eax - cmp [page_list],eax - jne @f - - inc eax - cmp [page_list_enable],eax - je @f - - mov [page_list_enable],eax - mov [redraw_window_flag],eax + xor eax,eax + cmp [page_list],eax + jne @f + + inc eax + cmp [page_list_enable],eax + je @f + + mov [page_list_enable],eax + mov [redraw_window_flag],eax ;-------------------------------------- align 4 @@: - pop ebp - ret + pop ebp + ret ;-------------------------------------- align 4 .done: - xor eax,eax - cmp [page_list],eax - jne @f + xor eax,eax + cmp [page_list],eax + jne @f - cmp [page_list_enable],eax - je @f + cmp [page_list_enable],eax + je @f - mov [page_list_enable],eax - inc eax - mov [redraw_window_flag],eax + mov [page_list_enable],eax + inc eax + mov [redraw_window_flag],eax ;-------------------------------------- align 4 @@: - pop ebp - ret + pop ebp + ret ;------------------------------------------------------------------------------ diff --git a/programs/system/taskbar/trunk/drawwind.inc b/programs/system/taskbar/trunk/drawwind.inc index 97915ce0ab..38e185bd40 100644 --- a/programs/system/taskbar/trunk/drawwind.inc +++ b/programs/system/taskbar/trunk/drawwind.inc @@ -4,439 +4,439 @@ ; *************************************************** align 4 draw_window: - pusha - mov [running_applications],-1 - mcall 12,1 + pusha + mov [running_applications],-1 + mcall 12,1 - mcall 48,3,system_colours,10*4 + mcall 48,3,system_colours, sizeof.system_colors - mov eax, [system_colours+4*6] - mov edx,[system_colours+4*6] - mov eax,COLOR_CHANGE_MAGNITUDE - call subtract_color_change_magnitude - mov [wcolor], edx + mov eax, [system_colours.work_button] + mov edx,[system_colours.work_button] + mov eax,COLOR_CHANGE_MAGNITUDE + call subtract_color_change_magnitude + mov [wcolor], edx - mcall 14 ; get screen max x & max y + mcall 14 ; get screen max x & max y - cmp [width],dword 0 - je no_def_width + cmp [width],dword 0 + je no_def_width - and eax,0xffff - mov ebx,[width] - shl ebx,16 - add eax,ebx + and eax,0xffff + mov ebx,[width] + shl ebx,16 + add eax,ebx ;-------------------------------------- align 4 no_def_width: - mov ebx,eax - mov [screenxy],ebx - shr ebx,16 - mov ecx,eax + mov ebx,eax + mov [screenxy],ebx + shr ebx,16 + mov ecx,eax - cmp [place_attachment],1 - je @f - - xor ecx,ecx - mov cx,[height] - dec cx - jmp .attachment_selected + cmp [place_attachment],1 + je @f + + xor ecx,ecx + mov cx,[height] + dec cx + jmp .attachment_selected ;-------------------------------------- align 4 @@: - sub ecx,[height] - inc ecx - shl ecx,16 - mov cx,[height] - dec cx + sub ecx,[height] + inc ecx + shl ecx,16 + mov cx,[height] + dec cx ;-------------------------------------- align 4 .attachment_selected: - xor eax,eax ; DEFINE AND DRAW WINDOW - mov edx, [wcolor] - or edx, 0x01000000 ; do not draw the window - mov esi, [wcolor] - or esi, 0x01000000 ; unmovable window - mov edi, [wcolor] - mov [panel_x_pos], ebx - mov [panel_y_pos], ecx ; ╧юър ўЄю Єръ. - mcall + xor eax,eax ; DEFINE AND DRAW WINDOW + mov edx, [wcolor] + or edx, 0x01000000 ; do not draw the window + mov esi, [wcolor] + or esi, 0x01000000 ; unmovable window + mov edi, [wcolor] + mov [panel_x_pos], ebx + mov [panel_y_pos], ecx ; ╧юър ўЄю Єръ. + mcall - movzx eax,word [screenxy+2] - mov [max_x],eax - - call fill_window - call minimize_left_button - call minimize_right_button - call draw_menu_and_clean_desktop - mov [ptime],0 - call draw_tray - call draw_application_buttons + movzx eax,word [screenxy+2] + mov [max_x],eax + + call fill_window + call minimize_left_button + call minimize_right_button + call draw_menu_and_clean_desktop + mov [ptime],0 + call draw_tray + call draw_application_buttons - mov [redraw_window_flag],0 - mcall 12,2 - popa - ret + mov [redraw_window_flag],0 + mcall 12,2 + popa + ret ;------------------------------------------------------------------------------ align 4 -fill_window: - movzx ebx,word [screenxy+2] - xor ecx,ecx - mov edx,[wcolor] - mov eax,COLOR_CHANGE_MAGNITUDE_0 - imul eax,dword [soften_height] - call subtract_color_change_magnitude - cmp [soften_up],dword 0 - je no_su +fill_window: + movzx ebx,word [screenxy+2] + xor ecx,ecx + mov edx,[wcolor] + mov eax,COLOR_CHANGE_MAGNITUDE_0 + imul eax,dword [soften_height] + call subtract_color_change_magnitude + cmp [soften_up],dword 0 + je no_su ;-------------------------------------- align 4 @@: - mov eax,COLOR_CHANGE_MAGNITUDE_0 - call add_color_change_magnitude + mov eax,COLOR_CHANGE_MAGNITUDE_0 + call add_color_change_magnitude ; draw soften_up - the width of 5 pixels - and edx,0x00FFFFFF - mcall 38 + and edx,0x00FFFFFF + mcall 38 - add ecx,1*65536+1 - cmp cx,[soften_height] ;5 - jb @r + add ecx,1*65536+1 + cmp cx,[soften_height] ;5 + jb @r ;-------------------------------------- align 4 no_su: - cmp [soften_down],dword 0 - je no_sd + cmp [soften_down],dword 0 + je no_sd ; draw soften_down - the width of 5 pixels - pusha - mov esi,[soften_height] - mov ecx,[height] - dec ecx - shl ecx,16 - add ecx,[height] - dec ecx - mov edx,[wcolor] - mov eax,COLOR_CHANGE_MAGNITUDE_0 - imul eax,dword [soften_height] - call subtract_color_change_magnitude + pusha + mov esi,[soften_height] + mov ecx,[height] + dec ecx + shl ecx,16 + add ecx,[height] + dec ecx + mov edx,[wcolor] + mov eax,COLOR_CHANGE_MAGNITUDE_0 + imul eax,dword [soften_height] + call subtract_color_change_magnitude ;-------------------------------------- align 4 @@: - mov eax,COLOR_CHANGE_MAGNITUDE_0 - call add_color_change_magnitude - and edx,0x00FFFFFF - mcall 38 - sub ecx,1*65536+1 - dec esi - jnz @r - popa + mov eax,COLOR_CHANGE_MAGNITUDE_0 + call add_color_change_magnitude + and edx,0x00FFFFFF + mcall 38 + sub ecx,1*65536+1 + dec esi + jnz @r + popa ;-------------------------------------- align 4 no_sd: - movzx ebx,word [screenxy+2] - xor ecx,ecx - cmp [soften_up],dword 0 - je @f + movzx ebx,word [screenxy+2] + xor ecx,ecx + cmp [soften_up],dword 0 + je @f - add ecx,[soften_height] - rol ecx,16 - add ecx,[soften_height] + add ecx,[soften_height] + rol ecx,16 + add ecx,[soften_height] ;-------------------------------------- align 4 @@: - mov edx,[wcolor] + mov edx,[wcolor] ;-------------------------------------- align 4 newline3: - and edx,0x00FFFFFF - mov eax,[height] - cmp [soften_up],dword 0 - je @f + and edx,0x00FFFFFF + mov eax,[height] + cmp [soften_up],dword 0 + je @f - sub eax,[soften_height] + sub eax,[soften_height] ;-------------------------------------- align 4 @@: - cmp [soften_down],dword 0 - je @f + cmp [soften_down],dword 0 + je @f - sub eax,[soften_height] + sub eax,[soften_height] ;-------------------------------------- align 4 @@: - mov cx,ax - inc ebx - mcall 13 - ret + mov cx,ax + inc ebx + mcall 13 + ret ;------------------------------------------------------------------------------ align 4 minimize_left_button: - cmp [minimize_left],dword 0 - je .exit + cmp [minimize_left],dword 0 + je .exit - mov ecx,1 *65536 - add ecx,[height] - dec ecx - mov edx,101 - or edx,0x40000000 - mcall 8,<0,9>,,,[wcolor] ; ABS LEFT + mov ecx,1 *65536 + add ecx,[height] + dec ecx + mov edx,101 + or edx,0x40000000 + mcall 8,<0,9>,,,[wcolor] ; ABS LEFT - mov ebx,2*65536 ;+6 - mov bx,[height] - shr bx,1 - sub bx,3 - mov edx,[wcolor] - mov eax,COLOR_CHANGE_MAGNITUDE_2 - call add_color_change_magnitude - mov ecx,edx - mcall 4,,,hidetext,1 ; HIDE TEXT + mov ebx,2*65536 ;+6 + mov bx,[height] + shr bx,1 + sub bx,3 + mov edx,[wcolor] + mov eax,COLOR_CHANGE_MAGNITUDE_2 + call add_color_change_magnitude + mov ecx,edx + mcall 4,,,hidetext,1 ; HIDE TEXT ;-------------------------------------- align 4 .exit: - ret + ret ;------------------------------------------------------------------------------ -align 4 +align 4 minimize_right_button: - cmp [minimize_right],dword 0 - je .exit - mov eax,[max_x] - sub eax,77 - shl eax,16 - mov ebx,eax - add ebx,67 + cmp [minimize_right],dword 0 + je .exit + mov eax,[max_x] + sub eax,77 + shl eax,16 + mov ebx,eax + add ebx,67 - mov ecx,1 *65536 - add ecx,[height] - dec ecx - add ebx,68*65536 - mov bx,10 ;9 - mov edx,102 - or edx,0x40000000 - mcall 8,,,,[wcolor] ; ABS RIGHT + mov ecx,1 *65536 + add ecx,[height] + dec ecx + add ebx,68*65536 + mov bx,10 ;9 + mov edx,102 + or edx,0x40000000 + mcall 8,,,,[wcolor] ; ABS RIGHT - mov ebx,[max_x] - sub ebx,6 - shl ebx,16 - mov bx,[height] - shr bx,1 - sub bx,3 - mov edx,[wcolor] - mov eax,COLOR_CHANGE_MAGNITUDE_2 - call add_color_change_magnitude - mov ecx,edx - mov esi,1 - mcall 4,,,hidetext+1 + mov ebx,[max_x] + sub ebx,6 + shl ebx,16 + mov bx,[height] + shr bx,1 + sub bx,3 + mov edx,[wcolor] + mov eax,COLOR_CHANGE_MAGNITUDE_2 + call add_color_change_magnitude + mov ecx,edx + mov esi,1 + mcall 4,,,hidetext+1 ;-------------------------------------- align 4 .exit: - ret + ret ;------------------------------------------------------------------------------ align 4 draw_menu_and_clean_desktop: - pusha + pusha ; check draw for menu - cmp [menu_enable],dword 0 - je no_menu + cmp [menu_enable],dword 0 + je no_menu ; calculate and draw menu - mov ebx, (0 shl 16) + MENU_SIZE-3 + mov ebx, (0 shl 16) + MENU_SIZE-3 ; check for left minimize button enabled - cmp [minimize_left],dword 0 - je @f + cmp [minimize_left],dword 0 + je @f - add ebx, ML_SIZE shl 16 + add ebx, ML_SIZE shl 16 ;-------------------------------------- align 4 @@: mov ecx, [height] - mov edx, 0x60d1ff01 - mcall 8,,,,[wcolor] ; MENU BUTTON - - mov eax,ebx - shr eax,16 - mov [menu_button_x.start],eax - - mov eax,ebx - and eax,0xffff - mov [menu_button_x.size],eax - - mov eax,ecx - shr eax,16 - mov [menu_button_y.start],eax - - mov eax,ecx - and eax,0xffff - mov [menu_button_y.size],eax + mov edx, 0x60d1ff01 + mcall 8,,,,[wcolor] ; MENU BUTTON + + mov eax,ebx + shr eax,16 + mov [menu_button_x.start],eax + + mov eax,ebx + and eax,0xffff + mov [menu_button_x.size],eax + + mov eax,ecx + shr eax,16 + mov [menu_button_y.start],eax + + mov eax,ecx + and eax,0xffff + mov [menu_button_y.size],eax - call calculate_button_y_coordinate_and_size - mov edx,[MenuButton_color] ;0x44aa44 - mov esi,[wcolor] + call calculate_button_y_coordinate_and_size + mov edx,[MenuButton_color] ;0x44aa44 + mov esi,[wcolor] add ebx,3 shl 16 - 5 - call draw_appl_button + call draw_appl_button - add ebx, 4*65536 - mov bx,[height] - shr bx,1 - sub bx,7 - mov ecx,[PanelText_color] - or ecx,0x10000000 - if lang eq et - mcall 4,,,m_text,5 - else - mcall 4,,,m_text,4 - end if + add ebx, 4*65536 + mov bx,[height] + shr bx,1 + sub bx,7 + mov ecx,[PanelText_color] + or ecx,0x10000000 + if lang eq et + mcall 4,,,m_text,5 + else + mcall 4,,,m_text,4 + end if ;-------------------------------------- align 4 no_menu: ; check draw for clean desktop button - cmp [clean_desktop_enable],dword 0 - je .exit + cmp [clean_desktop_enable],dword 0 + je .exit ; calculate and draw clean desktop button - mov ebx, (0 shl 16) + CLD_SIZE-5 -; check for left minimize button enabled - cmp [minimize_left],dword 0 - je @f + mov ebx, (0 shl 16) + CLD_SIZE-5 +; check for left minimize button enabled + cmp [minimize_left],dword 0 + je @f - add ebx, ML_SIZE shl 16 + add ebx, ML_SIZE shl 16 ;-------------------------------------- align 4 @@: ; check for menu button enabled - cmp [menu_enable],dword 0 - je @f - - add ebx, MENU_SIZE shl 16 + cmp [menu_enable],dword 0 + je @f + + add ebx, MENU_SIZE shl 16 ;-------------------------------------- align 4 @@: ; Inserted code for drawing buttons 103, 104, 105 (Clean, Restore, Exchange windows) - mov esi, dword [system_colours+24] ; drawing buttons - and esi, 0x00ffffff - mov edx, 0x60000000 + 103 + mov esi, dword [system_colours.work_button] ; drawing buttons + and esi, 0x00ffffff + mov edx, 0x60000000 + 103 mov ecx, [height] - mcall 8 ;,,<3,13> - - call calculate_button_y_coordinate_and_size - mov edx,[CleanDesktopButton_color] ;time_bgr_color - mov esi,[wcolor] - call draw_appl_button + mcall 8 ;,,<3,13> + + call calculate_button_y_coordinate_and_size + mov edx,[CleanDesktopButton_color] ;time_bgr_color + mov esi,[wcolor] + call draw_appl_button - mov ecx,[PanelText_color] - add ebx,5 shl 16 - mov bx,[height] - shr bx,1 - sub bx,2 - mcall 4,,,page_clean_but,1 - sub bx,2 - mcall ,,,page_clean_but+1 + mov ecx,[PanelText_color] + add ebx,5 shl 16 + mov bx,[height] + shr bx,1 + sub bx,2 + mcall 4,,,page_clean_but,1 + sub bx,2 + mcall ,,,page_clean_but+1 ;-------------------------------------- align 4 .exit: - popa - ret + popa + ret ;------------------------------------------------------------------------------ align 4 draw_application_buttons: - pusha + pusha - cmp [run_appl],dword 0 ; do not draw application buttons - je .exit + cmp [run_appl],dword 0 ; do not draw application buttons + je .exit - call calculate_offset_X + call calculate_offset_X - mov eax,[screenxy] - shr eax,16 + mov eax,[screenxy] + shr eax,16 - sub eax,[offset_X] + sub eax,[offset_X] ; check for left minimize button enabled - cmp [minimize_right],dword 0 - je @f + cmp [minimize_right],dword 0 + je @f - sub eax, MR_SIZE + sub eax, MR_SIZE ;-------------------------------------- align 4 @@: - cmp [clock_enable],dword 0 - je @f - - sub eax,CLOCK_SIZE + cmp [clock_enable],dword 0 + je @f + + sub eax,CLOCK_SIZE ;-------------------------------------- -align 4 +align 4 @@: - cmp [cpu_usage_enable],dword 0 - je @f - - sub eax,CPU_USAGE_SIZE + cmp [cpu_usage_enable],dword 0 + je @f + + sub eax,CPU_USAGE_SIZE ;-------------------------------------- -align 4 +align 4 @@: - cmp [chlang_enable],dword 0 - je @f - - sub eax,CHLANG_SIZE + cmp [chlang_enable],dword 0 + je @f + + sub eax,CHLANG_SIZE ;-------------------------------------- -align 4 +align 4 @@: - cmp [page_list_enable],dword 0 - je @f - - sub eax,PAGE_LIST_SIZE + cmp [page_list_enable],dword 0 + je @f + + sub eax,PAGE_LIST_SIZE ;-------------------------------------- -align 4 +align 4 @@: - mov ebx, TAB_SIZE - xor edx,edx - div ebx - mov [max_applications], eax - xor edi,edi + mov ebx, TAB_SIZE + xor edx,edx + div ebx + mov [max_applications], eax + xor edi,edi ;-------------------------------------- align 4 .nb: - mov ebx,edi - imul ebx,TAB_SIZE - add ebx,[offset_X] - shl ebx,16 - mov bx, TAB_SIZE-1 - mov edx,edi - add edx,52 - or edx,0x60000000 - mov ecx, [height] - mcall 8,,,,[wcolor] + mov ebx,edi + imul ebx,TAB_SIZE + add ebx,[offset_X] + shl ebx,16 + mov bx, TAB_SIZE-1 + mov edx,edi + add edx,52 + or edx,0x60000000 + mov ecx, [height] + mcall 8,,,,[wcolor] - inc edi - cmp edi,[max_applications] - jb .nb + inc edi + cmp edi,[max_applications] + jb .nb ;-------------------------------------- align 4 .exit: - popa - ret + popa + ret ;------------------------------------------------------------------------------ align 4 calculate_offset_X: - push eax - xor eax,eax + push eax + xor eax,eax ; check for left minimize button enabled - cmp [minimize_left],dword 0 - je @f + cmp [minimize_left],dword 0 + je @f - add eax, ML_SIZE + add eax, ML_SIZE ;-------------------------------------- align 4 -@@: +@@: ; check for menu button enabled - cmp [menu_enable],dword 0 - je @f - - add eax, MENU_SIZE + cmp [menu_enable],dword 0 + je @f + + add eax, MENU_SIZE ;-------------------------------------- align 4 @@: ; check for clean desktop button enabled - cmp [clean_desktop_enable],dword 0 - je @f + cmp [clean_desktop_enable],dword 0 + je @f - add eax, CLD_SIZE + add eax, CLD_SIZE ;-------------------------------------- align 4 @@: - mov [offset_X],eax - pop eax - ret + mov [offset_X],eax + pop eax + ret ;------------------------------------------------------------------------------ diff --git a/programs/system/taskbar/trunk/u_data.inc b/programs/system/taskbar/trunk/u_data.inc index dad3b826fe..d1efce9df4 100644 --- a/programs/system/taskbar/trunk/u_data.inc +++ b/programs/system/taskbar/trunk/u_data.inc @@ -1,109 +1,106 @@ ;------------------------------------------------------------------------------ align 4 -last_active_window rd 1 -prev_active_window rd 1 -active_window_changed rd 1 -app_tab_count rd 1 +last_active_window rd 1 +prev_active_window rd 1 +active_window_changed rd 1 +app_tab_count rd 1 -alt_tab_list_size rd 1 +alt_tab_list_size rd 1 -panel_x_pos rd 1 -panel_y_pos rd 1 +panel_x_pos rd 1 +panel_y_pos rd 1 -offset_X rd 1 -offset_x_tray rd 1 +offset_X rd 1 +offset_x_tray rd 1 -pos_x_clock rd 1 -pos_x_cpu_usage rd 1 -pos_x_cpu_chlang rd 1 -pos_x_page_list rd 1 +pos_x_clock rd 1 +pos_x_cpu_usage rd 1 +pos_x_cpu_chlang rd 1 +pos_x_page_list rd 1 -active_slot_number rd 1 +active_slot_number rd 1 -my_active_slot rd 1 -current_active_slot rd 1 +my_active_slot rd 1 +current_active_slot rd 1 screen_size: -.height rw 1 -.width rw 1 +.height rw 1 +.width rw 1 -draw_flag_certainly rb 1 +draw_flag_certainly rb 1 -start_menu_flag rb 1 -win_key_flag rb 1 +start_menu_flag rb 1 +win_key_flag rb 1 ;------------------------------------------------------------------------------ align 4 -system_colours system_colors ; rd 10 +system_colours system_colors ;------------------------------------------------------------------------------ align 4 -app_list rd 50 +app_list rd 50 ;------------------------------------------------------------------------------ align 4 -alt_tab_list rd 256*2 +alt_tab_list rd 256*2 ;------------------------------------------------------------------------------ align 4 path: - rb 1024 + rb 1024 ;----------------------------------------------------------------------------- align 4 library_path: -process_info_buffer: - rb 1024 +process_info_buffer process_information ;------------------------------------------------------------------------------ align 4 -procinfo_for_detect: - rb 1024 +procinfo_for_detect process_information ;------------------------------------------------------------------------------ align 4 -procinfo_window_tabs: - rb 1024 +procinfo_window_tabs process_information ;----------------------------------------------------------------------------- align 4 bootparam: - rb 256 + rb 256 ;------------------------------------------------------------------------------ align 4 tictable: - rd 256 + rd 256 ;------------------------------------------------------------------------------ align 4 end_name: - rb 64 + rb 64 ;------------------------------------------------------------------------------ align 4 menu_name: - rb 64 + rb 64 ;------------------------------------------------------------------------------ align 4 run_name: - rb 64 + rb 64 ;------------------------------------------------------------------------------ align 4 printscreen_name: - rb 64 + rb 64 ;------------------------------------------------------------------------------ align 4 calendar_name: - rb 64 + rb 64 ;------------------------------------------------------------------------------ align 4 sysmeter_name: - rb 64 + rb 64 ;------------------------------------------------------------------------------ align 4 mousemul_name: - rb 64 + rb 64 ;------------------------------------------------------------------------------ align 4 - rb 256 + rb 256 detect_stack: ;------------------------------------------------------------------------------ align 4 - rb 256 + rb 256 ctx_menu_stack: ;------------------------------------------------------------------------------ align 4 - rb 1024 + rb 1024 stack_top: ;------------------------------------------------------------------------------ diff --git a/programs/system/zkey/trunk/ZKEY.ASM b/programs/system/zkey/trunk/ZKEY.ASM index 513905ae50..4599fd79fa 100644 --- a/programs/system/zkey/trunk/ZKEY.ASM +++ b/programs/system/zkey/trunk/ZKEY.ASM @@ -9,15 +9,18 @@ ; use32 - org 0x0 + org 0x0 - db 'MENUET00' ; 8 byte id - dd 38 ; required os - dd STARTAPP ; program start - dd I_END ; program image size - dd 0x100000 ; required amount of memory - dd 0x00000000 ; reserved=no extended header + db 'MENUET01' + dd 1 ; version + dd STARTAPP ; program start + dd I_END ; program image size + dd MEM ; size memory for program + dd STACKTOP ; base stack pointer + dd 0 + dd 0 +include '../../../macros.inc' include "ASPAPI.INC" N_KEYCOLOR equ 0x00677889 ; Normal button color @@ -26,30 +29,28 @@ L_KEYCOLOR equ 0x00258778 ; Lock button color TEXTCOLOR equ 0x00FFFFFF ; Button caption color ASCII_KEYMAP_SIZE equ 128 -PROCINFO_SIZE equ 1024 -PROCINFO_BUFF equ ascii_keymap + ASCII_KEYMAP_SIZE STARTAPP: - mov ecx, 1 ; to send scancodes. - call set_keyboard_mode + mov ecx, 1 ; to send scancodes. + call set_keyboard_mode - call reload_ascii_keymap - call draw_window - jmp get_zkey_window_slot_number + call reload_ascii_keymap + call draw_window + jmp get_zkey_window_slot_number draw_window: - test byte [red_type], 1 - jnz @f - test byte [red_type], 2 - jnz .draw_switch_button + test byte [red_type], 1 + jnz @f + test byte [red_type], 2 + jnz .draw_switch_button start_draw_window 100,370,600,210,0x14224466,labelt - stdcall draw_button, 15,50,23,20,2,N_KEYCOLOR,keyText,3,TEXTCOLOR ; Esc + stdcall draw_button, 15,50,23,20,2,N_KEYCOLOR,keyText,3,TEXTCOLOR ; Esc - stdcall draw_button, 70,50,23,20,3,N_KEYCOLOR,keyText+3,2,TEXTCOLOR ; F1 - stdcall draw_button, 95,50,23,20,4,N_KEYCOLOR,keyText+5,2,TEXTCOLOR ; F2 - stdcall draw_button, 120,50,23,20,5,N_KEYCOLOR,keyText+7,2,TEXTCOLOR ; F3 - stdcall draw_button, 145,50,23,20,6,N_KEYCOLOR,keyText+9,2,TEXTCOLOR ; F4 + stdcall draw_button, 70,50,23,20,3,N_KEYCOLOR,keyText+3,2,TEXTCOLOR ; F1 + stdcall draw_button, 95,50,23,20,4,N_KEYCOLOR,keyText+5,2,TEXTCOLOR ; F2 + stdcall draw_button, 120,50,23,20,5,N_KEYCOLOR,keyText+7,2,TEXTCOLOR ; F3 + stdcall draw_button, 145,50,23,20,6,N_KEYCOLOR,keyText+9,2,TEXTCOLOR ; F4 stdcall draw_button, 183,50,23,20,7,N_KEYCOLOR,keyText+11,2,TEXTCOLOR ; F5 stdcall draw_button, 208,50,23,20,8,N_KEYCOLOR,keyText+13,2,TEXTCOLOR ; F6 @@ -77,7 +78,7 @@ draw_window: stdcall draw_button, 340,80,23,20,28,N_KEYCOLOR,ascii_keymap+43,1,TEXTCOLOR ;keyText+56,2,TEXTCOLOR ; \| stdcall draw_button, 365,80,30,20,29,N_KEYCOLOR,keyText+58,4,TEXTCOLOR ; bksp - stdcall draw_button, 15 ,103,33,20,30,N_KEYCOLOR,keyText+62,3,TEXTCOLOR ; Tab + stdcall draw_button, 15 ,103,33,20,30,N_KEYCOLOR,keyText+62,3,TEXTCOLOR ; Tab stdcall draw_button, 50 ,103,23,20,31,N_KEYCOLOR,ascii_keymap+16,1,TEXTCOLOR ;keyText+65,2,TEXTCOLOR ; QЙ stdcall draw_button, 75 ,103,23,20,32,N_KEYCOLOR,ascii_keymap+17,1,TEXTCOLOR ;keyText+67,2,TEXTCOLOR ; WЦ stdcall draw_button, 100,103,23,20,33,N_KEYCOLOR,ascii_keymap+18,1,TEXTCOLOR ;keyText+69,2,TEXTCOLOR ; EУ @@ -90,9 +91,9 @@ draw_window: stdcall draw_button, 275,103,23,20,40,N_KEYCOLOR,ascii_keymap+25,1,TEXTCOLOR ;keyText+83,2,TEXTCOLOR ; PЗ stdcall draw_button, 300,103,23,20,41,N_KEYCOLOR,ascii_keymap+26,1,TEXTCOLOR ;keyText+85,3,TEXTCOLOR ; [{Х stdcall draw_button, 325,103,23,20,42,N_KEYCOLOR,ascii_keymap+27,1,TEXTCOLOR ;keyText+88,3,TEXTCOLOR ; ]}Ъ - stdcall draw_button, 350,103,45,43,43,N_KEYCOLOR,keyText+91,5,TEXTCOLOR ; Enter + stdcall draw_button, 350,103,45,43,43,N_KEYCOLOR,keyText+91,5,TEXTCOLOR ; Enter - stdcall draw_button, 15 ,126,43,20,44,L_KEYCOLOR,keyText+96 ,4,TEXTCOLOR ; lock + stdcall draw_button, 15 ,126,43,20,44,L_KEYCOLOR,keyText+96 ,4,TEXTCOLOR ; lock stdcall draw_button, 60 ,126,23,20,45,N_KEYCOLOR,ascii_keymap+30,1,TEXTCOLOR ;keyText+100,2,TEXTCOLOR ; AФ stdcall draw_button, 85 ,126,23,20,46,N_KEYCOLOR,ascii_keymap+31,1,TEXTCOLOR ;keyText+102,2,TEXTCOLOR ; SЫ stdcall draw_button, 110,126,23,20,47,N_KEYCOLOR,ascii_keymap+32,1,TEXTCOLOR ;keyText+104,2,TEXTCOLOR ; DВ @@ -105,7 +106,7 @@ draw_window: stdcall draw_button, 285,126,23,20,54,N_KEYCOLOR,ascii_keymap+39,1,TEXTCOLOR ;keyText+118,3,TEXTCOLOR ; ;:Ж stdcall draw_button, 310,126,23,20,55,N_KEYCOLOR,ascii_keymap+40,1,TEXTCOLOR ;keyText+121,3,TEXTCOLOR ; '"Э - stdcall draw_button, 15 ,149,53,20,56,C_KEYCOLOR,keyText+124,5,TEXTCOLOR ; Shift + stdcall draw_button, 15 ,149,53,20,56,C_KEYCOLOR,keyText+124,5,TEXTCOLOR ; Shift stdcall draw_button, 70 ,149,23,20,57,N_KEYCOLOR,ascii_keymap+44,1,TEXTCOLOR ;keyText+129,2,TEXTCOLOR ; ZЯ stdcall draw_button, 95 ,149,23,20,58,N_KEYCOLOR,ascii_keymap+45,1,TEXTCOLOR ;keyText+131,2,TEXTCOLOR ; XЧ stdcall draw_button, 120,149,23,20,59,N_KEYCOLOR,ascii_keymap+46,1,TEXTCOLOR ;keyText+133,2,TEXTCOLOR ; CС @@ -117,61 +118,61 @@ draw_window: stdcall draw_button, 270,149,23,20,65,N_KEYCOLOR,ascii_keymap+52,1,TEXTCOLOR ;keyText+146,3,TEXTCOLOR ; .>Ю stdcall draw_button, 295,149,23,20,66,N_KEYCOLOR,ascii_keymap+53,1,TEXTCOLOR ;keyText+149,2,TEXTCOLOR ; /? - test byte [red_type], 1 - jnz @f - stdcall draw_button, 320,149,75,20,67,C_KEYCOLOR,keyText+151,5,TEXTCOLOR ; Shift + test byte [red_type], 1 + jnz @f + stdcall draw_button, 320,149,75,20,67,C_KEYCOLOR,keyText+151,5,TEXTCOLOR ; Shift - stdcall draw_button, 15 ,172,30,20,68,C_KEYCOLOR,keyText+156,4,TEXTCOLOR ; Ctrl - stdcall draw_button, 47 ,172,30,20,69,C_KEYCOLOR,keyText+160,3,TEXTCOLOR ; Win - stdcall draw_button, 79 ,172,30,20,70,C_KEYCOLOR,keyText+163,3,TEXTCOLOR ; Alt - stdcall draw_button, 111,172,156,20,71,N_KEYCOLOR,keyText+166,1,TEXTCOLOR ; Space - stdcall draw_button, 269,172,30,20,72,C_KEYCOLOR,keyText+167,3,TEXTCOLOR ; Alt - stdcall draw_button, 301,172,30,20,73,C_KEYCOLOR,keyText+170,3,TEXTCOLOR ; Win - stdcall draw_button, 333,172,30,20,74,C_KEYCOLOR,keyText+173,3,TEXTCOLOR ; [=] - stdcall draw_button, 365,172,30,20,75,C_KEYCOLOR,keyText+176,4,TEXTCOLOR ; Ctrl + stdcall draw_button, 15 ,172,30,20,68,C_KEYCOLOR,keyText+156,4,TEXTCOLOR ; Ctrl + stdcall draw_button, 47 ,172,30,20,69,C_KEYCOLOR,keyText+160,3,TEXTCOLOR ; Win + stdcall draw_button, 79 ,172,30,20,70,C_KEYCOLOR,keyText+163,3,TEXTCOLOR ; Alt + stdcall draw_button, 111,172,156,20,71,N_KEYCOLOR,keyText+166,1,TEXTCOLOR ; Space + stdcall draw_button, 269,172,30,20,72,C_KEYCOLOR,keyText+167,3,TEXTCOLOR ; Alt + stdcall draw_button, 301,172,30,20,73,C_KEYCOLOR,keyText+170,3,TEXTCOLOR ; Win + stdcall draw_button, 333,172,30,20,74,C_KEYCOLOR,keyText+173,3,TEXTCOLOR ; [=] + stdcall draw_button, 365,172,30,20,75,C_KEYCOLOR,keyText+176,4,TEXTCOLOR ; Ctrl - stdcall draw_button, 405,50 ,23,20,76,N_KEYCOLOR,keyText+180,3,TEXTCOLOR ; psc - stdcall draw_button, 430,50 ,23,20,77,L_KEYCOLOR,keyText+183,3,TEXTCOLOR ; slk - stdcall draw_button, 455,50 ,23,20,78,N_KEYCOLOR,keyText+186,3,TEXTCOLOR ; brk - stdcall draw_button, 405,80 ,23,20,79,N_KEYCOLOR,keyText+189,3,TEXTCOLOR ; Ins - stdcall draw_button, 430,80 ,23,20,80,N_KEYCOLOR,keyText+192,2,TEXTCOLOR ; Hm - stdcall draw_button, 455,80 ,23,20,81,N_KEYCOLOR,keyText+194,3,TEXTCOLOR ; Pup - stdcall draw_button, 405,103 ,23,20,82,N_KEYCOLOR,keyText+197,3,TEXTCOLOR ; Del - stdcall draw_button, 430,103 ,23,20,83,N_KEYCOLOR,keyText+200,3,TEXTCOLOR ; End - stdcall draw_button, 455,103 ,23,20,84,N_KEYCOLOR,keyText+203,3,TEXTCOLOR ; Pdn - stdcall draw_button, 430,149,23,20,85,C_KEYCOLOR,keyText+206,1,TEXTCOLOR ; ^ - stdcall draw_button, 405,172,23,20,86,C_KEYCOLOR,keyText+207,1,TEXTCOLOR ; v - stdcall draw_button, 430,172,23,20,87,C_KEYCOLOR,keyText+208,1,TEXTCOLOR ; < - stdcall draw_button, 455,172,23,20,88,C_KEYCOLOR,keyText+209,2,TEXTCOLOR ; > + stdcall draw_button, 405,50 ,23,20,76,N_KEYCOLOR,keyText+180,3,TEXTCOLOR ; psc + stdcall draw_button, 430,50 ,23,20,77,L_KEYCOLOR,keyText+183,3,TEXTCOLOR ; slk + stdcall draw_button, 455,50 ,23,20,78,N_KEYCOLOR,keyText+186,3,TEXTCOLOR ; brk + stdcall draw_button, 405,80 ,23,20,79,N_KEYCOLOR,keyText+189,3,TEXTCOLOR ; Ins + stdcall draw_button, 430,80 ,23,20,80,N_KEYCOLOR,keyText+192,2,TEXTCOLOR ; Hm + stdcall draw_button, 455,80 ,23,20,81,N_KEYCOLOR,keyText+194,3,TEXTCOLOR ; Pup + stdcall draw_button, 405,103 ,23,20,82,N_KEYCOLOR,keyText+197,3,TEXTCOLOR ; Del + stdcall draw_button, 430,103 ,23,20,83,N_KEYCOLOR,keyText+200,3,TEXTCOLOR ; End + stdcall draw_button, 455,103 ,23,20,84,N_KEYCOLOR,keyText+203,3,TEXTCOLOR ; Pdn + stdcall draw_button, 430,149,23,20,85,C_KEYCOLOR,keyText+206,1,TEXTCOLOR ; ^ + stdcall draw_button, 405,172,23,20,86,C_KEYCOLOR,keyText+207,1,TEXTCOLOR ; v + stdcall draw_button, 430,172,23,20,87,C_KEYCOLOR,keyText+208,1,TEXTCOLOR ; < + stdcall draw_button, 455,172,23,20,88,C_KEYCOLOR,keyText+209,2,TEXTCOLOR ; > - stdcall draw_button, 488,80 ,23,20,89,L_KEYCOLOR,keyText+211,3,TEXTCOLOR ; nlk - stdcall draw_button, 513,80 ,23,20,90,N_KEYCOLOR,keyText+214,1,TEXTCOLOR ; / - stdcall draw_button, 538,80 ,23,20,91,N_KEYCOLOR,keyText+215,1,TEXTCOLOR ; * - stdcall draw_button, 563,80 ,23,20,92,N_KEYCOLOR,keyText+216,1,TEXTCOLOR ; - - stdcall draw_button, 488,103 ,23,20,93,N_KEYCOLOR,keyText+217,1,TEXTCOLOR ; 7 - stdcall draw_button, 513,103 ,23,20,94,N_KEYCOLOR,keyText+218,1,TEXTCOLOR ; 8 - stdcall draw_button, 538,103 ,23,20,95,N_KEYCOLOR,keyText+219,1,TEXTCOLOR ; 9 - stdcall draw_button, 488,126,23,20,96,N_KEYCOLOR,keyText+220,1,TEXTCOLOR ; 4 - stdcall draw_button, 513,126,23,20,97,N_KEYCOLOR,keyText+221,1,TEXTCOLOR ; 5 - stdcall draw_button, 538,126,23,20,98,N_KEYCOLOR,keyText+222,1,TEXTCOLOR ; 6 - stdcall draw_button, 488,149,23,20,99,N_KEYCOLOR,keyText+223,1,TEXTCOLOR ; 1 - stdcall draw_button, 513,149,23,20,100,N_KEYCOLOR,keyText+224,1,TEXTCOLOR ; 2 - stdcall draw_button, 538,149,23,20,101,N_KEYCOLOR,keyText+225,1,TEXTCOLOR ; 3 - stdcall draw_button, 488,172,48,20,102,N_KEYCOLOR,keyText+226,1,TEXTCOLOR ; 0 - stdcall draw_button, 538,172,23,20,103,N_KEYCOLOR,keyText+227,1,TEXTCOLOR ; . - stdcall draw_button, 563,103 ,23,43,104,N_KEYCOLOR,keyText+228,1,TEXTCOLOR ; + - stdcall draw_button, 563,149,23,43,105,N_KEYCOLOR,keyText+229,3,TEXTCOLOR ; Ent + stdcall draw_button, 488,80 ,23,20,89,L_KEYCOLOR,keyText+211,3,TEXTCOLOR ; nlk + stdcall draw_button, 513,80 ,23,20,90,N_KEYCOLOR,keyText+214,1,TEXTCOLOR ; / + stdcall draw_button, 538,80 ,23,20,91,N_KEYCOLOR,keyText+215,1,TEXTCOLOR ; * + stdcall draw_button, 563,80 ,23,20,92,N_KEYCOLOR,keyText+216,1,TEXTCOLOR ; - + stdcall draw_button, 488,103 ,23,20,93,N_KEYCOLOR,keyText+217,1,TEXTCOLOR ; 7 + stdcall draw_button, 513,103 ,23,20,94,N_KEYCOLOR,keyText+218,1,TEXTCOLOR ; 8 + stdcall draw_button, 538,103 ,23,20,95,N_KEYCOLOR,keyText+219,1,TEXTCOLOR ; 9 + stdcall draw_button, 488,126,23,20,96,N_KEYCOLOR,keyText+220,1,TEXTCOLOR ; 4 + stdcall draw_button, 513,126,23,20,97,N_KEYCOLOR,keyText+221,1,TEXTCOLOR ; 5 + stdcall draw_button, 538,126,23,20,98,N_KEYCOLOR,keyText+222,1,TEXTCOLOR ; 6 + stdcall draw_button, 488,149,23,20,99,N_KEYCOLOR,keyText+223,1,TEXTCOLOR ; 1 + stdcall draw_button, 513,149,23,20,100,N_KEYCOLOR,keyText+224,1,TEXTCOLOR ; 2 + stdcall draw_button, 538,149,23,20,101,N_KEYCOLOR,keyText+225,1,TEXTCOLOR ; 3 + stdcall draw_button, 488,172,48,20,102,N_KEYCOLOR,keyText+226,1,TEXTCOLOR ; 0 + stdcall draw_button, 538,172,23,20,103,N_KEYCOLOR,keyText+227,1,TEXTCOLOR ; . + stdcall draw_button, 563,103 ,23,43,104,N_KEYCOLOR,keyText+228,1,TEXTCOLOR ; + + stdcall draw_button, 563,149,23,43,105,N_KEYCOLOR,keyText+229,3,TEXTCOLOR ; Ent .draw_switch_button: - mov eax, 6 - mul byte [keyboard_mode] - add eax, SwitchText - stdcall draw_button, 513,28,46,20,106,0x00700000,eax,6,TEXTCOLOR ; Scan/ASCII switch + mov eax, 6 + mul byte [keyboard_mode] + add eax, SwitchText + stdcall draw_button, 513,28,46,20,106,0x00700000,eax,6,TEXTCOLOR ; Scan/ASCII switch - xor al, al - xchg al, [red_type] - test al, 2 - jnz .skip_end_draw_window ; if we draw switch button without redraw window then end_draw_window not need + xor al, al + xchg al, [red_type] + test al, 2 + jnz .skip_end_draw_window ; if we draw switch button without redraw window then end_draw_window not need @@: .draw_indicators_area: @@ -183,124 +184,125 @@ draw_window: ret get_zkey_window_slot_number: - mov eax, 18 - mov ebx, 7 - int 0x40 - mov [zkey_window], eax + mov eax, 18 + mov ebx, 7 + int 0x40 + mov [zkey_window], eax set_event_mask: - mov eax, 40 - mov ebx, 39 - int 0x40 + mov eax, 40 + mov ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE ; 39 ; 100111b + int 0x40 still: - call get_receiver_window_slot_number - call get_receiver_window_keyboard_mode ; return in ecx keyboard_mode for set_keyboard_mode - call set_keyboard_mode + call get_receiver_window_slot_number + call get_receiver_window_keyboard_mode ; return in ecx keyboard_mode for set_keyboard_mode + call set_keyboard_mode ; delete_switch_button - mov eax, 8 - mov edx, 0x80700000 - int 0x40 - mov byte [red_type], 2 - call draw_window.draw_switch_button + mov eax, 8 + mov edx, BT_DEL + 0x00700000 + int 0x40 + + mov byte [red_type], 2 + call draw_window.draw_switch_button - mov eax, 10 ; Wait for an event in the queue. - int 0x40 + mov eax, 10 ; Wait for an event in the queue. + int 0x40 - cmp al,1 ; redraw request ? - jz red - cmp al,2 ; key in buffer ? - jz key - cmp al,3 ; button in buffer ? - jz button + cmp al, EV_REDRAW ; redraw request ? + jz red + cmp al, EV_KEY ; key in buffer ? + jz key + cmp al, EV_BUTTON ; button in buffer ? + jz button - jmp still + jmp still red: - call draw_window - jmp still + call draw_window + jmp still key: - mov eax, 2 - int 0x40 + mov eax, 2 + int 0x40 ; push ax - call get_control_keys_state - cmp [locks], ax - je @f + call get_control_keys_state + cmp [locks], ax + je @f .reload: - call reload_ascii_keymap - mov byte [red_type], 1 - call draw_window + call reload_ascii_keymap + mov byte [red_type], 1 + call draw_window @@: ; pop dx ; jmp button.select_key_code - jmp still + jmp still button: - mov eax, 17 ; Get pressed button code - int 0x40 - cmp ah, 1 ; Test x button - je close_app + mov eax, 17 ; Get pressed button code + int 0x40 + cmp ah, 1 ; Test x button + je close_app - cmp ah, 106 ; Test Scan/ASCII switch button - jne .keyboard_keys - mov cl, 1 - sub cl, byte [keyboard_mode] - call set_keyboard_mode - mov byte [red_type], 2 - jmp red + cmp ah, 106 ; Test Scan/ASCII switch button + jne .keyboard_keys + mov cl, 1 + sub cl, byte [keyboard_mode] + call set_keyboard_mode + mov byte [red_type], 2 + jmp red .keyboard_keys: - cmp ah, 2 ; Test if pressed buttons - jb still ; is a ZKEY keyboard key... - cmp ah, 106 - jnb still ; ...so, if not then still, - mov [butt], ah ; if yes then save pressed button ID + cmp ah, 2 ; Test if pressed buttons + jb still ; is a ZKEY keyboard key... + cmp ah, 106 + jnb still ; ...so, if not then still, + mov [butt], ah ; if yes then save pressed button ID .test_slot: - mov eax, [zkey_window] ; Test is receiver ZKEY window - mov ecx, [receiver_window] - cmp eax, ecx - je still ; if yes still. + mov eax, [zkey_window] ; Test is receiver ZKEY window + mov ecx, [receiver_window] + cmp eax, ecx + je still ; if yes still. .activate_receiver_window: - mov eax, 18 - mov ebx, 3 - int 0x40 + mov eax, 18 + mov ebx, 3 + int 0x40 call reload_ascii_keymap .read_key_scancode: - xor edx, edx - movzx si, byte [butt] ; Read scan code of the key from the table. - sub si, 2 - mov dl, [keyCodes+si] ; Set dl = scancode of the key corresponding to the pressed button. - cmp dl, 0xA0 - jb .select_key_code ; If not extended key then select ascii or scan to send and then send it to the receiver. + xor edx, edx + movzx si, byte [butt] ; Read scan code of the key from the table. + sub si, 2 + mov dl, [keyCodes+si] ; Set dl = scancode of the key corresponding to the pressed button. + cmp dl, 0xA0 + jb .select_key_code ; If not extended key then select ascii or scan to send and then send it to the receiver. - cmp dl, 0xA6 ; Test if it's extended2 key - jne .read_ext_key ; if not go to prepare to send simply extended key. - mov dl, 0xE1 ; Send extended2 scancode... - call send_key - mov dl, 0x1D ; ...and extended scancode, - call send_key ; - mov dl, [keyCodes.ext2] ; (There is only one ext2 key - 'Break') - jmp .send_key_code ; so... send it's normal scan code. + cmp dl, 0xA6 ; Test if it's extended2 key + jne .read_ext_key ; if not go to prepare to send simply extended key. + mov dl, 0xE1 ; Send extended2 scancode... + call send_key + mov dl, 0x1D ; ...and extended scancode, + call send_key ; + mov dl, [keyCodes.ext2] ; (There is only one ext2 key - 'Break') + jmp .send_key_code ; so... send it's normal scan code. .read_ext_key: - sub dl, 0xA0 ; Read extended key scan code from the table. - movzx si, dl - mov dl, [keyCodes.ext+si] + sub dl, 0xA0 ; Read extended key scan code from the table. + movzx si, dl + mov dl, [keyCodes.ext+si] .send_ext: - push dx ; Send extended scancode to the receiver's window. - mov dl, 0xE0 - call send_key - pop dx + push dx ; Send extended scancode to the receiver's window. + mov dl, 0xE0 + call send_key + pop dx ; jmp .send_key_code - .select_key_code: ; Select what to send ASCII or scan. - cmp [keyboard_mode], 0 ; Test if ZKEY must send ASCII. - jne .send_key_code + .select_key_code: ; Select what to send ASCII or scan. + cmp [keyboard_mode], 0 ; Test if ZKEY must send ASCII. + jne .send_key_code ; mov esi, ext0 ; Set esi to the beginning of the ext0 table. - and edx, 0x7F + and edx, 0x7F ; @@: ; cmp dl, byte [esi] ; je .send_key_code @@ -308,24 +310,24 @@ button: ; cmp esi, ext0end ; jng @b .read_ascii: - mov dl, byte [ascii_keymap+edx] ; Read ASCII from the keymap table. + mov dl, byte [ascii_keymap+edx] ; Read ASCII from the keymap table. .send_key_code: - call send_key ; Finally send the key to the receiver's window. + call send_key ; Finally send the key to the receiver's window. .wait: - mov eax, 5 - mov ebx, 1 ; Wait 0.01 second. - int 0x40 + mov eax, 5 + mov ebx, 1 ; Wait 0.01 second. + int 0x40 .activate_zkey_window: - mov eax, 18 - mov ebx, 3 - mov ecx, [zkey_window] - int 0x40 + mov eax, 18 + mov ebx, 3 + mov ecx, [zkey_window] + int 0x40 - jmp still + jmp still close_app: - mov eax,-1 ; close this program + mov eax,-1 ; close this program int 0x40 @@ -334,16 +336,16 @@ close_app: ;********************************** set_keyboard_mode: - mov eax, 66 - mov ebx, 1 ; Set keyboard mode - int 0x40 - mov [keyboard_mode], cl + mov eax, 66 + mov ebx, 1 ; Set keyboard mode + int 0x40 + mov [keyboard_mode], cl ret get_control_keys_state: ; This routine works only in Scan keyboard mode. - mov eax, 66 - mov ebx, 3 - int 0x40 + mov eax, 66 + mov ebx, 3 + int 0x40 ret @@ -352,65 +354,65 @@ ret ;********************************** get_keyboard_map: - mov eax, 26 - mov ebx, 2 - mov edx, ascii_keymap - int 0x40 + mov eax, 26 + mov ebx, 2 + mov edx, ascii_keymap + int 0x40 ret reload_ascii_keymap: - call get_control_keys_state - mov ecx, 1 + call get_control_keys_state + mov ecx, 1 - test ax, 3 ; Shift pressed ? - jnz @f - test ax, 0x40 ; Caps Lock on ? - jz .load_ascii_keymap + test ax, 3 ; Shift pressed ? + jnz @f + test ax, 0x40 ; Caps Lock on ? + jz .load_ascii_keymap @@: - mov ecx, 2 + mov ecx, 2 .load_ascii_keymap: - call get_keyboard_map + call get_keyboard_map ret get_receiver_window_slot_number: - mov eax, 18 - mov ebx, 7 - int 0x40 - mov ebx, [zkey_window] - cmp eax, ebx - je @f - mov [receiver_window], eax + mov eax, 18 + mov ebx, 7 + int 0x40 + mov ebx, [zkey_window] + cmp eax, ebx + je @f + mov [receiver_window], eax @@: ret get_receiver_window_keyboard_mode: - mov eax, 9 - mov ebx, PROCINFO_BUFF - mov ecx, [receiver_window] - int 0x40 - movzx ecx, byte [ebx + 75] - ret + mov eax, 9 + mov ebx, PROCINFO_BUFF + mov ecx, [receiver_window] + int 0x40 + movzx ecx, byte [ebx + process_information.keyboard_mode] + ret ;************************************ ;* input: edx = code of the key * ;************************************ send_key: - mov eax, 72 - mov ebx, 1 - mov ecx, 2 - int 0x40 + mov eax, 72 + mov ebx, 1 + mov ecx, 2 + int 0x40 ret lights_on: - bar 491,51,95,15,0 ; indicators area + bar 491,51,95,15,0 ; indicators area rectangle 490,50,96,16,TEXTCOLOR call get_control_keys_state - mov [locks], ax + mov [locks], ax test ax, 0x40 jz @f ;stdcall bar, 532, 53, 10, 11, 0x0000FF00 @@ -437,29 +439,29 @@ SwitchText db ' ASCII SCAN ' ;Button names keyText db 'EscF1F2F3F4F5F6F7F8F9F10F11F12' - db '~Ё1!2@3#4$5%6^7&8*9(0)-_=+\|bksp' - db 'TabQЙWЦEУRКTЕYНUГIШOЩPЗ{[Х}]ЪEnter' - db 'lockAФSЫDВFАGПHРJОKЛLД;:Ж''"Э' - db 'ShiftZЯXЧCСVМBИNТMЬ,<Б.>Ю/?Shift' - db 'CtrlWinAlt AltWin[=]Ctrl' - db 'pscslkbrkInsHmPupDelEndPdn^' - db 'nlk/*-7894561230.+Ent' + db '~Ё1!2@3#4$5%6^7&8*9(0)-_=+\|bksp' + db 'TabQЙWЦEУRКTЕYНUГIШOЩPЗ{[Х}]ЪEnter' + db 'lockAФSЫDВFАGПHРJОKЛLД;:Ж''"Э' + db 'ShiftZЯXЧCСVМBИNТMЬ,<Б.>Ю/?Shift' + db 'CtrlWinAlt AltWin[=]Ctrl' + db 'pscslkbrkInsHmPupDelEndPdn^' + db 'nlk/*-7894561230.+Ent' ;Key scan codes keyCodes: - db 0x01, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x57, 0x58 - db 0x29, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x2B, 0x0E - db 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C - db 0x3A, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28 - db 0x2A, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36 - db 0x1D, 0xA0, 0x38, 0x39, 0xA1, 0xA2, 0xA3, 0xA4 - db 0xA5, 0x46, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0 - db 0x45, 0xB1, 0x37, 0x4A, 0x47, 0x48, 0x49, 0x4B, 0x4C, 0x4D, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x4E, 0xB2 + db 0x01, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x57, 0x58 + db 0x29, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x2B, 0x0E + db 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C + db 0x3A, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28 + db 0x2A, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36 + db 0x1D, 0xA0, 0x38, 0x39, 0xA1, 0xA2, 0xA3, 0xA4 + db 0xA5, 0x46, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0 + db 0x45, 0xB1, 0x37, 0x4A, 0x47, 0x48, 0x49, 0x4B, 0x4C, 0x4D, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x4E, 0xB2 .ext: - db 0x5B, 0x38, 0x5C, 0x5D, 0x1D - db 0x37, 0x00, 0x52, 0x47, 0x49, 0x53, 0x4F, 0x51, 0x48, 0x4B, 0x50, 0x4D - db 0x35, 0x1C - .ext2 db 0x45 ; Just Break :) + db 0x5B, 0x38, 0x5C, 0x5D, 0x1D + db 0x37, 0x00, 0x52, 0x47, 0x49, 0x53, 0x4F, 0x51, 0x48, 0x4B, 0x50, 0x4D + db 0x35, 0x1C + .ext2 db 0x45 ; Just Break :) ;ext0: ; db 0x1D, 0x29, 0x2A, 0x36, 0x37, 0x38, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40 @@ -467,14 +469,21 @@ keyCodes: ; db 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x57, 0x58 ;ext0end: -receiver_window dd 0 ; Slot number of the receiver -zkey_window dd 0 ; Slot number of ZKEY -butt db 0 ; Pressed button ID -locks dw 0 ; NumLock, CapsLock, ScrollLock lights mask +receiver_window dd 0 ; Slot number of the receiver +zkey_window dd 0 ; Slot number of ZKEY +butt db 0 ; Pressed button ID +locks dw 0 ; NumLock, CapsLock, ScrollLock lights mask -keyboard_mode db 0 ; Scan or ASCII keys to send ? 0 - ASCII , 1 - Scan -red_type db 0 ; Type of window redraw. 0 - default , 1 - on ASCII_keymap change , 2 - Switch button pressed. +keyboard_mode db 0 ; Scan or ASCII keys to send ? 0 - ASCII , 1 - Scan +red_type db 0 ; Type of window redraw. 0 - default , 1 - on ASCII_keymap change , 2 - Switch button pressed. -I_END: ; End of application code and data marker +I_END: ; End of application code and data marker + +ascii_keymap: rb ASCII_KEYMAP_SIZE + +PROCINFO_BUFF process_information + + rb 4096 +STACKTOP: +MEM: -ascii_keymap: