Subversion Repositories Kolibri OS

Rev

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

Rev 1951 Rev 1956
1
;---------------------------------------------------------------------
1
;---------------------------------------------------------------------
2
convert_plugin_invoke:
2
convert_plugin_invoke:
3
	mov	eax,[plugin_0_name]
3
	mov	eax,[plugin_0_name]
4
	call	prepare_convert
4
	call	prepare_convert
5
	push	eax
5
	push	eax
6
	call	[Convert_plugin_0.Start]
6
	call	[Convert_plugin_0.Start]
7
	call	check_convert
7
	call	check_convert
8
;-------------------------------    
8
;-------------------------------    
9
	mov	eax,[plugin_1_name]
9
	mov	eax,[plugin_1_name]
10
	call	prepare_convert
10
	call	prepare_convert
11
	push	eax
11
	push	eax
12
	call	[Convert_plugin_1.Start]
12
	call	[Convert_plugin_1.Start]
13
	call	check_convert
13
	call	check_convert
14
;-------------------------------
14
;-------------------------------
15
	mov	eax,[plugin_2_name]
15
	mov	eax,[plugin_2_name]
16
	call	prepare_convert
16
	call	prepare_convert
17
	push	eax
17
	push	eax
18
	call	[Convert_plugin_2.Start]
18
	call	[Convert_plugin_2.Start]
19
	call	check_convert
19
	call	check_convert
20
;-------------------------------
20
;-------------------------------
21
	mov	eax,[plugin_3_name]
21
	mov	eax,[plugin_3_name]
22
	call	prepare_convert
22
	call	prepare_convert
23
	push	eax
23
	push	eax
24
	call	[Convert_plugin_3.Start]
24
	call	[Convert_plugin_3.Start]
25
	call	check_convert
25
	call	check_convert
26
;-------------------------------
26
;-------------------------------
27
	mov	eax,[plugin_4_name]
27
	mov	eax,[plugin_4_name]
28
	call	prepare_convert
28
	call	prepare_convert
29
	push	eax
29
	push	eax
30
	call	[Convert_plugin_4.Start]
30
	call	[Convert_plugin_4.Start]
31
	call	check_convert
31
	call	check_convert
32
;-------------------------------
32
;-------------------------------
33
	mov	eax,[plugin_5_name]
33
	mov	eax,[plugin_5_name]
34
	call	prepare_convert
34
	call	prepare_convert
35
	push	eax
35
	push	eax
36
	call	[Convert_plugin_5.Start]
36
	call	[Convert_plugin_5.Start]
37
	call	check_convert
37
	call	check_convert
38
;-------------------------------
38
;-------------------------------
39
	mov	eax,[plugin_6_name]
39
	mov	eax,[plugin_6_name]
40
	call	prepare_convert
40
	call	prepare_convert
41
	push	eax
41
	push	eax
42
	call	[Convert_plugin_6.Start]
42
	call	[Convert_plugin_6.Start]
43
	call	check_convert
43
	call	check_convert
44
;-------------------------------
44
;-------------------------------
45
	mov	eax,[plugin_7_name]
45
	mov	eax,[plugin_7_name]
46
	call	prepare_convert
46
	call	prepare_convert
47
	push	eax
47
	push	eax
48
	call	[Convert_plugin_7.Start]
48
	call	[Convert_plugin_7.Start]
49
	call	check_convert
49
	call	check_convert
50
;-------------------------------
50
;-------------------------------
51
	mov	eax,[plugin_8_name]
51
	mov	eax,[plugin_8_name]
52
	call	prepare_convert
52
	call	prepare_convert
53
	push	eax
53
	push	eax
54
	call	[Convert_plugin_8.Start]
54
	call	[Convert_plugin_8.Start]
55
	mov	eax,[return_code]
55
	mov	eax,[return_code]
56
	call	check_convert
56
	call	check_convert
57
;-------------------------------
57
;-------------------------------
58
	mov	eax,[plugin_9_name]
58
	mov	eax,[plugin_9_name]
59
	call	prepare_convert
59
	call	prepare_convert
60
	push	eax
60
	push	eax
61
	call	[Convert_plugin_9.Start]
61
	call	[Convert_plugin_9.Start]
62
;-------------------------------
62
;-------------------------------
63
.end:
63
.end:
64
	mov	ecx,[image_file]
64
	mov	ecx,[image_file]
65
	mcall	68, 13,
65
	mcall	68, 13,
66
	ret
66
	ret
67
;---------------------------------------------------------------------
67
;---------------------------------------------------------------------
68
prepare_convert:
68
prepare_convert:
69
	cmp	eax,dword 'NoKe'
69
	cmp	eax,dword 'NoKe'
70
	je	.1  ;@f
70
	je	.1  ;@f
71
	xor	eax,eax
71
	xor	eax,eax
72
	mov	[return_code],eax
72
	mov	[return_code],eax
73
	mov	eax,image_file
73
	mov	eax,image_file
74
	ret
74
	ret
75
.1:
75
.1:
76
	add	esp,4
76
	add	esp,4
77
	jmp	convert_plugin_invoke.end
77
	jmp	convert_plugin_invoke.end
78
;---------------------------------------------------------------------
78
;---------------------------------------------------------------------
79
check_convert:
79
check_convert:
80
	mov   eax,[return_code]
80
	mov   eax,[return_code]
81
	test  eax,eax
81
	test  eax,eax
82
	jz   prepare_convert.1
82
	jz   prepare_convert.1
83
    cmp   eax,dword 2
83
    cmp   eax,dword 2
84
    je   prepare_convert.1
84
    je   prepare_convert.1
85
	ret
85
	ret
86
;---------------------------------------------------------------------	
86
;---------------------------------------------------------------------	
87
convert:
87
convert:
88
	xor  eax,eax
88
	xor  eax,eax
89
	cmp  [error_fs],eax
89
	cmp  [error_fs],eax
90
	jnz   .error
90
	jnz   .error
91
 
91
 
92
	call  convert_plugin_invoke
92
	call  convert_plugin_invoke
93
 
93
 
94
	cmp   [return_code],dword 0
94
	cmp   [return_code],dword 0
95
	je   .all_ok
95
	je   .all_ok
96
	xor  eax,eax
96
	xor  eax,eax
97
;-------------------------------
97
;-------------------------------
98
.error_1:
98
.error_1:
99
	mov  [img_size],eax
99
	mov  [img_size],eax
100
	mov  [img_width],eax
100
	mov  [img_width],eax
101
	mov  [img_width_2],eax
101
	mov  [img_width_2],eax
102
	mov  [img_high],eax
102
	mov  [img_high],eax
103
	mov  [img_high_2],eax
103
	mov  [img_high_2],eax
104
	mov  [img_resolution],eax
104
	mov  [img_resolution],eax
105
	mov  [img_resolution_2],eax
105
	mov  [img_resolution_2],eax
106
	mov  [img_palette],eax 
106
	mov  [img_palette],eax 
107
	mov  [soi],eax
107
	mov  [soi],eax
108
	mov  [file_name],eax
108
	mov  [file_name],eax
109
	mov  [Total_Repeat_N],eax
109
	mov  [Total_Repeat_N],eax
110
	mov  [RAW1_pointer],eax
110
	mov  [RAW1_pointer],eax
111
	mov  [RAW1_flag],al
111
	mov  [RAW1_flag],al
112
	
112
	
113
	mov  [scaling_mode],dword 100
113
	mov  [scaling_mode],dword 100
114
	call error_window
114
	call error_window
115
	ret
115
	ret
116
;-------------------------------
116
;-------------------------------
117
.error:
117
.error:
118
	xor  eax,eax
118
	xor  eax,eax
119
	mov  [return_code],eax
119
	mov  [return_code],eax
120
	jmp .error_1
120
	jmp .error_1
121
;-------------------------------
121
;-------------------------------
122
.all_ok:
122
.all_ok:
123
    mov  ebx,[raw_pointer]
123
    mov  ebx,[raw_pointer]
124
	cmp  [ebx],dword 'RAW1'
124
	cmp  [ebx],dword 'RAW1'
125
	je   RAW1_processing
125
	je   RAW1_processing
126
	xor  eax,eax
126
	xor  eax,eax
127
	mov  [RAW1_flag],al
127
	mov  [RAW1_flag],al
128
	mov  [RAW1_pointer],eax
128
	mov  [RAW1_pointer],eax
129
	inc  eax
129
	inc  eax
130
	mov  [Total_Repeat_N],eax
130
	mov  [Total_Repeat_N],eax
131
	mov  eax,[ebx+4]
131
	mov  eax,[ebx+4]
132
	mov  [img_width],eax
132
	mov  [img_width],eax
133
	mov  [img_width_2],eax
133
	mov  [img_width_2],eax
134
	mov  eax,[ebx+8]
134
	mov  eax,[ebx+8]
135
	mov  [img_high],eax
135
	mov  [img_high],eax
136
	mov  [img_high_2],eax
136
	mov  [img_high_2],eax
137
	mov  eax,[ebx+12]
137
	mov  eax,[ebx+12]
138
	mov  [img_resolution_2],eax
138
	mov  [img_resolution_2],eax
139
;	mov  eax,[ebx+20]
139
;	mov  eax,[ebx+20]
140
;	add  eax,ebx
140
;	add  eax,ebx
141
;	mov  [img_palette],eax    
141
;	mov  [img_palette],eax    
142
;	mov  eax,[ebx+28]
142
;	mov  eax,[ebx+28]
143
;	add  eax,ebx
143
;	add  eax,ebx
144
;	mov  [soi],eax
144
;	mov  [soi],eax
145
;-------------------------------
145
;-------------------------------
146
;	xor  eax,eax
146
;	xor  eax,eax
147
;	mov  [raw_pointer_2],eax
147
;	mov  [raw_pointer_2],eax
148
	mov eax,image_file
148
;	mov eax,image_file
149
;	call [plugin_convert]
149
;	call [plugin_convert]
-
 
150
	push	dword image_file
150
	call [convert_Start]
151
	call	[convert_Start]
151
 
152
 
152
	mov  ebx,[raw_pointer]
153
	mov  ebx,[raw_pointer]
153
	mov  eax,[ebx+12]
154
	mov  eax,[ebx+12]
154
;	cmp  [ebx+18],word 2
155
;	cmp  [ebx+18],word 2
155
;	jne  @f
156
;	jne  @f
156
;	shr  eax,1
157
;	shr  eax,1
157
;@@:
158
;@@:
158
	cmp  eax,15
159
	cmp  eax,15
159
	jne  @f
160
	jne  @f
160
	inc  eax
161
	inc  eax
161
@@:	
162
@@:	
162
	mov  [img_resolution],eax
163
	mov  [img_resolution],eax
163
	
164
	
164
	mov  eax,[ebx+20]
165
	mov  eax,[ebx+20]
165
	add  eax,ebx
166
	add  eax,ebx
166
	mov  [img_palette],eax 
167
	mov  [img_palette],eax 
167
	
168
	
168
	mov  eax,[ebx+28]
169
	mov  eax,[ebx+28]
169
	add  eax,ebx
170
	add  eax,ebx
170
	mov  [soi],eax
171
	mov  [soi],eax
171
 
172
 
172
;    mov  eax,[raw_pointer_2]
173
;    mov  eax,[raw_pointer_2]
173
;    test eax,eax
174
;    test eax,eax
174
;	jz  @f
175
;	jz  @f
175
;    mov  [soi],eax
176
;    mov  [soi],eax
176
;@@:
177
;@@:
177
 
178
 
178
;-------------------------------
179
;-------------------------------
179
;    mov  eax,[img_resolution]
180
;    mov  eax,[img_resolution]
180
;    cmp  eax,32
181
;    cmp  eax,32
181
;    ja   @f
182
;    ja   @f
182
;    cmp  [ebx+18],word 2
183
;    cmp  [ebx+18],word 2
183
;    je   @f
184
;    je   @f
184
;    cmp  [ebx+18],word 1
185
;    cmp  [ebx+18],word 1
185
;    jne  .img_resolution_ok
186
;    jne  .img_resolution_ok
186
;.grayscale_16:
187
;.grayscale_16:
187
;    cmp  eax,16
188
;    cmp  eax,16
188
;    jne  .img_resolution_ok 
189
;    jne  .img_resolution_ok 
189
;    shr  eax,1
190
;    shr  eax,1
190
;    mov  [img_resolution],eax
191
;    mov  [img_resolution],eax
191
;    jmp  .img_resolution_ok    
192
;    jmp  .img_resolution_ok    
192
;@@:
193
;@@:
193
;    shr  eax,1
194
;    shr  eax,1
194
;    cmp  eax,16
195
;    cmp  eax,16
195
;    jne  @f
196
;    jne  @f
196
;    shr  eax,1
197
;    shr  eax,1
197
;@@:
198
;@@:
198
;    mov  [img_resolution],eax
199
;    mov  [img_resolution],eax
199
   
200
   
200
.img_resolution_ok:
201
.img_resolution_ok:
201
	xor  eax,eax
202
	xor  eax,eax
202
	mov  [scroll_bar_data_vertical.position],eax
203
	mov  [scroll_bar_data_vertical.position],eax
203
	mov  [scroll_bar_data_horizontal.position],eax
204
	mov  [scroll_bar_data_horizontal.position],eax
204
    call  get_window_param
205
    call  get_window_param
205
    test  [window_status],1b
206
    test  [window_status],1b
206
    jnz   .end
207
    jnz   .end
207
	cmp  [scaling_mode],dword 100
208
	cmp  [scaling_mode],dword 100
208
	jne   .end
209
	jne   .end
209
    mov  ebx,[img_high]
210
    mov  ebx,[img_high]
210
    mov  eax,[img_width]
211
    mov  eax,[img_width]
211
	test	ebx, ebx
212
	test	ebx, ebx
212
	jns	@f
213
	jns	@f
213
	neg	ebx
214
	neg	ebx
214
@@:
215
@@:
215
    add  eax,9
216
    add  eax,9
216
    cmp  eax,770
217
    cmp  eax,770
217
    jae  @f
218
    jae  @f
218
    mov  eax,770
219
    mov  eax,770
219
@@:
220
@@:
220
    add  ebx,54
221
    add  ebx,54
221
    cmp  ebx,150
222
    cmp  ebx,150
222
    jae  @f
223
    jae  @f
223
    mov  ebx,150
224
    mov  ebx,150
224
@@:
225
@@:
225
    mov  [wnd_width],eax
226
    mov  [wnd_width],eax
226
    mov  [wnd_height],ebx
227
    mov  [wnd_height],ebx
227
	
228
	
228
	mcall 14
229
	mcall 14
229
	
230
	
230
	mov  ebx,eax
231
	mov  ebx,eax
231
	and  eax,0xffff
232
	and  eax,0xffff
232
	shr  ebx,16
233
	shr  ebx,16
233
	inc  eax
234
	inc  eax
234
	inc  ebx
235
	inc  ebx
235
	cmp  eax,[wnd_height]
236
	cmp  eax,[wnd_height]
236
	jae  @f
237
	jae  @f
237
	xor  eax,eax
238
	xor  eax,eax
238
	mov  ax,[scroll_bar_data_vertical.size_x]
239
	mov  ax,[scroll_bar_data_vertical.size_x]
239
	add  [wnd_width],eax
240
	add  [wnd_width],eax
240
@@:	
241
@@:	
241
	cmp  ebx,[wnd_width]
242
	cmp  ebx,[wnd_width]
242
	jae  @f
243
	jae  @f
243
	xor  eax,eax
244
	xor  eax,eax
244
	mov  ax,[scroll_bar_data_horizontal.size_y]
245
	mov  ax,[scroll_bar_data_horizontal.size_y]
245
	add  [wnd_height],eax
246
	add  [wnd_height],eax
246
@@:	
247
@@:	
247
    mov  eax,[wnd_width]
248
    mov  eax,[wnd_width]
248
    mov  ebx,[wnd_height]
249
    mov  ebx,[wnd_height]
249
	
250
	
250
    test [bWasDraw],1
251
    test [bWasDraw],1
251
    jz	 @f
252
    jz	 @f
252
    mov  esi,ebx
253
    mov  esi,ebx
253
    mov  edx,eax
254
    mov  edx,eax
254
    mcall 67,-1,-1
255
    mcall 67,-1,-1
255
@@:
256
@@:
256
.end:
257
.end:
257
    ret
258
    ret
258
;---------------------------------------------------------------------
259
;---------------------------------------------------------------------