2015-08-03 14:32:28 +02: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 20:07:56 +02:00
|
|
|
mov eax, [rectangle.width]
|
|
|
|
mov ebx, [rectangle.height]
|
2015-08-03 14:32:28 +02:00
|
|
|
mul ebx
|
2015-08-04 18:29:37 +02:00
|
|
|
if BITS_PER_PIXEL = 16
|
|
|
|
shl eax, 1
|
|
|
|
else if BITS_PER_PIXEL = 24
|
|
|
|
lea eax, [eax*2+eax]
|
2015-08-14 15:30:03 +02:00
|
|
|
else if BITS_PER_PIXEL = 32
|
|
|
|
shl eax, 2
|
2015-08-04 18:29:37 +02:00
|
|
|
end if
|
2015-08-03 14:32:28 +02:00
|
|
|
@@:
|
2015-08-04 18:29:37 +02:00
|
|
|
push eax
|
|
|
|
add eax, esi
|
2015-08-03 14:32:28 +02:00
|
|
|
cmp [datapointer], eax
|
|
|
|
jae @f
|
|
|
|
call read_data.more
|
|
|
|
pop eax
|
|
|
|
jmp @b
|
|
|
|
@@:
|
2015-08-04 18:29:37 +02:00
|
|
|
pop eax
|
2015-08-03 14:32:28 +02:00
|
|
|
|
2015-08-03 20:07:56 +02:00
|
|
|
mov eax, [rectangle.y]
|
2015-08-03 14:32:28 +02:00
|
|
|
movzx ebx, [screen.width]
|
|
|
|
mul ebx ; [screen.width]*[rectangle.y]
|
2015-08-12 13:47:57 +02:00
|
|
|
add eax, [rectangle.x] ; [screen.width]*[rectangle.y]+[rectangle.x]
|
2015-08-14 15:30:03 +02:00
|
|
|
lea edi, [framebuffer+eax*3] ; edi = framebuffer_data+([screen.width]*[rectangle.y]+[rectangle.x])*3
|
2015-08-03 14:32:28 +02:00
|
|
|
|
|
|
|
movzx eax, [screen.width]
|
2015-08-03 20:07:56 +02:00
|
|
|
sub eax, [rectangle.width]
|
2015-08-03 14:32:28 +02:00
|
|
|
lea ebp, [eax*3] ; ebp = ([screen.width]-[rectangle.width])*3
|
|
|
|
|
2015-08-03 20:07:56 +02:00
|
|
|
mov edx, [rectangle.height]
|
2015-08-03 14:32:28 +02:00
|
|
|
|
|
|
|
.lineloop:
|
2015-08-03 20:07:56 +02:00
|
|
|
mov ecx, [rectangle.width]
|
2015-08-04 18:29:37 +02:00
|
|
|
if BITS_PER_PIXEL = 24
|
|
|
|
lea ecx, [ecx*2+ecx]
|
|
|
|
end if
|
2015-08-03 14:32:28 +02:00
|
|
|
|
2015-08-04 18:29:37 +02:00
|
|
|
if BITS_PER_PIXEL = 8
|
2015-08-03 14:32:28 +02:00
|
|
|
.pixelloop:
|
2015-08-04 18:29:37 +02:00
|
|
|
mov bl, 85
|
2015-08-03 14:32:28 +02:00
|
|
|
mov al, [esi]
|
2015-08-04 18:29:37 +02:00
|
|
|
shr al, 6
|
2015-08-03 14:32:28 +02:00
|
|
|
and al, 3
|
|
|
|
mul bl
|
2015-08-04 18:29:37 +02:00
|
|
|
stosb ; blue
|
|
|
|
mov bl, 36
|
2015-08-03 14:32:28 +02:00
|
|
|
mov al, [esi]
|
2015-08-04 18:29:37 +02:00
|
|
|
shr al, 3
|
|
|
|
and al, 7
|
2015-08-03 14:32:28 +02:00
|
|
|
mul bl
|
2015-08-04 18:29:37 +02:00
|
|
|
stosb ; green
|
2015-08-03 14:32:28 +02:00
|
|
|
mov al, [esi]
|
2015-08-04 18:29:37 +02:00
|
|
|
and al, 7
|
2015-08-03 14:32:28 +02:00
|
|
|
mul bl
|
2015-08-04 18:29:37 +02:00
|
|
|
stosb ; red
|
2015-08-03 14:32:28 +02:00
|
|
|
inc esi
|
|
|
|
dec ecx
|
|
|
|
jnz .pixelloop
|
2015-08-04 18:29:37 +02: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
|
2015-08-14 15:30:03 +02:00
|
|
|
else if BITS_PER_PIXEL = 32
|
|
|
|
.pixelloop:
|
|
|
|
movsw
|
|
|
|
movsb
|
|
|
|
inc esi
|
|
|
|
dec ecx
|
|
|
|
jnz .pixelloop
|
2015-08-04 18:29:37 +02:00
|
|
|
end if
|
2015-08-03 14:32:28 +02:00
|
|
|
|
|
|
|
add edi, ebp
|
|
|
|
dec edx
|
|
|
|
jnz .lineloop
|
|
|
|
jmp next_rectangle
|