Subversion Repositories Kolibri OS

Rev

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