VNC client: added CopyRect encoding.
git-svn-id: svn://kolibrios.org@5666 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
1284ae36ca
commit
21ae92e9fb
80
programs/network/vncc/copyrect.inc
Normal file
80
programs/network/vncc/copyrect.inc
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; ;;
|
||||||
|
;; 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_copyrect:
|
||||||
|
|
||||||
|
DEBUGF 1,"CopyRect\n"
|
||||||
|
|
||||||
|
@@:
|
||||||
|
lea eax, [esi+4]
|
||||||
|
cmp [datapointer], eax
|
||||||
|
jae @f
|
||||||
|
call read_data.more
|
||||||
|
jmp @b
|
||||||
|
@@:
|
||||||
|
|
||||||
|
push esi
|
||||||
|
|
||||||
|
movzx eax, word[esi+2] ; [src.y]
|
||||||
|
xchg al, ah
|
||||||
|
movzx ebx, [screen.width]
|
||||||
|
mul ebx ; [screen.width]*[src.y]
|
||||||
|
movzx ebx, word[esi] ; [src.x]
|
||||||
|
xchg bl, bh
|
||||||
|
add eax, ebx ; [screen.width]*[src.y]+[src.x]
|
||||||
|
lea esi, [framebuffer_data+eax*3] ; esi = framebuffer_data+([screen.width]*[src.y]+[src.x])*3
|
||||||
|
|
||||||
|
movzx eax, [rectangle.y]
|
||||||
|
movzx ebx, [screen.width]
|
||||||
|
mul ebx ; [screen.width]*[rectangle.y]
|
||||||
|
movzx ebx, [rectangle.x]
|
||||||
|
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]
|
||||||
|
sub ax, [rectangle.width]
|
||||||
|
lea ebp, [eax*3] ; ebp = ([screen.width]-[rectangle.width])*3
|
||||||
|
|
||||||
|
cmp esi, edi
|
||||||
|
ja .copy
|
||||||
|
|
||||||
|
; source pixels come before destination in buffer, copy backwards
|
||||||
|
movzx eax, [rectangle.height]
|
||||||
|
movzx edx, [screen.width]
|
||||||
|
mul edx
|
||||||
|
lea eax, [eax*3-1]
|
||||||
|
add esi, eax
|
||||||
|
add edi, eax
|
||||||
|
|
||||||
|
neg ebp
|
||||||
|
std
|
||||||
|
.copy:
|
||||||
|
|
||||||
|
movzx edx, [rectangle.height]
|
||||||
|
movzx ecx, [rectangle.width]
|
||||||
|
lea ecx, [ecx*3]
|
||||||
|
.lineloop:
|
||||||
|
push ecx
|
||||||
|
rep movsb
|
||||||
|
pop ecx
|
||||||
|
|
||||||
|
add esi, ebp
|
||||||
|
add edi, ebp
|
||||||
|
dec edx
|
||||||
|
jnz .lineloop
|
||||||
|
|
||||||
|
pop esi
|
||||||
|
add esi, 4
|
||||||
|
cld
|
||||||
|
jmp next_rectangle
|
@ -91,7 +91,7 @@ no_security:
|
|||||||
mcall send, [socketnum], pixel_format8, 20, 0
|
mcall send, [socketnum], pixel_format8, 20, 0
|
||||||
DEBUGF 1, "Sending pixel format\n"
|
DEBUGF 1, "Sending pixel format\n"
|
||||||
|
|
||||||
mcall send, [socketnum], encodings, 8, 0
|
mcall send, [socketnum], encodings, 12, 0
|
||||||
DEBUGF 1, "Sending encoding info\n"
|
DEBUGF 1, "Sending encoding info\n"
|
||||||
|
|
||||||
mov [thread_ready], 1
|
mov [thread_ready], 1
|
||||||
@ -165,8 +165,8 @@ rectangle_loop:
|
|||||||
|
|
||||||
cmp eax, 0
|
cmp eax, 0
|
||||||
je encoding_raw
|
je encoding_raw
|
||||||
; cmp eax, 1
|
cmp eax, 1
|
||||||
; je encoding_copyrect
|
je encoding_copyrect
|
||||||
; cmp eax, 2
|
; cmp eax, 2
|
||||||
; je encoding_RRE
|
; je encoding_RRE
|
||||||
; cmp eax, 5
|
; cmp eax, 5
|
||||||
|
@ -67,6 +67,7 @@ ends
|
|||||||
|
|
||||||
include "logon.inc"
|
include "logon.inc"
|
||||||
include "raw.inc"
|
include "raw.inc"
|
||||||
|
include "copyrect.inc"
|
||||||
include "thread.inc"
|
include "thread.inc"
|
||||||
|
|
||||||
START:
|
START:
|
||||||
@ -236,10 +237,13 @@ pixel_format8 db 0 ; setPixelformat
|
|||||||
|
|
||||||
encodings db 2 ; setEncodings
|
encodings db 2 ; setEncodings
|
||||||
db 0 ; padding
|
db 0 ; padding
|
||||||
db 0, 1 ; number of encodings
|
db 0, 2 ; number of encodings
|
||||||
db 0, 0, 0 ,0 ; raw encoding (DWORD, Big endian order)
|
db 0, 0, 0, 0 ; raw encoding (DWORD, Big endian order)
|
||||||
; db 1, 0, 0, 0 ; Copyrect encoding
|
db 0, 0, 0, 1 ; Copyrect encoding
|
||||||
; db
|
; db 0, 0, 0, 2 ; RRE
|
||||||
|
; db 0, 0, 0, 5 ; HexTile
|
||||||
|
; db 0, 0, 0, 15 ; TRLE
|
||||||
|
; db 0, 0, 0, 16 ; ZRLE
|
||||||
|
|
||||||
fbur db 3 ; frame buffer update request
|
fbur db 3 ; frame buffer update request
|
||||||
.inc db 0 ; incremental
|
.inc db 0 ; incremental
|
||||||
|
Loading…
Reference in New Issue
Block a user