Subversion Repositories Kolibri OS

Rev

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

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