Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9940 → Rev 9941

/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