Subversion Repositories Kolibri OS

Rev

Rev 50 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

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