home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / alde_c / misc / func / advc / video.c < prev   
Encoding:
C/C++ Source or Header  |  1988-12-29  |  2.3 KB  |  81 lines

  1. #include <dos.h>
  2.  
  3. void bkscroll(lcol,trow,rcol,brow,lines)  /* scroll a screen area down */
  4.    int lcol, trow, rcol, brow, lines;
  5. {
  6.    union REGS inregs;
  7.    union REGS outregs;
  8.  
  9.    inregs.h.ah = 15;                    /* get active display page */
  10.    int86(0x10,&inregs,&outregs);
  11.    inregs.h.bh = outregs.h.bh;
  12.    inregs.h.dl = --lcol;
  13.    inregs.h.dh = --trow;
  14.    inregs.h.ah = 2;                     /* set cursor position */
  15.    int86(0x10,&inregs,&outregs);
  16.    inregs.h.ah = 8;                     /* get color/attribute */
  17.    int86(0x10,&inregs,&outregs);
  18.    inregs.h.bh = outregs.h.ah;
  19.    inregs.h.cl = lcol;
  20.    inregs.h.ch = trow;
  21.    inregs.h.dl = --rcol;
  22.    inregs.h.dh = --brow;
  23.    inregs.h.al = lines;
  24.    inregs.h.ah = 7;                     /* do the backscroll */
  25.    int86(0x10,&inregs,&outregs);
  26. }
  27.  
  28.  
  29.  
  30.  
  31.  
  32. void clreol()                         /* clear from cursor to end of line */
  33. {
  34.    union REGS inregs;
  35.    union REGS outregs;
  36.    int attr, columns;
  37.  
  38.    inregs.h.ah = 15;                       /* get display page, columns */
  39.    int86(0x10,&inregs,&outregs);
  40.    inregs.h.bh = outregs.h.bh;
  41.    columns = outregs.h.ah;
  42.    inregs.h.ah = 8;                        /* get color/attribute */
  43.    int86(0x10,&inregs,&outregs);
  44.    attr = outregs.h.ah;
  45.    inregs.h.ah = 3;                        /* get cursor position */
  46.    int86(0x10,&inregs,&outregs);
  47.    inregs.h.bl = attr;
  48.    inregs.x.cx = columns - outregs.h.dl;
  49.    inregs.x.ax = 0x0920;                   /* write spaces until EOLN */
  50.    int86(0x10,&inregs,&outregs);
  51. }
  52.  
  53.  
  54.  
  55.  
  56.  
  57. void scroll(lcol,trow,rcol,brow,lines)   /* scroll a screen area up */
  58.    int lcol, trow, rcol, brow, lines;
  59. {
  60.    union REGS inregs;
  61.    union REGS outregs;
  62.  
  63.    inregs.h.ah = 15;                    /* get active display page */
  64.    int86(0x10,&inregs,&outregs);
  65.    inregs.h.bh = outregs.h.bh;
  66.    inregs.h.dl = --lcol;
  67.    inregs.h.dh = --trow;
  68.    inregs.h.ah = 2;                     /* set cursor position */
  69.    int86(0x10,&inregs,&outregs);
  70.    inregs.h.ah = 8;                     /* get color/attribute */
  71.    int86(0x10,&inregs,&outregs);
  72.    inregs.h.bh = outregs.h.ah;
  73.    inregs.h.cl = lcol;
  74.    inregs.h.ch = trow;
  75.    inregs.h.dl = --rcol;
  76.    inregs.h.dh = --brow;
  77.    inregs.h.al = lines;
  78.    inregs.h.ah = 6;                     /* do the scroll */
  79.    int86(0x10,&inregs,&outregs);
  80. }
  81.