Subversion Repositories Kolibri OS

Rev

Rev 260 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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