Subversion Repositories Kolibri OS

Rev

Rev 5668 | Rev 5716 | 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]
5668 hidnplayr 41
        mov     ebx, [rectangle.x]
5663 hidnplayr 42
        add     eax, ebx                                ; [screen.width]*[rectangle.y]+[rectangle.x]
43
        lea     edi, [framebuffer_data+eax*3]           ; edi = framebuffer_data+([screen.width]*[rectangle.y]+[rectangle.x])*3
3545 hidnplayr 44
 
5663 hidnplayr 45
        movzx   eax, [screen.width]
5668 hidnplayr 46
        sub     eax, [rectangle.width]
5663 hidnplayr 47
        lea     ebp, [eax*3]                            ; ebp = ([screen.width]-[rectangle.width])*3
3545 hidnplayr 48
 
5668 hidnplayr 49
        mov     edx, [rectangle.height]
3545 hidnplayr 50
 
5663 hidnplayr 51
  .lineloop:
5668 hidnplayr 52
        mov     ecx, [rectangle.width]
5677 hidnplayr 53
if BITS_PER_PIXEL = 24
54
        lea     ecx, [ecx*2+ecx]
55
end if
3545 hidnplayr 56
 
5677 hidnplayr 57
if BITS_PER_PIXEL = 8
5663 hidnplayr 58
  .pixelloop:
5677 hidnplayr 59
        mov     bl, 85
5663 hidnplayr 60
        mov     al, [esi]
5677 hidnplayr 61
        shr     al, 6
5663 hidnplayr 62
        and     al, 3
63
        mul     bl
5677 hidnplayr 64
        stosb                   ; blue
65
        mov     bl, 36
5663 hidnplayr 66
        mov     al, [esi]
5677 hidnplayr 67
        shr     al, 3
68
        and     al, 7
5663 hidnplayr 69
        mul     bl
5677 hidnplayr 70
        stosb                   ; green
5663 hidnplayr 71
        mov     al, [esi]
5677 hidnplayr 72
        and     al, 7
5663 hidnplayr 73
        mul     bl
5677 hidnplayr 74
        stosb                   ; red
5663 hidnplayr 75
        inc     esi
76
        dec     ecx
77
        jnz     .pixelloop
5677 hidnplayr 78
else if BITS_PER_PIXEL = 16
79
  .pixelloop:
80
        lodsw
81
        mov     bx, ax
82
        shl     al, 3
83
        and     al, 0xf8
84
        stosb                   ; blue
85
        mov     ax, bx
86
        shr     ax, 3
87
        and     al, 0xfc
88
        stosb                   ; green
89
        mov     al, bh
90
        and     al, 0xf8
91
        stosb                   ; red
92
        dec     ecx
93
        jnz     .pixelloop
94
else if BITS_PER_PIXEL = 24
95
        rep movsb
96
end if
3545 hidnplayr 97
 
5663 hidnplayr 98
        add     edi, ebp
99
        dec     edx
100
        jnz     .lineloop
101
        jmp     next_rectangle