Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 927 → Rev 928

/kernel/branches/kolibri_pe/video/cursors.inc
453,13 → 453,13
align 4
proc init_cursors
 
cmp [SCR_MODE],word 0x13
cmp [scr_mode], 0x13
jbe .fail
 
test word [SCR_MODE], 0x4000
test [scr_mode], 0x4000
jz .fail
 
movzx eax, byte [ScreenBPP]
mov eax, [ScreenBPP]
mov ebx, [BytesPerScanLine]
cmp eax, 32
jne @F
493,7 → 493,7
mov [scr_width], ecx
mov [scr_height], edx
 
movzx ebx, byte [ScreenBPP]
mov ebx, [ScreenBPP]
cmp ebx, 32
jne @F
 
598,8 → 598,7
mov [_dy], edi
 
mul ebx
lea esi, [ecx+ecx*2]
add esi, [LFBAddress]
lea esi, [LFB_BASE+ecx+ecx*2]
add esi, eax
mov [cur_saved_base],esi
 
710,8 → 709,7
mov [_dy], edi
 
mul ebx
lea esi, [eax+ecx*4]
add esi, [LFBAddress]
lea esi, [LFB_BASE+eax+ecx*4]
mov [cur_saved_base],esi
 
mov edi, [scr_width]
/kernel/branches/kolibri_pe/video/vesa12.inc
63,10 → 63,10
set_bank:
pushfd
cli
cmp al,[BANK_RW]
cmp al, byte [bank_rw]
je .retsb
 
mov [BANK_RW],al
mov byte [bank_rw],al
push dx
mov dx,3D8h
out dx,al
84,10 → 84,10
set_bank:
pushfd
cli
cmp al,[BANK_RW]
cmp al, byte [bank_rw]
je .retsb
 
mov [BANK_RW],al
mov byte [bank_rw],al
push ax
push dx
push cx
172,10 → 172,10
pushfd
cli
 
cmp al,[BANK_RW]
cmp al, byte [bank_rw]
je .retsb
 
mov [BANK_RW],al
mov byte [bank_rw],al
push ax
push dx
mov dx,3CEh
206,10 → 206,10
pushfd
cli
 
cmp al,[BANK_RW]
cmp al, byte [bank_rw]
je .retsb
 
mov [BANK_RW],al
mov byte [bank_rw],al
push ax
push dx
mov ah,al
336,7 → 336,7
mul ebx
add eax, esi
lea eax, [VGABasePtr+eax+esi*2]
cmp [ScreenBPP],byte 24
cmp byte [ScreenBPP], 24
jz v12bgl3
add eax,esi
 
410,7 → 410,7
add eax,ecx ; x
add eax,ecx
add eax,ecx
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start
cmp byte [ScreenBPP], 24 ; 24 or 32 bpp ? - x start
jz dbpi2412
add eax,ecx
 
425,7 → 425,7
mov ecx,eax
add ecx,eax
add ecx,eax
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size
cmp byte [ScreenBPP], 24 ; 24 or 32 bpp ? - x size
jz dbpi24312
add ecx,eax
 
463,7 → 463,7
 
dbcblimitlno12:
 
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ?
cmp byte [ScreenBPP], 24 ; 24 or 32 bpp ?
jz dbpi24bit12
jmp dbpi32bit12
 
776,7 → 776,7
add eax,ecx ; x
add eax,ecx
add eax,ecx
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start
cmp byte [ScreenBPP], 24 ; 24 or 32 bpp ? - x start
jz pi2412
add eax,ecx
 
817,7 → 817,7
 
dbcblimitlno212:
 
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ?
cmp byte [ScreenBPP], 24 ; 24 or 32 bpp ?
jnz pi32bit12
 
pi24bit12:
974,7 → 974,7
vesa12_read_screen_pixel:
 
and eax,0x3FFFFF
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ?
cmp byte [ScreenBPP], 24 ; 24 or 32 bpp ?
jz v12rsp24
mov edi,eax
shl edi,2
/kernel/branches/kolibri_pe/video/vesa20.inc
23,13 → 23,7
; If you're planning to write your own video driver I suggest
; you replace the VESA12.INC file and see those instructions.
 
;Screen_Max_X equ 0xfe00
;Screen_Max_Y equ 0xfe04
;BytesPerScanLine equ 0xfe08
;LFBAddress equ 0xfe80
;ScreenBPP equ 0xfbf1
 
 
;*************************************************
; getpixel
;
42,7 → 36,7
 
getpixel:
push eax ebx edx edi
call dword [GETPIXEL]
call [get_pixel]
pop edi edx ebx eax
ret
 
52,8 → 46,11
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
lea edi, [eax+eax*2] ; edi = x*3
add edi, ebx ; edi = x*3+(y*y multiplier)
add edi, [LFBAddress] ; ebx = where pixel is in memory
mov ecx, [edi]
if SHADOWFB
mov ecx, [SHADOWFB+edi]
else
mov ecx, [LFB_BASE+edi]
end if
and ecx, 0xffffff
ret
 
60,8 → 57,11
Vesa20_getpixel32:
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
lea edi, [ebx+eax*4] ; edi = x*4+(y*y multiplier)
add edi, [LFBAddress] ; ebx = where pixel is in memory
mov ecx, [edi]
if SHADOWFB
mov ecx, [SHADOWFB+edi]
else
mov ecx, [LFB_BASE+edi]
end if
and ecx, 0xffffff
ret
 
177,7 → 177,7
mov [putimg.winmap_newline], eax
; screen new line increment
mov eax, [BytesPerScanLine]
movzx ebx, byte [ScreenBPP]
mov ebx, [ScreenBPP]
shr ebx, 3
imul ecx, ebx
sub eax, ecx
188,11 → 188,10
mov edx, [putimg.abs_cy]
imul edx, [BytesPerScanLine]
mov eax, [putimg.abs_cx]
movzx ebx, byte [ScreenBPP]
mov ebx, [ScreenBPP]
shr ebx, 3
imul eax, ebx
add edx, eax
add edx, [LFBAddress]
; pointer to pixel map
mov eax, [putimg.abs_cy]
imul eax, [Screen_Max_X]
218,9 → 217,15
cmp [ebp], bl
jne .skip
; mov eax, [esi] ; eax = RRBBGGRR
mov [edx], ax
if SHADOWFB
mov [SHADOWFB+edx], ax
end if
mov [LFB_BASE+edx], ax
shr eax, 16
mov [edx+2], al
if SHADOWFB
mov [SHADOWFB+edx+2], al
end if
mov [LFB_BASE+edx+2], al
.skip:
; add esi, 3 ;[putimg.source_bpp]
add edx, 3
261,7 → 266,10
cmp [ebp], bl
jne .skip
; mov eax, [esi] ; ecx = RRBBGGRR
mov [edx], eax
if SHADOWFB
mov [SHADOWFB+edx], eax
end if
mov [LFB_BASE+edx], eax
.skip:
; add esi, [putimg.source_bpp]
add edx, 4
324,7 → 332,7
mov [esp+32-8],ecx
.noneg:
; OK to set pixel
call dword [PUTPIXEL] ; call the real put_pixel function
call [put_pixel] ; call the real put_pixel function
.exit:
popad
ret
336,11 → 344,15
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
lea edi, [eax+eax*2] ; edi = x*3
mov eax, [esp+32-8+4]
add edi, [LFBAddress]
add edi, ebx ; ebx = where to put pixel in memory
mov [edi], ax
if SHADOWFB
mov [SHADOWFB+ebx+edi], ax
end if
mov [LFB_BASE+ebx+edi], ax
shr eax, 16
mov [edi+2], al
if SHADOWFB
mov [SHADOWFB+ebx+edi+2], al
end if
mov [LFB_BASE+ebx+edi+2], al
ret
 
 
351,8 → 363,10
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
add edi, [LFBAddress] ; ebx = where to put pixel in memory
mov [edi], eax
if SHADOWFB
mov [SHADOWFB+edi], eax
end if
mov [LFB_BASE+edi], eax
ret
 
;*************************************************
623,7 → 637,7
mov [drbar.line_inc_map], eax
; line_inc_scr
mov eax, [drbar.real_sx]
movzx ebx, byte [ScreenBPP]
mov ebx, [ScreenBPP]
shr ebx, 3
imul eax, ebx
neg eax
633,11 → 647,10
mov edx, [drbar.abs_cy]
imul edx, [BytesPerScanLine]
mov eax, [drbar.abs_cx]
; movzx ebx, byte [ScreenBPP]
; mov ebx, [ScreenBPP]
; shr ebx, 3
imul eax, ebx
add edx, eax
add edx, [LFBAddress]
; pointer to pixel map
mov eax, [drbar.abs_cy]
imul eax, [Screen_Max_X]
668,8 → 681,12
.new_x:
cmp byte [ebp], bl
jne .skip
mov [edx], bh
mov [edx + 1], ax
if SHADOWFB
mov [SHADOWFB+edx], bh
mov [SHADOWFB+edx + 1], ax
end if
mov [LFB_BASE+edx], bh
mov [LFB_BASE+edx + 1], ax
.skip:
; add pixel
add edx, 3
704,7 → 721,10
.new_x:
cmp byte [ebp], bl
jne .skip
mov [edx], eax
if SHADOWFB
mov [SHADOWFB+edx], eax
end if
mov [LFB_BASE+edx], eax
.skip:
; add pixel
add edx, 4
731,60 → 751,7
mov [EGA_counter],1
ret
 
;voodoodbcplimit:
 
; ebp:=(y+Ywin)*(ScreenXSize+1)+(x+Xwin)+AddrBuffer
 
 
; pusha
 
; xor edx,edx
; mov eax,ebp
; mov ebx,[Screen_Max_X] ; Screen_X_size
; inc ebx ; +1
; sub eax,display_data ; -AddrBuffer
; div ebx ;
; mov ebx,eax ; ebx:=Y
; mov eax,edx ; eax:=X
; call cplimit
 
; test ecx,ecx
; jne dbcpl12
; popa
; clc
; ret
; dbcpl12:
; popa
; stc
; ret
 
 
 
 
;dbcplimit:
 
; pusha
 
; xor edx,edx
; mov ebx,[Screen_Max_X]
; inc ebx
; sub eax,display_data
; div ebx
; mov ebx,eax
; mov eax,edx
; call cplimit
 
; test ecx,ecx
; jne dbcpl1
; popa
; clc
; ret
; dbcpl1:
; popa
; stc
; ret
 
 
vesa20_drawbackground_tiled:
call [disable_mouse]
pushad
800,11 → 767,11
add ebp, eax
add ebp, eax
add ebp, eax
cmp [ScreenBPP], byte 24 ; 24 or 32 bpp ? - x size
cmp byte [ScreenBPP], 24 ; 24 or 32 bpp ? - x size
jz @f
add ebp, eax
@@:
add ebp, [LFBAddress]
; add ebp, LFB_BASE
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
call calculate_edi
xchg edi, ebp
849,7 → 816,7
add esi, 3
add edi, 3
@@:
cmp [ScreenBPP], byte 25 ; 24 or 32 bpp?
cmp byte [ScreenBPP], 25 ; 24 or 32 bpp?
sbb edi, -1 ; +1 for 32 bpp
; I do not use 'inc eax' because this is slightly slower then 'add eax,1'
add ebp, edx
910,11 → 877,10
add ebp, eax
add ebp, eax
add ebp, eax
cmp [ScreenBPP], byte 24 ; 24 or 32 bpp ? - x size
cmp byte [ScreenBPP], 24 ; 24 or 32 bpp ? - x size
jz @f
add ebp, eax
@@:
add ebp, [LFBAddress]
; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB
call calculate_edi
xchg edi, ebp
991,11 → 957,17
mov ebx, [bgr_next_line+esi]
call [overlapping_of_points_ptr]
.novert:
mov [edi], ax
if SHADOWFB
mov [SHADOWFB+edi], ax
end if
mov [LFB_BASE+edi], ax
shr eax, 16
mov [edi+2], al
if SHADOWFB
mov [SHADOWFB+edi+2], al
end if
mov [LFB_BASE+edi+2], al
snbgp:
cmp [ScreenBPP], byte 25
cmp byte [ScreenBPP], 25
sbb edi, -4
add ebp, 1
mov eax, [esp+20]
1019,7 → 991,7
sub edi, eax
sub edi, eax
sub edi, eax
cmp [ScreenBPP], byte 24
cmp byte [ScreenBPP], 24
jz @f
sub edi, eax
@@:
/kernel/branches/kolibri_pe/video/vga.inc
126,7 → 126,7
 
checkVga_N13:
 
cmp [SCR_MODE],dword 0x13
cmp [scr_mode], 0x13
jne @f
 
; cnvl:
133,7 → 133,7
pushad
cmp [EGA_counter],1
je novesal
mov ecx,[MOUSE_X]
mov ecx, dword [MOUSE_X]
cmp ecx,[novesachecksum]
jne novesal
popad
201,7 → 201,7
 
VGA_drawbackground:
; draw all
cmp [SCR_MODE],dword 0x12
cmp [scr_mode], 0x12
jne .end
pushad
mov esi,[LFBAddress]
377,7 → 377,7
VGA__putimage:
; ecx = size [x|y]
; edx = coordinates [x|y]
cmp [SCR_MODE],dword 0x12
cmp [scr_mode], 0x12
jne @f
pushad
rol edx,16
397,7 → 397,7
; ebx cy
; ecx xe
; edx ye
cmp [SCR_MODE],dword 0x12
cmp [scr_mode], 0x12
jne @f
pushad
sub ecx,eax