Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 380 → Rev 381

/kernel/trunk/video/cursors.inc
426,11 → 426,11
 
align 4
proc init_cursors
cmp [0xfe0c],word 0x13
cmp [SCR_MODE],word 0x13
jbe .fail
 
movzx eax, byte [ScreenBPP]
mov ebx, [SCR_BYTES_PER_LINE]
mov ebx, [BytesPerScanLine]
cmp eax, 32
jne @F
sub ebx, 128
456,8 → 456,8
stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
mov [def_cursor], eax
 
mov ecx, [SCR_X_SIZE]
mov edx, [SCR_Y_SIZE]
mov ecx, [ScreenWidth]
mov edx, [ScreenHeight]
inc ecx
inc edx
mov [scr_width], ecx
/kernel/trunk/video/vesa12.inc
32,9 → 32,9
; modified by Mario79
;set_bank:
;cli
;cmp al,[0xfff2]
;cmp al,[BANK_RW]
;je retsb
;mov [0xfff2],al
;mov [BANK_RW],al
;push dx
;mov dx,3D8h
;out dx,al
50,9 → 50,9
set_bank:
pushfd
cli
cmp al,[0xfff2]
cmp al,[BANK_RW]
je retsb
mov [0xfff2],al
mov [BANK_RW],al
push ax
push dx
push cx
132,9 → 132,9
;
;set_bank:
;cli
;cmp al,[0xfff2]
;cmp al,[BANK_RW]
;je retsb
;mov [0xfff2],al
;mov [BANK_RW],al
;push ax
;push dx
;mov dx,3CEh
160,9 → 160,9
 
;set_bank:
; cli
; cmp al,[0xfff2]
; cmp al,[BANK_RW]
; je retsb
; mov [0xfff2],al
; mov [BANK_RW],al
; push ax
; push dx
; mov ah,al
216,7 → 216,7
 
push eax
push ebx
mov esi,0x300000
mov esi,IMG_BACKGROUND
 
cmp [WinMapAddress-12],dword 1 ; tiled background
jne no_vesa12_tiled_bgr
247,7 → 247,7
 
imul eax,dword [WinMapAddress-8]
xor edx,edx
mov ecx,[0xfe00]
mov ecx,[ScreenWidth]
inc ecx
div ecx
 
255,7 → 255,7
mov eax,ebx
imul eax,dword [WinMapAddress-4]
xor edx,edx
mov ecx,[0xfe04]
mov ecx,[ScreenHeight]
inc ecx
div ecx
mov ebx,eax
278,7 → 278,7
add esi,eax
add esi,eax
add esi,eax
add esi,0x300000
add esi,IMG_BACKGROUND
pop ebx
pop eax
 
288,7 → 288,7
pusha
mov esi,eax
mov edi,ebx
mov eax,[0xfe00]
mov eax,[ScreenWidth]
add eax,1
mul ebx
add eax,esi
295,13 → 295,13
add eax,WinMapAddress
cmp [eax],byte 1
jnz v12nbgp
mov eax,[0xfe08]
mov eax,[BytesPerScanLine]
mov ebx,edi
mul ebx
add eax,esi
add eax,esi
add eax,esi
cmp [0xFBF1],byte 24
cmp [ScreenBPP],byte 24
jz v12bgl3
add eax,esi
 
310,13 → 310,13
push ebx
push eax
 
sub eax,[0xfe80]
sub eax,[LFBAddress]
 
shr eax,16
call set_bank
pop eax
and eax,65535
add eax,0xa0000
add eax,VGABasePtr
pop ebx
 
mov [eax],cx
369,19 → 369,19
add ebx,[ecx-twdw+WDATA.box.top]
push eax
mov eax,ebx ; y
mov ebx,[0xfe08]
mov ebx,[BytesPerScanLine]
mul ebx
pop ecx
add eax,ecx ; x
add eax,ecx
add eax,ecx
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - x start
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start
jz dbpi2412
add eax,ecx
 
dbpi2412:
 
add eax,[0xfe80]
add eax,[LFBAddress]
mov edi,eax
 
; x size
390,7 → 390,7
mov ecx,eax
add ecx,eax
add ecx,eax
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - x size
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size
jz dbpi24312
add ecx,eax
 
410,10 → 410,10
cmp ecx,0
jnz dbcblimitlset12
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right]
cmp ecx,[0xfe00]
cmp ecx,[ScreenWidth]
jnz dbcblimitlset12
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom]
cmp ecx,[0xfe04]
cmp ecx,[ScreenHeight]
jnz dbcblimitlset12
pop ecx
pop eax
428,7 → 428,7
 
dbcblimitlno12:
 
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ?
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ?
jz dbpi24bit12
jmp dbpi32bit12
 
458,7 → 458,7
 
xor edx,edx
mov eax,edi
sub eax,[0xfe80]
sub eax,[LFBAddress]
mov ebx,3
div ebx
add eax,WinMapAddress
481,11 → 481,11
 
push edi
mov eax,edi
sub eax,[0xfe80]
sub eax,[LFBAddress]
shr eax,16
call set_bank
and edi,0xffff
add edi,0xa0000
add edi,VGABasePtr
mov eax,[esp+8+3*4+16+4+4]
stosw
shr eax,16
523,7 → 523,7
pop ecx
pop edi
pop ebx
add edi,[0xfe08]
add edi,[BytesPerScanLine]
dec ebx
jz dbnonewpi12
jmp dbnewpi12
550,7 → 550,7
push ecx
 
mov eax,edi
sub eax,[0xfe80]
sub eax,[LFBAddress]
shr eax,2
add eax,WinMapAddress
mov ebx,[CURRENT_TASK]
572,11 → 572,11
 
push edi
mov eax,edi
sub eax,[0xfe80]
sub eax,[LFBAddress]
shr eax,16
call set_bank
and edi,0xffff
add edi,0xa0000
add edi,VGABasePtr
mov eax,[esp+8+3*4+16+4+4]
stosw
shr eax,16
615,7 → 615,7
pop ecx
pop edi
pop ebx
add edi,[0xfe08]
add edi,[BytesPerScanLine]
dec ebx
jz nodbnewpi3212
jmp dbnewpi3212
631,7 → 631,7
mov edi,eax ; x
mov eax,ebx ; y
lea edi,[edi+edi*2]
mov ebx,[0xfe08]
mov ebx,[BytesPerScanLine]
mul ebx
add edi,eax
mov eax,edi
638,7 → 638,7
shr eax,16
call set_bank
and edi,65535
add edi,0xa0000
add edi,VGABasePtr
mov eax,[esp+28]
stosw
shr eax,16
653,7 → 653,7
mov edi,eax ; x
mov eax,ebx ; y
shl edi,2
mov ebx,[0xfe08]
mov ebx,[BytesPerScanLine]
mul ebx
add edi,eax
mov eax,edi
660,7 → 660,7
shr eax,16
call set_bank
and edi,65535
add edi,0xa0000
add edi,VGABasePtr
mov ecx,[esp+28]
mov [edi],ecx
sti
672,7 → 672,7
mov edi,eax ; x
mov eax,ebx ; y
lea edi,[edi+edi*2]
mov ebx,[0xfe08]
mov ebx,[BytesPerScanLine]
mul ebx
add edi,eax
mov eax,edi
679,7 → 679,7
shr eax,16
call set_bank
and edi,65535
add edi,0xa0000
add edi,VGABasePtr
mov ecx,[edi]
and ecx,255*256*256+255*256+255
sti
691,7 → 691,7
mov edi,eax ; x
mov eax,ebx ; y
shl edi,2
mov ebx,[0xfe08]
mov ebx,[BytesPerScanLine]
xor edx,edx
mul ebx
add edi,eax
699,7 → 699,7
shr eax,16
call set_bank
and edi,65535
add edi,0xa0000
add edi,VGABasePtr
mov ecx,[edi]
and ecx,255*256*256+255*256+255
sti
736,18 → 736,18
add ebx,[ecx-twdw+WDATA.box.top]
push eax
mov eax,ebx ; y
mul dword [0xfe08]
mul dword [BytesPerScanLine]
pop ecx
add eax,ecx ; x
add eax,ecx
add eax,ecx
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - x start
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x start
jz pi2412
add eax,ecx
 
pi2412:
 
add eax,[0xfe80]
add eax,[LFBAddress]
mov edi,eax
 
; x size
766,10 → 766,10
cmp dword [eax+draw_data-CURRENT_TASK+RECT.top], 0
jnz dbcblimitlset212
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right]
cmp ecx,[0xfe00]
cmp ecx,[ScreenWidth]
jnz dbcblimitlset212
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom]
cmp ecx,[0xfe04]
cmp ecx,[ScreenHeight]
jnz dbcblimitlset212
pop ecx
push 0
782,7 → 782,7
 
dbcblimitlno212:
 
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ?
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ?
jnz pi32bit12
 
pi24bit12:
794,7 → 794,7
push ebx
 
mov edx,edi
sub edx,[0xfe80]
sub edx,[LFBAddress]
mov ebx,3
div ebx
add edx,WinMapAddress
818,12 → 818,12
push edi
push eax
mov eax,edi
sub eax,[0xfe80]
sub eax,[LFBAddress]
shr eax,16
call set_bank
pop eax
and edi,0xffff
add edi,0xa0000
add edi,VGABasePtr
mov [edi],ax
shr eax,16
mov [edi+2],al
843,7 → 843,7
pop ecx
pop edi
 
add edi,[0xfe08]
add edi,[BytesPerScanLine]
add esi,[esp+32]
dec ebx
jnz newpi12
864,7 → 864,7
push ebx
 
mov edx,edi
sub edx,[0xfe80]
sub edx,[LFBAddress]
shr edx,2
add edx,WinMapAddress
mov ebx,[CURRENT_TASK]
887,12 → 887,12
push edi
push eax
mov eax,edi
sub eax,[0xfe80]
sub eax,[LFBAddress]
shr eax,16
call set_bank
pop eax
and edi,0xffff
mov [edi+0xa0000],eax
mov [edi+VGABasePtr],eax
pop edi
 
imp32no12:
909,7 → 909,7
pop ecx
pop edi
 
add edi,[0xfe08]
add edi,[BytesPerScanLine]
dec ebx
jnz newpi3212
 
923,7 → 923,7
vesa12_read_screen_pixel:
 
and eax,0x3FFFFF
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ?
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ?
jz v12rsp24
mov edi,eax
shl edi,2
931,7 → 931,7
shr eax,16
call set_bank
and edi,65535
add edi,0xa0000
add edi,VGABasePtr
mov eax,[edi]
and eax,0x00ffffff
ret
942,7 → 942,7
shr eax,16
call set_bank
and edi,65535
add edi,0xa0000
add edi,VGABasePtr
mov eax,[edi]
and eax,0x00ffffff
ret
/kernel/trunk/video/vesa20.inc
17,12 → 17,12
; If you're planning to write your own video driver I suggest
; you replace the VESA12.INC file and see those instructions.
 
ScreenWidth equ 0xfe00
ScreenHeight equ 0xfe04
BytesPerScanLine equ 0xfe08
LFBAddress equ 0xfe80
ScreenBPP equ 0xfbf1
WinMapAddress equ 0x460000
;ScreenWidth equ 0xfe00
;ScreenHeight equ 0xfe04
;BytesPerScanLine equ 0xfe08
;LFBAddress equ 0xfe80
;ScreenBPP equ 0xfbf1
;WinMapAddress equ 0x460000
 
 
 
333,7 → 333,7
mov [esp+32-8],ecx
.noneg:
; OK to set pixel
call dword [0xe020] ; call the real put_pixel function
call dword [PUTPIXEL] ; call the real put_pixel function
.exit:
popad
 
930,7 → 930,7
mov ebx,[esp+8] ; ebx:=B*3
mul ebx ;
add esi,eax ;
mov eax,[esi+0x300000]
mov eax,[esi+IMG_BACKGROUND]
and eax,0xffffff
 
xchg edi, ebp
1066,7 → 1066,7
mov cx,dx
imul eax, [esp+8] ;8
add esi,eax
mov eax,[esi+0x300000]
mov eax,[esi+IMG_BACKGROUND]
push eax
ror ecx,16
xor eax,eax
1079,7 → 1079,7
cmp eax,5
pop eax
jb @f
mov ebx,[esi+0x300000+3]
mov ebx,[esi+IMG_BACKGROUND+3]
call overlapping_of_points
@@:
push eax
1097,7 → 1097,7
mov ebx,[display_data-8]
shl ebx,1
add ebx,[display_data-8]
add ebx,0x300000
add ebx,IMG_BACKGROUND
add ebx,esi
mov ebx,[ebx]
call overlapping_of_points
/kernel/trunk/video/vga.inc
122,7 → 122,7
 
checkVga_N13:
 
cmp [0xfe0c],dword 0x13
cmp [SCR_MODE],dword 0x13
jne @f
 
; cnvl:
129,7 → 129,7
pushad
cmp [EGA_counter],1
je novesal
mov ecx,[0xfb0a]
mov ecx,[MOUSE_X]
cmp ecx,[novesachecksum]
jne novesal
popad
151,7 → 151,7
sub eax,100
imul eax,640*4
add ecx,eax
movzx eax,word [0xfb0a]
movzx eax,word [MOUSE_X]
cmp eax,160
jge m13l1
mov eax,160
163,9 → 163,9
sub eax,160
shl eax,2
add ecx,eax
mov esi,[0xfe80]
mov esi,[LFBAddress]
add esi,ecx
mov edi,0xa0000
mov edi,VGABasePtr
mov edx,200
mov ecx,320
cld
197,11 → 197,11
 
VGA_drawbackground:
; draw all
cmp [0xfe0c],dword 0x12
cmp [SCR_MODE],dword 0x12
jne .end
pushad
mov esi,[0xfe80]
mov edi,0xa0000
mov esi,[LFBAddress]
mov edi,VGABasePtr
mov ebx,640/32 ; 640*480/(8*4)
mov edx,480
@@:
322,11 → 322,11
lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32)
mov edi,edx
add edi, [0xfe80] ; + LFB address
add edi, [LFBAddress] ; + LFB address
mov [edi], eax ; write to LFB for Vesa2.0
shr edx,5 ; change BytesPerPixel to 1/8
mov edi,edx
add edi, 0x0a0000 ; address of pixel in VGA area
add edi, VGABasePtr ; address of pixel in VGA area
and ecx,0x07 ; bit no. (modulo 8)
pushfd
; edi = address, eax = 24bit colour, ecx = bit no. (modulo 8)
373,7 → 373,7
VGA__putimage:
; ecx = size [x|y]
; edx = coordinates [x|y]
cmp [0xfe0c],dword 0x12
cmp [SCR_MODE],dword 0x12
jne @f
pushad
rol edx,16
393,7 → 393,7
; ebx cy
; ecx xe
; edx ye
cmp [0xfe0c],dword 0x12
cmp [SCR_MODE],dword 0x12
jne @f
pushad
sub ecx,eax
418,10 → 418,10
lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
lea ebx, [ebx+eax*4] ; + x*BytesPerPixel (Vesa2.0 32)
mov esi,ebx
add esi, [0xfe80] ; + LFB address
add esi, [LFBAddress] ; + LFB address
shr ebx,5 ; change BytesPerPixel to 1/8
mov edi,ebx
add edi, 0x0a0000 ; address of pixel in VGA area
add edi, VGABasePtr ; address of pixel in VGA area
mov ebx,ecx
shr ebx,5
inc ebx