2015-08-03 15:32:28 +03:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
|
|
|
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;;
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;; VNC client for KolibriOS ;;
|
|
|
|
;; ;;
|
|
|
|
;; Written by hidnplayr@kolibrios.org ;;
|
|
|
|
;; ;;
|
|
|
|
;; GNU GENERAL PUBLIC LICENSE ;;
|
|
|
|
;; Version 2, June 1991 ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
encoding_raw:
|
|
|
|
|
|
|
|
DEBUGF 1,"RAW\n"
|
|
|
|
|
2015-08-03 21:07:56 +03:00
|
|
|
mov eax, [rectangle.width]
|
|
|
|
mov ebx, [rectangle.height]
|
2015-08-03 15:32:28 +03:00
|
|
|
mul ebx
|
2015-08-04 19:29:37 +03:00
|
|
|
if BITS_PER_PIXEL = 16
|
|
|
|
shl eax, 1
|
|
|
|
else if BITS_PER_PIXEL = 24
|
|
|
|
lea eax, [eax*2+eax]
|
|
|
|
end if
|
2015-08-03 15:32:28 +03:00
|
|
|
@@:
|
2015-08-04 19:29:37 +03:00
|
|
|
push eax
|
|
|
|
add eax, esi
|
2015-08-03 15:32:28 +03:00
|
|
|
cmp [datapointer], eax
|
|
|
|
jae @f
|
|
|
|
call read_data.more
|
|
|
|
pop eax
|
|
|
|
jmp @b
|
|
|
|
@@:
|
2015-08-04 19:29:37 +03:00
|
|
|
pop eax
|
2015-08-03 15:32:28 +03:00
|
|
|
|
2015-08-03 21:07:56 +03:00
|
|
|
mov eax, [rectangle.y]
|
2015-08-03 15:32:28 +03:00
|
|
|
movzx ebx, [screen.width]
|
|
|
|
mul ebx ; [screen.width]*[rectangle.y]
|
2015-08-03 21:07:56 +03:00
|
|
|
mov ebx, [rectangle.x]
|
2015-08-03 15:32:28 +03:00
|
|
|
add eax, ebx ; [screen.width]*[rectangle.y]+[rectangle.x]
|
|
|
|
lea edi, [framebuffer_data+eax*3] ; edi = framebuffer_data+([screen.width]*[rectangle.y]+[rectangle.x])*3
|
|
|
|
|
|
|
|
movzx eax, [screen.width]
|
2015-08-03 21:07:56 +03:00
|
|
|
sub eax, [rectangle.width]
|
2015-08-03 15:32:28 +03:00
|
|
|
lea ebp, [eax*3] ; ebp = ([screen.width]-[rectangle.width])*3
|
|
|
|
|
2015-08-03 21:07:56 +03:00
|
|
|
mov edx, [rectangle.height]
|
2015-08-03 15:32:28 +03:00
|
|
|
|
|
|
|
.lineloop:
|
2015-08-03 21:07:56 +03:00
|
|
|
mov ecx, [rectangle.width]
|
2015-08-04 19:29:37 +03:00
|
|
|
if BITS_PER_PIXEL = 24
|
|
|
|
lea ecx, [ecx*2+ecx]
|
|
|
|
end if
|
2015-08-03 15:32:28 +03:00
|
|
|
|
2015-08-04 19:29:37 +03:00
|
|
|
if BITS_PER_PIXEL = 8
|
2015-08-03 15:32:28 +03:00
|
|
|
.pixelloop:
|
2015-08-04 19:29:37 +03:00
|
|
|
mov bl, 85
|
2015-08-03 15:32:28 +03:00
|
|
|
mov al, [esi]
|
2015-08-04 19:29:37 +03:00
|
|
|
shr al, 6
|
2015-08-03 15:32:28 +03:00
|
|
|
and al, 3
|
|
|
|
mul bl
|
2015-08-04 19:29:37 +03:00
|
|
|
stosb ; blue
|
|
|
|
mov bl, 36
|
2015-08-03 15:32:28 +03:00
|
|
|
mov al, [esi]
|
2015-08-04 19:29:37 +03:00
|
|
|
shr al, 3
|
|
|
|
and al, 7
|
2015-08-03 15:32:28 +03:00
|
|
|
mul bl
|
2015-08-04 19:29:37 +03:00
|
|
|
stosb ; green
|
2015-08-03 15:32:28 +03:00
|
|
|
mov al, [esi]
|
2015-08-04 19:29:37 +03:00
|
|
|
and al, 7
|
2015-08-03 15:32:28 +03:00
|
|
|
mul bl
|
2015-08-04 19:29:37 +03:00
|
|
|
stosb ; red
|
2015-08-03 15:32:28 +03:00
|
|
|
inc esi
|
|
|
|
dec ecx
|
|
|
|
jnz .pixelloop
|
2015-08-04 19:29:37 +03:00
|
|
|
else if BITS_PER_PIXEL = 16
|
|
|
|
.pixelloop:
|
|
|
|
lodsw
|
|
|
|
mov bx, ax
|
|
|
|
shl al, 3
|
|
|
|
and al, 0xf8
|
|
|
|
stosb ; blue
|
|
|
|
mov ax, bx
|
|
|
|
shr ax, 3
|
|
|
|
and al, 0xfc
|
|
|
|
stosb ; green
|
|
|
|
mov al, bh
|
|
|
|
and al, 0xf8
|
|
|
|
stosb ; red
|
|
|
|
dec ecx
|
|
|
|
jnz .pixelloop
|
|
|
|
else if BITS_PER_PIXEL = 24
|
|
|
|
rep movsb
|
|
|
|
end if
|
2015-08-03 15:32:28 +03:00
|
|
|
|
|
|
|
add edi, ebp
|
|
|
|
dec edx
|
|
|
|
jnz .lineloop
|
|
|
|
jmp next_rectangle
|