home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 361_01 / clr.c < prev    next >
C/C++ Source or Header  |  1991-09-20  |  849b  |  35 lines

  1.  
  2.  
  3. /* Clr.c --> Using Scroll (Interrupt 0x10h, 6/7h) to Clear the CRT.
  4.  *
  5.  * Author: J.Ekwall                                     13 September 91
  6.  *
  7.  * Copyrighted to the Public Domain.  Unlimited Distribution Authorized.
  8.  *
  9.  * User Assumes All Risks/Liabilities.
  10.  *
  11.  * Last Update: 13 September 91/EK
  12.  */
  13.  
  14. #include <stdek.h>
  15. #include <gadgets.h>
  16. #include <dos.h>
  17.  
  18. void ClrTo(int X, int Color)
  19. /* Clear from the current cursor location thru X. */
  20. {
  21.     int xx, yy;
  22.         
  23.     Getxy(&xx, &yy); if (X < xx) return; Scroll(xx, yy, X, yy, Color, 0, 0);
  24. }
  25.  
  26. void Scroll(int Left, int Top, int Right, int Bottom, int Color, int N, 
  27.    int Flag)
  28. {
  29.    union REGS rg;
  30.  
  31.    rg.h.bh = Color; rg.h.cl = --Left; rg.h.ch = --Top; rg.h.dl = --Right;
  32.    rg.h.dh = --Bottom; rg.h.al = N; rg.h.ah = 7 - !Flag; int86(0x10,&rg,&rg);
  33. }
  34.  
  35.