Subversion Repositories Kolibri OS

Rev

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