/kernel/trunk/video/vesa12.inc |
---|
709,6 → 709,12 |
vesa12_putimage: |
; ebx = pointer to image |
; ecx = size [x|y] |
; edx = coordinates [x|y] |
; ebp = pointer to 'get' function |
; esi = pointer to 'init' function |
; edi = parameter for 'get' function |
; mov ebx,image |
; mov ecx,320*65536+240 |
730,8 → 736,7 |
add ebx,[ecx-twdw+WDATA.box.top] |
push eax |
mov eax,ebx ; y |
mov ebx,[0xfe08] |
mul ebx |
mul dword [0xfe08] |
pop ecx |
add eax,ecx ; x |
add eax,ecx |
747,29 → 752,18 |
; x size |
movzx eax,word [esp+6] |
mov ecx,eax |
add ecx,eax |
add ecx,eax |
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - x size |
jz pi24312 |
add ecx,eax |
movzx ecx,word [esp+6] |
pi24312: |
mov esi,[esp+8] |
movzx ebx,word [esp+4] |
; check limits while draw ? |
push eax |
push ecx |
mov eax,[0x3010] |
mov ecx,[eax+draw_data-0x3000+RECT.left] |
cmp ecx,0 |
cmp dword [eax+draw_data-0x3000+RECT.left], 0 |
jnz dbcblimitlset212 |
mov ecx,[eax+draw_data-0x3000+RECT.top] |
cmp ecx,0 |
cmp dword [eax+draw_data-0x3000+RECT.top], 0 |
jnz dbcblimitlset212 |
mov ecx,[eax+draw_data-0x3000+RECT.right] |
cmp ecx,[0xfe00] |
778,84 → 772,67 |
cmp ecx,[0xfe04] |
jnz dbcblimitlset212 |
pop ecx |
pop eax |
push dword 0 |
push 0 |
jmp dbcblimitlno212 |
dbcblimitlset212: |
pop ecx |
pop eax |
push dword 1 |
push 1 |
dbcblimitlno212: |
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? |
jz pi24bit12 |
jmp pi32bit12 |
jnz pi32bit12 |
pi24bit12: |
cld |
push eax |
push ebx |
push edx |
xor edx,edx |
mov eax,ecx |
mov ebx,3 |
div ebx |
mov ecx,eax |
pop edx |
pop ebx |
pop eax |
newpi12: |
push edi |
push esi |
push ecx |
push ebx |
xor edx,edx |
mov eax,edi |
sub eax,[0xfe80] |
mov edx,edi |
sub edx,[0xfe80] |
mov ebx,3 |
div ebx |
add eax,WinMapAddress |
add edx,WinMapAddress |
mov ebx,[0x3000] |
mov bh,[esp+4*4] |
mov bh,[esp+4*3] |
np2412: |
cmp bl,[eax] |
cmp bl,[edx] |
jnz imp24no12 |
mov edx,[esi] |
cmp bh,0 |
jz imp24yes12 |
; mov eax,[esi] |
push dword [esp+4*3+20] |
call ebp |
; cmp bh,0 |
; jz imp24yes12 |
; call dbcplimit |
; jnz imp24no12 |
imp24yes12: |
push edi |
push eax |
push edi |
mov eax,edi |
sub eax,[0xfe80] |
shr eax,16 |
call set_bank |
pop eax |
and edi,0xffff |
add edi,0xa0000 |
mov [edi],edx |
shr edx,2 |
mov [edi+2],dl |
sti |
mov [edi],ax |
shr eax,16 |
mov [edi+2],al |
pop edi |
pop eax |
imp24no12: |
inc eax |
add esi,3 |
inc edx |
; add esi,3 |
add edi,3 |
dec ecx |
jnz np2412 |
864,73 → 841,63 |
pop ebx |
pop ecx |
pop esi |
pop edi |
add edi,[0xfe08] |
xor eax,eax |
mov ax,[esp+4+2+4] |
lea eax,[eax+eax*2] |
add esi,eax |
dec ebx |
jz nonewpi12 |
jmp newpi12 |
jnz newpi12 |
nonewpi12: |
add esp,7*4 |
mov eax,0 |
pop eax edx ecx ebx eax edi esi |
xor eax, eax |
ret |
pi32bit12: |
cld |
shr ecx,2 |
newpi3212: |
push edi |
push esi |
push ecx |
push ebx |
mov eax,edi |
sub eax,[0xfe80] |
shr eax,2 |
add eax,WinMapAddress |
mov edx,edi |
sub edx,[0xfe80] |
shr edx,2 |
add edx,WinMapAddress |
mov ebx,[0x3000] |
mov bh,[esp+4*4] |
mov bh,[esp+4*3] |
np3212: |
cmp bl,[eax] |
cmp bl,[edx] |
jnz imp32no12 |
mov edx,[esi] |
cmp bh,0 |
jz imp32yes12 |
; mov eax,[esi] |
push dword [esp+4*3+20] |
call ebp |
; cmp bh,0 |
; jz imp32yes12 |
; call dbcplimit |
; jnz imp32no12 |
imp32yes12: |
push edi |
push eax |
push edi |
mov eax,edi |
sub eax,[0xfe80] |
shr eax,16 |
call set_bank |
pop eax |
and edi,0xffff |
add edi,0xa0000 |
mov [edi],edx |
sti |
mov [edi+0xa0000],eax |
pop edi |
pop eax |
imp32no12: |
inc eax |
add esi,3 |
inc edx |
; add esi,3 |
add edi,4 |
dec ecx |
jnz np3212 |
939,21 → 906,16 |
pop ebx |
pop ecx |
pop esi |
pop edi |
add edi,[0xfe08] |
movzx eax,word [esp+4+2+4] |
lea eax,[eax+eax*2] |
add esi,eax |
dec ebx |
jz nonewpi3212 |
jmp newpi3212 |
jnz newpi3212 |
nonewpi3212: |
add esp,7*4 |
mov eax,0 |
pop eax edx ecx ebx eax edi esi |
xor eax, eax |
ret |
/kernel/trunk/video/vesa20.inc |
---|
76,16 → 76,21 |
.abs_cx dd ? |
.abs_cy dd ? |
.line_increment dd ? |
.source_bpp dd ? |
.winmap_newline dd ? |
.screen_newline dd ? |
.stack_data = 4*13 |
.stack_data = 4*12 |
.edi dd ? |
.esi dd ? |
.ebp dd ? |
end virtual |
align 4 |
align 16 |
; ebx = pointer |
; ecx = size [x|y] |
; edx = coordinates [x|y] |
; ebp = pointer to 'get' function |
; esi = pointer to 'init' function |
; edi = parameter for 'get' function |
vesa20_putimage: |
pushad |
call [disable_mouse] |
92,13 → 97,6 |
sub esp, putimg.stack_data |
mov [putimg.source_bpp], 3 |
; test ebx, 0x80000000 |
; jz @f |
; inc [putimg.source_bpp] |
; @@: |
; and ebx, 0x7FFFFFFF |
; save pointer to image |
mov [putimg.pti], ebx |
164,7 → 162,8 |
mov eax, [putimg.image_sx] |
sub eax, [putimg.real_sx] |
;; imul eax, [putimg.source_bpp] |
lea eax, [eax + eax * 2] |
; lea eax, [eax + eax * 2] |
call esi |
mov [putimg.line_increment], eax |
; winmap new line increment |
183,7 → 182,7 |
mov [putimg.screen_newline], eax |
; pointer to image |
mov ecx, [putimg.pti] |
mov esi, [putimg.pti] |
; pointer to screen |
mov edx, [putimg.abs_cy] |
213,29 → 212,32 |
mov edi, [putimg.real_sy] |
align 4 |
.new_line: |
mov esi, [putimg.real_sx] |
mov ecx, [putimg.real_sx] |
; push ebp edx |
align 4 |
.new_x: |
push [putimg.edi] |
mov eax, [putimg.ebp+4] |
call eax |
cmp [ebp], bl |
jne .skip |
mov eax, [ecx] ; ecx = RRBBGGRR |
; mov eax, [esi] ; eax = RRBBGGRR |
mov [edx], ax |
shr eax, 16 |
mov [edx+2], al |
.skip: |
add ecx, 3 ;[putimg.source_bpp] |
; add esi, 3 ;[putimg.source_bpp] |
add edx, 3 |
inc ebp |
dec esi |
dec ecx |
jnz .new_x |
; pop edx ebp |
add ecx, [putimg.line_increment] |
add esi, [putimg.line_increment] |
add edx, [putimg.screen_newline] ;[BytesPerScanLine] |
add ebp, [putimg.winmap_newline] ;[ScreenWidth] |
;inc ebp |
251,27 → 253,30 |
mov edi, [putimg.real_sy] |
align 4 |
.new_line: |
mov esi, [putimg.real_sx] |
mov ecx, [putimg.real_sx] |
; push ebp edx |
align 4 |
.new_x: |
push [putimg.edi] |
mov eax, [putimg.ebp+4] |
call eax |
cmp [ebp], bl |
jne .skip |
mov eax, [ecx] ; ecx = RRBBGGRR |
; mov eax, [esi] ; ecx = RRBBGGRR |
mov [edx], eax |
.skip: |
add ecx, [putimg.source_bpp] |
; add esi, [putimg.source_bpp] |
add edx, 4 |
inc ebp |
dec esi |
dec ecx |
jnz .new_x |
; pop edx ebp |
add ecx, [putimg.line_increment] |
add esi, [putimg.line_increment] |
add edx, [putimg.screen_newline] ;[BytesPerScanLine] |
add ebp, [putimg.winmap_newline] ;[ScreenWidth] |
;inc ebp |