Subversion Repositories Kolibri OS

Rev

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

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