Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9714 → Rev 9715

/kernel/trunk/kernel.asm
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved.
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved.
;; PROGRAMMING:
;; Ivan Poddubny
;; Marat Zakiyanov (Mario79)
1546,14 → 1546,14
 
mov edi, [current_slot_idx]
mov ecx, edi
shl edi, 8
shl ecx, 5
shl edi, BSF sizeof.APPDATA
shl ecx, BSF sizeof.WDATA
 
mov eax, [ecx+window_data+WDATA.box.left]
add eax, [edi+SLOT_BASE+APPDATA.wnd_clientbox.left]
mov eax, [window_data + ecx + WDATA.box.left]
add eax, [SLOT_BASE + edi + APPDATA.wnd_clientbox.left]
shl eax, 16
add eax, [ecx+window_data+WDATA.box.top]
add eax, [edi+SLOT_BASE+APPDATA.wnd_clientbox.top]
add eax, [window_data + ecx + WDATA.box.top]
add eax, [SLOT_BASE + edi + APPDATA.wnd_clientbox.top]
add ebx, eax
mov ecx, [esp+64+32-12+4]
mov eax, [esp+64+8] ; background color (if given)
1940,7 → 1940,7
add eax, [_display.win_map]
movzx edx, byte [ebx+eax]
shl edx, BSF sizeof.APPDATA
mov esi, [edx+SLOT_BASE+APPDATA.cursor]
mov esi, [SLOT_BASE + edx + APPDATA.cursor]
 
cmp esi, [current_cursor]
je @f
2146,7 → 2146,7
je .nowindowactivate; already active
 
mov edi, ecx
shl edi, 5
shl edi, BSF sizeof.WDATA
add edi, window_data
movzx esi, word [WIN_STACK + ecx * 2]
lea esi, [WIN_POS + esi * 2]
2174,7 → 2174,7
je .fail
 
mov eax, edx
shl edx, 5
shl edx, BSF sizeof.WDATA
 
cmp [edx*8 + SLOT_BASE + APPDATA.state], TSTATE_FREE
je .fail
2182,7 → 2182,7
cmp ecx, 1
jnz .set_zmod
 
mov al, [edx + window_data + WDATA.z_modif]
mov al, [window_data + edx + WDATA.z_modif]
jmp .exit
 
.set_zmod:
2195,12 → 2195,12
cmp bl, ZPOS_ALWAYS_TOP
jg .fail
 
mov [edx + window_data + WDATA.z_modif], bl
mov [window_data + edx + WDATA.z_modif], bl
 
mov eax, [edx + window_data + WDATA.box.left]
mov ebx, [edx + window_data + WDATA.box.top]
mov ecx, [edx + window_data + WDATA.box.width]
mov edx, [edx + window_data + WDATA.box.height]
mov eax, [window_data + edx + WDATA.box.left]
mov ebx, [window_data + edx + WDATA.box.top]
mov ecx, [window_data + edx + WDATA.box.width]
mov edx, [window_data + edx + WDATA.box.height]
add ecx, eax
add edx, ebx
call window._.set_screen
2207,7 → 2207,7
call window._.set_top_wnd
call window._.redraw_top_wnd
 
shl esi, 5
shl esi, BSF sizeof.WDATA
mov [esi + window_data + WDATA.fl_redraw], 1
 
 
2603,15 → 2603,15
mov ax, [WIN_POS + ecx * 2]
mov [ebx+6], ax
 
shl ecx, 8 ;5=32 8=256
shl ecx, BSF sizeof.APPDATA
 
; +0: dword: memory usage
;mov eax, [ecx+TASK_TABLE+TASKDATA.cpu_usage]
mov eax, [ecx-sizeof.APPDATA+SLOT_BASE+APPDATA.cpu_usage]
mov eax, [SLOT_BASE + ecx - sizeof.APPDATA + APPDATA.cpu_usage]
mov [ebx], eax
; +10: 11 bytes: name of the process
push ecx
lea eax, [ecx+SLOT_BASE+APPDATA.app_name]
lea eax, [SLOT_BASE + ecx + APPDATA.app_name]
add ebx, 10
mov ecx, 11
call memmove
2635,12 → 2635,12
stosd
 
; +30: PID/TID
mov eax, [ecx*8 + SLOT_BASE + APPDATA.tid]
mov eax, [SLOT_BASE + ecx*8 + APPDATA.tid]
stosd
 
; window position and size
push esi
lea esi, [ecx + window_data + WDATA.box]
lea esi, [window_data + ecx + WDATA.box]
movsd
movsd
movsd
2647,11 → 2647,11
movsd
 
; Process state (+50)
movzx eax, byte [ecx*8 + SLOT_BASE + APPDATA.state]
movzx eax, byte [SLOT_BASE + ecx*8 + APPDATA.state]
stosd
 
; Window client area box
lea esi, [ecx*8 + SLOT_BASE + APPDATA.wnd_clientbox]
lea esi, [SLOT_BASE + ecx*8 + APPDATA.wnd_clientbox]
movsd
movsd
movsd
2658,15 → 2658,15
movsd
 
; Window state
mov al, [ecx+window_data+WDATA.fl_wstate]
mov al, [window_data + ecx + WDATA.fl_wstate]
stosb
 
; Event mask (+71)
mov EAX, dword [ecx*8 + SLOT_BASE + APPDATA.event_mask]
mov EAX, dword [SLOT_BASE + ecx*8 + APPDATA.event_mask]
stosd
 
; Keyboard mode (+75)
mov al, byte [ecx*8 + SLOT_BASE + APPDATA.keyboard_mode]
mov al, byte [SLOT_BASE + ecx*8 + APPDATA.keyboard_mode]
stosb
 
pop esi
2728,7 → 2728,7
jnz srl1
 
mov edx, [current_slot_idx] ; return whole screen draw area for this app
shl edx, 5
shl edx, 5 ;?
add edx, draw_data
mov [edx + RECT.left], 0
mov [edx + RECT.top], 0
2906,7 → 2906,7
.set_mouse_event:
add edi, sizeof.APPDATA
add ebx, sizeof.WDATA
test [edi + SLOT_BASE + APPDATA.event_mask], 0x80000000
test [SLOT_BASE + edi + APPDATA.event_mask], 0x80000000
jz .pos_filter
 
cmp edi, [esp] ; skip if filtration active
2914,7 → 2914,7
;--------------------------------------
align 4
.pos_filter:
test [edi + SLOT_BASE + APPDATA.event_mask], 0x40000000
test [SLOT_BASE + edi + APPDATA.event_mask], 0x40000000
jz .set
 
mov esi, [ebx + WDATA.box.left]
2933,7 → 2933,7
;--------------------------------------
align 4
.set:
or [edi+SLOT_BASE+APPDATA.occurred_events], EVENT_MOUSE
or [SLOT_BASE + edi + APPDATA.occurred_events], EVENT_MOUSE
;--------------------------------------
align 4
.skip:
2975,33 → 2975,33
add edi, sizeof.APPDATA
mov eax, [BG_Rect_X_left_right]
mov edx, [BG_Rect_Y_top_bottom]
cmp [edi+SLOT_BASE+APPDATA.draw_bgr_x], 0
cmp [SLOT_BASE + edi + APPDATA.draw_bgr_x], 0
jz .set
.join:
cmp word [edi+SLOT_BASE+APPDATA.draw_bgr_x], ax
cmp word [SLOT_BASE + edi + APPDATA.draw_bgr_x], ax
jae @f
mov word [edi+SLOT_BASE+APPDATA.draw_bgr_x], ax
mov word [SLOT_BASE + edi + APPDATA.draw_bgr_x], ax
@@:
shr eax, 16
cmp word [edi+SLOT_BASE+APPDATA.draw_bgr_x+2], ax
cmp word [SLOT_BASE + edi + APPDATA.draw_bgr_x + 2], ax
jbe @f
mov word [edi+SLOT_BASE+APPDATA.draw_bgr_x+2], ax
mov word [SLOT_BASE + edi + APPDATA.draw_bgr_x + 2], ax
@@:
cmp word [edi+SLOT_BASE+APPDATA.draw_bgr_y], dx
cmp word [SLOT_BASE + edi + APPDATA.draw_bgr_y], dx
jae @f
mov word [edi+SLOT_BASE+APPDATA.draw_bgr_y], dx
mov word [SLOT_BASE + edi + APPDATA.draw_bgr_y], dx
@@:
shr edx, 16
cmp word [edi+SLOT_BASE+APPDATA.draw_bgr_y+2], dx
cmp word [SLOT_BASE + edi + APPDATA.draw_bgr_y+2], dx
jbe @f
mov word [edi+SLOT_BASE+APPDATA.draw_bgr_y+2], dx
mov word [SLOT_BASE + edi + APPDATA.draw_bgr_y+2], dx
@@:
jmp .common
.set:
mov [edi+SLOT_BASE+APPDATA.draw_bgr_x], eax
mov [edi+SLOT_BASE+APPDATA.draw_bgr_y], edx
mov [SLOT_BASE + edi + APPDATA.draw_bgr_x], eax
mov [SLOT_BASE + edi + APPDATA.draw_bgr_y], edx
.common:
or [edi+SLOT_BASE+APPDATA.occurred_events], EVENT_BACKGROUND
or [SLOT_BASE + edi + APPDATA.occurred_events], EVENT_BACKGROUND
loop set_bgr_event
pop edi ecx
;--------- set event 5 stop -----------
3066,15 → 3066,15
align 4
newct:
mov cl, [ebx]
cmp cl, byte 3
cmp cl, TSTATE_ZOMBIE
jz .terminate
 
cmp cl, byte 4
cmp cl, TSTATE_TERMINATING
jnz .noterminate
.terminate:
pushad
mov ecx, eax
shl ecx, 8
shl ecx, BSF sizeof.APPDATA
add ecx, SLOT_BASE
call restore_default_cursor_before_killing
popad
3113,7 → 3113,7
push ecx
 
mov eax, ecx
shl eax, 5
shl eax, BSF sizeof.WDATA
add eax, window_data
 
cmp eax, [esp+4]
3741,9 → 3741,9
 
mov eax, [current_slot_idx]
shl eax, 8
add dx, word [eax+SLOT_BASE+APPDATA.wnd_clientbox.top]
add dx, word [SLOT_BASE + eax + APPDATA.wnd_clientbox.top]
rol edx, 16
add dx, word [eax+SLOT_BASE+APPDATA.wnd_clientbox.left]
add dx, word [SLOT_BASE + eax + APPDATA.wnd_clientbox.left]
rol edx, 16
;--------------------------------------
align 4
4301,14 → 4301,14
;-----------------------------------------------------------------------------
align 4
.1:
shl edi, 8
mov [edi+SLOT_BASE + APPDATA.keyboard_mode], cl
shl edi, BSF sizeof.APPDATA
mov [SLOT_BASE + edi + APPDATA.keyboard_mode], cl
 
ret
;-----------------------------------------------------------------------------
align 4
.2: ; 2 = get keyboard mode
shl edi, 8
shl edi, BSF sizeof.APPDATA
movzx eax, byte [SLOT_BASE+edi + APPDATA.keyboard_mode]
mov [esp+32], eax
ret