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