Subversion Repositories Kolibri OS

Rev

Rev 485 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;   *********************************************
  2. ;   *******  DRAW PLAY BAR **********************
  3. ;   *********************************************
  4.  
  5. draw_bar:
  6.     push eax ebp
  7.     mov  eax,[cur_tick]
  8.     test eax,eax
  9.     jz   .ex
  10.     mov  ebp,[coo]
  11.     mul  dword [ebp-20]
  12.     mov  ebx,[tick_count]
  13.     test ebx,ebx
  14.     jz   .ex
  15.     div  ebx
  16.     mov  ebx,[ebp-16]
  17.     mov  bx,ax
  18.     mov  ecx,[ebp-12]
  19.     mov  edx,0x84706a
  20.     mov  eax,13
  21.     mcall
  22.     mov  esi,TOTALTIME_XY
  23.     mov  eax,[tick_count]
  24.     call draw_total_time
  25.   .nobar:
  26.     mov  esi,[ebp+20]
  27.     mov  ebx,[ebp+12]
  28.     mov  ecx,[ebp+16]
  29.     call draw_cur_time
  30.     mov  esi,140 shl 16+(WND_HEIGHT-18)
  31.     sub  ebx,95 shl 16
  32.     add  ecx,(WND_HEIGHT-34)shl 16
  33.     call draw_cur_time
  34.   .ex:
  35.     pop  ebp eax
  36.     ret
  37.  
  38.  
  39.  
  40. ;   *********************************************
  41. ;   *******  Ž…„…‹…ˆ… ˆ Ž’ˆ‘Ž‚Š€ ŽŠ€ *******
  42. ;   *********************************************
  43.  
  44. draw_window:
  45.     mov  eax,12
  46.     mov  ebx,1
  47.     mcall
  48.     or   [flag],FL_BOTTRED
  49.     xor  eax,eax
  50.     mov  ebx,100*65536+275
  51.     mov  ecx,200*65536+WND_HEIGHT
  52.     mov  edi,hdr_raw+8
  53.     mov  ebp,[coo]
  54.     test [flag],FL_HIDDEN
  55.     jz   .nohide1
  56.     and  ebx,0xffff
  57.     and  ecx,0xffff
  58.     add  edi,275*14*3
  59.   .nohide1:
  60.     push edi
  61.     mov  edx,WND_BACK
  62.     mov  esi,edx
  63.     mov  edi,edx
  64.     mcall
  65.     mov  ecx,[channel]
  66.     shl  ecx,4
  67.     add  cl,[sel_track]
  68.     mcall 47,0x20100,,<191,15>,0xf0f000
  69.     movsx ecx,[octave]
  70.     add   ecx,100
  71.     mcall ,0x30000,,<132,15>
  72.     pop  ebx
  73.     mcall 7,,(275 shl 16+14),0
  74.     mov  esi,0x80ecce7a
  75.  
  76.     mov  eax,8
  77.     mov  ebx,265 shl 16+7
  78.     mov  ecx,3 shl 16+7
  79.     mov  edx,1+1 shl 30
  80.     mcall        ; close button
  81.     sub  ebx,10 shl 16
  82.     mov  edx,100+1 shl 30
  83.     mcall        ; shade button-101
  84.     sub  ebx,10 shl 16
  85.     add  edx,3
  86.     mcall        ; minimize button-103
  87.     sub  ebx,239 shl 16
  88.     inc  edx         ; about button-104
  89.     mcall
  90.     xor  esi,esi
  91.     xor  edi,edi
  92.     mov  ecx,3
  93.     pushd [ebp+12]
  94.     pushd [ebp+16]
  95.     call draw_navigation
  96.     add  esp,8
  97.  
  98.     mov  ebx,[ebp-16]
  99.     add  ebx,[ebp-20]
  100.     mov  ecx,[ebp-12]
  101.     add  ecx,[ebp-24]
  102.     mov  esi,0x2c2b46
  103.     mov  edx,2+1 shl 29
  104.     mcall
  105.  
  106.     shr  eax,1
  107.  
  108.     mov  ecx,12
  109.     mov  ebx,FN_XY
  110.     mov  edx,[fn_ptr];I_PARAM;filename
  111.     mov  esi,1;[fname_len]
  112.     mov  edi,0x00e200
  113.   .fnlp:
  114.     push ecx
  115.     mcall ,,edi
  116.     add  ebx,1 shl 16
  117.     mcall
  118.     add  ebx,6 shl 16
  119.     inc  edx
  120.     pop  ecx
  121.     loop .fnlp
  122.     add  ebx,5 shl 16
  123.     mcall ,,0xa0a0a0,text,text_end-text
  124.     call draw_bar
  125.     call PL_show
  126.     test [flag],FL_HIDDEN
  127.     jnz  .nohide2
  128.     mov  eax,7
  129.     mov  ebx,btn_raw+8
  130.     mov  ecx,BTNS_SIZE
  131.     mov  edx,BTNS_XY
  132.     mcall
  133.   .nohide2:
  134.     mov  esi,FL_SHUFFLE
  135.     mov  edi,btncoords+8
  136.     mov  eax,13
  137.     mov  edx,0xd600
  138.     mov  ecx,2
  139.   .loo3:
  140.     test [flag],esi
  141.     je   .el
  142.     mov  ebx,[edi]
  143.     add  ebx,5 shl 16
  144.     add  ebx,[ebp]
  145.     mov  bx,3
  146.     push ecx
  147.     mov  ecx,[edi+4]
  148.     add  ecx,4 shl 16
  149.     add  ecx,[ebp+4]
  150.     mov  cx,2
  151.     mcall
  152.     pop  ecx
  153.   .el:
  154.     add  edi,8
  155.     inc  esi
  156.     loop .loo3
  157.  
  158.   .enddraw:
  159.     mov  eax,12
  160.     mov  ebx,2
  161.     mcall
  162.     ret
  163.  
  164. draw_navigation:
  165. ; ebp - coordinates
  166.     push esi edi ecx
  167.     mov  eax,8
  168.  
  169.     mov  ecx,5
  170.     mov  ebx,[ebp]
  171.     add  ebx,[ebp-8]
  172.     add  ebx,esi
  173.     mov  edx,3+1 shl 30
  174.   .btnloo:
  175.     push ecx
  176.     mov  ecx,[ebp+4]
  177.     add  ecx,[ebp-4]
  178.     add  ecx,edi
  179.     mcall
  180.     pop  ecx
  181.     add  ebx,[ebp+8]
  182.     inc  edx
  183.     loop .btnloo
  184.     pop  ecx
  185.  
  186.     lea  edi,[ebp+24]
  187.   .btnloo2:
  188.     mov  ebx,[edi]
  189.     add  ebx,[ebp]
  190.     add  ebx,[esp+4]
  191.     push ecx
  192.     mov  ecx,[edi+4]
  193.     add  ecx,[ebp+4]
  194.     add  ecx,[esp+4]
  195.     mcall
  196.     pop  ecx
  197.     add  edi,8
  198.     inc  edx
  199.     loop .btnloo2
  200.     pop  edi esi
  201.     ret
  202.  
  203. draw_cur_time:
  204.     pusha
  205.     mcall 13,,,WND_BACK
  206.     mcall 8,,,101+1 shl 29+1 shl 30
  207.     mov  ebx,[tick_count]
  208.     mov  eax,[cur_tick]
  209.     test [flag],FL_REVERSE
  210.     jz   .norev
  211.     xchg eax,ebx
  212.     sub  eax,ebx
  213.     lea  ebx,[esi-6 shl 16]
  214.     push eax
  215.     mcall 4,,0xf000,dots+1,1
  216.     pop  eax
  217.   .norev:
  218.     mov  [esp+28],eax
  219.     popa
  220. draw_total_time:      ; eax -time to show
  221.     pusha
  222.     xor  edx,edx
  223.     mov  ebx,100
  224.     div  ebx
  225.     xor  edx,edx
  226.     mov  ebx,60
  227.     div  ebx
  228.     push edx
  229.     mov  ecx,eax
  230.     mcall 47,0x20000,,esi,0xf000
  231.     pop  ecx
  232.     add  edx,17 shl 16
  233.     mcall
  234.     sub  edx,5 shl 16
  235.     mcall 4,edx,esi,dots,1
  236.     popa
  237.     ret
  238.  
  239. BOTT_BTN equ 25 shl 16+18
  240. BOTT_SIZEX equ 25
  241. BOTT_SIZEY equ 18
  242. BOTT_S     equ BOTT_SIZEX*BOTT_SIZEY*3
  243. BOTT_X  equ PL_X
  244. BOTT_Y  equ (WND_HEIGHT-27)
  245. BOTT_SPACE equ 30 shl 16
  246.  
  247. popup db -1
  248.  
  249. draw_bottom:
  250.     pusha
  251.     mcall 13,175,(BOTT_Y-5)shl 16+24,WND_BACK
  252.     add  ebx,(266-30)shl 16-135
  253.     mcall
  254.     mov  ecx,5
  255.     mov  esi,bot_btn
  256.     push esi
  257.     mov  ebx,bottom_raw+8
  258.     xor  eax,eax
  259.   .nxt:
  260.     push ecx
  261.     lodsw
  262.     shl  eax,16
  263.     lea  edx,[eax+BOTT_Y]
  264.     mcall 7,,BOTT_BTN
  265.     add  ebx,BOTT_S*4
  266.     pop  ecx
  267.     cmp  ecx,4
  268.     jne  .noadj
  269.     add  ebx,BOTT_S
  270.   .noadj:
  271.     loop .nxt
  272.     mov  esi,[esp]
  273.     mov  ecx,5
  274.     mov  ebp,BOTT_Y shl 16+BOTT_SIZEY
  275.     mov  edx,20+1 shl 30
  276.   .nxt2:
  277.     push ecx
  278.     lodsw
  279.     shl  eax,16
  280.     lea  ebx,[eax+BOTT_SIZEX+2 shl 16-3]
  281.     mcall 8,,ebp
  282.     inc  edx
  283.     pop  ecx
  284.     loop .nxt2
  285.     pop  esi
  286.     call draw_popup
  287.     popa
  288.     ret
  289.  
  290. draw_popup:
  291.     movsx eax,[popup]
  292.     cmp  eax,0
  293.     jge  .ok
  294.     mov  edx,30+1 shl 31
  295.     mov  ecx,21
  296.     mov  eax,8
  297.   .clr:
  298.     mcall
  299.     inc  edx
  300.     loop .clr
  301.     jmp  .ex
  302.   .ok:
  303.     push eax
  304.     lea  edx,[eax+1 shl 31+20]
  305.     mcall 8
  306.     pop  eax
  307.     mov  ebx,eax
  308.     shl  eax,2
  309.     mov  ecx,3
  310.     cmp  eax,4
  311.     jne  .noadj1
  312.     inc  ecx
  313.   .noadj1:
  314.     cmp  eax,8
  315.     jb   .noadj2
  316.     inc  eax
  317.   .noadj2:
  318.     inc  eax
  319.     push eax
  320.     movzx edx,word[bot_btn+ebx*2]
  321.     shl  edx,16
  322.     add  edx,BOTT_Y
  323.     push edx
  324.   .noadj3:
  325.     imul ebx,eax,BOTT_S
  326.     add  ebx,bottom_raw+8
  327.     push ecx
  328.   .nxt:
  329.     push ecx
  330.     mcall 7,,BOTT_BTN
  331.     add  ebx,BOTT_S
  332.     sub  edx,BOTT_SIZEY
  333.     pop  ecx
  334.     loop .nxt
  335.     pop  ecx ebx edx
  336.     mov  ebp,BOTT_Y shl 16+BOTT_SIZEY
  337.     mov  eax,8
  338.     add  edx,1 shl 30+30
  339.     add  ebx,2 shl 16
  340.     mov  bx,BOTT_SIZEX-3
  341.   .nxt2:
  342.     push ecx
  343.     mcall ,,ebp
  344.     inc  edx
  345.     sub  ebp,BOTT_SIZEY shl 16
  346.     pop  ecx
  347.     loop .nxt2
  348.   .ex:
  349.     ret
  350.  
  351. bot_btn:
  352.     dw 10,40,70,100,240
  353.  
  354. about1:
  355.   db 13,10,'* MIDAMP for KolibriOS v1.1 by Willow, July 2005 *',13,10,0