Rev 1792 | Rev 3840 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1792 | yogev_ezra | 1 | ;--------------------------------------------------------------------- |
2 | key_menu: |
||
3 | mcall 2 |
||
4 | cmp [extended_key],1 |
||
5 | je .extended_key |
||
6 | test al, al |
||
7 | jnz .end_1 |
||
8 | cmp ah, 0xE0 |
||
9 | jne @f |
||
10 | mov [extended_key],1 |
||
11 | .end_1: |
||
12 | ret |
||
13 | @@: |
||
14 | cmp ah,72 |
||
15 | je menu_key_72.1 |
||
16 | cmp ah,80 |
||
17 | je menu_key_80.1 |
||
18 | cmp ah,28 |
||
19 | je menu_key_28.1 |
||
20 | .end: |
||
21 | cmp ah,208 |
||
22 | je .end_1 |
||
23 | cmp ah,200 |
||
24 | je .end_1 |
||
25 | cmp ah,156 |
||
26 | je .end_1 |
||
27 | cmp ah,184 |
||
28 | je .end_5 |
||
29 | cmp ah,187 |
||
30 | je .end_1 |
||
31 | cmp ah,188 |
||
32 | je .end_1 |
||
33 | cmp ah,199 |
||
34 | je .end_1 |
||
35 | cmp ah,207 |
||
36 | je .end_1 |
||
37 | cmp ah,201 |
||
38 | je .end_1 |
||
39 | cmp ah,209 |
||
40 | je .end_1 |
||
41 | cmp ah,42 ; NumLock ON |
||
42 | je .end_1 |
||
43 | cmp ah,170 ; NumLock ON |
||
44 | je .end_1 |
||
45 | cmp ah,210 |
||
46 | je .end_1 |
||
47 | cmp ah,211 |
||
48 | je .end_1 |
||
49 | cmp ah,56 |
||
50 | je .end_4 |
||
51 | cmp ah,59 |
||
52 | je .end_2 |
||
53 | cmp ah,60 |
||
54 | je .end_3 |
||
55 | .for_all: |
||
56 | mov [close_menu],1 |
||
57 | ret |
||
58 | |||
59 | .end_2: |
||
60 | cmp [alt_flag],0 |
||
61 | je .for_all |
||
62 | cmp [select_panel_counter],0 |
||
63 | je .end_1 |
||
64 | mov [close_menu],2 |
||
65 | ret |
||
66 | .end_3: |
||
67 | cmp [alt_flag],0 |
||
68 | je .for_all |
||
69 | cmp [select_panel_counter],0 |
||
70 | jne .end_1 |
||
71 | mov [close_menu],2 |
||
72 | ret |
||
73 | .end_4: |
||
74 | cmp [alt_flag],1 |
||
75 | je .end_1 |
||
76 | mov [alt_flag],1 |
||
77 | jmp @f |
||
78 | .end_5: |
||
79 | cmp [alt_flag],0 |
||
80 | je .end_1 |
||
81 | mov [alt_flag],0 |
||
82 | @@: |
||
83 | call erase_fbutton |
||
84 | call draw_fbutton |
||
85 | ret |
||
86 | ;--------------------------------------------------------------------- |
||
87 | .extended_key: |
||
88 | mov [extended_key],0 |
||
89 | menu_key_80: |
||
90 | cmp ah,80 ; arrow down |
||
91 | jne menu_key_72 |
||
92 | .1: |
||
93 | mov eax,[retrieved_devices_table_counter] |
||
94 | dec eax |
||
95 | cmp eax,[start_draw_menu_cursor_line] |
||
96 | je @f |
||
97 | inc [start_draw_menu_cursor_line] |
||
98 | @@: |
||
99 | ret |
||
100 | ;--------------------------------------------------------------------- |
||
101 | menu_key_72: |
||
102 | cmp ah,72 ;arrow up |
||
103 | jne menu_key_71 |
||
104 | .1: |
||
105 | cmp [start_draw_menu_cursor_line],0 |
||
106 | je @f |
||
107 | dec [start_draw_menu_cursor_line] |
||
108 | @@: |
||
109 | ret |
||
110 | ;--------------------------------------------------------------------- |
||
111 | menu_key_71: |
||
112 | cmp ah,71 ;Home |
||
113 | je @f |
||
114 | cmp ah,73 ;PageUp |
||
115 | jne menu_key_79 |
||
116 | @@: |
||
117 | mov [start_draw_menu_cursor_line],0 |
||
118 | ret |
||
119 | ;--------------------------------------------------------------------- |
||
120 | menu_key_79: |
||
121 | cmp ah,79 ; End |
||
122 | je @f |
||
123 | cmp ah,81 ; PageDown |
||
124 | jne menu_key_82 |
||
125 | @@: |
||
126 | mov eax,[retrieved_devices_table_counter] |
||
127 | dec eax |
||
128 | mov [start_draw_menu_cursor_line],eax |
||
129 | ret |
||
130 | ;--------------------------------------------------------------------- |
||
131 | menu_key_82: |
||
132 | cmp ah,82 ; Insert |
||
133 | jne menu_key_83 |
||
134 | mov esi,[start_draw_menu_cursor_line] |
||
135 | imul esi,10 |
||
136 | add esi,retrieved_devices_table |
||
137 | inc esi |
||
138 | cmp [esi],word 'cd' |
||
139 | jne @f |
||
140 | xor ecx,ecx |
||
141 | mov cl,[esi+2] |
||
142 | sub ecx,0x30 |
||
143 | mcall 24,5 |
||
144 | @@: |
||
145 | ret |
||
146 | ;--------------------------------------------------------------------- |
||
147 | menu_key_83: |
||
148 | cmp ah,83 ; Delete |
||
149 | jne menu_key_28 |
||
150 | mov esi,[start_draw_menu_cursor_line] |
||
151 | imul esi,10 |
||
152 | add esi,retrieved_devices_table |
||
153 | inc esi |
||
154 | cmp [esi],word 'cd' |
||
155 | jne @f |
||
156 | xor ecx,ecx |
||
157 | mov cl,[esi+2] |
||
158 | sub ecx,0x30 |
||
159 | mcall 24,4 |
||
160 | @@: |
||
161 | ret |
||
162 | ;--------------------------------------------------------------------- |
||
163 | menu_key_28: |
||
164 | cmp ah,28 ; Enter |
||
165 | jne menu_key_end |
||
166 | .1: |
||
167 | mov [press_enter_menu],1 |
||
168 | ret |
||
169 | menu_key_end: |
||
170 | jmp key_menu.end |
||
171 | ;--------------------------------------------------------------------- |
||
172 | key_menu_left: |
||
173 | mov [close_menu],0 |
||
174 | mov [press_enter_menu],0 |
||
175 | call key_menu |
||
176 | cmp [press_enter_menu],1 |
||
177 | je .press_enter_menu |
||
178 | cmp [close_menu],0 |
||
179 | je draw_left_select_disk_menu.red |
||
180 | .1: |
||
181 | ; mov [left_panel_clear_all],1 |
||
182 | call draw_left_panel |
||
183 | ; mov [right_panel_clear_all],1 |
||
184 | call draw_right_panel |
||
185 | cmp [alt_flag],0 |
||
186 | je still |
||
187 | cmp [close_menu],2 |
||
188 | je draw_right_select_disk_menu |
||
189 | jmp still |
||
190 | .press_enter_menu: |
||
191 | mov esi,[start_draw_menu_cursor_line] |
||
192 | imul esi,10 |
||
193 | add esi,retrieved_devices_table |
||
194 | inc esi |
||
195 | call copy_folder_name |
||
196 | mov [left_start_draw_cursor_line],0 |
||
197 | call proc_read_folder |
||
198 | jmp still |
||
199 | ;--------------------------------------------------------------------- |
||
200 | key_menu_right: |
||
201 | mov [close_menu],0 |
||
202 | mov [press_enter_menu],0 |
||
203 | call key_menu |
||
204 | cmp [press_enter_menu],1 |
||
205 | je .press_enter_menu |
||
206 | cmp [close_menu],0 |
||
207 | je draw_right_select_disk_menu.red |
||
208 | .1: |
||
209 | ; mov [left_panel_clear_all],1 |
||
210 | call draw_left_panel |
||
211 | ; mov [right_panel_clear_all],1 |
||
212 | call draw_right_panel |
||
213 | cmp [alt_flag],0 |
||
214 | je still |
||
215 | cmp [close_menu],2 |
||
216 | je draw_left_select_disk_menu |
||
217 | jmp still |
||
218 | .press_enter_menu: |
||
219 | mov esi,[start_draw_menu_cursor_line] |
||
220 | imul esi,10 |
||
221 | add esi,retrieved_devices_table |
||
222 | inc esi |
||
223 | call copy_folder_name_1 |
||
224 | mov [right_start_draw_cursor_line],0 |
||
225 | call proc_read_folder_1 |
||
226 | jmp still |
||
227 | ;--------------------------------------------------------------------- |
||
228 | draw_left_select_disk_menu: |
||
3755 | mario79 | 229 | call device_detect_f70 |
1792 | yogev_ezra | 230 | mov [select_panel_counter],0 |
231 | call draw_left_panel |
||
232 | call draw_right_panel |
||
233 | mov [start_draw_menu_cursor_line],0 |
||
234 | .red: |
||
235 | call draw_left_menu |
||
236 | .still: |
||
237 | mcall 10 |
||
238 | cmp eax,1 |
||
239 | je red |
||
240 | cmp eax,2 |
||
241 | je key_menu_left |
||
242 | cmp eax,3 |
||
243 | je @f |
||
244 | cmp eax,6 |
||
245 | je mouse_menu_left |
||
246 | jmp .still |
||
247 | @@: |
||
248 | call draw_left_panel |
||
249 | jmp button |
||
250 | ;--------------------------------------------------------------------- |
||
251 | draw_right_select_disk_menu: |
||
3755 | mario79 | 252 | call device_detect_f70 |
1792 | yogev_ezra | 253 | mov [select_panel_counter],1 |
254 | call draw_left_panel |
||
255 | call draw_right_panel |
||
256 | mov [start_draw_menu_cursor_line],0 |
||
257 | .red: |
||
258 | call draw_right_menu |
||
259 | .still: |
||
260 | mcall 10 |
||
261 | cmp eax,1 |
||
262 | je red |
||
263 | cmp eax,2 |
||
264 | je key_menu_right |
||
265 | cmp eax,3 |
||
266 | je @f |
||
267 | cmp eax,6 |
||
268 | je mouse_menu_right |
||
269 | jmp .still |
||
270 | @@: |
||
271 | call draw_right_panel |
||
272 | jmp button |
||
273 | ;--------------------------------------------------------------------- |
||
274 | draw_left_menu: |
||
275 | mov ebx,[left_panel_x] |
||
276 | mov bx,60 |
||
277 | mov ecx,[left_panel_y] |
||
278 | mov eax,[retrieved_devices_table_counter] |
||
279 | mov cx,ax |
||
280 | imul cx,10 |
||
281 | mov edx,0xffffcc |
||
282 | mov eax,13 |
||
283 | int 0x40 |
||
284 | call draw_menu_Selection |
||
285 | call draw_menu_data |
||
286 | ret |
||
287 | ;--------------------------------------------------------------------- |
||
288 | draw_right_menu: |
||
289 | mov ebx,[right_panel_x] |
||
290 | mov bx,60 |
||
291 | mov ecx,[right_panel_y] |
||
292 | mov eax,[retrieved_devices_table_counter] |
||
293 | mov cx,ax |
||
294 | imul cx,10 |
||
295 | mov edx,0xffffcc |
||
296 | mov eax,13 |
||
297 | int 0x40 |
||
298 | call draw_menu_Selection |
||
299 | call draw_menu_data |
||
300 | ret |
||
301 | ;--------------------------------------------------------------------- |
||
302 | draw_menu_data: |
||
303 | mov edx,retrieved_devices_table |
||
304 | shr ecx,16 |
||
305 | mov bx,cx |
||
306 | mov ebp,0 |
||
307 | .start: |
||
308 | mcall 4, ,0x80000000 |
||
309 | add ebx,10 |
||
310 | add edx,10 |
||
311 | inc ebp |
||
312 | cmp ebp,[retrieved_devices_table_counter] |
||
313 | jne .start |
||
314 | ret |
||
315 | ;--------------------------------------------------------------------- |
||
316 | draw_menu_Selection: |
||
317 | push ebx ecx |
||
318 | mov eax,[start_draw_menu_cursor_line] |
||
319 | imul eax,10 |
||
320 | shl eax,16 |
||
321 | add ecx,eax |
||
322 | mov cx,10 |
||
323 | mov edx,0xbbffbb |
||
324 | mov eax,13 |
||
325 | int 0x40 |
||
326 | pop ecx ebx |
||
327 | ret |
||
328 | ;--------------------------------------------------------------------- |
||
329 | mouse_menu_left: |
||
330 | mcall 37,2 |
||
331 | mov [mouse_keys],eax |
||
332 | mcall 37,1 |
||
333 | mov [mouse_position],eax |
||
334 | test eax,0x80000000 |
||
335 | jnz draw_left_select_disk_menu.still |
||
336 | test eax,0x8000 |
||
337 | jnz draw_left_select_disk_menu.still |
||
338 | mov ebx,eax |
||
339 | shr ebx,16 |
||
340 | shl eax,16 |
||
341 | shr eax,16 |
||
342 | cmp ebx,[window_width] |
||
343 | ja draw_left_select_disk_menu.still |
||
344 | cmp eax,[window_high] |
||
345 | ja draw_left_select_disk_menu.still |
||
346 | xor ecx,ecx |
||
347 | mov cx,[left_panel_y.start_y] |
||
348 | cmp ax,cx |
||
349 | jbe .close |
||
350 | mov edx,[retrieved_devices_table_counter] |
||
351 | imul edx,10 |
||
352 | add cx,dx |
||
353 | cmp ax,cx |
||
354 | jae .close |
||
355 | mov cx,[left_panel_x.start_x] |
||
356 | cmp bx,cx |
||
357 | jbe .close |
||
358 | add cx,60 |
||
359 | cmp bx,cx |
||
360 | jae .close |
||
361 | sub ax,[left_panel_y.start_y] |
||
362 | mov ebx,10 |
||
363 | xor edx,edx |
||
364 | div ebx |
||
365 | mov [start_draw_menu_cursor_line],eax |
||
366 | cmp [mouse_keys],0 |
||
367 | je draw_left_select_disk_menu.red |
||
368 | jmp key_menu_left.press_enter_menu |
||
369 | .close: |
||
370 | cmp [mouse_keys],0 |
||
371 | je draw_left_select_disk_menu.still |
||
372 | ; mov [left_panel_clear_all],1 |
||
373 | call draw_left_panel |
||
374 | jmp still |
||
375 | ;--------------------------------------------------------------------- |
||
376 | mouse_menu_right: |
||
377 | mcall 37,2 |
||
378 | mov [mouse_keys],eax |
||
379 | mcall 37,1 |
||
380 | mov [mouse_position],eax |
||
381 | test eax,0x80000000 |
||
382 | jnz draw_right_select_disk_menu.still |
||
383 | test eax,0x8000 |
||
384 | jnz draw_right_select_disk_menu.still |
||
385 | mov ebx,eax |
||
386 | shr ebx,16 |
||
387 | shl eax,16 |
||
388 | shr eax,16 |
||
389 | cmp ebx,[window_width] |
||
390 | ja draw_right_select_disk_menu.still |
||
391 | cmp eax,[window_high] |
||
392 | ja draw_right_select_disk_menu.still |
||
393 | xor ecx,ecx |
||
394 | mov cx,[right_panel_y.start_y] |
||
395 | cmp ax,cx |
||
396 | jbe .close |
||
397 | mov edx,[retrieved_devices_table_counter] |
||
398 | imul edx,10 |
||
399 | add cx,dx |
||
400 | cmp ax,cx |
||
401 | jae .close |
||
402 | mov cx,[right_panel_x.start_x] |
||
403 | cmp bx,cx |
||
404 | jbe .close |
||
405 | add cx,60 |
||
406 | cmp bx,cx |
||
407 | jae .close |
||
408 | sub ax,[right_panel_y.start_y] |
||
409 | mov ebx,10 |
||
410 | xor edx,edx |
||
411 | div ebx |
||
412 | mov [start_draw_menu_cursor_line],eax |
||
413 | cmp [mouse_keys],0 |
||
414 | je draw_right_select_disk_menu.red |
||
415 | jmp key_menu_right.press_enter_menu |
||
416 | .close: |
||
417 | cmp [mouse_keys],0 |
||
418 | je draw_right_select_disk_menu.still |
||
419 | ; mov [right_panel_clear_all],1 |
||
420 | call draw_right_panel |
||
421 | jmp still |
||
422 | ;--------------------------------------------------------------------- |