Rev 502 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
31 | halyavin | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ; ; |
||
3 | ; SYSTEM X-TREE BROWSER ; |
||
4 | ; ; |
||
5 | ; Author: Pavlushin Evgeni waptap@mail.ru ; |
||
6 | ; site: www.deck4.narod.ru ; |
||
7 | ; ; |
||
8 | ; Compile with FASM for MenuetOS ; |
||
9 | ; ; |
||
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
11 | |||
12 | ;Bug report +bug deleted -bug not deleted |
||
13 | ;show/fade del notwork+ |
||
14 | ;64Ver Run file from HD bug deleted. |
||
15 | ;65Ver The bad scroll realization |
||
16 | ;66Ver The good scroll realization, url line anti-flick |
||
17 | ;67Ver Url line monolith procedure |
||
18 | ;68Ver Mini icon on left of file name |
||
19 | ;69Ver Getimg proc size minus 900 bytes |
||
20 | ;70Ver Del data area ramsize minus 140000 bytes |
||
21 | ;72Ver Quick sort, ramsize minus 200000 bytes |
||
22 | ;73Ver Url flick and out bugs delete |
||
23 | ;74Ver scroll bug deleted |
||
24 | ;75Ver hd partition fast change button. Add bmp,txt,exec,asm and inc icons. |
||
25 | ; sort type in headmenu bug del |
||
26 | ;78Ver directory extension bug fix by Asko Vuori |
||
27 | ;79Ver Asko Vuori volume label add and "put in command line" bug fix |
||
28 | ;80Ver prompt edit fatal bug deleted, antiflick when move list up/down |
||
29 | ;81Ver Save Dialog bug deleted |
||
134 | diamond | 30 | ;82Ver Rewritten to function 70. Corrected work with scrollbar. |
156 | diamond | 31 | ;83Ver CD-ROM support |
32 | ;84Ver URL line editor corrected |
||
134 | diamond | 33 | ;1560000 bytes memory! |
31 | halyavin | 34 | |
35 | ;****************************************************************************** |
||
36 | use32 |
||
131 | diamond | 37 | org 0x0 |
38 | db 'MENUET01' ; 8 byte id |
||
39 | dd 0x01 ; header version |
||
40 | dd START ; program start |
||
41 | dd I_END ; program image size |
||
42 | dd RAM_END ; memory |
||
43 | dd RAM_END ; stack |
||
44 | dd param_area ,0x0 ; param,icon |
||
31 | halyavin | 45 | ; dd 0,0 |
46 | |||
47 | ;****************************************************************************** |
||
485 | heavyiron | 48 | include '..\..\..\macros.inc' |
31 | halyavin | 49 | include 'ascl.inc' |
50 | include 'ascgl.inc' |
||
131 | diamond | 51 | |
31 | halyavin | 52 | gif_hash_offset = gif_hash |
53 | |||
131 | diamond | 54 | START: ; start of execution |
31 | halyavin | 55 | ; //// Willow |
131 | diamond | 56 | ; mov eax,58 |
57 | ; mov ebx,MRUfile |
||
485 | heavyiron | 58 | ; mcall |
31 | halyavin | 59 | ; //// Willow |
131 | diamond | 60 | mcall 18,11,1,table_area |
134 | diamond | 61 | cmp [edx+2],byte 0 |
131 | diamond | 62 | je no_hdpartition_on_hd0 |
134 | diamond | 63 | mov [hdimg1], aHD0 |
131 | diamond | 64 | no_hdpartition_on_hd0: |
134 | diamond | 65 | cmp [edx+3],byte 0 |
131 | diamond | 66 | je no_hdpartition_on_hd1 |
134 | diamond | 67 | mov [hdimg2], aHD1 |
131 | diamond | 68 | no_hdpartition_on_hd1: |
134 | diamond | 69 | cmp [edx+4],byte 0 |
131 | diamond | 70 | je no_hdpartition_on_hd2 |
134 | diamond | 71 | mov [hdimg3], aHD2 |
131 | diamond | 72 | no_hdpartition_on_hd2: |
134 | diamond | 73 | cmp [edx+5],byte 0 |
131 | diamond | 74 | je no_hdpartition_on_hd3 |
134 | diamond | 75 | mov [hdimg4], aHD3 |
131 | diamond | 76 | no_hdpartition_on_hd3: |
156 | diamond | 77 | test byte [edx+1], 80h |
78 | jz @f |
||
79 | mov [hdimg1], aCD0 |
||
80 | mov [hdimg1+4], 'CD-R' |
||
81 | mov [hdimg1+8], 'OM ' |
||
82 | @@: |
||
83 | test byte [edx+1], 20h |
||
84 | jz @f |
||
85 | mov [hdimg2], aCD1 |
||
86 | mov [hdimg2+4], 'CD-R' |
||
87 | mov [hdimg2+8], 'OM ' |
||
88 | @@: |
||
89 | test byte [edx+1], 8 |
||
90 | jz @f |
||
91 | mov [hdimg3], aCD2 |
||
92 | mov [hdimg3+4], 'CD-R' |
||
93 | mov [hdimg3+8], 'OM ' |
||
94 | @@: |
||
95 | test byte [edx+1], 2 |
||
96 | jz @f |
||
97 | mov [hdimg4], aCD3 |
||
98 | mov [hdimg4+4], 'CD-R' |
||
99 | mov [hdimg4+8], 'OM ' |
||
100 | @@: |
||
31 | halyavin | 101 | |
102 | mov eax,40 |
||
103 | mov ebx,0100111b |
||
485 | heavyiron | 104 | mcall |
31 | halyavin | 105 | |
106 | cmp byte [param_area],0 ;test parameters line |
||
131 | diamond | 107 | jne no_brow ;it's dialog |
134 | diamond | 108 | mov [browser], 1 ;it's browser |
109 | jmp no_dlg |
||
31 | halyavin | 110 | no_brow: |
111 | |||
112 | mov al,byte [param_area+5] |
||
113 | mov [dlg_type],al |
||
114 | |||
115 | mov eax,9 |
||
116 | mov ebx,procinfo |
||
117 | mov ecx,-1 |
||
485 | heavyiron | 118 | mcall |
31 | halyavin | 119 | |
120 | mov eax,dword [procinfo+30] |
||
121 | mov edi,MYPID+4-1 |
||
122 | mov ecx,4 |
||
123 | mov ebx,10 |
||
124 | cld |
||
125 | |||
126 | new_d: |
||
127 | xor edx,edx |
||
128 | div ebx |
||
129 | add dl,'0' |
||
130 | mov [edi],dl |
||
131 | dec edi |
||
132 | loop new_d |
||
133 | |||
134 | movzx eax,byte [param_area] |
||
135 | sub eax,48 |
||
136 | imul eax,10 |
||
137 | movzx ebx,byte [param_area+1] |
||
138 | add eax,ebx |
||
139 | sub eax,48 |
||
140 | imul eax,10 |
||
141 | movzx ebx,byte [param_area+2] |
||
142 | add eax,ebx |
||
143 | sub eax,48 |
||
144 | imul eax,10 |
||
145 | movzx ebx,byte [param_area+3] |
||
146 | add eax,ebx |
||
147 | sub eax,48 |
||
148 | |||
149 | mov ecx,eax ;pid to ecx |
||
150 | mov eax,60 |
||
151 | mov ebx,2 |
||
152 | mov edx,MYPID |
||
153 | mov esi,4 |
||
485 | heavyiron | 154 | mcall |
31 | halyavin | 155 | no_dlg: |
156 | |||
157 | giftoimg but_file,tempimg |
||
158 | |||
159 | ;************************ |
||
160 | ; Get images |
||
161 | ;************************ |
||
162 | |||
163 | mov eax,0 ;x |
||
131 | diamond | 164 | mov ebx,0 ;y |
31 | halyavin | 165 | mov esi,286 ;xs |
131 | diamond | 166 | mov edi,16 ;ys |
31 | halyavin | 167 | mov ecx,tempimg ;src |
168 | mov edx,butimg ;dest |
||
169 | call getimgproc |
||
170 | mov eax,288 |
||
171 | mov esi,60 |
||
172 | mov edx,logoimg ;dest |
||
173 | call getimgproc |
||
174 | mov eax,0 ;x |
||
131 | diamond | 175 | mov ebx,16 ;y |
176 | mov esi,51 ;xs |
||
31 | halyavin | 177 | mov edi,esi ;ys |
131 | diamond | 178 | mov edx,logoinfimg ;dest |
31 | halyavin | 179 | call getimgproc |
131 | diamond | 180 | mov eax,51 ;x |
181 | mov esi,8 ;xs |
||
182 | mov edi,9 ;ys |
||
31 | halyavin | 183 | mov edx,upsb ;dest |
184 | call getimgproc |
||
185 | mov eax,51+8 ;x |
||
186 | mov edx,dnsb ;dest |
||
187 | call getimgproc |
||
188 | |||
189 | mov eax,51+16 ;x |
||
131 | diamond | 190 | mov ebx,16 ;y |
191 | mov esi,12 ;xs |
||
192 | mov edi,9 ;ys |
||
31 | halyavin | 193 | |
194 | mov ecx,tempimg ;src |
||
195 | mov edx,hdico ;dest |
||
156 | diamond | 196 | mov ebp,10 |
31 | halyavin | 197 | loogetimg: |
198 | call getimgproc |
||
199 | add edx,9*12*3+8 |
||
200 | add eax,12 |
||
201 | dec ebp |
||
202 | jnz loogetimg |
||
203 | |||
204 | call read_directory |
||
205 | ; call convertation |
||
206 | red: |
||
131 | diamond | 207 | call draw_window ; at first, draw the window |
31 | halyavin | 208 | |
209 | still: |
||
210 | mov eax,9 |
||
211 | mov ebx,procinfo |
||
212 | mov ecx,-1 |
||
485 | heavyiron | 213 | mcall |
31 | halyavin | 214 | |
215 | wtevent red,key,button |
||
216 | |||
217 | scrolltest: |
||
218 | mov eax,37 |
||
219 | mov ebx,2 |
||
485 | heavyiron | 220 | mcall |
134 | diamond | 221 | dec eax |
31 | halyavin | 222 | jne still |
223 | |||
224 | scrl: |
||
225 | mov eax,37 |
||
226 | mov ebx,1 |
||
485 | heavyiron | 227 | mcall |
134 | diamond | 228 | movzx ebx, ax ; y |
229 | shr eax, 16 ; x |
||
31 | halyavin | 230 | mov ebp,eax |
502 | heavyiron | 231 | sub ebp,[listx] ;[procinfo.box.width] |
31 | halyavin | 232 | sub ebp,[listxsize] |
233 | add ebp,[scrollsize] |
||
234 | cmp ebp,dword [scrollsize] ;8 |
||
134 | diamond | 235 | jae menu_test ; still |
31 | halyavin | 236 | |
134 | diamond | 237 | lea ebp, [ebx-scrollbutsize] |
238 | sub ebp, [listy] ; up scroll |
||
239 | jl menu_test |
||
240 | mov ecx, [listysize] |
||
241 | sub ecx, 2*scrollbutsize |
||
242 | mov eax, [scroll_height] |
||
243 | cmp ebp, ecx |
||
244 | jge menu_test |
||
245 | sub ecx, eax |
||
246 | shr eax, 1 |
||
247 | sub ebp, eax |
||
248 | jge @f |
||
249 | xor ebp, ebp |
||
250 | @@: |
||
251 | cmp ebp, ecx |
||
252 | jl @f |
||
253 | mov ebp, ecx |
||
254 | @@: |
||
255 | xor edx, edx |
||
256 | mov eax, [listysize] |
||
257 | sub eax, 2 |
||
258 | mov ebx, 10 |
||
259 | div ebx |
||
260 | mov ebx, eax |
||
261 | cmp ebx, [listsize] |
||
262 | jae notusescrl |
||
263 | mov eax, [listsize] |
||
264 | sub eax, ebx |
||
265 | mul ebp |
||
266 | div ecx |
||
267 | cmp eax, [filecursor] |
||
268 | jz still |
||
269 | mov [filecursor], eax |
||
270 | jmp usescrl |
||
31 | halyavin | 271 | notusescrl: |
134 | diamond | 272 | cmp [filecursor], 0 |
273 | jz still |
||
31 | halyavin | 274 | mov [filecursor],0 ;ebp |
275 | usescrl: |
||
276 | |||
277 | mov [flick],1 |
||
278 | jmp anti_flick ;red |
||
279 | |||
280 | menu_test: |
||
281 | cmp [pmenu_draw],1 ;if menu is show, update all |
||
282 | jne still |
||
283 | mov [pmenu_draw],0 |
||
131 | diamond | 284 | jmp red ;update all window |
31 | halyavin | 285 | |
286 | ;this function not use in dialog when poup menu's is not used |
||
287 | ;in dialog's |
||
288 | |||
289 | ;=================== |
||
290 | ; Test keyboard |
||
291 | ;=================== |
||
131 | diamond | 292 | key: ; key |
31 | halyavin | 293 | mov eax,2 |
485 | heavyiron | 294 | mcall |
31 | halyavin | 295 | cmp dword [focus],0 |
296 | jne con_edit |
||
297 | cmp ah,key_Up |
||
298 | jne no_upk |
||
299 | mov ebx,1 |
||
300 | jmp up |
||
301 | no_upk: |
||
302 | cmp ah,key_Down |
||
303 | jne no_downk |
||
304 | mov ebx,1 |
||
305 | jmp down |
||
306 | no_downk: |
||
307 | cmp ah,key_PgUp |
||
308 | jne no_pgup |
||
309 | mov ebx,10 |
||
310 | jmp up |
||
311 | no_pgup: |
||
312 | cmp ah,key_PgDown |
||
313 | jne no_pgdown |
||
314 | mov ebx,10 |
||
315 | jmp down |
||
316 | no_pgdown: |
||
317 | cmp ah,key_Enter |
||
134 | diamond | 318 | je kfad |
31 | halyavin | 319 | cmp ah,key_Bspace |
131 | diamond | 320 | je back |
31 | halyavin | 321 | cmp ah,key_F2 |
131 | diamond | 322 | je viewset |
31 | halyavin | 323 | cmp ah,key_F3 |
131 | diamond | 324 | je textopen |
31 | halyavin | 325 | cmp ah,key_F5 |
131 | diamond | 326 | je copy_to_clip |
31 | halyavin | 327 | cmp ah,key_F6 |
131 | diamond | 328 | je paste_from_clip |
31 | halyavin | 329 | cmp ah,key_F11 |
131 | diamond | 330 | je edit_prompt |
31 | halyavin | 331 | cmp ah,key_F12 |
131 | diamond | 332 | je update |
31 | halyavin | 333 | jmp still |
334 | |||
335 | ; test input string |
||
336 | con_edit: |
||
337 | cmp ah,key_Enter |
||
338 | jne no_con_ent |
||
339 | not [focus] |
||
340 | jmp savetest |
||
134 | diamond | 341 | ; jmp update |
31 | halyavin | 342 | no_con_ent: |
343 | cmp ah,key_Left |
||
344 | jne no_con_left |
||
156 | diamond | 345 | cmp [cursor], 0 |
346 | jz still |
||
31 | halyavin | 347 | dec [cursor] |
348 | mov [flick],2 |
||
349 | jmp anti_flick ;red |
||
350 | no_con_left: |
||
351 | cmp ah,key_Right |
||
352 | jne no_con_right |
||
156 | diamond | 353 | mov eax, [cursor] |
354 | cmp byte [path+eax], 0 |
||
355 | jz still |
||
31 | halyavin | 356 | inc [cursor] |
357 | mov [flick],2 |
||
358 | jmp anti_flick ;red |
||
359 | no_con_right: |
||
360 | cmp ah,key_Bspace |
||
361 | jne no_con_bspace |
||
362 | |||
134 | diamond | 363 | mov ebp, [cursor] |
364 | test ebp, ebp |
||
365 | jz still |
||
31 | halyavin | 366 | lobsp: |
367 | mov bl,byte [path+ebp] |
||
368 | mov byte [path+ebp-1],bl |
||
369 | inc ebp |
||
134 | diamond | 370 | cmp ebp,1024 |
31 | halyavin | 371 | jne lobsp |
372 | dec [cursor] |
||
373 | mov [flick],2 |
||
374 | jmp anti_flick ;red |
||
375 | no_con_bspace: |
||
376 | |||
377 | mov ecx,[cursor] |
||
134 | diamond | 378 | mov ebp,1022 |
379 | cmp byte [path+ebp], 0 |
||
380 | jnz still |
||
31 | halyavin | 381 | losx: |
134 | diamond | 382 | cmp ebp, ecx |
383 | jbe @f |
||
31 | halyavin | 384 | mov bl,byte [path+ebp] |
385 | mov byte [path+ebp+1],bl |
||
386 | dec ebp |
||
134 | diamond | 387 | jmp losx |
388 | @@: |
||
31 | halyavin | 389 | |
390 | mov byte [path+ebp],ah |
||
391 | inc dword [cursor] |
||
392 | |||
393 | mov [flick],2 |
||
394 | jmp anti_flick |
||
395 | |||
396 | |||
397 | ;---------------------------- |
||
398 | ;Test on mouse button |
||
399 | ;----------------------------- |
||
400 | |||
131 | diamond | 401 | button: ; button |
31 | halyavin | 402 | mov eax,17 |
485 | heavyiron | 403 | mcall |
31 | halyavin | 404 | |
131 | diamond | 405 | cmp ah,2 ;Edit prompt line? |
406 | je edit_prompt |
||
31 | halyavin | 407 | |
408 | cmp ah,4 |
||
409 | jne no_filelist |
||
410 | |||
411 | mousetest: |
||
412 | mov eax,37 |
||
413 | mov ebx,1 |
||
485 | heavyiron | 414 | mcall |
31 | halyavin | 415 | mov ebx,eax |
131 | diamond | 416 | shr eax,16 ;x |
31 | halyavin | 417 | and ebx,0xffff ;y |
418 | |||
419 | sub ebx,[listy] ;80 |
||
420 | mov [mousey],ebx |
||
421 | |||
422 | mov ecx,[listx] |
||
423 | cmp eax,ecx |
||
131 | diamond | 424 | jl still |
31 | halyavin | 425 | add ecx,[listxsize] |
426 | cmp eax,ecx |
||
131 | diamond | 427 | jg still |
31 | halyavin | 428 | |
429 | filexadd: |
||
430 | |||
431 | ; Enter in directory |
||
432 | file_add: |
||
433 | mov edx,0 ;for div correct work div |
||
434 | mov eax,dword [mousey] |
||
435 | mov ebx,10 |
||
436 | div ebx |
||
437 | |||
438 | add eax,[filecursor] |
||
439 | jmp no_kfad |
||
440 | kfad: |
||
441 | mov eax,[filecursor] |
||
442 | no_kfad: |
||
134 | diamond | 443 | mov ebx,27 |
31 | halyavin | 444 | mul ebx |
134 | diamond | 445 | lea ebp,[convinfo+eax] |
446 | mov esi,[ebp] |
||
447 | cmp esi,-1 |
||
448 | jz still |
||
31 | halyavin | 449 | |
450 | mov edi,paramtest ;clear param string |
||
134 | diamond | 451 | mov ecx,1024/4 |
452 | xor eax,eax |
||
453 | rep stosd |
||
31 | halyavin | 454 | |
134 | diamond | 455 | mov edi, path |
456 | mov ecx, 1024 |
||
457 | repnz scasb |
||
458 | dec edi |
||
459 | cmp [ebp+15], dword 'FOL ' |
||
460 | jnz openf |
||
461 | ; open directory - append its name to path |
||
462 | cmp ecx, 2 |
||
463 | jb still |
||
464 | push edi |
||
465 | mov al, '/' |
||
466 | stosb |
||
467 | dec ecx |
||
468 | @@: |
||
469 | lodsb |
||
470 | stosb |
||
471 | test al, al |
||
472 | jz @f |
||
473 | dec ecx |
||
474 | jnz @b |
||
475 | ; name is too long - do not do anything |
||
476 | pop edi |
||
477 | xor eax, eax |
||
478 | mov ecx, path+1024 |
||
479 | sub ecx, edi |
||
480 | rep stosb |
||
481 | jmp still |
||
482 | @@: |
||
156 | diamond | 483 | sub edi, path+1 |
484 | mov [cursor], edi |
||
134 | diamond | 485 | pop edi |
486 | ; name appended, now read new directory |
||
31 | halyavin | 487 | mov [filecursor],0 |
488 | |||
489 | call read_directory |
||
490 | ;; call convertation |
||
491 | call draw_window |
||
134 | diamond | 492 | jmp still |
31 | halyavin | 493 | |
494 | ;Savetest |
||
495 | savetest: |
||
496 | cmp byte [dlg_type],'S' |
||
134 | diamond | 497 | jne still |
498 | ; always force open file - this is better |
||
499 | ; because there exists files without extension and folders with extension |
||
500 | jmp openf |
||
501 | ; mov ecx,100 |
||
502 | ;savetestloop: |
||
503 | ; cmp [path+ecx],byte 0 |
||
504 | ; je next_byte |
||
505 | ; cmp [path+ecx],byte 32 |
||
506 | ; je next_byte |
||
507 | ; cmp [path+ecx],byte '.' |
||
508 | ; je openf ;it's file |
||
509 | ;; cmp [path+ecx],byte '/' |
||
510 | ;; je no_save ;it's dir |
||
511 | ;next_byte: |
||
512 | ; dec ecx |
||
513 | ; jnz savetestloop |
||
514 | ; jmp still |
||
31 | halyavin | 515 | |
516 | ;Open/Run file |
||
517 | |||
518 | openf: |
||
134 | diamond | 519 | push esi edi |
520 | mov esi, path |
||
521 | mov edi, paramtest |
||
522 | mov ecx, 1024/4 |
||
523 | rep movsd |
||
524 | pop edi esi |
||
525 | add edi, paramtest-path |
||
31 | halyavin | 526 | |
527 | cmp dword [focus],0 ;if prompt line with focus no add file name from frame |
||
528 | jne file_set |
||
529 | |||
134 | diamond | 530 | cmp edi, paramtest+1022 |
531 | jae still |
||
532 | mov al, '/' |
||
533 | stosb |
||
534 | @@: |
||
535 | lodsb |
||
536 | stosb |
||
537 | test al, al |
||
538 | jz file_set |
||
539 | cmp edi, paramtest+1024 |
||
540 | jb @b |
||
541 | jmp still |
||
542 | |||
31 | halyavin | 543 | file_set: |
544 | |||
545 | cmp [browser],0 |
||
546 | jne is_brow |
||
547 | |||
548 | movzx eax,byte [param_area] |
||
549 | sub eax,48 |
||
550 | imul eax,10 |
||
551 | movzx ebx,byte [param_area+1] |
||
552 | add eax,ebx |
||
553 | sub eax,48 |
||
554 | imul eax,10 |
||
555 | movzx ebx,byte [param_area+2] |
||
556 | add eax,ebx |
||
557 | sub eax,48 |
||
558 | imul eax,10 |
||
559 | movzx ebx,byte [param_area+3] |
||
560 | add eax,ebx |
||
561 | sub eax,48 |
||
562 | |||
563 | mov ecx,eax ;pid to ecx |
||
564 | mov eax,60 |
||
565 | mov ebx,2 |
||
566 | mov edx,paramtest |
||
134 | diamond | 567 | mov esi,1024 |
485 | heavyiron | 568 | mcall |
31 | halyavin | 569 | |
570 | jmp exit |
||
571 | |||
572 | is_brow: |
||
573 | |||
574 | ; cmp [convinfo+edi+26],dword 'Fvol' |
||
575 | ; je edit |
||
576 | |||
134 | diamond | 577 | ; find extension |
578 | mov eax, paramtest+1023 |
||
579 | @@: |
||
580 | dec eax |
||
581 | cmp byte [eax+1], 0 |
||
582 | jz @b |
||
583 | @@: |
||
584 | cmp byte [eax], '/' |
||
585 | jz .noext |
||
586 | cmp byte [eax], '.' |
||
587 | jz .ext |
||
588 | dec eax |
||
589 | cmp eax, paramtest |
||
590 | jae @b |
||
591 | .noext: |
||
592 | ; file has no extension |
||
593 | ; xor ebx, ebx |
||
594 | jmp execute |
||
595 | .ext: |
||
596 | inc eax |
||
597 | ; eax points to extension |
||
598 | cmp byte [eax], 0 |
||
599 | jz .noext |
||
600 | mov ecx, dword [eax] |
||
601 | and ecx, not 0x20202020 |
||
602 | mov ebx, jpgview |
||
603 | cmp ecx, 'JPG' |
||
604 | jz run |
||
605 | cmp ecx, 'JPEG' ; note that it will select also *.JPEG* |
||
606 | jz run |
||
607 | mov ebx, gifview |
||
608 | cmp ecx, 'GIF' |
||
609 | jz run |
||
205 | heavyiron | 610 | mov ebx, ac97 |
134 | diamond | 611 | cmp ecx, 'WAV' |
612 | jz run |
||
205 | heavyiron | 613 | cmp ecx, 'MP3' |
614 | jz run |
||
134 | diamond | 615 | mov ebx, midamp |
616 | cmp ecx, 'MID' |
||
617 | jz run |
||
618 | mov ebx, bmpview |
||
619 | cmp ecx, 'BMP' |
||
620 | jz run |
||
31 | halyavin | 621 | ; //// Willow |
134 | diamond | 622 | mov ebx, pngview |
623 | cmp ecx, 'PNG' |
||
624 | jz run |
||
31 | halyavin | 625 | ; //// Willow |
134 | diamond | 626 | mov ebx, rtfread |
627 | cmp ecx, 'RTF' |
||
628 | jz run |
||
629 | mov ebx, editor |
||
630 | cmp ecx, 'ASM' |
||
631 | jz run |
||
632 | cmp ecx, 'TXT' |
||
633 | jz run |
||
634 | cmp ecx, 'INC' |
||
635 | jz run |
||
205 | heavyiron | 636 | mov ebx, life2 |
637 | cmp ecx, 'LIF' |
||
638 | jz run |
||
639 | mov ebx, view3ds |
||
640 | cmp ecx, '3DS' and not 0x20202020 |
||
641 | jz run |
||
134 | diamond | 642 | jmp still |
31 | halyavin | 643 | |
644 | execute: |
||
134 | diamond | 645 | mov ebx, fileinfo_start |
646 | and dword [ebx+8], 0 ; no parameters |
||
647 | mov dword [ebx+21], paramtest ; program name |
||
648 | .do: |
||
649 | mov eax, 70 |
||
485 | heavyiron | 650 | mcall |
134 | diamond | 651 | jmp still |
31 | halyavin | 652 | |
653 | run: |
||
134 | diamond | 654 | mov [fileinfo_name], ebx ; program name |
655 | mov ebx, fileinfo_start |
||
656 | mov dword [ebx+8], paramtest ; parameters |
||
657 | jmp execute.do |
||
31 | halyavin | 658 | |
659 | no_filelist: |
||
660 | |||
131 | diamond | 661 | cmp ah,5 ;OPEN/SAVE button |
662 | je kfad |
||
31 | halyavin | 663 | |
131 | diamond | 664 | cmp ah,6 ;Scroll up |
31 | halyavin | 665 | jne no_scrlup |
666 | mov ebx,1 |
||
667 | jmp up |
||
668 | no_scrlup: |
||
669 | |||
131 | diamond | 670 | cmp ah,7 ;Scroll down |
31 | halyavin | 671 | jne no_scrldown |
672 | mov ebx,1 |
||
673 | jmp down |
||
674 | no_scrldown: |
||
675 | |||
676 | cmp ah,8 |
||
677 | jne no_update |
||
678 | update: |
||
679 | call read_directory |
||
680 | ; call convertation |
||
681 | ; mov [filecursor],0 |
||
682 | call draw_window |
||
683 | no_update: |
||
684 | |||
685 | cmp ah,9 |
||
686 | jne no_textopen |
||
687 | textopen: |
||
134 | diamond | 688 | mov eax, 27 |
689 | mul [filecursor] |
||
690 | cmp dword [eax+convinfo+15], 'FOL ' |
||
691 | jz still |
||
692 | push eax |
||
693 | mov esi, path |
||
694 | mov edi, paramtest |
||
695 | @@: |
||
696 | lodsb |
||
697 | test al, al |
||
698 | jz @f |
||
699 | stosb |
||
700 | jmp @b |
||
701 | @@: |
||
702 | mov al, '/' |
||
703 | stosb |
||
704 | pop eax |
||
705 | mov esi, [eax+convinfo] |
||
706 | cmp esi, -1 |
||
707 | jz still |
||
708 | @@: |
||
709 | lodsb |
||
710 | stosb |
||
711 | test al, al |
||
712 | jz @f |
||
713 | cmp edi, paramtest+1024 |
||
714 | jb @b |
||
715 | jmp still |
||
716 | @@: |
||
717 | mov ebx, editor |
||
718 | jmp run |
||
31 | halyavin | 719 | |
720 | no_textopen: |
||
721 | |||
722 | cmp ah,11 |
||
723 | jne no_view |
||
724 | viewset: |
||
134 | diamond | 725 | inc [viewmode] |
726 | cmp [viewmode], 4 |
||
727 | jb @f |
||
728 | mov [viewmode], 0 |
||
729 | @@: |
||
31 | halyavin | 730 | call read_directory |
731 | ; call convertation |
||
732 | mov [filecursor],0 |
||
733 | call draw_window |
||
734 | jmp still |
||
735 | no_view: |
||
736 | |||
131 | diamond | 737 | cmp ah,12 ;move back |
31 | halyavin | 738 | jne no_back |
739 | back: |
||
134 | diamond | 740 | mov edi, path+1024 |
741 | mov ecx, edi |
||
742 | @@: |
||
743 | dec edi |
||
744 | cmp byte [edi], '/' |
||
745 | jz @f |
||
746 | cmp edi, path |
||
747 | ja @b |
||
748 | jmp still |
||
749 | @@: |
||
750 | sub ecx, edi |
||
156 | diamond | 751 | lea eax, [edi-path] |
752 | mov [cursor], eax |
||
134 | diamond | 753 | xor eax, eax |
754 | rep stosb |
||
31 | halyavin | 755 | mov [filecursor],0 |
756 | call read_directory |
||
757 | ; call convertation |
||
758 | call draw_window |
||
759 | jmp still |
||
760 | |||
761 | no_back: |
||
131 | diamond | 762 | cmp ah,13 ;string up? |
31 | halyavin | 763 | jne no_up |
131 | diamond | 764 | mov ebx,1 ;step |
31 | halyavin | 765 | up: |
766 | mov [downstop],0 |
||
767 | sub [filecursor],ebx |
||
768 | cmp [filecursor],0 |
||
769 | jnl cr_ok |
||
770 | mov [filecursor],0 |
||
771 | cr_ok: |
||
772 | jmp draw_wd |
||
773 | no_up: |
||
131 | diamond | 774 | cmp ah,14 ;string down? |
31 | halyavin | 775 | jne no_dn |
131 | diamond | 776 | mov ebx,1 ;step |
31 | halyavin | 777 | down: |
778 | cmp [downstop],1 |
||
131 | diamond | 779 | je no_dn |
31 | halyavin | 780 | add [filecursor],ebx |
781 | jmp draw_wd |
||
782 | no_dn: |
||
783 | |||
784 | cmp ah,15 |
||
131 | diamond | 785 | jne no_copyclip ;copy to clipboard |
31 | halyavin | 786 | copy_to_clip: |
134 | diamond | 787 | mov eax, 27 |
788 | mul [filecursor] |
||
789 | cmp dword [convinfo+eax+15], 'FOL ' |
||
790 | jz still |
||
791 | push eax |
||
792 | mov esi, path |
||
793 | mov edi, paramtest |
||
794 | @@: |
||
795 | lodsb |
||
796 | test al, al |
||
797 | jz @f |
||
798 | stosb |
||
799 | jmp @b |
||
800 | @@: |
||
801 | pop eax |
||
802 | mov esi, [convinfo+eax] |
||
803 | cmp esi, -1 |
||
804 | jz still |
||
805 | mov al, '/' |
||
806 | stosb |
||
807 | @@: |
||
808 | lodsb |
||
809 | stosb |
||
810 | test al, al |
||
811 | jz @f |
||
812 | cmp edi, paramtest+1024 |
||
813 | jb @b |
||
814 | jmp still |
||
815 | @@: |
||
816 | sub edi, paramtest+1 |
||
817 | mov ebx, clipfile_info |
||
818 | mov byte [ebx], 2 |
||
819 | mov [ebx+12], edi |
||
820 | mov eax, 70 |
||
485 | heavyiron | 821 | mcall |
134 | diamond | 822 | jmp still |
31 | halyavin | 823 | no_copyclip: |
824 | |||
825 | cmp ah,16 |
||
826 | jne no_clippaste |
||
827 | paste_from_clip: |
||
134 | diamond | 828 | mov ebx, clipfile_info |
829 | mov byte [ebx], 0 |
||
830 | mov dword [ebx+12], 1023 |
||
831 | mov eax, 70 |
||
485 | heavyiron | 832 | mcall |
134 | diamond | 833 | cmp ebx, 0 |
834 | jle still |
||
835 | mov byte [paramtest+ebx], 0 |
||
836 | ; OS allows only 256 symbols in command line |
||
837 | cmp ebx, 250 |
||
838 | jae still |
||
839 | ; we use Pascal-style strings for /RD/1/COPYR |
||
840 | ; source file |
||
841 | mov edi, copyr_param |
||
842 | mov al, bl |
||
843 | stosb |
||
844 | mov ecx, ebx |
||
845 | mov esi, paramtest |
||
846 | rep movsb |
||
847 | ; destination path |
||
848 | inc edi |
||
849 | mov ebp, edi |
||
850 | mov esi, path |
||
851 | @@: |
||
852 | cmp edi, copyr_param+255 |
||
853 | jae still |
||
854 | lodsb |
||
855 | test al, al |
||
856 | jz @f |
||
857 | stosb |
||
858 | jmp @b |
||
859 | ; destination file name |
||
860 | @@: |
||
861 | dec ebx |
||
862 | jz still |
||
863 | cmp byte [paramtest+ebx], '/' |
||
864 | jnz @b |
||
865 | lea esi, [paramtest+ebx] |
||
866 | @@: |
||
867 | lodsb |
||
868 | test al, al |
||
869 | jz @f |
||
870 | stosb |
||
871 | cmp edi, copyr_param+255 |
||
872 | jae still |
||
873 | jmp @b |
||
874 | @@: |
||
875 | mov byte [edi], 0 |
||
876 | sub edi, ebp |
||
877 | mov eax, edi |
||
878 | mov [ebp-1], al |
||
879 | ; display |
||
880 | cmp [browser], 1 |
||
31 | halyavin | 881 | jne no_outpath |
131 | diamond | 882 | mov eax,4 ; function 4 : write text to window |
883 | mov ebx,10*65536+67 ; [x start] *65536 + [y start] |
||
31 | halyavin | 884 | mov ecx,0x00000000 ;[sc.grab_text] ; color of text RRGGBB |
134 | diamond | 885 | mov edx, copyr_param+1 |
886 | movzx esi, byte [edx-1] |
||
485 | heavyiron | 887 | mcall |
131 | diamond | 888 | mov ebx,250*65536+67 ; [x start] *65536 + [y start] |
31 | halyavin | 889 | mov ecx,0x00000000 ;[sc.grab_text] ; color of text RRGGBB |
134 | diamond | 890 | mov edx, ebp |
891 | mov esi, edi |
||
485 | heavyiron | 892 | mcall |
31 | halyavin | 893 | no_outpath: |
894 | |||
134 | diamond | 895 | ; run COPYR |
896 | mov eax, 70 |
||
897 | mov ebx, copyr_run |
||
485 | heavyiron | 898 | mcall |
31 | halyavin | 899 | delay 50 ;wait recoed file |
900 | jmp update ;still |
||
901 | no_clippaste: |
||
902 | |||
131 | diamond | 903 | cmp ah,19 ;Delete from floppy |
134 | diamond | 904 | jne no_delt |
31 | halyavin | 905 | delete_file: |
134 | diamond | 906 | ; OS now do not support file delete |
907 | jmp still |
||
31 | halyavin | 908 | no_delt: |
909 | |||
131 | diamond | 910 | cmp ah,20 ;I - Help |
911 | je help_scr |
||
31 | halyavin | 912 | |
913 | cmp ah,22 |
||
914 | jne no_headfile |
||
915 | mov [drawhf],1 |
||
916 | call draw_window |
||
917 | mov [drawhf],0 |
||
918 | mov [pmenu_draw],1 |
||
919 | jmp still |
||
920 | no_headfile: |
||
921 | |||
922 | cmp ah,23 |
||
923 | jne no_headview |
||
924 | mov [drawhv],1 |
||
925 | call draw_window |
||
926 | mov [drawhv],0 |
||
927 | mov [pmenu_draw],1 |
||
928 | jmp still |
||
929 | no_headview: |
||
930 | |||
931 | cmp ah,24 |
||
932 | jne no_headinfo |
||
933 | mov [drawhi],1 |
||
934 | call draw_window |
||
935 | mov [drawhi],0 |
||
936 | mov [pmenu_draw],1 |
||
937 | jmp still |
||
938 | no_headinfo: |
||
939 | |||
940 | ;FILE MENU |
||
941 | cmp ah,30 |
||
942 | je kfad |
||
943 | |||
944 | cmp ah,31 |
||
131 | diamond | 945 | je copy_to_clip ;Copy |
31 | halyavin | 946 | |
947 | cmp ah,32 |
||
131 | diamond | 948 | je paste_from_clip ;Paste |
31 | halyavin | 949 | |
950 | cmp ah,33 |
||
131 | diamond | 951 | je delete_file ;Delte |
31 | halyavin | 952 | |
953 | cmp ah,34 |
||
131 | diamond | 954 | je textopen ;Edit in Tinypad |
31 | halyavin | 955 | |
956 | cmp ah,37 |
||
131 | diamond | 957 | je exit |
31 | halyavin | 958 | |
959 | ;VIEW MENU |
||
134 | diamond | 960 | cmp ah,40 ;Sort by name |
31 | halyavin | 961 | jne no_sn |
134 | diamond | 962 | mov [viewmode], 0 |
31 | halyavin | 963 | jmp update |
964 | no_sn: |
||
965 | |||
134 | diamond | 966 | cmp ah,41 ;Sort by extension |
31 | halyavin | 967 | jne no_se |
134 | diamond | 968 | mov [viewmode], 1 |
31 | halyavin | 969 | jmp update |
970 | no_se: |
||
971 | |||
134 | diamond | 972 | cmp ah,42 ;Sort by size |
31 | halyavin | 973 | jne no_ss |
134 | diamond | 974 | mov [viewmode], 2 |
31 | halyavin | 975 | jmp update |
976 | no_ss: |
||
977 | |||
134 | diamond | 978 | cmp ah,43 ;Sort by date |
31 | halyavin | 979 | jne no_sd |
134 | diamond | 980 | mov [viewmode], 3 |
31 | halyavin | 981 | jmp update |
982 | no_sd: |
||
983 | |||
984 | ;HELP MENU |
||
131 | diamond | 985 | cmp ah,50 ;Help? |
986 | je help_scr |
||
31 | halyavin | 987 | |
131 | diamond | 988 | cmp ah,51 ;Info? |
989 | je info_scr |
||
31 | halyavin | 990 | |
131 | diamond | 991 | cmp ah,1 ; test on exit button |
992 | je exit |
||
31 | halyavin | 993 | |
994 | jmp still |
||
995 | |||
996 | exit: |
||
997 | ; //// Willow |
||
131 | diamond | 998 | ; mov eax,58 |
999 | ; mov ebx,MRUfile |
||
1000 | ; mov dword[ebx+8],255 |
||
1001 | ; inc dword[ebx] |
||
485 | heavyiron | 1002 | ; mcall |
31 | halyavin | 1003 | ; //// Willow |
1004 | mov eax,-1 |
||
485 | heavyiron | 1005 | mcall |
31 | halyavin | 1006 | |
1007 | draw_wd: |
||
1008 | ; call draw_window |
||
1009 | ; jmp still |
||
1010 | mov [flick],1 |
||
1011 | jmp anti_flick |
||
1012 | |||
1013 | edit_prompt: |
||
1014 | not [focus] |
||
1015 | jmp red |
||
1016 | |||
1017 | help_scr: |
||
1018 | mov esi,14 |
||
1019 | mov ebp,help_text |
||
1020 | jmp screen |
||
1021 | |||
1022 | info_scr: |
||
1023 | mov esi,6 |
||
1024 | mov ebp,info_text |
||
1025 | jmp screen |
||
1026 | |||
1027 | screen: |
||
134 | diamond | 1028 | cmp [browser], 1 ;it's browser? |
31 | halyavin | 1029 | jne dialogscr |
1030 | |||
502 | heavyiron | 1031 | mov eax,[procinfo.box.height] |
31 | halyavin | 1032 | sub eax,90 |
1033 | drawfbox 40,76,300,eax,0x00000000 |
||
502 | heavyiron | 1034 | mov eax,[procinfo.box.height] |
31 | halyavin | 1035 | sub eax,92 |
1036 | drawfbox 41,77,298,eax,0x00ffffff |
||
1037 | mov edi,esi ;14 |
||
1038 | mov ebx,(41+26)*65536+(77+20) |
||
1039 | mov ecx,cl_Black |
||
1040 | mov edx,ebp ;help_text |
||
1041 | jmp outlab |
||
1042 | |||
1043 | dialogscr: |
||
502 | heavyiron | 1044 | mov eax,[procinfo.box.height] |
31 | halyavin | 1045 | sub eax,84 |
1046 | drawfbox 16,54,270,eax,0x00000000 |
||
502 | heavyiron | 1047 | mov eax,[procinfo.box.height] |
31 | halyavin | 1048 | sub eax,86 |
1049 | drawfbox 17,55,268,eax,0x00ffffff |
||
1050 | mov edi,esi ;14 |
||
1051 | mov ebx,(17+10)*65536+(55+1) |
||
1052 | mov ecx,cl_Black |
||
1053 | mov edx,ebp ;help_text |
||
1054 | |||
131 | diamond | 1055 | outlab: ;out labels |
31 | halyavin | 1056 | mov eax,4 |
1057 | mov esi,40 |
||
1058 | helploo: |
||
485 | heavyiron | 1059 | mcall |
31 | halyavin | 1060 | add ebx,11 |
1061 | add edx,40 |
||
1062 | dec edi |
||
1063 | jnz helploo |
||
1064 | |||
1065 | setimg 48,84,logoinfimg |
||
1066 | |||
1067 | jmp still |
||
1068 | |||
134 | diamond | 1069 | getimgproc: |
1070 | pushad |
||
1071 | mov dword [edx],esi ;xs |
||
1072 | mov dword [edx+4],edi ;ys |
||
1073 | |||
1074 | mov ebp,eax |
||
1075 | mov eax,dword [ecx] ;getx size |
||
1076 | push edx |
||
1077 | push ecx |
||
1078 | lea ecx,[eax+2*eax] |
||
1079 | |||
1080 | mul ebx |
||
1081 | add eax,ebp ;x |
||
1082 | mov edx,ecx |
||
1083 | lea eax,[eax+2*eax] ;eax=offset on imsrc |
||
1084 | |||
1085 | mov ebp,esi ;xs |
||
1086 | mov ebx,edi ;ys |
||
1087 | |||
1088 | pop edi |
||
1089 | lea esi,[eax+8+edi] |
||
1090 | |||
1091 | pop edi |
||
1092 | add edi,8 |
||
1093 | |||
1094 | cld |
||
1095 | cyc: |
||
1096 | push esi |
||
1097 | lea ecx, [ebp+ebp*2] |
||
1098 | rep movsb |
||
1099 | pop esi |
||
1100 | add esi,edx |
||
1101 | dec ebx |
||
1102 | jne cyc |
||
1103 | |||
1104 | popad |
||
1105 | ret |
||
1106 | |||
31 | halyavin | 1107 | ;HELP TEXT |
1108 | help_text: |
||
1109 | ;0123456789012345678901234567890123456789 |
||
1110 | db ' ~~~~~ SYSTEM X-TREE ~~~~~ ' |
||
1111 | db ' HELP ' |
||
1112 | db ' ' |
||
1113 | db ' ' |
||
1114 | db 'F2 - CHANGE SORTMODE (name,ext,size,dat)' |
||
1115 | db 'F3 - VIEW file in tinypad ' |
||
1116 | |||
1117 | db 'F5 - COPY FILE to clipboard ' |
||
1118 | db 'F6 - PASTE FILE from clipboard ' |
||
1119 | db 'F11- EDIT PROMPT string ' |
||
1120 | db 'F12- UPDATE directory sources ' |
||
1121 | db ' ' |
||
1122 | |||
1123 | db 'Enter - input to directory ' |
||
1124 | db 'Backspace - back to previos directory ' |
||
1125 | db 'PageDn/PageUp, Up/Down - move cursor ' |
||
1126 | |||
1127 | info_text: |
||
1128 | db ' ~~~~~ SYSTEM X-TREE ~~~~~ ' |
||
156 | diamond | 1129 | db ' INFO 84 Ver ' |
31 | halyavin | 1130 | db ' ' |
1131 | db ' Create by Pavlushin Evgeni ' |
||
134 | diamond | 1132 | db 'with ASCL library special for Kolibri OS' |
31 | halyavin | 1133 | db ' www.deck4.narod.ru waptap@mail.ru ' |
1134 | |||
1135 | |||
1136 | ; ********************************************* |
||
1137 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
||
1138 | ; ******** FILE BROWSER / DIALOG ********* |
||
1139 | |||
1140 | ;draw_browser_window: |
||
1141 | |||
1142 | draw_window: |
||
1143 | |||
1144 | ; mov eax,9 |
||
1145 | ; mov ebx,procinfo |
||
1146 | ; mov ecx,-1 |
||
485 | heavyiron | 1147 | ; mcall |
502 | heavyiron | 1148 | ; mov eax,[procinfo.box.width] |
31 | halyavin | 1149 | ; cmp eax,66 |
1150 | ; jg temp12345 |
||
1151 | ; ret |
||
1152 | ; temp12345: |
||
1153 | mov eax,48 |
||
1154 | mov ebx,3 |
||
1155 | mov ecx,sc |
||
1156 | mov edx,sizeof.system_colors |
||
485 | heavyiron | 1157 | mcall |
31 | halyavin | 1158 | |
1159 | mov eax,[sc.work_button] |
||
1160 | mov [b_color],eax |
||
1161 | |||
131 | diamond | 1162 | mov eax,12 ; function 12:tell os about windowdraw |
1163 | mov ebx,1 ; 1, start of draw |
||
485 | heavyiron | 1164 | mcall |
31 | halyavin | 1165 | |
1166 | ;Window |
||
1167 | |||
131 | diamond | 1168 | xor eax,eax ; function 0 : define and draw window |
31 | halyavin | 1169 | |
134 | diamond | 1170 | cmp [browser], 1 ;it's browser |
31 | halyavin | 1171 | jne nob1 |
131 | diamond | 1172 | mov ebx,140*65536+400 ; [x start] *65536 + [x size] |
1173 | mov ecx,160*65536+280 ; [y start] *65536 + [y size] |
||
31 | halyavin | 1174 | jmp isb1 |
1175 | nob1: |
||
131 | diamond | 1176 | mov ebx,140*65536+320 ; [x start] *65536 + [x size] |
1177 | mov ecx,260*65536+240 ; [y start] *65536 + [y size] |
||
31 | halyavin | 1178 | isb1: |
1179 | ; mov edx,[sc.work] ; color of work area RRGGBB |
||
131 | diamond | 1180 | or edx,0x03ffffff;000000 |
485 | heavyiron | 1181 | mcall |
31 | halyavin | 1182 | |
1183 | ;Get proc info |
||
1184 | mov eax,9 |
||
1185 | mov ebx,procinfo |
||
1186 | mov ecx,-1 |
||
485 | heavyiron | 1187 | mcall |
31 | halyavin | 1188 | |
502 | heavyiron | 1189 | mov eax,[procinfo.box.width] |
31 | halyavin | 1190 | cmp eax,66 |
134 | diamond | 1191 | jg @f |
1192 | .ret: |
||
31 | halyavin | 1193 | ret |
134 | diamond | 1194 | @@: |
502 | heavyiron | 1195 | cmp [procinfo.box.height], 0x70 |
134 | diamond | 1196 | jl .ret |
31 | halyavin | 1197 | |
134 | diamond | 1198 | cmp [browser], 1 ;it's browser |
31 | halyavin | 1199 | jne nob9 |
1200 | mov [listx],120 |
||
502 | heavyiron | 1201 | ; mov eax,[procinfo.box.width] |
134 | diamond | 1202 | sub eax,127;[listx]+7 |
1203 | cmp eax,10 |
||
1204 | jl .ret |
||
31 | halyavin | 1205 | mov [listxsize],eax |
1206 | mov [listy],73 |
||
502 | heavyiron | 1207 | mov eax,[procinfo.box.height] |
134 | diamond | 1208 | sub eax,73+7;[listy]+7 |
31 | halyavin | 1209 | mov [listysize],eax |
1210 | jmp isb9 |
||
1211 | nob9: |
||
1212 | mov [listx],10 |
||
502 | heavyiron | 1213 | ; mov eax,[procinfo.box.width] |
134 | diamond | 1214 | sub eax,17 ;[listx]+7 |
31 | halyavin | 1215 | mov [listxsize],eax |
1216 | mov [listy],54 |
||
502 | heavyiron | 1217 | mov eax,[procinfo.box.height] |
134 | diamond | 1218 | sub eax,54+34;[listy]+34 |
31 | halyavin | 1219 | mov [listysize],eax |
1220 | isb9: |
||
1221 | |||
1222 | |||
1223 | ;Draw only browser components |
||
134 | diamond | 1224 | cmp [browser], 1 ;it's browser |
31 | halyavin | 1225 | jne nob2 |
1226 | |||
131 | diamond | 1227 | mov eax,[sc.grab_text] ; color of text RRGGBB |
1228 | or eax,0x10000000 |
||
1229 | glabel 8,8,'SYSTEM X-TREE FILE BROWSER',eax |
||
31 | halyavin | 1230 | |
1231 | ;Draw buttons headers |
||
1232 | mov eax,8 |
||
1233 | mov ebx,8*65536+(6*8-1) ;start pos x |
||
1234 | mov ecx,23*65536+10 ;start pos y |
||
1235 | mov edx,22;+1000000000000000000000000000000b ;spoke butt |
||
131 | diamond | 1236 | mov edi,3 ;draw 13 button's |
31 | halyavin | 1237 | mov esi,0x00339933 |
485 | heavyiron | 1238 | mcall |
31 | halyavin | 1239 | dec edi |
1240 | nexthbut: |
||
1241 | add ebx,(6*8)*65536 |
||
1242 | inc edx |
||
485 | heavyiron | 1243 | mcall |
31 | halyavin | 1244 | dec edi |
1245 | jnz nexthbut |
||
1246 | |||
1247 | ;File STRING |
||
134 | diamond | 1248 | glabel 8,25,' FILE VIEW INFO ', cl_White ;Black |
31 | halyavin | 1249 | |
1250 | ;BlackLine |
||
502 | heavyiron | 1251 | mov eax,[procinfo.box.width] |
31 | halyavin | 1252 | sub eax,10 |
1253 | drawfbox 5,35, eax, 1, cl_Black |
||
1254 | |||
1255 | ;BlackLine2 |
||
502 | heavyiron | 1256 | mov eax,[procinfo.box.width] |
31 | halyavin | 1257 | sub eax,10 |
1258 | drawfbox 5,68, eax, 1, cl_Black |
||
1259 | |||
1260 | ;BlackLine2 vertical |
||
502 | heavyiron | 1261 | ; mov eax,[procinfo.box.height] |
31 | halyavin | 1262 | ; sub eax,69+4 |
1263 | ; drawfbox 115, 69, 1, eax, cl_Black |
||
1264 | |||
1265 | ;Set logo img |
||
1266 | setimg 34,88,logoinfimg |
||
131 | diamond | 1267 | glabel 20,165,'SYSTEM X-TREE',cl_Black |
31 | halyavin | 1268 | add ebx,10 |
134 | diamond | 1269 | glabel ,,'FOR KolibriOS', |
31 | halyavin | 1270 | |
1271 | add ebx,9*65536+20 |
||
131 | diamond | 1272 | glabel ,,'welcome to',cl_Green |
31 | halyavin | 1273 | add ebx,-15*65536+10 |
134 | diamond | 1274 | glabel ,,'www.kolibrios.org',cl_Green |
31 | halyavin | 1275 | |
131 | diamond | 1276 | ; glabel ,,'Create by',cl_Green |
31 | halyavin | 1277 | ; add ebx,10 |
131 | diamond | 1278 | ; glabel ,,' Pavlushin', |
31 | halyavin | 1279 | ; add ebx,10 |
131 | diamond | 1280 | ; glabel ,,' Evgeni', |
31 | halyavin | 1281 | |
1282 | |||
1283 | ;Draw head->file buttons |
||
1284 | cmp [drawhf],1 |
||
1285 | jne no_drawhf |
||
1286 | mov ebx,8*65536+6*12 ;start pos x |
||
1287 | mov ecx,35*65536+10 ;start pos y |
||
1288 | mov edx,30 ;spoke butt |
||
131 | diamond | 1289 | mov edi,8 ;draw 4 button's |
31 | halyavin | 1290 | mov esi,cl_Grey |
1291 | call menubutton |
||
1292 | no_drawhf: |
||
1293 | |||
1294 | ;Draw head->view buttons |
||
1295 | cmp [drawhv],1 |
||
1296 | jne no_drawhv |
||
1297 | mov ebx,(8+6*8)*65536+6*12 ;start pos x |
||
1298 | mov ecx,35*65536+10 ;start pos y |
||
1299 | mov edx,40 ;spoke butt |
||
134 | diamond | 1300 | mov edi,4 ;draw 4 button's |
31 | halyavin | 1301 | mov esi,cl_Grey |
1302 | call menubutton |
||
1303 | no_drawhv: |
||
1304 | |||
1305 | ;Draw head->info buttons |
||
1306 | cmp [drawhi],1 |
||
1307 | jne no_drawhi |
||
1308 | mov ebx,(8+12*8)*65536+6*12 ;start pos x |
||
1309 | mov ecx,35*65536+10 ;start pos y |
||
1310 | mov edx,50 ;spoke butt |
||
131 | diamond | 1311 | mov edi,2 ;draw 2 button's |
31 | halyavin | 1312 | mov esi,cl_Grey |
1313 | call menubutton |
||
1314 | no_drawhi: |
||
1315 | |||
1316 | nob2: |
||
1317 | |||
1318 | ;Draw buttons instruments |
||
1319 | mov eax,8 |
||
134 | diamond | 1320 | cmp [browser], 1 ;it's browser |
31 | halyavin | 1321 | jne nob3 |
1322 | mov ebx,10*65536+16+5 ;start pos x |
||
1323 | mov ecx,37*65536+15 ;start pos y |
||
1324 | jmp isb3 |
||
1325 | nob3: |
||
1326 | mov ebx,16*65536+16+5 ;start pos x |
||
1327 | mov ecx,29*65536+15 ;start pos y |
||
1328 | isb3: |
||
1329 | mov edx,8;+1000000000000000000000000000000b ;spoke butt |
||
131 | diamond | 1330 | mov edi,13 ;draw 13 button's |
31 | halyavin | 1331 | mov esi,cl_Grey |
485 | heavyiron | 1332 | mcall |
31 | halyavin | 1333 | dec edi |
1334 | nextbut: |
||
1335 | add ebx,(16+6)*65536 |
||
1336 | inc edx |
||
485 | heavyiron | 1337 | mcall |
31 | halyavin | 1338 | dec edi |
1339 | jnz nextbut |
||
1340 | |||
1341 | |||
134 | diamond | 1342 | cmp [browser], 1 ;it's browser |
31 | halyavin | 1343 | jne nob4 |
1344 | ;But img browser |
||
1345 | setimg 10,37,butimg |
||
1346 | ;left logo |
||
502 | heavyiron | 1347 | add eax,[procinfo.box.width] |
31 | halyavin | 1348 | sub eax,80 |
1349 | mov [temp],eax |
||
1350 | setimg [temp],37,logoimg |
||
1351 | jmp isb4 |
||
1352 | nob4: |
||
1353 | ;But img dialog |
||
1354 | setimg 16,29,butimg |
||
1355 | isb4: |
||
1356 | |||
134 | diamond | 1357 | cmp [browser], 1 ;it's browser |
31 | halyavin | 1358 | jne nob5 |
1359 | |||
1360 | mov [urlx],48 |
||
1361 | mov [urly],55 |
||
502 | heavyiron | 1362 | mov eax,[procinfo.box.width] |
31 | halyavin | 1363 | sub eax,48+10 |
1364 | mov [urlxsize],eax |
||
1365 | mov [urlysize],12 |
||
1366 | |||
131 | diamond | 1367 | glabel 20,57,"URL:",cl_Black |
31 | halyavin | 1368 | |
1369 | ;Out view mode info |
||
134 | diamond | 1370 | movzx edx, [viewmode] |
1371 | shl edx, 4 |
||
31 | halyavin | 1372 | mov eax,4 |
1373 | mov ebx,180*65536+25 |
||
1374 | mov ecx,cl_Black |
||
1375 | add edx,modetext |
||
1376 | mov esi,16 |
||
485 | heavyiron | 1377 | mcall |
31 | halyavin | 1378 | |
1379 | ;List size |
||
1380 | outcount [listsize],294,25,cl_Black,4*65536 |
||
1381 | jmp isb5 |
||
1382 | |||
1383 | head_dlg: db 'OPEN FILE' |
||
131 | diamond | 1384 | db 'SAVE FILE' |
31 | halyavin | 1385 | but_dlg: db 'OPEN' |
131 | diamond | 1386 | db 'SAVE' |
31 | halyavin | 1387 | |
1388 | nob5: |
||
1389 | |||
1390 | mov [urlx],10 |
||
502 | heavyiron | 1391 | mov eax,[procinfo.box.height] |
31 | halyavin | 1392 | sub eax,24 |
1393 | mov [urly],eax |
||
502 | heavyiron | 1394 | mov eax,[procinfo.box.width] |
31 | halyavin | 1395 | sub eax,80 |
1396 | mov [urlxsize],eax |
||
1397 | mov [urlysize],12 |
||
1398 | |||
131 | diamond | 1399 | cmp byte [dlg_type],'O' ;if byte O - is Open dialog |
31 | halyavin | 1400 | jne no_openh |
131 | diamond | 1401 | mov edx,head_dlg ;draw in head OPEN FILE |
31 | halyavin | 1402 | jmp out_laby |
1403 | no_openh: |
||
131 | diamond | 1404 | cmp byte [dlg_type],'S' ;if byte S - is Save dialog |
31 | halyavin | 1405 | jne no_saveh |
131 | diamond | 1406 | mov edx,head_dlg+9 ;draw in head SAVE FILE |
31 | halyavin | 1407 | out_laby: |
1408 | mov ebx,8*65536+8 |
||
131 | diamond | 1409 | mov ecx,[sc.grab_text] ; color of text RRGGBB |
1410 | or ecx,0x10000000 |
||
31 | halyavin | 1411 | mov esi,9 |
1412 | mov eax,4 |
||
485 | heavyiron | 1413 | mcall |
31 | halyavin | 1414 | no_saveh: |
1415 | |||
1416 | |||
1417 | ;Draw OPEN\SAVE button |
||
1418 | mov ebx,0*65536+50 |
||
1419 | mov ecx,0*65536+12 |
||
502 | heavyiron | 1420 | mov eax,[procinfo.box.width] |
31 | halyavin | 1421 | sub eax,63 |
1422 | shl eax,16 |
||
1423 | add ebx,eax |
||
502 | heavyiron | 1424 | mov eax,[procinfo.box.height] |
31 | halyavin | 1425 | sub eax,25 |
1426 | shl eax,16 |
||
1427 | add ecx,eax |
||
1428 | mov eax,8 |
||
1429 | mov edx,5 ;button ID |
||
1430 | mov esi,0x006699aa ;gradient!!! |
||
485 | heavyiron | 1431 | mcall |
31 | halyavin | 1432 | |
1433 | ; label OPEN or SAVE |
||
502 | heavyiron | 1434 | mov ebx,[procinfo.box.width] |
31 | halyavin | 1435 | sub ebx,48 |
502 | heavyiron | 1436 | mov eax,[procinfo.box.height] |
31 | halyavin | 1437 | sub eax,22 |
1438 | shl ebx,16 |
||
1439 | add ebx,eax |
||
1440 | |||
131 | diamond | 1441 | cmp byte [dlg_type],'O' ;if byte O - is Open dialog |
31 | halyavin | 1442 | jne no_openb |
131 | diamond | 1443 | mov edx,but_dlg ;draw in head OPEN FILE |
31 | halyavin | 1444 | jmp out_labx |
1445 | no_openb: |
||
131 | diamond | 1446 | cmp byte [dlg_type],'S' ;if byte S - is Save dialog |
31 | halyavin | 1447 | jne no_saveb |
131 | diamond | 1448 | mov edx,but_dlg+4 ;draw in head SAVE FILE |
31 | halyavin | 1449 | out_labx: |
1450 | mov ecx,cl_White |
||
1451 | mov esi,4 |
||
1452 | mov eax,4 |
||
485 | heavyiron | 1453 | mcall |
31 | halyavin | 1454 | no_saveb: |
1455 | |||
1456 | isb5: |
||
1457 | |||
1458 | anti_flick: |
||
1459 | |||
1460 | cmp [flick],2 |
||
1461 | je draw_url |
||
1462 | cmp [flick],0 |
||
1463 | jne no_flick_url |
||
1464 | |||
1465 | ;*************************** |
||
1466 | ; DRAW URL LINE |
||
1467 | ;*************************** |
||
1468 | draw_url: |
||
1469 | |||
1470 | ;Draw URL focus button |
||
1471 | mov ebx,[urlx] |
||
1472 | shl ebx,16 |
||
1473 | add ebx,[urlxsize] |
||
1474 | mov ecx,[urly] |
||
1475 | shl ecx,16 |
||
1476 | add ecx,[urlysize] |
||
1477 | dec ebx |
||
1478 | dec ecx |
||
1479 | mov eax,8 |
||
1480 | mov edx,2 ;button ID |
||
1481 | mov esi,0x00aaaaaa ;gradient!!! |
||
485 | heavyiron | 1482 | mcall |
31 | halyavin | 1483 | |
1484 | ;Draw URL String |
||
1485 | mov eax,13 |
||
1486 | mov edx,cl_Black |
||
485 | heavyiron | 1487 | mcall |
31 | halyavin | 1488 | add ebx,1*65536-2+1 |
1489 | add ecx,1*65536-2+1 |
||
1490 | mov edx,cl_White |
||
485 | heavyiron | 1491 | mcall |
31 | halyavin | 1492 | |
1493 | ;Draw URL Cursor |
||
1494 | mov eax,6 |
||
1495 | mul [cursor] |
||
1496 | mov ebx,[urlx] |
||
1497 | add ebx,eax |
||
1498 | shl ebx,16 |
||
1499 | add ebx,2*65536+1 |
||
1500 | mov ecx,[urly] |
||
1501 | shl ecx,16 |
||
1502 | add ecx,[urlysize] |
||
1503 | add ecx,2*65536-4 |
||
1504 | mov eax,13 |
||
1505 | mov edx,cl_Black |
||
485 | heavyiron | 1506 | mcall |
31 | halyavin | 1507 | |
1508 | ; OUT TEXT |
||
131 | diamond | 1509 | mov eax,[urlxsize] ;calculating text leight |
31 | halyavin | 1510 | sub eax,8 |
1511 | mov ebx,6 |
||
1512 | div ebx |
||
1513 | mov esi,eax |
||
1514 | |||
1515 | mov ebx,[urlx] |
||
1516 | shl ebx,16 |
||
1517 | add ebx,[urly] |
||
1518 | add ebx,3*65536+2 |
||
131 | diamond | 1519 | mov eax,4 ; function 4 : write text to window |
31 | halyavin | 1520 | mov ecx,0x00000000 ;[sc.grab_text] ; color of text RRGGBB |
131 | diamond | 1521 | mov edx,path ; pointer to text beginning |
485 | heavyiron | 1522 | mcall |
31 | halyavin | 1523 | |
1524 | cmp [flick],2 |
||
1525 | jne no_flick_url |
||
1526 | mov [flick],0 |
||
1527 | jmp still |
||
1528 | no_flick_url: |
||
1529 | |||
1530 | |||
1531 | ;*************************** |
||
1532 | ; DRAW FILE LIST |
||
1533 | ;*************************** |
||
1534 | |||
1535 | ;Draw Scroll Line |
||
1536 | mov eax,13 |
||
1537 | |||
1538 | mov ebx,[listx] |
||
1539 | add ebx,[listxsize] |
||
1540 | sub ebx,[scrollsize] |
||
1541 | shl ebx,16 |
||
1542 | add ebx,dword [scrollsize] |
||
1543 | mov ecx,[listy] |
||
134 | diamond | 1544 | add ecx,scrollbutsize |
31 | halyavin | 1545 | shl ecx,16 |
1546 | add ecx,[listysize] |
||
134 | diamond | 1547 | sub ecx,scrollbutsize*2 |
31 | halyavin | 1548 | mov edx,[scrollcolor] ;0x00006600 |
485 | heavyiron | 1549 | mcall |
31 | halyavin | 1550 | |
1551 | ;Draw Scroll Box |
||
1552 | mov edx,0 |
||
1553 | mov eax,[listysize] |
||
1554 | sub eax,2 |
||
1555 | mov ebx,dword 10 |
||
1556 | div ebx |
||
1557 | |||
1558 | mov ebx,eax |
||
131 | diamond | 1559 | cmp ebx,[listsize] ;filelistsize in ebx |
134 | diamond | 1560 | jae notusescroll |
31 | halyavin | 1561 | ;usescroll |
134 | diamond | 1562 | ; calculate scroll size |
1563 | mov eax, [listysize] |
||
1564 | sub eax, 2*scrollbutsize |
||
1565 | push eax |
||
1566 | mul ebx |
||
1567 | div [listsize] |
||
1568 | cmp eax, 5 |
||
1569 | jae @f |
||
1570 | mov al, 5 |
||
1571 | @@: |
||
1572 | mov [scroll_height], eax |
||
1573 | ; calculate scroll pos |
||
1574 | sub [esp], eax |
||
1575 | mov eax, [listsize] |
||
1576 | sub eax, ebx |
||
1577 | mov ecx, eax |
||
1578 | cmp eax, [filecursor] |
||
1579 | jb @f |
||
1580 | mov eax, [filecursor] |
||
1581 | @@: |
||
1582 | mul dword [esp] |
||
1583 | div ecx |
||
1584 | mov [scroll_pos], eax |
||
1585 | pop ecx |
||
1586 | ; draw |
||
1587 | lea ecx, [eax+scrollbutsize] |
||
1588 | add ecx, [listy] |
||
1589 | shl ecx, 16 |
||
1590 | mov cx, word [scroll_height] |
||
1591 | mov eax, 13 |
||
1592 | mov ebx, [listx] |
||
1593 | add ebx, [listxsize] |
||
1594 | sub ebx, [scrollsize] |
||
1595 | shl ebx, 16 |
||
1596 | mov bx, word [scrollsize] |
||
1597 | mov edx, [scrollboxcol] |
||
485 | heavyiron | 1598 | mcall |
31 | halyavin | 1599 | notusescroll: |
1600 | |||
1601 | |||
1602 | ;Draw list button for get file name |
||
1603 | mov ebx,[listx] |
||
1604 | shl ebx,16 |
||
1605 | add ebx,[listxsize] |
||
131 | diamond | 1606 | sub ebx,15 ;right free zone |
31 | halyavin | 1607 | sub ebx,[scrollsize] |
1608 | mov ecx,[listy] |
||
1609 | shl ecx,16 |
||
1610 | add ecx,[listysize] |
||
1611 | |||
1612 | mov eax,8 |
||
1613 | mov edx,4+1000000000000000000000000000000b ;spoke butt |
||
485 | heavyiron | 1614 | mcall |
31 | halyavin | 1615 | |
1616 | add ebx,15 |
||
1617 | mov eax,13 |
||
1618 | mov edx,[listcolor] ;ffffff |
||
485 | heavyiron | 1619 | mcall |
31 | halyavin | 1620 | |
1621 | ;Draw up/down buttons |
||
1622 | mov ebx,[listx] |
||
1623 | add ebx,[listxsize] |
||
1624 | sub ebx,[scrollsize] |
||
1625 | shl ebx,16 |
||
1626 | add ebx,[scrollsize] |
||
1627 | mov ecx,[listy] |
||
1628 | shl ecx,16 |
||
134 | diamond | 1629 | add ecx,scrollbutsize-1 |
31 | halyavin | 1630 | mov eax,8 |
1631 | mov edx,6+1000000000000000000000000000000b ;spoke butt |
||
485 | heavyiron | 1632 | mcall |
31 | halyavin | 1633 | |
1634 | inc ecx |
||
1635 | mov eax,13 |
||
1636 | mov edx,[scrollbutcol] ;ffffff |
||
485 | heavyiron | 1637 | mcall |
31 | halyavin | 1638 | |
1639 | ; Draw image on up button |
||
1640 | pushad |
||
1641 | shr ebx,16 |
||
1642 | mov edx,ebx |
||
1643 | shl edx,16 |
||
1644 | shr ecx,16 |
||
1645 | add edx,ecx |
||
1646 | mov ecx,8*65536+9 |
||
1647 | mov ebx,upsb+8 |
||
1648 | mov eax,7 |
||
485 | heavyiron | 1649 | mcall |
31 | halyavin | 1650 | popad |
1651 | |||
1652 | |||
131 | diamond | 1653 | dec ecx ;correction |
31 | halyavin | 1654 | mov edx,7+1000000000000000000000000000000b ;spoke butt |
1655 | mov eax,[listysize] |
||
134 | diamond | 1656 | sub eax,scrollbutsize |
31 | halyavin | 1657 | shl eax,16 |
1658 | add ecx,eax |
||
1659 | |||
1660 | mov eax,8 |
||
485 | heavyiron | 1661 | mcall |
31 | halyavin | 1662 | |
1663 | inc ecx |
||
1664 | mov eax,13 |
||
1665 | mov edx,[scrollbutcol] ;ffffff |
||
485 | heavyiron | 1666 | mcall |
31 | halyavin | 1667 | |
1668 | ; Draw image on down button |
||
1669 | pushad |
||
1670 | shr ebx,16 |
||
1671 | mov edx,ebx |
||
1672 | shl edx,16 |
||
1673 | shr ecx,16 |
||
1674 | add edx,ecx |
||
1675 | mov ecx,8*65536+9 |
||
1676 | mov ebx,dnsb+8 |
||
1677 | mov eax,7 |
||
485 | heavyiron | 1678 | mcall |
31 | halyavin | 1679 | popad |
1680 | |||
1681 | |||
1682 | ; Draw text in file list |
||
1683 | |||
134 | diamond | 1684 | ; mov eax,[listxsize] |
1685 | ; sub eax,40*6 ;leight of string |
||
1686 | ; shr eax,1 |
||
1687 | ; add eax,[listx] |
||
1688 | mov eax, [listx] |
||
1689 | add eax, 12+4 ; for icons |
||
31 | halyavin | 1690 | shl eax,16 |
1691 | add eax,[listy] |
||
1692 | add eax,2 |
||
1693 | |||
1694 | mov [filelistxy],eax ;dword 19*65536+58 |
||
1695 | |||
1696 | mov edx,0 |
||
1697 | mov eax,[listysize] |
||
1698 | sub eax,2 |
||
1699 | mov ebx,dword 10 |
||
1700 | div ebx |
||
1701 | mov [filelistsize],eax ;dword 40 |
||
1702 | |||
1703 | ; OUT FILE DATA |
||
131 | diamond | 1704 | mov eax,[filecursor] ;calc cursor position |
134 | diamond | 1705 | mov ebx,27 |
31 | halyavin | 1706 | mul ebx |
1707 | |||
1708 | ;OUT TEXT |
||
1709 | mov ebp,4096 ; 16 ;out strings process |
||
1710 | sub ebp,[filecursor] |
||
1711 | mov edx,convinfo ;fileinfo+11 |
||
1712 | add edx,eax |
||
1713 | mov ebx,dword [filelistxy] |
||
1714 | loo: |
||
134 | diamond | 1715 | cmp dword [edx], -1 |
1716 | jz noout |
||
31 | halyavin | 1717 | mov ecx,0x00888888 ;for another file's color white |
134 | diamond | 1718 | cmp [edx+15],dword 'FOL ' ;folder yellow |
31 | halyavin | 1719 | jne nb |
1720 | mov ecx,0x00006666 |
||
1721 | jmp cset1 |
||
1722 | nb: |
||
134 | diamond | 1723 | mov eax, [edx] |
1724 | xor edi, edi |
||
1725 | ; find extension and set color |
||
1726 | @@: |
||
1727 | inc eax |
||
1728 | cmp byte [eax-1], 0 |
||
1729 | jz @f |
||
1730 | cmp byte [eax-1], '.' |
||
1731 | jnz @b |
||
1732 | mov edi, eax |
||
1733 | jmp @b |
||
1734 | @@: |
||
1735 | test edi, edi |
||
1736 | jz @f |
||
1737 | mov edi, [edi] |
||
1738 | and edi, not 0x20202020 ; toupper |
||
1739 | @@: |
||
31 | halyavin | 1740 | ;Color set |
134 | diamond | 1741 | ; text's blue |
1742 | mov ecx, 0x00446666 |
||
1743 | cmp edi, 'TXT' |
||
1744 | jz cset |
||
1745 | cmp edi, 'INC' |
||
1746 | jz cset |
||
1747 | cmp edi, 'ASM' |
||
1748 | jz cset |
||
1749 | cmp edi, 'RTF' |
||
1750 | jz cset |
||
1751 | ; picture's pure |
||
1752 | mov ecx, 0x00226688 |
||
1753 | cmp edi, 'BMP' |
||
1754 | jz cset |
||
1755 | cmp edi, 'JPG' |
||
1756 | jz cset |
||
1757 | cmp edi, 'JPEG' |
||
1758 | jz cset |
||
1759 | cmp edi, 'GIF' |
||
1760 | jz cset |
||
1761 | cmp edi, 'PNG' |
||
1762 | jz cset |
||
1763 | cmp edi, 'WAV' |
||
1764 | jz cset |
||
1765 | cmp edi, 'MID' |
||
1766 | jz cset |
||
1767 | ; execute's green |
||
1768 | mov ecx, 0x00008866 |
||
1769 | test edi, edi |
||
1770 | jz cset |
||
1771 | ; for another file's color white |
||
1772 | mov ecx, 0x00888888 |
||
31 | halyavin | 1773 | cset: |
1774 | |||
1775 | cset1: |
||
134 | diamond | 1776 | push edx |
1777 | mov edx,[edx] |
||
1778 | push ebx edx |
||
1779 | mov eax, [listxsize] |
||
1780 | sub eax, [scrollsize] |
||
1781 | sub eax, 12+4 |
||
1782 | xor edx, edx |
||
1783 | mov ebx, 6 |
||
1784 | div ebx |
||
1785 | pop edx ebx |
||
1786 | sub eax, 25 |
||
1787 | xor esi, esi |
||
1788 | @@: |
||
1789 | cmp byte [edx+esi], 0 |
||
1790 | jz @f |
||
1791 | inc esi |
||
1792 | cmp esi, eax |
||
1793 | jbe @b |
||
1794 | dec esi |
||
1795 | @@: |
||
1796 | push eax |
||
31 | halyavin | 1797 | mov eax,4 |
485 | heavyiron | 1798 | mcall |
134 | diamond | 1799 | cmp byte [edx+esi], 0 |
1800 | jz @f |
||
1801 | pushad |
||
1802 | mov edx, more_char |
||
1803 | mov eax, esi |
||
1804 | imul eax, 6*65536 |
||
1805 | add ebx, eax |
||
1806 | mov esi, 1 |
||
1807 | mov eax, 4 |
||
485 | heavyiron | 1808 | mcall |
134 | diamond | 1809 | popad |
1810 | @@: |
||
1811 | pop eax |
||
1812 | pop edx |
||
1813 | push ebx edx |
||
1814 | inc eax |
||
1815 | imul eax, 6*65536 |
||
1816 | add ebx, eax |
||
1817 | add edx,4 |
||
1818 | mov esi,23 |
||
1819 | mov eax,4 |
||
485 | heavyiron | 1820 | mcall |
134 | diamond | 1821 | pop edx ebx |
31 | halyavin | 1822 | |
134 | diamond | 1823 | pushad |
1824 | cmp [edx+15],dword 'Fvol' ;volume label |
||
31 | halyavin | 1825 | jne no_volico |
1826 | push hdico+8 |
||
1827 | jmp out_ico |
||
1828 | no_volico: |
||
134 | diamond | 1829 | cmp [edx+15],dword 'FOL ' |
31 | halyavin | 1830 | jne no_folico |
134 | diamond | 1831 | cmp [edx+4],dword 'HARD' |
31 | halyavin | 1832 | jne no_hdico |
1833 | push hdico+8 |
||
1834 | jmp out_ico |
||
1835 | no_hdico: |
||
134 | diamond | 1836 | cmp [edx+4],dword 'RAMD' |
31 | halyavin | 1837 | jne no_rdico |
1838 | push rdico+8 |
||
1839 | jmp out_ico |
||
1840 | no_rdico: |
||
134 | diamond | 1841 | cmp [edx+4],dword 'FLOP' |
131 | diamond | 1842 | jne no_fdico |
1843 | push rdico+8 |
||
1844 | jmp out_ico |
||
1845 | no_fdico: |
||
156 | diamond | 1846 | cmp [edx+4],dword 'CD-R' |
1847 | jne no_cdico |
||
1848 | push cdico+8 |
||
1849 | jmp out_ico |
||
1850 | no_cdico: |
||
31 | halyavin | 1851 | push folico+8 |
1852 | jmp out_ico |
||
1853 | no_folico: |
||
134 | diamond | 1854 | cmp edi,dword 'BMP' |
131 | diamond | 1855 | je is_imgico |
134 | diamond | 1856 | cmp edi,dword 'JPG' |
131 | diamond | 1857 | je is_imgico |
134 | diamond | 1858 | cmp edi,dword 'JPEG' |
131 | diamond | 1859 | je is_imgico |
134 | diamond | 1860 | cmp edi,dword 'GIF' |
131 | diamond | 1861 | je is_imgico |
31 | halyavin | 1862 | ; //// Willow |
134 | diamond | 1863 | cmp edi,dword 'PNG' |
131 | diamond | 1864 | je is_imgico |
31 | halyavin | 1865 | ; //// Willow |
134 | diamond | 1866 | cmp edi,dword 'WAV' |
131 | diamond | 1867 | je is_imgico |
134 | diamond | 1868 | cmp edi,dword 'MID' |
131 | diamond | 1869 | je is_imgico |
31 | halyavin | 1870 | jmp no_imgico |
1871 | is_imgico: |
||
1872 | push imgico+8 |
||
1873 | jmp out_ico |
||
1874 | no_imgico: |
||
134 | diamond | 1875 | cmp edi,dword 'ASM' |
131 | diamond | 1876 | je is_asmincico |
134 | diamond | 1877 | cmp edi,dword 'INC' |
131 | diamond | 1878 | je is_asmincico |
31 | halyavin | 1879 | jmp no_asmincico |
1880 | is_asmincico: |
||
1881 | push asmincico+8 |
||
1882 | jmp out_ico |
||
1883 | no_asmincico: |
||
134 | diamond | 1884 | cmp edi,dword 'RTF' |
131 | diamond | 1885 | je @f |
134 | diamond | 1886 | cmp edi,dword 'TXT' |
31 | halyavin | 1887 | jne no_txtico |
131 | diamond | 1888 | @@: |
31 | halyavin | 1889 | push txtico+8 |
1890 | jmp out_ico |
||
1891 | no_txtico: |
||
134 | diamond | 1892 | test edi,edi |
31 | halyavin | 1893 | jne no_execico |
1894 | push execico+8 |
||
1895 | jmp out_ico |
||
1896 | no_execico: |
||
134 | diamond | 1897 | cmp [edx+15],dword 'DAT ' |
31 | halyavin | 1898 | jne no_datico |
1899 | push datico+8 |
||
1900 | jmp out_ico |
||
1901 | no_datico: |
||
134 | diamond | 1902 | cmp [edx+15],dword 'DEL ' |
31 | halyavin | 1903 | jne no_out_ico |
1904 | push delico+8 |
||
1905 | jmp out_ico |
||
1906 | out_ico: |
||
1907 | |||
1908 | mov edx,ebx |
||
1909 | sub edx,14*65536+1 |
||
1910 | mov ecx,12*65536+9 |
||
1911 | ; mov ebx,upsb+8 |
||
1912 | pop ebx |
||
1913 | mov eax,7 |
||
485 | heavyiron | 1914 | mcall |
31 | halyavin | 1915 | no_out_ico: |
1916 | popad |
||
1917 | |||
1918 | |||
1919 | add ebx,10 |
||
1920 | noout: |
||
134 | diamond | 1921 | add edx,27 |
31 | halyavin | 1922 | |
1923 | dec [filelistsize] |
||
134 | diamond | 1924 | jz extloo |
31 | halyavin | 1925 | |
1926 | dec ebp |
||
1927 | jnz loo |
||
1928 | dext: |
||
1929 | mov [downstop],1 |
||
1930 | |||
1931 | extloo: |
||
1932 | |||
134 | diamond | 1933 | cmp [browser], 1 ;it's browser |
31 | halyavin | 1934 | jne nob8 |
1935 | |||
1936 | ;Draw text for head->file buttons |
||
1937 | cmp [drawhf],1 |
||
1938 | jne no_drawhftext |
||
1939 | drawfbox 8,35,(6*12)+1,11*8,0x00000000 |
||
1940 | drawfbox 9,36,(6*12)-1,(11*8)-2,0x00ffffff |
||
1941 | |||
1942 | mov edi,8 |
||
1943 | mov ebx,9*65536+37 |
||
1944 | mov ecx,cl_Black |
||
1945 | mov edx,file_text_label |
||
1946 | call drawmenu |
||
1947 | jmp no_drawhftext |
||
1948 | |||
1949 | file_text_label: |
||
131 | diamond | 1950 | db ' Open ' |
1951 | db ' Copy ' |
||
1952 | db ' Paste ' |
||
1953 | db ' Delete ' |
||
1954 | db ' Tinypad ' |
||
1955 | db ' Edit ' |
||
1956 | db ' ' |
||
1957 | db ' Exit ' |
||
31 | halyavin | 1958 | |
1959 | no_drawhftext: |
||
1960 | |||
1961 | ;Draw text for head->view buttons |
||
1962 | cmp [drawhv],1 |
||
1963 | jne no_drawhvtext |
||
134 | diamond | 1964 | drawfbox (8+6*8),35,(6*12)+1,(11*4),0x00000000 |
1965 | drawfbox (9+6*8),36,(6*12)-1,(11*4)-2,0x00ffffff |
||
31 | halyavin | 1966 | |
134 | diamond | 1967 | mov edi,4 |
31 | halyavin | 1968 | mov ebx,(9+6*8)*65536+37 |
1969 | mov ecx,cl_Black |
||
1970 | mov edx,view_text_label |
||
1971 | call drawmenu |
||
1972 | jmp no_drawhvtext |
||
1973 | |||
1974 | view_text_label: |
||
131 | diamond | 1975 | db ' Name sort ' |
1976 | db ' Ext. sort ' |
||
1977 | db ' Size sort ' |
||
1978 | db ' Date sort ' |
||
31 | halyavin | 1979 | |
1980 | no_drawhvtext: |
||
1981 | |||
1982 | ;Draw text for head->info buttons |
||
1983 | cmp [drawhi],1 |
||
1984 | jne no_drawhitext |
||
1985 | drawfbox (8+12*8),35,(6*12)+1,(11*2),0x00000000 |
||
1986 | drawfbox (9+12*8),36,(6*12)-1,(11*2)-2,0x00ffffff |
||
1987 | |||
1988 | mov edi,2 |
||
1989 | mov eax,4 |
||
1990 | mov ebx,(9+12*8)*65536+37 |
||
1991 | mov ecx,cl_Black |
||
1992 | mov edx,info_text_label |
||
1993 | call drawmenu |
||
1994 | jmp no_drawhitext |
||
1995 | |||
1996 | info_text_label: |
||
131 | diamond | 1997 | db ' Help ' |
1998 | db ' About ' |
||
31 | halyavin | 1999 | |
2000 | no_drawhitext: |
||
2001 | |||
2002 | nob8: |
||
2003 | cmp [flick],1 |
||
2004 | jne no_flick |
||
2005 | mov [flick],0 |
||
2006 | jmp still |
||
2007 | no_flick: |
||
2008 | |||
131 | diamond | 2009 | mov eax,12 ; function 12:tell os about windowdraw |
2010 | mov ebx,2 ; 2, end of draw |
||
485 | heavyiron | 2011 | mcall |
31 | halyavin | 2012 | |
2013 | ret |
||
2014 | |||
2015 | ;FILE LIST PARAMETRS |
||
2016 | |||
131 | diamond | 2017 | listx dd 15 |
2018 | listy dd 72 |
||
31 | halyavin | 2019 | listxsize dd 350 |
2020 | listysize dd 41 |
||
2021 | |||
2022 | filelistxy dd 0 |
||
2023 | filelistsize dd 0 |
||
2024 | scrollsize dd 8 |
||
2025 | listcolor dd 0xffffff ;0xeeeeee |
||
2026 | scrollcolor dd 0x778877 |
||
2027 | scrollboxcol dd 0x335533 |
||
2028 | scrollbutcol dd 0x224422 |
||
134 | diamond | 2029 | scrollbutsize = 9 |
31 | halyavin | 2030 | |
2031 | ;URL LINE PARAMETRS |
||
2032 | |||
131 | diamond | 2033 | urlx dd 10 |
2034 | urly dd 20 |
||
31 | halyavin | 2035 | urlxsize dd 350 |
2036 | urlysize dd 12 |
||
2037 | |||
2038 | |||
2039 | drawmenu: |
||
2040 | mov eax,4 |
||
2041 | mov esi,12 |
||
2042 | menuloo: |
||
485 | heavyiron | 2043 | mcall |
31 | halyavin | 2044 | add ebx,11 |
2045 | add edx,12 |
||
2046 | dec edi |
||
2047 | jnz menuloo |
||
2048 | ret |
||
2049 | |||
2050 | menubutton: |
||
2051 | mov eax,8 |
||
2052 | nextmenubut: |
||
485 | heavyiron | 2053 | mcall |
31 | halyavin | 2054 | add ecx,11*65536 |
2055 | inc edx |
||
2056 | dec edi |
||
2057 | jnz nextmenubut |
||
2058 | ret |
||
2059 | |||
2060 | ;***************************** |
||
2061 | ; READ FILE STRUCTURE PROC |
||
2062 | ;***************************** |
||
2063 | |||
2064 | read_directory: |
||
2065 | |||
2066 | ;STEP 1 CLEAR CONVINFO |
||
2067 | mov edi,convinfo |
||
2068 | mov al,255 |
||
134 | diamond | 2069 | mov ecx,4096*27 |
31 | halyavin | 2070 | cld |
134 | diamond | 2071 | push edi |
31 | halyavin | 2072 | rep stosb |
134 | diamond | 2073 | pop edi |
31 | halyavin | 2074 | |
2075 | ;STEP 2 TEST ON HD OR PARTITION |
||
2076 | cmp [path],byte '/' |
||
2077 | je nstep |
||
134 | diamond | 2078 | ; copy info on RD and FD |
2079 | mov esi, hdimg |
||
2080 | mov ecx, 2*27 |
||
2081 | rep movsb |
||
2082 | ; hard disks |
||
2083 | mov eax, 4 |
||
2084 | .1: |
||
2085 | mov ecx, 27 |
||
2086 | cmp dword [esi], 0 |
||
2087 | jz .2 |
||
2088 | rep movsb |
||
2089 | jmp .3 |
||
2090 | .2: |
||
2091 | add esi, ecx |
||
2092 | .3: |
||
2093 | dec eax |
||
2094 | jnz .1 |
||
2095 | mov [listsize], 0 |
||
2096 | ret |
||
31 | halyavin | 2097 | nstep: |
2098 | cmp [path+3],byte '/' |
||
2099 | je nstep2 |
||
131 | diamond | 2100 | cmp [path+4],byte '/' |
2101 | je nstep2 |
||
156 | diamond | 2102 | mov ecx,1 |
131 | diamond | 2103 | cmp [path+1],word 'RD' |
156 | diamond | 2104 | jz loxpt |
2105 | cmp [path+1],word 'CD' |
||
2106 | jz loxpt |
||
2107 | mov ecx,2 |
||
131 | diamond | 2108 | cmp [path+1],word 'FD' |
156 | diamond | 2109 | jz loxpt |
131 | diamond | 2110 | cmp [path+1],dword 'HD0' |
2111 | jne nostep_HD0 |
||
134 | diamond | 2112 | movzx ecx,byte [table_area+2] |
131 | diamond | 2113 | jmp loxpt |
2114 | nostep_HD0: |
||
2115 | cmp [path+1],dword 'HD1' |
||
2116 | jne nostep_HD1 |
||
134 | diamond | 2117 | movzx ecx,byte [table_area+3] |
131 | diamond | 2118 | jmp loxpt |
2119 | nostep_HD1: |
||
2120 | cmp [path+1],dword 'HD2' |
||
2121 | jne nostep_HD2 |
||
134 | diamond | 2122 | movzx ecx,byte [table_area+4] |
131 | diamond | 2123 | jmp loxpt |
2124 | nostep_HD2: |
||
2125 | cmp [path+1],dword 'HD3' |
||
2126 | jne nostep_HD3 |
||
134 | diamond | 2127 | movzx ecx,byte [table_area+5] |
131 | diamond | 2128 | jmp loxpt |
2129 | nostep_HD3: |
||
2130 | |||
134 | diamond | 2131 | mov ecx,2 |
131 | diamond | 2132 | |
31 | halyavin | 2133 | loxpt: |
134 | diamond | 2134 | cmp ecx, 20 |
2135 | jbe @f |
||
2136 | mov ecx, 20 |
||
2137 | @@: |
||
2138 | mov eax, a1 |
||
2139 | mov esi, ptimg |
||
2140 | @@: |
||
2141 | stosd |
||
2142 | add eax, 3 |
||
2143 | push ecx esi |
||
2144 | mov ecx, 23 |
||
2145 | rep movsb |
||
2146 | pop esi ecx |
||
2147 | loop @b |
||
31 | halyavin | 2148 | mov [listsize],0 |
2149 | ret |
||
2150 | nstep2: |
||
2151 | |||
134 | diamond | 2152 | ;STEP 3 was deleted |
31 | halyavin | 2153 | |
2154 | ;STEP 4 READ DATA FROM HD |
||
2155 | |||
2156 | loorhd: |
||
134 | diamond | 2157 | mov eax,70 |
31 | halyavin | 2158 | mov ebx,fileinfoblock |
485 | heavyiron | 2159 | mcall |
31 | halyavin | 2160 | |
134 | diamond | 2161 | cmp eax,6 |
131 | diamond | 2162 | je end_of_dir |
31 | halyavin | 2163 | |
2164 | ; It's erorr's test is poor code |
||
2165 | |||
2166 | cmp eax,1 |
||
2167 | jne no_inv_part |
||
131 | diamond | 2168 | glabel 10,10,'Invalid partition or hd base',cl_Red+font_Big |
31 | halyavin | 2169 | jmp end_of_dir |
2170 | no_inv_part: |
||
2171 | cmp eax,3 |
||
2172 | jne no_unk_fs |
||
134 | diamond | 2173 | glabel 10,10,'Unknown file system',cl_Red+font_Big |
31 | halyavin | 2174 | jmp end_of_dir |
2175 | no_unk_fs: |
||
2176 | |||
2177 | end_of_dir: |
||
134 | diamond | 2178 | ; -1 -> 0 |
2179 | cmp ebx, -1 |
||
2180 | sbb ebx, -1 |
||
31 | halyavin | 2181 | mov [dirlen],ebx |
2182 | |||
134 | diamond | 2183 | ; command successful |
31 | halyavin | 2184 | |
134 | diamond | 2185 | mov esi, outinfo+32 |
2186 | and [listsize], 0 |
||
2187 | test ebx, ebx |
||
2188 | jz nofiles |
||
31 | halyavin | 2189 | |
2190 | newlineb: |
||
134 | diamond | 2191 | push ebx |
31 | halyavin | 2192 | |
134 | diamond | 2193 | mov edi, fileinfo |
2194 | push edi |
||
2195 | mov al, ' ' |
||
2196 | mov ecx, 27 |
||
2197 | rep stosb |
||
2198 | pop edi |
||
2199 | push esi |
||
2200 | add esi, 40 |
||
2201 | mov [edi], esi |
||
2202 | pop esi |
||
31 | halyavin | 2203 | |
134 | diamond | 2204 | mov eax, 'DAT ' ; data or ... ? |
2205 | mov cl, [esi] |
||
2206 | test cl, 0x10 |
||
2207 | jz @f |
||
2208 | mov eax, 'FOL ' |
||
2209 | mov [edi+15], eax |
||
2210 | jmp nosize |
||
2211 | @@: |
||
2212 | test cl, 8 |
||
2213 | jz novol |
||
2214 | mov eax, 'Fvol' |
||
2215 | mov [edi+15], eax |
||
2216 | jmp nosize |
||
2217 | novol: |
||
2218 | mov [edi+15], eax |
||
31 | halyavin | 2219 | |
134 | diamond | 2220 | ; size |
2221 | mov eax, [esi+32] |
||
2222 | push esi |
||
2223 | lea esi, [edi+26] |
||
2224 | mov ebx, 10 |
||
2225 | mov ecx, 8 |
||
2226 | newnum: |
||
2227 | xor edx, edx |
||
2228 | div ebx |
||
2229 | add dl, '0' |
||
2230 | mov [esi], dl |
||
2231 | test eax, eax |
||
2232 | jz zernum |
||
2233 | dec esi |
||
2234 | loop newnum |
||
2235 | zernum: |
||
2236 | pop esi |
||
2237 | nosize: |
||
31 | halyavin | 2238 | |
134 | diamond | 2239 | ; date |
2240 | mov dword [edi+6], '. .' |
||
2241 | ; year |
||
2242 | movzx eax, word [esi+28+2] |
||
2243 | mov ecx, 4 |
||
2244 | newdel1: |
||
2245 | xor edx, edx |
||
2246 | mov ebx, 10 |
||
2247 | div ebx |
||
2248 | add edx, '0' |
||
2249 | mov [edi+ecx+9], dl |
||
2250 | loop newdel1 |
||
2251 | ; month |
||
2252 | movzx eax, byte [esi+28+1] |
||
2253 | xor edx, edx |
||
2254 | div ebx |
||
2255 | add al, '0' |
||
2256 | add dl, '0' |
||
2257 | mov [edi+7], al |
||
2258 | mov [edi+8], dl |
||
2259 | ; day |
||
2260 | movzx eax, byte [esi+28] |
||
2261 | xor edx, edx |
||
2262 | div ebx |
||
2263 | add al, '0' |
||
2264 | add dl, '0' |
||
2265 | mov [edi+4], al |
||
2266 | mov [edi+5], dl |
||
31 | halyavin | 2267 | |
2268 | ;STEP 5 Test on WRITE OR NOTWRITE |
||
134 | diamond | 2269 | cmp word [esi+40], '.' |
2270 | jz nextfl |
||
2271 | cmp word [esi+40], '..' |
||
2272 | jnz @f |
||
2273 | cmp byte [esi+42], 0 |
||
2274 | jz nextfl |
||
2275 | @@: |
||
31 | halyavin | 2276 | |
134 | diamond | 2277 | ; STEP 6 SORT ALGORYTHM |
31 | halyavin | 2278 | |
134 | diamond | 2279 | push esi |
2280 | xor esi, esi |
||
31 | halyavin | 2281 | |
134 | diamond | 2282 | ; At first Fold after Dat |
31 | halyavin | 2283 | |
2284 | ftestname: |
||
134 | diamond | 2285 | cmp dword [convinfo+esi], -1 |
2286 | jz writefile |
||
2287 | cmp byte [fileinfo+15],'F' |
||
131 | diamond | 2288 | je F |
134 | diamond | 2289 | cmp byte [fileinfo+15],'D' |
2290 | jne add_element |
||
2291 | D: cmp byte [convinfo+esi+15],'D' |
||
131 | diamond | 2292 | je add_element |
134 | diamond | 2293 | cmp byte [convinfo+esi+15],'F' |
131 | diamond | 2294 | je skipfile |
31 | halyavin | 2295 | jmp add_element |
134 | diamond | 2296 | F: cmp byte [convinfo+esi+15],'D' |
31 | halyavin | 2297 | je writenow |
134 | diamond | 2298 | ; cmp byte [convinfo+esi+15],'F' |
31 | halyavin | 2299 | ; je add_element |
2300 | ; jmp add_element |
||
2301 | |||
2302 | add_element: |
||
134 | diamond | 2303 | ; compare items |
2304 | movzx eax, [viewmode] |
||
2305 | call [compare+eax*4] |
||
2306 | jb writenow |
||
31 | halyavin | 2307 | skipfile: |
134 | diamond | 2308 | add esi,27 |
31 | halyavin | 2309 | jmp ftestname |
2310 | |||
2311 | writenow: |
||
134 | diamond | 2312 | mov ecx,4096*27-1 |
31 | halyavin | 2313 | sub ecx,esi |
2314 | ldloop: |
||
2315 | mov al,[convinfo+ecx+esi] |
||
134 | diamond | 2316 | mov [convinfo+ecx+esi+27],al |
31 | halyavin | 2317 | dec ecx |
2318 | jns ldloop |
||
2319 | |||
2320 | writefile: |
||
134 | diamond | 2321 | mov ecx,26 |
31 | halyavin | 2322 | wfloop: |
134 | diamond | 2323 | mov al,[fileinfo+ecx] |
31 | halyavin | 2324 | mov [convinfo+ecx+esi],al |
2325 | dec ecx |
||
2326 | jns wfloop |
||
134 | diamond | 2327 | inc [listsize] |
2328 | pop esi |
||
31 | halyavin | 2329 | |
2330 | nextfl: |
||
134 | diamond | 2331 | add esi, 304 |
2332 | pop ebx |
||
2333 | dec ebx |
||
2334 | jnz newlineb |
||
31 | halyavin | 2335 | |
134 | diamond | 2336 | nofiles: |
2337 | ret |
||
31 | halyavin | 2338 | |
134 | diamond | 2339 | toupper: |
2340 | cmp al, 'a' |
||
2341 | jb .ret |
||
2342 | cmp al, 'z' |
||
2343 | ja @f |
||
2344 | .sub20: |
||
2345 | sub al, 0x20 |
||
2346 | .ret: |
||
2347 | ret |
||
2348 | @@: |
||
2349 | cmp al, 0xA0 |
||
2350 | jb .ret |
||
2351 | cmp al, 0xB0 |
||
2352 | jb .sub20 |
||
2353 | cmp al, 0xE0 |
||
2354 | jb .ret |
||
2355 | cmp al, 0xF0 |
||
2356 | jae @f |
||
2357 | sub al, 0xE0-0x90 |
||
2358 | ret |
||
2359 | @@: |
||
2360 | cmp al, 0xF1 |
||
2361 | jnz .ret |
||
2362 | dec eax |
||
2363 | ret |
||
31 | halyavin | 2364 | |
134 | diamond | 2365 | compare_date: |
2366 | pushad |
||
2367 | mov al, [fileinfo+10] |
||
2368 | cmp al, [convinfo+esi+10] |
||
2369 | jnz .ret |
||
2370 | mov al, [fileinfo+11] |
||
2371 | cmp al, [convinfo+esi+11] |
||
2372 | jnz .ret |
||
2373 | mov al, [fileinfo+12] |
||
2374 | cmp al, [convinfo+esi+12] |
||
2375 | jnz .ret |
||
2376 | mov al, [fileinfo+13] |
||
2377 | cmp al, [convinfo+esi+13] |
||
2378 | jnz .ret |
||
2379 | mov al, [fileinfo+7] |
||
2380 | cmp al, [convinfo+esi+7] |
||
2381 | jnz .ret |
||
2382 | mov al, [fileinfo+8] |
||
2383 | cmp al, [convinfo+esi+8] |
||
2384 | jnz .ret |
||
2385 | mov al, [fileinfo+4] |
||
2386 | cmp al, [convinfo+esi+4] |
||
2387 | jnz .ret |
||
2388 | mov al, [fileinfo+5] |
||
2389 | cmp al, [convinfo+esi+5] |
||
2390 | jz compare_name.1 |
||
2391 | .ret: |
||
2392 | popad |
||
2393 | ret |
||
2394 | compare_name: |
||
2395 | pushad |
||
2396 | .1: |
||
2397 | mov edi, dword [convinfo+esi] |
||
2398 | mov esi, dword [fileinfo] |
||
2399 | call strcmpi |
||
2400 | popad |
||
2401 | ret |
||
2402 | compare_ext: |
||
2403 | pushad |
||
2404 | mov esi, dword [convinfo+esi] |
||
2405 | mov edi, dword [fileinfo] |
||
2406 | call find_ext |
||
2407 | xchg esi, edi |
||
2408 | call find_ext |
||
2409 | call strcmpi |
||
2410 | popad |
||
2411 | jz compare_name |
||
2412 | ret |
||
2413 | compare_size: |
||
2414 | pushad |
||
2415 | lea edi, [convinfo+esi+19] |
||
2416 | lea esi, [fileinfo+19] |
||
2417 | mov ecx, 8 |
||
2418 | repz cmpsb |
||
2419 | popad |
||
2420 | jz compare_name |
||
2421 | ret |
||
31 | halyavin | 2422 | |
134 | diamond | 2423 | strcmpi: |
2424 | lodsb |
||
2425 | call toupper |
||
2426 | push eax |
||
2427 | mov al, [edi] |
||
2428 | inc edi |
||
2429 | call toupper |
||
2430 | cmp [esp], al |
||
2431 | pop eax |
||
2432 | jnz @f |
||
2433 | test al, al |
||
2434 | jnz strcmpi |
||
2435 | @@: |
||
2436 | ret |
||
2437 | |||
2438 | find_ext: |
||
2439 | lodsb |
||
2440 | test al, al |
||
2441 | jz .noext |
||
2442 | cmp al, '.' |
||
2443 | jnz find_ext |
||
2444 | ret |
||
2445 | .noext: |
||
2446 | dec esi |
||
2447 | ret |
||
2448 | |||
31 | halyavin | 2449 | ;****************************************************************************** |
2450 | |||
2451 | ; DATA AREA |
||
2452 | pmenu_draw dd 0 ;if poup menu is draw,update all window |
||
131 | diamond | 2453 | flick dd 0 ;anti flick on ? |
2454 | drawhf dd 0 ;draw file menu? |
||
2455 | drawhv dd 0 ;draw view menu? |
||
2456 | drawhi dd 0 ;draw info menu? |
||
2457 | cursor dd 0 ;cursor in prompt line |
||
2458 | focus dd 0 ;prompt edit or window? |
||
31 | halyavin | 2459 | downstop dd 0 |
2460 | filecursor dd 0 |
||
131 | diamond | 2461 | mousex dd 0 |
2462 | mousey dd 0 |
||
31 | halyavin | 2463 | blocksread dd 0 |
2464 | listsize dd 0 ;num of files in directory |
||
131 | diamond | 2465 | temp dd 0 |
31 | halyavin | 2466 | readblock dd 1 |
2467 | dlg_type db 0 ;S-save O-open |
||
134 | diamond | 2468 | browser db 0 ;0-dialog, 1-browser |
2469 | viewmode db 0 ;folder sort |
||
31 | halyavin | 2470 | |
134 | diamond | 2471 | compare dd compare_name |
2472 | dd compare_ext |
||
2473 | dd compare_size |
||
2474 | dd compare_date |
||
31 | halyavin | 2475 | |
134 | diamond | 2476 | aRD db 'RD',0 |
2477 | aFD db 'FD',0 |
||
2478 | aHD0 db 'HD0',0 |
||
2479 | aHD1 db 'HD1',0 |
||
2480 | aHD2 db 'HD2',0 |
||
2481 | aHD3 db 'HD3',0 |
||
156 | diamond | 2482 | aCD0 db 'CD0',0 |
2483 | aCD1 db 'CD1',0 |
||
2484 | aCD2 db 'CD2',0 |
||
2485 | aCD3 db 'CD3',0 |
||
134 | diamond | 2486 | a1 db '1',0,0 |
2487 | a2 db '2',0,0 |
||
2488 | a3 db '3',0,0 |
||
2489 | a4 db '4',0,0 |
||
2490 | a5 db '5',0,0 |
||
2491 | a6 db '6',0,0 |
||
2492 | a7 db '7',0,0 |
||
2493 | a8 db '8',0,0 |
||
2494 | a9 db '9',0,0 |
||
2495 | a10 db '10',0 |
||
2496 | a11 db '11',0 |
||
2497 | a12 db '12',0 |
||
2498 | a13 db '13',0 |
||
2499 | a14 db '14',0 |
||
2500 | a15 db '15',0 |
||
2501 | a16 db '16',0 |
||
2502 | a17 db '17',0 |
||
2503 | a18 db '18',0 |
||
2504 | a19 db '19',0 |
||
2505 | a20 db '20',0 |
||
131 | diamond | 2506 | |
134 | diamond | 2507 | hdimg: |
2508 | dd aRD |
||
2509 | db 'RAMDISK FOL ' |
||
2510 | dd aFD |
||
2511 | db 'FLOPPYDISK FOL ' |
||
2512 | hdimg1 dd 0 |
||
2513 | db 'HARDDISK FOL ' |
||
2514 | hdimg2 dd 0 |
||
2515 | db 'HARDDISK FOL ' |
||
2516 | hdimg3 dd 0 |
||
2517 | db 'HARDDISK FOL ' |
||
2518 | hdimg4 dd 0 |
||
2519 | db 'HARDDISK FOL ' |
||
2520 | ptimg db 'PARTITION FOL ' |
||
31 | halyavin | 2521 | |
2522 | modetext: |
||
2523 | ;0123456789012345 |
||
2524 | db 'SORT BY NAME 0' |
||
2525 | db 'SORT BY EXT. 1' |
||
2526 | db 'SORT BY SIZE 2' ;type sort |
||
2527 | db 'SORT BY DATE 3' |
||
2528 | db 'DEL SORT NAME 4' |
||
2529 | db 'DEL SORT EXT. 5' |
||
2530 | db 'DEL SORT SIZE 6' ;type sort |
||
2531 | db 'DEL SORT DATE 7' |
||
2532 | |||
131 | diamond | 2533 | dirlen dd 0x1 |
31 | halyavin | 2534 | b_color dd 0x6677cc |
2535 | |||
2536 | ; //// Willow |
||
131 | diamond | 2537 | ;MRUfile: |
2538 | ; dd 0x0 |
||
2539 | ; dd 0x0 |
||
2540 | ; dd 0x1 |
||
2541 | ; dd path |
||
2542 | ; dd tempzone |
||
2543 | ; db '/RD/1/MRU.LST',0 |
||
31 | halyavin | 2544 | ; //// Willow |
2545 | |||
2546 | ;Name of programs |
||
134 | diamond | 2547 | editor db '/RD/1/TINYPAD',0 |
529 | spraid | 2548 | bmpview db '/sys/MV',0 |
2549 | jpgview db '/sys/JPEGVIEW',0 |
||
2550 | gifview db '/sys/GIFVIEW',0 |
||
205 | heavyiron | 2551 | ac97 db '/RD/1/AC97SND',0 |
134 | diamond | 2552 | rtfread db '/RD/1/RTFREAD',0 |
31 | halyavin | 2553 | ; //// Willow |
529 | spraid | 2554 | pngview db '/sys/@RCHER',0 |
31 | halyavin | 2555 | ; //// Willow |
134 | diamond | 2556 | midamp db '/RD/1/MIDAMP',0 |
205 | heavyiron | 2557 | view3ds db '/RD/1/3D/VIEW3DS',0 |
2558 | life2 db '/RD/1/DEMOS/LIFE2',0 |
||
31 | halyavin | 2559 | |
134 | diamond | 2560 | more_char db 10h |
2561 | |||
31 | halyavin | 2562 | fileinfo_start: |
134 | diamond | 2563 | dd 7 |
2564 | dd 0 |
||
2565 | fileinfo_params: |
||
2566 | dd 0 |
||
2567 | dd 0 |
||
2568 | dd 0 |
||
2569 | db 0 |
||
2570 | fileinfo_name: |
||
2571 | dd 0 |
||
31 | halyavin | 2572 | |
134 | diamond | 2573 | clipfile_info: |
2574 | dd ? |
||
2575 | dd 0 |
||
2576 | dd 0 |
||
2577 | dd ? |
||
2578 | dd paramtest |
||
2579 | db '/RD/1/CLIPFILE.TXT',0 |
||
2580 | copyr_run: |
||
2581 | dd 7 |
||
2582 | dd 0 |
||
2583 | dd copyr_param |
||
2584 | dd 0 |
||
2585 | dd 0 |
||
529 | spraid | 2586 | db '/sys/COPYR',0 |
134 | diamond | 2587 | |
31 | halyavin | 2588 | fileinfoblock: |
134 | diamond | 2589 | dd 0x1 ; read folder |
131 | diamond | 2590 | dd 0x0 ; first block |
134 | diamond | 2591 | dd 0x0 ; flags (ANSI names) |
2592 | dd 4095 ; number of blocks to read |
||
131 | diamond | 2593 | dd outinfo ; ret offset |
31 | halyavin | 2594 | path: |
134 | diamond | 2595 | times 1024 db 0 ;path |
131 | diamond | 2596 | |
2597 | table_area: |
||
2598 | rb 10 |
||
2599 | |||
31 | halyavin | 2600 | ;rb 256 |
2601 | but_file: |
||
2602 | file 'systr12.GIF' |
||
134 | diamond | 2603 | |
2604 | I_END: |
||
2605 | |||
2606 | scroll_height dd ? |
||
2607 | scroll_pos dd ? |
||
2608 | |||
31 | halyavin | 2609 | butimg: |
131 | diamond | 2610 | rb 400*16*3+8 ;buttons (left pice of picture) |
31 | halyavin | 2611 | logoimg: |
131 | diamond | 2612 | rb 70*16*3+8 ;logo (right pice of picture) |
31 | halyavin | 2613 | logoinfimg: |
131 | diamond | 2614 | rb 60*60*3+8 ;logoinfo (right pice of picture) |
31 | halyavin | 2615 | upsb: |
131 | diamond | 2616 | rb 8*9*3+8 ;up scroll button |
31 | halyavin | 2617 | dnsb: |
131 | diamond | 2618 | rb 8*9*3+8 ;down scroll button |
31 | halyavin | 2619 | |
2620 | ;ICONS RESERVE AREA |
||
2621 | hdico: |
||
2622 | rb 12*9*3+8 |
||
2623 | rdico: |
||
2624 | rb 12*9*3+8 |
||
2625 | folico: |
||
2626 | rb 12*9*3+8 |
||
2627 | datico: |
||
2628 | rb 12*9*3+8 |
||
2629 | delico: |
||
2630 | rb 12*9*3+8 |
||
2631 | imgico: |
||
2632 | rb 12*9*3+8 |
||
2633 | txtico: |
||
2634 | rb 12*9*3+8 |
||
2635 | asmincico: |
||
2636 | rb 12*9*3+8 |
||
2637 | execico: |
||
2638 | rb 12*9*3+8 |
||
156 | diamond | 2639 | cdico: |
2640 | rb 12*9*3+8 |
||
31 | halyavin | 2641 | |
131 | diamond | 2642 | tempimg: ;reserve ram for images |
2643 | rb 400*100*3+8 ;for picture |
||
31 | halyavin | 2644 | rb 8000 |
2645 | |||
2646 | gif_hash: |
||
2647 | rd 4096 |
||
2648 | |||
2649 | MYPID: |
||
2650 | rd 8 |
||
2651 | |||
2652 | param_area: |
||
2653 | rb 256 |
||
2654 | paramtest: |
||
134 | diamond | 2655 | rb 1024 |
31 | halyavin | 2656 | filedir: |
134 | diamond | 2657 | rb 1024 |
31 | halyavin | 2658 | |
2659 | procinfo process_information |
||
2660 | sc system_colors |
||
2661 | |||
2662 | fileinfo: |
||
2663 | rb 200 ;4096*62+1024 |
||
2664 | |||
134 | diamond | 2665 | copyr_param rb 256 |
2666 | |||
31 | halyavin | 2667 | outinfo: |
134 | diamond | 2668 | rb 32+4096*304 |
31 | halyavin | 2669 | |
2670 | convinfo: |
||
134 | diamond | 2671 | rb 4096*27 |
2672 | ; stack |
||
2673 | align 4 |
||
2674 | rb 1024 |
||
31 | halyavin | 2675 | RAM_END: |