2012-03-13 17:51:57 +01:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
2022-02-12 18:27:41 +01:00
|
|
|
;; Copyright (C) KolibriOS team 2011-2022. All rights reserved. ;;
|
2012-03-13 17:51:57 +01:00
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2011-03-01 07:08:11 +01:00
|
|
|
|
2014-04-17 23:19:45 +02:00
|
|
|
$Revision$
|
|
|
|
|
|
|
|
|
2012-02-23 19:52:13 +01:00
|
|
|
struct BLITTER_BLOCK
|
|
|
|
xmin dd ?
|
|
|
|
ymin dd ?
|
|
|
|
xmax dd ?
|
|
|
|
ymax dd ?
|
|
|
|
ends
|
|
|
|
|
|
|
|
|
|
|
|
struct BLITTER
|
2012-10-12 20:30:58 +02:00
|
|
|
dc RECT
|
|
|
|
sc RECT
|
2012-02-23 19:52:13 +01:00
|
|
|
dst_x dd ? ; 32
|
|
|
|
dst_y dd ? ; 36
|
|
|
|
src_x dd ? ; 40
|
|
|
|
src_y dd ? ; 44
|
|
|
|
w dd ? ; 48
|
|
|
|
h dd ? ; 52
|
|
|
|
|
|
|
|
bitmap dd ? ; 56
|
|
|
|
stride dd ? ; 60
|
|
|
|
ends
|
2011-03-01 07:08:11 +01:00
|
|
|
|
|
|
|
|
2012-10-12 20:30:58 +02:00
|
|
|
|
2011-03-01 07:08:11 +01:00
|
|
|
align 4
|
2012-10-12 20:30:58 +02:00
|
|
|
block_clip:
|
|
|
|
;esi= clip RECT ptr
|
|
|
|
;edi= RECT ptr
|
|
|
|
;return code:
|
2015-01-05 16:12:40 +01:00
|
|
|
;CF= 0 - draw, 1 - don't draw
|
2011-03-01 07:08:11 +01:00
|
|
|
|
2011-10-14 23:38:50 +02:00
|
|
|
push ebx
|
2012-10-12 20:30:58 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [edi + RECT.left]
|
|
|
|
mov ebx, [edi + RECT.right]
|
|
|
|
mov ecx, [esi + RECT.left] ;clip.left
|
|
|
|
mov edx, [esi + RECT.right] ;clip.right
|
2012-10-12 20:30:58 +02:00
|
|
|
|
|
|
|
cmp eax, edx ;left >= clip.right
|
|
|
|
jge .fail
|
|
|
|
|
|
|
|
cmp ebx, ecx ;right < clip.left
|
|
|
|
jl .fail
|
|
|
|
|
|
|
|
cmp eax, ecx ;left >= clip.left
|
2015-01-05 16:12:40 +01:00
|
|
|
jge @F
|
2012-10-12 20:30:58 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [edi + RECT.left], ecx
|
2012-10-12 20:30:58 +02:00
|
|
|
@@:
|
|
|
|
cmp ebx, edx ;right <= clip.right
|
|
|
|
jle @f
|
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [edi + RECT.right], edx
|
2015-01-05 16:12:40 +01:00
|
|
|
@@:
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [edi + RECT.top]
|
|
|
|
mov ebx, [edi + RECT.bottom]
|
|
|
|
mov ecx, [esi + RECT.top] ;clip.top
|
|
|
|
mov edx, [esi + RECT.bottom] ;clip.bottom
|
2012-10-12 20:30:58 +02:00
|
|
|
|
|
|
|
cmp eax, edx ;top >= clip.bottom
|
|
|
|
jge .fail
|
|
|
|
|
|
|
|
cmp ebx, ecx ;bottom < clip.top
|
|
|
|
jl .fail
|
|
|
|
|
|
|
|
cmp eax, ecx ;top >= clip.top
|
2015-01-05 16:12:40 +01:00
|
|
|
jge @F
|
2012-10-12 20:30:58 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [edi + RECT.top], ecx
|
2012-10-12 20:30:58 +02:00
|
|
|
@@:
|
|
|
|
cmp ebx, edx ;bottom <= clip.bottom
|
|
|
|
jle @f
|
2015-01-05 16:12:40 +01:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [edi + RECT.bottom], edx
|
2012-10-12 20:30:58 +02:00
|
|
|
@@:
|
2011-10-14 23:38:50 +02:00
|
|
|
pop ebx
|
2015-01-05 16:12:40 +01:00
|
|
|
clc
|
2011-03-01 07:08:11 +01:00
|
|
|
ret
|
2012-10-12 20:30:58 +02:00
|
|
|
.fail:
|
2011-10-14 23:38:50 +02:00
|
|
|
pop ebx
|
2015-01-05 16:12:40 +01:00
|
|
|
stc
|
2011-03-01 07:08:11 +01:00
|
|
|
ret
|
|
|
|
|
2012-10-12 20:30:58 +02:00
|
|
|
|
2011-03-01 07:08:11 +01:00
|
|
|
align 4
|
|
|
|
blit_clip:
|
|
|
|
|
2015-01-05 16:12:40 +01:00
|
|
|
;return code:
|
|
|
|
;CF= 0 - draw, 1 - don't draw
|
|
|
|
|
2017-12-20 02:07:10 +01:00
|
|
|
.sx0 = 8
|
|
|
|
.sy0 = 12
|
|
|
|
.sx1 = 16
|
|
|
|
.sy1 = 20
|
|
|
|
|
|
|
|
.dx0 = 24
|
|
|
|
.dy0 = 28
|
|
|
|
.dx1 = 32
|
|
|
|
.dy1 = 36
|
2011-03-01 07:08:11 +01:00
|
|
|
|
|
|
|
|
2011-10-14 23:38:50 +02:00
|
|
|
push edi
|
|
|
|
push esi
|
|
|
|
push ebx
|
|
|
|
sub esp, 40
|
|
|
|
|
|
|
|
mov ebx, ecx
|
2022-02-12 18:27:41 +01:00
|
|
|
mov edx, [ecx + BLITTER.src_x]
|
2011-10-14 23:38:50 +02:00
|
|
|
mov [esp+.sx0], edx
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [ecx + BLITTER.src_y]
|
2011-10-14 23:38:50 +02:00
|
|
|
mov [esp+.sy0], eax
|
2022-02-12 18:27:41 +01:00
|
|
|
add edx, [ecx + BLITTER.w]
|
|
|
|
add eax, [ecx + BLITTER.h]
|
|
|
|
mov [esp + .sx1], edx
|
|
|
|
mov [esp + .sy1], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
lea edi, [esp + .sx0]
|
|
|
|
lea esi, [ebx + BLITTER.sc]
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
call block_clip
|
2015-01-05 16:12:40 +01:00
|
|
|
jc .done
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov edi, [esp + .sx0]
|
|
|
|
mov edx, [ebx + BLITTER.dst_x]
|
2011-10-14 23:38:50 +02:00
|
|
|
add edx, edi
|
2022-02-12 18:27:41 +01:00
|
|
|
sub edx, [ebx + BLITTER.src_x]
|
|
|
|
mov [esp + .dx0], edx
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
mov ecx, [esp+.sy0]
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [ebx + BLITTER.dst_y]
|
2011-10-14 23:38:50 +02:00
|
|
|
add eax, ecx
|
2022-02-12 18:27:41 +01:00
|
|
|
sub eax, [ebx + BLITTER.src_y]
|
|
|
|
mov [esp + .dy0], eax
|
2012-10-12 20:30:58 +02:00
|
|
|
|
2011-10-14 23:38:50 +02:00
|
|
|
sub edx, edi
|
2022-02-12 18:27:41 +01:00
|
|
|
add edx, [esp + .sx1]
|
|
|
|
mov [esp + .dx1], edx
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
sub eax, ecx
|
2022-02-12 18:27:41 +01:00
|
|
|
add eax, [esp + .sy1]
|
|
|
|
mov [esp + .dy1], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
lea edi, [esp + .dx0]
|
|
|
|
lea esi, [ebx + BLITTER.dc]
|
2011-10-14 23:38:50 +02:00
|
|
|
call block_clip
|
2015-01-05 16:12:40 +01:00
|
|
|
jc .done
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov edx, [esp + .dx0]
|
|
|
|
mov eax, [esp + .dx1]
|
2011-10-14 23:38:50 +02:00
|
|
|
sub eax, edx
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [ebx + BLITTER.w], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [esp + .dy0]
|
|
|
|
mov ecx, [esp + .dy1]
|
2011-10-14 23:38:50 +02:00
|
|
|
sub ecx, eax
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [ebx + BLITTER.h], ecx
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov ecx, [ebx + BLITTER.src_x]
|
2011-10-14 23:38:50 +02:00
|
|
|
add ecx, edx
|
2022-02-12 18:27:41 +01:00
|
|
|
sub ecx, [ebx + BLITTER.dst_x]
|
|
|
|
mov [ebx + BLITTER.src_x], ecx
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov ecx, [ebx + BLITTER.src_y]
|
2011-10-14 23:38:50 +02:00
|
|
|
add ecx, eax
|
2022-02-12 18:27:41 +01:00
|
|
|
sub ecx, [ebx + BLITTER.dst_y]
|
|
|
|
mov [ebx + BLITTER.src_y], ecx
|
|
|
|
mov [ebx + BLITTER.dst_x], edx
|
|
|
|
mov [ebx + BLITTER.dst_y], eax
|
2015-01-05 16:12:40 +01:00
|
|
|
clc
|
2012-10-12 20:30:58 +02:00
|
|
|
.done:
|
2011-10-14 23:38:50 +02:00
|
|
|
add esp, 40
|
|
|
|
pop ebx
|
|
|
|
pop esi
|
|
|
|
pop edi
|
2011-03-01 07:08:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
purge .sx0
|
|
|
|
purge .sy0
|
|
|
|
purge .sx1
|
|
|
|
purge .sy1
|
|
|
|
|
|
|
|
purge .dx0
|
|
|
|
purge .dy0
|
|
|
|
purge .dx1
|
|
|
|
purge .dy1
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
align 4
|
|
|
|
blit_32:
|
2011-10-14 23:38:50 +02:00
|
|
|
push ebp
|
|
|
|
push edi
|
|
|
|
push esi
|
|
|
|
push ebx
|
2014-01-13 12:16:28 +01:00
|
|
|
virtual at sizeof.BLITTER
|
|
|
|
.position dd ? ; (x shl 16) + y
|
|
|
|
; ???
|
|
|
|
.extra_var1 dd ?
|
2016-12-07 19:33:17 +01:00
|
|
|
.flags dd ?
|
2014-01-13 12:16:28 +01:00
|
|
|
.local_vars_size = $
|
|
|
|
end virtual
|
|
|
|
sub esp, .local_vars_size
|
2016-12-07 19:33:17 +01:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + .flags], ebx
|
2022-02-03 19:41:21 +01:00
|
|
|
|
2023-09-22 18:31:40 +02:00
|
|
|
mov eax, [current_slot]
|
|
|
|
mov eax, [eax + APPDATA.window]
|
|
|
|
mov ebx, [eax + WDATA.box.width]
|
|
|
|
mov edx, [eax + WDATA.box.height]
|
2012-10-12 20:30:58 +02:00
|
|
|
inc ebx
|
|
|
|
inc edx
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
xor eax, eax
|
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.dc.left], eax
|
|
|
|
mov [esp + BLITTER.dc.top], eax
|
|
|
|
mov [esp + BLITTER.dc.right], ebx
|
|
|
|
mov [esp + BLITTER.dc.bottom], edx
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.sc.left], eax
|
|
|
|
mov [esp + BLITTER.sc.top], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
mov eax, [ecx+24]
|
2012-10-12 20:30:58 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.sc.right], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
mov eax, [ecx+28]
|
2012-10-12 20:30:58 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.sc.bottom], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
mov eax, [ecx]
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.dst_x], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
mov eax, [ecx+4]
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.dst_y], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
mov eax, [ecx+16]
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.src_x], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
mov eax, [ecx+20]
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.src_y], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
mov eax, [ecx+8]
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.w], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
mov eax, [ecx+12]
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.h], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
mov eax, [ecx+32]
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.bitmap], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
mov eax, [ecx+36]
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + BLITTER.stride], eax
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
mov ecx, esp
|
|
|
|
call blit_clip
|
2015-01-05 16:12:40 +01:00
|
|
|
jc .L57
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2023-09-22 18:31:40 +02:00
|
|
|
mov eax, [current_slot]
|
|
|
|
mov eax, [eax + APPDATA.window]
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov ebx, [esp + BLITTER.dst_x]
|
|
|
|
mov ebp, [esp + BLITTER.dst_y]
|
2023-09-22 18:31:40 +02:00
|
|
|
add ebx, [eax + WDATA.box.left]
|
|
|
|
add ebp, [eax + WDATA.box.top]
|
2016-12-07 19:33:17 +01:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
test [esp + .flags], BLIT_CLIENT_RELATIVE
|
2016-12-07 19:33:17 +01:00
|
|
|
jz .no_client_relative
|
|
|
|
|
2023-09-22 18:31:40 +02:00
|
|
|
add ebx, [eax + WDATA.clientbox.left]
|
|
|
|
add ebp, [eax + WDATA.clientbox.top]
|
2016-12-07 19:33:17 +01:00
|
|
|
.no_client_relative:
|
2012-03-07 16:50:41 +01:00
|
|
|
|
|
|
|
mov ecx, ebx
|
2022-02-12 18:27:41 +01:00
|
|
|
add ecx, [esp + BLITTER.w]
|
2012-03-07 16:50:41 +01:00
|
|
|
shl ecx, 16
|
|
|
|
mov cx, bp
|
2022-02-12 18:27:41 +01:00
|
|
|
add ecx, [esp + BLITTER.h]
|
2012-03-07 16:50:41 +01:00
|
|
|
|
2014-01-13 12:16:28 +01:00
|
|
|
mov eax, ebx
|
|
|
|
shl eax, 16
|
|
|
|
mov ax, bp
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + .position], eax
|
2014-01-13 12:16:28 +01:00
|
|
|
|
2011-10-14 23:38:50 +02:00
|
|
|
mov edi, ebp
|
|
|
|
|
2012-03-19 21:56:55 +01:00
|
|
|
; imul edi, [_display.pitch]
|
|
|
|
mov edi, [BPSLine_calc_area+edi*4]
|
2012-03-10 12:37:42 +01:00
|
|
|
; imul ebp, [_display.width]
|
2012-03-19 21:56:55 +01:00
|
|
|
mov ebp, [d_width_calc_area+ebp*4]
|
2012-03-10 12:37:42 +01:00
|
|
|
|
2011-10-14 23:38:50 +02:00
|
|
|
add ebp, ebx
|
2015-01-05 18:59:03 +01:00
|
|
|
add ebp, [_display.win_map]
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [esp + BLITTER.src_y]
|
|
|
|
imul eax, [esp + BLITTER.stride]
|
|
|
|
mov esi, [esp + BLITTER.src_x]
|
|
|
|
lea esi, [eax + esi*4]
|
|
|
|
add esi, [esp + BLITTER.bitmap]
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2012-03-07 16:50:41 +01:00
|
|
|
mov eax, ecx
|
2022-02-12 18:27:41 +01:00
|
|
|
mov ecx, [esp + BLITTER.h]
|
|
|
|
mov edx, [esp + BLITTER.w]
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
test ecx, ecx ;FIXME check clipping
|
|
|
|
jz .L57
|
|
|
|
|
|
|
|
test edx, edx
|
|
|
|
jz .L57
|
|
|
|
|
2014-11-01 18:26:42 +01:00
|
|
|
cmp [_display.bits_per_pixel], 32
|
2011-10-14 23:38:50 +02:00
|
|
|
jne .core_24
|
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
lea edi, [edi + ebx*4]
|
2011-10-14 23:38:50 +02:00
|
|
|
|
2021-06-17 11:41:16 +02:00
|
|
|
mov ebx, [current_slot_idx]
|
2014-01-13 12:16:28 +01:00
|
|
|
; check for hardware cursor
|
|
|
|
cmp [_display.select_cursor], select_cursor
|
|
|
|
jne .core_32.hardware_cursor
|
|
|
|
;--------------------------------------
|
|
|
|
.core_32.software_cursor:
|
2011-03-01 07:08:11 +01:00
|
|
|
align 4
|
|
|
|
.outer32:
|
|
|
|
|
|
|
|
align 4
|
|
|
|
.inner32:
|
2014-01-13 12:16:28 +01:00
|
|
|
cmp [ebp], bl
|
2012-03-11 18:29:24 +01:00
|
|
|
jne .skip
|
2012-03-07 16:50:41 +01:00
|
|
|
;--------------------------------------
|
2014-01-13 12:16:28 +01:00
|
|
|
mov eax, [esi]
|
2012-03-07 16:50:41 +01:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov ecx, [esp + .position]
|
2012-03-07 16:50:41 +01:00
|
|
|
|
|
|
|
; check mouse area for putpixel
|
|
|
|
call [_display.check_mouse]
|
2012-03-10 18:36:55 +01:00
|
|
|
;--------------------------------------
|
2012-03-07 16:50:41 +01:00
|
|
|
; store to real LFB
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [LFB_BASE + edi], eax
|
2012-03-07 16:50:41 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-03-11 18:29:24 +01:00
|
|
|
.skip:
|
2014-01-13 12:16:28 +01:00
|
|
|
add esi, 4
|
|
|
|
add edi, 4
|
|
|
|
inc ebp
|
2022-02-12 18:27:41 +01:00
|
|
|
add [esp + .position], 1 shl 16
|
2011-10-14 23:38:50 +02:00
|
|
|
dec edx
|
|
|
|
jnz .inner32
|
2011-03-01 07:08:11 +01:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
add esi, [esp + BLITTER.stride]
|
2015-01-05 18:59:03 +01:00
|
|
|
add edi, [_display.lfb_pitch]
|
2011-10-14 23:38:50 +02:00
|
|
|
add ebp, [_display.width]
|
2011-03-01 07:08:11 +01:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov edx, [esp + BLITTER.w]
|
2014-01-13 12:16:28 +01:00
|
|
|
mov eax, edx
|
|
|
|
inc [esp+.position]
|
|
|
|
sub ebp, edx
|
|
|
|
shl eax, 2
|
|
|
|
sub esi, eax
|
|
|
|
sub edi, eax
|
|
|
|
shl eax, 16-2
|
2022-02-12 18:27:41 +01:00
|
|
|
sub [esp + .position], eax
|
|
|
|
dec [esp + BLITTER.h]
|
2011-10-14 23:38:50 +02:00
|
|
|
jnz .outer32
|
2014-01-13 12:16:28 +01:00
|
|
|
jmp .done
|
|
|
|
.core_32.hardware_cursor:
|
|
|
|
align 4
|
|
|
|
.hw.outer32:
|
|
|
|
xor ecx, ecx
|
|
|
|
|
|
|
|
align 4
|
|
|
|
.hw.inner32:
|
2022-02-12 18:27:41 +01:00
|
|
|
cmp [ebp + ecx], bl
|
2014-01-13 12:16:28 +01:00
|
|
|
jne .hw.skip
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [esi + ecx*4]
|
|
|
|
mov [LFB_BASE + edi + ecx*4], eax
|
2014-01-13 12:16:28 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
.hw.skip:
|
|
|
|
inc ecx
|
|
|
|
dec edx
|
|
|
|
jnz .hw.inner32
|
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
add esi, [esp + BLITTER.stride]
|
2015-01-05 18:59:03 +01:00
|
|
|
add edi, [_display.lfb_pitch]
|
2014-01-13 12:16:28 +01:00
|
|
|
add ebp, [_display.width]
|
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov edx, [esp + BLITTER.w]
|
|
|
|
dec [esp + BLITTER.h]
|
2014-01-13 12:16:28 +01:00
|
|
|
jnz .hw.outer32
|
2011-03-01 07:08:11 +01:00
|
|
|
|
|
|
|
.done:
|
2012-03-12 19:26:37 +01:00
|
|
|
; call [draw_pointer]
|
2012-10-12 20:30:58 +02:00
|
|
|
; call __sys_draw_pointer
|
2011-03-01 07:08:11 +01:00
|
|
|
.L57:
|
2014-01-13 12:16:28 +01:00
|
|
|
add esp, .local_vars_size
|
2011-10-14 23:38:50 +02:00
|
|
|
pop ebx
|
|
|
|
pop esi
|
|
|
|
pop edi
|
|
|
|
pop ebp
|
2011-03-01 07:08:11 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
.core_24:
|
2014-11-03 16:12:21 +01:00
|
|
|
cmp [_display.bits_per_pixel], 24
|
|
|
|
jne .core_16
|
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
lea ebx, [ebx + ebx*2]
|
|
|
|
lea edi, [LFB_BASE + edi + ebx]
|
2021-06-17 11:41:16 +02:00
|
|
|
mov ebx, [current_slot_idx]
|
2011-03-01 07:08:11 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
.outer24:
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + .extra_var1], edi
|
2011-10-14 23:38:50 +02:00
|
|
|
xor ecx, ecx
|
2011-03-01 07:08:11 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
.inner24:
|
2022-02-12 18:27:41 +01:00
|
|
|
cmp [ebp + ecx], bl ; Does the process own this pixel?
|
2012-03-11 18:29:24 +01:00
|
|
|
jne .skip_1
|
2012-03-07 16:50:41 +01:00
|
|
|
;--------------------------------------
|
|
|
|
push eax
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [esi + ecx*4]
|
2011-03-01 07:08:11 +01:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
lea edi, [edi + ecx*2]
|
2012-03-07 16:50:41 +01:00
|
|
|
|
2012-03-10 18:36:55 +01:00
|
|
|
; check for hardware cursor
|
|
|
|
cmp [_display.select_cursor], select_cursor
|
|
|
|
jne .no_mouseunder_1
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-03-07 16:50:41 +01:00
|
|
|
push ecx
|
|
|
|
|
|
|
|
mov ecx, [esp+4]
|
|
|
|
ror ecx, 16
|
|
|
|
sub ecx, edx
|
|
|
|
rol ecx, 16
|
2022-02-12 18:27:41 +01:00
|
|
|
sub ecx, [esp + BLITTER.h + 8]
|
2012-03-07 16:50:41 +01:00
|
|
|
|
|
|
|
; check mouse area for putpixel
|
|
|
|
call [_display.check_mouse]
|
|
|
|
pop ecx
|
2012-03-10 18:36:55 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.no_mouseunder_1:
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [edi + ecx], ax
|
2011-10-14 23:38:50 +02:00
|
|
|
shr eax, 16
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [edi + ecx+2], al
|
2012-03-07 16:50:41 +01:00
|
|
|
|
|
|
|
pop eax
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-03-11 18:29:24 +01:00
|
|
|
.skip_1:
|
2022-02-12 18:27:41 +01:00
|
|
|
mov edi, [esp + .extra_var1]
|
2011-10-14 23:38:50 +02:00
|
|
|
inc ecx
|
|
|
|
dec edx
|
|
|
|
jnz .inner24
|
2011-03-01 07:08:11 +01:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
add esi, [esp + BLITTER.stride]
|
2015-01-05 18:59:03 +01:00
|
|
|
add edi, [_display.lfb_pitch]
|
2011-10-14 23:38:50 +02:00
|
|
|
add ebp, [_display.width]
|
2011-03-01 07:08:11 +01:00
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov edx, [esp + BLITTER.w]
|
|
|
|
dec [esp + BLITTER.h]
|
2011-10-14 23:38:50 +02:00
|
|
|
jnz .outer24
|
2011-03-01 07:08:11 +01:00
|
|
|
|
2011-10-14 23:38:50 +02:00
|
|
|
jmp .done
|
2014-11-03 16:12:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
.core_16:
|
2022-02-12 18:27:41 +01:00
|
|
|
lea edi, [LFB_BASE + edi + ebx*2]
|
2021-06-17 11:41:16 +02:00
|
|
|
mov ebx, [current_slot_idx]
|
2014-11-03 16:12:21 +01:00
|
|
|
|
2014-11-03 17:03:20 +01:00
|
|
|
.outer16:
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [esp + .extra_var1], edi
|
2014-11-03 16:12:21 +01:00
|
|
|
xor ecx, ecx
|
|
|
|
|
2014-11-03 17:03:20 +01:00
|
|
|
.inner16:
|
2022-02-12 18:27:41 +01:00
|
|
|
cmp [ebp + ecx], bl ; Does the process own this pixel?
|
2014-11-03 16:12:21 +01:00
|
|
|
jne .skip_2
|
|
|
|
;--------------------------------------
|
|
|
|
push eax
|
2022-02-12 18:27:41 +01:00
|
|
|
mov eax, [esi + ecx*4]
|
2014-11-03 16:12:21 +01:00
|
|
|
|
|
|
|
; check for hardware cursor
|
|
|
|
cmp [_display.select_cursor], select_cursor
|
|
|
|
jne .no_mouseunder_2
|
|
|
|
;--------------------------------------
|
|
|
|
push ecx
|
|
|
|
|
|
|
|
mov ecx, [esp+4]
|
|
|
|
ror ecx, 16
|
|
|
|
sub ecx, edx
|
|
|
|
rol ecx, 16
|
2022-02-12 18:27:41 +01:00
|
|
|
sub ecx, [esp + BLITTER.h + 8]
|
2014-11-03 16:12:21 +01:00
|
|
|
|
|
|
|
; check mouse area for putpixel
|
|
|
|
call [_display.check_mouse]
|
|
|
|
pop ecx
|
|
|
|
;--------------------------------------
|
2014-11-03 17:03:20 +01:00
|
|
|
.no_mouseunder_2:
|
2014-11-03 16:12:21 +01:00
|
|
|
; convert to 16 bpp and store to LFB
|
|
|
|
and eax, 00000000111110001111110011111000b
|
|
|
|
shr ah, 2
|
|
|
|
shr ax, 3
|
|
|
|
ror eax, 8
|
|
|
|
add al, ah
|
|
|
|
rol eax, 8
|
2022-02-12 18:27:41 +01:00
|
|
|
mov [edi + ecx*2], ax
|
2014-11-03 16:12:21 +01:00
|
|
|
pop eax
|
|
|
|
;--------------------------------------
|
2014-11-03 17:03:20 +01:00
|
|
|
.skip_2:
|
2022-02-12 18:27:41 +01:00
|
|
|
mov edi, [esp + .extra_var1]
|
2014-11-03 16:12:21 +01:00
|
|
|
inc ecx
|
|
|
|
dec edx
|
|
|
|
jnz .inner16
|
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
add esi, [esp + BLITTER.stride]
|
2015-01-05 18:59:03 +01:00
|
|
|
add edi, [_display.lfb_pitch]
|
2014-11-03 16:12:21 +01:00
|
|
|
add ebp, [_display.width]
|
|
|
|
|
2022-02-12 18:27:41 +01:00
|
|
|
mov edx, [esp + BLITTER.w]
|
|
|
|
dec [esp + BLITTER.h]
|
2014-11-03 16:12:21 +01:00
|
|
|
jnz .outer16
|
|
|
|
|
|
|
|
jmp .done
|
|
|
|
|