Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
31 | halyavin | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ; ; |
||
3 | ; MENUBAR for MenuetOS - Compile with fasm ; |
||
4 | ; ; |
||
5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
6 | |||
7 | use32 |
||
8 | org 0x0 |
||
9 | db 'MENUET01' ; 8 byte id |
||
10 | dd 0x01 ; required OS version |
||
11 | dd START ; program start |
||
12 | dd I_END ; program image size |
||
13 | dd 0xB000 ; reguired amount of memory - 64 Kb |
||
14 | dd 0xA000 ; esp |
||
15 | dd 0x0,0x0 ; param, icon |
||
16 | |||
17 | include 'lang.inc' |
||
18 | include 'macros.inc' |
||
19 | |||
20 | width dd 305 |
||
21 | buttons dd 1 ; 0 no frames ; 1 frames |
||
22 | soften_up dd 1 ; 0 no ; 1 yes |
||
23 | soften_down dd 0 ; 0 no ; 1 yes |
||
24 | minimize_left dd 1 |
||
25 | minimize_right dd 1 |
||
26 | icons_position dd 95 |
||
27 | menu_enable dd 1 |
||
28 | setup_enable dd 0 |
||
29 | graph_text dd 1 |
||
30 | soften_middle dd 1 ; 0 no ; 1 yes |
||
31 | icons dd 1 ; 0 defaults ; 1 activate |
||
32 | |||
33 | dat db 'PANEL DAT' |
||
34 | |||
35 | |||
36 | ;mainalive db 1 |
||
37 | |||
38 | ;correct_display: |
||
39 | ; mov eax,15 |
||
40 | ; mov ebx,3 |
||
41 | ; int 0x40 |
||
42 | ; mcall 5, 300 |
||
43 | ; jmp correct_display |
||
44 | |||
45 | chlangproc: |
||
46 | ; mcall 18, 7 |
||
47 | ; mov [my_process],eax |
||
48 | begin_2: |
||
49 | mcall 40,0b ; 0 |
||
50 | begin: |
||
51 | .begin: |
||
52 | mcall 5, eax |
||
53 | begin_3: |
||
54 | mcall 18, 7 |
||
55 | mov [active_process],eax |
||
56 | ; cmp [mainalive], 0 |
||
57 | ; je .exit |
||
58 | |||
59 | mcall 66, 3 |
||
60 | mov ah,al |
||
61 | and al,100000b |
||
62 | cmp al,100000b |
||
63 | je change_start_end |
||
64 | mov al,ah |
||
65 | and al,10000b |
||
66 | cmp al,10000b |
||
67 | je change_start_end |
||
68 | mov al,ah |
||
69 | and al,1000b |
||
70 | cmp al,1000b |
||
71 | je change_key_lang_1 |
||
72 | mov al,ah |
||
73 | and al,100b |
||
74 | cmp al,100b |
||
75 | je change_key_lang_1 |
||
76 | mov al,ah |
||
77 | and al,1111b |
||
78 | cmp al,11b |
||
79 | jne begin |
||
80 | mcall 19, file_sys, syslang |
||
81 | call syslang_music |
||
82 | ; mcall 5, 25 |
||
83 | begin_1: |
||
84 | mov ecx,[active_process] |
||
85 | mcall 18, 3 |
||
86 | mcall 5, 25 |
||
87 | jmp begin |
||
88 | change_key_lang_1: |
||
89 | mov al,ah |
||
90 | and al,11b |
||
91 | cmp al,01b |
||
92 | je change_key_lang |
||
93 | cmp al,10b |
||
94 | jne begin |
||
95 | change_key_lang: |
||
96 | mcall 19, file_sys, chlang |
||
97 | call chlang_music |
||
98 | ; mcall 5, 25 |
||
99 | jmp begin_1 |
||
100 | change_start_end: |
||
101 | mov al,ah |
||
102 | and al,1100b |
||
103 | cmp al,1000b |
||
104 | je start_end |
||
105 | cmp al,100b |
||
106 | jne start_menu |
||
107 | start_end: |
||
108 | ; mov ecx,[my_process] |
||
109 | ; mcall 18, 3 |
||
110 | mcall 18,12 |
||
111 | cmp al,1 |
||
112 | je scan_codes |
||
113 | cmp ah,255 |
||
114 | jne begin |
||
115 | start_end_application: |
||
116 | mcall 19,file_end,0 |
||
117 | mcall 5 ,50 |
||
118 | jmp begin |
||
119 | scan_codes: |
||
120 | cmp ah,88 |
||
121 | je start_end_application |
||
122 | jmp begin |
||
123 | start_menu: |
||
124 | mcall 18,12 |
||
125 | mov [button_presssed_alt],eax |
||
126 | ; mov ecx,eax |
||
127 | ; mcall 47,0x40100, ,10 shl 16+5,0 |
||
128 | ; mov eax,ecx |
||
129 | cmp al,1 |
||
130 | je scan_codes2 |
||
131 | cmp ah,72 ;232 |
||
132 | je start_menu_application |
||
133 | cmp ah,73 ;233 |
||
134 | je start_menu_application |
||
135 | cmp ah,0x35 ;b6 ;53 |
||
136 | je kill_active_application |
||
137 | cmp ah,0x9 |
||
138 | jne begin |
||
139 | jmp begin |
||
140 | |||
141 | kill_active_application: |
||
142 | mcall 18, 7 |
||
143 | mov ecx,eax |
||
144 | ; mcall 9, area9 |
||
145 | ; mov eax,area9 |
||
146 | ; mov ecx,[eax+4] |
||
147 | mcall 18, 2 |
||
148 | jmp begin |
||
149 | start_menu_application: |
||
150 | mcall 19,filename,0 |
||
151 | call menu_music |
||
152 | mcall 5,50 |
||
153 | jmp begin |
||
154 | scan_codes2: |
||
155 | cmp ah,91 |
||
156 | je start_menu_application |
||
157 | cmp ah,92 |
||
158 | je start_menu_application |
||
159 | cmp ah,83 ;62 |
||
160 | je kill_active_application |
||
161 | jmp begin |
||
162 | |||
163 | button_presssed_alt dd 0 |
||
164 | |||
165 | active_process dd 0 |
||
166 | my_process dd 0 |
||
167 | |||
168 | calendar_music: |
||
169 | mcall 55, eax, , , calendarmusic |
||
170 | ret |
||
171 | setup_music: |
||
172 | mcall 55,eax, , ,setupmusic |
||
173 | ret |
||
174 | sysmeter_music: |
||
175 | mcall 55,eax, , ,sysmetermusic |
||
176 | ret |
||
177 | button_music: |
||
178 | mcall 55,eax, , ,buttonmusic |
||
179 | ret |
||
180 | syslang_music: |
||
181 | mcall 55, eax, , , syslangmusic |
||
182 | ret |
||
183 | chlang_music: |
||
184 | mcall 55, eax, , , chlangmusic |
||
185 | ret |
||
186 | menu_music: |
||
187 | mcall 55,eax, , ,menumusic |
||
188 | ret |
||
189 | |||
190 | chlangmusic: db 0x82,0x60,0x83,0x65,0x82,0x60,0 |
||
191 | |||
192 | syslangmusic: db 0x82,0x65,0x83,0x70,0x82,0x65,0 |
||
193 | |||
194 | menumusic: db 0x82,0x50,0x84,0x48,0x82,0x50,0x84,0x53,0x82,0x51,0 |
||
195 | |||
196 | activatemusic: db 0x83,0x30,0x85,0x60,0 |
||
197 | |||
198 | buttonmusic: db 0x85,0x25,0x85,0x40,0 |
||
199 | |||
200 | sysmetermusic: db 0x85,0x35,0x85,0x45,0 |
||
201 | |||
202 | setupmusic: db 0x85,0x40,0x85,0x50,0 |
||
203 | |||
204 | calendarmusic: db 0x85,0x37,0x85,0x48,0 |
||
205 | |||
206 | ; .exit: mcall -1 |
||
207 | |||
208 | |||
209 | START: |
||
210 | mov eax, 6 |
||
211 | mov ebx, dat |
||
212 | mov ecx, 0 |
||
213 | mov edx, -1 |
||
214 | mov esi, I_END |
||
215 | int 0x40 |
||
216 | |||
217 | mov eax,40 |
||
218 | mov ebx,0101b |
||
219 | int 0x40 |
||
220 | |||
221 | mov edi,width |
||
222 | mov esi,I_END |
||
223 | mov eax,0 |
||
224 | new_number: |
||
225 | cmp [esi],byte ';' |
||
226 | je number_ready |
||
227 | imul eax,10 |
||
228 | movzx ebx,byte [esi] |
||
229 | sub ebx,'0' |
||
230 | add eax,ebx |
||
231 | inc esi |
||
232 | jmp new_number |
||
233 | number_ready: |
||
234 | mov [edi],eax |
||
235 | mov eax,0 |
||
236 | add edi,4 |
||
237 | inc esi |
||
238 | cmp [esi],byte 'x' |
||
239 | jne new_number |
||
240 | |||
241 | |||
242 | call set_variables |
||
243 | |||
244 | mcall 51, 1, chlangproc, 0xB000 |
||
245 | ; mcall 5, 5 |
||
246 | ; mcall 51, 1, correct_display, 0xA800 |
||
247 | |||
248 | start_after_minimize: |
||
249 | |||
250 | call draw_window |
||
251 | call draw_info |
||
252 | call draw_running_applications |
||
253 | |||
254 | mov eax, 23 |
||
255 | mov ebx, 30 |
||
256 | int 0x40 |
||
257 | |||
258 | still: |
||
259 | ; mcall 13,<390,70>,<3,11>,0xffffff |
||
260 | ; mov ecx,[button_presssed_alt] |
||
261 | ; mcall 47,0x80100,ecx ,400 shl 16+5,0 |
||
262 | |||
263 | call draw_info |
||
264 | call draw_running_applications |
||
265 | |||
266 | mov eax, 23 |
||
267 | mov ebx, 20 |
||
268 | int 0x40 |
||
269 | |||
270 | cmp eax,1 ; redraw ? |
||
271 | jz red |
||
272 | cmp eax,3 ; button ? |
||
273 | jz button |
||
274 | |||
275 | jmp still |
||
276 | |||
277 | red: ; redraw window |
||
278 | call draw_window |
||
279 | call draw_info |
||
280 | jmp still |
||
281 | |||
282 | button: ; button |
||
283 | mov eax,17 |
||
284 | int 0x40 |
||
285 | |||
286 | cmp ah,50 |
||
287 | jb no_activate |
||
288 | cmp ah,70 |
||
289 | jg no_activate |
||
290 | |||
291 | movzx ecx,byte ah |
||
292 | sub ecx,52 |
||
293 | shl ecx,2 |
||
294 | |||
295 | mov eax,18 |
||
296 | mov ebx,3 |
||
297 | mov ecx,[app_list+ecx] |
||
298 | int 0x40 |
||
299 | ; cmp [music_type],0 |
||
300 | ; je still |
||
301 | mcall 55,eax, , ,activatemusic |
||
302 | jmp still |
||
303 | no_activate: |
||
304 | |||
305 | |||
306 | cmp ah,101 ; minimize to left |
||
307 | je left_button |
||
308 | |||
309 | cmp ah,102 ; minimize to right |
||
310 | je right_button |
||
311 | |||
312 | cmp ah,byte 1 ; start/terminate menu |
||
313 | jnz noselect |
||
314 | call menu_handler |
||
315 | ; cmp [music_type],0 |
||
316 | ; je still |
||
317 | call menu_music |
||
318 | jmp still |
||
319 | noselect: |
||
320 | |||
321 | cmp ah,byte 2 ; start calendar |
||
322 | jnz noid15 ;noclock |
||
323 | mov eax, 19 |
||
324 | mov ebx, file6 |
||
325 | xor ecx, ecx |
||
326 | int 0x40 |
||
327 | call calendar_music |
||
328 | jmp still |
||
329 | ; noclock: |
||
330 | |||
331 | ; cmp ah,byte 11 ; start file 1 |
||
332 | ; jnz nob1 |
||
333 | ; mov eax,19 |
||
334 | ; mov ebx,file1 |
||
335 | ; int 0x40 |
||
336 | ; jmp still |
||
337 | ; nob1: |
||
338 | |||
339 | ; cmp ah,byte 12 ; start file 2 |
||
340 | ; jnz nob2 |
||
341 | ; mov eax,19 |
||
342 | ; mov ebx,file2 |
||
343 | ; int 0x40 |
||
344 | ; jmp still |
||
345 | ; nob2: |
||
346 | |||
347 | ; cmp ah,byte 13 ; start file 3 |
||
348 | ; jnz nob3 |
||
349 | ; mov eax,19 |
||
350 | ; mov ebx,file3 |
||
351 | ; int 0x40 |
||
352 | ; jmp still |
||
353 | ; nob3: |
||
354 | |||
355 | ; cmp ah,14 ; start file 4 |
||
356 | ; jne noid14 |
||
357 | ; mov eax,19 |
||
358 | ; mov ebx,file4 |
||
359 | ; mov ecx,file4_par |
||
360 | ; int 0x40 |
||
361 | ; jmp still |
||
362 | ; noid14: |
||
363 | |||
364 | ; cmp ah,15 ; start file 5 |
||
365 | ; jne noid15 |
||
366 | ; mov eax,19 |
||
367 | ; mov ebx,file5 |
||
368 | ; int 0x40 |
||
369 | ; jmp still |
||
370 | |||
371 | noid15: |
||
372 | cmp ah,16 |
||
373 | jne noid16 |
||
374 | mcall 19, file_sys, chlang |
||
375 | call chlang_music |
||
376 | mcall 5, 25 |
||
377 | jmp still |
||
378 | |||
379 | noid16: |
||
380 | cmp ah,17 |
||
381 | jne noid17 |
||
382 | mcall 19, file_sys, syslang |
||
383 | call syslang_music |
||
384 | mcall 5, 25 |
||
385 | jmp still |
||
386 | |||
387 | noid17: |
||
388 | cmp ah,18 |
||
389 | jne noid18 |
||
390 | mcall 19, sysmeter, 0 |
||
391 | call sysmeter_music |
||
392 | jmp still |
||
393 | |||
394 | noid18: |
||
395 | cmp ah,19 |
||
396 | jne noid19 |
||
397 | ; inc [music_type] |
||
398 | ; and [music_type],1 |
||
399 | mcall 18,8,2 |
||
400 | ; mcall 18,8 |
||
401 | ; mov [sound_flag],al |
||
402 | |||
403 | ; mcall 15,4,2 |
||
404 | mcall 15,3 |
||
405 | jmp red |
||
406 | |||
407 | noid19: |
||
408 | cmp ah,20 ; start system setup |
||
409 | jnz noid20 |
||
410 | mov eax, 19 |
||
411 | mov ebx, file_sys |
||
412 | xor ecx, ecx |
||
413 | int 0x40 |
||
414 | call setup_music |
||
415 | |||
416 | noid20: |
||
417 | |||
418 | jmp still |
||
419 | |||
420 | |||
421 | |||
422 | draw_running_applications: |
||
423 | |||
424 | pusha |
||
425 | |||
426 | cmp [icons],1 |
||
427 | jne dr_ret |
||
428 | |||
429 | call calculate_applications |
||
430 | |||
431 | cmp edi,[running_applications] |
||
432 | jne noret |
||
433 | popa |
||
434 | ret |
||
435 | noret: |
||
436 | |||
437 | ; cmp edi,[running_applications] |
||
438 | ; jge no_application_decrease |
||
439 | call draw_window |
||
440 | ; no_application_decrease: |
||
441 | |||
442 | mov [running_applications],edi |
||
443 | |||
444 | mov edi,0 |
||
445 | mov ecx,2 |
||
446 | mov [contrast],0 |
||
447 | |||
448 | newpr: |
||
449 | |||
450 | mov eax,9 |
||
451 | mov ebx,0x8000 |
||
452 | int 0x40 |
||
453 | |||
454 | push eax |
||
455 | push ecx |
||
456 | |||
457 | cmp eax,ecx |
||
458 | jb norpl2 |
||
459 | |||
460 | cmp byte [0x8000+10], '@' |
||
461 | je norpl |
||
462 | cmp [0x8000+11],dword 'CON ' |
||
463 | je norpl |
||
464 | cmp [0x8000+11],dword 'ENU ' |
||
465 | je norpl |
||
466 | ; cmp [0x8000+12],dword 'NEL ' |
||
467 | ; je norpl |
||
468 | cmp [0x8000+10],dword ' ' |
||
469 | je norpl |
||
470 | |||
471 | mov eax,13 |
||
472 | mov ebx,edi |
||
473 | inc ebx |
||
474 | shl ebx,16 |
||
475 | imul ebx,6*10 |
||
476 | add ebx,17 shl 16+54 |
||
477 | mov ecx,3 shl 16+14 |
||
478 | xor edx,edx |
||
479 | sub ebx,10 shl 16 |
||
480 | int 0x40 |
||
481 | |||
482 | sub ebx,1 shl 16 |
||
483 | mov bx,1 |
||
484 | mov ecx,4 shl 16+12 |
||
485 | int 0x40 |
||
486 | |||
487 | sub ebx,1 shl 16 |
||
488 | mov ecx,5 shl 16+10 |
||
489 | int 0x40 |
||
490 | |||
491 | add ebx,56 shl 16 |
||
492 | mov ecx,4 shl 16+12 |
||
493 | int 0x40 |
||
494 | |||
495 | add ebx,1 shl 16 |
||
496 | mov ecx,5 shl 16+10 |
||
497 | int 0x40 |
||
498 | |||
499 | inc [contrast] |
||
500 | and [contrast],1 |
||
501 | cmp [contrast],1 |
||
502 | je contrast1 |
||
503 | mov edx,0x88ff |
||
504 | jmp contrast2 |
||
505 | contrast1: |
||
506 | mov edx,0x55ff |
||
507 | contrast2: |
||
508 | sub ebx,55 shl 16 |
||
509 | mov bx,54 |
||
510 | mov ecx,4 shl 16+12 |
||
511 | ; mov edx,0x66ff |
||
512 | int 0x40 |
||
513 | |||
514 | sub ebx,1 shl 16 |
||
515 | mov bx,1 |
||
516 | mov ecx,5 shl 16+10 |
||
517 | int 0x40 |
||
518 | |||
519 | add ebx,55 shl 16 |
||
520 | int 0x40 |
||
521 | |||
522 | mov eax,4 |
||
523 | mov ebx,edi |
||
524 | inc ebx |
||
525 | shl ebx,16 |
||
526 | imul ebx,6*10 ;13 |
||
527 | add ebx,20*65536+7 |
||
528 | mov ecx,0xffffff ;[wcolor] |
||
529 | ; add ecx,0x303030 |
||
530 | mov edx,0x8000+10 |
||
531 | mov esi,11 |
||
532 | sub ebx,10 shl 16 |
||
533 | int 0x40 |
||
534 | |||
535 | norpl2: |
||
536 | |||
537 | inc edi |
||
538 | |||
539 | norpl: |
||
540 | |||
541 | pop ecx |
||
542 | pop eax |
||
543 | |||
544 | inc ecx |
||
545 | |||
546 | cmp edi,[max_applications] |
||
547 | jb newpr |
||
548 | |||
549 | nompr: |
||
550 | |||
551 | dr_ret: |
||
552 | |||
553 | popa |
||
554 | |||
555 | ret |
||
556 | |||
557 | |||
558 | calculate_applications: |
||
559 | |||
560 | mov edi,app_list |
||
561 | mov ecx,20 |
||
562 | mov eax,0xff |
||
563 | cld |
||
564 | rep stosd |
||
565 | |||
566 | mov edi,0 |
||
567 | mov ecx,2 |
||
568 | |||
569 | cnewpr: |
||
570 | |||
571 | mov eax,9 |
||
572 | mov ebx,0x8000 |
||
573 | int 0x40 |
||
574 | |||
575 | cmp byte [0x8000+10], '@' |
||
576 | je cnorpl |
||
577 | cmp [0x8000+11],dword 'CON ' |
||
578 | je cnorpl |
||
579 | cmp [0x8000+11],dword 'ENU ' |
||
580 | je cnorpl |
||
581 | ; cmp [0x8000+12],dword 'NEL ' |
||
582 | ; je cnorpl |
||
583 | cmp [0x8000+10],dword ' ' |
||
584 | je cnorpl |
||
585 | |||
586 | mov [app_list+edi*4],ecx |
||
587 | |||
588 | inc edi |
||
589 | |||
590 | cnorpl: |
||
591 | inc ecx |
||
592 | |||
593 | cmp eax,ecx |
||
594 | jge cnewpr |
||
595 | |||
596 | ret |
||
597 | |||
598 | |||
599 | draw_application_buttons: |
||
600 | |||
601 | pusha |
||
602 | |||
603 | cmp [icons],1 |
||
604 | jne da_ret |
||
605 | |||
606 | mov eax,14 |
||
607 | int 0x40 |
||
608 | |||
609 | shr eax,16 |
||
610 | |||
611 | cmp eax,639 |
||
612 | jne now1 |
||
613 | mov [max_applications],7 ;6 |
||
614 | now1: |
||
615 | cmp eax,799 |
||
616 | jne now2 |
||
617 | mov [max_applications],10 ;8 |
||
618 | now2: |
||
619 | cmp eax,1023 |
||
620 | jne now3 |
||
621 | mov [max_applications],13 ;8 |
||
622 | now3: |
||
623 | cmp eax,1279 |
||
624 | jne now4 |
||
625 | mov [max_applications],18 ;8 |
||
626 | now4: |
||
627 | mov edi,1 |
||
628 | |||
629 | nb: |
||
630 | |||
631 | mov eax,8 |
||
632 | mov ebx,edi |
||
633 | shl ebx,16 |
||
634 | imul ebx,6*10 ;13 |
||
635 | add ebx,15*65536+10*6-1 ;13 |
||
636 | mov ecx,1*65536+17 |
||
637 | mov edx,edi |
||
638 | add edx,51 |
||
639 | cmp [buttons],1 |
||
640 | je bufr |
||
641 | or edx,0x60000000 |
||
642 | bufr: |
||
643 | mov esi,[wcolor] |
||
644 | sub ebx,11 shl 16 |
||
645 | int 0x40 |
||
646 | |||
647 | inc edi |
||
648 | cmp edi,[max_applications] |
||
649 | jbe nb |
||
650 | |||
651 | da_ret: |
||
652 | |||
653 | popa |
||
654 | |||
655 | ret |
||
656 | |||
657 | |||
658 | menu_handler: |
||
659 | mov eax, 19 |
||
660 | mov ebx, filename |
||
661 | xor ecx, ecx |
||
662 | int 0x40 |
||
663 | ret |
||
664 | |||
665 | draw_small_right: |
||
666 | |||
667 | pusha |
||
668 | |||
669 | mov eax,12 |
||
670 | mov ebx,1 |
||
671 | int 0x40 |
||
672 | |||
673 | mov eax,0 |
||
674 | mov edx,[wcolor] |
||
675 | mov esi,edx |
||
676 | mov edi,edx |
||
677 | or edx, 0x01000000 |
||
678 | int 0x40 |
||
679 | |||
680 | mov eax,8 |
||
681 | mov ebx,0*65536+9 |
||
682 | mov ecx,0*65536 |
||
683 | mov cx,[b_size_y] |
||
684 | mov edx,1 |
||
685 | mov esi,[wcolor] |
||
686 | int 0x40 |
||
687 | |||
688 | mov eax,4 |
||
689 | mov ebx,2*65536+16 |
||
690 | cmp [graph_text],1 |
||
691 | jne nos3 |
||
692 | mov ebx,2*65536+7 |
||
693 | nos3: |
||
694 | mov ecx,[wcolor] |
||
695 | add ecx,0x303030 |
||
696 | mov edx,hidetext |
||
697 | mov esi,1 |
||
698 | int 0x40 |
||
699 | |||
700 | mov eax,12 |
||
701 | mov ebx,2 |
||
702 | int 0x40 |
||
703 | |||
704 | popa |
||
705 | |||
706 | ret |
||
707 | |||
708 | |||
709 | |||
710 | draw_small_left: |
||
711 | |||
712 | pusha |
||
713 | |||
714 | mov eax,12 |
||
715 | mov ebx,1 |
||
716 | int 0x40 |
||
717 | |||
718 | mov eax,0 |
||
719 | mov edx,[wcolor] |
||
720 | mov esi,edx |
||
721 | mov edi,edx |
||
722 | or edx, 0x01000000 |
||
723 | int 0x40 |
||
724 | |||
725 | cmp [graph_text],1 |
||
726 | je nos4 |
||
727 | |||
728 | mov eax,8 |
||
729 | mov ebx,0*65536+9 |
||
730 | mov ecx,0*65536+18-6 |
||
731 | mov edx,2 |
||
732 | mov esi,[wcolor] |
||
733 | int 0x40 |
||
734 | |||
735 | mov eax,4 |
||
736 | mov ebx,2*65536+4 |
||
737 | mov ecx,[wcolor] |
||
738 | add ecx,0x303030 |
||
739 | mov edx,hidetext+2 |
||
740 | mov esi,1 |
||
741 | int 0x40 |
||
742 | |||
743 | nos4: |
||
744 | |||
745 | mov eax,8 |
||
746 | mov ebx,0*65536+9 |
||
747 | mov ecx,13*65536+25 |
||
748 | cmp [graph_text],1 |
||
749 | jne nos6 |
||
750 | mov ecx,0*65536 |
||
751 | mov cx,word [b_size_y] |
||
752 | nos6: |
||
753 | mov edx,1 |
||
754 | mov esi,[wcolor] |
||
755 | int 0x40 |
||
756 | |||
757 | mov eax,4 |
||
758 | mov ebx,3*65536+22 |
||
759 | cmp [graph_text],1 |
||
760 | jne nos7 |
||
761 | mov ebx,3*65536+7 |
||
762 | nos7: |
||
763 | mov ecx,[wcolor] |
||
764 | add ecx,0x303030 |
||
765 | mov edx,hidetext+1 |
||
766 | mov esi,1 |
||
767 | int 0x40 |
||
768 | |||
769 | mov eax,12 |
||
770 | mov ebx,2 |
||
771 | int 0x40 |
||
772 | |||
773 | popa |
||
774 | ret |
||
775 | |||
776 | |||
777 | ;------------------------------------------------- |
||
778 | |||
779 | right_button: |
||
780 | |||
781 | call button_music |
||
782 | |||
783 | mov [small_draw],dword draw_small_right |
||
784 | |||
785 | mcall 14 |
||
786 | shr eax, 16 |
||
787 | mov ebx, eax |
||
788 | mov ecx, -1 |
||
789 | mov edx, 9 |
||
790 | sub ebx, edx |
||
791 | mov esi, -1 |
||
792 | mcall 67 |
||
793 | |||
794 | call draw_small_right |
||
795 | |||
796 | mov eax, 23 |
||
797 | mov ebx, 30 |
||
798 | int 0x40 |
||
799 | |||
800 | jmp small_wait |
||
801 | |||
802 | ;------------------------------------------------- |
||
803 | |||
804 | left_button: |
||
805 | |||
806 | call button_music |
||
807 | |||
808 | mov [small_draw],dword draw_small_left |
||
809 | |||
810 | mov ebx, 0 |
||
811 | mov edx, 9 |
||
812 | mov ecx, -1 |
||
813 | mov esi, -1 |
||
814 | mcall 67 |
||
815 | |||
816 | call draw_small_left |
||
817 | |||
818 | mov eax, 23 |
||
819 | mov ebx, 30 |
||
820 | int 0x40 |
||
821 | |||
822 | ;------------------------------------------------- |
||
823 | |||
824 | small_wait: |
||
825 | |||
826 | mov eax, 10 |
||
827 | int 0x40 |
||
828 | |||
829 | cmp eax,1 |
||
830 | jne no_win |
||
831 | call [small_draw] |
||
832 | jmp small_wait |
||
833 | no_win: |
||
834 | |||
835 | mov eax,17 |
||
836 | int 0x40 |
||
837 | |||
838 | cmp ah,1 |
||
839 | jne no_full |
||
840 | |||
841 | mov eax, 14 ; get screen max x & max y |
||
842 | int 0x40 |
||
843 | mov edx, eax |
||
844 | shr edx, 16 |
||
845 | mov ebx, -1 |
||
846 | mov ecx, -1 |
||
847 | mov esi, -1 |
||
848 | mcall 67 ; x0 y0 xs ys |
||
849 | |||
850 | call button_music |
||
851 | |||
852 | jmp still |
||
853 | |||
854 | |||
855 | no_full: |
||
856 | |||
857 | call menu_handler |
||
858 | |||
859 | jmp small_wait |
||
860 | |||
861 | |||
862 | |||
863 | set_variables: |
||
864 | |||
865 | pusha |
||
866 | |||
867 | mov [b_size_y],dword 38 |
||
868 | cmp [graph_text],1 |
||
869 | jne noy2 |
||
870 | mov [b_size_y],dword 18 |
||
871 | noy2: |
||
872 | |||
873 | mov [button_frames],0x0 |
||
874 | cmp [buttons],0 |
||
875 | jne no_frames |
||
876 | mov [button_frames],0x40000000 |
||
877 | no_frames: |
||
878 | |||
879 | |||
880 | mov eax,48 ; 3d button look |
||
881 | mov ebx,1 |
||
882 | mov ecx,1 |
||
883 | int 0x40 |
||
884 | |||
885 | mov eax,0x40404040 ; dividers for processes |
||
886 | mov edi,pros |
||
887 | mov ecx,10 |
||
888 | cld |
||
889 | rep stosd |
||
890 | |||
891 | popa |
||
892 | ret |
||
893 | |||
894 | |||
895 | |||
896 | ; eax = number (1 or 2) |
||
897 | ; ebx = language id |
||
898 | draw_flag: |
||
899 | pusha |
||
900 | |||
901 | ; cmp [graph_text],0 |
||
902 | ; je mini_flag |
||
903 | |||
904 | ; eax = 2 BIG |
||
905 | ; eax = 1 small |
||
906 | |||
907 | mov edx,ebx |
||
908 | |||
909 | mov ebx,[maxx] |
||
910 | and eax,1 |
||
911 | imul eax,17 ;17 |
||
912 | sub ebx,eax |
||
913 | sub ebx,76 ;79 ;28 |
||
914 | |||
915 | pushad |
||
916 | ; dec ebx |
||
917 | sub ebx,2 |
||
918 | shl ebx, 16 |
||
919 | add ebx, 15 ;25 |
||
920 | mov ecx, 4*65536+13 |
||
921 | mov edx,0 |
||
922 | mov eax,13 |
||
923 | int 0x40 |
||
924 | add ebx,1 shl 16 |
||
925 | sub ebx,2 |
||
926 | mov ecx, 5 shl 16+11 |
||
927 | cmp [type_lang],1 |
||
928 | je label_1 |
||
929 | mov edx,0xff ;[wcolor] |
||
930 | jmp label_2 |
||
931 | label_1: |
||
932 | mov edx,0x7700 |
||
933 | label_2: |
||
934 | mov eax, 13 |
||
935 | int 0x40 |
||
936 | popad |
||
937 | |||
938 | shl ebx,16 |
||
939 | add ebx,7 ;24 |
||
940 | |||
941 | mov ecx,[bte] ; color |
||
942 | |||
943 | dec edx |
||
944 | shl edx,1 |
||
945 | add edx,flag_text |
||
946 | mov esi,2 |
||
947 | mov eax,4 |
||
948 | int 0x40 |
||
949 | |||
950 | mov ebx,[maxx] |
||
951 | sub ebx,48 |
||
952 | shl ebx,16 |
||
953 | mov bx,34 |
||
954 | mov ecx,3 shl 16+14 |
||
955 | xor edx,edx |
||
956 | mov eax,13 |
||
957 | int 0x40 |
||
958 | add ebx,1 shl 16 |
||
959 | sub ebx,2 |
||
960 | mov ecx,4 shl 16+12 |
||
961 | mov edx,0x66cc |
||
962 | int 0x40 |
||
963 | |||
964 | popa |
||
965 | ret |
||
966 | |||
967 | ;mini_flag: |
||
968 | ; popa |
||
969 | ; ret |
||
970 | |||
971 | |||
972 | |||
973 | |||
974 | ; *************************************************** |
||
975 | ; ********* WINDOW DEFINITIONS AND DRAW ************* |
||
976 | ; *************************************************** |
||
977 | |||
978 | |||
979 | draw_window: |
||
980 | |||
981 | pusha |
||
982 | |||
983 | mov [running_applications],-1 |
||
984 | mov [checks],-1 |
||
985 | |||
986 | mov eax, 12 ; tell os about redraw |
||
987 | mov ebx, 1 |
||
988 | int 0x40 |
||
989 | |||
990 | mov eax, 48 |
||
991 | mov ebx, 3 |
||
992 | mov ecx, system_colours |
||
993 | mov edx, 10*4 |
||
994 | int 0x40 |
||
995 | |||
996 | mov eax, [system_colours+4*6] |
||
997 | mov [wcolor], eax |
||
998 | |||
999 | mov eax,14 ; get screen max x & max y |
||
1000 | int 0x40 |
||
1001 | |||
1002 | cmp [width],0 |
||
1003 | je no_def_width |
||
1004 | and eax,0xffff |
||
1005 | mov ebx,[width] |
||
1006 | shl ebx,16 |
||
1007 | add eax,ebx |
||
1008 | no_def_width: |
||
1009 | |||
1010 | mov ebx,eax |
||
1011 | mov [screenxy],ebx |
||
1012 | shr ebx,16 |
||
1013 | sub ax,38 |
||
1014 | shl eax,16 |
||
1015 | mov ecx,eax |
||
1016 | add ecx,0*65536+38 |
||
1017 | cmp [graph_text],1 |
||
1018 | jne no_text_1 |
||
1019 | mov cx,18 |
||
1020 | add ecx,20*65536 |
||
1021 | no_text_1: |
||
1022 | mov eax, 0 ; DEFINE AND DRAW WINDOW |
||
1023 | mov edx, [wcolor] |
||
1024 | or edx, 0x01000000 ; do not draw the window |
||
1025 | mov esi, [wcolor] |
||
1026 | or esi, 0x01000000 ; unmovable window |
||
1027 | mov edi, [wcolor] |
||
1028 | int 0x40 |
||
1029 | |||
1030 | movzx ebx,word [screenxy+2] |
||
1031 | mov ecx,0*65536+0 |
||
1032 | mov edx,[wcolor] |
||
1033 | add edx,0x161616 |
||
1034 | newline: |
||
1035 | sub edx,0x040404 |
||
1036 | mov eax,38 |
||
1037 | cmp [soften_up],1 |
||
1038 | jne no_su |
||
1039 | int 0x40 |
||
1040 | no_su: |
||
1041 | |||
1042 | pusha |
||
1043 | cmp [soften_down],1 |
||
1044 | jne no_sd |
||
1045 | sub edx,0x141414 |
||
1046 | mov edi,[b_size_y] |
||
1047 | shl edi,16 |
||
1048 | add edi,[b_size_y] |
||
1049 | add ecx,edi |
||
1050 | sub ecx,3*65536+3 |
||
1051 | int 0x40 |
||
1052 | no_sd: |
||
1053 | popa |
||
1054 | |||
1055 | add ecx,1*65536+1 |
||
1056 | cmp cx,5 |
||
1057 | jb newline |
||
1058 | |||
1059 | cmp [soften_middle],1 |
||
1060 | jne no_sm |
||
1061 | |||
1062 | movzx ebx,word [screenxy+2] |
||
1063 | mov ecx,5*65536+5 |
||
1064 | mov esi,stripe |
||
1065 | mov edx,[wcolor] |
||
1066 | newline3: |
||
1067 | add edx,[esi] |
||
1068 | add esi,4 |
||
1069 | |||
1070 | mov eax,38 |
||
1071 | int 0x40 |
||
1072 | add ecx,1*65536+1 |
||
1073 | cmp cx,15 |
||
1074 | jb newline3 |
||
1075 | |||
1076 | no_sm: |
||
1077 | |||
1078 | cmp [minimize_left],1 |
||
1079 | jne no_mleft |
||
1080 | mov eax,8 ; ABS LEFT |
||
1081 | mov ebx,0 *65536+9 |
||
1082 | mov ecx,1 *65536 |
||
1083 | add ecx,[b_size_y] |
||
1084 | dec ecx |
||
1085 | mov edx,101 |
||
1086 | add edx,[button_frames] |
||
1087 | mov esi,[wcolor] |
||
1088 | int 0x40 |
||
1089 | mov eax,4 ; HIDE TEXT |
||
1090 | mov ebx,2*65536+17 |
||
1091 | cmp [graph_text],1 |
||
1092 | jne no_y1 |
||
1093 | mov bx,7 |
||
1094 | no_y1: |
||
1095 | mov ecx,[wcolor] |
||
1096 | add ecx,0x303030 |
||
1097 | mov edx,hidetext |
||
1098 | mov esi,1 |
||
1099 | int 0x40 |
||
1100 | no_mleft: |
||
1101 | |||
1102 | movzx eax,word [screenxy+2] |
||
1103 | mov [maxx],eax |
||
1104 | |||
1105 | cmp [minimize_right],1 |
||
1106 | jne no_mright |
||
1107 | mov eax,[maxx] |
||
1108 | sub eax,77 |
||
1109 | shl eax,16 |
||
1110 | mov ebx,eax |
||
1111 | add ebx,67 |
||
1112 | mov eax,8 ; ABS RIGHT |
||
1113 | mov ecx,1 *65536 |
||
1114 | add ecx,[b_size_y] |
||
1115 | dec ecx |
||
1116 | add ebx,68*65536 |
||
1117 | mov bx,9 |
||
1118 | mov edx,102 |
||
1119 | add edx,[button_frames] |
||
1120 | mov esi,[wcolor] |
||
1121 | int 0x40 |
||
1122 | mov edx,hidetext+1 |
||
1123 | mov eax,4 |
||
1124 | mov ebx,[maxx] |
||
1125 | sub ebx,6 |
||
1126 | shl ebx,16 |
||
1127 | mov bx,17 |
||
1128 | cmp [graph_text],1 |
||
1129 | jne no_y2 |
||
1130 | mov bx,7 |
||
1131 | no_y2: |
||
1132 | mov ecx,[wcolor] |
||
1133 | add ecx,0x303030 |
||
1134 | mov esi,1 |
||
1135 | int 0x40 |
||
1136 | no_mright: |
||
1137 | |||
1138 | call draw_menuet_icon |
||
1139 | |||
1140 | call draw_program_icons |
||
1141 | |||
1142 | mov [ptime],0 |
||
1143 | call draw_info |
||
1144 | |||
1145 | call draw_application_buttons |
||
1146 | |||
1147 | ; mov ecx,[button_presssed_alt] |
||
1148 | ; mcall 47,0x80100,ecx ,400 shl 16+5,0 |
||
1149 | |||
1150 | mov eax,12 |
||
1151 | mov ebx,2 |
||
1152 | int 0x40 |
||
1153 | |||
1154 | popa |
||
1155 | ret |
||
1156 | |||
1157 | |||
1158 | |||
1159 | draw_menuet_icon: |
||
1160 | |||
1161 | pusha |
||
1162 | |||
1163 | cmp [menu_enable],1 |
||
1164 | jne no_menu |
||
1165 | |||
1166 | |||
1167 | mov eax, 8 ; M BUTTON |
||
1168 | mov ebx, 10*65536 + 47 |
||
1169 | cmp [minimize_left], 0 |
||
1170 | jne @f |
||
1171 | sub ebx, 10*65536 |
||
1172 | @@: |
||
1173 | mov ecx, 1*65536 |
||
1174 | add ecx, [b_size_y] |
||
1175 | dec ecx |
||
1176 | mov edx, 0x20000001 |
||
1177 | add edx, [button_frames] |
||
1178 | mov esi, [wcolor] |
||
1179 | int 0x40 |
||
1180 | |||
1181 | cmp [graph_text], 1 |
||
1182 | jne no_mtext |
||
1183 | |||
1184 | push ebx |
||
1185 | mov eax,13 |
||
1186 | mov ebx,12 shl 16+44 ;51 |
||
1187 | mov ecx,1 shl 16+17 |
||
1188 | xor edx,edx |
||
1189 | int 0x40 |
||
1190 | ; mov ebx,63 shl 16+1 |
||
1191 | mov ebx,56 shl 16+1 |
||
1192 | mov ecx,2 shl 16+15 |
||
1193 | int 0x40 |
||
1194 | mov ebx,57 shl 16+1 |
||
1195 | mov ecx,4 shl 16+11 |
||
1196 | int 0x40 |
||
1197 | mov ebx,58 shl 16+1 |
||
1198 | mov ecx,6 shl 16+7 |
||
1199 | int 0x40 |
||
1200 | ; mov ebx,66 shl 16+1 |
||
1201 | ; mov ecx,9 shl 16+1 |
||
1202 | ; int 0x40 |
||
1203 | mov ebx,13 shl 16+43 ;50 |
||
1204 | mov ecx,2 shl 16+15 |
||
1205 | mov edx,0x7700 |
||
1206 | int 0x40 |
||
1207 | ; mov ebx,62 shl 16+1 |
||
1208 | ; mov ecx,3 shl 16+14 |
||
1209 | ; int 0x40 |
||
1210 | mov ebx,56 shl 16+1 |
||
1211 | mov ecx,4 shl 16+11 |
||
1212 | int 0x40 |
||
1213 | mov ebx,57 shl 16+1 |
||
1214 | mov ecx,6 shl 16+7 |
||
1215 | int 0x40 |
||
1216 | pop ebx |
||
1217 | |||
1218 | mov eax, 4 |
||
1219 | mov bx, 7 |
||
1220 | add ebx, 8*65536 |
||
1221 | mov ecx, 0x10ffffff |
||
1222 | mov edx, m_text |
||
1223 | mov esi, 4 |
||
1224 | int 0x40 |
||
1225 | |||
1226 | popa |
||
1227 | ret |
||
1228 | |||
1229 | no_mtext: |
||
1230 | |||
1231 | |||
1232 | |||
1233 | mov eax,[wcolor] |
||
1234 | mov [m_icon+4],eax |
||
1235 | |||
1236 | mov eax,6 ; load file |
||
1237 | mov ebx,m_bmp |
||
1238 | mov ecx,0 |
||
1239 | mov edx,200000 |
||
1240 | mov esi,image |
||
1241 | mov edi,0 |
||
1242 | int 0x40 |
||
1243 | |||
1244 | mov eax,40 |
||
1245 | mov ebx,0 |
||
1246 | mov edi,image+53 |
||
1247 | |||
1248 | new_m_pix: |
||
1249 | |||
1250 | ; movzx ecx,byte [edi] |
||
1251 | ; shr ecx,5 |
||
1252 | |||
1253 | mov cl,[edi] |
||
1254 | cmp cl,10 |
||
1255 | jb nopix |
||
1256 | mov cl,[edi+1] |
||
1257 | cmp cl,10 |
||
1258 | jb nopix |
||
1259 | mov cl,[edi+2] |
||
1260 | cmp cl,10 |
||
1261 | jb nopix |
||
1262 | |||
1263 | pusha |
||
1264 | cmp [minimize_left],0 |
||
1265 | jne no_m_s2 |
||
1266 | sub ebx,10 |
||
1267 | no_m_s2: |
||
1268 | ; mov edx,[ecx*4+m_icon] |
||
1269 | mov edx,[edi+1] |
||
1270 | |||
1271 | mov ecx,eax |
||
1272 | mov eax,1 |
||
1273 | add ebx,12 |
||
1274 | int 0x40 |
||
1275 | popa |
||
1276 | |||
1277 | nopix: |
||
1278 | |||
1279 | add edi,3 |
||
1280 | add ebx,1 |
||
1281 | cmp ebx,40 |
||
1282 | jnz new_m_pix |
||
1283 | |||
1284 | mov ebx,0 |
||
1285 | dec eax |
||
1286 | jnz new_m_pix |
||
1287 | |||
1288 | no_menu: |
||
1289 | |||
1290 | popa |
||
1291 | ret |
||
1292 | |||
1293 | |||
1294 | draw_program_icons: |
||
1295 | |||
1296 | pusha |
||
1297 | |||
1298 | cmp [icons],0 |
||
1299 | jne dp_ret |
||
1300 | |||
1301 | mov edi,1 |
||
1302 | push edi |
||
1303 | |||
1304 | new_icon_file: |
||
1305 | |||
1306 | pusha |
||
1307 | mov edx,[esp+32] |
||
1308 | add edx,10 |
||
1309 | push edx |
||
1310 | mov esi,[wcolor] |
||
1311 | mov ecx,1*65536 |
||
1312 | add ecx,[b_size_y] |
||
1313 | dec ecx |
||
1314 | mov eax,edi |
||
1315 | dec eax |
||
1316 | imul eax,40 |
||
1317 | mov ebx,eax |
||
1318 | add ebx,[icons_position] |
||
1319 | shl ebx,16 |
||
1320 | mov bx,39 |
||
1321 | pop edx |
||
1322 | add edx,[button_frames] |
||
1323 | or edx, 0x20000000 |
||
1324 | mov eax,8 |
||
1325 | int 0x40 |
||
1326 | popa |
||
1327 | |||
1328 | mov ecx,[esp] |
||
1329 | add ecx,48 |
||
1330 | mov [iconf+6],cl |
||
1331 | |||
1332 | mov eax,6 ; load file |
||
1333 | mov ebx,iconf |
||
1334 | mov ecx,0 |
||
1335 | mov edx,200000 |
||
1336 | mov esi,image |
||
1337 | int 0x40 |
||
1338 | |||
1339 | mov eax,0 |
||
1340 | mov ebx,32 |
||
1341 | mov edi,image+51+32*33*3 |
||
1342 | |||
1343 | np2: ; new pixel of file |
||
1344 | |||
1345 | mov edx,[edi] |
||
1346 | and edx,0xffffff |
||
1347 | |||
1348 | cmp eax,3 ; Y draw limits |
||
1349 | jb nopix2 |
||
1350 | cmp eax,36 |
||
1351 | jg nopix2 |
||
1352 | cmp ebx,38 ; X draw limits |
||
1353 | jg nopix2 |
||
1354 | cmp ebx,2 |
||
1355 | jb nopix2 |
||
1356 | |||
1357 | cmp edx,0 |
||
1358 | jz nopix2 |
||
1359 | |||
1360 | cmp [graph_text],1 |
||
1361 | jne no_icon_text |
||
1362 | |||
1363 | pusha |
||
1364 | |||
1365 | mov ebx,[esp+32] |
||
1366 | dec ebx |
||
1367 | imul ebx,40 |
||
1368 | add ebx,8 |
||
1369 | add ebx,[icons_position] |
||
1370 | shl ebx,16 |
||
1371 | mov bx,7 |
||
1372 | |||
1373 | mov eax,4 |
||
1374 | mov ecx,0xffffff |
||
1375 | mov edx,[esp+32] |
||
1376 | dec edx |
||
1377 | imul edx,4 |
||
1378 | add edx,mi_text |
||
1379 | mov esi,4 |
||
1380 | int 0x40 |
||
1381 | |||
1382 | popa |
||
1383 | |||
1384 | jmp nopix2 |
||
1385 | |||
1386 | no_icon_text: |
||
1387 | |||
1388 | mov esi,[esp] |
||
1389 | pusha |
||
1390 | push edx |
||
1391 | mov ecx,eax |
||
1392 | add ecx,2 |
||
1393 | mov eax,esi |
||
1394 | dec eax |
||
1395 | imul eax,40 |
||
1396 | add ebx,eax |
||
1397 | add ebx,3 |
||
1398 | add ebx,[icons_position] |
||
1399 | pop edx |
||
1400 | mov eax,1 |
||
1401 | int 0x40 |
||
1402 | popa |
||
1403 | |||
1404 | nopix2: |
||
1405 | |||
1406 | sub edi,3 |
||
1407 | dec ebx |
||
1408 | jnz np2 |
||
1409 | |||
1410 | mov ebx,32 |
||
1411 | add eax,1 |
||
1412 | cmp eax,32 |
||
1413 | jnz np2 |
||
1414 | |||
1415 | add dword [esp],1 |
||
1416 | mov edi,[esp] |
||
1417 | cmp dword [esp],4 |
||
1418 | jbe new_icon_file |
||
1419 | add esp,4 |
||
1420 | |||
1421 | mov eax,4 |
||
1422 | mov ebx,40 |
||
1423 | imul ebx,3 |
||
1424 | add ebx,[icons_position] |
||
1425 | add ebx,10 |
||
1426 | shl ebx,16 |
||
1427 | mov bx,23 |
||
1428 | mov ecx,[wcolor] |
||
1429 | mov edx,gpl |
||
1430 | mov esi,3 |
||
1431 | int 0x40 |
||
1432 | |||
1433 | dp_ret: |
||
1434 | |||
1435 | popa |
||
1436 | ret |
||
1437 | |||
1438 | |||
1439 | |||
1440 | draw_info: ; draw cpu usage, time, date |
||
1441 | |||
1442 | pusha |
||
1443 | |||
1444 | cmp [setup_enable],1 |
||
1445 | jne no_setup |
||
1446 | |||
1447 | cmp [minimize_right],0 |
||
1448 | jne no_m_r |
||
1449 | add [maxx],10 |
||
1450 | |||
1451 | no_m_r: |
||
1452 | |||
1453 | mov eax,3 |
||
1454 | int 0x40 |
||
1455 | cmp eax,[ptime] |
||
1456 | jz _ret |
||
1457 | mov [ptime],eax |
||
1458 | |||
1459 | call draw_cpu_usage |
||
1460 | |||
1461 | mov eax,[maxx] ; blink sec |
||
1462 | sub eax,33 |
||
1463 | shl eax,16 |
||
1464 | mov ebx,eax |
||
1465 | add ebx,9 |
||
1466 | mov eax,3 |
||
1467 | int 0x40 |
||
1468 | cmp [graph_text],1 |
||
1469 | jne no_y4 |
||
1470 | sub bx,2 |
||
1471 | no_y4: |
||
1472 | mov ecx,eax |
||
1473 | shr ecx,16 |
||
1474 | and ecx,1 |
||
1475 | mov edx,[bte] |
||
1476 | sub edx,[wcolor] |
||
1477 | imul ecx,edx |
||
1478 | add ecx,[wcolor] |
||
1479 | mov edx,sec |
||
1480 | mov eax,4 |
||
1481 | mov esi,1 |
||
1482 | int 0x40 |
||
1483 | |||
1484 | |||
1485 | mov eax,26 ; check for change in time or country |
||
1486 | mov ebx,5 |
||
1487 | int 0x40 |
||
1488 | mov edx,eax |
||
1489 | mov eax,26 |
||
1490 | mov ebx,2 |
||
1491 | mov ecx,9 |
||
1492 | int 0x40 |
||
1493 | add edx,eax |
||
1494 | mov eax,3 |
||
1495 | int 0x40 |
||
1496 | and eax,0xffff |
||
1497 | add edx,eax |
||
1498 | cmp edx,[checks] |
||
1499 | je _ret |
||
1500 | mov [checks],edx |
||
1501 | |||
1502 | mov ebx,[maxx] |
||
1503 | sub ebx,48 ;;94 ;;74 |
||
1504 | shl ebx,16 |
||
1505 | add ebx,33 ;;84 ;;64 |
||
1506 | |||
1507 | mov eax,8 ; time/date button |
||
1508 | mov ecx,3 *65536 |
||
1509 | add ecx,[b_size_y] |
||
1510 | ; dec ecx |
||
1511 | sub cx,5 |
||
1512 | mov edx,2+0x20000000 |
||
1513 | mov esi,[wcolor] |
||
1514 | int 0x40 |
||
1515 | pusha |
||
1516 | mov eax,13 |
||
1517 | add ebx,10*65536-16 |
||
1518 | add ecx,5*65536-8 |
||
1519 | mov edx,[wcolor] |
||
1520 | int 0x40 |
||
1521 | popa |
||
1522 | and edx,0xffff |
||
1523 | add edx,[button_frames] |
||
1524 | int 0x40 |
||
1525 | |||
1526 | mov eax,8 |
||
1527 | mov ebx,[maxx] |
||
1528 | sub ebx,77 ;80 |
||
1529 | shl ebx,16 |
||
1530 | add ebx,12 |
||
1531 | mov ecx,5 shl 16+10 |
||
1532 | mov edx,16+0x20000000 ;button 16 |
||
1533 | mov esi,[wcolor] |
||
1534 | int 0x40 |
||
1535 | sub ebx,17 shl 16 |
||
1536 | inc edx ;button 17 |
||
1537 | int 0x40 |
||
1538 | add ebx,33 shl 16 |
||
1539 | mov bx,8 |
||
1540 | inc edx ;button 18 |
||
1541 | int 0x40 |
||
1542 | sub ebx,47 shl 16 |
||
1543 | mov bx,10 |
||
1544 | inc edx ;button 19 |
||
1545 | int 0x40 |
||
1546 | sub ebx,14 shl 16 |
||
1547 | inc edx ;button 20 |
||
1548 | int 0x40 |
||
1549 | ; flags |
||
1550 | |||
1551 | mov eax,26 |
||
1552 | mov ebx,5 |
||
1553 | int 0x40 |
||
1554 | mov ebx,eax |
||
1555 | |||
1556 | mov eax,1 |
||
1557 | mov [type_lang],al |
||
1558 | call draw_flag |
||
1559 | |||
1560 | mov eax,26 |
||
1561 | mov ebx,2 |
||
1562 | mov ecx,9 |
||
1563 | int 0x40 |
||
1564 | mov ebx,eax |
||
1565 | |||
1566 | mov eax,2 |
||
1567 | mov [type_lang],al |
||
1568 | call draw_flag |
||
1569 | |||
1570 | mcall 18,8,1 |
||
1571 | mov [sound_flag],al |
||
1572 | |||
1573 | mov ebx,[maxx] |
||
1574 | sub ebx,109 ;112 ;28 |
||
1575 | shl ebx,16 |
||
1576 | mov bx,12 |
||
1577 | mov ecx, 4*65536+13 |
||
1578 | mov edx,0 |
||
1579 | mov eax,13 |
||
1580 | int 0x40 |
||
1581 | add ebx,1 shl 16 |
||
1582 | sub bx,2 |
||
1583 | mov ecx,5 shl 16+11 |
||
1584 | mov edx,0xcc |
||
1585 | int 0x40 |
||
1586 | add ebx,1 shl 16 |
||
1587 | mov bx,5 |
||
1588 | mov ecx,8 shl 16+5 |
||
1589 | mov edx,0xdddd00 |
||
1590 | int 0x40 |
||
1591 | add ebx,5 shl 16 |
||
1592 | mov bx,1 |
||
1593 | mov ecx,7 shl 16+7 |
||
1594 | int 0x40 |
||
1595 | add ebx,1 shl 16 |
||
1596 | mov ecx,6 shl 16+9 |
||
1597 | int 0x40 |
||
1598 | add ebx,1 shl 16 |
||
1599 | mov ecx,5 shl 16+11 |
||
1600 | int 0x40 |
||
1601 | |||
1602 | ; cmp [music_type],0 |
||
1603 | ; jne dalshe |
||
1604 | cmp [sound_flag],0 |
||
1605 | je dalshe |
||
1606 | |||
1607 | sub ebx,8 shl 16 |
||
1608 | ror ebx,16 |
||
1609 | mov cx,bx |
||
1610 | rol ebx,16 |
||
1611 | mov bx,cx |
||
1612 | add bx,8 |
||
1613 | mov ecx,5 shl 16+15 |
||
1614 | mov edx,0xff0000 |
||
1615 | mov eax,38 |
||
1616 | int 0x40 |
||
1617 | add ebx,1 shl 16 |
||
1618 | inc bx |
||
1619 | int 0x40 |
||
1620 | rol ecx,16 |
||
1621 | int 0x40 |
||
1622 | sub ebx,1 shl 16 |
||
1623 | dec bx |
||
1624 | int 0x40 |
||
1625 | |||
1626 | dalshe: |
||
1627 | |||
1628 | mov ebx,[maxx] |
||
1629 | sub ebx,123 |
||
1630 | shl ebx,16 |
||
1631 | mov bx,12 |
||
1632 | mov ecx, 4*65536+13 |
||
1633 | mov edx,0 |
||
1634 | mov eax,13 |
||
1635 | int 0x40 |
||
1636 | add ebx,1 shl 16 |
||
1637 | sub bx,2 |
||
1638 | mov ecx,5 shl 16+11 |
||
1639 | mov edx,0xffcc00 |
||
1640 | int 0x40 |
||
1641 | mov eax,4 |
||
1642 | mov ebx,[maxx] |
||
1643 | sub ebx,121 |
||
1644 | shl ebx,16 |
||
1645 | mov bx,7 |
||
1646 | mov ecx,0x10000000 |
||
1647 | mov edx,file_sys |
||
1648 | mov esi,1 |
||
1649 | int 0x40 |
||
1650 | add ebx,1 shl 16 |
||
1651 | int 0x40 |
||
1652 | |||
1653 | ; sub ebx,14 shl 16 |
||
1654 | ; mov bx,7 |
||
1655 | ; mov edx,turn_text |
||
1656 | ; mov esi,1 |
||
1657 | |||
1658 | ; mov ecx,0x60a060 ;[wcolor] |
||
1659 | ; add ecx,0x303030 |
||
1660 | ; mov eax,4 |
||
1661 | ; int 0x40 |
||
1662 | ; add ebx,1 shl 16 |
||
1663 | ; int 0x40 |
||
1664 | ; add ebx,1 shl 16 |
||
1665 | ; int 0x40 |
||
1666 | ; add ebx,1 shl 16 |
||
1667 | ; int 0x40 |
||
1668 | |||
1669 | ; add ebx,1 shl 16 |
||
1670 | ; mov ecx,0x60a060 ;[wcolor] |
||
1671 | ; int 0x40 |
||
1672 | ; add ebx,1 shl 16 |
||
1673 | ; int 0x40 |
||
1674 | ; add ebx,1 shl 16 |
||
1675 | ; sub ecx,0x303030 |
||
1676 | ; int 0x40 |
||
1677 | |||
1678 | ; sub ebx,6 shl 16 |
||
1679 | ; mov bx,1 |
||
1680 | ; mov ecx,2 shl 16+15 |
||
1681 | ; mov edx,0x60a060 ;[wcolor] |
||
1682 | ; add edx,0x303030 |
||
1683 | ; mov eax,13 |
||
1684 | ; int 0x40 |
||
1685 | ; add ebx,1 shl 16 |
||
1686 | ; mov bx,1 |
||
1687 | ; mov edx,0x60a060 ;[wcolor] |
||
1688 | ; int 0x40 |
||
1689 | ; add ebx,1 shl 16 |
||
1690 | ; mov bx,1 |
||
1691 | ; sub edx,0x303030 |
||
1692 | ; int 0x40 |
||
1693 | ; add ebx,1 shl 16 |
||
1694 | ; mov edx,[wcolor] |
||
1695 | ; int 0x40 |
||
1696 | |||
1697 | mov eax,3 ; get time |
||
1698 | int 0x40 |
||
1699 | |||
1700 | movzx ebx,al |
||
1701 | shr eax,8 |
||
1702 | movzx ecx,al |
||
1703 | shr eax,8 |
||
1704 | movzx edx,al |
||
1705 | |||
1706 | ; ebx ecx edx h m s |
||
1707 | |||
1708 | push ebx |
||
1709 | push ecx |
||
1710 | |||
1711 | mov eax,[maxx] |
||
1712 | sub eax,32 |
||
1713 | shl eax,16 |
||
1714 | mov ebx,eax |
||
1715 | add ebx,9 |
||
1716 | |||
1717 | mov ecx,[bte] |
||
1718 | |||
1719 | cmp [graph_text],1 |
||
1720 | jne no_y3 |
||
1721 | sub bx,2 |
||
1722 | mov ecx,0xffffff |
||
1723 | no_y3: |
||
1724 | |||
1725 | |||
1726 | mov edx,[esp] ; __:_X |
||
1727 | and edx,15 |
||
1728 | mov eax,4 |
||
1729 | add ebx,10*65536 |
||
1730 | add edx,text |
||
1731 | mov esi,1 |
||
1732 | int 0x40 |
||
1733 | |||
1734 | pop edx ; __:X_ |
||
1735 | shr edx,4 |
||
1736 | and edx,15 |
||
1737 | mov eax,4 |
||
1738 | sub ebx,6*65536 |
||
1739 | add edx,text |
||
1740 | mov esi,1 |
||
1741 | int 0x40 |
||
1742 | |||
1743 | mov edx,[esp] ; _X:__ |
||
1744 | and edx,15 |
||
1745 | mov eax,4 |
||
1746 | sub ebx,11*65536 |
||
1747 | add edx,text |
||
1748 | mov esi,1 |
||
1749 | int 0x40 |
||
1750 | |||
1751 | pop edx ; X_:__ |
||
1752 | shr edx,4 |
||
1753 | and edx,15 |
||
1754 | mov eax,4 |
||
1755 | sub ebx,6*65536 |
||
1756 | add edx,text |
||
1757 | mov esi,1 |
||
1758 | int 0x40 |
||
1759 | |||
1760 | call draw_cpu_usage |
||
1761 | |||
1762 | _ret: |
||
1763 | |||
1764 | cmp [minimize_right],0 |
||
1765 | jne no_m_r2 |
||
1766 | sub [maxx],10 |
||
1767 | no_m_r2: |
||
1768 | |||
1769 | no_setup: |
||
1770 | |||
1771 | popa |
||
1772 | ret |
||
1773 | |||
1774 | |||
1775 | |||
1776 | draw_cpu_usage: |
||
1777 | |||
1778 | pusha |
||
1779 | |||
1780 | mov [ysi],30 |
||
1781 | cmp [graph_text],1 |
||
1782 | jne @f |
||
1783 | mov [ysi],10 |
||
1784 | @@: |
||
1785 | |||
1786 | |||
1787 | mov eax,18 ; TSC / SEC |
||
1788 | mov ebx,5 |
||
1789 | int 0x40 |
||
1790 | shr eax,20 |
||
1791 | push eax |
||
1792 | mov eax,18 ; IDLE / SEC |
||
1793 | mov ebx,4 |
||
1794 | int 0x40 |
||
1795 | shr eax,20 |
||
1796 | xor edx,edx |
||
1797 | imul eax,[ysi] |
||
1798 | |||
1799 | cdq |
||
1800 | pop ebx |
||
1801 | inc ebx |
||
1802 | div ebx |
||
1803 | push eax |
||
1804 | |||
1805 | mov eax,13 |
||
1806 | mov ebx,[maxx] |
||
1807 | sub ebx,60 ;;65 |
||
1808 | shl ebx,16 |
||
1809 | mov bx,8 |
||
1810 | push ebx |
||
1811 | mov eax,13 |
||
1812 | mov ecx,5*65536 |
||
1813 | add cx,word [ysi] |
||
1814 | inc cx |
||
1815 | |||
1816 | push ebx |
||
1817 | inc ecx |
||
1818 | sub ebx,1 shl 16 |
||
1819 | add ebx,2 |
||
1820 | xor edx,edx |
||
1821 | int 0x40 |
||
1822 | dec ecx |
||
1823 | pop ebx |
||
1824 | |||
1825 | mov edx,0xff0000 ;[wcolor] |
||
1826 | ; sub edx,0x303030 |
||
1827 | int 0x40 |
||
1828 | pop ebx |
||
1829 | pop eax |
||
1830 | |||
1831 | ; push ebx |
||
1832 | inc eax |
||
1833 | mov ecx,5*65536 |
||
1834 | mov cx,ax |
||
1835 | ; pop ebx |
||
1836 | push ecx |
||
1837 | push ebx |
||
1838 | sub ecx,1 shl 16 |
||
1839 | add ecx,1 |
||
1840 | sub ebx,1 shl 16 |
||
1841 | add ebx,2 |
||
1842 | mov eax,13 |
||
1843 | xor edx,edx |
||
1844 | int 0x40 |
||
1845 | pop ebx |
||
1846 | pop ecx |
||
1847 | mov edx,0x44aa44 ;[wcolor] |
||
1848 | ; add edx,0x00101010 |
||
1849 | int 0x40 |
||
1850 | |||
1851 | popa |
||
1852 | |||
1853 | ret |
||
1854 | |||
1855 | |||
1856 | |||
1857 | |||
1858 | ; DATA |
||
1859 | |||
1860 | stripe: |
||
1861 | dd -0x010101 |
||
1862 | dd -0x010101 |
||
1863 | dd -0x020202 |
||
1864 | dd -0x010101 |
||
1865 | dd -0x000000 |
||
1866 | |||
1867 | dd 0x000000 |
||
1868 | dd 0x010101 |
||
1869 | dd 0x020202 |
||
1870 | dd 0x010101 |
||
1871 | dd 0x010101 |
||
1872 | |||
1873 | m_icon: |
||
1874 | dd 0x0 |
||
1875 | dd 0x808080 |
||
1876 | dd 0x000000 |
||
1877 | dd 0x000000 |
||
1878 | dd 0xffffff |
||
1879 | |||
1880 | |||
1881 | lsz m_text,\ |
||
1882 | ru, "",\ |
||
1883 | en, "MENU" |
||
1884 | |||
1885 | mi_text db 'WAVETETRBGRDGPL ' |
||
1886 | |||
1887 | flag_text db 'EnFiGeRuFr' |
||
1888 | |||
1889 | type_lang db 0 |
||
1890 | ;music_type db 1 |
||
1891 | sound_flag db 0 |
||
1892 | button_frames dd 0x0 |
||
1893 | |||
1894 | checks dd -1 |
||
1895 | hidetext db 0x11,0x10,0x1e |
||
1896 | iconf db 'MBAR_IX BMP' |
||
1897 | m_bmp db 'MENUET BMP' |
||
1898 | |||
1899 | sysmeter db 'SYSMETER ' |
||
1900 | file_end db 'END ' |
||
1901 | file_sys db 'SETUP ' |
||
1902 | filename db 'MENU ' |
||
1903 | turn_text db '><' |
||
1904 | ;file1 db 'SB ' |
||
1905 | ;file2 db 'TETRIS ' |
||
1906 | ;file3 db 'PIC4 ' |
||
1907 | ;file4 db 'TINYPAD ' |
||
1908 | ;file4_par db 'COPYING.TXT',0 |
||
1909 | ;file5 db 'MFASM ' |
||
1910 | file6 db 'CALENDAR ' |
||
1911 | gpl db 'GPL' |
||
1912 | |||
1913 | chlang db 'LANG',0 |
||
1914 | syslang db 'SLAN',0 |
||
1915 | |||
1916 | contrast db 0 |
||
1917 | |||
1918 | running_applications dd 0x100 |
||
1919 | max_applications dd 11 |
||
1920 | |||
1921 | b_size_y: dd 0x0 |
||
1922 | ysi dd 0 |
||
1923 | small_draw dd 0x0 |
||
1924 | |||
1925 | ptime dd 0x0 |
||
1926 | maxx dd 0x0 |
||
1927 | text db '0123456789' |
||
1928 | bte dd 0xccddee |
||
1929 | |||
1930 | wcolor dd 0x506070 |
||
1931 | |||
1932 | sec db ': ' |
||
1933 | pros db ' ' |
||
1934 | db ' ' |
||
1935 | |||
1936 | screenxy dd 0x0 |
||
1937 | stcount dd 0x0 |
||
1938 | |||
1939 | I_END: |
||
1940 | area9 rb 100 |
||
1941 | system_colours rd 10 |
||
1942 | app_list rd 50 |
||
1943 | tictable: |
||
1944 | rd 256 |
||
1945 | image:' |