Subversion Repositories Kolibri OS

Rev

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

  1. ;----------------------------------------------------------
  2. ;input:
  3. ; eax - start X
  4. ; ebx - start Y
  5. ; ecx - size X
  6. ; edx - size Y
  7. ; esi - colos styles (1...7)
  8. draw_volume_rectangle:
  9.         mov     [line_x],eax
  10.         mov     [line_y],ebx
  11.         mov     [line_size_x],ecx
  12.         mov     [line_size_y],edx
  13.         cmp     esi,1
  14.         jne     no_volume_light_rectangle
  15.  
  16.         ;mov esi,dword[syscolors+20]
  17.         mov     [color_rectangle],0xc7cbcf ;esi
  18.         mov     [color_line1],0xaeabae
  19.         mov     [color_line2],0xffffff
  20.         mov     [color_line3],0xc7cbcf ;esi
  21.         jmp     exit_colors
  22. ;----------------------------------------------------------
  23. no_volume_light_rectangle:
  24.         cmp     esi,2
  25.         jne     no_pressed_rectangle
  26.  
  27.         mov     [color_rectangle],0x666666
  28.         mov     [color_line1],0xaeabae
  29.         mov     [color_line2],0x666666
  30.         mov     [color_line3],0x666666
  31.         jmp     exit_colors
  32. ;----------------------------------------------------------
  33. no_pressed_rectangle:
  34.         cmp     esi,3
  35.         jne     no_pressed_panel
  36.  
  37.         mov esi,dword[syscolors+20]
  38.         mov     [color_rectangle],esi
  39.         mov     [color_line1],0xaeabae
  40.         mov     [color_line2],7000
  41.         mov     [color_line3],0xffffff
  42.         jmp     exit_colors
  43. ;----------------------------------------------------------
  44. no_pressed_panel:
  45.         cmp     esi,4
  46.         jne     no_pressed_light_panel
  47.  
  48.         mov     [color_rectangle],0xffffff
  49.         mov     [color_line1],0xaeabae
  50.         mov     [color_line2],7000
  51.         mov     [color_line3],0xffffff
  52.         jmp     exit_colors
  53. ;----------------------------------------------------------
  54. no_pressed_light_panel:
  55.         cmp     esi,5
  56.         jne     no_light_pressed_rectangle
  57.  
  58.         mov     [color_rectangle],0x666666
  59.         mov     [color_line1],0xaeabae
  60.         mov     [color_line2],0x666666
  61.         mov     [color_line3],0x666666
  62.         jmp     exit_colors
  63. ;----------------------------------------------------------
  64. no_light_pressed_rectangle:
  65.         cmp     esi,6
  66.         jne     no_work_rectangle
  67.  
  68.         mov esi,dword[syscolors+20]
  69.         mov [color_rectangle],esi
  70.         mov     [color_line1],0xaeabae
  71.         mov     [color_line2],esi
  72.         mov     [color_line3],esi
  73.         jmp     exit_colors
  74. ;----------------------------------------------------------
  75. no_work_rectangle:
  76.         cmp     esi,7
  77.         jne     no_work_rectangle_2
  78.  
  79.         mov esi,dword[syscolors+20]
  80.         mov     [color_rectangle],esi
  81.         mov     [color_line1],esi
  82.         mov     [color_line2],esi
  83.         mov     [color_line3],esi
  84.         jmp     exit_colors
  85. ;----------------------------------------------------------
  86. no_work_rectangle_2:
  87. exit_colors:
  88. ;draw   rectangle
  89.         mov     ebx,[line_x]
  90.         mov     ecx,[line_y]
  91.         shl     ebx,16
  92.         shl     ecx,16
  93.         add     ebx,[line_size_x]
  94.         add     ecx,[line_size_y]
  95.         mov     edx,[color_rectangle]
  96.         mcall SF_DRAW_RECT
  97. ;line   1
  98.         mov     edx,[color_line1]
  99.         mov     ebx,[line_x]
  100.         mov     ecx,[line_y]
  101.         shl     ebx,16
  102.         shl     ecx,16
  103.         add     ebx,[line_x]
  104.         add     ecx,[line_y]
  105.         add     ebx,[line_size_x]
  106.         call    draw_line
  107. ;line   2
  108.         mov     edx,[color_line1]
  109.         mov     ebx,[line_x]
  110.         mov     ecx,[line_y]
  111.         shl     ebx,16
  112.         shl     ecx,16
  113.         add     ebx,[line_x]
  114.         add     ecx,[line_y]
  115.         add     ecx,[line_size_y]
  116.         call    draw_line
  117. ;line   3
  118.         mov     edx,[color_line1]
  119.         mov     ebx,[line_x]
  120.         mov     ecx,[line_y]
  121.         add     ecx,[line_size_y]
  122.         shl     ebx,16
  123.         shl     ecx,16
  124.         add     ebx,[line_x]
  125.         add     ecx,[line_y]
  126.         add     ebx,[line_size_x]
  127.         add     ecx,[line_size_y]
  128.         call    draw_line
  129. ;line   4
  130.         mov     edx,[color_line1]
  131.         mov     ebx,[line_x]
  132.         mov     ecx,[line_y]
  133.         add     ebx,[line_size_x]
  134.         shl     ebx,16
  135.         shl     ecx,16
  136.         add     ebx,[line_x]
  137.         add     ecx,[line_y]
  138.         add     ebx,[line_size_x]
  139.         add     ecx,[line_size_y]
  140.         call    draw_line
  141. ;light  line    1
  142.         mov     edx,[color_line2]
  143.         mov     ebx,[line_x]
  144.         mov     ecx,[line_y]
  145.         inc     ebx
  146.         inc     ecx
  147.         shl     ebx,16
  148.         shl     ecx,16
  149.         add     ebx,[line_x]
  150.         add     ecx,[line_y]
  151.         add     ebx,[line_size_x]
  152.         dec     ebx
  153.         inc     ecx
  154.         call    draw_line
  155. ;light  line    2
  156.         mov     edx,[color_line2]
  157.         mov     ebx,[line_x]
  158.         mov     ecx,[line_y]
  159.         inc     ebx
  160.         inc     ecx
  161.         shl     ebx,16
  162.         shl     ecx,16
  163.         add     ebx,[line_x]
  164.         add     ecx,[line_y]
  165.         add     ecx,[line_size_y]
  166.         dec     ecx
  167.         inc     ebx
  168.         call    draw_line
  169. ;light  line    3
  170.         mov     edx,[color_line3]
  171.         mov     ebx,[line_x]
  172.         mov     ecx,[line_y]
  173.         add     ebx,[line_size_x]
  174.         dec     ebx
  175.         inc     ecx
  176.         shl     ebx,16
  177.         shl     ecx,16
  178.         add     ebx,[line_x]
  179.         add     ecx,[line_y]
  180.         add     ebx,[line_size_x]
  181.         add     ecx,[line_size_y]
  182.         dec     ebx
  183.         dec     ecx
  184.         call    draw_line
  185. ;light  line    4
  186.         mov     edx,[color_line3]
  187.         mov     ebx,[line_x]
  188.         mov     ecx,[line_y]
  189.         add     ecx,[line_size_y]
  190.         inc     ebx
  191.         dec     ecx
  192.         shl     ebx,16
  193.         shl     ecx,16
  194.         add     ebx,[line_x]
  195.         add     ecx,[line_y]
  196.         add     ecx,[line_size_y]
  197.         add     ebx,[line_size_x]
  198.         dec     ecx
  199.         dec     ebx
  200.         call    draw_line
  201.         ret
  202. ;----------------------------------------------------------
  203. ;input:
  204. ; eax - rectangle X
  205. ; ebx - rectangle Y
  206. ; ecx - point X
  207. ; edx - point Y
  208. ; esi - rectangle size X
  209. ; edi - rectangle size Y
  210. ;output:
  211. ; eax - 1 if point in rectangle
  212. columnus:
  213.         sub     eax,ecx
  214.         jns     @f
  215.         neg     eax
  216.         cmp     eax,esi
  217.         ja      @f
  218.         sub     ebx,edx
  219.         jns     @f
  220.         neg     ebx
  221.         cmp     ebx,edi
  222.         ja      @f
  223.         mov     eax,1
  224.         jmp     columnus_true
  225. @@:
  226.         xor     eax,eax
  227. columnus_true:
  228.         ret
  229. ;----------------------------------------------------------
  230. print_text:
  231.         mov     [text_x],eax
  232.         mov     [text_y],ebx
  233.         mov     ebx,[text_x]
  234.         shl     ebx,16
  235.         add     ebx,[text_y]
  236.         mcall SF_DRAW_TEXT
  237.         ret
  238. ;----------------------------------------------------------
  239. draw_line:
  240.         mcall SF_DRAW_LINE
  241.         ret
  242. ;----------------------------------------------------------
  243. ;lightlin 12508927
  244. ;lines 5669590
  245. ;workpan 9350879
  246. ;btnpress 9089258
  247. line_x          dd      0
  248. line_y          dd      0
  249. line_size_x     dd      0
  250. line_size_y     dd      0
  251. color_line1     dd      0
  252. color_line2     dd      0
  253. color_line3     dd      0
  254. color_rectangle dd      0
  255. ;--------------------
  256. text_x          dd      0
  257. text_y          dd      0
  258. ;--------------------