Mail Archives: djgpp/1996/12/13/12:12:29
>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
- Raw text -