From: sorry AT too DOT dangerous (Fly Boy) Newsgroups: comp.os.msdos.djgpp Subject: Re: 2 graphics questions Date: Tue, 11 Feb 1997 19:36:16 GMT Lines: 26 Message-ID: <3300b67e.2979457@news.telepac.pt> References: <01bc0fa6$3d6be440$5357f8ce AT 698130> <5d6cpv$b2o AT waldorf DOT csc DOT calpoly DOT edu> NNTP-Posting-Host: alm2_p2.telepac.pt To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On 4 Feb 1997 04:09:35 GMT, jlouwere AT galaxy DOT csc DOT calpoly DOT edu (Jan Louwerens) wrote: >Ian Mausolus (mausolus AT ican DOT net) wrote: >: What is that vertical retrace stuff all about? Do you actaully have to >: check to see if the video card or monitor is finished drawing to the screen >: before displaying another picture? and how do you do that? > >You don't have to wait for vertical retrace, but it could make your >animations look smoother by avoiding shearing.Her is how it's done: > >#include > >#define RetracePort 0x03DA > >void WaitVertRetrace(void) >{ > while(inportb(RetracePort) & 0x08); // wait for end if already in VR > while(!(inportb(RetracePort) & 0x08)); // wait for VR to start... > // this way you get the entire VR >} > >JL > Is there any way to have the vertical retrace generate a hardware interrupt, so that you do not burn CPU cycles away waiting for it ?