Rev 5722 | 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] |
||
5722 | hidnplayr | 26 | else if BITS_PER_PIXEL = 32 |
27 | shl eax, 2 |
||
5677 | hidnplayr | 28 | end if |
29 | @@: |
||
30 | push eax |
||
5663 | hidnplayr | 31 | add eax, esi |
32 | cmp [datapointer], eax |
||
33 | jae @f |
||
34 | call read_data.more |
||
35 | pop eax |
||
36 | jmp @b |
||
37 | @@: |
||
5677 | hidnplayr | 38 | pop eax |
3545 | hidnplayr | 39 | |
5668 | hidnplayr | 40 | mov eax, [rectangle.y] |
5663 | hidnplayr | 41 | movzx ebx, [screen.width] |
42 | mul ebx ; [screen.width]*[rectangle.y] |
||
5716 | hidnplayr | 43 | add eax, [rectangle.x] ; [screen.width]*[rectangle.y]+[rectangle.x] |
5722 | hidnplayr | 44 | lea edi, [framebuffer+eax*3] ; edi = framebuffer_data+([screen.width]*[rectangle.y]+[rectangle.x])*3 |
3545 | hidnplayr | 45 | |
5663 | hidnplayr | 46 | movzx eax, [screen.width] |
5668 | hidnplayr | 47 | sub eax, [rectangle.width] |
5663 | hidnplayr | 48 | lea ebp, [eax*3] ; ebp = ([screen.width]-[rectangle.width])*3 |
3545 | hidnplayr | 49 | |
5668 | hidnplayr | 50 | mov edx, [rectangle.height] |
3545 | hidnplayr | 51 | |
5663 | hidnplayr | 52 | .lineloop: |
5668 | hidnplayr | 53 | mov ecx, [rectangle.width] |
3545 | hidnplayr | 54 | |
5677 | hidnplayr | 55 | if BITS_PER_PIXEL = 8 |
5663 | hidnplayr | 56 | .pixelloop: |
5750 | hidnplayr | 57 | xor eax, eax |
58 | lodsb |
||
59 | mov eax, [lut_8bpp+eax*4] |
||
60 | stosw |
||
61 | shr eax, 16 |
||
62 | stosb |
||
5663 | hidnplayr | 63 | dec ecx |
64 | jnz .pixelloop |
||
5677 | hidnplayr | 65 | else if BITS_PER_PIXEL = 16 |
66 | .pixelloop: |
||
67 | lodsw |
||
68 | mov bx, ax |
||
69 | shl al, 3 |
||
70 | and al, 0xf8 |
||
71 | stosb ; blue |
||
72 | mov ax, bx |
||
73 | shr ax, 3 |
||
74 | and al, 0xfc |
||
75 | stosb ; green |
||
76 | mov al, bh |
||
77 | and al, 0xf8 |
||
78 | stosb ; red |
||
79 | dec ecx |
||
80 | jnz .pixelloop |
||
81 | else if BITS_PER_PIXEL = 24 |
||
5750 | hidnplayr | 82 | lea ecx, [ecx*2+ecx] |
5677 | hidnplayr | 83 | rep movsb |
5722 | hidnplayr | 84 | else if BITS_PER_PIXEL = 32 |
85 | .pixelloop: |
||
86 | movsw |
||
87 | movsb |
||
88 | inc esi |
||
89 | dec ecx |
||
90 | jnz .pixelloop |
||
5677 | hidnplayr | 91 | end if |
3545 | hidnplayr | 92 | |
5663 | hidnplayr | 93 | add edi, ebp |
94 | dec edx |
||
95 | jnz .lineloop |
||
96 | jmp next_rectangle |