Rev 5677 | Rev 5722 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5663 | hidnplayr | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
3 | ;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;; |
||
4 | ;; Distributed under terms of the GNU General Public License ;; |
||
5 | ;; ;; |
||
6 | ;; VNC client for KolibriOS ;; |
||
7 | ;; ;; |
||
8 | ;; Written by hidnplayr@kolibrios.org ;; |
||
9 | ;; ;; |
||
10 | ;; GNU GENERAL PUBLIC LICENSE ;; |
||
11 | ;; Version 2, June 1991 ;; |
||
12 | ;; ;; |
||
13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
3545 | hidnplayr | 14 | |
5663 | hidnplayr | 15 | encoding_raw: |
3545 | hidnplayr | 16 | |
5663 | hidnplayr | 17 | DEBUGF 1,"RAW\n" |
3545 | hidnplayr | 18 | |
5668 | hidnplayr | 19 | mov eax, [rectangle.width] |
20 | mov ebx, [rectangle.height] |
||
5663 | hidnplayr | 21 | mul ebx |
5677 | hidnplayr | 22 | if BITS_PER_PIXEL = 16 |
23 | shl eax, 1 |
||
24 | else if BITS_PER_PIXEL = 24 |
||
25 | lea eax, [eax*2+eax] |
||
26 | end if |
||
27 | @@: |
||
28 | push eax |
||
5663 | hidnplayr | 29 | add eax, esi |
30 | cmp [datapointer], eax |
||
31 | jae @f |
||
32 | call read_data.more |
||
33 | pop eax |
||
34 | jmp @b |
||
35 | @@: |
||
5677 | hidnplayr | 36 | pop eax |
3545 | hidnplayr | 37 | |
5668 | hidnplayr | 38 | mov eax, [rectangle.y] |
5663 | hidnplayr | 39 | movzx ebx, [screen.width] |
40 | mul ebx ; [screen.width]*[rectangle.y] |
||
5716 | hidnplayr | 41 | add eax, [rectangle.x] ; [screen.width]*[rectangle.y]+[rectangle.x] |
5663 | hidnplayr | 42 | lea edi, [framebuffer_data+eax*3] ; edi = framebuffer_data+([screen.width]*[rectangle.y]+[rectangle.x])*3 |
3545 | hidnplayr | 43 | |
5663 | hidnplayr | 44 | movzx eax, [screen.width] |
5668 | hidnplayr | 45 | sub eax, [rectangle.width] |
5663 | hidnplayr | 46 | lea ebp, [eax*3] ; ebp = ([screen.width]-[rectangle.width])*3 |
3545 | hidnplayr | 47 | |
5668 | hidnplayr | 48 | mov edx, [rectangle.height] |
3545 | hidnplayr | 49 | |
5663 | hidnplayr | 50 | .lineloop: |
5668 | hidnplayr | 51 | mov ecx, [rectangle.width] |
5677 | hidnplayr | 52 | if BITS_PER_PIXEL = 24 |
53 | lea ecx, [ecx*2+ecx] |
||
54 | end if |
||
3545 | hidnplayr | 55 | |
5677 | hidnplayr | 56 | if BITS_PER_PIXEL = 8 |
5663 | hidnplayr | 57 | .pixelloop: |
5677 | hidnplayr | 58 | mov bl, 85 |
5663 | hidnplayr | 59 | mov al, [esi] |
5677 | hidnplayr | 60 | shr al, 6 |
5663 | hidnplayr | 61 | and al, 3 |
62 | mul bl |
||
5677 | hidnplayr | 63 | stosb ; blue |
64 | mov bl, 36 |
||
5663 | hidnplayr | 65 | mov al, [esi] |
5677 | hidnplayr | 66 | shr al, 3 |
67 | and al, 7 |
||
5663 | hidnplayr | 68 | mul bl |
5677 | hidnplayr | 69 | stosb ; green |
5663 | hidnplayr | 70 | mov al, [esi] |
5677 | hidnplayr | 71 | and al, 7 |
5663 | hidnplayr | 72 | mul bl |
5677 | hidnplayr | 73 | stosb ; red |
5663 | hidnplayr | 74 | inc esi |
75 | dec ecx |
||
76 | jnz .pixelloop |
||
5677 | hidnplayr | 77 | else if BITS_PER_PIXEL = 16 |
78 | .pixelloop: |
||
79 | lodsw |
||
80 | mov bx, ax |
||
81 | shl al, 3 |
||
82 | and al, 0xf8 |
||
83 | stosb ; blue |
||
84 | mov ax, bx |
||
85 | shr ax, 3 |
||
86 | and al, 0xfc |
||
87 | stosb ; green |
||
88 | mov al, bh |
||
89 | and al, 0xf8 |
||
90 | stosb ; red |
||
91 | dec ecx |
||
92 | jnz .pixelloop |
||
93 | else if BITS_PER_PIXEL = 24 |
||
94 | rep movsb |
||
95 | end if |
||
3545 | hidnplayr | 96 | |
5663 | hidnplayr | 97 | add edi, ebp |
98 | dec edx |
||
99 | jnz .lineloop |
||
100 | jmp next_rectangle |