Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
260 hidnplayr 1
encoding_raw:
2
    DEBUGF 1,'FRAME: RAW\n'
3
 
4
    mov   ax,[screen.width]		      ;
5
    mov   bx,[frame.y]			      ;
6
    mul   bx				      ;
7
    DEBUGF 1,'screen.width*frame.y=%u\n',ax
8
    mov   bx,3				      ;
9
    mul   bx				      ;
10
    shl   edx,16			      ;
11
    mov   dx,ax 			      ;
12
    mov   ebx,edx			      ; mov ebx,[screen.width]*[frame.y]*3
13
    push  ebx
14
    DEBUGF 1,'screen.width*frame.y*3=%u\n',edx
15
    mov   ax,[frame.x]			      ;
16
    mov   bx,3				      ;
17
    mul   bx				      ;
18
    shl   edx,16			      ;
19
    mov   dx,ax 			      ;
20
    pop   ebx
21
    add   ebx,edx			      ; add ebx,[frame.x]*3
22
    add   ebx,framebuffer_data		      ; add ebx,framebuffer_data
23
    push  ebx
24
    DEBUGF 1,'frame.x*3=%u\n',edx
25
 
26
    mov   ax,[frame.width]		      ;
27
    mov   bx,3				      ;
28
    mul   bx				      ;
29
    shl   edx,16			      ;
30
    mov   dx,ax 			      ;
31
    DEBUGF 1,'frame.width*3=%u\n',edx
32
    pop   ebx
33
    add   edx,ebx			      ; mov edx,ebx+[frame.width]*3
34
 
35
    push  ebx
36
    push  edx				      ;
37
    mov   ax,[frame.height]		      ;
38
    mov   bx,3				      ;
39
    mul   bx				      ;
40
    mov   bx,[screen.width]		      ;
41
    mul   bx				      ;
42
    shl   edx,16			      ;
43
    mov   dx,ax 			      ;
44
    mov   ecx,edx			      ;
45
    pop   edx				      ;
46
    DEBUGF 1,'frame.height*screen.width*3=%u\n',ecx
47
    add   ecx,edx			      ; mov ecx,edx+[frame.height]*[screen.width]*3
48
    pop   ebx
49
 
50
    DEBUGF 1,'FRAME: framebuffer:%u ebx:%u ecx:%u edx:%u\n',framebuffer_data,ebx,ecx,edx
51
 
52
   .pixelloop32:
53
    cmp   ebx,ecx
54
    jge   next_rectangle
55
 
56
    add   esi,2 	  ; 32 bit code RAW
57
    mov   al,[esi]	  ;
58
    mov   [ebx],al	  ;
59
    inc   ebx		  ;
60
    dec   esi		  ;
61
			  ;
62
    mov   al,[esi]	  ;
63
    mov   [ebx],al	  ;
64
    inc   ebx		  ;
65
    dec   esi		  ;
66
			  ;
67
    mov   al,[esi]	  ;
68
    mov   [ebx],al	  ;
69
    inc   ebx		  ;
70
    add   esi,4 	  ;
71
 
72
;    mov   ax,[esi]        ; 16 bit code RAW
73
;    and   ax,32
74
;    mov   [ebx],al
75
;    inc   ebx
76
;
77
;    mov   ax,[esi]
78
;    shr   ax,5
79
;    and   ax,32
80
;    mov   [ebx],al
81
;    inc   ebx
82
;
83
;    mov   ax,[esi]
84
;    shr   ax,10
85
;    and   ax,64
86
;    mov   [ebx],al
87
;    inc   ebx
88
;    inc   esi
89
;    inc   esi
90
 
91
 
92
;    mov   al,[esi]        ; 8 bit code RAW
93
;    and   al,7            ;
94
;    mov   byte[ebx],0xff;al        ;
95
;    inc   ebx             ;
96
;                          ;
97
;    mov   al,[esi]        ;
98
;    shr   al,3            ;
99
;    and   al,7            ;
100
;    mov   [ebx],al        ;
101
;    inc   ebx             ;
102
;                          ;
103
;    mov   al,[esi]        ;
104
;    shr   al,6            ;
105
;    and   al,3            ;
106
;    mov   [ebx],al        ;
107
;    inc   ebx             ;
108
;                          ;
109
;    inc   esi             ;
110
 
111
 
112
    cmp   ebx,edx
113
    jl	  .pixelloop32
114
 
115
    push  edx
116
    push  ebx
117
    mov   ax,[screen.width]
118
    mov   bx,3
119
    mul   bx
120
    shl   edx,16
121
    mov   dx,ax
122
    mov   eax,edx
123
    pop   ebx
124
    pop   edx
125
 
126
    add   ebx,eax ; eax = [screen.width]*3
127
    add   edx,eax
128
 
129
    push  edx
130
    push  ebx
131
    mov   ax,[frame.width]
132
    mov   bx,3
133
    mul   bx
134
    shl   edx,16
135
    mov   dx,ax
136
    mov   eax,edx
137
    pop   ebx
138
    pop   edx
139
 
140
    sub   ebx,eax ; eax = [frame.width]*3
141
 
142
    jmp   .pixelloop32
143