home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 328_01 / wcursor.c < prev    next >
C/C++ Source or Header  |  1991-03-17  |  1KB  |  86 lines

  1. /*! wcursor
  2.  *
  3.  *
  4.  *    turn cursor on or off
  5.  *
  6.  *     use :     1 = ON  turns cursor on
  7.  *           0 = OFF turns cursor off
  8.  *
  9.  */
  10. #include "wscreen.h"
  11. #include "wsys.h"
  12.  
  13.  
  14. #include <dos.h>
  15.  
  16.  
  17.  
  18. void wcursor(int want_cursor)
  19.     {
  20.     int row, col, page;
  21.  
  22.     PSEUDOREGS;
  23.  
  24.  
  25.  
  26.  
  27.     #ifndef TEXTONLY
  28.  
  29.         if (wmode == 'G')
  30.             {
  31.             return;
  32.             }
  33.  
  34.     #endif    /* TEXTONLY */
  35.  
  36.  
  37.  
  38.  
  39.     if        (want_cursor == ON)
  40.         {
  41.         w0-> winflag |= WFL_CURSOR;
  42.  
  43.         /* move the physical cursor to the logical location
  44.          *     NOTE that using TurboC's pseudoregs
  45.          *     means all far * calculations have to
  46.          *     be done before loading regs.
  47.          */
  48.         page = w0-> winpage;
  49.         col = w0-> winleft +w0->winx;
  50.         row = w0-> wintop  +w0->winy;
  51.         _DH = row;
  52.         _DL = col;
  53.         _BH = page;
  54.         _AH = 2;       /* function to set cursor position */
  55.         INTERRUPT(0x10);
  56.  
  57.         /*load new cursor size
  58.          */
  59.         _CX = wcurscanln;
  60.  
  61.         _AH = 1;    /* indicates cursor size request */
  62.         INTERRUPT (0x10);
  63.  
  64.  
  65.  
  66.         }
  67.  
  68.     else     /* want_cursor OFF */
  69.         {
  70.         w0-> winflag &= (0xff - WFL_CURSOR);
  71.  
  72.         _CH = 0x2E;  /* stop cursor */
  73.         _CL = 0x20;
  74.         _AH = 1;
  75.         INTERRUPT (0x10);
  76.         }
  77.  
  78.     return;
  79.     }    /*end wcursor routine */
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.