Rev 2000 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1951 | mario79 | 1 | ;--------------------------------------------------------------------- |
2 | k_option: |
||
3 | test dword [status],64 |
||
4 | jnz still |
||
5 | or dword [status],64 |
||
6 | |||
7 | call get_memory_for_tread_stack |
||
8 | mov [thread_stack_7],eax |
||
9 | mcall 51,1,thread7 ;,thread_stack_7 |
||
10 | jmp still |
||
11 | ;--------------------------------------------------------------------- |
||
12 | get_memory_for_tread_stack: |
||
13 | mcall 68,12,4096 |
||
14 | mov edx,eax |
||
15 | add edx,4096 |
||
16 | ret |
||
17 | ;--------------------------------------------------------------------- |
||
18 | thread7: ; start of bgrd thread |
||
19 | mcall 9, procinfo_threads, -1 |
||
20 | mov eax,[ebx+30] |
||
21 | mov [PID7],eax |
||
22 | mcall 40, 0x27 |
||
23 | mov eax,[slide_show_delay] |
||
24 | mov [slide_show_delay_old],eax |
||
25 | mov eax,[arrows_offset] |
||
26 | mov [arrows_offset_old],eax |
||
27 | mov eax,[check1+32] |
||
28 | mov [show_file_name_old],eax |
||
29 | mov eax,[check2+32] |
||
30 | mov [filtering_flag_old],eax |
||
31 | xor eax,eax |
||
32 | mov [option_pointer],eax |
||
33 | call .set_pointers |
||
34 | .red: |
||
35 | call .draw_window |
||
36 | |||
37 | .still: |
||
38 | |||
39 | mov eax,10 ; wait here for event |
||
40 | mcall |
||
41 | |||
42 | cmp eax,1 ; redraw request ? |
||
43 | je .red |
||
44 | cmp eax,2 ; key in buffer ? |
||
45 | je .key |
||
46 | cmp eax,3 ; button in buffer ? |
||
47 | je .button |
||
48 | cmp eax,6 ; mouse in buffer ? |
||
49 | je .mouse |
||
50 | jmp .still |
||
51 | |||
52 | .mouse: |
||
53 | mov ebx,[check1+32] |
||
54 | and ebx,10b |
||
55 | push dword check1 |
||
56 | call [check_box_mouse] |
||
57 | mov eax,[check1+32] |
||
58 | and eax,10b |
||
59 | cmp ebx,eax |
||
60 | je @f ;.still |
||
61 | mov [option_pointer],2 |
||
62 | call .set_pointers |
||
63 | call .draw_all_options_values |
||
64 | jmp .still |
||
65 | @@: |
||
66 | mov ebx,[check2+32] |
||
67 | and ebx,10b |
||
68 | push dword check2 |
||
69 | call [check_box_mouse] |
||
70 | mov eax,[check2+32] |
||
71 | and eax,10b |
||
72 | cmp ebx,eax |
||
73 | je .still |
||
74 | mov [option_pointer],3 |
||
75 | call .set_pointers |
||
76 | call .draw_all_options_values |
||
77 | jmp .still |
||
78 | ;--------------------------------------------------------------------- |
||
79 | .key: |
||
80 | mcall |
||
81 | cmp ah,27 |
||
82 | je .close |
||
83 | cmp ah,13 |
||
84 | je .kok |
||
85 | cmp ah,32 |
||
86 | je .select_space |
||
87 | cmp ah,56 ;plus |
||
88 | je .select_plus ;.plus_slide_show_delay |
||
89 | cmp ah,43 ;plus |
||
90 | je .select_plus ;.plus_slide_show_delay |
||
91 | cmp ah,61 ;plus |
||
92 | je .select_plus ;.plus_slide_show_delay |
||
93 | cmp ah,54 ;minus |
||
94 | je .select_minus ;.minus_slide_show_delay |
||
95 | cmp ah,45 ;minus |
||
96 | je .select_minus ;.minus_slide_show_delay |
||
97 | cmp ah,95 ;minus |
||
98 | je .select_minus ;.minus_slide_show_delay |
||
99 | cmp ah,178 ;up arrow |
||
100 | je .up_arrow |
||
101 | cmp ah,177 ;down arrow |
||
102 | je .down_arrow |
||
103 | jmp .still |
||
104 | ;--------------------------------------------------------------------- |
||
105 | .button: ; button |
||
106 | mov eax,17 ; get id |
||
107 | mcall |
||
108 | |||
109 | cmp ah,5 |
||
110 | je .minus_arrows_offset |
||
111 | |||
112 | cmp ah,4 |
||
113 | je .plus_arrows_offset |
||
114 | |||
115 | cmp ah,3 |
||
116 | je .minus_slide_show_delay |
||
117 | |||
118 | cmp ah,2 |
||
119 | je .plus_slide_show_delay |
||
120 | |||
121 | cmp ah,1 ; button id=1 ? |
||
122 | jne .noclose |
||
123 | .close: |
||
124 | mov eax,[slide_show_delay_old] |
||
125 | mov [slide_show_delay],eax |
||
126 | mov eax,[arrows_offset_old] |
||
127 | mov [arrows_offset],eax |
||
128 | mov eax,[show_file_name_old] |
||
129 | mov [check1+32],eax |
||
130 | mov eax,[filtering_flag_old] |
||
131 | mov [check2+32],eax |
||
132 | jmp .close_all |
||
133 | .close_1: |
||
134 | mov eax,[check2+32] |
||
135 | test eax,10b |
||
136 | jz @f |
||
137 | mov [filtering_flag],1 |
||
138 | jmp .redraw_flag |
||
139 | @@: |
||
140 | mov [filtering_flag],0 |
||
141 | .redraw_flag: |
||
142 | mov [redraw_flag],byte 1 |
||
143 | .close_all: |
||
144 | xor dword [status],64 |
||
145 | xor eax,eax |
||
146 | mov [PID7],eax |
||
147 | |||
148 | mcall 68,13,[thread_stack_7] |
||
149 | |||
150 | mov eax,-1 ; close this program |
||
151 | mcall |
||
152 | .noclose: |
||
153 | |||
154 | .kok: |
||
155 | |||
156 | jmp .close_1 |
||
157 | ;--------------------------------------------------------------------- |
||
158 | .select_plus: |
||
159 | jmp [plus_pointer] |
||
160 | ;--------------------------------------------------------------------- |
||
161 | .select_minus: |
||
162 | jmp [minus_pointer] |
||
163 | ;--------------------------------------------------------------------- |
||
164 | .select_space: |
||
165 | jmp [space_pointer] |
||
166 | ;--------------------------------------------------------------------- |
||
167 | .plus_slide_show_delay: |
||
168 | cmp [option_pointer],0 |
||
169 | je @f |
||
170 | mov [option_pointer],0 |
||
171 | call .draw_all_options_values |
||
172 | @@: |
||
173 | cmp [slide_show_delay],99990 |
||
174 | je .still |
||
175 | add [slide_show_delay],10 |
||
176 | call .draw_slide_show_delay |
||
177 | jmp .still |
||
178 | ;--------------------------------------------------------------------- |
||
179 | .minus_slide_show_delay: |
||
180 | cmp [option_pointer],0 |
||
181 | je @f |
||
182 | mov [option_pointer],0 |
||
183 | call .draw_all_options_values |
||
184 | @@: |
||
185 | cmp [slide_show_delay],0 |
||
186 | je .still |
||
187 | sub [slide_show_delay],10 |
||
188 | call .draw_slide_show_delay |
||
189 | jmp .still |
||
190 | ;--------------------------------------------------------------------- |
||
191 | .plus_arrows_offset: |
||
192 | cmp [option_pointer],1 |
||
193 | je @f |
||
194 | mov [option_pointer],1 |
||
195 | call .draw_all_options_values |
||
196 | @@: |
||
197 | cmp [arrows_offset],100 |
||
198 | je .still |
||
199 | inc [arrows_offset] |
||
200 | call .draw_arrows_offset |
||
201 | call calculate_arrows_offset |
||
202 | jmp .still |
||
203 | ;--------------------------------------------------------------------- |
||
204 | .minus_arrows_offset: |
||
205 | cmp [option_pointer],1 |
||
206 | je @f |
||
207 | mov [option_pointer],1 |
||
208 | call .draw_all_options_values |
||
209 | @@: |
||
210 | cmp [arrows_offset],1 |
||
211 | je .still |
||
212 | dec [arrows_offset] |
||
213 | call .draw_arrows_offset |
||
214 | call calculate_arrows_offset |
||
215 | jmp .still |
||
216 | ;--------------------------------------------------------------------- |
||
217 | .space_check1: |
||
218 | test [check1+32],dword 10b |
||
219 | jnz @f |
||
220 | or [check1+32],dword 10b |
||
221 | jmp .space_check1_1 |
||
222 | @@: |
||
223 | xor [check1+32],dword 10b |
||
224 | .space_check1_1: |
||
225 | call .draw_all_options_values |
||
226 | jmp .still |
||
227 | ;--------------------------------------------------------------------- |
||
228 | .space_check2: |
||
229 | test [check2+32],dword 10b |
||
230 | jnz @f |
||
231 | or [check2+32],dword 10b |
||
232 | jmp .space_check2_1 |
||
233 | @@: |
||
234 | xor [check2+32],dword 10b |
||
235 | .space_check2_1: |
||
236 | call .draw_all_options_values |
||
237 | jmp .still |
||
238 | ;--------------------------------------------------------------------- |
||
239 | .down_arrow: |
||
240 | cmp [option_pointer],3 |
||
241 | je .still |
||
242 | inc [option_pointer] |
||
243 | .draw_all_points: |
||
244 | call .set_pointers |
||
245 | call .draw_all_options_values |
||
246 | jmp .still |
||
247 | ;--------------------------------------------------------------------- |
||
248 | .up_arrow: |
||
249 | cmp [option_pointer],0 |
||
250 | je .still |
||
251 | dec [option_pointer] |
||
252 | jmp .draw_all_points |
||
253 | ;--------------------------------------------------------------------- |
||
254 | .set_pointers: |
||
255 | cmp [option_pointer],0 |
||
256 | jne @f |
||
257 | mov [plus_pointer],thread7.plus_slide_show_delay |
||
258 | mov [minus_pointer],thread7.minus_slide_show_delay |
||
259 | mov [space_pointer],thread7.still |
||
260 | ret |
||
261 | @@: |
||
262 | cmp [option_pointer],1 |
||
263 | jne @f |
||
264 | mov [plus_pointer],thread7.plus_arrows_offset |
||
265 | mov [minus_pointer],thread7.minus_arrows_offset |
||
266 | mov [space_pointer],thread7.still |
||
267 | ret |
||
268 | @@: |
||
269 | cmp [option_pointer],2 |
||
270 | jne @f |
||
271 | mov [plus_pointer],thread7.still |
||
272 | mov [minus_pointer],thread7.still |
||
273 | mov [space_pointer],thread7.space_check1 |
||
274 | ret |
||
275 | @@: |
||
276 | mov [plus_pointer],thread7.still |
||
277 | mov [minus_pointer],thread7.still |
||
278 | mov [space_pointer],thread7.space_check2 |
||
279 | ret |
||
280 | ;--------------------------------------------------------------------- |
||
281 | .draw_all_options_values: |
||
282 | call .draw_slide_show_delay |
||
283 | call .draw_arrows_offset |
||
284 | call .draw_check1 |
||
285 | call .draw_check2 |
||
286 | ret |
||
287 | ;--------------------------------------------------------------------- |
||
288 | ; ********************************************* |
||
289 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
||
290 | ; ********************************************* |
||
291 | |||
292 | |||
293 | .draw_window: |
||
294 | mcall 12,1 |
||
295 | ; DRAW WINDOW |
||
296 | xor eax,eax ; function 0 : define and draw window |
||
297 | mov ebx,100*65536+300 ; [x start] *65536 + [x size] |
||
298 | mov ecx,100*65536+120 ; [y start] *65536 + [y size] |
||
299 | mov edx,0x03909090 ; color of work area RRGGBB,8->color gl |
||
300 | mcall |
||
301 | |||
302 | mcall 8,<15,10>,<50,11>,2,0xdddddd |
||
303 | inc edx |
||
304 | mcall ,<77,10> |
||
305 | ;--------------------------------- |
||
306 | inc edx |
||
307 | mcall ,<15,10>,<90,11> |
||
308 | inc edx |
||
309 | mcall ,<77,10> |
||
310 | ;--------------------------------- |
||
311 | inc edx |
||
312 | mcall ,<250,40>,<50,20> |
||
313 | ;--------------------------------- |
||
314 | |||
315 | ; mcall 13,<50,45>,<25,12>,0xffffff |
||
316 | ; mov ecx,[ch_flag_en] |
||
317 | ; mcall 47,0x800a0000,,<72,27>,0x10000000; 0x40000000,0xffffff |
||
318 | ; WINDOW LABEL |
||
319 | mcall 71,1, optiontext |
||
320 | |||
321 | ; mov eax,4 ; function 4 : write text to window |
||
322 | ; mov ebx,46*65536+28 ; [x start] *65536 + [y start] |
||
323 | ; mov ecx,0xffffff |
||
324 | ; mov edx, sorttext |
||
325 | ; mov esi, sorttext.size |
||
326 | ; mcall |
||
327 | ; mov ebx,135*65536+57 |
||
328 | ; mov edx, ok_btn |
||
329 | ; mov esi, ok_btn.size ;2 |
||
330 | mcall 4,<10,35>,0x80ffffff,slide_show_delay_title |
||
331 | mcall ,<17,53>,0x90000000,slide_show_delay_text |
||
332 | mcall ,<10,75>,0x80ffffff,arrows_offset_title |
||
333 | mcall ,<17,93>,0x90000000,slide_show_delay_text |
||
334 | mcall ,<265,57>, ,ok_btn |
||
335 | |||
336 | call .draw_all_options_values |
||
337 | |||
338 | ; mcall 47,0x80000,[PID5],<200, 5>,0xffffff |
||
339 | mcall 12,2 |
||
340 | |||
341 | ret |
||
342 | ;--------------------------------------------------------------------- |
||
343 | ;.draw_opt_boxes: |
||
344 | ; draw_option_boxes option_boxes_sort,option_boxes_sort_end |
||
345 | ; ret |
||
346 | ;--------------------------------------------------------------------- |
||
347 | .draw_slide_show_delay: |
||
348 | mov edx,0xffffff |
||
349 | cmp [option_pointer],0 |
||
350 | jne @f |
||
351 | mov edx,0xffff80 |
||
352 | @@: |
||
353 | mcall 13,<29,45>,<50,12>, |
||
354 | mcall 47,0x800a0000,[slide_show_delay],<32,52>,0x10000000; 0x40000000,0xffffff |
||
355 | ret |
||
356 | ;--------------------------------------------------------------------- |
||
357 | .draw_arrows_offset: |
||
358 | mov edx,0xffffff |
||
359 | cmp [option_pointer],1 |
||
360 | jne @f |
||
361 | mov edx,0xffff80 |
||
362 | @@: |
||
363 | mcall 13,<29,45>,<90,12>, |
||
364 | mcall 47,0x800a0000,[arrows_offset],<32,92>,0x10000000; 0x40000000,0xffffff |
||
365 | ret |
||
366 | ;--------------------------------------------------------------------- |
||
367 | .draw_check1: |
||
368 | mov [check1+12],dword 0xffffff |
||
369 | cmp [option_pointer],2 |
||
370 | jne @f |
||
371 | mov [check1+12],dword 0xffff80 |
||
372 | @@: |
||
373 | push dword check1 |
||
374 | call [check_box_draw] |
||
375 | ret |
||
376 | ;--------------------------------------------------------------------- |
||
377 | .draw_check2: |
||
378 | mov [check2+12],dword 0xffffff |
||
379 | cmp [option_pointer],3 |
||
380 | jne @f |
||
381 | mov [check2+12],dword 0xffff80 |
||
382 | @@: |
||
383 | push dword check2 |
||
384 | call [check_box_draw] |
||
385 | ret |
||
386 | ;---------------------------------------------------------------------32,92>90,12>29,45>32,52>50,12>29,45>200,>265,57>17,93>10,75>17,53>10,35>72,27>25,12>50,45>50,20>250,40>77,10>90,11>15,10>77,10>50,11>15,10> |