Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6444 → Rev 6443

/programs/system/cpu/trunk/cpu.asm
1,7 → 1,33
;-----------------------;
; CPU - process manager ;
;-----------------------;
 
;
; CPU -process Manager
;
;------------------------------------------------------------------------------
; version: 1.80
; last update: 07/04/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Complete elimination of flicker.
; Using f.0 C = 1 - don't fill working area on window draw.
; Increasing the size of buttons and a bright color.
; Processing "window is rolled up" and "window is minimized"
;------------------------------------------------------------------------------
; version: 1.70
; last update: 04/04/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Code refactoring and optimization.
; Added russian language support.
; Fix - processes information showing not been updated during
; the processing of mouse events.
;------------------------------------------------------------------------------
; Many fix's and changes created by:
; Diamond, Heavyiron, SPraid, <Lrz>,
; Leency, IgorA, kaitz
;---------------------------------------------------------------------
; integrated with load_lib.obj by <Lrz>
;---------------------------------------------------------------------
; additions by M.Lisovin lisovin@26.ru
;---------------------------------------------------------------------
; original author - VTurjanmaa
;------------------------------------------------------------------------------
format binary as ""
 
use32
250,7 → 276,14
mov ecx,[curposy]
shl ecx,16
mov cx,10 ; button height
push ecx
add ecx,3 shl 16
mcall 13,<11,95>,,[btn_bacground_color]
pop ecx
 
mcall 13,<111,393>,,[bar_bacground_color]
;--------------------------------------
align 4
@@:
ret
;------------------------------------------------------------------------------
262,6 → 295,15
;output:
; edi - next slot (or -1 if no next slot)
;registers corrupted!
;delete old button
cmp [draw_window_flag],0
je @f
mov edx,[index]
add edx,(1 shl 31)+11
mcall 8
;--------------------------------------
align 4
@@:
;create terminate process button
mov ecx,[curposy]
shl ecx,16
268,26 → 310,41
mov cx,13 ; button height
mov edx,[index]
add edx,11
mov esi,0xccddee
mov esi,0xccddee ; 0xaabbcc
;contrast
test dword [index],1
jz @f
mov esi,0xaabbcc
jz .change_color_button
mov esi,0xaabbcc ; 0x8899aa
;--------------------------------------
align 4
.change_color_button:
cmp [draw_window_flag],0
je @f
mcall 8,<10,99>
;--------------------------------------
align 4
@@:
mcall 8,<10,99>
mov [btn_bacground_color],esi
;draw background for proccess information
mov edx,0xddffdd
; ecx was already set
mov edx,0xddffdd ; 0x88ff88
;contrast
test dword [index],1
jz @f
mov edx,0xffffff
@@:
jz .change_color_info
mov edx,0xffffff ; 0xddffdd
;--------------------------------------
align 4
.change_color_info:
inc cx
cmp [draw_window_flag],0
je @f
mcall 13,<110,395>
;--------------------------------------
align 4
@@:
mov [bar_bacground_color],edx
;nothing else should be done if there is no process for this button
;nothing else should be done
;if there is no process for this button
cmp edi,-1
jne .return_1
 
373,6 → 430,7
div ebx
mov [cpu_percent],eax
;set text color to display process information
;([tcolor] variable)
;0% : black
;1-80% : green
;81-100% : red
379,7 → 437,7
test eax,eax
jnz .no_black
 
mov esi,eax
mov [tcolor],eax
jmp .color_set
;--------------------------------------
align 4
387,12 → 445,12
cmp eax,80
ja .no_green
 
mov esi,0x107a30
mov dword [tcolor],0x107a30
jmp .color_set
;--------------------------------------
align 4
.no_green:
mov esi,0xac0000
mov dword [tcolor],0xac0000
;--------------------------------------
align 4
.color_set:
401,16 → 459,22
push edi
mov edx,[curposy]
add edx,15*65536+3
mcall 47,<2,256>
mov esi,[tcolor]
and esi,0xffffff
or esi,0x40000000
mcall 47,<2,256>,,,,[btn_bacground_color]
;show process name
mov ebx,[curposy]
add ebx,40*65536+3
mov ecx,esi
mcall 4,,,process_info_buffer.process_name,11
mov ecx,[tcolor]
and ecx,0xffffff
or ecx,0x40000000
mcall 4,,,process_info_buffer.process_name,11,[btn_bacground_color]
;show pid
mov edx,[curposy]
add edx,125*65536+3
mov esi,ecx
mov esi,[tcolor]
and esi,0xffffff
or esi,0x40000000
mcall 47,<8,256>,[process_info_buffer.PID],,,[bar_bacground_color]
;show cpu usage
736,6 → 800,7
winypos rd 1
mouse_dd rd 1
cpu_percent rd 1
tcolor rd 1
list_add rd 1
curposy rd 1
index rd 1
756,6 → 821,10
align 4
cur_dir_path:
rb 1024
;------------------------------------------------------------------------------
align 4
rb 1024
stack_area:
;------------------------------------------------------------------------------
U_END:
;------------------------------------------------------------------------------