Subversion Repositories Kolibri OS

Rev

Rev 1951 | Rev 1958 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1951 Rev 1956
Line 39... Line 39...
39
;include    'macros.inc'
39
;include    'macros.inc'
40
include    '../../../../macros.inc'
40
include    '../../../../macros.inc'
41
;---------------------------------------------------------------------
41
;---------------------------------------------------------------------
42
START:
42
START:
43
	pushad
43
	pushad
-
 
44
	mov	eax,dword [esp+36]
44
	mov [pointer],eax
45
	mov [pointer],eax
45
	mov eax,[eax+4]
46
	mov eax,[eax+4]
46
	mov [image_file],eax
47
	mov [image_file],eax
47
    mov  esi,[eax+28]
48
	mov  esi,[eax+28]
48
    add  esi,eax
49
	add  esi,eax
49
	mov  edi,esi
50
	mov  edi,esi
50
	mov  ecx,[eax+32]
51
	mov  ecx,[eax+32]
51
;	xor  ebx,ebx
52
;	xor  ebx,ebx
52
;	mov  [raw_area],ebx
53
;	mov  [raw_area],ebx
Line 78... Line 79...
78
	shr  eax,1
79
	shr  eax,1
79
	mov  [ebx+12],eax
80
	mov  [ebx+12],eax
80
@@:
81
@@:
Line 81... Line 82...
81
	
82
	
82
	popad
83
	popad
83
	ret
84
	ret	4
84
;---------------------------------------------------------------------	
85
;---------------------------------------------------------------------	
85
.less_8b:
86
.less_8b:
86
	mov edx,[image_file]
87
	mov edx,[image_file]
87
	mov ecx,[area_size]
88
	mov ecx,[area_size]
Line 92... Line 93...
92
	
93
	
93
	mov ecx,[area_size]
94
	mov ecx,[area_size]
94
	mov  eax,ecx
95
	mov  eax,ecx
95
	shr  ecx,2
96
	shr  ecx,2
96
	test eax,3
97
	test eax,3
97
    jz  @f
98
	jz  @f
98
    inc  ecx
99
	inc  ecx
99
@@:
100
@@:
100
	mov  esi,[raw_area]
101
	mov  esi,[raw_area]
101
	mov  edi,[image_file]
102
	mov  edi,[image_file]
102
	add  edi,[edi+28]
103
	add  edi,[edi+28]
Line 107... Line 108...
107
	mcall 68,13
108
	mcall 68,13
108
	mov eax,[image_file]
109
	mov eax,[image_file]
109
	mov ebx,[pointer]
110
	mov ebx,[pointer]
110
	mov [ebx+4],eax
111
	mov [ebx+4],eax
111
	popad
112
	popad
112
	ret
113
	ret	4
113
;---------------------------------------------------------------------	
114
;---------------------------------------------------------------------	
114
.16b:
115
.16b:
115
    cmp  [eax+18],word 3
116
	cmp  [eax+18],word 3
116
	je   @f   ;.convert_16_in_8
117
	je   @f   ;.convert_16_in_8
117
    cmp  [eax+18],word 4
118
	cmp  [eax+18],word 4
118
	jne  .16b_1
119
	jne  .16b_1
119
@@:
120
@@:
120
    xor  ebx,ebx
121
	xor  ebx,ebx
121
	mov  bx,[eax+18]
122
	mov  bx,[eax+18]
Line 122... Line 123...
122
	
123
	
123
	xchg  eax,ecx
124
	xchg  eax,ecx
124
	xor  edx,edx
125
	xor  edx,edx
125
	div  ebx
126
	div  ebx
Line 126... Line 127...
126
	xchg  ecx,eax
127
	xchg  ecx,eax
Line 127... Line 128...
127
	
128
	
128
	shr  ecx,1
129
	shr  ecx,1
129
	
130
	
130
	mov  [eax+16],word 8
131
	mov  [eax+16],word 8
Line 131... Line 132...
131
    mov  ebx,[eax+12]
132
	mov  ebx,[eax+12]
132
	shr  ebx,1
133
	shr  ebx,1
Line 158... Line 159...
158
	dec ecx
159
	dec ecx
159
	jnz .convert_16_in_8 
160
	jnz .convert_16_in_8 
160
	jmp .16b_end
161
	jmp .16b_end
161
;---------------------------------------------------------------------
162
;---------------------------------------------------------------------
162
.16b_1:
163
.16b_1:
163
    cmp  [eax+18],word 1
164
	cmp  [eax+18],word 1
164
	je   @f  ;.convert_16_in_8_1
165
	je   @f  ;.convert_16_in_8_1
165
    cmp  [eax+18],word 2
166
	cmp  [eax+18],word 2
166
	jne  .16b_end
167
	jne  .16b_end
167
@@:
168
@@:
168
	shr  ecx,1
169
	shr  ecx,1
Line 169... Line 170...
169
	
170
	
170
	mov  [eax+16],word 8
171
	mov  [eax+16],word 8
171
    mov  ebx,[eax+12]
172
	mov  ebx,[eax+12]
172
	shr  ebx,1
173
	shr  ebx,1
Line 173... Line 174...
173
	mov  [eax+12],ebx
174
	mov  [eax+12],ebx
174
	
175
	
175
.convert_16_in_8_1:
176
.convert_16_in_8_1:
176
   cld
177
	cld
177
   lodsw
178
	lodsw
178
;   shr ax,8
179
;	shr ax,8
179
;	mov al,ah
180
;	mov al,ah
180
   stosb
181
	stosb
181
   dec ecx
182
	dec ecx
182
   jnz .convert_16_in_8_1
183
	jnz .convert_16_in_8_1
183
;---------------------------------------------------------------------
184
;---------------------------------------------------------------------
184
.16b_end:
185
.16b_end:
185
    xor  eax,eax
186
	xor  eax,eax
186
	mov  [raw_area],eax
187
	mov  [raw_area],eax
187
	jmp .ret_ok
188
	jmp .ret_ok
188
;---------------------------------------------------------------------	
189
;---------------------------------------------------------------------	
Line 211... Line 212...
211
	
212
	
212
	jmp .less_8b  ;.ret_ok
213
	jmp .less_8b  ;.ret_ok
213
;---------------------------------------------------------------------
214
;---------------------------------------------------------------------
214
.2b:
215
.2b:
215
	call .get_memory
216
	call .get_memory
216
;    jmp .ret_ok
217
;	jmp .ret_ok
217
;	shr  ecx,1
218
;	shr  ecx,1
218
	mov  edx,ebx
219
	mov  edx,ebx
219
	mov  eax,ebx
220
	mov  eax,ebx
220
	shr  ebx,2
221
	shr  ebx,2
221
	test eax,3
222
	test eax,3
222
    jz  @f
223
	jz  @f
223
    inc  ebx
224
	inc  ebx
224
@@:
225
@@:
225
	mov  ebp,ebx
226
	mov  ebp,ebx
226
.2b_1:
227
.2b_1:
227
	push ebp edi
228
	push ebp edi
Line 264... Line 265...
264
	call .get_memory
265
	call .get_memory
265
	mov  edx,ebx
266
	mov  edx,ebx
266
	mov  eax,ebx
267
	mov  eax,ebx
267
	shr  ebx,3
268
	shr  ebx,3
268
	test eax,7
269
	test eax,7
269
    jz  @f
270
	jz  @f
270
    inc  ebx
271
	inc  ebx
271
@@:
272
@@:
272
	mov  ebp,ebx
273
	mov  ebp,ebx
273
.1b_1:
274
.1b_1:
274
	push ebp edi
275
	push ebp edi
275
@@:
276
@@:
Line 351... Line 352...
351
	pushad
352
	pushad
352
	mov [pointer],eax
353
	mov [pointer],eax
353
	mov eax,[eax+4]
354
	mov eax,[eax+4]
354
	mov [image_file],eax
355
	mov [image_file],eax
Line 355... Line 356...
355
 
356
 
356
    mov  esi,[eax+28]
357
	mov  esi,[eax+28]
Line 357... Line 358...
357
    add  esi,eax
358
	add  esi,eax
358
 
359
 
Line 359... Line 360...
359
	mov  ebp,[eax+20]
360
	mov  ebp,[eax+20]
360
    add  ebp,eax
361
	add  ebp,eax
361
	
362
	
362
	mov  ecx,[eax+4]
363
	mov  ecx,[eax+4]
Line 380... Line 381...
380
.ret_ok:
381
.ret_ok:
381
	mov ebx,[pointer]
382
	mov ebx,[pointer]
382
	mov  eax,[raw_area]
383
	mov  eax,[raw_area]
383
	mov  [ebx+20],eax  ; store RAW pointer
384
	mov  [ebx+20],eax  ; store RAW pointer
384
	popad
385
	popad
385
	ret
386
	ret	4
Line 386... Line 387...
386
 
387
 
387
;---------------------------------------------------------------------
388
;---------------------------------------------------------------------
388
.32b:
389
.32b:
389
	cld
390
	cld