Subversion Repositories Kolibri OS

Rev

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