Rev 2189 | Rev 3014 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2189 | Rev 2237 | ||
---|---|---|---|
1 | ;***************************************************************************** |
1 | ;***************************************************************************** |
2 | ; zSea - advanced image viewer for KolibriOS |
2 | ; zSea - advanced image viewer for KolibriOS |
3 | ; Copyright (c) 2008-2011, Marat Zakiyanov aka Mario79, aka Mario |
3 | ; Copyright (c) 2008-2011, 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 |
13 | ; * Neither the name of 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 |
20 | ; DISCLAIMED. IN NO EVENT SHALL |
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ñ4 16.09.2011 |
28 | ; v.1.0 rñ4 25.09.2011 |
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 | 45 | ||
46 | include '../../macros.inc' |
46 | include '../../macros.inc' |
47 | include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
47 | include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
48 | include '../../proc32.inc' |
48 | include '../../proc32.inc' |
49 | 49 | ||
50 | ;include 'load_lib.mac' |
50 | ;include 'load_lib.mac' |
51 | include '../../develop/libraries/box_lib/load_lib.mac' |
51 | include '../../develop/libraries/box_lib/load_lib.mac' |
52 | @use_library ;use load lib macros |
52 | @use_library ;use load lib macros |
53 | ;****************************************************************************** |
53 | ;****************************************************************************** |
54 | 54 | ||
55 | START: ; start of execution |
55 | START: ; start of execution |
56 | mcall 68, 11 |
56 | mcall 68, 11 |
57 | mcall 66, 1,1 |
57 | mcall 66, 1,1 |
58 | mcall 40, 0x27 |
58 | mcall 40, 0x27 |
59 | 59 | ||
60 | mcall 9, procinfo, -1 |
60 | mcall 9, procinfo, -1 |
61 | mov eax,[ebx+30] |
61 | mov eax,[ebx+30] |
62 | mov [PID],eax |
62 | mov [PID],eax |
63 | xor ecx,ecx |
63 | xor ecx,ecx |
64 | @@: |
64 | @@: |
65 | inc ecx |
65 | inc ecx |
66 | mcall 9, procinfo |
66 | mcall 9, procinfo |
67 | mov eax,[PID] |
67 | mov eax,[PID] |
68 | cmp eax,[ebx+30] |
68 | cmp eax,[ebx+30] |
69 | jne @r |
69 | jne @r |
70 | mov [active_process],ecx |
70 | mov [active_process],ecx |
71 | 71 | ||
72 | mcall 48,4 |
72 | mcall 48,4 |
73 | mov [skin_height],eax |
73 | mov [skin_height],eax |
74 | 74 | ||
75 | mcall 68,12,1024 |
75 | mcall 68,12,1024 |
76 | mov [menu_data_1.procinfo],eax |
76 | mov [menu_data_1.procinfo],eax |
77 | mov [menu_data_2.procinfo],eax |
77 | mov [menu_data_2.procinfo],eax |
78 | mov [menu_data_3.procinfo],eax |
78 | mov [menu_data_3.procinfo],eax |
79 | mov [menu_data_4.procinfo],eax |
79 | mov [menu_data_4.procinfo],eax |
80 | mov [menu_data_5.procinfo],eax |
80 | mov [menu_data_5.procinfo],eax |
81 | mov [menu_data_6.procinfo],eax |
81 | mov [menu_data_6.procinfo],eax |
82 | 82 | ||
83 | mov [load_directory_pointer],dir_header |
83 | mov [load_directory_pointer],dir_header |
84 | 84 | ||
85 | 85 | ||
86 | call load_plugins |
86 | call load_plugins |
87 | 87 | ||
88 | 88 | ||
89 | call load_buttons |
89 | call load_buttons |
90 | 90 | ||
91 | ; call init_data_OpenDialog |
91 | ; call init_data_OpenDialog |
92 | 92 | ||
93 | ;init_OpenDialog OpenDialog_data |
93 | ;init_OpenDialog OpenDialog_data |
94 | push dword OpenDialog_data |
94 | push dword OpenDialog_data |
95 | call [OpenDialog_Init] |
95 | call [OpenDialog_Init] |
96 | 96 | ||
97 | call get_filter_data |
97 | call get_filter_data |
98 | 98 | ||
99 | ;----------------------------------------------------- |
99 | ;----------------------------------------------------- |
100 | ; check for parameters |
100 | ; check for parameters |
101 | cmp dword [temp_area],'BOOT' |
101 | cmp dword [temp_area],'BOOT' |
102 | jne .no_boot |
102 | jne .no_boot |
103 | .background: |
103 | .background: |
104 | call load_image |
104 | call load_image |
105 | cmp [error_fs],0 |
105 | cmp [error_fs],0 |
106 | jnz .exit |
106 | jnz .exit |
107 | call convert |
107 | call convert |
108 | 108 | ||
109 | call background |
109 | call background |
110 | 110 | ||
111 | .exit: |
111 | .exit: |
112 | call Set_ini |
112 | call Set_ini |
113 | .exit_1: |
113 | .exit_1: |
114 | mov ebx,18 |
114 | mov ebx,18 |
115 | mov edx,PID1 |
115 | mov edx,PID1 |
116 | mov esi,7 |
116 | mov esi,7 |
117 | .kill_successors: |
117 | .kill_successors: |
118 | mov ecx,[edx] |
118 | mov ecx,[edx] |
119 | add edx,4 |
119 | add edx,4 |
120 | test ecx,ecx |
120 | test ecx,ecx |
121 | jz @f |
121 | jz @f |
122 | mcall 18 |
122 | mcall 18 |
123 | @@: |
123 | @@: |
124 | dec esi |
124 | dec esi |
125 | jnz .kill_successors |
125 | jnz .kill_successors |
126 | 126 | ||
127 | mcall -1 |
127 | mcall -1 |
128 | ;----------------------------------------------------- |
128 | ;----------------------------------------------------- |
129 | .no_boot: |
129 | .no_boot: |
130 | xor eax,eax |
130 | xor eax,eax |
131 | cmp byte [temp_area],al |
131 | cmp byte [temp_area],al |
132 | jnz @f |
132 | jnz @f |
133 | mov [file_name],eax |
133 | mov [file_name],eax |
134 | jmp .no_param |
134 | jmp .no_param |
135 | @@: |
135 | @@: |
136 | 136 | ||
137 | 137 | ||
138 | mov edi,string ; clear string |
138 | mov edi,string ; clear string |
139 | mov ecx,256/4 ; length of a string |
139 | mov ecx,256/4 ; length of a string |
140 | xor eax,eax ; symbol <0> |
140 | xor eax,eax ; symbol <0> |
141 | rep stosd |
141 | rep stosd |
142 | 142 | ||
143 | 143 | ||
144 | mov edi,temp_area ; look for <0> in temp_area |
144 | mov edi,temp_area ; look for <0> in temp_area |
145 | 145 | ||
146 | cmp [edi],byte "\" |
146 | cmp [edi],byte "\" |
147 | jne .continue |
147 | jne .continue |
148 | cmp [edi+1],byte "T" |
148 | cmp [edi+1],byte "T" |
149 | jne @f |
149 | jne @f |
150 | mov [bgrmode],dword 1 |
150 | mov [bgrmode],dword 1 |
151 | jmp .continue_1 |
151 | jmp .continue_1 |
152 | @@: |
152 | @@: |
153 | cmp [edi+1],byte "S" |
153 | cmp [edi+1],byte "S" |
154 | jne START.exit |
154 | jne START.exit |
155 | mov [bgrmode],dword 2 |
155 | mov [bgrmode],dword 2 |
156 | .continue_1: |
156 | .continue_1: |
157 | add edi,4 |
157 | add edi,4 |
158 | .continue: |
158 | .continue: |
159 | mov esi,edi |
159 | mov esi,edi |
160 | mov ecx,257 ; strlen |
160 | mov ecx,257 ; strlen |
161 | repne scasb |
161 | repne scasb |
162 | lea ecx, [edi-temp_area] |
162 | lea ecx, [edi-temp_area] |
163 | 163 | ||
164 | mov edi,string |
164 | mov edi,string |
165 | rep movsb ; copy string from temp_area to "string" (filename) |
165 | rep movsb ; copy string from temp_area to "string" (filename) |
166 | cmp [temp_area],byte "\" |
166 | cmp [temp_area],byte "\" |
167 | je START.background |
167 | je START.background |
168 | call load_directory |
168 | call load_directory |
169 | test eax,eax |
169 | test eax,eax |
170 | jnz @f |
170 | jnz @f |
171 | call load_image |
171 | call load_image |
172 | test eax,eax |
172 | test eax,eax |
173 | jnz @f |
173 | jnz @f |
174 | call convert |
174 | call convert |
175 | jmp .no_param |
175 | jmp .no_param |
176 | @@: |
176 | @@: |
177 | mov [load_directory_pointer],dir_header |
177 | mov [load_directory_pointer],dir_header |
178 | mov [error_fs],eax |
178 | mov [error_fs],eax |
179 | call convert.error |
179 | call convert.error |
180 | ;----------------------------------------------------- |
180 | ;----------------------------------------------------- |
181 | .no_param: |
181 | .no_param: |
182 | ; or ecx,-1 ; get information about me |
182 | ; or ecx,-1 ; get information about me |
183 | ; call getappinfo |
183 | ; call getappinfo |
184 | 184 | ||
185 | ; mov edx,[process_info+30] ; òåïåðü â edx íàø èäåíòèôèêàòîð |
185 | ; mov edx,[process_info+30] ; òåïåðü â edx íàø èäåíòèôèêàòîð |
186 | ; mov ecx,eax |
186 | ; mov ecx,eax |
187 | 187 | ||
188 | ; @@: |
188 | ; @@: |
189 | ; call getappinfo |
189 | ; call getappinfo |
190 | ; cmp edx,[process_info+30] |
190 | ; cmp edx,[process_info+30] |
191 | ; je @f ; åñëè íàø PID ñîâïàë ñ PID ðàññìàòðèâàåìîãî ïðîöåññà, ìû íàøëè ñåáÿ |
191 | ; je @f ; åñëè íàø PID ñîâïàë ñ PID ðàññìàòðèâàåìîãî ïðîöåññà, ìû íàøëè ñåáÿ |
192 | ; dec ecx ; èíà÷å ñìîòðèì ñëåäóþùèé ïðîöåññ |
192 | ; dec ecx ; èíà÷å ñìîòðèì ñëåäóþùèé ïðîöåññ |
193 | ; jne @b ; âîçâðàùàåìñÿ, åñëè íå âñå ïðîöåññû ðàññìîòðåíû |
193 | ; jne @b ; âîçâðàùàåìñÿ, åñëè íå âñå ïðîöåññû ðàññìîòðåíû |
194 | ; @@: |
194 | ; @@: |
195 | 195 | ||
196 | ; òåïåðü â ecx íîìåð ïðîöåññà |
196 | ; òåïåðü â ecx íîìåð ïðîöåññà |
197 | ; mov [process],ecx |
197 | ; mov [process],ecx |
198 | ;--------------------------------------------------------------------- |
198 | ;--------------------------------------------------------------------- |
199 | cmp [wnd_width],635 |
199 | cmp [wnd_width],635 |
200 | jae @f |
200 | jae @f |
201 | mov [wnd_width],635 |
201 | mov [wnd_width],635 |
202 | @@: |
202 | @@: |
203 | cmp [wnd_height],150 |
203 | cmp [wnd_height],150 |
204 | jae @f |
204 | jae @f |
205 | mov [wnd_height],150 |
205 | mov [wnd_height],150 |
206 | @@: |
206 | @@: |
207 | ; call draw_window |
207 | ; call draw_window |
208 | red: |
208 | red: |
209 | ;draw_still: |
209 | ;draw_still: |
210 | ; pusha |
210 | ; pusha |
211 | call get_window_param |
211 | call get_window_param |
212 | test [window_status],10b |
212 | test [window_status],10b |
213 | jnz red_1 ;still |
213 | jnz red_1 ;still |
214 | test [window_status],100b |
214 | test [window_status],100b |
215 | jnz red_1 |
215 | jnz red_1 |
216 | test [window_status],1b |
216 | test [window_status],1b |
217 | jnz red_1 |
217 | jnz red_1 |
218 | mov esi,-1 |
218 | mov esi,-1 |
219 | mov eax,procinfo |
219 | mov eax,procinfo |
220 | mov eax,[eax+66] |
220 | mov eax,[eax+66] |
221 | cmp eax,150 |
221 | cmp eax,150 |
222 | ; cmp [window_high],150 |
222 | ; cmp [window_high],150 |
223 | jae @f |
223 | jae @f |
224 | mov esi,150 |
224 | mov esi,150 |
225 | mcall 67,-1,ebx,ebx |
225 | mcall 67,-1,ebx,ebx |
226 | @@: |
226 | @@: |
227 | mov edx,-1 |
227 | mov edx,-1 |
228 | mov eax,procinfo |
228 | mov eax,procinfo |
229 | mov eax,[eax+62] |
229 | mov eax,[eax+62] |
230 | cmp eax,635 |
230 | cmp eax,635 |
231 | ; cmp [window_width],635 |
231 | ; cmp [window_width],635 |
232 | jae @f ;red_1 |
232 | jae @f ;red_1 |
233 | mov edx,635 |
233 | mov edx,635 |
234 | mcall 67,-1,ebx, ,ebx |
234 | mcall 67,-1,ebx, ,ebx |
235 | @@: |
235 | @@: |
236 | ; mcall 67,-1,ebx |
236 | ; mcall 67,-1,ebx |
237 | ; popa |
237 | ; popa |
238 | ; xor esi,esi |
238 | ; xor esi,esi |
239 | red_1: |
239 | red_1: |
240 | ; xor eax,eax |
240 | ; xor eax,eax |
241 | ; mov [scroll_bar_data_vertical.position],eax |
241 | ; mov [scroll_bar_data_vertical.position],eax |
242 | ; mov [scroll_bar_data_horizontal.position],eax |
242 | ; mov [scroll_bar_data_horizontal.position],eax |
243 | 243 | ||
244 | call draw_window |
244 | call draw_window |
245 | 245 | ||
246 | cmp [redraw_wallpaper_flag],0 |
246 | cmp [redraw_wallpaper_flag],0 |
247 | je still |
247 | je still |
248 | mov [redraw_wallpaper_flag],0 |
248 | mov [redraw_wallpaper_flag],0 |
249 | call clear_thread |
249 | call clear_thread |
250 | ; mcall 15,3 |
250 | ; mcall 15,3 |
251 | ; jmp red_1 |
251 | ; jmp red_1 |
252 | still: |
252 | still: |
253 | call pause_cicle |
253 | call pause_cicle |
254 | 254 | ||
255 | cmp [RAW1_flag],1 |
255 | cmp [RAW1_flag],1 |
256 | je animation_handler |
256 | je animation_handler |
257 | 257 | ||
258 | mcall 48,4 |
258 | mcall 48,4 |
259 | cmp [skin_height],eax |
259 | cmp [skin_height],eax |
260 | je @f |
260 | je @f |
261 | mov [skin_height],eax |
261 | mov [skin_height],eax |
262 | call convert.img_resolution_ok |
262 | call convert.img_resolution_ok |
263 | jmp red_1 |
263 | jmp red_1 |
264 | @@: |
264 | @@: |
265 | mcall 10 |
265 | mcall 10 |
266 | .1: |
266 | .1: |
267 | cmp [open_file_flag],1 |
267 | cmp [open_file_flag],1 |
268 | je kopen_1 |
268 | je kopen_1 |
269 | cmp [sort_directory_flag],byte 1 |
269 | cmp [sort_directory_flag],byte 1 |
270 | je red_sort_directory |
270 | je red_sort_directory |
271 | cmp [redraw_flag],byte 1 |
271 | cmp [redraw_flag],byte 1 |
272 | je redraw_window |
272 | je redraw_window |
273 | cmp eax,1 ; ïåðåðèñîâàòü îêíî ? |
273 | cmp eax,1 ; ïåðåðèñîâàòü îêíî ? |
274 | je red ; åñëè äà - íà ìåòêó red |
274 | je red ; åñëè äà - íà ìåòêó red |
275 | cmp eax,2 ; íàæàòà êëàâèøà ? |
275 | cmp eax,2 ; íàæàòà êëàâèøà ? |
276 | je key ; åñëè äà - íà key |
276 | je key ; åñëè äà - íà key |
277 | cmp eax,3 ; íàæàòà êíîïêà ? |
277 | cmp eax,3 ; íàæàòà êíîïêà ? |
278 | je button ; åñëè äà - íà button |
278 | je button ; åñëè äà - íà button |
279 | cmp eax,6 |
279 | cmp eax,6 |
280 | je mouse |
280 | je mouse |
281 | ; cmp [redraw_wallpaper_flag],1 |
281 | ; cmp [redraw_wallpaper_flag],1 |
282 | ; jne still |
282 | ; jne still |
283 | ; mov [redraw_wallpaper_flag],0 |
283 | ; mov [redraw_wallpaper_flag],0 |
284 | ; mcall 15,3 |
284 | ; mcall 15,3 |
285 | jmp still ; åñëè äðóãîå ñîáûòèå - â íà÷àëî öèêëà |
285 | jmp still ; åñëè äðóãîå ñîáûòèå - â íà÷àëî öèêëà |
286 | 286 | ||
287 | red_sort_directory: |
287 | red_sort_directory: |
288 | mov [sort_directory_flag],byte 0 |
288 | mov [sort_directory_flag],byte 0 |
289 | jmp red_1 |
289 | jmp red_1 |
290 | 290 | ||
291 | redraw_window: |
291 | redraw_window: |
292 | mov [redraw_flag],byte 0 |
292 | mov [redraw_flag],byte 0 |
293 | jmp red_1 |
293 | jmp red_1 |
294 | 294 | ||
295 | ;--------------------------------------------------------------------- |
295 | ;--------------------------------------------------------------------- |
296 | ; red: |
296 | ; red: |
297 | ; test dword [status], 4 |
297 | ; test dword [status], 4 |
298 | ; jz draw_still |
298 | ; jz draw_still |
299 | ; mov al,18 |
299 | ; mov al,18 |
300 | ; mov ebx,3 |
300 | ; mov ebx,3 |
301 | ; mov ecx,[process] |
301 | ; mov ecx,[process] |
302 | ; mcall 18,3,[active_process] |
302 | ; mcall 18,3,[active_process] |
303 | ; and byte [status], not 4 |
303 | ; and byte [status], not 4 |
304 | ; jmp still |
304 | ; jmp still |
305 | ;--------------------------------------------------------------------- |
305 | ;--------------------------------------------------------------------- |
306 | button: ; button |
306 | button: ; button |
307 | mov eax,17 ; get id |
307 | mov eax,17 ; get id |
308 | mcall |
308 | mcall |
309 | cmp ah,1 ; button id=1 ? |
309 | cmp ah,1 ; button id=1 ? |
310 | je START.exit |
310 | je START.exit |
311 | ; jne .noclose |
311 | ; jne .noclose |
312 | ; |
312 | ; |
313 | ; mov eax,-1 ; close this program |
313 | ; mov eax,-1 ; close this program |
314 | ; mcall |
314 | ; mcall |
315 | .noclose: |
315 | .noclose: |
316 | cmp ah,2 |
316 | cmp ah,2 |
317 | je slide_show.3 ;still |
317 | je slide_show.3 ;still |
318 | jmp slide_show |
318 | jmp slide_show |
319 | ;--------------------------------------------------------------------- |
319 | ;--------------------------------------------------------------------- |
320 | pause_cicle: |
320 | pause_cicle: |
321 | pusha |
321 | pusha |
322 | .start: |
322 | .start: |
323 | mcall 9,procinfo,-1 |
323 | mcall 9,procinfo,-1 |
324 | mov eax,[procinfo+70] ;status of window |
324 | mov eax,[procinfo+70] ;status of window |
325 | test eax,100b |
325 | test eax,100b |
326 | jne @f |
326 | jne @f |
327 | popa |
327 | popa |
328 | ret |
328 | ret |
329 | @@: |
329 | @@: |
330 | mcall 10 |
330 | mcall 10 |
331 | dec eax |
331 | dec eax |
332 | jz .redraw |
332 | jz .redraw |
333 | dec eax |
333 | dec eax |
334 | jz .key |
334 | jz .key |
335 | dec eax |
335 | dec eax |
336 | jnz .start |
336 | jnz .start |
337 | .button: |
337 | .button: |
338 | mcall -1 |
338 | mcall -1 |
339 | .key: |
339 | .key: |
340 | mcall 2 |
340 | mcall 2 |
341 | jmp .start |
341 | jmp .start |
342 | .redraw: |
342 | .redraw: |
343 | call draw_window |
343 | call draw_window |
344 | jmp .start |
344 | jmp .start |
345 | ;--------------------------------------------------------------------- |
345 | ;--------------------------------------------------------------------- |
346 | get_filter_data: |
346 | get_filter_data: |
347 | mov edi,Filter+4 |
347 | mov edi,Filter+4 |
348 | xor eax,eax |
348 | xor eax,eax |
349 | mov ecx,10 |
349 | mov ecx,10 |
350 | cld |
350 | cld |
351 | @@: |
351 | @@: |
352 | mov esi,10 |
352 | mov esi,10 |
353 | sub esi,ecx |
353 | sub esi,ecx |
354 | lea esi,[esi+esi*2] ; x 3 |
354 | lea esi,[esi+esi*2] ; x 3 |
355 | shl esi,3 ; x 8 |
355 | shl esi,3 ; x 8 |
356 | add esi,dword Convert_plugin_0.Assoc |
356 | add esi,dword Convert_plugin_0.Assoc |
357 | mov esi,[esi] |
357 | mov esi,[esi] |
358 | add esi,4 |
358 | add esi,4 |
359 | 359 | ||
360 | test esi,esi |
360 | test esi,esi |
361 | jz @f |
361 | jz @f |
362 | call .start |
362 | call .start |
363 | dec ecx |
363 | dec ecx |
364 | jnz @r |
364 | jnz @r |
365 | @@: |
365 | @@: |
366 | mov [edi],byte 0 |
366 | mov [edi],byte 0 |
367 | mov eax,Filter |
367 | mov eax,Filter |
368 | sub edi,eax |
368 | sub edi,eax |
369 | mov [eax],edi |
369 | mov [eax],edi |
370 | 370 | ||
371 | ret |
371 | ret |
372 | .start: |
372 | .start: |
373 | @@: |
373 | @@: |
374 | lodsb |
374 | lodsb |
375 | stosb |
375 | stosb |
376 | test eax,eax |
376 | test eax,eax |
377 | jnz @r |
377 | jnz @r |
378 | cmp [esi],ah |
378 | cmp [esi],ah |
379 | jne @r |
379 | jne @r |
380 | ret |
380 | ret |
381 | ;--------------------------------------------------------------------- |
381 | ;--------------------------------------------------------------------- |
382 | kopen_1: |
382 | kopen_1: |
383 | 383 | ||
384 | mov [open_file_flag],0 |
384 | mov [open_file_flag],0 |
385 | call load_directory |
385 | call load_directory |
386 | test eax,eax |
386 | test eax,eax |
387 | jz kopen |
387 | jz kopen |
388 | .err: |
388 | .err: |
389 | mov [load_directory_pointer],dir_header |
389 | mov [load_directory_pointer],dir_header |
390 | mov [error_fs],eax |
390 | mov [error_fs],eax |
391 | call convert.error |
391 | call convert.error |
392 | jmp still ;red_1 |
392 | jmp still ;red_1 |
393 | 393 | ||
394 | kopen: |
394 | kopen: |
395 | cmp [string],byte 0 |
395 | cmp [string],byte 0 |
396 | je still |
396 | je still |
397 | 397 | ||
398 | mov ecx,-1 |
398 | mov ecx,-1 |
399 | call getappinfo |
399 | call getappinfo |
400 | 400 | ||
401 | call load_image |
401 | call load_image |
402 | 402 | ||
403 | test eax,eax |
403 | test eax,eax |
404 | jnz kopen_1.err |
404 | jnz kopen_1.err |
405 | call convert |
405 | call convert |
406 | 406 | ||
407 | .1: |
407 | .1: |
408 | call get_window_param |
408 | call get_window_param |
409 | test [window_status],1b |
409 | test [window_status],1b |
410 | jz red ;draw_still |
410 | jz red ;draw_still |
411 | mov [no_draw_window],1 |
411 | mov [no_draw_window],1 |
412 | 412 | ||
413 | ; push edx |
413 | ; push edx |
414 | ; mov edx,size_after_convert_2 |
414 | ; mov edx,size_after_convert_2 |
415 | ; call write_memory_size |
415 | ; call write_memory_size |
416 | ; pop edx |
416 | ; pop edx |
417 | 417 | ||
418 | call draw_other |
418 | call draw_other |
419 | 419 | ||
420 | mov [no_draw_window],0 |
420 | mov [no_draw_window],0 |
421 | ; jmp draw_still |
421 | ; jmp draw_still |
422 | jmp still |
422 | jmp still |
423 | ;--------------------------------------------------------------------- |
423 | ;--------------------------------------------------------------------- |
424 | getappinfo: |
424 | getappinfo: |
425 | mov eax,9 |
425 | mov eax,9 |
426 | mov ebx,process_info |
426 | mov ebx,process_info |
427 | mcall |
427 | mcall |
428 | ret |
428 | ret |
429 | ;--------------------------------------------------------------------- |
429 | ;--------------------------------------------------------------------- |
430 | get_window_param: |
430 | get_window_param: |
431 | mcall 9, procinfo, -1 |
431 | mcall 9, procinfo, -1 |
432 | mov eax,[ebx+34] |
432 | mov eax,[ebx+34] |
433 | mov [window_start_x],eax |
433 | mov [window_start_x],eax |
434 | mov eax,[ebx+38] |
434 | mov eax,[ebx+38] |
435 | mov [window_start_y],eax |
435 | mov [window_start_y],eax |
436 | mov eax,[ebx+66] ;46] |
436 | mov eax,[ebx+66] ;46] |
437 | inc eax |
437 | inc eax |
438 | mov [window_high],eax |
438 | mov [window_high],eax |
439 | mov eax,[ebx+62] ;42] |
439 | mov eax,[ebx+62] ;42] |
440 | inc eax |
440 | inc eax |
441 | mov [window_width],eax |
441 | mov [window_width],eax |
442 | mov eax,[ebx+70] |
442 | mov eax,[ebx+70] |
443 | mov [window_status],eax |
443 | mov [window_status],eax |
444 | ; mcall 48,4 |
444 | ; mcall 48,4 |
445 | ; mov [skin_high],eax |
445 | ; mov [skin_high],eax |
446 | ret |
446 | ret |
447 | ;--------------------------------------------------------------------- |
447 | ;--------------------------------------------------------------------- |
448 | ;write_memory_size: |
448 | ;write_memory_size: |
449 | ; pusha |
449 | ; pusha |
450 | ; mcall 9, procinfo, -1 |
450 | ; mcall 9, procinfo, -1 |
451 | ; mov eax,[ebx+26] |
451 | ; mov eax,[ebx+26] |
452 | ; mov [edx],eax |
452 | ; mov [edx],eax |
453 | ; popa |
453 | ; popa |
454 | ; ret |
454 | ; ret |
455 | ;--------------------------------------------------------------------- |
455 | ;--------------------------------------------------------------------- |
456 | include 'backgrnd.inc' |
456 | include 'backgrnd.inc' |
457 | include 'draw_win.inc' |
457 | include 'draw_win.inc' |
458 | include 'full_win.inc' |
458 | include 'full_win.inc' |
459 | include 'mouse.inc' |
459 | include 'mouse.inc' |
460 | include 'key.inc' |
460 | include 'key.inc' |
461 | include 'menu_key.inc' |
461 | include 'menu_key.inc' |
462 | include 'clr_bcgr.inc' |
462 | include 'clr_bcgr.inc' |
463 | include 'w_error.inc' |
463 | include 'w_error.inc' |
464 | include 'load.inc' |
464 | include 'load.inc' |
465 | include 'animat.inc' |
465 | include 'animat.inc' |
466 | include 'draw_img.inc' |
466 | include 'draw_img.inc' |
467 | include 'convert.inc' |
467 | include 'convert.inc' |
468 | include 'zoom.inc' |
468 | include 'zoom.inc' |
469 | include 'w_about.inc' |
469 | include 'w_about.inc' |
470 | include 'win_file.inc' |
470 | include 'win_file.inc' |
471 | include 'win_info.inc' |
471 | include 'win_info.inc' |
472 | include 'win_bcgr.inc' |
472 | include 'win_bcgr.inc' |
473 | include 'win_sort.inc' |
473 | include 'win_sort.inc' |
474 | include 'win_opti.inc' |
474 | include 'win_opti.inc' |
475 | include 'libini.inc' |
475 | include 'libini.inc' |
476 | include 'dll.inc' |
476 | include 'dll.inc' |
477 | include 'data.inc' |
477 | include 'data.inc' |
478 | ;--------------------------------------------------------------------- |
478 | ;--------------------------------------------------------------------- |
479 | IM_END: |
479 | IM_END: |
480 | include 'dat_area.inc' |
480 | include 'dat_area.inc' |
481 | I_END:0>0> |
481 | I_END:0>0> |