Subversion Repositories Kolibri OS

Rev

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