Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1708 → Rev 1707

/kernel/branches/Kolibri-A/trunk/video/vesa20.inc
256,8 → 256,8
; ebx = y
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
lea edi, [ebx+eax*4] ; edi = x*4+(y*y multiplier)
; mov eax, [esp+32-8+4] ; eax = color
mov [LFB_BASE+edi], ecx
mov eax, [esp+32-8+4] ; eax = color
mov [LFB_BASE+edi], eax
ret
 
 
277,6 → 277,7
 
align 4
__sys_draw_line:
; inc [mouse_pause]
call [_display.disable_mouse]
 
; draw a line
305,7 → 306,6
push eax ; save x1
push ebx ; save y1
push esi ; save x2
 
push ebp ; save y2
; checking x-axis...
sub esi, eax ; esi = x2-x1
408,9 → 408,6
cmp ebx, [Screen_Max_Y]
jge .out
push eax ebp esi ebx edx
bt ecx, 24 ; color inversion check
rcl edi,1 ; forced graphics check
 
mov ebp, [_display.width] ; ebp = screen co-ords base
imul ebp, ebx
add ebp, [_WinMapAddress]
428,47 → 425,29
mov edx, [Screen_Max_X]
 
.draw: ; -- the line ---
jmp dword [hline.drawtable + edi*4] ; a coolhack (C) Serge
 
align 4
.invert_color:
mov ecx, [ebx+eax*4]
xor ecx, 0x00FFFFFF
or ecx, 0x01000000 ; keep bit[24] high !
align 4
.check_overlap:
movzx esi, byte [ebp+eax] ; check whether the line covered by other windows
test edi,1 ; forced ?
jnz .checked
; check whether the line covered by other windows
movzx esi, byte [ebp+eax]
cmp esi, [CURRENT_TASK]
je .putpixel
jmp .nextpixel
align 4
.invert_force:
jne .nextpixel
.checked:
test ecx,0x01000000
jz .noneg
mov ecx, [ebx+eax*4]
xor ecx, 0x00FFFFFF
or ecx, 0x01000000 ; keep bit[24] high !
align 4
.putpixel:
not ecx
and ecx, 0x01FFFFFF ; keep bit[24] high !
.noneg:
mov [ebx+eax*4], ecx
align 4
.nextpixel:
inc eax
cmp eax, edx
ja .exit
jmp dword [hline.drawtable + edi*4] ; close the loop
 
jle .draw
.exit:
shr edi, 1 ; restore the 'force' bit
pop edx ebx esi ebp eax
.out:
ret
align 4
.drawtable:
dd .check_overlap ; general case
dd .invert_color
dd .putpixel ; force to draw it
dd .invert_force
 
 
align 4
vline:
; --------- draw a vertical line ------------
502,47 → 481,31
jb .draw
mov edx, [Screen_Max_Y] ; to prevent off-screen drawing
 
.draw:
jmp dword [vline.drawtable + edi*4]
align 4
.invert_color:
mov ecx, [eax]
xor ecx, 0x00FFFFFF
or ecx, 0x01000000
align 4
.check_overlap:
.draw: ; (vertical line itself)
test edi,1 ; forced ?
jnz .checked
; check whether the line covered by other windows
movzx esi, byte [ebp]
cmp esi, [CURRENT_TASK]
je .putpixel
jmp .nextpixel
 
align 4
.invert_force:
jne .nextpixel
.checked:
test ecx,0x01000000
jz .noneg
mov ecx, [eax]
xor ecx, 0x00FFFFFF
or ecx, 0x01000000
align 4
.putpixel:
not ecx
and ecx, 0x01FFFFFF ; keep bit[24] high !
.noneg:
mov [eax], ecx
align 4
.nextpixel:
add eax, [BytesPerScanLine]
add ebp, [_display.width]
inc ebx
cmp ebx, edx
ja .exit
jmp dword [vline.drawtable + edi*4]
jle .draw
.exit:
shr edi, 1
pop edx ebx esi ebp eax
.out:
ret
align 4
.drawtable:
dd .check_overlap ; general case
dd .invert_color
dd .putpixel ; force to draw it
dd .invert_force
 
 
;*************************************************
1059,6 → 1022,3
paddb mm4, mm1
movd eax, mm4
ret
diff16 "VESA2 code end ",0,$
diff16 "VESA2 code size",get_pixel,$