From: aleksi AT kalliot DOT pp DOT fi (Aleksi Kallio) Newsgroups: comp.os.msdos.djgpp Subject: Re: Synchronising graphics with the screen Date: Thu, 12 Dec 1996 19:24:13 GMT Lines: 21 Message-ID: <32b02f61.760381@news.eunet.fi> References: <32AD6A7A DOT 41C67EA6 AT ic DOT ac DOT uk> NNTP-Posting-Host: kalliot.pp.fi To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp >I am useing DJGPP, and have written several graphicsy type programs. >Unfortunately the plotting commands are completely out of synch with the >monitor. Consequently the image looks crap. Please help. >Is there some internal register or variable which can be monitored using >inline assembly? An interrupt? I think what you need is vertical retrace synchronisation. When picture is been drawed, from left to right, up to down, the electron gun(or something) traces back to upper left corner after drawing the image, so then is the time to copy everything from screen double buffer to actual screen. This function does the job and should work with DJGPP. void WaitVSync() { while ( inp(0x3DA) & 0x08) {} while (!inp(0x3DA) & 0x08) {} } Aleksi Kallio