delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/10/14/20:36:53

Date: Fri, 14 Oct 1994 16:18:57 -0400 (EDT)
From: David Max <max AT SLINKY DOT CS DOT NYU DOT EDU>
Subject: Re: GAS
To: David DOT Black AT newcastle DOT ac DOT uk
Cc: DJGPP <djgpp AT sun DOT soe DOT clarkson DOT edu>

> 	and secondly [and a little more technically] does any one know
> 	how to detect the video frame fly back signal from a VGA card?
> 

Here you go (neither of these solutions is my original handiwork): 

SOLUTION #1:

Waiting for the vertical retrace period is done as follow

   mov dx, 3dah   ; general register
_again:
   in  al, dx     ; get raster status
   test al, 8     ; test vertical retrace bit
   jz _again      ; if not in retrace sit in loop

SOLUTION #2:

I think you need to include one or both of pc.h and dos.h to use this
 
#define DISPIO             0x3DA
#define VRT_bit            8
 
/* Wait for Vertical Retrace before continuing */
while (inportb(DISPIO) & VRT_bit);
while ((inportb(DISPIO) & VRT_bit) == 0);
    

Good luck,

David Max 
New York University


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019