Subversion Repositories Kolibri OS

Rev

Rev 109 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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