Subversion Repositories Kolibri OS

Rev

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

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                              ;;
  3. ;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
  4. ;; Distributed under terms of the GNU General Public License    ;;
  5. ;;                                                              ;;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7.  
  8.  
  9. LOAD_FROM_FILE  = 0
  10. LOAD_FROM_MEM   = 1
  11. LOAD_INDIRECT   = 2
  12. LOAD_SYSTEM     = 3
  13.  
  14. struct  BITMAPINFOHEADER
  15.         Size                    dd ?
  16.         Width                   dd ?
  17.         Height                  dd ?
  18.         Planes                  dw ?
  19.         BitCount                dw ?
  20.         Compression             dd ?
  21.         SizeImage               dd ?
  22.         XPelsPerMeter           dd ?
  23.         YPelsPerMeter           dd ?
  24.         ClrUsed                 dd ?
  25.         ClrImportant            dd ?
  26. ends
  27. ;------------------------------------------------------------------------------
  28. align 4
  29. proc init_cursor stdcall, dst:dword, src:dword
  30.            locals
  31.              rBase    dd ?
  32.              pQuad    dd ?
  33.              pBits    dd ?
  34.              pAnd     dd ?
  35.              width    dd ?
  36.              height   dd ?
  37.              counter  dd ?
  38.            endl
  39.  
  40.         mov     esi, [src]
  41.         add     esi, [esi+18]
  42.         mov     eax, esi
  43.  
  44.         cmp     [esi + BITMAPINFOHEADER.BitCount], 24
  45.         je      .img_24
  46.         cmp     [esi + BITMAPINFOHEADER.BitCount], 8
  47.         je      .img_8
  48.         cmp     [esi + BITMAPINFOHEADER.BitCount], 4
  49.         je      .img_4
  50. ;--------------------------------------
  51. align 4
  52. .img_2:
  53.         add     eax, [esi]
  54.         mov     [pQuad], eax
  55.         add     eax, 8
  56.         mov     [pBits], eax
  57.         add     eax, 128
  58.         mov     [pAnd], eax
  59.         mov     eax, [esi+4]
  60.         mov     [width], eax
  61.         mov     ebx, [esi+8]
  62.         shr     ebx, 1
  63.         mov     [height], ebx
  64.  
  65.         mov     edi, [dst]
  66.         add     edi, 32*31*4
  67.         mov     [rBase], edi
  68.  
  69.         mov     esi, [pQuad]
  70. ;--------------------------------------
  71. align 4
  72. .l21:
  73.         mov     ebx, [pBits]
  74.         mov     ebx, [ebx]
  75.         bswap   ebx
  76.         mov     eax, [pAnd]
  77.         mov     eax, [eax]
  78.         bswap   eax
  79.         mov     [counter], 32
  80. ;--------------------------------------
  81. align 4
  82. @@:
  83.         xor     edx, edx
  84.         shl     eax, 1
  85.         setc    dl
  86.         dec     edx
  87.  
  88.         xor     ecx, ecx
  89.         shl     ebx, 1
  90.         setc    cl
  91.         mov     ecx, [esi + ecx*4]
  92.         and     ecx, edx
  93.         and     edx, 0xFF000000
  94.         or      edx, ecx
  95.         mov     [edi], edx
  96.  
  97.         add     edi, 4
  98.         dec     [counter]
  99.         jnz     @B
  100.  
  101.         add     [pBits], 4
  102.         add     [pAnd], 4
  103.         mov     edi, [rBase]
  104.         sub     edi, 128
  105.         mov     [rBase], edi
  106.         sub     [height], 1
  107.         jnz     .l21
  108.         ret
  109. ;--------------------------------------
  110. align 4
  111. .img_4:
  112.         add     eax, [esi]
  113.         mov     [pQuad], eax
  114.         add     eax, 64
  115.         mov     [pBits], eax
  116.         add     eax, 0x200
  117.         mov     [pAnd], eax
  118.         mov     eax, [esi+4]
  119.         mov     [width], eax
  120.         mov     ebx, [esi+8]
  121.         shr     ebx, 1
  122.         mov     [height], ebx
  123.  
  124.         mov     edi, [dst]
  125.         add     edi, 32*31*4
  126.         mov     [rBase], edi
  127.  
  128.         mov     esi, [pQuad]
  129.         mov     ebx, [pBits]
  130. ;--------------------------------------
  131. align 4
  132. .l4:
  133.         mov     eax, [pAnd]
  134.         mov     eax, [eax]
  135.         bswap   eax
  136.         mov     [counter], 16
  137. ;--------------------------------------
  138. align 4
  139. @@:
  140.         xor     edx, edx
  141.         shl     eax, 1
  142.         setc    dl
  143.         dec     edx
  144.  
  145.         movzx   ecx, byte [ebx]
  146.         and     cl, 0xF0
  147.         shr     ecx, 2
  148.         mov     ecx, [esi + ecx]
  149.         and     ecx, edx
  150.         and     edx, 0xFF000000
  151.         or      edx, ecx
  152.         mov     [edi], edx
  153.  
  154.         xor     edx, edx
  155.         shl     eax, 1
  156.         setc    dl
  157.         dec     edx
  158.  
  159.         movzx   ecx, byte [ebx]
  160.         and     cl, 0x0F
  161.         mov     ecx, [esi + ecx*4]
  162.         and     ecx, edx
  163.         and     edx, 0xFF000000
  164.         or      edx, ecx
  165.         mov     [edi+4], edx
  166.  
  167.         inc     ebx
  168.         add     edi, 8
  169.         dec     [counter]
  170.         jnz     @B
  171.  
  172.         add     [pAnd], 4
  173.         mov     edi, [rBase]
  174.         sub     edi, 128
  175.         mov     [rBase], edi
  176.         sub     [height], 1
  177.         jnz     .l4
  178.         ret
  179. ;--------------------------------------
  180. align 4
  181. .img_8:
  182.         add     eax, [esi]
  183.         mov     [pQuad], eax
  184.         add     eax, 1024
  185.         mov     [pBits], eax
  186.         add     eax, 1024
  187.         mov     [pAnd], eax
  188.         mov     eax, [esi+4]
  189.         mov     [width], eax
  190.         mov     ebx, [esi+8]
  191.         shr     ebx, 1
  192.         mov     [height], ebx
  193.  
  194.         mov     edi, [dst]
  195.         add     edi, 32*31*4
  196.         mov     [rBase], edi
  197.  
  198.         mov     esi, [pQuad]
  199.         mov     ebx, [pBits]
  200. ;--------------------------------------
  201. align 4
  202. .l81:
  203.         mov     eax, [pAnd]
  204.         mov     eax, [eax]
  205.         bswap   eax
  206.         mov     [counter], 32
  207. ;--------------------------------------
  208. align 4
  209. @@:
  210.         xor     edx, edx
  211.         shl     eax, 1
  212.         setc    dl
  213.         dec     edx
  214.  
  215.         movzx   ecx, byte [ebx]
  216.         mov     ecx, [esi + ecx*4]
  217.         and     ecx, edx
  218.         and     edx, 0xFF000000
  219.         or      edx, ecx
  220.         mov     [edi], edx
  221.  
  222.         inc     ebx
  223.         add     edi, 4
  224.         dec     [counter]
  225.         jnz     @B
  226.  
  227.         add     [pAnd], 4
  228.         mov     edi, [rBase]
  229.         sub     edi, 128
  230.         mov     [rBase], edi
  231.         sub     [height], 1
  232.         jnz     .l81
  233.         ret
  234. ;--------------------------------------
  235. align 4
  236. .img_24:
  237.         add     eax, [esi]
  238.         mov     [pQuad], eax
  239.         add     eax, 0xC00
  240.         mov     [pAnd], eax
  241.         mov     eax, [esi + BITMAPINFOHEADER.Width]
  242.         mov     [width], eax
  243.         mov     ebx, [esi + BITMAPINFOHEADER.Height]
  244.         shr     ebx, 1
  245.         mov     [height], ebx
  246.  
  247.         mov     edi, [dst]
  248.         add     edi, 32*31*4
  249.         mov     [rBase], edi
  250.  
  251.         mov     esi, [pAnd]
  252.         mov     ebx, [pQuad]
  253. ;--------------------------------------
  254. align 4
  255. .row_24:
  256.         mov     eax, [esi]
  257.         bswap   eax
  258.         mov     [counter], 32
  259. ;--------------------------------------
  260. align 4
  261. @@:
  262.         xor     edx, edx
  263.         shl     eax, 1
  264.         setc    dl
  265.         dec     edx
  266.  
  267.         mov     ecx, [ebx]
  268.         and     ecx, 0x00FFFFFF
  269.         and     ecx, edx
  270.         and     edx, 0xFF000000
  271.         or      edx, ecx
  272.         mov     [edi], edx
  273.         add     ebx, 3
  274.         add     edi, 4
  275.         dec     [counter]
  276.         jnz     @B
  277.  
  278.         add     esi, 4
  279.         mov     edi, [rBase]
  280.         sub     edi, 128
  281.         mov     [rBase], edi
  282.         sub     [height], 1
  283.         jnz     .row_24
  284.         ret
  285. endp
  286. ;------------------------------------------------------------------------------
  287. align 4
  288. proc set_cursor stdcall, hcursor:dword
  289.         mov     eax, [hcursor]
  290.         cmp     [eax + CURSOR.magic], 'CURS'
  291.         jne     .fail
  292. ;           cmp [eax+CURSOR.size], CURSOR_SIZE
  293. ;           jne .fail
  294.         mov     ebx, [current_slot]
  295.         mov     ebx, [ebx + APPDATA.window]
  296.         xchg    eax, [ebx + WDATA.cursor]
  297.         jmp     .end
  298. ;--------------------------------------
  299. align 4
  300. .fail:
  301.         mov     eax, [def_cursor]
  302.         mov     ebx, [current_slot]
  303.         mov     ebx, [ebx + APPDATA.window]
  304.         xchg    eax, [ebx + WDATA.cursor]
  305. align 4
  306. .end:
  307.         mov     [redrawmouse_unconditional], 1
  308.         call    __sys_draw_pointer
  309.         ret
  310. endp
  311. ;------------------------------------------------------------------------------
  312. align 4
  313. ; param
  314. ;  eax= pid
  315. ;  ebx= src
  316. ;  ecx= flags
  317.  
  318. create_cursor:
  319. virtual at esp
  320. .src     dd ?
  321. .flags   dd ?
  322. .hcursor dd ?
  323. end virtual
  324.  
  325.         sub     esp, 4         ;space for .hcursor
  326.         push    ecx
  327.         push    ebx
  328.  
  329.         mov     ebx, eax
  330.         mov     eax, sizeof.CURSOR
  331.         call    create_kernel_object
  332.         test    eax, eax
  333.         jz      .fail
  334.  
  335.         mov     [.hcursor], eax
  336.  
  337.         xor     ebx, ebx
  338.         mov     [eax + CURSOR.magic], 'CURS'
  339.         mov     [eax + CURSOR.destroy], destroy_cursor
  340.         mov     [eax + CURSOR.hot_x], ebx
  341.         mov     [eax + CURSOR.hot_y], ebx
  342.  
  343.         stdcall kernel_alloc, PAGE_SIZE
  344.         test    eax, eax
  345.         jz      .fail
  346.  
  347.         mov     edi, [.hcursor]
  348.         mov     [edi + CURSOR.base], eax
  349.  
  350.         mov     esi, [.src]
  351.         mov     ebx, [.flags]
  352.         cmp     bx, LOAD_INDIRECT
  353.         je      .indirect
  354.  
  355.         movzx   ecx, word [esi+10]
  356.         movzx   edx, word [esi+12]
  357.         mov     [edi + CURSOR.hot_x], ecx
  358.         mov     [edi + CURSOR.hot_y], edx
  359.  
  360.         stdcall init_cursor, eax, esi
  361.  
  362. align 4
  363. .add_cursor:
  364.         mov     ecx, [.hcursor]
  365.         lea     ecx, [ecx + CURSOR.list_next]
  366.         lea     edx, [_display.cr_list.next]
  367.  
  368.         pushfd
  369.         cli
  370.         list_add ecx, edx   ;list_add_tail(new, head)
  371.         popfd
  372.  
  373.         mov     eax, [.hcursor]
  374.         cmp     [_display.init_cursor], 0
  375.         je      .fail
  376.  
  377.         push    eax
  378.         call    [_display.init_cursor]
  379.         add     esp, 4
  380.  
  381.         mov     eax, [.hcursor]
  382. ;--------------------------------------
  383. align 4
  384. .fail:
  385.         add     esp, 12
  386.         ret
  387. ;--------------------------------------
  388. align 4
  389. .indirect:
  390.         shr     ebx, 16
  391.         movzx   ecx, bh
  392.         movzx   edx, bl
  393.         mov     [edi + CURSOR.hot_x], ecx
  394.         mov     [edi + CURSOR.hot_y], edx
  395.  
  396.         xchg    edi, eax
  397.         mov     ecx, PAGE_SIZE/4
  398.         cld
  399.         rep movsd
  400.         jmp     .add_cursor
  401. ;------------------------------------------------------------------------------
  402. align 4
  403. proc load_cursor stdcall, src:dword, flags:dword
  404.            locals
  405.              handle  dd ?
  406.            endl
  407.  
  408.         xor     eax, eax
  409.         cmp     [create_cursor], eax
  410.         je      .fail2
  411.  
  412.         mov     [handle], eax
  413.         cmp     word [flags], LOAD_FROM_FILE
  414.         jne     @F
  415.  
  416.         stdcall load_file, [src]
  417.         test    eax, eax
  418.         jz      .fail
  419.         mov     [src], eax
  420. ;--------------------------------------
  421. align 4
  422. @@:
  423.         push    ebx
  424.         push    esi
  425.         push    edi
  426.  
  427.         mov     eax, [current_slot]
  428.         mov     eax, [eax + APPDATA.tid]
  429.         mov     ebx, [src]
  430.         mov     ecx, [flags]
  431.         call    create_cursor    ;eax, ebx, ecx
  432.         mov     [handle], eax
  433.  
  434.         cmp     word [flags], LOAD_FROM_FILE
  435.         jne     .exit
  436.         stdcall kernel_free, [src]
  437. ;--------------------------------------
  438. align 4
  439. .exit:
  440.         pop     edi
  441.         pop     esi
  442.         pop     ebx
  443. ;--------------------------------------
  444. align 4
  445. .fail:
  446.         mov     eax, [handle]
  447. ;--------------------------------------
  448. align 4
  449. .fail2:
  450.         ret
  451. endp
  452. ;------------------------------------------------------------------------------
  453. align 4
  454. proc delete_cursor stdcall, hcursor:dword
  455.  
  456. ;        DEBUGF 1,'K : delete_cursor %x\n', [hcursor]
  457.  
  458.         mov     esi, [hcursor]
  459.  
  460.         cmp     [esi + CURSOR.magic], 'CURS'
  461.         jne     .fail
  462.  
  463.         mov     ebx, [current_slot]
  464.         mov     ebx, [ebx + APPDATA.tid]
  465.         cmp     ebx, [esi + CURSOR.pid]
  466.         jne     .fail
  467.  
  468.         mov     ebx, [current_slot]
  469.         mov     ebx, [ebx + APPDATA.window]
  470.         cmp     esi, [ebx + WDATA.cursor]
  471.         jne     @F
  472.         mov     eax, [def_cursor]
  473.         mov     [ebx + WDATA.cursor], eax
  474. ;--------------------------------------
  475. align 4
  476. @@:
  477.         mov     eax, [hcursor]
  478.         call    [eax + APPOBJ.destroy]
  479. ;--------------------------------------
  480. align 4
  481. .fail:
  482.         ret
  483. endp
  484. ;------------------------------------------------------------------------------
  485. align 4
  486. ; param
  487. ;  eax= cursor
  488. destroy_cursor:
  489.  
  490.         push    eax
  491.         stdcall kernel_free, [eax + CURSOR.base]
  492.  
  493.         mov     eax, [esp]
  494.         lea     eax, [eax + CURSOR.list_next]
  495.  
  496.         pushfd
  497.         cli
  498.         list_del eax
  499.         popfd
  500.  
  501.         pop     eax
  502.         call    destroy_kernel_object
  503.         ret
  504. ;------------------------------------------------------------------------------
  505. align 4
  506. select_cursor:
  507.         mov     eax, [esp + 4]
  508.         mov     [_display.cursor], eax
  509.         ret     4
  510. ;------------------------------------------------------------------------------
  511. align 4
  512. proc restore_24 stdcall, x:dword, y:dword
  513.  
  514.         push    ebx
  515.  
  516.         mov     ebx, [cur_saved_base]
  517.         mov     edx, [cur.h]
  518.         test    edx, edx
  519.         jz      .ret
  520.  
  521.         push    esi
  522.         push    edi
  523.  
  524.         mov     esi, cur_saved_data
  525.         mov     ecx, [cur.w]
  526.         lea     ecx, [ecx + ecx*2]
  527.         push    ecx
  528. ;--------------------------------------
  529. align 4
  530. @@:
  531.         mov     edi, ebx
  532.         add     ebx, [_display.lfb_pitch]
  533.  
  534.         mov     ecx, [esp]
  535.         rep movsb
  536.         dec     edx
  537.         jnz     @B
  538.  
  539.         pop     ecx
  540.         pop     edi
  541.         pop     esi
  542. ;--------------------------------------
  543. align 4
  544. .ret:
  545.         pop     ebx
  546.         ret
  547. endp
  548. ;------------------------------------------------------------------------------
  549. align 4
  550. proc restore_32 stdcall, x:dword, y:dword
  551.  
  552.         push    ebx
  553.  
  554.         mov     ebx, [cur_saved_base]
  555.         mov     edx, [cur.h]
  556.         test    edx, edx
  557.         jz      .ret
  558.  
  559.         push    esi
  560.         push    edi
  561.  
  562.         mov     esi, cur_saved_data
  563. ;--------------------------------------
  564. align 4
  565. @@:
  566.         mov     edi, ebx
  567.         add     ebx, [_display.lfb_pitch]
  568.  
  569.         mov     ecx, [cur.w]
  570.         rep movsd
  571.         dec     edx
  572.         jnz     @B
  573.  
  574.         pop     edi
  575.         pop     esi
  576.  
  577. ;--------------------------------------
  578. align 4
  579. .ret:
  580.         pop     ebx
  581.         ret
  582. endp
  583. ;------------------------------------------------------------------------------
  584. align 4
  585. proc restore_16 stdcall, x:dword, y:dword
  586.  
  587.         push    ebx
  588.  
  589.         mov     ebx, [cur_saved_base]
  590.         mov     edx, [cur.h]
  591.         test    edx, edx
  592.         jz      .ret
  593.  
  594.         push    esi
  595.         push    edi
  596.  
  597.         mov     esi, cur_saved_data
  598. ;--------------------------------------
  599. align 4
  600. @@:
  601.         mov     edi, ebx
  602.         add     ebx, [_display.lfb_pitch]
  603.  
  604.         mov     ecx, [cur.w]
  605.         rep movsw
  606.         dec     edx
  607.         jnz     @B
  608.  
  609.         pop     edi
  610.         pop     esi
  611.  
  612. ;--------------------------------------
  613. align 4
  614. .ret:
  615.         pop     ebx
  616.         ret
  617. endp
  618. ;------------------------------------------------------------------------------
  619. align 4
  620. proc VGA_restore_32 stdcall, x:dword, y:dword
  621.  
  622.         push    ebx
  623.  
  624.         mov     ebx, [cur_saved_base]
  625.         mov     edx, [cur.h]
  626.         test    edx, edx
  627.         jz      .ret
  628.  
  629.         push    esi
  630.         push    edi
  631.  
  632.         mov     esi, cur_saved_data
  633.         mov     edi, ebx
  634.         push    [cur.w]
  635.         push    [cur.top];[y]
  636.         push    [cur.left];[x]
  637.         ;mov     eax, [cur.top]
  638.         ;add     [esp + 4], eax
  639.         ;mov     eax, [cur.left]
  640.         ;add     [esp], eax
  641. ;--------------------------------------
  642. align 4
  643. @@:
  644.         mov     ecx, [esi]
  645.         add     esi, 4
  646.  
  647.         ;mov     eax, [esp]
  648.         ;sub     eax, [x]
  649.         ;shl     eax, 2 ; *4
  650.         ;mov     [edi + eax], ecx
  651.  
  652.         mov     eax, [esp]
  653.         mov     ebx, [esp + 4]
  654.  
  655.         push    edx  edi
  656.         mov     edi, 1
  657.         or      ecx, 0x04000000
  658.         call    __sys_putpixel
  659.         pop     edi edx
  660.         add     dword[esp], 1
  661.         dec     dword[esp + 8]
  662.         jnz     @b
  663.  
  664.         mov     eax, [cur.w]
  665.         mov     ecx, [cur.left];[x]
  666.         ;add     ecx, [cur.left]
  667.         mov     [esp + 8], eax
  668.  
  669.         mov     dword[esp], ecx
  670.  
  671.         inc     dword[esp + 4]
  672.         ;add     edi, [_display.lfb_pitch]
  673.         dec     edx
  674.         jnz     @b
  675.  
  676.         add     esp, 4*3
  677.  
  678.         pop     edi
  679.         pop     esi
  680. ;--------------------------------------
  681. align 4
  682. .ret:
  683.         pop     ebx
  684.         ret
  685. endp
  686. ;------------------------------------------------------------------------------
  687. align 4
  688. proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
  689.            locals
  690.              h      dd ?
  691.              _dx     dd ?
  692.              _dy     dd ?
  693.            endl
  694.  
  695.         mov     esi, [hcursor]
  696.         mov     ecx, [x]
  697.         mov     eax, [y]
  698. ;        mov     ebx, [BytesPerScanLine]
  699.  
  700.         xor     edx, edx
  701.         sub     ecx, [esi + CURSOR.hot_x]
  702.         lea     ebx, [ecx + 32-1]
  703.         mov     [x], ecx
  704.         sets    dl
  705.         dec     edx
  706.         and     ecx, edx      ;clip x to 0<=x
  707.         mov     [cur.left], ecx
  708.         mov     edi, ecx
  709.         sub     edi, [x]
  710.         mov     [_dx], edi
  711.  
  712.         xor     edx, edx
  713.         sub     eax, [esi + CURSOR.hot_y]
  714.         lea     edi, [eax+32-1]
  715.         mov     [y], eax
  716.         sets    dl
  717.         dec     edx
  718.         and     eax, edx      ;clip y to 0<=y
  719.         mov     [cur.top], eax
  720.         mov     edx, eax
  721.         sub     edx, [y]
  722.         mov     [_dy], edx
  723.  
  724. ;        mul     dword [BytesPerScanLine]
  725.         mov     eax, [BPSLine_calc_area + eax*4]
  726.         lea     edx, [LFB_BASE + ecx*3]
  727.         add     edx, eax
  728.         mov     [cur_saved_base], edx
  729.  
  730.         cmp     ebx, [_display.width]
  731.         jb      @F
  732.         mov     ebx, [_display.width]
  733. ;--------------------------------------
  734. align 4
  735. @@:
  736.         cmp     edi, [_display.height]
  737.         jb      @F
  738.         mov     edi, [_display.height]
  739. ;--------------------------------------
  740. align 4
  741. @@:
  742.  
  743.         sub     ebx, [x]
  744.         sub     edi, [y]
  745.         sub     ebx, [_dx]
  746.         sub     edi, [_dy]
  747.  
  748.         mov     [cur.w], ebx
  749.         mov     [cur.h], edi
  750.         mov     [h], edi
  751.  
  752.         mov     eax, edi
  753.         mov     edi, cur_saved_data
  754. ;--------------------------------------
  755. align 4
  756. @@:
  757.         mov     esi, edx
  758.         add     edx, [_display.lfb_pitch]
  759.         mov     ecx, [cur.w]
  760.         lea     ecx, [ecx + ecx*2]
  761.         rep movsb
  762.         dec     eax
  763.         jnz     @B
  764.  
  765. ;draw cursor
  766.         mov     ebx, [cur_saved_base]
  767.         mov     eax, [_dy]
  768.         shl     eax, 5
  769.         add     eax, [_dx]
  770.  
  771.         mov     esi, [hcursor]
  772.         mov     esi, [esi + CURSOR.base]
  773.         lea     edx, [esi + eax*4]
  774. ;--------------------------------------
  775. align 4
  776. .row:
  777.         mov     ecx, [cur.w]
  778.         mov     esi, edx
  779.         mov     edi, ebx
  780.         add     edx, 32*4
  781.         add     ebx, [_display.lfb_pitch]
  782. ;--------------------------------------
  783. align 4
  784. .pix:
  785.         lodsd
  786.         test    eax, 0xFF000000
  787.         jz      @F
  788.         mov     [edi], ax
  789.         shr     eax, 16
  790.         mov     [edi+2], al
  791. ;--------------------------------------
  792. align 4
  793. @@:
  794.         add     edi, 3
  795.         dec     ecx
  796.         jnz     .pix
  797.  
  798.         dec     [h]
  799.         jnz     .row
  800.         ret
  801. endp
  802. ;------------------------------------------------------------------------------
  803. align 4
  804. proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
  805.            locals
  806.              h      dd ?
  807.              _dx     dd ?
  808.              _dy     dd ?
  809.            endl
  810.  
  811.         mov     esi, [hcursor]
  812.         mov     ecx, [x]
  813.         mov     eax, [y]
  814.  
  815.         xor     edx, edx
  816.         sub     ecx, [esi + CURSOR.hot_x]
  817.         lea     ebx, [ecx+32-1]
  818.         mov     [x], ecx
  819.         sets    dl
  820.         dec     edx
  821.         and     ecx, edx      ;clip x to 0<=x
  822.         mov     [cur.left], ecx
  823.         mov     edi, ecx
  824.         sub     edi, [x]
  825.         mov     [_dx], edi
  826.  
  827.         xor     edx, edx
  828.         sub     eax, [esi + CURSOR.hot_y]
  829.         lea     edi, [eax+32-1]
  830.         mov     [y], eax
  831.         sets    dl
  832.         dec     edx
  833.         and     eax, edx      ;clip y to 0<=y
  834.         mov     [cur.top], eax
  835.         mov     edx, eax
  836.         sub     edx, [y]
  837.         mov     [_dy], edx
  838.  
  839. ;        mul     dword [BytesPerScanLine]
  840.         mov     eax, [BPSLine_calc_area+eax*4]
  841.         lea     edx, [LFB_BASE + eax + ecx*4]
  842.         mov     [cur_saved_base], edx
  843.  
  844.         cmp     ebx, [_display.width]
  845.         jb      @F
  846.         mov     ebx, [_display.width]
  847. ;--------------------------------------
  848. align 4
  849. @@:
  850.         cmp     edi, [_display.height]
  851.         jb      @F
  852.         mov     edi, [_display.height]
  853. ;--------------------------------------
  854. align 4
  855. @@:
  856.         sub     ebx, [x]
  857.         sub     edi, [y]
  858.         sub     ebx, [_dx]
  859.         sub     edi, [_dy]
  860.  
  861.         mov     [cur.w], ebx
  862.         mov     [cur.h], edi
  863.         mov     [h], edi
  864.  
  865.         mov     eax, edi
  866.         mov     edi, cur_saved_data
  867. ;--------------------------------------
  868. align 4
  869. @@:
  870.         mov     esi, edx
  871.         add     edx, [_display.lfb_pitch]
  872.         mov     ecx, [cur.w]
  873.         rep movsd
  874.         dec     eax
  875.         jnz     @B
  876.  
  877. ;draw cursor
  878.         mov     ebx, [cur_saved_base]
  879.         mov     eax, [_dy]
  880.         shl     eax, 5
  881.         add     eax, [_dx]
  882.  
  883.         mov     esi, [hcursor]
  884.         mov     esi, [esi + CURSOR.base]
  885.         lea     edx, [esi+eax*4]
  886. ;--------------------------------------
  887. align 4
  888. .row:
  889.         mov     ecx, [cur.w]
  890.         mov     esi, edx
  891.         mov     edi, ebx
  892.         add     edx, 32*4
  893.         add     ebx, [_display.lfb_pitch]
  894. ;--------------------------------------
  895. align 4
  896. .pix:
  897.         lodsd
  898.         test    eax, 0xFF000000
  899.         jz      @F
  900.         mov     [edi], eax
  901. ;--------------------------------------
  902. align 4
  903. @@:
  904.         add     edi, 4
  905.         dec     ecx
  906.         jnz     .pix
  907.  
  908.         dec     [h]
  909.         jnz     .row
  910.         ret
  911. endp
  912. ;------------------------------------------------------------------------------
  913. align 4
  914. proc move_cursor_16 stdcall, hcursor:dword, x:dword, y:dword
  915.            locals
  916.              h      dd ?
  917.              _dx     dd ?
  918.              _dy     dd ?
  919.            endl
  920.  
  921.         mov     esi, [hcursor]
  922.         mov     ecx, [x]
  923.         mov     eax, [y]
  924.  
  925.         xor     edx, edx
  926.         sub     ecx, [esi + CURSOR.hot_x]
  927.         lea     ebx, [ecx + 32-1]
  928.         mov     [x], ecx
  929.         sets    dl
  930.         dec     edx
  931.         and     ecx, edx      ;clip x to 0<=x
  932.         mov     [cur.left], ecx
  933.         mov     edi, ecx
  934.         sub     edi, [x]
  935.         mov     [_dx], edi
  936.  
  937.         xor     edx, edx
  938.         sub     eax, [esi + CURSOR.hot_y]
  939.         lea     edi, [eax + 32-1]
  940.         mov     [y], eax
  941.         sets    dl
  942.         dec     edx
  943.         and     eax, edx      ;clip y to 0<=y
  944.         mov     [cur.top], eax
  945.         mov     edx, eax
  946.         sub     edx, [y]
  947.         mov     [_dy], edx
  948.  
  949. ;        mul     dword [BytesPerScanLine]
  950.         mov     eax, [BPSLine_calc_area + eax*4]
  951.         lea     edx, [LFB_BASE + eax + ecx*2]
  952.         mov     [cur_saved_base], edx
  953.  
  954.         cmp     ebx, [_display.width]
  955.         jb      @F
  956.         mov     ebx, [_display.width]
  957. ;--------------------------------------
  958. align 4
  959. @@:
  960.         cmp     edi, [_display.height]
  961.         jb      @F
  962.         mov     edi, [_display.height]
  963. ;--------------------------------------
  964. align 4
  965. @@:
  966.         sub     ebx, [x]
  967.         sub     edi, [y]
  968.         sub     ebx, [_dx]
  969.         sub     edi, [_dy]
  970.  
  971.         mov     [cur.w], ebx
  972.         mov     [cur.h], edi
  973.         mov     [h], edi
  974.  
  975.         mov     eax, edi
  976.         mov     edi, cur_saved_data
  977. ;--------------------------------------
  978. align 4
  979. @@:
  980.         mov     esi, edx
  981.         add     edx, [_display.lfb_pitch]
  982.         mov     ecx, [cur.w]
  983.  
  984.         rep movsw
  985.         dec     eax
  986.         jnz     @B
  987.  
  988. ;draw cursor
  989.         mov     ebx, [cur_saved_base]
  990.         mov     eax, [_dy]
  991.         shl     eax, 5
  992.         add     eax, [_dx]
  993.  
  994.         mov     esi, [hcursor]
  995.         mov     esi, [esi + CURSOR.base]
  996.         lea     edx, [esi + eax*4]
  997. ;--------------------------------------
  998. align 4
  999. .row:
  1000.         mov     ecx, [cur.w]
  1001.         mov     esi, edx
  1002.         mov     edi, ebx
  1003.         add     edx, 32*4
  1004.         add     ebx, [_display.lfb_pitch]
  1005. ;--------------------------------------
  1006. align 4
  1007. .pix:
  1008.         lodsd
  1009.         test    eax, 0xFF000000
  1010.         jz      @F
  1011. ; convert to 16 bpp and store to real LFB
  1012.         and     eax, 00000000111110001111110011111000b
  1013.         shr     ah, 2
  1014.         shr     ax, 3
  1015.         ror     eax, 8
  1016.         add     al, ah
  1017.         rol     eax, 8
  1018.         mov     [edi], ax
  1019. ;--------------------------------------
  1020. align 4
  1021. @@:
  1022.         add     edi, 2
  1023.         dec     ecx
  1024.         jnz     .pix
  1025.  
  1026.         dec     [h]
  1027.         jnz     .row
  1028.         ret
  1029. endp
  1030.  
  1031. ;------------------------------------------------------------------------------
  1032. align 4
  1033. proc VGA_move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
  1034.            locals
  1035.              h      dd ?
  1036.              _dx     dd ?
  1037.              _dy     dd ?
  1038.              bg_ptr dd ?
  1039.              tmp_x  dd ?
  1040.              tmp_y  dd ?
  1041.            endl
  1042.  
  1043.         mov     esi, [hcursor]
  1044.         mov     ecx, [x]
  1045.         mov     eax, [y]
  1046.  
  1047.         xor     edx, edx
  1048.         sub     ecx, [esi + CURSOR.hot_x]
  1049.         lea     ebx, [ecx+32-1]
  1050.         mov     [x], ecx
  1051.         sets    dl
  1052.         dec     edx
  1053.         and     ecx, edx      ;clip x to 0<=x
  1054.         mov     [cur.left], ecx
  1055.         mov     edi, ecx
  1056.         sub     edi, [x]
  1057.         mov     [_dx], edi
  1058.  
  1059.         xor     edx, edx
  1060.         sub     eax, [esi + CURSOR.hot_y]
  1061.         lea     edi, [eax+32-1]
  1062.         mov     [y], eax
  1063.         sets    dl
  1064.         dec     edx
  1065.         and     eax, edx      ;clip y to 0<=y
  1066.         mov     [cur.top], eax
  1067.         mov     edx, eax
  1068.         sub     edx, [y]
  1069.         mov     [_dy], edx
  1070.  
  1071.         mov     [tmp_x], ecx
  1072.         mov     [tmp_y], eax
  1073.         mov     eax, [BPSLine_calc_area+eax*4]
  1074.         lea     edx, [LFB_BASE + eax + ecx*4]
  1075.         mov     [cur_saved_base], edx
  1076.  
  1077.         cmp     ebx, [_display.width]
  1078.         jb      @F
  1079.         mov     ebx, [_display.width]
  1080. ;--------------------------------------
  1081. align 4
  1082. @@:
  1083.         cmp     edi, [_display.height]
  1084.         jb      @F
  1085.         mov     edi, [_display.height]
  1086. ;--------------------------------------
  1087. align 4
  1088. @@:
  1089.         sub     ebx, [x]
  1090.         sub     edi, [y]
  1091.         sub     ebx, [_dx]
  1092.         sub     edi, [_dy]
  1093.  
  1094.         mov     [cur.w], ebx
  1095.         mov     [cur.h], edi
  1096.         mov     [h], edi
  1097.  
  1098.         mov     eax, edi
  1099.         mov     edi, cur_saved_data
  1100.  
  1101.         xor     ecx, ecx
  1102.         mov     eax, ecx
  1103. ;--------------------------------------
  1104. align 4
  1105. @@:
  1106.         ; get and save pixel background
  1107.         push    eax ecx ebx edx
  1108.         add     eax, [tmp_x]
  1109.         mov     ebx, ecx
  1110.         add     ebx, [tmp_y]
  1111.         push    edi
  1112.  
  1113.         or      ecx, 0x04000000
  1114.         call    [GETPIXEL]
  1115.  
  1116.         pop     edi
  1117.         ;and     ecx, 0x00ffffff
  1118.         mov     [edi], ecx
  1119.         add     edi, 4
  1120.  
  1121.         pop     edx ebx ecx eax
  1122.         inc     eax
  1123.         cmp     eax, [cur.w]
  1124.         jb      @b
  1125.         xor     eax, eax
  1126.         inc     ecx
  1127.         cmp     ecx, [h]
  1128.         jb      @B
  1129.  
  1130. ;draw cursor
  1131.         mov     ebx, [cur_saved_base]
  1132.         mov     eax, [_dy]
  1133.         shl     eax, 5
  1134.         add     eax, [_dx]
  1135.  
  1136.         mov     esi, [hcursor]
  1137.         mov     esi, [esi + CURSOR.base]
  1138.         lea     edx, [esi+eax*4]
  1139.         mov     [bg_ptr], cur_saved_data
  1140.  
  1141.         mov     [_dy], 0
  1142. ;--------------------------------------
  1143. align 4
  1144. .row:
  1145.         mov     [_dx], 0
  1146.         mov     ecx, [cur.w]
  1147.         mov     esi, edx  ; cursor image base
  1148.         mov     edi, ebx
  1149.         add     edx, 32*4
  1150.         add     ebx, [_display.lfb_pitch]
  1151. ;--------------------------------------
  1152. align 4
  1153. .pix:
  1154.         ; get pixel cursor
  1155.         lodsd
  1156.         test    eax, 0xFF000000
  1157.         jz      @F
  1158.         mov     [edi], eax
  1159.  
  1160.         pusha
  1161.         mov     edi, 1 ; force
  1162.         mov     ecx, eax ; color
  1163.         and     ecx, 0x00ffffff
  1164.         or      ecx, 0x04000000
  1165.         mov     eax, [x]
  1166.         mov     ebx, [y]
  1167.         add     eax, [_dx]
  1168.         add     ebx, [_dy]
  1169.         call    __sys_putpixel
  1170.         popa
  1171. ;--------------------------------------
  1172. align 4
  1173. @@:
  1174.         inc     [_dx]
  1175.         add     edi, 4
  1176.         dec     ecx
  1177.         jnz     .pix
  1178.  
  1179.         inc     [_dy]
  1180.         dec     [h]
  1181.         jnz     .row
  1182.         ret
  1183. endp
  1184.  
  1185. ;------------------------------------------------------------------------------
  1186. align 4
  1187. check_mouse_area_for_getpixel_new:
  1188. ; in:
  1189. ; eax = x
  1190. ; ebx = y
  1191. ; out:
  1192. ; ecx = new color
  1193. ;--------------------------------------
  1194. ; check for Y
  1195.         cmp     bx, [Y_UNDER_subtraction_CUR_hot_y]
  1196.         jb      .no_mouse_area
  1197.  
  1198.         cmp     bx, [Y_UNDER_sub_CUR_hot_y_add_curh]
  1199.         jae     .no_mouse_area
  1200. ;--------------------------------------
  1201. ; check for X
  1202.         cmp     ax, [X_UNDER_subtraction_CUR_hot_x]
  1203.         jb      .no_mouse_area
  1204.  
  1205.         cmp     ax, [X_UNDER_sub_CUR_hot_x_add_curh]
  1206.         jae     .no_mouse_area
  1207. ;--------------------------------------
  1208.         push    eax ebx
  1209. ; offset X
  1210.         movzx   ecx, word [X_UNDER_subtraction_CUR_hot_x]
  1211.         sub     eax, ecx        ; x1
  1212. ; offset Y
  1213.         movzx   ecx, word [Y_UNDER_subtraction_CUR_hot_y]
  1214.         sub     ebx, ecx        ; y1
  1215. ;--------------------------------------
  1216. ; ebx = offset y
  1217. ; eax = offset x
  1218.         imul    ebx, [cur.w]     ;y
  1219.         add     eax, ebx
  1220.         mov     ebx, eax
  1221.         shl     eax, 2
  1222.         cmp     byte [_display.bits_per_pixel], 32
  1223.         je      @f
  1224.         sub     eax, ebx
  1225.         cmp     byte [_display.bits_per_pixel], 24
  1226.         je      @f
  1227.         sub     eax, ebx
  1228.         add     eax, cur_saved_data
  1229.         mov     ecx, [eax]
  1230.         shl     ecx, 3
  1231.         ror     ecx, 8
  1232.         shl     cx, 2
  1233.         ror     ecx, 8
  1234.         shl     cl, 3
  1235.         rol     ecx, 16
  1236.         or      ecx, 0xff000000
  1237.         pop     ebx eax
  1238.         ret
  1239.  
  1240. ;--------------------------------------
  1241. align 4
  1242. @@:
  1243.         add     eax, cur_saved_data
  1244.         mov     ecx, [eax]
  1245.         or      ecx, 0xff000000
  1246.         pop     ebx eax
  1247.         ret
  1248. ;--------------------------------------
  1249. align 4
  1250. .no_mouse_area:
  1251.         xor     ecx, ecx
  1252.         ret
  1253. ;-----------------------------------------------------------------------------
  1254. align 4
  1255. check_mouse_area_for_putpixel_new:
  1256. ; in:
  1257. ; ecx = x shl 16 + y
  1258. ; eax = color
  1259. ; out:
  1260. ; eax = new color
  1261. ;--------------------------------------
  1262. ; check for Y
  1263.         cmp     cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
  1264.         jae     .no_mouse_area
  1265.  
  1266.         sub     cx, [Y_UNDER_subtraction_CUR_hot_y]
  1267.         jb      .no_mouse_area
  1268.  
  1269.         rol     ecx, 16
  1270. ;--------------------------------------
  1271. ; check for X
  1272.         cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
  1273.         jae     .no_mouse_area
  1274.  
  1275.         sub     cx, [X_UNDER_subtraction_CUR_hot_x]
  1276.         jb      .no_mouse_area
  1277.  
  1278.         ror     ecx, 16
  1279. ;--------------------------------------
  1280. align 4
  1281. .1:
  1282.         push    eax
  1283. ;--------------------------------------
  1284. ; ecx = (offset x) shl 16 + (offset y)
  1285.         push    ebx
  1286.         mov     ebx, ecx
  1287.         shr     ebx, 16        ; x
  1288.         and     ecx, 0xffff    ; y
  1289.  
  1290.         cmp     ecx, [cur.h]
  1291.         jae     @f
  1292.  
  1293.         cmp     ebx, [cur.w]
  1294.         jb      .ok
  1295. ;--------------------------------------
  1296. align 4
  1297. @@:
  1298. ;        DEBUGF  1, "K : SHIT HAPPENS: %x %x \n", ecx,ebx
  1299.         pop     ebx
  1300.         jmp     .sh   ; SORRY! SHIT HAPPENS!
  1301. ;--------------------------------------
  1302. align 4
  1303. .ok:
  1304. ; ecx = offset y
  1305. ; ebx = offset x
  1306.         push    ebx ecx
  1307.         imul    ecx, [cur.w]    ;y
  1308.         add     ecx, ebx
  1309.         mov     ebx, ecx
  1310.         shl     ecx, 2
  1311.         cmp     byte [_display.bits_per_pixel], 16
  1312.         je      .16
  1313.         cmp     byte [_display.bits_per_pixel], 24
  1314.         je      .24
  1315.         and     eax, 0xFFFFFF
  1316.         mov     [ecx + cur_saved_data], eax   ;store new color  to
  1317.         jmp     @f
  1318. ;--------------------------------------
  1319. align 4
  1320. .16:
  1321.         sub     ecx, ebx
  1322.         sub     ecx, ebx
  1323. ; convert to 16 bpp and store to real LFB
  1324.         and     eax, 00000000111110001111110011111000b
  1325.         shr     ah, 2
  1326.         shr     ax, 3
  1327.         ror     eax, 8
  1328.         add     al, ah
  1329.         rol     eax, 8
  1330.         mov     [ecx + cur_saved_data], ax      ;store new color  to
  1331.         jmp     @f
  1332. ;--------------------------------------
  1333. align 4
  1334. .24:
  1335.         sub     ecx, ebx
  1336.         mov     [ecx + cur_saved_data], ax      ;store new color  to
  1337.         shr     eax, 16
  1338.         mov     [ecx + cur_saved_data + 2], al  ;store new color  to
  1339. ;--------------------------------------
  1340. align 4
  1341. @@:
  1342.         pop     ecx ebx
  1343.  
  1344.         shl     ecx, 5
  1345.         add     ecx, ebx
  1346.  
  1347.         mov     eax, [current_cursor]
  1348.         mov     eax, [eax + CURSOR.base]
  1349.         lea     eax, [eax + ecx*4]
  1350.         mov     eax, [eax]
  1351.  
  1352.         pop     ebx
  1353.  
  1354.         test    eax, 0xFF000000
  1355.         jz      @f
  1356.  
  1357.         add     esp, 4
  1358.         ret
  1359. ;--------------------------------------
  1360. align 4
  1361. .sh:
  1362.         mov     ecx, -1
  1363. ;--------------------------------------
  1364. align 4
  1365. @@:
  1366.         pop     eax
  1367. ;--------------------------------------
  1368. align 4
  1369. .no_mouse_area:
  1370.         ret
  1371. ;------------------------------------------------------------------------------
  1372. align 4
  1373. get_display:
  1374.         mov     eax, _display
  1375.         ret
  1376. ;------------------------------------------------------------------------------
  1377. align 4
  1378. init_display:
  1379.         xor     eax, eax
  1380.         mov     edi, _display
  1381.  
  1382.         mov     [edi + display_t.init_cursor], eax
  1383.         mov     [edi + display_t.select_cursor], eax
  1384.         mov     [edi + display_t.show_cursor], eax
  1385.         mov     [edi + display_t.move_cursor], eax
  1386.         mov     [edi + display_t.restore_cursor], eax
  1387.  
  1388.         lea     ecx, [edi + display_t.cr_list.next]
  1389.         mov     [edi + display_t.cr_list.next], ecx
  1390.         mov     [edi + display_t.cr_list.prev], ecx
  1391.  
  1392.         cmp     [SCR_MODE], word 0x12
  1393.         jne     .not_vga
  1394.         ; TODO
  1395.         mov     ebx, VGA_restore_32
  1396.         mov     ecx, VGA_move_cursor_32
  1397.         mov     edx, VGA_putpixel
  1398.         jmp     .set
  1399.  
  1400. .not_vga:
  1401.         test    word [SCR_MODE], 0x4000
  1402.         jnz     .not_ega
  1403.  
  1404.         mov     ebx, restore_32
  1405.         mov     ecx, move_cursor_32
  1406.         mov     edx, Vesa20_putpixel32_new
  1407.         mov     eax, [_display.bits_per_pixel]
  1408.         jmp     .set
  1409.  
  1410. .not_ega:
  1411.         mov     ebx, restore_32
  1412.         mov     ecx, move_cursor_32
  1413.         mov     edx, Vesa20_putpixel32_new
  1414.         mov     eax, [_display.bits_per_pixel]
  1415.  
  1416.         cmp     al, 32
  1417.         jne     .not_32bpp
  1418.  
  1419. .set:
  1420.         mov     [_display.select_cursor], select_cursor
  1421.         mov     [_display.move_cursor], ecx
  1422.         mov     [_display.restore_cursor], ebx
  1423.         ;mov     [_display.check_mouse], check_mouse_area_for_putpixel_new
  1424.         ;mov     [_display.check_m_pixel], check_mouse_area_for_getpixel_new
  1425.  
  1426.         mov     [PUTPIXEL], edx
  1427.  
  1428.         stdcall load_cursor, def_hresize, dword LOAD_FROM_MEM
  1429.         mov     [def_cursor_hresize], eax
  1430.         stdcall load_cursor, def_vresize, dword LOAD_FROM_MEM
  1431.         mov     [def_cursor_vresize], eax
  1432.         stdcall load_cursor, def_dresize1, dword LOAD_FROM_MEM
  1433.         mov     [def_cursor_dresize1], eax
  1434.         stdcall load_cursor, def_dresize2, dword LOAD_FROM_MEM
  1435.         mov     [def_cursor_dresize2], eax
  1436.  
  1437.         stdcall load_cursor, clock_arrow, dword LOAD_FROM_MEM
  1438.         mov     [def_cursor_clock], eax
  1439.         stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
  1440.         mov     [def_cursor], eax
  1441.         ret
  1442.  
  1443. .not_32bpp:
  1444.         cmp     al, 24
  1445.         jne     .not_24bpp
  1446.  
  1447.         mov     ebx, restore_24
  1448.         mov     ecx, move_cursor_24
  1449.         mov     edx, Vesa20_putpixel24_new
  1450.         jmp     .set
  1451.  
  1452. .not_24bpp:
  1453.         cmp     al, 16
  1454.         jne     .not_16bpp
  1455.         mov     ebx, restore_16
  1456.         mov     ecx, move_cursor_16
  1457.         mov     edx, Vesa20_putpixel16_new
  1458.         jmp     .set
  1459.  
  1460. .not_16bpp:
  1461. ;        cmp     al, 15
  1462. ;        jne     .fail
  1463. ;        mov     ebx, restore_15
  1464. ;        mov     ecx, move_cursor_15
  1465. ;        mov     edx, Vesa20_putpixel15_new
  1466. ;        jmp     .set
  1467. .fail:
  1468.         ;xor     eax, eax
  1469.         ;mov     [_display.select_cursor], eax
  1470.         ;mov     [_display.move_cursor], eax
  1471.         ret
  1472. ;------------------------------------------------------------------------------
  1473. align 4
  1474. def_arrow:
  1475.   file 'arrow.cur'
  1476. ;------------------------------------------------------------------------------
  1477. align 4
  1478. def_hresize:
  1479.   file 'hresize.cur'
  1480. ;------------------------------------------------------------------------------
  1481. align 4
  1482. def_vresize:
  1483.   file 'vresize.cur'
  1484. ;------------------------------------------------------------------------------
  1485. align 4
  1486. def_dresize1:
  1487.   file 'dresize1.cur'
  1488. ;------------------------------------------------------------------------------
  1489. align 4
  1490. def_dresize2:
  1491.   file 'dresize2.cur'
  1492. ;------------------------------------------------------------------------------
  1493. align 4
  1494. clock_arrow:
  1495.   file 'arrow_clock.cur'
  1496. ;------------------------------------------------------------------------------
  1497.  
  1498.