home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / PVQUAN15.ZIP / VGA.ZIP / VGA_RETR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-19  |  1.4 KB  |  35 lines

  1. /************************************************************************
  2.  *                                                                      *
  3.  *                  Copyright (c) 1991, Frank van der Hulst             *
  4.  *                          All Rights Reserved                         *
  5.  *                                                                      *
  6.  * Authors:                                                             *
  7.  *          FvdH - Frank van der Hulst (Wellington, NZ)                     *
  8.  *                                                                      *
  9.  * Versions:                                                            *
  10.  *    V1.1 910626 FvdH - QUANT released for DBW_RENDER                    *
  11.  *    V1.2 911021 FvdH - QUANT released for PoV Ray                      *
  12.  *    V1.3 911030 FvdH - Added 320x200x256x4 pages support                    *
  13.  *                                                                      *
  14.  ************************************************************************/
  15. /*
  16. VGA Vertical retrace detection module.
  17. */
  18.  
  19. #include <dos.h>
  20. #include <vga.h>
  21.  
  22. #define DISPIO             0x3DA
  23. #define VRT_bit            8
  24.  
  25. void WaitForVerticalRetrace(void)
  26. {
  27. static char chopper = 1;
  28.  
  29.     while (inportb(DISPIO) & VRT_bit)             /* wait */ ;
  30.     while ((inportb(DISPIO) & VRT_bit) == 0)    /* wait */ ;
  31.     if ((chopper++ & 1)== 0)        outportb(0x3fc, 1);
  32.     else                                    outportb(0x3fc, 3);
  33. }
  34.  
  35.