Subversion Repositories Kolibri OS

Rev

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

Rev 3423 Rev 3425
1
;*****************************************************************************
1
;*****************************************************************************
2
; zSea - advanced image viewer for KolibriOS
2
; zSea - advanced image viewer for KolibriOS
3
; Copyright (c) 2008-2013, Marat Zakiyanov aka Mario79, aka Mario
3
; Copyright (c) 2008-2013, Marat Zakiyanov aka Mario79, aka Mario
4
; All rights reserved.
4
; All rights reserved.
5
;
5
;
6
; Redistribution and use in source and binary forms, with or without
6
; Redistribution and use in source and binary forms, with or without
7
; modification, are permitted provided that the following conditions are met:
7
; modification, are permitted provided that the following conditions are met:
8
;	 * Redistributions of source code must retain the above copyright
8
;	 * Redistributions of source code must retain the above copyright
9
;	   notice, this list of conditions and the following disclaimer.
9
;	   notice, this list of conditions and the following disclaimer.
10
;	 * Redistributions in binary form must reproduce the above copyright
10
;	 * Redistributions in binary form must reproduce the above copyright
11
;	   notice, this list of conditions and the following disclaimer in the
11
;	   notice, this list of conditions and the following disclaimer in the
12
;	   documentation and/or other materials provided with the distribution.
12
;	   documentation and/or other materials provided with the distribution.
13
;	 * Neither the name of the  nor the
13
;	 * Neither the name of the  nor the
14
;	   names of its contributors may be used to endorse or promote products
14
;	   names of its contributors may be used to endorse or promote products
15
;	   derived from this software without specific prior written permission.
15
;	   derived from this software without specific prior written permission.
16
;
16
;
17
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
17
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
18
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
; DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
20
; DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
21
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
;*****************************************************************************
27
;*****************************************************************************
28
;	v.1.0 rñ5 26.03.2013
28
;	v.1.0 rñ5 26.03.2013
29
;******************************************************************************
29
;******************************************************************************
30
	use32
30
	use32
31
	org 0x0
31
	org 0x0
32
	db 'MENUET01'	; 8 byte id
32
	db 'MENUET01'	; 8 byte id
33
	dd 0x01		; header version
33
	dd 0x01		; header version
34
	dd START	; start of code
34
	dd START	; start of code
35
	dd IM_END	; size of image
35
	dd IM_END	; size of image
36
	dd I_END	; memory for app
36
	dd I_END	; memory for app
37
	dd stacktop	; esp
37
	dd stacktop	; esp
38
	dd temp_area	; I_Param
38
	dd temp_area	; I_Param
39
	dd path		; APPLICATION PACH
39
	dd path		; APPLICATION PACH
40
 
40
 
41
include 'lang.inc'
41
include 'lang.inc'
42
;include 'macros.inc'
42
;include 'macros.inc'
43
;include 'editbox_ex.mac'
43
;include 'editbox_ex.mac'
44
;include 'proc32.inc'
44
;include 'proc32.inc'
45
include '../../macros.inc'
45
include '../../macros.inc'
46
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
46
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
47
include '../../proc32.inc'
47
include '../../proc32.inc'
48
include 'debug.inc'
48
;include 'debug.inc'
49
;include 'load_lib.mac'
49
;include 'load_lib.mac'
50
include '../../develop/libraries/box_lib/load_lib.mac'
50
include '../../develop/libraries/box_lib/load_lib.mac'
51
        @use_library    ;use load lib macros
51
        @use_library    ;use load lib macros
52
;******************************************************************************
52
;******************************************************************************
53
 
53
 
54
START:				; start of execution
54
START:				; start of execution
55
	mcall	68, 11
55
	mcall	68, 11
56
	mcall	66, 1,1
56
	mcall	66, 1,1
57
	mcall 40, 0x27
57
	mcall 40, 0x27
58
 
58
 
59
	mcall 9, procinfo, -1
59
	mcall 9, procinfo, -1
60
	mov	eax,[ebx+30]
60
	mov	eax,[ebx+30]
61
	mov	[PID],eax
61
	mov	[PID],eax
62
	xor	ecx,ecx
62
	xor	ecx,ecx
63
@@:
63
@@:
64
	inc	ecx
64
	inc	ecx
65
	mcall 9, procinfo
65
	mcall 9, procinfo
66
	mov	eax,[PID]
66
	mov	eax,[PID]
67
	cmp	eax,[ebx+30]
67
	cmp	eax,[ebx+30]
68
	jne	@r
68
	jne	@r
69
	mov	[active_process],ecx
69
	mov	[active_process],ecx
70
 
70
 
71
	mcall	48,4
71
	mcall	48,4
72
	mov	[skin_height],eax
72
	mov	[skin_height],eax
73
	
73
	
74
	mcall	68,12,1024
74
	mcall	68,12,1024
75
	mov	[menu_data_1.procinfo],eax
75
	mov	[menu_data_1.procinfo],eax
76
	mov	[menu_data_2.procinfo],eax
76
	mov	[menu_data_2.procinfo],eax
77
	mov	[menu_data_3.procinfo],eax
77
	mov	[menu_data_3.procinfo],eax
78
	mov	[menu_data_4.procinfo],eax
78
	mov	[menu_data_4.procinfo],eax
79
	mov	[menu_data_5.procinfo],eax
79
	mov	[menu_data_5.procinfo],eax
80
	mov	[menu_data_6.procinfo],eax
80
	mov	[menu_data_6.procinfo],eax
81
 
81
 
82
	mov	[load_directory_pointer],dir_header
82
	mov	[load_directory_pointer],dir_header
83
 
83
 
84
 
84
 
85
	call	load_plugins
85
	call	load_plugins
86
 
86
 
87
	;init_checkboxes2 check1,...
87
	;init_checkboxes2 check1,...
88
	push	check1
88
	push	check1
89
	call	[init_checkbox]
89
	call	[init_checkbox]
90
	push	check2
90
	push	check2
91
	call	[init_checkbox]
91
	call	[init_checkbox]
92
 
92
 
93
	call	load_buttons
93
	call	load_buttons
94
 
94
 
95
;	call	init_data_OpenDialog
95
;	call	init_data_OpenDialog
96
 
96
 
97
;init_OpenDialog	OpenDialog_data
97
;init_OpenDialog	OpenDialog_data
98
	push    dword OpenDialog_data
98
	push    dword OpenDialog_data
99
	call    [OpenDialog_Init]
99
	call    [OpenDialog_Init]
100
 
100
 
101
;init_ColorDialog	ColorDialog_data
101
;init_ColorDialog	ColorDialog_data
102
	push    dword ColorDialog_data
102
	push    dword ColorDialog_data
103
	call    [ColorDialog_Init]
103
	call    [ColorDialog_Init]
104
	
104
	
105
	call	get_filter_data
105
	call	get_filter_data
106
 
106
 
107
;-----------------------------------------------------
107
;-----------------------------------------------------
108
; check for parameters
108
; check for parameters
109
	cmp	dword [temp_area],'BOOT'
109
	cmp	dword [temp_area],'BOOT'
110
	jne	.no_boot
110
	jne	.no_boot
111
.background:
111
.background:
112
	call	load_image
112
	call	load_image
113
	cmp	[error_fs],0
113
	cmp	[error_fs],0
114
	jnz	.exit
114
	jnz	.exit
115
	call	convert
115
	call	convert
116
 
116
 
117
	call	background
117
	call	background
118
 
118
 
119
.exit:
119
.exit:
120
	call Set_ini
120
	call Set_ini
121
.exit_1:
121
.exit_1:
122
	mov	ebx,18
122
	mov	ebx,18
123
	mov	edx,PID1
123
	mov	edx,PID1
124
	mov	esi,7
124
	mov	esi,7
125
.kill_successors:
125
.kill_successors:
126
	mov	ecx,[edx]
126
	mov	ecx,[edx]
127
	add	edx,4
127
	add	edx,4
128
	test	ecx,ecx
128
	test	ecx,ecx
129
	jz	@f
129
	jz	@f
130
	mcall 18
130
	mcall 18
131
@@:
131
@@:
132
	dec	esi
132
	dec	esi
133
	jnz	.kill_successors
133
	jnz	.kill_successors
134
	
134
	
135
	mcall -1
135
	mcall -1
136
;-----------------------------------------------------
136
;-----------------------------------------------------
137
 .no_boot:
137
 .no_boot:
138
	xor	eax,eax
138
	xor	eax,eax
139
	cmp	byte [temp_area],al
139
	cmp	byte [temp_area],al
140
	jnz	@f
140
	jnz	@f
141
	mov	[file_name],eax
141
	mov	[file_name],eax
142
	jmp .no_param
142
	jmp .no_param
143
@@:
143
@@:
144
 
144
 
145
 
145
 
146
	mov	edi,string	; clear string
146
	mov	edi,string	; clear string
147
	mov	ecx,256/4	;	length of a string
147
	mov	ecx,256/4	;	length of a string
148
	xor	eax,eax	;	symbol <0>
148
	xor	eax,eax	;	symbol <0>
149
	rep	stosd
149
	rep	stosd
150
 
150
 
151
 
151
 
152
	mov	edi,temp_area	; look for <0> in temp_area
152
	mov	edi,temp_area	; look for <0> in temp_area
153
 
153
 
154
	cmp	[edi],byte "\"
154
	cmp	[edi],byte "\"
155
	jne	.continue
155
	jne	.continue
156
	cmp	[edi+1],byte "T"
156
	cmp	[edi+1],byte "T"
157
	jne	@f
157
	jne	@f
158
	mov	[bgrmode],dword 1
158
	mov	[bgrmode],dword 1
159
	jmp	.continue_1
159
	jmp	.continue_1
160
@@:
160
@@:
161
	cmp	[edi+1],byte "S"
161
	cmp	[edi+1],byte "S"
162
	jne	START.exit
162
	jne	START.exit
163
	mov	[bgrmode],dword 2
163
	mov	[bgrmode],dword 2
164
.continue_1:
164
.continue_1:
165
	add	edi,4
165
	add	edi,4
166
.continue:
166
.continue:
167
	mov	esi,edi
167
	mov	esi,edi
168
	mov	ecx,257	;	strlen
168
	mov	ecx,257	;	strlen
169
	repne scasb
169
	repne scasb
170
	lea		ecx, [edi-temp_area]
170
	lea		ecx, [edi-temp_area]
171
 
171
 
172
	mov	edi,string
172
	mov	edi,string
173
	rep	movsb		; copy string from temp_area to "string" (filename)
173
	rep	movsb		; copy string from temp_area to "string" (filename)
174
	cmp	[temp_area],byte "\"
174
	cmp	[temp_area],byte "\"
175
	je	START.background
175
	je	START.background
176
	call	load_directory
176
	call	load_directory
177
	test	eax,eax
177
	test	eax,eax
178
	jnz	@f
178
	jnz	@f
179
	call	load_image
179
	call	load_image
180
	test	eax,eax
180
	test	eax,eax
181
	jnz	@f
181
	jnz	@f
182
	call	convert
182
	call	convert
183
	jmp	.no_param
183
	jmp	.no_param
184
@@:
184
@@:
185
	mov	[load_directory_pointer],dir_header
185
	mov	[load_directory_pointer],dir_header
186
	mov	[error_fs],eax
186
	mov	[error_fs],eax
187
	call	convert.error
187
	call	convert.error
188
;-----------------------------------------------------
188
;-----------------------------------------------------
189
 .no_param:
189
 .no_param:
190
;	or	ecx,-1		; get information about me
190
;	or	ecx,-1		; get information about me
191
;	call getappinfo
191
;	call getappinfo
192
 
192
 
193
;	mov edx,[process_info+30] ; òåïåðü â edx íàø èäåíòèôèêàòîð
193
;	mov edx,[process_info+30] ; òåïåðü â edx íàø èäåíòèôèêàòîð
194
;	mov ecx,eax
194
;	mov ecx,eax
195
 
195
 
196
;	@@:
196
;	@@:
197
;	call getappinfo
197
;	call getappinfo
198
;	cmp edx,[process_info+30]
198
;	cmp edx,[process_info+30]
199
;	je	@f	; åñëè íàø PID ñîâïàë ñ PID ðàññìàòðèâàåìîãî ïðîöåññà, ìû íàøëè ñåáÿ
199
;	je	@f	; åñëè íàø PID ñîâïàë ñ PID ðàññìàòðèâàåìîãî ïðîöåññà, ìû íàøëè ñåáÿ
200
;	dec ecx ; èíà÷å ñìîòðèì ñëåäóþùèé ïðîöåññ
200
;	dec ecx ; èíà÷å ñìîòðèì ñëåäóþùèé ïðîöåññ
201
;	jne @b	; âîçâðàùàåìñÿ, åñëè íå âñå ïðîöåññû ðàññìîòðåíû
201
;	jne @b	; âîçâðàùàåìñÿ, åñëè íå âñå ïðîöåññû ðàññìîòðåíû
202
;	@@:
202
;	@@:
203
 
203
 
204
; òåïåðü â ecx íîìåð ïðîöåññà
204
; òåïåðü â ecx íîìåð ïðîöåññà
205
;	mov	[process],ecx
205
;	mov	[process],ecx
206
;---------------------------------------------------------------------
206
;---------------------------------------------------------------------
207
	cmp	[wnd_width],635
207
	cmp	[wnd_width],635
208
	jae	@f
208
	jae	@f
209
	mov	[wnd_width],635
209
	mov	[wnd_width],635
210
@@:
210
@@:
211
	cmp	[wnd_height],150
211
	cmp	[wnd_height],150
212
	jae	@f
212
	jae	@f
213
	mov	[wnd_height],150
213
	mov	[wnd_height],150
214
@@:
214
@@:
215
;	call draw_window
215
;	call draw_window
216
red:
216
red:
217
;draw_still:
217
;draw_still:
218
;	pusha
218
;	pusha
219
	call	get_window_param
219
	call	get_window_param
220
	test	[window_status],10b
220
	test	[window_status],10b
221
	jnz	red_1	;still
221
	jnz	red_1	;still
222
	test	[window_status],100b
222
	test	[window_status],100b
223
	jnz	red_1
223
	jnz	red_1
224
	test	[window_status],1b
224
	test	[window_status],1b
225
	jnz	red_1
225
	jnz	red_1
226
	mov esi,-1
226
	mov esi,-1
227
	mov eax,procinfo
227
	mov eax,procinfo
228
	mov eax,[eax+66]
228
	mov eax,[eax+66]
229
	cmp	eax,150
229
	cmp	eax,150
230
;	cmp	[window_high],150
230
;	cmp	[window_high],150
231
	jae	@f
231
	jae	@f
232
	mov	esi,150
232
	mov	esi,150
233
	mcall 67,-1,ebx,ebx
233
	mcall 67,-1,ebx,ebx
234
@@:
234
@@:
235
	mov edx,-1
235
	mov edx,-1
236
	mov eax,procinfo
236
	mov eax,procinfo
237
	mov eax,[eax+62]
237
	mov eax,[eax+62]
238
	cmp	eax,635
238
	cmp	eax,635
239
;	cmp	[window_width],635
239
;	cmp	[window_width],635
240
	jae	@f	;red_1
240
	jae	@f	;red_1
241
	mov	edx,635
241
	mov	edx,635
242
	mcall 67,-1,ebx, ,ebx
242
	mcall 67,-1,ebx, ,ebx
243
@@:
243
@@:
244
;	mcall 67,-1,ebx
244
;	mcall 67,-1,ebx
245
;	popa
245
;	popa
246
;	xor esi,esi
246
;	xor esi,esi
247
red_1:
247
red_1:
248
;	xor	eax,eax
248
;	xor	eax,eax
249
;	mov	[scroll_bar_data_vertical.position],eax
249
;	mov	[scroll_bar_data_vertical.position],eax
250
;	mov	[scroll_bar_data_horizontal.position],eax
250
;	mov	[scroll_bar_data_horizontal.position],eax
251
 
251
 
252
	call draw_window
252
	call draw_window
253
	
253
	
254
	cmp	[redraw_wallpaper_flag],0
254
	cmp	[redraw_wallpaper_flag],0
255
	je	still
255
	je	still
256
	mov	[redraw_wallpaper_flag],0
256
	mov	[redraw_wallpaper_flag],0
257
	call	clear_thread
257
	call	clear_thread
258
;	mcall 15,3
258
;	mcall 15,3
259
;	jmp  red_1
259
;	jmp  red_1
260
still:
260
still:
261
	call	pause_cicle
261
	call	pause_cicle
262
	
262
	
263
	cmp	[RAW1_flag],1
263
	cmp	[RAW1_flag],1
264
	je	animation_handler
264
	je	animation_handler
265
	
265
	
266
	mcall	48,4
266
	mcall	48,4
267
	cmp	[skin_height],eax
267
	cmp	[skin_height],eax
268
	je	@f
268
	je	@f
269
	mov	[skin_height],eax
269
	mov	[skin_height],eax
270
	call	convert.img_resolution_ok
270
	call	convert.img_resolution_ok
271
	jmp	red_1
271
	jmp	red_1
272
@@:
272
@@:
273
	mcall	10
273
	mcall	10
274
.1:
274
.1:
275
	cmp	[open_file_flag],1
275
	cmp	[open_file_flag],1
276
	je	kopen_1
276
	je	kopen_1
277
	cmp	[sort_directory_flag],byte 1
277
	cmp	[sort_directory_flag],byte 1
278
	je	red_sort_directory
278
	je	red_sort_directory
279
	cmp	[redraw_flag],byte 1
279
	cmp	[redraw_flag],byte 1
280
	je	redraw_window
280
	je	redraw_window
281
	cmp	eax,1	; ïåðåðèñîâàòü îêíî ?
281
	cmp	eax,1	; ïåðåðèñîâàòü îêíî ?
282
	je		red	; åñëè äà - íà ìåòêó red
282
	je		red	; åñëè äà - íà ìåòêó red
283
	cmp	eax,2	; íàæàòà êëàâèøà ?
283
	cmp	eax,2	; íàæàòà êëàâèøà ?
284
	je		key	; åñëè äà - íà key
284
	je		key	; åñëè äà - íà key
285
	cmp	eax,3	; íàæàòà êíîïêà ?
285
	cmp	eax,3	; íàæàòà êíîïêà ?
286
	je		button		; åñëè äà - íà button
286
	je		button		; åñëè äà - íà button
287
	cmp	eax,6
287
	cmp	eax,6
288
	je	mouse
288
	je	mouse
289
;	cmp [redraw_wallpaper_flag],1
289
;	cmp [redraw_wallpaper_flag],1
290
;	jne still
290
;	jne still
291
;	mov	[redraw_wallpaper_flag],0
291
;	mov	[redraw_wallpaper_flag],0
292
;	mcall	15,3
292
;	mcall	15,3
293
	jmp	still	; åñëè äðóãîå ñîáûòèå - â íà÷àëî öèêëà
293
	jmp	still	; åñëè äðóãîå ñîáûòèå - â íà÷àëî öèêëà
294
 
294
 
295
red_sort_directory:
295
red_sort_directory:
296
	mov	[sort_directory_flag],byte 0
296
	mov	[sort_directory_flag],byte 0
297
	jmp	red_1
297
	jmp	red_1
298
 
298
 
299
redraw_window:
299
redraw_window:
300
	mov	[redraw_flag],byte 0
300
	mov	[redraw_flag],byte 0
301
	jmp	red_1
301
	jmp	red_1
302
	
302
	
303
;---------------------------------------------------------------------
303
;---------------------------------------------------------------------
304
;	red:
304
;	red:
305
;	test	dword [status], 4
305
;	test	dword [status], 4
306
;	jz	draw_still
306
;	jz	draw_still
307
;	mov	al,18
307
;	mov	al,18
308
;	mov	ebx,3
308
;	mov	ebx,3
309
;	mov	ecx,[process]
309
;	mov	ecx,[process]
310
;	mcall	18,3,[active_process]
310
;	mcall	18,3,[active_process]
311
;	and	byte [status], not 4
311
;	and	byte [status], not 4
312
;	jmp	still
312
;	jmp	still
313
;---------------------------------------------------------------------
313
;---------------------------------------------------------------------
314
button:			; button
314
button:			; button
315
	mov	eax,17		; get id
315
	mov	eax,17		; get id
316
	mcall
316
	mcall
317
	cmp	ah,1			; button id=1 ?
317
	cmp	ah,1			; button id=1 ?
318
	je	START.exit
318
	je	START.exit
319
;	jne	.noclose
319
;	jne	.noclose
320
;
320
;
321
;	mov	eax,-1		; close this program
321
;	mov	eax,-1		; close this program
322
;	mcall
322
;	mcall
323
.noclose:
323
.noclose:
324
	cmp	ah,2
324
	cmp	ah,2
325
	je	slide_show.3	;still
325
	je	slide_show.3	;still
326
	jmp	slide_show
326
	jmp	slide_show
327
;---------------------------------------------------------------------
327
;---------------------------------------------------------------------
328
pause_cicle:
328
pause_cicle:
329
	pusha
329
	pusha
330
.start:
330
.start:
331
	mcall	9,procinfo,-1
331
	mcall	9,procinfo,-1
332
	mov	eax,[procinfo+70] ;status of window
332
	mov	eax,[procinfo+70] ;status of window
333
	test	eax,100b
333
	test	eax,100b
334
	jne	@f
334
	jne	@f
335
	popa
335
	popa
336
	ret
336
	ret
337
@@:
337
@@:
338
	mcall	10
338
	mcall	10
339
	dec	eax
339
	dec	eax
340
	jz	.redraw
340
	jz	.redraw
341
	dec	eax
341
	dec	eax
342
	jz	.key
342
	jz	.key
343
	dec	eax
343
	dec	eax
344
	jnz	.start	
344
	jnz	.start	
345
.button:
345
.button:
346
	mcall	-1
346
	mcall	-1
347
.key:
347
.key:
348
	mcall	2
348
	mcall	2
349
	jmp	.start
349
	jmp	.start
350
.redraw:
350
.redraw:
351
	call	draw_window
351
	call	draw_window
352
	jmp	.start
352
	jmp	.start
353
;---------------------------------------------------------------------
353
;---------------------------------------------------------------------
354
get_filter_data:
354
get_filter_data:
355
	mov	edi,Filter+4
355
	mov	edi,Filter+4
356
	xor	eax,eax
356
	xor	eax,eax
357
	mov	ecx,10
357
	mov	ecx,10
358
	cld
358
	cld
359
@@:
359
@@:
360
	mov	esi,10
360
	mov	esi,10
361
	sub	esi,ecx
361
	sub	esi,ecx
362
	lea     esi,[esi+esi*2] ; x 3
362
	lea     esi,[esi+esi*2] ; x 3
363
	shl	esi,3  ; x 8
363
	shl	esi,3  ; x 8
364
	add	esi,dword Convert_plugin_0.Assoc
364
	add	esi,dword Convert_plugin_0.Assoc
365
	mov	esi,[esi]
365
	mov	esi,[esi]
366
	add	esi,4
366
	add	esi,4
367
 
367
 
368
	test	esi,esi
368
	test	esi,esi
369
	jz	@f
369
	jz	@f
370
	call	.start
370
	call	.start
371
	dec	ecx
371
	dec	ecx
372
	jnz	@r
372
	jnz	@r
373
@@:
373
@@:
374
	mov	[edi],byte 0
374
	mov	[edi],byte 0
375
	mov	eax,Filter
375
	mov	eax,Filter
376
	sub	edi,eax
376
	sub	edi,eax
377
	mov	[eax],edi
377
	mov	[eax],edi
378
 
378
 
379
	ret
379
	ret
380
.start:
380
.start:
381
@@:
381
@@:
382
	lodsb
382
	lodsb
383
	stosb
383
	stosb
384
	test	eax,eax
384
	test	eax,eax
385
	jnz	@r
385
	jnz	@r
386
	cmp	[esi],ah
386
	cmp	[esi],ah
387
	jne	@r
387
	jne	@r
388
	ret
388
	ret
389
;---------------------------------------------------------------------
389
;---------------------------------------------------------------------
390
kopen_1:
390
kopen_1:
391
 
391
 
392
	mov	[open_file_flag],0
392
	mov	[open_file_flag],0
393
	call	load_directory
393
	call	load_directory
394
	test	eax,eax
394
	test	eax,eax
395
	jz	kopen
395
	jz	kopen
396
.err:
396
.err:
397
	mov	[load_directory_pointer],dir_header
397
	mov	[load_directory_pointer],dir_header
398
	mov	[error_fs],eax
398
	mov	[error_fs],eax
399
	call	convert.error
399
	call	convert.error
400
	jmp	still	;red_1
400
	jmp	still	;red_1
401
 
401
 
402
kopen:
402
kopen:
403
	cmp	[string],byte 0
403
	cmp	[string],byte 0
404
	je	still
404
	je	still
405
 
405
 
406
	mov	ecx,-1
406
	mov	ecx,-1
407
	call	getappinfo
407
	call	getappinfo
408
 
408
 
409
	call	load_image
409
	call	load_image
410
 
410
 
411
	test	eax,eax
411
	test	eax,eax
412
	jnz	kopen_1.err
412
	jnz	kopen_1.err
413
	call	convert
413
	call	convert
414
 
414
 
415
.1:
415
.1:
416
	call	get_window_param
416
	call	get_window_param
417
	test	[window_status],1b
417
	test	[window_status],1b
418
	jz	red	;draw_still
418
	jz	red	;draw_still
419
	mov	[no_draw_window],1
419
	mov	[no_draw_window],1
420
 
420
 
421
;	push	edx
421
;	push	edx
422
;	mov	edx,size_after_convert_2
422
;	mov	edx,size_after_convert_2
423
;	call	write_memory_size
423
;	call	write_memory_size
424
;	pop	edx
424
;	pop	edx
425
 
425
 
426
	call	draw_other
426
	call	draw_other
427
 
427
 
428
	mov	[no_draw_window],0
428
	mov	[no_draw_window],0
429
;	jmp	draw_still
429
;	jmp	draw_still
430
	jmp	still
430
	jmp	still
431
;---------------------------------------------------------------------
431
;---------------------------------------------------------------------
432
getappinfo:
432
getappinfo:
433
	mov	eax,9
433
	mov	eax,9
434
	mov	ebx,process_info
434
	mov	ebx,process_info
435
	mcall
435
	mcall
436
	ret
436
	ret
437
;---------------------------------------------------------------------
437
;---------------------------------------------------------------------
438
get_window_param:
438
get_window_param:
439
	mcall	9, procinfo, -1
439
	mcall	9, procinfo, -1
440
	mov	eax,[ebx+34]
440
	mov	eax,[ebx+34]
441
	mov	[window_start_x],eax
441
	mov	[window_start_x],eax
442
	mov	eax,[ebx+38]
442
	mov	eax,[ebx+38]
443
	mov	[window_start_y],eax
443
	mov	[window_start_y],eax
444
	mov	eax,[ebx+66]   ;46]
444
	mov	eax,[ebx+66]   ;46]
445
	inc	eax
445
	inc	eax
446
	mov	[window_high],eax
446
	mov	[window_high],eax
447
	mov	eax,[ebx+62]   ;42]
447
	mov	eax,[ebx+62]   ;42]
448
	inc	eax
448
	inc	eax
449
	mov	[window_width],eax
449
	mov	[window_width],eax
450
	mov	eax,[ebx+70]
450
	mov	eax,[ebx+70]
451
	mov	[window_status],eax
451
	mov	[window_status],eax
452
;	mcall	48,4
452
;	mcall	48,4
453
;	mov	[skin_high],eax
453
;	mov	[skin_high],eax
454
	ret
454
	ret
455
;---------------------------------------------------------------------
455
;---------------------------------------------------------------------
456
;write_memory_size:
456
;write_memory_size:
457
;	pusha
457
;	pusha
458
;	mcall	9, procinfo, -1
458
;	mcall	9, procinfo, -1
459
;	mov	eax,[ebx+26]
459
;	mov	eax,[ebx+26]
460
;	mov	[edx],eax
460
;	mov	[edx],eax
461
;	popa
461
;	popa
462
;	ret
462
;	ret
463
;---------------------------------------------------------------------
463
;---------------------------------------------------------------------
464
include	'backgrnd.inc'
464
include	'backgrnd.inc'
465
include	'draw_win.inc'
465
include	'draw_win.inc'
466
include	'full_win.inc'
466
include	'full_win.inc'
467
include	'mouse.inc'
467
include	'mouse.inc'
468
include	'key.inc'
468
include	'key.inc'
469
include	'menu_key.inc'
469
include	'menu_key.inc'
470
include	'clr_bcgr.inc'
470
include	'clr_bcgr.inc'
471
include	'w_error.inc'
471
include	'w_error.inc'
472
include	'load.inc'
472
include	'load.inc'
473
include	'animat.inc'
473
include	'animat.inc'
474
include	'draw_img.inc'
474
include	'draw_img.inc'
475
include	'convert.inc'
475
include	'convert.inc'
476
include	'zoom.inc'
476
include	'zoom.inc'
477
include	'w_about.inc'
477
include	'w_about.inc'
478
include	'win_file.inc'
478
include	'win_file.inc'
479
include	'win_info.inc'
479
include	'win_info.inc'
480
include	'win_bcgr.inc'
480
include	'win_bcgr.inc'
481
include	'win_sort.inc'
481
include	'win_sort.inc'
482
include	'win_opti.inc'
482
include	'win_opti.inc'
483
include	'libini.inc'
483
include	'libini.inc'
484
include	'../../dll.inc'
484
include	'../../dll.inc'
485
include	'data.inc'
485
include	'data.inc'
486
;---------------------------------------------------------------------
486
;---------------------------------------------------------------------
487
IM_END:
487
IM_END:
488
include	'dat_area.inc'
488
include	'dat_area.inc'
489
I_END:
489
I_END: