delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/04/15:25:24

From: Gary Preston <gary AT prestons DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Vertical Retrace
Date: Wed, 4 Jun 1997 18:58:04 +0100
Organization: None
Distribution: world
Message-ID: <zT5RRDAsyalzEw6A@prestons.demon.co.uk>
NNTP-Posting-Host: prestons.demon.co.uk
MIME-Version: 1.0
Lines: 30
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

  I've been trying to get my code synced with the verticle retrace for
the past few days, I already know how to do this using Turbo c (16 bit)
and presumed there would be no difference with djgpp since both
have the call inp this does not work however.

Below is the code I'm using for vsync and the defines can someone
clarify whether I should be doing this another way and if so how and
more importantly why since inp is available?

#define VGA_INPUT_STATUS_1 0x3DA
#define VGA_VSYNC_MASK 0x08


void Vertical_Retrace( void )
{

  while(  inportb( VGA_INPUT_STATUS_1 ) & VGA_VSYNC_MASK )  {}
  while(!(inportb( VGA_INPUT_STATUS_1 ) & VGA_VSYNC_MASK ) ){}

}



-- 
Gary Preston. Gary AT prestons DOT demon DOT co DOT uk
Last game (SpaceFighter) available from my web page:
http://www.prestons.demon.co.uk/index.html
Its only a bug if someone else wrote it, otherwise its a special feature.

- Raw text -


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