Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 2385 → Rev 2540

/kernel/branches/net/video/arrow_clock.cur
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/kernel/branches/net/video/blitter.inc
1,3 → 1,9
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
struct BLITTER_BLOCK
xmin dd ?
324,9 → 330,6
test eax, eax
jne .L57
 
inc [mouse_pause]
call [_display.disable_mouse]
 
mov eax, [TASK_BASE]
 
mov ebx, [esp+BLITTER.dst_x]
333,10 → 336,20
mov ebp, [esp+BLITTER.dst_y]
add ebx, [eax-twdw + WDATA.box.left]
add ebp, [eax-twdw + WDATA.box.top]
 
mov ecx, ebx
add ecx, [esp+BLITTER.w]
shl ecx, 16
mov cx, bp
add ecx, [esp+BLITTER.h]
 
mov edi, ebp
 
imul edi, [_display.pitch]
imul ebp, [_display.width]
; imul edi, [_display.pitch]
mov edi, [BPSLine_calc_area+edi*4]
; imul ebp, [_display.width]
mov ebp, [d_width_calc_area+ebp*4]
 
add ebp, ebx
add ebp, [_WinMapAddress]
 
346,6 → 359,7
lea esi, [eax+esi*4]
add esi, [esp+BLITTER.bitmap]
 
mov eax, ecx
mov ecx, [esp+BLITTER.h]
mov edx, [esp+BLITTER.w]
 
361,7 → 375,6
lea edi, [edi+ebx*4]
 
mov ebx, [CURRENT_TASK]
 
align 4
.outer32:
xor ecx, ecx
369,11 → 382,39
align 4
.inner32:
cmp [ebp+ecx], bl
jne @F
jne .skip
;--------------------------------------
push eax
mov eax, [esi+ecx*4]
 
mov eax, [esi+ecx*4]
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
;--------------------------------------
align 4
@@:
push ecx
 
mov ecx, [esp+4]
ror ecx, 16
sub ecx, edx
rol ecx, 16
sub ecx, [esp+BLITTER.h + 8]
 
; check mouse area for putpixel
call [_display.check_mouse]
pop ecx
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [LFB_BASE+edi+ecx*4], eax
@@:
pop eax
;--------------------------------------
align 4
.skip:
inc ecx
dec edx
jnz .inner32
387,8 → 428,8
jnz .outer32
 
.done:
dec [mouse_pause]
call [draw_pointer]
; call [draw_pointer]
call __sys_draw_pointer
.L57:
add esp, 72
pop ebx
410,15 → 451,43
align 4
.inner24:
cmp [ebp+ecx], bl
jne @F
 
jne .skip_1
;--------------------------------------
push eax
mov eax, [esi+ecx*4]
 
lea edi, [edi+ecx*2]
 
; 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]
ror ecx, 16
sub ecx, edx
rol ecx, 16
sub ecx, [esp+BLITTER.h + 8]
 
; check mouse area for putpixel
call [_display.check_mouse]
pop ecx
;--------------------------------------
align 4
.no_mouseunder_1:
mov [edi+ecx], ax
shr eax, 16
mov [edi+ecx+2], al
@@:
 
pop eax
;--------------------------------------
align 4
.skip_1:
mov edi, [esp+64]
inc ecx
dec edx
/kernel/branches/net/video/cursors.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26,7 → 26,7
ClrUsed dd ?
ClrImportant dd ?
ends
 
;------------------------------------------------------------------------------
align 4
proc init_cursor stdcall, dst:dword, src:dword
locals
49,7 → 49,8
je .img_8
cmp [esi+BITMAPINFOHEADER.BitCount], 4
je .img_4
 
;--------------------------------------
align 4
.img_2:
add eax, [esi]
mov [pQuad], eax
68,6 → 69,8
mov [rBase], edi
 
mov esi, [pQuad]
;--------------------------------------
align 4
.l21:
mov ebx, [pBits]
mov ebx, [ebx]
76,6 → 79,8
mov eax, [eax]
bswap eax
mov [counter], 32
;--------------------------------------
align 4
@@:
xor edx, edx
shl eax, 1
103,7 → 108,8
sub [height], 1
jnz .l21
ret
 
;--------------------------------------
align 4
.img_4:
add eax, [esi]
mov [pQuad], eax
123,11 → 129,15
 
mov esi, [pQuad]
mov ebx, [pBits]
;--------------------------------------
align 4
.l4:
mov eax, [pAnd]
mov eax, [eax]
bswap eax
mov [counter], 16
;--------------------------------------
align 4
@@:
xor edx, edx
shl eax, 1
168,6 → 178,8
sub [height], 1
jnz .l4
ret
;--------------------------------------
align 4
.img_8:
add eax, [esi]
mov [pQuad], eax
187,11 → 199,15
 
mov esi, [pQuad]
mov ebx, [pBits]
;--------------------------------------
align 4
.l81:
mov eax, [pAnd]
mov eax, [eax]
bswap eax
mov [counter], 32
;--------------------------------------
align 4
@@:
xor edx, edx
shl eax, 1
217,6 → 233,8
sub [height], 1
jnz .l81
ret
;--------------------------------------
align 4
.img_24:
add eax, [esi]
mov [pQuad], eax
234,10 → 252,14
 
mov esi, [pAnd]
mov ebx, [pQuad]
;--------------------------------------
align 4
.row_24:
mov eax, [esi]
bswap eax
mov [counter], 32
;--------------------------------------
align 4
@@:
xor edx, edx
shl eax, 1
263,7 → 285,7
jnz .row_24
ret
endp
 
;------------------------------------------------------------------------------
align 4
proc set_cursor stdcall, hcursor:dword
mov eax, [hcursor]
274,6 → 296,8
mov ebx, [current_slot]
xchg eax, [ebx+APPDATA.cursor]
ret
;--------------------------------------
align 4
.fail:
mov eax, [def_cursor]
mov ebx, [current_slot]
280,7 → 304,8
xchg eax, [ebx+APPDATA.cursor]
ret
endp
 
;------------------------------------------------------------------------------
align 4
; param
; eax= pid
; ebx= src
328,6 → 353,8
 
stdcall init_cursor, eax, esi
 
align 4
.add_cursor:
mov ecx, [.hcursor]
lea ecx, [ecx+CURSOR.list_next]
lea edx, [_display.cr_list.next]
338,7 → 365,6
popfd
 
mov eax, [.hcursor]
.check_hw:
cmp [_display.init_cursor], 0
je .fail
 
347,22 → 373,26
add esp, 4
 
mov eax, [.hcursor]
;--------------------------------------
align 4
.fail:
add esp, 12
ret
;--------------------------------------
align 4
.indirect:
shr ebx, 16
movzx ecx, bh
movzx edx, bl
mov [eax+CURSOR.hot_x], ecx
mov [eax+CURSOR.hot_y], edx
mov [edi+CURSOR.hot_x], ecx
mov [edi+CURSOR.hot_y], edx
 
xchg edi, eax
mov ecx, 1024
cld
rep movsd
jmp .check_hw
 
jmp .add_cursor
;------------------------------------------------------------------------------
align 4
proc load_cursor stdcall, src:dword, flags:dword
locals
381,6 → 411,8
test eax, eax
jz .fail
mov [src], eax
;--------------------------------------
align 4
@@:
push ebx
push esi
397,16 → 429,22
cmp word [flags], LOAD_FROM_FILE
jne .exit
stdcall kernel_free, [src]
;--------------------------------------
align 4
.exit:
pop edi
pop esi
pop ebx
;--------------------------------------
align 4
.fail:
mov eax, [handle]
;--------------------------------------
align 4
.fail2:
ret
endp
 
;------------------------------------------------------------------------------
align 4
proc delete_cursor stdcall, hcursor:dword
locals
433,17 → 471,20
jne @F
mov eax, [def_cursor]
mov [ebx+APPDATA.cursor], eax
;--------------------------------------
align 4
@@:
mov eax, [hcursor]
call [eax+APPOBJ.destroy]
;--------------------------------------
align 4
.fail:
ret
endp
 
;------------------------------------------------------------------------------
align 4
; param
; eax= cursor
 
align 4
destroy_cursor:
 
push eax
460,13 → 501,13
pop eax
call destroy_kernel_object
ret
 
;------------------------------------------------------------------------------
align 4
select_cursor:
mov eax, [esp+4]
mov [_display.cursor], eax
ret 4
 
;------------------------------------------------------------------------------
align 4
proc restore_24 stdcall, x:dword, y:dword
 
484,6 → 525,8
mov ecx, [cur.w]
lea ecx, [ecx+ecx*2]
push ecx
;--------------------------------------
align 4
@@:
mov edi, ebx
add ebx, [BytesPerScanLine]
496,11 → 539,13
pop ecx
pop edi
pop esi
;--------------------------------------
align 4
.ret:
pop ebx
ret
endp
 
;------------------------------------------------------------------------------
align 4
proc restore_32 stdcall, x:dword, y:dword
 
515,6 → 560,8
push edi
 
mov esi, cur_saved_data
;--------------------------------------
align 4
@@:
mov edi, ebx
add ebx, [BytesPerScanLine]
525,12 → 572,14
jnz @B
 
pop edi
;--------------------------------------
align 4
.ret:
pop esi
pop ebx
ret
endp
 
;------------------------------------------------------------------------------
align 4
proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
locals
542,7 → 591,7
mov esi, [hcursor]
mov ecx, [x]
mov eax, [y]
mov ebx, [BytesPerScanLine]
; mov ebx, [BytesPerScanLine]
 
xor edx, edx
sub ecx, [esi+CURSOR.hot_x]
568,7 → 617,8
sub edx, [y]
mov [_dy], edx
 
mul dword [BytesPerScanLine]
; mul dword [BytesPerScanLine]
mov eax, [BPSLine_calc_area+eax*4]
lea edx, [LFB_BASE+ecx*3]
add edx, eax
mov [cur_saved_base], edx
576,10 → 626,14
cmp ebx, [Screen_Max_X]
jbe @F
mov ebx, [Screen_Max_X]
;--------------------------------------
align 4
@@:
cmp edi, [Screen_Max_Y]
jbe @F
mov edi, [Screen_Max_Y]
;--------------------------------------
align 4
@@:
mov [cur.right], ebx
mov [cur.bottom], edi
595,6 → 649,8
 
mov eax, edi
mov edi, cur_saved_data
;--------------------------------------
align 4
@@:
mov esi, edx
add edx, [BytesPerScanLine]
613,6 → 669,8
mov esi, [hcursor]
mov esi, [esi+CURSOR.base]
lea edx, [esi+eax*4]
;--------------------------------------
align 4
.row:
mov ecx, [cur.w]
mov esi, edx
619,6 → 677,8
mov edi, ebx
add edx, 32*4
add ebx, [BytesPerScanLine]
;--------------------------------------
align 4
.pix:
lodsd
test eax, 0xFF000000
626,6 → 686,8
mov [edi], ax
shr eax, 16
mov [edi+2], al
;--------------------------------------
align 4
@@:
add edi, 3
dec ecx
635,8 → 697,7
jnz .row
ret
endp
 
 
;------------------------------------------------------------------------------
align 4
proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
locals
673,7 → 734,8
sub edx, [y]
mov [_dy], edx
 
mul dword [BytesPerScanLine]
; mul dword [BytesPerScanLine]
mov eax, [BPSLine_calc_area+eax*4]
lea edx, [LFB_BASE+eax+ecx*4]
mov [cur_saved_base], edx
 
680,10 → 742,14
cmp ebx, [Screen_Max_X]
jbe @F
mov ebx, [Screen_Max_X]
;--------------------------------------
align 4
@@:
cmp edi, [Screen_Max_Y]
jbe @F
mov edi, [Screen_Max_Y]
;--------------------------------------
align 4
@@:
mov [cur.right], ebx
mov [cur.bottom], edi
699,6 → 765,8
 
mov eax, edi
mov edi, cur_saved_data
;--------------------------------------
align 4
@@:
mov esi, edx
add edx, [BytesPerScanLine]
716,6 → 784,8
mov esi, [hcursor]
mov esi, [esi+CURSOR.base]
lea edx, [esi+eax*4]
;--------------------------------------
align 4
.row:
mov ecx, [cur.w]
mov esi, edx
722,11 → 792,15
mov edi, ebx
add edx, 32*4
add ebx, [BytesPerScanLine]
;--------------------------------------
align 4
.pix:
lodsd
test eax, 0xFF000000
jz @F
mov [edi], eax
;--------------------------------------
align 4
@@:
add edi, 4
dec ecx
736,16 → 810,158
jnz .row
ret
endp
;------------------------------------------------------------------------------
align 4
check_mouse_area_for_getpixel_new:
; in:
; eax = x
; ebx = y
; out:
; ecx = new color
;--------------------------------------
; check for Y
cmp bx, [Y_UNDER_subtraction_CUR_hot_y]
jb .no_mouse_area
 
cmp bx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae .no_mouse_area
;--------------------------------------
; check for X
cmp ax, [X_UNDER_subtraction_CUR_hot_x]
jb .no_mouse_area
 
cmp ax, [X_UNDER_sub_CUR_hot_x_add_curh]
jae .no_mouse_area
;--------------------------------------
push eax ebx
; offset X
mov ecx, [X_UNDER_subtraction_CUR_hot_x]
sub eax, ecx ; x1
; offset Y
mov ecx, [Y_UNDER_subtraction_CUR_hot_y]
sub ebx, ecx ; y1
;--------------------------------------
; ebx = offset y
; eax = offset x
imul ebx, [cur.w] ;y
add eax, ebx
mov ebx, eax
shl eax, 2
cmp [ScreenBPP], byte 32
je @f
sub eax, ebx
;--------------------------------------
align 4
@@:
add eax, cur_saved_data
mov ecx, [eax]
and ecx, 0xffffff
add ecx, 0xff000000
pop ebx eax
ret
;--------------------------------------
align 4
.no_mouse_area:
xor ecx, ecx
ret
;-----------------------------------------------------------------------------
align 4
check_mouse_area_for_putpixel_new:
; in:
; ecx = x shl 16 + y
; eax = color
; out:
; eax = new color
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb .no_mouse_area
 
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae .no_mouse_area
 
rol ecx, 16
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb .no_mouse_area
 
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae .no_mouse_area
;--------------------------------------
align 4
.1:
push eax
; offset X
mov ax, [X_UNDER_subtraction_CUR_hot_x]
sub cx, ax ; x1
ror ecx, 16
; offset Y
mov ax, [Y_UNDER_subtraction_CUR_hot_y]
sub cx, ax ; y1
;--------------------------------------
; ecx = (offset x) shl 16 + (offset y)
push ebx
mov ebx, ecx
shr ebx, 16 ; x
and ecx, 0xffff ; y
; ecx = offset y
; ebx = offset x
mov eax, [esp + 4]
 
push ebx ecx
imul ecx, [cur.w] ;y
add ecx, ebx
mov ebx, ecx
shl ecx, 2
cmp [ScreenBPP], byte 24
je .24
and eax, 0xFFFFFF
mov [ecx + cur_saved_data], eax ;store new color to
jmp @f
;--------------------------------------
align 4
.24:
sub ecx, ebx
mov [ecx + cur_saved_data], ax ;store new color to
shr eax, 16
mov [ecx + cur_saved_data + 2], al ;store new color to
;--------------------------------------
align 4
@@:
pop ecx ebx
 
shl ecx, 5
add ecx, ebx
 
mov eax, [current_cursor]
mov eax, [eax+CURSOR.base]
lea eax, [eax+ecx*4]
mov eax, [eax]
 
pop ebx
 
test eax, 0xFF000000
jz @f
 
pop ecx
ret
;--------------------------------------
align 4
@@:
pop eax
;--------------------------------------
align 4
.no_mouse_area:
ret
;------------------------------------------------------------------------------
align 4
get_display:
mov eax, _display
ret
 
;------------------------------------------------------------------------------
align 4
init_display:
 
xor eax, eax
mov edi, _display
 
764,6 → 980,7
 
test word [SCR_MODE], 0x4000
jz .fail
; jmp .fail
 
mov ebx, restore_32
mov ecx, move_cursor_32
775,22 → 992,47
mov ecx, move_cursor_24
cmp eax, 24
jne .fail
;--------------------------------------
align 4
@@:
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
 
cmp [PUTPIXEL], dword VGA_putpixel
je @f
cmp [ScreenBPP], byte 32
je .32
mov [PUTPIXEL], dword Vesa20_putpixel24_new
jmp @f
;--------------------------------------
align 4
.32:
mov [PUTPIXEL], dword Vesa20_putpixel32_new
;--------------------------------------
align 4
@@:
stdcall load_cursor, clock_arrow, dword LOAD_FROM_MEM
mov [def_cursor_clock], eax
stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
mov [def_cursor], eax
ret
;--------------------------------------
align 4
.fail:
xor eax, eax
mov [_display.select_cursor], eax
mov [_display.move_cursor], eax
ret
 
 
;------------------------------------------------------------------------------
align 4
def_arrow:
file 'arrow.cur'
;------------------------------------------------------------------------------
align 4
clock_arrow:
file 'arrow_clock.cur'
;------------------------------------------------------------------------------
 
/kernel/branches/net/video/vesa12.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; VESA12.INC ;;
/kernel/branches/net/video/vesa20.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; VESA20.INC ;;
31,7 → 31,7
 
 
 
;*************************************************
;-----------------------------------------------------------------------------
; getpixel
;
; in:
40,32 → 40,79
;
; ret:
; ecx = 00 RR GG BB
 
;-----------------------------------------------------------------------------
align 4
getpixel:
push eax ebx edx edi
call dword [GETPIXEL]
pop edi edx ebx eax
ret
 
;-----------------------------------------------------------------------------
align 4
Vesa20_getpixel24:
; eax = x
; ebx = y
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
;--------------------------------------
align 4
@@:
; check mouse area for putpixel
test ecx, 0x04000000 ; don't load to mouseunder area
jnz .no_mouseunder
call [_display.check_m_pixel]
test ecx, ecx ;0xff000000
jnz @f
;--------------------------------------
align 4
.no_mouseunder:
;--------------------------------------
; imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
mov ebx, [BPSLine_calc_area+ebx*4]
lea edi, [eax+eax*2]; edi = x*3
add edi, ebx ; edi = x*3+(y*y multiplier)
mov ecx, [LFB_BASE+edi]
;--------------------------------------
align 4
@@:
and ecx, 0xffffff
ret
 
;-----------------------------------------------------------------------------
align 4
Vesa20_getpixel32:
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
;--------------------------------------
align 4
@@:
; check mouse area for putpixel
test ecx, 0x04000000 ; don't load to mouseunder area
jnz .no_mouseunder
call [_display.check_m_pixel]
test ecx, ecx ;0xff000000
jnz @f
;--------------------------------------
align 4
.no_mouseunder:
;--------------------------------------
; 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 ecx, [LFB_BASE+edi]
;--------------------------------------
align 4
@@:
and ecx, 0xffffff
ret
 
;*************************************************
 
;-----------------------------------------------------------------------------
virtual at esp
putimg:
.real_sx dd ?
80,7 → 127,9
.line_increment dd ?
.winmap_newline dd ?
.screen_newline dd ?
.stack_data = 4*12
.real_sx_and_abs_cx dd ?
.real_sy_and_abs_cy dd ?
.stack_data = 4*14
.edi dd ?
.esi dd ?
.ebp dd ?
92,7 → 141,7
.ret_addr dd ?
.arg_0 dd ?
end virtual
 
;-----------------------------------------------------------------------------
align 16
; ebx = pointer
; ecx = size [x|y]
100,10 → 149,8
; ebp = pointer to 'get' function
; esi = pointer to 'init' function
; edi = parameter for 'get' function
 
vesa20_putimage:
pushad
call [_display.disable_mouse]
sub esp, putimg.stack_data
; save pointer to image
mov [putimg.pti], ebx
138,10 → 185,14
add esp, putimg.stack_data
popad
ret
;--------------------------------------
align 4
@@:
cmp ebx, [putimg.image_sx]
jbe .end_x
mov ebx, [putimg.image_sx]
;--------------------------------------
align 4
.end_x:
mov [putimg.real_sx], ebx
; init real_sy
154,10 → 205,14
add esp, putimg.stack_data
popad
ret
;--------------------------------------
align 4
@@:
cmp ebx, [putimg.image_sy]
jbe .end_y
mov ebx, [putimg.image_sy]
;--------------------------------------
align 4
.end_y:
mov [putimg.real_sy], ebx
; line increment
185,29 → 240,49
mov esi, [putimg.pti]
; pointer to screen
mov edx, [putimg.abs_cy]
imul edx, [BytesPerScanLine]
; imul edx, [BytesPerScanLine]
mov edx, [BPSLine_calc_area+edx*4]
mov eax, [putimg.abs_cx]
movzx ebx, byte [ScreenBPP]
shr ebx, 3
; movzx ebx, byte [ScreenBPP]
; shr ebx, 3
imul eax, ebx
add edx, eax
; pointer to pixel map
mov eax, [putimg.abs_cy]
imul eax, [Screen_Max_X]
add eax, [putimg.abs_cy]
; imul eax, [Screen_Max_X]
; add eax, [putimg.abs_cy]
mov eax, [d_width_calc_area + eax*4]
 
add eax, [putimg.abs_cx]
add eax, [_WinMapAddress]
xchg eax, ebp
;--------------------------------------
mov ecx, [putimg.real_sx]
add ecx, [putimg.abs_cx]
mov [putimg.real_sx_and_abs_cx], ecx
mov ecx, [putimg.real_sy]
add ecx, [putimg.abs_cy]
mov [putimg.real_sy_and_abs_cy], ecx
;--------------------------------------
; get process number
mov ebx, [CURRENT_TASK]
cmp byte [ScreenBPP], 32
je put_image_end_32
;put_image_end_24:
;--------------------------------------
put_image_end_24:
mov edi, [putimg.real_sy]
;--------------------------------------
; check for hardware cursor
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je put_image_end_24_new
cmp ecx, 0
je put_image_end_24_old
;--------------------------------------
align 4
.new_line:
mov ecx, [putimg.real_sx]
; push ebp edx
;--------------------------------------
align 4
.new_x:
push [putimg.edi]
215,21 → 290,23
call eax
cmp [ebp], bl
jne .skip
; mov eax, [esi] ; eax = RRBBGGRR
;--------------------------------------
; store to real LFB
mov [LFB_BASE+edx], ax
shr eax, 16
mov [LFB_BASE+edx+2], al
;--------------------------------------
align 4
.skip:
; add esi, 3 ;[putimg.source_bpp]
add edx, 3
inc ebp
dec ecx
jnz .new_x
; pop edx ebp
 
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline];[BytesPerScanLine]
add ebp, [putimg.winmap_newline];[Screen_Max_X]
; inc ebp
 
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
236,23 → 313,175
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
;--------------------------------------
align 4
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
;--------------------------------------
align 4
@@:
dec edi
jnz .new_line
;--------------------------------------
align 4
.finish:
add esp, putimg.stack_data
popad
ret
;------------------------------------------------------------------------------
align 4
put_image_end_24_old:
;--------------------------------------
align 4
.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 real LFB
mov [LFB_BASE+edx], ax
shr eax, 16
mov [LFB_BASE+edx+2], al
;--------------------------------------
align 4
.skip:
add edx, 3
inc ebp
dec ecx
jnz .new_x
 
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline];[BytesPerScanLine]
add ebp, [putimg.winmap_newline];[Screen_Max_X]
 
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
;--------------------------------------
align 4
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
;--------------------------------------
align 4
@@:
dec edi
jnz .new_line
jmp put_image_end_24.finish
;------------------------------------------------------------------------------
align 4
put_image_end_24_new:
;--------------------------------------
align 4
.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
mov ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb .no_mouse_area
 
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae .no_mouse_area
 
rol ecx, 16
add ecx, [putimg.real_sx_and_abs_cx + 4]
sub ecx, [esp]
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb .no_mouse_area
 
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae .no_mouse_area
;--------------------------------------
; check mouse area for putpixel
call check_mouse_area_for_putpixel_new.1
;--------------------------------------
align 4
.no_mouse_area:
pop ecx
; store to real LFB
mov [LFB_BASE+edx], ax
shr eax, 16
mov [LFB_BASE+edx+2], al
;--------------------------------------
align 4
.skip:
add edx, 3
inc ebp
dec ecx
jnz .new_x
 
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline];[BytesPerScanLine]
add ebp, [putimg.winmap_newline];[Screen_Max_X]
 
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
;--------------------------------------
align 4
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
;--------------------------------------
align 4
@@:
dec edi
jnz .new_line
jmp put_image_end_24.finish
;------------------------------------------------------------------------------
align 4
put_image_end_32:
mov edi, [putimg.real_sy]
;--------------------------------------
; check for hardware cursor
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je put_image_end_32_new
cmp ecx, 0
je put_image_end_32_old
;--------------------------------------
align 4
.new_line:
mov ecx, [putimg.real_sx]
; push ebp edx
;--------------------------------------
align 4
.new_x:
push [putimg.edi]
260,19 → 489,21
call eax
cmp [ebp], bl
jne .skip
; mov eax, [esi] ; ecx = RRBBGGRR
;--------------------------------------
; store to real LFB
mov [LFB_BASE+edx], eax
;--------------------------------------
align 4
.skip:
; add esi, [putimg.source_bpp]
add edx, 4
inc ebp
dec ecx
jnz .new_x
; pop edx ebp
 
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline];[BytesPerScanLine]
add ebp, [putimg.winmap_newline];[Screen_Max_X]
; inc ebp
 
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
279,27 → 510,171
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
;--------------------------------------
align 4
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
;--------------------------------------
align 4
@@:
dec edi
jnz .new_line
;--------------------------------------
align 4
.finish:
add esp, putimg.stack_data
popad
cmp [SCR_MODE], dword 0x12
jne @f
call VGA__putimage
;--------------------------------------
align 4
@@:
mov [EGA_counter], 1
ret
;------------------------------------------------------------------------------
align 4
put_image_end_32_old:
;--------------------------------------
align 4
.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 real LFB
mov [LFB_BASE+edx], eax
;--------------------------------------
align 4
.skip:
add edx, 4
inc ebp
dec ecx
jnz .new_x
 
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline];[BytesPerScanLine]
add ebp, [putimg.winmap_newline];[Screen_Max_X]
 
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
;--------------------------------------
align 4
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
;--------------------------------------
align 4
@@:
dec edi
jnz .new_line
jmp put_image_end_32.finish
;------------------------------------------------------------------------------
align 4
put_image_end_32_new:
;--------------------------------------
align 4
.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
mov ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb .no_mouse_area
 
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae .no_mouse_area
 
rol ecx, 16
add ecx, [putimg.real_sx_and_abs_cx + 4]
sub ecx, [esp]
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb .no_mouse_area
 
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae .no_mouse_area
;--------------------------------------
; check mouse area for putpixel
call check_mouse_area_for_putpixel_new.1
;--------------------------------------
align 4
.no_mouse_area:
pop ecx
; store to real LFB
mov [LFB_BASE+edx], eax
;--------------------------------------
align 4
.skip:
add edx, 4
inc ebp
dec ecx
jnz .new_x
 
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline];[BytesPerScanLine]
add ebp, [putimg.winmap_newline];[Screen_Max_X]
 
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
;--------------------------------------
align 4
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
;--------------------------------------
align 4
@@:
dec edi
jnz .new_line
jmp put_image_end_32.finish
;------------------------------------------------------------------------------
align 4
__sys_putpixel:
 
; eax = x coordinate
; ebx = y coordinate
; ecx = ?? RR GG BB ; 0x01000000 negation
; 0x02000000 used for draw_rectangle without top line
; for example drawwindow_III and drawwindow_IV
; edi = 0x00000001 force
 
;;; mov [novesachecksum], dword 0
312,72 → 687,197
jnz .forced
 
; not forced:
 
push eax
mov edx, [_display.width]; screen x size
imul edx, ebx
add eax, [_WinMapAddress]
mov edx, [d_width_calc_area + ebx*4]
add edx, [_WinMapAddress]
movzx edx, byte [eax+edx]
cmp edx, [CURRENT_TASK]
pop eax
jne .exit
 
;--------------------------------------
align 4
.forced:
; check if negation
test ecx, 0x01000000
jz .noneg
 
call getpixel
not ecx
 
rol ecx, 8
mov cl, [esp+32-8+3]
ror ecx, 8
mov [esp+32-8], ecx
;--------------------------------------
align 4
.noneg:
; OK to set pixel
call dword [PUTPIXEL]; call the real put_pixel function
;--------------------------------------
align 4
.exit:
popad
ret
 
;-----------------------------------------------------------------------------
align 4
Vesa20_putpixel24:
; eax = x
; ebx = y
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
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
;--------------------------------------
align 4
@@:
; store to real LFB
mov [LFB_BASE+ebx+edi], ax
shr eax, 16
mov [LFB_BASE+ebx+edi+2], al
ret
;-----------------------------------------------------------------------------
align 4
Vesa20_putpixel24_new:
; eax = x
; ebx = y
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], select_cursor
jne @f
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb @f
 
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae @f
 
rol ecx, 16
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb @f
 
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae @f
 
call check_mouse_area_for_putpixel_new.1
;--------------------------------------
align 4
@@:
; store to real LFB
mov [LFB_BASE+ebx+edi], ax
shr eax, 16
mov [LFB_BASE+ebx+edi+2], al
ret
;-----------------------------------------------------------------------------
align 4
Vesa20_putpixel32:
; eax = x
; ebx = y
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
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
;--------------------------------------
align 4
@@:
and eax, 0xffffff
; store to real LFB
mov [LFB_BASE+edi], eax
ret
;-----------------------------------------------------------------------------
align 4
Vesa20_putpixel32_new:
; eax = x
; ebx = y
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], select_cursor
jne @f
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb @f
 
;align 4
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae @f
 
rol ecx, 16
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb @f
 
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae @f
 
call check_mouse_area_for_putpixel_new.1
;--------------------------------------
align 4
@@:
and eax, 0xffffff
; store to real LFB
mov [LFB_BASE+edi], eax
ret
;-----------------------------------------------------------------------------
align 4
calculate_edi:
mov edi, ebx
imul edi, [Screen_Max_X]
add edi, ebx
; mov edi, ebx
; imul edi, [Screen_Max_X]
; add edi, ebx
mov edi, [d_width_calc_area + ebx*4]
add edi, eax
ret
 
;*************************************************
 
;-----------------------------------------------------------------------------
; DRAWLINE
 
;-----------------------------------------------------------------------------
align 4
__sys_draw_line:
; inc [mouse_pause]
call [_display.disable_mouse]
 
; draw a line
; eax = HIWORD = x1
; LOWORD = x2
414,8 → 914,12
call vline
push edx ; necessary to rightly restore stack frame at .exit
jmp .exit
;--------------------------------------
align 4
.x2lx1:
neg esi ; get esi absolute value
;--------------------------------------
align 4
.no_vline:
; checking y-axis...
sub ebp, ebx ; ebp = y2-y1
425,9 → 929,12
mov edx, [dl_x2]; else (if y1=y2)
call hline
jmp .exit
 
;--------------------------------------
align 4
.y2ly1:
neg ebp ; get ebp absolute value
;--------------------------------------
align 4
.no_hline:
cmp ebp, esi
jle .x_rules ; |y2-y1| < |x2-x1| ?
440,6 → 947,8
mov edx, [dl_y2]
mov [dl_y2], ebx
mov [dl_y1], edx
;--------------------------------------
align 4
.no_reverse1:
mov eax, [dl_dx]
cdq ; extend eax sing to edx
451,6 → 960,8
cmp ebp, edx
jb @f
inc eax
;--------------------------------------
align 4
@@:
;--------------------------------------
mov edx, ebp ; edx = counter (number of pixels to draw)
457,7 → 968,8
mov ebp, 1 *65536; <<16 ; ebp = dy = 1.0
mov esi, eax ; esi = dx
jmp .y_rules
 
;--------------------------------------
align 4
.x_rules:
cmp [dl_x2], eax ; make sure x1 is at the begining
jge .no_reverse2
468,6 → 980,8
mov edx, [dl_y2]
mov [dl_y2], ebx
mov [dl_y1], edx
;--------------------------------------
align 4
.no_reverse2:
xor edx, edx
mov eax, [dl_dy]
480,16 → 994,22
cmp esi, edx
jb @f
inc eax
;--------------------------------------
align 4
@@:
;--------------------------------------
mov edx, esi ; edx = counter (number of pixels to draw)
mov esi, 1 *65536;<< 16 ; esi = dx = 1.0
mov ebp, eax ; ebp = dy
;--------------------------------------
align 4
.y_rules:
mov eax, [dl_x1]
mov ebx, [dl_y1]
shl eax, 16
shl ebx, 16
 
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
;-----------------------------------------------------------------------------
align 4
.draw:
499,6 → 1019,8
test ah, 0x80
jz @f
add eax, 1 shl 16
;--------------------------------------
align 4
@@:
;--------------------------------------
shr eax, 16
507,10 → 1029,14
test bh, 0x80
jz @f
add ebx, 1 shl 16
;--------------------------------------
align 4
@@:
;--------------------------------------
shr ebx, 16
call [putpixel]
; and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel]
call __sys_putpixel
pop ebx eax
add ebx, ebp ; y = y+dy
add eax, esi ; x = x+dx
519,15 → 1045,18
; force last drawn pixel to be at (x2,y2)
mov eax, [dl_x2]
mov ebx, [dl_y2]
call [putpixel]
; and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; call [putpixel]
call __sys_putpixel
;--------------------------------------
align 4
.exit:
add esp, 6*4
popa
; dec [mouse_pause]
call [draw_pointer]
; call [draw_pointer]
ret
 
 
;------------------------------------------------------------------------------
align 4
hline:
; draw an horizontal line
; eax = x1
539,16 → 1068,22
cmp edx, eax ; make sure x2 is above x1
jge @f
xchg eax, edx
;--------------------------------------
align 4
@@:
call [putpixel]
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
;--------------------------------------
align 4
@@:
; call [putpixel]
call __sys_putpixel
inc eax
cmp eax, edx
jle @b
pop edx eax
ret
 
 
;------------------------------------------------------------------------------
align 4
vline:
; draw a vertical line
; eax = x
560,19 → 1095,22
cmp edx, ebx ; make sure y2 is above y1
jge @f
xchg ebx, edx
;--------------------------------------
align 4
@@:
call [putpixel]
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
;--------------------------------------
align 4
@@:
; call [putpixel]
call __sys_putpixel
inc ebx
cmp ebx, edx
jle @b
pop edx ebx
ret
 
 
;*************************************************
 
 
;------------------------------------------------------------------------------
align 4
virtual at esp
drbar:
.bar_sx dd ?
586,9 → 1124,11
.color dd ?
.line_inc_scr dd ?
.line_inc_map dd ?
.stack_data = 4*11
.real_sx_and_abs_cx dd ?
.real_sy_and_abs_cy dd ?
.stack_data = 4*13
end virtual
 
;--------------------------------------
align 4
; eax cx
; ebx cy
597,7 → 1137,6
; edi color
vesa20_drawbar:
pushad
call [_display.disable_mouse]
sub esp, drbar.stack_data
mov [drbar.color], edi
sub edx, ebx
621,6 → 1160,8
; \end{diamond}[20.08.2006]
sub ebx, [drbar.bar_cx]
ja @f
;--------------------------------------
align 4
.exit: ;// mike.dld, 2005-01-29
add esp, drbar.stack_data
popad
627,10 → 1168,14
xor eax, eax
inc eax
ret
;--------------------------------------
align 4
@@:
cmp ebx, [drbar.bar_sx]
jbe .end_x
mov ebx, [drbar.bar_sx]
;--------------------------------------
align 4
.end_x:
mov [drbar.real_sx], ebx
; real_sy = MIN(wnd_sy-bar_cy, bar_sy);
645,10 → 1190,14
xor eax, eax
inc eax
ret
;--------------------------------------
align 4
@@:
cmp ebx, [drbar.bar_sy]
jbe .end_y
mov ebx, [drbar.bar_sy]
;--------------------------------------
align 4
.end_y:
mov [drbar.real_sy], ebx
; line_inc_map
666,45 → 1215,71
mov [drbar.line_inc_scr], eax
; pointer to screen
mov edx, [drbar.abs_cy]
imul edx, [BytesPerScanLine]
; imul edx, [BytesPerScanLine]
mov edx, [BPSLine_calc_area+edx*4]
mov eax, [drbar.abs_cx]
; movzx ebx, byte [ScreenBPP]
; shr ebx, 3
imul eax, ebx
add edx, eax
; pointer to pixel map
mov eax, [drbar.abs_cy]
imul eax, [Screen_Max_X]
add eax, [drbar.abs_cy]
; imul eax, [Screen_Max_X]
; add eax, [drbar.abs_cy]
mov eax, [d_width_calc_area + eax*4]
 
add eax, [drbar.abs_cx]
add eax, [_WinMapAddress]
xchg eax, ebp
;--------------------------------------
mov ebx, [drbar.real_sx]
add ebx, [drbar.abs_cx]
mov [drbar.real_sx_and_abs_cx], ebx
mov ebx, [drbar.real_sy]
add ebx, [drbar.abs_cy]
mov [drbar.real_sy_and_abs_cy], ebx
 
add edx, LFB_BASE
;--------------------------------------
; get process number
mov ebx, [CURRENT_TASK]
mov ebx, [CURRENT_TASK] ; bl - process num
mov esi, [drbar.real_sy]
mov eax, [drbar.color] ; BBGGRR00
rol eax, 8
mov bh, al ; 0x80 drawing gradient bars
ror eax, 8
cmp byte [ScreenBPP], 24
jne draw_bar_end_32
;--------------------------------------
align 4
draw_bar_end_24:
mov eax, [drbar.color] ;; BBGGRR00
mov bh, al ;; bh = BB
shr eax, 8 ;; eax = RRGG
; eax - color high RRGG
; eax - color high RRGGBB
; bl - process num
; bh - color low BB
; ecx - temp
; edx - pointer to screen
; esi - counter
; edi - counter
mov esi, [drbar.real_sy]
;--------------------------------------
; check for hardware cursor
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je draw_bar_end_24_new
cmp ecx, 0
je draw_bar_end_24_old
;--------------------------------------
align 4
.new_y:
mov edi, [drbar.real_sx]
;--------------------------------------
align 4
.new_x:
cmp byte [ebp], bl
jne .skip
 
mov [LFB_BASE+edx], bh
mov [LFB_BASE+edx + 1], ax
;--------------------------------------
; store to real LFB
mov [edx], ax
shr eax, 16
mov [edx + 2], al
;--------------------------------------
align 4
.skip:
; add pixel
add edx, 3
714,33 → 1289,176
; add line
add edx, [drbar.line_inc_scr]
add ebp, [drbar.line_inc_map]
; <Ivan 15.10.04> drawing gradient bars
test eax, 0x00800000
; drawing gradient bars
test bh, 0x80
jz @f
test bh, bh
test al, al
jz @f
dec bh
dec al
;--------------------------------------
align 4
@@:
; </Ivan 15.10.04>
dec esi
jnz .new_y
;--------------------------------------
align 4
.end:
add esp, drbar.stack_data
popad
xor eax, eax
ret
;------------------------------------------------------------------------------
align 4
draw_bar_end_24_old:
;--------------------------------------
align 4
.new_y:
mov edi, [drbar.real_sx]
;--------------------------------------
align 4
.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 real LFB
mov [edx], ax
shr eax, 16
mov [edx + 2], al
mov eax, [drbar.color]
;--------------------------------------
align 4
.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
;--------------------------------------
align 4
@@:
dec esi
jnz .new_y
jmp draw_bar_end_24.end
;------------------------------------------------------------------------------
align 4
draw_bar_end_24_new:
;--------------------------------------
align 4
.new_y:
mov edi, [drbar.real_sx]
;--------------------------------------
align 4
.new_x:
cmp byte [ebp], bl
jne .skip
;--------------------------------------
mov ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb .no_mouse_area
 
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae .no_mouse_area
 
rol ecx, 16
add ecx, [drbar.real_sx_and_abs_cx]
sub ecx, edi
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb .no_mouse_area
 
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae .no_mouse_area
;--------------------------------------
; check mouse area for putpixel
push eax
call check_mouse_area_for_putpixel_new.1
mov [edx], ax
shr eax, 16
mov [edx + 2], al
pop eax
jmp .skip
; store to real LFB
;--------------------------------------
align 4
.no_mouse_area:
mov [edx], ax
ror eax, 16
mov [edx + 2], al
rol eax, 16
;--------------------------------------
align 4
.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
;--------------------------------------
align 4
@@:
dec esi
jnz .new_y
jmp draw_bar_end_24.end
;------------------------------------------------------------------------------
align 4
draw_bar_end_32:
mov eax, [drbar.color] ;; BBGGRR00
mov esi, [drbar.real_sy]
; eax - color high RRGGBB
; bl - process num
; ecx - temp
; edx - pointer to screen
; esi - counter
; edi - counter
;--------------------------------------
; check for hardware cursor
mov ecx, [_display.select_cursor]
cmp ecx, select_cursor
je draw_bar_end_32_new
cmp ecx, 0
je draw_bar_end_32_old
;--------------------------------------
align 4
.new_y:
mov edi, [drbar.real_sx]
;--------------------------------------
align 4
.new_x:
cmp byte [ebp], bl
jne .skip
 
mov [LFB_BASE+edx], eax
;--------------------------------------
; store to real LFB
mov [edx], eax
mov eax, [drbar.color]
;--------------------------------------
align 4
.skip:
; add pixel
add edx, 4
750,35 → 1468,161
; add line
add edx, [drbar.line_inc_scr]
add ebp, [drbar.line_inc_map]
; <Ivan 15.10.04> drawing gradient bars
test eax, 0x80000000
; drawing gradient bars
test bh, 0x80
jz @f
test al, al
jz @f
dec al
;--------------------------------------
align 4
@@:
; </Ivan 15.10.04>
dec esi
jnz .new_y
;--------------------------------------
align 4
.end:
add esp, drbar.stack_data
popad
cmp [SCR_MODE], dword 0x12
jne @f
call VGA_draw_bar
;--------------------------------------
align 4
@@:
xor eax, eax
mov [EGA_counter], 1
ret
;------------------------------------------------------------------------------
align 4
draw_bar_end_32_old:
;--------------------------------------
align 4
.new_y:
mov edi, [drbar.real_sx]
;--------------------------------------
align 4
.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 real LFB
mov [edx], eax
mov eax, [drbar.color]
;--------------------------------------
align 4
.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
;--------------------------------------
align 4
@@:
dec esi
jnz .new_y
jmp draw_bar_end_32.end
;------------------------------------------------------------------------------
align 4
draw_bar_end_32_new:
;--------------------------------------
align 4
.new_y:
mov edi, [drbar.real_sx]
;--------------------------------------
align 4
.new_x:
cmp byte [ebp], bl
jne .skip
;--------------------------------------
mov ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb .no_mouse_area
 
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae .no_mouse_area
 
rol ecx, 16
add ecx, [drbar.real_sx_and_abs_cx]
sub ecx, edi
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb .no_mouse_area
 
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae .no_mouse_area
;--------------------------------------
; check mouse area for putpixel
push eax
call check_mouse_area_for_putpixel_new.1
mov [edx], eax
pop eax
jmp .skip
; store to real LFB
;--------------------------------------
align 4
.no_mouse_area:
mov [edx], eax
;--------------------------------------
align 4
.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
;--------------------------------------
align 4
@@:
dec esi
jnz .new_y
jmp draw_bar_end_32.end
;------------------------------------------------------------------------------
align 4
vesa20_drawbackground_tiled:
call [_display.disable_mouse]
pushad
; External loop for all y from start to end
mov ebx, [draw_data+32+RECT.top] ; y start
;--------------------------------------
align 4
dp2:
mov ebp, [draw_data+32+RECT.left] ; x start
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
; and LFB data (output for our function) [edi]
mov eax, [BytesPerScanLine]
mul ebx
; mov eax, [BytesPerScanLine]
; mul ebx
mov eax, [BPSLine_calc_area+ebx*4]
xchg ebp, eax
add ebp, eax
add ebp, eax
786,6 → 1630,8
cmp [ScreenBPP], byte 24 ; 24 or 32 bpp ? - x size
jz @f
add ebp, eax
;--------------------------------------
align 4
@@:
add ebp, LFB_BASE
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
819,16 → 1665,47
; edx = 1
; esi -> bgr memory, edi -> output
; ebp = offset in WinMapAddress
;--------------------------------------
align 4
dp3:
cmp [ebp], dl
jnz nbgp
movsb
movsb
movsb
jmp @f
;--------------------------------------
push eax ecx
 
mov ecx, eax
shl ecx, 16
add ecx, ebx
 
mov eax, [esi]
 
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
;--------------------------------------
align 4
@@:
and eax, 0xffffff
; check mouse area for putpixel
call [_display.check_mouse]
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [edi], ax
shr eax, 16
mov [edi+2], al
 
pop ecx eax
;--------------------------------------
align 4
nbgp:
add esi, 3
add edi, 3
;--------------------------------------
align 4
@@:
cmp [ScreenBPP], byte 25 ; 24 or 32 bpp?
sbb edi, -1 ; +1 for 32 bpp
845,6 → 1722,8
sub esi, ecx
sub esi, ecx
jmp dp3
;--------------------------------------
align 4
dp4:
; next scan line
inc ebx
852,14 → 1731,16
jbe dp2
popad
mov [EGA_counter], 1
cmp [SCR_MODE], dword 0x12
jne @f
call VGA_drawbackground
;--------------------------------------
align 4
@@:
ret
 
; ----------
 
 
;------------------------------------------------------------------------------
align 4
vesa20_drawbackground_stretch:
call [_display.disable_mouse]
pushad
; Helper variables
; calculate 2^32*(BgrDataWidth-1) mod (ScreenWidth-1)
885,8 → 1766,9
mov ebp, [draw_data+32+RECT.left] ; x start
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
; and LFB data (output for our function) [edi]
mov eax, [BytesPerScanLine]
mul ebx
; mov eax, [BytesPerScanLine]
; mul ebx
mov eax, [BPSLine_calc_area+ebx*4]
xchg ebp, eax
add ebp, eax
add ebp, eax
894,6 → 1776,8
cmp [ScreenBPP], byte 24 ; 24 or 32 bpp ? - x size
jz @f
add ebp, eax
;--------------------------------------
align 4
@@:
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
call calculate_edi
924,6 → 1808,8
push edx
push esi
; 3) Smooth horizontal
;--------------------------------------
align 4
bgr_resmooth0:
mov ecx, [esp+8]
mov edx, [esp+4]
931,6 → 1817,8
push edi
mov edi, bgr_cur_line
call smooth_line
;--------------------------------------
align 4
bgr_resmooth1:
mov eax, [esp+16+4]
inc eax
944,8 → 1832,12
add esi, [BgrDataWidth]
mov edi, bgr_next_line
call smooth_line
;--------------------------------------
align 4
bgr.no2nd:
pop edi
;--------------------------------------
align 4
sdp3:
xor esi, esi
mov ecx, [esp+12]
961,6 → 1853,8
; precalculated constants:
; qword [esp+28] = 2^32*(BgrDataHeight-1)/(ScreenHeight-1)
; qword [esp+36] = 2^32*(BgrDataWidth-1)/(ScreenWidth-1)
;--------------------------------------
align 4
sdp3a:
mov eax, [_WinMapAddress]
cmp [ebp+eax], byte 1
970,12 → 1864,33
jz .novert
mov ebx, [bgr_next_line+esi]
call [overlapping_of_points_ptr]
;--------------------------------------
align 4
.novert:
 
push ecx
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
;--------------------------------------
align 4
@@:
mov ecx, [esp+20+4] ;x
shl ecx, 16
add ecx, [esp+24+4] ;y
; check mouse area for putpixel
call [_display.check_mouse]
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [LFB_BASE+edi], ax
shr eax, 16
 
mov [LFB_BASE+edi+2], al
pop ecx
;--------------------------------------
align 4
snbgp:
cmp [ScreenBPP], byte 25
sbb edi, -4
986,6 → 1901,8
add esi, 4
cmp eax, [draw_data+32+RECT.right]
jbe sdp3a
;--------------------------------------
align 4
sdp4:
; next y
mov ebx, [esp+24]
1004,6 → 1921,8
cmp [ScreenBPP], byte 24
jz @f
sub edi, eax
;--------------------------------------
align 4
@@:
add edi, [BytesPerScanLine]
; restore ecx,edx; advance esi to next background line
1030,19 → 1949,29
inc ecx
rep movsd
jmp bgr_resmooth1
;--------------------------------------
align 4
sdpdone:
add esp, 44
popad
mov [EGA_counter], 1
cmp [SCR_MODE], dword 0x12
jne @f
call VGA_drawbackground
;--------------------------------------
align 4
@@:
ret
 
uglobal
;--------------------------------------
align 4
bgr_cur_line rd 1920 ; maximum width of screen
bgr_next_line rd 1920
;--------------------------------------
endg
 
;--------------------------------------
align 4
smooth_line:
mov al, [esi+2]
shl eax, 16
1052,6 → 1981,8
mov ebx, [esi+2]
shr ebx, 8
call [overlapping_of_points_ptr]
;--------------------------------------
align 4
@@:
stosd
mov eax, [esp+20+8]
1066,11 → 1997,13
lea eax, [eax*3]
sub esi, eax
jmp smooth_line
;--------------------------------------
align 4
@@:
mov eax, [draw_data+32+RECT.left]
mov [esp+20+8], eax
ret
 
;------------------------------------------------------------------------------
align 16
overlapping_of_points:
if 0
1135,18 → 2068,25
end if
 
iglobal
;--------------------------------------
align 4
overlapping_of_points_ptr dd overlapping_of_points
;--------------------------------------
endg
 
;------------------------------------------------------------------------------
align 4
init_background:
mov edi, BgrAuxTable
xor edx, edx
;--------------------------------------
align 4
.loop2:
mov eax, edx
shl eax, 8
neg eax
mov ecx, 0x200
;--------------------------------------
align 4
.loop1:
mov byte [edi], ah
inc edi
1157,9 → 2097,11
test byte [cpu_caps+(CAPS_MMX/8)], 1 shl (CAPS_MMX mod 8)
jz @f
mov [overlapping_of_points_ptr], overlapping_of_points_mmx
;--------------------------------------
align 4
@@:
ret
 
;------------------------------------------------------------------------------
align 16
overlapping_of_points_mmx:
movd mm0, eax
1179,3 → 2121,4
paddb mm4, mm1
movd eax, mm4
ret
;------------------------------------------------------------------------------
/kernel/branches/net/video/vga.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; VGA.INC ;;
13,7 → 13,8
 
$Revision$
 
 
;------------------------------------------------------------------------------
align 4
paletteVGA:
 
;16 colour palette
24,9 → 25,9
mov ecx, 16
mov dx, 0x3c9
xor eax, eax
 
;--------------------------------------
align 4
palvganew:
 
mov al, 0
test ah, 4
jz palvgalbl1
34,6 → 35,8
test ah, 8
jz palvgalbl1
add al, 32
;--------------------------------------
align 4
palvgalbl1:
out dx, al; red 0,31 or 63
mov al, 0
43,6 → 46,8
test ah, 8
jz palvgalbl2
add al, 32
;--------------------------------------
align 4
palvgalbl2:
out dx, al; blue 0,31 or 63
mov al, 0
52,6 → 57,8
test ah, 8
jz palvgalbl3
add al, 32
;--------------------------------------
align 4
palvgalbl3:
out dx, al; green 0,31 or 63
add ah, 1
60,9 → 67,9
; mov ax, 0005h
; out dx, ax
ret
 
;------------------------------------------------------------------------------
align 4
palette320x200:
 
mov edx, 0x3c8
xor eax, eax
out dx, al
69,16 → 76,21
mov ecx, 256
mov edx, 0x3c9
xor eax, eax
 
;--------------------------------------
align 4
palnew:
mov al, 0
test ah, 64
jz pallbl1
add al, 21
;--------------------------------------
align 4
pallbl1:
test ah, 128
jz pallbl2
add al, 42
;--------------------------------------
align 4
pallbl2:
out dx, al
mov al, 0
85,14 → 97,20
test ah, 8
jz pallbl3
add al, 8
;--------------------------------------
align 4
pallbl3:
test ah, 16
jz pallbl4
add al, 15
;--------------------------------------
align 4
pallbl4:
test ah, 32
jz pallbl5
add al, 40
;--------------------------------------
align 4
pallbl5:
out dx, al
mov al, 0
99,20 → 117,26
test ah, 1
jz pallbl6
add al, 8
;--------------------------------------
align 4
pallbl6:
test ah, 2
jz pallbl7
add al, 15
;--------------------------------------
align 4
pallbl7:
test ah, 4
jz pallbl8
add al, 40
;--------------------------------------
align 4
pallbl8:
out dx, al
add ah, 1
loop palnew
 
ret
;------------------------------------------------------------------------------
align 4
uglobal
novesachecksum dd 0x0
123,13 → 147,12
temp:
.cx dd 0
endg
;------------------------------------------------------------------------------
align 4
checkVga_N13:
 
cmp [SCR_MODE], dword 0x13
jne @f
 
; cnvl:
pushad
cmp [EGA_counter], 1
je novesal
137,9 → 160,12
cmp ecx, [novesachecksum]
jne novesal
popad
;--------------------------------------
align 4
@@:
ret
 
;--------------------------------------
align 4
novesal:
mov [novesachecksum], ecx
mov ecx, 0
147,10 → 173,14
cmp eax, 100
jge m13l3
mov eax, 100
;--------------------------------------
align 4
m13l3:
cmp eax, 480-100
jbe m13l4
mov eax, 480-100
;--------------------------------------
align 4
m13l4:
sub eax, 100
imul eax, 640*4
159,10 → 189,14
cmp eax, 160
jge m13l1
mov eax, 160
;--------------------------------------
align 4
m13l1:
cmp eax, 640-160
jbe m13l2
mov eax, 640-160
;--------------------------------------
align 4
m13l2:
sub eax, 160
shl eax, 2
173,6 → 207,8
mov edx, 200
mov ecx, 320
cld
;--------------------------------------
align 4
m13pix:
lodsd
test eax, eax
188,6 → 224,8
and ebx, (128+64)*256*256; red
shr ebx, 8+8
add eax, ebx
;--------------------------------------
align 4
.save_pixel:
stosb
loop m13pix
198,16 → 236,17
mov [EGA_counter], 0
popad
ret
 
;------------------------------------------------------------------------------
align 4
VGA_drawbackground:
; draw all
cmp [SCR_MODE], dword 0x12
jne .end
pushad
mov esi, [LFBAddress]
mov edi, VGABasePtr
mov ebx, 640/32; 640*480/(8*4)
mov edx, 480
;--------------------------------------
align 4
@@:
push ebx edx esi edi
shl edx, 9
221,9 → 260,9
jnz @r
call VGA_draw_long_line_1
popad
.end:
ret
 
;------------------------------------------------------------------------------
align 4
VGA_draw_long_line:
mov dx, 3ceh
mov ax, 0ff08h
231,6 → 270,8
out dx, ax
mov ax, 0005h
out dx, ax
;--------------------------------------
align 4
m12pix:
call VGA_draw_32_pixels
dec ebx
246,7 → 287,8
out dx, al
sti
ret
 
;------------------------------------------------------------------------------
align 4
VGA_draw_32_pixels:
xor eax, eax
mov ebp, VGA_8_pixels
255,8 → 297,12
mov [ebp+8], eax
mov [ebp+12], eax
mov ch, 4
;--------------------------------------
align 4
.main_loop:
mov cl, 8
;--------------------------------------
align 4
.convert_pixels_to_VGA:
lodsd ; eax = 24bit colour
test eax, eax
273,6 → 319,8
cmp al, 170
jbe .p13green
or [ebp+12], ch
;--------------------------------------
align 4
.p13green:
cmp ah, 85
jbe .p13red
280,6 → 328,8
cmp ah, 170
jbe .p13red
or [ebp+12], ch
;--------------------------------------
align 4
.p13red:
shr eax, 8
cmp ah, 85
288,10 → 338,14
cmp ah, 170
jbe .p13cont
or [ebp+12], ch
;--------------------------------------
align 4
.p13cont:
ror eax, 8
mov ch, ah
inc cl
;--------------------------------------
align 4
.end:
dec cl
jnz .convert_pixels_to_VGA
303,6 → 357,8
mov esi, ebp
mov dx, 3c4h
mov ah, 1h
;--------------------------------------
align 4
@@:
mov al, 02h
out dx, ax
316,12 → 372,36
add edi, 4
pop esi
ret
 
;------------------------------------------------------------------------------
align 4
VGA_putpixel:
; eax = x
; ebx = y
mov ecx, eax
mov eax, [esp+32-8+4] ; color
;--------------------------------------
; 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
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
call [_display.check_mouse]
;--------------------------------------
align 4
@@:
pop ecx
;--------------------------------------
align 4
.no_mouseunder:
shl ebx, 9
lea ebx, [ebx+ebx*4] ; óìíîæåíèå íà 5
lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32)
343,6 → 423,8
cmp al, 170
jbe .p13green
or dl, 0x08
;--------------------------------------
align 4
.p13green:
cmp ah, 85
jbe .p13red
350,6 → 432,8
cmp ah, 170
jbe .p13red
or dl, 0x08
;--------------------------------------
align 4
.p13red:
shr eax, 8
cmp ah, 85
358,6 → 442,8
cmp ah, 170
jbe .p13cont
or dl, 0x08
;--------------------------------------
align 4
.p13cont:
ror edx, 8
inc cl
371,14 → 457,12
rol edx, 8
mov [edi], dl
popfd
;.end:
ret
 
;------------------------------------------------------------------------------
align 4
VGA__putimage:
; ecx = size [x|y]
; edx = coordinates [x|y]
cmp [SCR_MODE], dword 0x12
jne @f
pushad
rol edx, 16
movzx eax, dx
389,16 → 473,14
movzx ecx, cx
call VGA_draw_bar_1
popad
@@:
ret
 
;------------------------------------------------------------------------------
align 4
VGA_draw_bar:
; eax cx
; ebx cy
; ecx xe
; edx ye
cmp [SCR_MODE], dword 0x12
jne @f
pushad
sub ecx, eax
sub edx, ebx
408,9 → 490,9
and edx, 0xffff
call VGA_draw_bar_1
popad
@@:
ret
 
;------------------------------------------------------------------------------
align 4
VGA_draw_bar_1:
mov [temp.cx], eax
mov eax, [TASK_BASE]
429,6 → 511,8
mov ebx, ecx
shr ebx, 5
inc ebx
;--------------------------------------
align 4
.main_loop:
call VGA_draw_long_line_1
dec edx
435,7 → 519,8
jnz .main_loop
call VGA_draw_long_line_1
ret
 
;------------------------------------------------------------------------------
align 4
VGA_draw_long_line_1:
push ebx edx esi edi
shl edx, 9
446,5 → 531,4
call VGA_draw_long_line
pop edi esi edx ebx
ret
 
 
;------------------------------------------------------------------------------