Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9940 → Rev 9941

/kernel/trunk/blkdev/disk.inc
731,7 → 731,7
; [ecx+0x40] is shorter than [ebx+0x1fe]: one-byte offset vs 4-bytes offset.
lea ecx, [ebx+0x1be] ; ecx -> partition table
cmp word [ecx+0x40], 0xaa55
jnz .mbr_failed
jnz .notmbr
; 8. The MBR is treated differently from EBRs. For MBR we additionally need to
; execute step 10 and possibly step 11.
test ebp, ebp
/kernel/trunk/const.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
789,6 → 789,15
check_m_pixel dd ?
 
bytes_per_pixel dd ?
 
put_pixel dd ?
put_rect dd ?
put_image dd ?
put_line dd ?
get_pixel dd ?
get_rect dd ?
get_image dd ?
get_line dd ?
ends
 
struct DISPMODE
/kernel/trunk/core/taskman.inc
709,16 → 709,16
mov [slot], eax
 
mov esi, [current_slot]
mov ebx, esi ;ebx=esi - pointer to extended information about current thread
mov ebx, esi ;ebx=esi - pointer to information about current thread
 
mov edi, eax
shl edi, BSF sizeof.APPDATA
add edi, SLOT_BASE
mov edx, edi ;edx=edi - pointer to extended infomation about new thread
mov edx, edi ;edx=edi - pointer to infomation about new thread
mov ecx, sizeof.APPDATA/4
xor eax, eax
cld
rep stosd ;clean extended information about new thread
rep stosd ;clean information about new thread
mov esi, ebx
mov edi, edx
mov ecx, 11
/kernel/trunk/data32.inc
353,7 → 353,6
 
BPSLine_calc_area rd MAX_SCREEN_HEIGHT
d_width_calc_area rd MAX_SCREEN_HEIGHT
mouseunder rd 16*24
 
mem_block_list rd 64*2
mem_used_list rd 64*2
395,8 → 394,6
BANK_RW dd ?
end if
 
MOUSE_PICTURE dd ?
 
def_cursor dd ?
def_cursor_clock dd ?
def_cursor_hresize dd ?
404,7 → 401,6
def_cursor_dresize1 dd ?
def_cursor_dresize2 dd ?
current_cursor dd ?
hw_cursor dd ?
cur_saved_base dd ?
 
cur.lock dd ? ; 1 - lock update, 2- hide
/kernel/trunk/gui/mousepointer.inc
File deleted
Property changes:
Deleted: svn:eol-style
-native
\ No newline at end of property
Deleted: svn:keywords
-Rev
\ No newline at end of property
/kernel/trunk/gui/button.inc
95,13 → 95,13
 
; make coordinates clientbox-relative
push eax
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
mov eax, [current_slot]
mov eax, [eax + APPDATA.window]
rol ebx, 16
add bx, word[window_data + eax + WDATA.clientbox.left]
add bx, word[eax + WDATA.clientbox.left]
rol ebx, 16
rol ecx, 16
add cx, word[window_data + eax + WDATA.clientbox.top]
add cx, word[eax + WDATA.clientbox.top]
rol ecx, 16
pop eax
 
173,10 → 173,10
dec ebp
shr ebx, 16
shr ecx, 16
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
add ebx, [eax + window_data + WDATA.box.left]
add ecx, [eax + window_data + WDATA.box.top]
mov eax, [current_slot]
mov eax, [eax + APPDATA.window]
add ebx, [eax + WDATA.box.left]
add ecx, [eax + WDATA.box.top]
mov eax, ebx
inc eax
mov edx, ebx
/kernel/trunk/gui/mouse.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2010-2023. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7,8 → 7,6
 
$Revision$
 
include 'mousepointer.inc'
 
;================================
;/////// public functions ///////
;================================
/kernel/trunk/gui/window.inc
186,7 → 186,7
align 4
; system function 48
syscall_display_settings:
cmp ebx, 13
cmp ebx, .ftable.size-1
ja .ret
jmp dword[.ftable + ebx*4]
 
206,6 → 206,7
dd .getFontSize
dd .setFontSize
dd .setSkinUnicode
.ftable.size = ($ - .ftable)/4
 
.redrawWholeScreen:
xor eax, eax
223,7 → 224,7
mov eax, [_display.height]
dec eax
mov [draw_limits.bottom], eax
mov eax, window_data
mov eax, window_data ; TODO: check pointer
jmp redrawscreen
 
.setButtonStyle:
406,18 → 407,18
;> ebx = 1
;> ecx = scale power (resulting scale is 2^ebx)
syscall_set_window_shape:
mov edi, [current_slot_idx]
shl edi, BSF sizeof.WDATA
mov edi, [current_slot]
mov edi, [edi + APPDATA.window]
 
test ebx, ebx
jne .shape_scale
mov [window_data + edi + WDATA.shape], ecx
mov [edi + WDATA.shape], ecx
;--------------------------------------
align 4
.shape_scale:
dec ebx
jnz .exit
mov [window_data + edi + WDATA.shape_scale], ecx
mov [edi + WDATA.shape_scale], ecx
;--------------------------------------
align 4
.exit:
427,9 → 428,8
align 4
; system function 67
syscall_move_window:
mov edi, [current_slot_idx]
shl edi, BSF sizeof.WDATA
add edi, window_data
mov edi, [current_slot]
mov edi, [edi + APPDATA.window]
 
test [edi + WDATA.fl_wdrawn], 1
jz .exit
556,11 → 556,11
.next_window:
movzx edi, word[WIN_POS + esi * 2]
shl edi, BSF sizeof.WDATA
add edi, window_data
 
test byte [window_data + edi + WDATA.fl_wstate], WSTATE_USED
test byte [edi + WDATA.fl_wstate], WSTATE_USED
jz .skip_window
 
add edi, window_data
test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
jnz .skip_window
 
1245,7 → 1245,7
dec bl
jnz @f
call minimize_window
jmp .exit
ret
;--------------------------------------
align 4
@@:
1614,9 → 1614,8
align 4
;< edx = pointer to WDATA struct
window._.sys_set_window:
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
add eax, window_data
mov eax, [current_slot]
mov eax, [eax + APPDATA.window]
; save window colors
mov [eax + WDATA.cl_workarea], edx
mov [eax + WDATA.cl_titlebar], esi
1847,18 → 1846,20
 
mov edi, esi
shl edi, BSF sizeof.WDATA
add edi, window_data
 
cmp esi, 1
jz .check_for_shaped_window
 
cmp [window_data + edi + WDATA.box.width], 0
cmp [edi + WDATA.box.width], 0
jnz .check_for_shaped_window
cmp [window_data + edi + WDATA.box.height], 0
 
cmp [edi + WDATA.box.height], 0
jz .exit
;--------------------------------------
align 4
.check_for_shaped_window:
cmp [window_data + edi + WDATA.shape], 0
cmp [edi + WDATA.shape], 0
jne .shaped_window
 
; get x&y size
1908,7 → 1909,7
inc ecx
inc edx
 
push [window_data + edi + WDATA.shape_scale] ; push scale first -> for loop
push [edi + WDATA.shape_scale] ; push scale first -> for loop
 
; get WinMap start -> ebp
push eax
1918,7 → 1919,7
add eax, [_display.win_map]
mov ebp, eax
 
mov edi, [window_data + edi + WDATA.shape]
mov edi, [edi + WDATA.shape]
pop eax
 
; eax = x_start
2227,9 → 2228,8
;--------------------------------------
align 4
@@:
mov edx, [current_slot_idx]
shl edx, BSF sizeof.WDATA
add edx, window_data
mov edx, [current_slot]
mov edx, [edx + APPDATA.window]
movzx ebx, [edx + WDATA.fl_wstyle]
and bl, 0x0F
cmp bl, 3
2263,17 → 2263,17
;--------------------------------------
align 4
.2:
mov edi, [current_slot_idx]
shl edi, BSF sizeof.WDATA
test [window_data + edi + WDATA.fl_wstyle], WSTYLE_HASCAPTION
mov edi, [current_slot]
mov edi, [edi + APPDATA.window]
test [edi + WDATA.fl_wstyle], WSTYLE_HASCAPTION
jz .exit
mov edx, [window_data + edi + WDATA.caption]
mov edx, [edi + WDATA.caption]
or edx, edx
jz .exit
 
mov ebp, [edi + window_data + WDATA.box.left - 2]
mov bp, word[edi + window_data + WDATA.box.top]
movzx eax, [edi + window_data + WDATA.fl_wstyle]
mov ebp, [edi + WDATA.box.left - 2]
mov bp, word[edi + WDATA.box.top]
movzx eax, [edi + WDATA.fl_wstyle]
and al, 0x0F
cmp al, 3
je .skinned
2284,7 → 2284,7
;--------------------------------------
align 4
.skinned:
movzx eax, word[edi + window_data + WDATA.box.width]
movzx eax, word[edi + WDATA.box.width]
sub ax, [_skinmargins.left]
sub ax, [_skinmargins.right]
js .exit
2301,7 → 2301,7
.not_skinned:
cmp al, 1
je .exit
movzx eax, word[edi + window_data + WDATA.box.width]
movzx eax, word[edi + WDATA.box.width]
sub eax, 16
js .exit
mov ebx, 80002h
2310,7 → 2310,7
mov esi, eax
add ebx, ebp
mov ecx, [common_colours + 16]
mov al, [window_data + edi + WDATA.captionEncoding]
mov al, [edi + WDATA.captionEncoding]
test al, al
jnz @f
mov al, 1
2368,19 → 2368,19
; void __fastcall get_window_rect(struct RECT* rc);
; ecx = pointer to RECT
window._.get_rect:
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
mov eax, [current_slot]
mov eax, [eax + APPDATA.window]
 
mov edx, [eax + window_data + WDATA.box.left]
mov edx, [eax + WDATA.box.left]
mov [ecx+RECT.left], edx
 
add edx, [eax + window_data + WDATA.box.width]
add edx, [eax + WDATA.box.width]
mov [ecx+RECT.right], edx
 
mov edx, [eax +window_data + WDATA.box.top]
mov edx, [eax + WDATA.box.top]
mov [ecx+RECT.top], edx
 
add edx, [eax + window_data + WDATA.box.height]
add edx, [eax + WDATA.box.height]
mov [ecx+RECT.bottom], edx
ret
;------------------------------------------------------------------------------
/kernel/trunk/hid/mousedrv.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54,46 → 54,7
movzx ebx, word [Y_UNDER]
stdcall [_display.restore_cursor], eax, ebx
popad
ret
 
@@:
pushad
xor ecx, ecx
xor edx, edx
 
.mres:
movzx eax, word [X_UNDER]
movzx ebx, word [Y_UNDER]
add eax, ecx
add ebx, edx
push ecx
push edx
push eax
push ebx
mov eax, edx
shl eax, 6
shl ecx, 2
add eax, ecx
add eax, mouseunder
mov ecx, [eax]
pop ebx
pop eax
mov edi, 1 ; force
or ecx, 0x04000000 ; don't save to mouseunder area
; call [putpixel]
call __sys_putpixel
pop edx
pop ecx
inc ecx
cmp ecx, 16
jnz .mres
 
xor ecx, ecx
inc edx
cmp edx, 24
jnz .mres
 
popad
ret
 
;-----------------------------------------------------------------------------
101,7 → 62,7
align 4
save_draw_mouse:
cmp [_display.move_cursor], 0
je .no_hw_cursor
je .exit
pushad
 
mov [X_UNDER], ax
158,8 → 119,10
je .draw
 
@@:
push esi
call [_display.select_cursor]
cmp [_display.select_cursor], 0
jz .error
 
stdcall [_display.select_cursor], esi
mov [current_cursor], esi
;--------------------------------------
align 4
177,281 → 140,14
; ret
;--------------------------------------
align 4
.no_hw_cursor:
pushad
; save & draw
mov [X_UNDER], ax
mov [Y_UNDER], bx
push eax
push ebx
mov ecx, 0
mov edx, 0
;--------------------------------------
align 4
.drm:
push eax
push ebx
push ecx
push edx
; helloworld
push ecx
add eax, ecx ; save picture under mouse
add ebx, edx
push ecx
or ecx, 0x04000000 ; don't load to mouseunder area
push eax ebx edx edi
call [GETPIXEL]
pop edi edx ebx eax
mov [COLOR_TEMP], ecx
pop ecx
mov eax, edx
shl eax, 6
shl ecx, 2
add eax, ecx
add eax, mouseunder
mov ebx, [COLOR_TEMP]
and ebx, 0xffffff
mov [eax], ebx
pop ecx
mov edi, edx ; y cycle
shl edi, 4 ; *16 bytes per row
add edi, ecx ; x cycle
mov esi, edi
add edi, esi
add edi, esi ; *3
add edi, [MOUSE_PICTURE] ; we have our str address
mov esi, edi
add esi, 16*24*3
push ecx
mov ecx, [COLOR_TEMP]
call combine_colors
and ecx, 0xffffff
mov [MOUSE_COLOR_MEM], ecx
pop ecx
pop edx
pop ecx
pop ebx
pop eax
add eax, ecx ; we have x coord+cycle
add ebx, edx ; and y coord+cycle
push ecx
mov ecx, [MOUSE_COLOR_MEM]
mov edi, 1 ; force
or ecx, 0x04000000 ; don't save to mouseunder area
; call [putpixel]
call __sys_putpixel
pop ecx
mov ebx, [esp+0] ; pure y coord again
mov eax, [esp+4] ; and x
inc ecx ; +1 cycle
cmp ecx, 16 ; if more than 16
jnz .drm
 
xor ecx, ecx
inc edx
cmp edx, 24
jnz .drm
 
add esp, 8
.error:
popad
.exit:
ret
 
;-----------------------------------------------------------------------------
 
align 4
combine_colors:
; in
; ecx - color ( 00 RR GG BB )
; edi - ref to new color byte
; esi - ref to alpha byte
;
; out
; ecx - new color ( roughly (ecx*[esi]>>8)+([edi]*[esi]>>8) )
push eax
push ebx
push edx
push ecx
xor ecx, ecx
; byte 0
mov eax, 0xff
sub al, [esi+0]
mov ebx, [esp]
shr ebx, 16
and ebx, 0xff
mul ebx
shr eax, 8
add ecx, eax
xor eax, eax
xor ebx, ebx
mov al, [edi+0]
mov bl, [esi+0]
mul ebx
shr eax, 8
add ecx, eax
shl ecx, 8
; byte 1
mov eax, 0xff
sub al, [esi+1]
mov ebx, [esp]
shr ebx, 8
and ebx, 0xff
mul ebx
shr eax, 8
add ecx, eax
xor eax, eax
xor ebx, ebx
mov al, [edi+1]
mov bl, [esi+1]
mul ebx
shr eax, 8
add ecx, eax
shl ecx, 8
; byte 2
mov eax, 0xff
sub al, [esi+2]
mov ebx, [esp]
and ebx, 0xff
mul ebx
shr eax, 8
add ecx, eax
xor eax, eax
xor ebx, ebx
mov al, [edi+2]
mov bl, [esi+2]
mul ebx
shr eax, 8
add ecx, eax
pop eax
pop edx
pop ebx
pop eax
ret
 
;-----------------------------------------------------------------------------
 
align 4
check_mouse_area_for_getpixel:
; in:
; eax = x
; ebx = y
; out:
; ecx = new color
push eax ebx
; check for Y
xor ecx, ecx
mov cx, [Y_UNDER] ; [MOUSE_Y]
 
cmp ebx, ecx
jb .no_mouse_area
add ecx, 23 ; mouse cursor Y size
cmp ebx, ecx
ja .no_mouse_area
; offset Y
sub bx, [Y_UNDER] ; [MOUSE_Y]
;--------------------------------------
; check for X
xor ecx, ecx
mov cx, [X_UNDER] ; [MOUSE_X]
cmp eax, ecx
jb .no_mouse_area
add ecx, 15 ; mouse cursor X size
cmp eax, ecx
ja .no_mouse_area
; offset X
sub ax, [X_UNDER] ; [MOUSE_X]
;--------------------------------------
; eax = offset x
; ebx = offset y
shl ebx, 6 ;y
shl eax, 2 ;x
add eax, ebx
add eax, mouseunder
mov ecx, [eax]
and ecx, 0xffffff
or ecx, 0xff000000
pop ebx eax
ret
 
.no_mouse_area:
xor ecx, ecx
pop ebx eax
ret
 
;-----------------------------------------------------------------------------
 
align 4
check_mouse_area_for_putpixel:
; in:
; ecx = x shl 16 + y
; eax = color
; out:
; eax = new color
push eax
; check for Y
mov ax, [Y_UNDER] ; [MOUSE_Y]
cmp cx, ax
jb .no_mouse_area
add ax, 23 ; mouse cursor Y size
cmp cx, ax
ja .no_mouse_area
; offset Y
sub cx, [Y_UNDER] ; [MOUSE_Y]
mov ax, cx
shl eax, 16
 
; check for X
mov ax, [X_UNDER] ; [MOUSE_X]
shr ecx, 16
cmp cx, ax
jb .no_mouse_area
add ax, 15 ; mouse cursor X size
cmp cx, ax
ja .no_mouse_area
; offset X
sub cx, [X_UNDER] ; [MOUSE_X]
mov ax, cx
 
; eax = (offset y) shl 16 + (offset x)
 
pop ecx
 
push eax ebx
 
mov ebx, eax
shr ebx, 16 ; y
and eax, 0xffff ; x
 
shl ebx, 6
shl eax, 2
add eax, ebx
add eax, mouseunder
and ecx, 0xFFFFFF
mov [eax], ecx
 
pop ebx eax
 
push esi edi
rol eax, 16
movzx edi, ax ; y cycle
shl edi, 4 ; *16 bytes per row
shr eax, 16
add edi, eax ; x cycle
lea edi, [edi*3]
add edi, [MOUSE_PICTURE] ; we have our str address
mov esi, edi
add esi, 16*24*3
call combine_colors
pop edi esi
mov eax, ecx
ret
 
.no_mouse_area:
pop eax
ret
 
;-----------------------------------------------------------------------------
 
align 4
__sys_draw_pointer:
pushad
movzx ecx, word [X_UNDER]
461,25 → 157,22
cmp [redrawmouse_unconditional], 0
je @f
mov [redrawmouse_unconditional], 0
jmp redrawmouse
jmp .redrawmouse
@@:
cmp eax, ecx
jne redrawmouse
jne .redrawmouse
cmp ebx, edx
je nodmp
je .nodmp
 
;--------------------------------------
 
align 4
redrawmouse:
.redrawmouse:
pushfd
cli
call draw_mouse_under
call save_draw_mouse
 
; mov eax, [_display.select_cursor]
; test eax, eax
; jz @f
cmp [_display.select_cursor], select_cursor
jne @f
 
499,7 → 192,7
mov [X_UNDER_sub_CUR_hot_x_add_curh], ax
@@:
popfd
nodmp:
.nodmp:
popad
ret
 
/kernel/trunk/kernel.asm
1901,8 → 1901,6
 
;-----------------------------------------------------------------------------
sys_end:
cmp [_display.select_cursor], 0
je @f
; restore default cursor before killing
pusha
mov ecx, [current_slot]
1909,7 → 1907,6
mov ecx, [ecx + APPDATA.window]
call restore_default_cursor_before_killing
popa
@@:
;--------------------------------------
; kill all sockets this process owns
pusha
1954,8 → 1951,10
cmp esi, [current_cursor]
je @f
 
push esi
call [_display.select_cursor]
cmp [_display.select_cursor], 0
jz @f
 
stdcall [_display.select_cursor], esi
mov [current_cursor], esi
@@:
mov [redrawmouse_unconditional], 1
2062,8 → 2061,6
call socket_process_end
popa
;--------------------------------------
cmp [_display.select_cursor], 0
je .restore_end
; restore default cursor before killing
pusha
mov ecx, [esp+32]
2075,7 → 2072,6
call restore_default_cursor_before_killing
@@:
popa
.restore_end:
;--------------------------------------
;call MEM_Heap_Lock ;guarantee that process isn't working with heap
mov [ecx + APPDATA.state], TSTATE_ZOMBIE; clear possible i40's
2557,8 → 2553,7
lea eax, [edx-1]
stosd
 
mov edx, ecx
shr edx, (BSF sizeof.APPDATA - BSF sizeof.WDATA)
mov edx, [SLOT_BASE + ecx + APPDATA.window]
 
; +30: PID/TID
mov eax, [SLOT_BASE + ecx + APPDATA.tid]
2566,7 → 2561,7
 
; window position and size
push esi
lea esi, [window_data + edx + WDATA.box]
lea esi, [edx + WDATA.box]
movsd
movsd
movsd
2577,7 → 2572,7
stosd
 
; Window client area box
lea esi, [window_data + edx + WDATA.clientbox]
lea esi, [edx + WDATA.clientbox]
movsd
movsd
movsd
2584,7 → 2579,7
movsd
 
; Window state
mov al, [window_data + edx + WDATA.fl_wstate]
mov al, [edx + WDATA.fl_wstate]
stosb
 
; Event mask (+71)
2771,12 → 2766,8
 
is_cache_enabled:
mov eax, cr0
mov ebx, eax
and eax, 01100000_00000000_00000000_00000000b
jz cache_disabled
mov [esp + SYSCALL_STACK.eax], ebx
cache_disabled:
mov dword [esp + SYSCALL_STACK.eax], eax;0
mov [esp + SYSCALL_STACK.eax], eax
ret
 
modify_pce:
2891,7 → 2882,7
; DEBUGF 1, "K : backg y %x\n",[BG_Rect_Y_top_bottom]
;--------- set event 5 start ----------
push ecx edi
xor edi, edi
mov edi, window_data
mov ecx, [thread_count]
;--------------------------------------
align 4
2899,40 → 2890,38
add edi, sizeof.WDATA
mov eax, [BG_Rect_X_left_right]
mov edx, [BG_Rect_Y_top_bottom]
cmp [window_data + edi + WDATA.draw_bgr_x], 0
cmp [edi + WDATA.draw_bgr_x], 0
jz .set
.join:
cmp word [window_data + edi + WDATA.draw_bgr_x], ax
cmp word [edi + WDATA.draw_bgr_x], ax
jae @f
mov word [window_data + edi + WDATA.draw_bgr_x], ax
mov word [edi + WDATA.draw_bgr_x], ax
@@:
shr eax, 16
cmp word [window_data + edi + WDATA.draw_bgr_x + 2], ax
cmp word [edi + WDATA.draw_bgr_x + 2], ax
jbe @f
mov word [window_data + edi + WDATA.draw_bgr_x + 2], ax
mov word [edi + WDATA.draw_bgr_x + 2], ax
@@:
cmp word [window_data + edi + WDATA.draw_bgr_y], dx
cmp word [edi + WDATA.draw_bgr_y], dx
jae @f
mov word [window_data + edi + WDATA.draw_bgr_y], dx
mov word [edi + WDATA.draw_bgr_y], dx
@@:
shr edx, 16
cmp word [window_data + edi + WDATA.draw_bgr_y+2], dx
cmp word [edi + WDATA.draw_bgr_y+2], dx
jbe @f
mov word [window_data + edi + WDATA.draw_bgr_y+2], dx
mov word [edi + WDATA.draw_bgr_y+2], dx
@@:
jmp .common
.set:
mov [window_data + edi + WDATA.draw_bgr_x], eax
mov [window_data + edi + WDATA.draw_bgr_y], edx
mov [edi + WDATA.draw_bgr_x], eax
mov [edi + WDATA.draw_bgr_y], edx
.common:
mov eax, [window_data + edi + WDATA.thread]
mov eax, [edi + WDATA.thread]
test eax, eax
jz @f
or [eax + APPDATA.occurred_events], EVENT_BACKGROUND
@@:
sub ecx, 1
jnz set_bgr_event
;loop set_bgr_event
loop set_bgr_event
pop edi ecx
;--------- set event 5 stop -----------
dec [REDRAW_BACKGROUND] ; got new update request?
2956,7 → 2945,7
jne noshutdown
 
lea ecx, [edx-1]
mov edx, SLOT_BASE + sizeof.APPDATA ;OS_BASE+0x3040
mov edx, SLOT_BASE + sizeof.APPDATA*2 ;OS_BASE+0x3040
jecxz no_mark_system_shutdown
;--------------------------------------
align 4
3003,13 → 2992,11
jnz .noterminate
.terminate:
pushad
mov ecx, eax
shl ecx, BSF sizeof.WDATA
add ecx, window_data
push esi
mov ecx, dword[ebx - APPDATA.state + APPDATA.window]
call restore_default_cursor_before_killing
popad
 
pushad
pop esi
call terminate
popad
cmp byte [SYS_SHUTDOWN], 0
3025,6 → 3012,7
ret
;-----------------------------------------------------------------------------
align 4
; eax - ptr to WDATA
redrawscreen:
; eax , if process window_data base is eax, do not set flag/limits
 
3065,13 → 3053,11
mov eax, [edi + WDATA.box.left]
mov ebx, [edi + WDATA.box.top]
 
mov ecx, [draw_limits.bottom] ; ecx = area y end ebx = window y start
cmp ecx, ebx
jb ricino
cmp ebx, [draw_limits.bottom] ; ecx = area y end ebx = window y start
jae ricino
 
mov ecx, [draw_limits.right] ; ecx = area x end eax = window x start
cmp ecx, eax
jb ricino
cmp eax, [draw_limits.right] ; ecx = area x end eax = window x start
jae ricino
 
mov eax, [edi + WDATA.box.left]
mov ebx, [edi + WDATA.box.top]
3090,7 → 3076,7
;--------------------------------------
align 4
bgli:
cmp dword[esp], 1
cmp dword[esp], 1 ; check index in window_data array, 1 - idle
jnz .az
 
cmp [REDRAW_BACKGROUND], 0
3139,18 → 3125,16
;--------------------------------------
align 4
.az:
mov eax, edi
 
mov ebx, [draw_limits.left] ; set limits
mov [eax + WDATA.draw_data.left], ebx
mov [edi + WDATA.draw_data.left], ebx
mov ebx, [draw_limits.top]
mov [eax + WDATA.draw_data.top], ebx
mov [edi + WDATA.draw_data.top], ebx
mov ebx, [draw_limits.right]
mov [eax + WDATA.draw_data.right], ebx
mov [edi + WDATA.draw_data.right], ebx
mov ebx, [draw_limits.bottom]
mov [eax + WDATA.draw_data.bottom], ebx
mov [edi + WDATA.draw_data.bottom], ebx
 
cmp dword [esp], 1
cmp dword [esp], 1 ; check idle thread
jne nobgrd
inc [REDRAW_BACKGROUND]
call wakeup_osloop
3159,8 → 3143,8
newdw8:
nobgrd:
;--------------------------------------
push eax edi ebp
mov edi, [esp+12]
push edi ebp
mov edi, [esp+8]
cmp edi, 1
je .found
 
3210,14 → 3194,14
;--------------------------------------
align 4
.not_found:
pop ebp edi eax
pop ebp edi
jmp ricino
;--------------------------------------
align 4
.found:
pop ebp edi eax
pop ebp edi
 
mov [eax + WDATA.fl_redraw], WSTATE_REDRAW ; mark as redraw
mov [edi + WDATA.fl_redraw], WSTATE_REDRAW ; mark as redraw
;--------------------------------------
align 4
ricino:
/kernel/trunk/video/blitter.inc
213,10 → 213,10
mov [esp + .flags], ebx
 
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
mov ebx, [window_data + eax + WDATA.box.width]
mov edx, [window_data + eax + WDATA.box.height]
mov eax, [current_slot]
mov eax, [eax + APPDATA.window]
mov ebx, [eax + WDATA.box.width]
mov edx, [eax + WDATA.box.height]
inc ebx
inc edx
 
260,19 → 260,19
call blit_clip
jc .L57
 
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
mov eax, [current_slot]
mov eax, [eax + APPDATA.window]
 
mov ebx, [esp + BLITTER.dst_x]
mov ebp, [esp + BLITTER.dst_y]
add ebx, [window_data + eax + WDATA.box.left]
add ebp, [window_data + eax + WDATA.box.top]
add ebx, [eax + WDATA.box.left]
add ebp, [eax + WDATA.box.top]
test [esp + .flags], BLIT_CLIENT_RELATIVE
jz .no_client_relative
 
add ebx, [window_data + eax + WDATA.clientbox.left]
add ebp, [window_data + eax + WDATA.clientbox.top]
add ebx, [eax + WDATA.clientbox.left]
add ebp, [eax + WDATA.clientbox.top]
.no_client_relative:
 
mov ecx, ebx
320,8 → 320,6
mov ebx, [current_slot_idx]
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je .core_32.software_cursor
cmp [_display.select_cursor], 0
jne .core_32.hardware_cursor
;--------------------------------------
.core_32.software_cursor:
430,12 → 428,9
 
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder_1
;--------------------------------------
align 4
@@:
push ecx
 
mov ecx, [esp+4]
491,11 → 486,8
 
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder_2
;--------------------------------------
@@:
push ecx
 
mov ecx, [esp+4]
/kernel/trunk/video/cursors.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
617,6 → 617,74
endp
;------------------------------------------------------------------------------
align 4
proc VGA_restore_32 stdcall, x:dword, y:dword
 
push ebx
 
mov ebx, [cur_saved_base]
mov edx, [cur.h]
test edx, edx
jz .ret
 
push esi
push edi
 
mov esi, cur_saved_data
mov edi, ebx
push [cur.w]
push [cur.top];[y]
push [cur.left];[x]
;mov eax, [cur.top]
;add [esp + 4], eax
;mov eax, [cur.left]
;add [esp], eax
;--------------------------------------
align 4
@@:
mov ecx, [esi]
add esi, 4
 
;mov eax, [esp]
;sub eax, [x]
;shl eax, 2 ; *4
;mov [edi + eax], ecx
 
mov eax, [esp]
mov ebx, [esp + 4]
 
push edx edi
mov edi, 1
or ecx, 0x04000000
call __sys_putpixel
pop edi edx
add dword[esp], 1
dec dword[esp + 8]
jnz @b
 
mov eax, [cur.w]
mov ecx, [cur.left];[x]
;add ecx, [cur.left]
mov [esp + 8], eax
 
mov dword[esp], ecx
 
inc dword[esp + 4]
;add edi, [_display.lfb_pitch]
dec edx
jnz @b
 
add esp, 4*3
 
pop edi
pop esi
;--------------------------------------
align 4
.ret:
pop ebx
ret
endp
;------------------------------------------------------------------------------
align 4
proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
locals
h dd ?
959,8 → 1027,163
jnz .row
ret
endp
 
;------------------------------------------------------------------------------
align 4
proc VGA_move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
locals
h dd ?
_dx dd ?
_dy dd ?
bg_ptr dd ?
tmp_x dd ?
tmp_y dd ?
endl
 
mov esi, [hcursor]
mov ecx, [x]
mov eax, [y]
 
xor edx, edx
sub ecx, [esi + CURSOR.hot_x]
lea ebx, [ecx+32-1]
mov [x], ecx
sets dl
dec edx
and ecx, edx ;clip x to 0<=x
mov [cur.left], ecx
mov edi, ecx
sub edi, [x]
mov [_dx], edi
 
xor edx, edx
sub eax, [esi + CURSOR.hot_y]
lea edi, [eax+32-1]
mov [y], eax
sets dl
dec edx
and eax, edx ;clip y to 0<=y
mov [cur.top], eax
mov edx, eax
sub edx, [y]
mov [_dy], edx
 
mov [tmp_x], ecx
mov [tmp_y], eax
mov eax, [BPSLine_calc_area+eax*4]
lea edx, [LFB_BASE + eax + ecx*4]
mov [cur_saved_base], edx
 
cmp ebx, [_display.width]
jb @F
mov ebx, [_display.width]
;--------------------------------------
align 4
@@:
cmp edi, [_display.height]
jb @F
mov edi, [_display.height]
;--------------------------------------
align 4
@@:
sub ebx, [x]
sub edi, [y]
sub ebx, [_dx]
sub edi, [_dy]
 
mov [cur.w], ebx
mov [cur.h], edi
mov [h], edi
 
mov eax, edi
mov edi, cur_saved_data
 
xor ecx, ecx
mov eax, ecx
;--------------------------------------
align 4
@@:
; get and save pixel background
push eax ecx ebx edx
add eax, [tmp_x]
mov ebx, ecx
add ebx, [tmp_y]
push edi
 
or ecx, 0x04000000
call [GETPIXEL]
 
pop edi
;and ecx, 0x00ffffff
mov [edi], ecx
add edi, 4
 
pop edx ebx ecx eax
inc eax
cmp eax, [cur.w]
jb @b
xor eax, eax
inc ecx
cmp ecx, [h]
jb @B
 
;draw cursor
mov ebx, [cur_saved_base]
mov eax, [_dy]
shl eax, 5
add eax, [_dx]
 
mov esi, [hcursor]
mov esi, [esi + CURSOR.base]
lea edx, [esi+eax*4]
mov [bg_ptr], cur_saved_data
 
mov [_dy], 0
;--------------------------------------
align 4
.row:
mov [_dx], 0
mov ecx, [cur.w]
mov esi, edx ; cursor image base
mov edi, ebx
add edx, 32*4
add ebx, [_display.lfb_pitch]
;--------------------------------------
align 4
.pix:
; get pixel cursor
lodsd
test eax, 0xFF000000
jz @F
mov [edi], eax
 
pusha
mov edi, 1 ; force
mov ecx, eax ; color
and ecx, 0x00ffffff
or ecx, 0x04000000
mov eax, [x]
mov ebx, [y]
add eax, [_dx]
add ebx, [_dy]
call __sys_putpixel
popa
;--------------------------------------
align 4
@@:
inc [_dx]
add edi, 4
dec ecx
jnz .pix
 
inc [_dy]
dec [h]
jnz .row
ret
endp
 
;------------------------------------------------------------------------------
align 4
check_mouse_area_for_getpixel_new:
; in:
; eax = x
1167,16 → 1390,31
mov [edi + display_t.cr_list.prev], ecx
 
if ~defined UEFI
cmp [SCR_MODE], word 0x13
jbe .fail
cmp [SCR_MODE], word 0x12
jne .not_vga
; TODO
mov ebx, VGA_restore_32
mov ecx, VGA_move_cursor_32
mov edx, VGA_putpixel
jmp .set
 
.not_vga:
test word [SCR_MODE], 0x4000
jz .fail
jnz .not_ega
 
mov ebx, restore_32
mov ecx, move_cursor_32
mov edx, Vesa20_putpixel32_new
mov eax, [_display.bits_per_pixel]
jmp .set
 
.not_ega:
end if
mov ebx, restore_32
mov ecx, move_cursor_32
mov edx, Vesa20_putpixel32_new
mov eax, [_display.bits_per_pixel]
 
cmp al, 32
jne .not_32bpp
 
1184,13 → 1422,11
mov [_display.select_cursor], select_cursor
mov [_display.move_cursor], ecx
mov [_display.restore_cursor], ebx
mov [_display.check_mouse], check_mouse_area_for_putpixel_new
mov [_display.check_m_pixel], check_mouse_area_for_getpixel_new
;mov [_display.check_mouse], check_mouse_area_for_putpixel_new
;mov [_display.check_m_pixel], check_mouse_area_for_getpixel_new
 
cmp [PUTPIXEL], dword VGA_putpixel
je @f
mov [PUTPIXEL], edx
@@:
 
stdcall load_cursor, def_hresize, dword LOAD_FROM_MEM
mov [def_cursor_hresize], eax
stdcall load_cursor, def_vresize, dword LOAD_FROM_MEM
1230,11 → 1466,10
; mov ecx, move_cursor_15
; mov edx, Vesa20_putpixel15_new
; jmp .set
 
.fail:
xor eax, eax
mov [_display.select_cursor], eax
mov [_display.move_cursor], eax
;xor eax, eax
;mov [_display.select_cursor], eax
;mov [_display.move_cursor], eax
ret
;------------------------------------------------------------------------------
align 4
/kernel/trunk/video/framebuffer.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Synhronization for MenuetOS. ;;
99,26 → 99,25
jmp .finish
 
.16bpp:
mov [PUTPIXEL], Vesa20_putpixel16
mov [PUTPIXEL], Vesa20_putpixel16_new
mov [GETPIXEL], Vesa20_getpixel16
mov [_display.bytes_per_pixel], 2
jmp .finish
 
.24bpp:
mov [PUTPIXEL], Vesa20_putpixel24
mov [PUTPIXEL], Vesa20_putpixel24_new
mov [GETPIXEL], Vesa20_getpixel24
mov [_display.bytes_per_pixel], 3
jmp .finish
 
.32bpp:
mov [PUTPIXEL], Vesa20_putpixel32
mov [PUTPIXEL], Vesa20_putpixel32_new
mov [GETPIXEL], Vesa20_getpixel32
mov [_display.bytes_per_pixel], 4
 
.finish:
mov [MOUSE_PICTURE], mousepointer
mov [_display.check_mouse], check_mouse_area_for_putpixel
mov [_display.check_m_pixel], check_mouse_area_for_getpixel
mov [_display.check_mouse], check_mouse_area_for_putpixel_new
mov [_display.check_m_pixel], check_mouse_area_for_getpixel_new
 
mov ax, word [SCR_MODE]
cmp ax, 0x0012
/kernel/trunk/video/vesa20.inc
40,10 → 40,7
 
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
@@:
 
; check mouse area for putpixel
test ecx, 0x04000000 ; don't load to mouseunder area
78,10 → 75,7
 
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
@@:
 
; check mouse area for putpixel
test ecx, 0x04000000 ; don't load to mouseunder area
110,10 → 104,7
 
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
@@:
 
; check mouse area for putpixel
test ecx, 0x04000000 ; don't load to mouseunder area
189,16 → 180,16
mov [putimg.image_cx], eax
mov [putimg.image_cy], edx
; calculate absolute (i.e. screen) coordinates
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
mov ebx, [eax + window_data + WDATA.box.left]
mov eax, [current_slot]
mov eax, [eax + APPDATA.window]
mov ebx, [eax + WDATA.box.left]
add ebx, [putimg.image_cx]
mov [putimg.abs_cx], ebx
mov ebx, [eax +window_data + WDATA.box.top]
mov ebx, [eax + WDATA.box.top]
add ebx, [putimg.image_cy]
mov [putimg.abs_cy], ebx
; real_sx = MIN(wnd_sx-image_cx, image_sx);
mov ebx, [eax + window_data + WDATA.box.width] ; ebx = wnd_sx
mov ebx, [eax + WDATA.box.width] ; ebx = wnd_sx
inc ebx ; WDATA.box.width is one pixel less than real window x-size
sub ebx, [putimg.image_cx]
ja @f
213,7 → 204,7
.end_x:
mov [putimg.real_sx], ebx
; init real_sy
mov ebx, [eax + window_data + WDATA.box.height] ; ebx = wnd_sy
mov ebx, [eax + WDATA.box.height] ; ebx = wnd_sy
inc ebx
sub ebx, [putimg.image_cy]
ja @f
292,8 → 283,7
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je put_image_end_16_new
cmp ecx, 0
je put_image_end_16_old
 
.new_line:
mov ecx, [putimg.real_sx]
.new_x:
340,64 → 330,6
;------------------------------------------------------------------------------
 
align 4
put_image_end_16_old:
 
.new_line:
mov ecx, [putimg.real_sx]
.new_x:
push [putimg.edi]
mov eax, [putimg.ebp + 4]
call eax
cmp [ebp], bl
jne .skip
 
push ecx
neg ecx
add ecx, [putimg.real_sx_and_abs_cx + 4]
shl ecx, 16
add ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
 
; check mouse area for putpixel
call check_mouse_area_for_putpixel
pop ecx
 
; convert to 16 bpp and store to LFB
;; and eax, 00000000111110001111110011111000b
;; shr ah, 2
;; shr ax, 3
;; ror eax, 8
;; add al, ah
;; rol eax, 8
mov [LFB_BASE + edx], ax
.skip:
inc edx
inc edx
inc ebp
dec ecx
jnz .new_x
 
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline]
add ebp, [putimg.winmap_newline]
 
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
@@:
dec edi
jnz .new_line
jmp put_image_end_16.finish
 
;------------------------------------------------------------------------------
 
align 4
put_image_end_16_new:
 
.new_line:
490,8 → 422,7
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je put_image_end_24_new
cmp ecx, 0
je put_image_end_24_old
 
.new_line:
mov ecx, [putimg.real_sx]
.new_x:
536,63 → 467,6
;------------------------------------------------------------------------------
 
align 4
put_image_end_24_old:
 
.new_line:
mov ecx, [putimg.real_sx]
;--------------------------------------
align 4
.new_x:
push [putimg.edi]
mov eax, [putimg.ebp + 4]
call eax
cmp [ebp], bl
jne .skip
 
push ecx
neg ecx
add ecx, [putimg.real_sx_and_abs_cx + 4]
shl ecx, 16
add ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
 
; check mouse area for putpixel
call check_mouse_area_for_putpixel
pop ecx
; store to LFB
mov [LFB_BASE + edx], ax
shr eax, 16
mov [LFB_BASE + edx + 2], al
 
.skip:
add edx, 3
inc ebp
dec ecx
jnz .new_x
 
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline]
add ebp, [putimg.winmap_newline]
 
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
 
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
 
@@:
dec edi
jnz .new_line
jmp put_image_end_24.finish
 
;------------------------------------------------------------------------------
 
align 4
put_image_end_24_new:
 
.new_line:
682,8 → 556,6
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je put_image_end_32_new
cmp ecx, 0
je put_image_end_32_old
 
.new_line:
mov ecx, [putimg.real_sx]
736,59 → 608,6
;------------------------------------------------------------------------------
 
align 4
put_image_end_32_old:
 
.new_line:
mov ecx, [putimg.real_sx]
.new_x:
push [putimg.edi]
mov eax, [putimg.ebp + 4]
call eax
cmp [ebp], bl
jne .skip
 
push ecx
neg ecx
add ecx, [putimg.real_sx_and_abs_cx + 4]
shl ecx, 16
add ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
 
; check mouse area for putpixel
call check_mouse_area_for_putpixel
pop ecx
; store to LFB
mov [LFB_BASE+edx], eax
 
.skip:
add edx, 4
inc ebp
dec ecx
jnz .new_x
 
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline]
add ebp, [putimg.winmap_newline]
 
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
 
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
 
@@:
dec edi
jnz .new_line
jmp put_image_end_32.finish
 
;------------------------------------------------------------------------------
 
align 4
put_image_end_32_new:
 
.new_line:
877,9 → 696,9
 
pushad
cmp eax, [_display.width]
jge .exit
jae .exit
cmp ebx, [_display.height]
jge .exit
jae .exit
test edi, 1 ; force ?
jnz .forced
 
915,41 → 734,6
; ebx = y
 
align 4
Vesa20_putpixel16:
 
mov ecx, eax
shl ecx, 16
mov cx, bx
 
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
mov ebx, [BPSLine_calc_area + ebx*4]
lea edi, [eax*2]; edi = x*2
mov eax, [esp + 32-8+4]
 
; check for hardware cursor
cmp [_display.select_cursor], 0
jne @f
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
call check_mouse_area_for_putpixel
@@:
; store to LFB
and eax, 00000000111110001111110011111000b
shr ah, 2
shr ax, 3
ror eax, 8
add al, ah
rol eax, 8
 
mov [LFB_BASE + ebx + edi], ax
ret
 
;-----------------------------------------------------------------------------
; eax = x
; ebx = y
 
align 4
Vesa20_putpixel16_new:
 
mov ecx, eax
1000,37 → 784,6
; ebx = y
 
align 4
Vesa20_putpixel24:
 
mov ecx, eax
shl ecx, 16
mov cx, bx
 
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
mov ebx, [BPSLine_calc_area + ebx*4]
lea edi, [eax + eax*2]; edi = x*3
mov eax, [esp + 32-8+4]
 
; check for hardware cursor
cmp [_display.select_cursor], 0
jne @f
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
call check_mouse_area_for_putpixel
@@:
 
; store to LFB
mov [LFB_BASE + ebx + edi], ax
shr eax, 16
mov [LFB_BASE + ebx + edi + 2], al
ret
 
;-----------------------------------------------------------------------------
; eax = x
; ebx = y
 
align 4
Vesa20_putpixel24_new:
 
mov ecx, eax
1076,35 → 829,6
; ebx = y
 
align 4
Vesa20_putpixel32:
 
mov ecx, eax
shl ecx, 16
mov cx, bx
 
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
mov ebx, [BPSLine_calc_area+ebx*4]
lea edi, [ebx + eax*4] ; edi = x*4+(y*y multiplier)
mov eax, [esp + 32-8+4] ; eax = color
 
; check for hardware cursor
cmp [_display.select_cursor], 0
jne @f
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
call check_mouse_area_for_putpixel
@@:
and eax, 0xffffff
; store to LFB
mov [LFB_BASE + edi], eax
ret
 
;-----------------------------------------------------------------------------
; eax = x
; ebx = y
 
align 4
Vesa20_putpixel32_new:
 
mov ecx, eax
1402,14 → 1126,14
mov [drbar.bar_sx], ecx
mov [drbar.bar_cx], eax
mov [drbar.bar_cy], ebx
mov edi, [current_slot_idx]
shl edi, BSF sizeof.WDATA
add eax, [edi + window_data + WDATA.box.left] ; win_cx
add ebx, [edi + window_data + WDATA.box.top] ; win_cy
mov edi, [current_slot]
mov edi, [edi + APPDATA.window]
add eax, [edi + WDATA.box.left] ; win_cx
add ebx, [edi + WDATA.box.top] ; win_cy
mov [drbar.abs_cx], eax
mov [drbar.abs_cy], ebx
; real_sx = MIN(wnd_sx-bar_cx, bar_sx);
mov ebx, [edi + window_data + WDATA.box.width] ; ebx = wnd_sx
mov ebx, [edi + WDATA.box.width] ; ebx = wnd_sx
inc ebx ; WDATA.box.width is one pixel less than real window x-size
sub ebx, [drbar.bar_cx]
ja @f
1426,7 → 1150,7
.end_x:
mov [drbar.real_sx], ebx
; real_sy = MIN(wnd_sy-bar_cy, bar_sy);
mov ebx, [edi + window_data + WDATA.box.height] ; ebx = wnd_sy
mov ebx, [edi + WDATA.box.height] ; ebx = wnd_sy
inc ebx
sub ebx, [drbar.bar_cy]
ja @f
1508,8 → 1232,7
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je draw_bar_end_24_new
cmp ecx, 0
je draw_bar_end_24_old
 
.new_y:
mov edi, [drbar.real_sx]
.new_x:
1547,49 → 1270,6
;------------------------------------------------------------------------------
 
align 4
draw_bar_end_24_old:
 
.new_y:
mov edi, [drbar.real_sx]
.new_x:
cmp byte [ebp], bl
jne .skip
 
mov ecx, [drbar.real_sx_and_abs_cx]
sub ecx, edi
shl ecx, 16
add ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
; check mouse area for putpixel
call check_mouse_area_for_putpixel
; store to LFB
mov [edx], ax
shr eax, 16
mov [edx + 2], al
mov eax, [drbar.color]
.skip:
; add pixel
add edx, 3
inc ebp
dec edi
jnz .new_x
; add line
add edx, [drbar.line_inc_scr]
add ebp, [drbar.line_inc_map]
; drawing gradient bars
test bh, 0x80
jz @f
test al, al
jz @f
dec al
@@:
dec esi
jnz .new_y
jmp draw_bar_end_24.end
 
;------------------------------------------------------------------------------
 
align 4
draw_bar_end_24_new:
 
.new_y:
1669,8 → 1349,6
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je draw_bar_end_32_new
cmp ecx, 0
je draw_bar_end_32_old
 
.new_y:
mov edi, [drbar.real_sx]
1713,45 → 1391,6
mov [EGA_counter], 1
ret
 
draw_bar_end_32_old:
 
.new_y:
mov edi, [drbar.real_sx]
.new_x:
cmp byte [ebp], bl
jne .skip
 
mov ecx, [drbar.real_sx_and_abs_cx]
sub ecx, edi
shl ecx, 16
add ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
 
; check mouse area for putpixel
call check_mouse_area_for_putpixel
; store to LFB
mov [edx], eax
mov eax, [drbar.color]
.skip:
; add pixel
add edx, 4
inc ebp
dec edi
jnz .new_x
; add line
add edx, [drbar.line_inc_scr]
add ebp, [drbar.line_inc_map]
; drawing gradient bars
test bh, 0x80
jz @f
test al, al
jz @f
dec al
@@:
dec esi
jnz .new_y
jmp draw_bar_end_32.end
 
;------------------------------------------------------------------------------
 
align 4
1830,8 → 1469,7
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je draw_bar_end_16_new
cmp ecx, 0
je draw_bar_end_16_old
 
.new_y:
mov edi, [drbar.real_sx]
.new_x:
1879,57 → 1517,6
;------------------------------------------------------------------------------
 
align 4
draw_bar_end_16_old:
 
.new_y:
mov edi, [drbar.real_sx]
.new_x:
cmp byte [ebp], bl
jne .skip
 
mov ecx, [drbar.real_sx_and_abs_cx]
sub ecx, edi
shl ecx, 16
add ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
 
; check mouse area for putpixel
call check_mouse_area_for_putpixel
; convert to 16 bpp and store to LFB
and eax, 00000000111110001111110011111000b
shr ah, 2
shr ax, 3
ror eax, 8
add al, ah
rol eax, 8
mov [edx], ax
mov eax, [drbar.color]
.skip:
 
; add pixel
add edx, 2
inc ebp
dec edi
jnz .new_x
 
; add line
add edx, [drbar.line_inc_scr]
add ebp, [drbar.line_inc_map]
 
; drawing gradient bars
test bh, 0x80
jz @f
test al, al
jz @f
dec al
@@:
dec esi
jnz .new_y
jmp draw_bar_end_16.end
 
;------------------------------------------------------------------------------
 
align 4
draw_bar_end_16_new:
 
.new_y:
2077,10 → 1664,8
 
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
@@:
 
and eax, 0xffffff
; check mouse area for putpixel
call [_display.check_mouse]
2271,10 → 1856,8
push ecx
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
@@:
 
mov ecx, [esp+20+4] ;x
shl ecx, 16
add ecx, [esp+24+4] ;y
/kernel/trunk/video/vga.inc
382,12 → 382,9
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
;--------------------------------------
align 4
@@:
push ecx
shl ecx, 16
mov cx, bx
394,6 → 391,7
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
 
call [_display.check_mouse]
;--------------------------------------
align 4
495,10 → 493,10
align 4
VGA_draw_bar_1:
mov [temp.cx], eax
mov eax, [current_slot_idx]
shl eax, BSF sizeof.WDATA
add ebx, [window_data + eax + WDATA.box.top]
mov eax, [window_data + eax + WDATA.box.left]
mov eax, [current_slot]
mov eax, [eax + APPDATA.window]
add ebx, [eax + WDATA.box.top]
mov eax, [eax + WDATA.box.left]
add eax, [temp.cx]
and eax, 0xfff8
shl ebx, 9