Message-Id: <335F7F77.21A3@canvaslink.com> Date: Thu, 24 Apr 1997 11:42:47 -0400 From: Tom Grandgent Reply-To: tgrand AT canvaslink DOT com Organization: Canvas Link, Inc. Mime-Version: 1.0 To: Christoph Kukulies Cc: noss AT pupk DOT unibe DOT ch, djgpp AT delorie DOT com Subject: Re: timer interrupt - sample code anyone? References: <199704240849 DOT KAA21592 AT gilberto DOT physik DOT rwth-aachen DOT de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Christoph Kukulies wrote: > > > At 02:57 PM 4/23/97 -0400, you wrote: > > > > >Ok, I have a system of measuring the frame rate in my game that I > > >think is pretty foolproof. I have a variable called frame_count that > > >is incremented at the end of every frame. I then have an ISR which > > >is called once per second. In this ISR, I copy frame_count into > > >a variable called fps, then I set frame_count back to 0. > > > > > > Tom Grandgent > > > > And how do you detect the end of every frame? From VGA specs I found on the > > Web I read that bit 3 of 0x3CA is set during vertical retrace but I have not > > been able to capture it. Am I barking up the wrong tree? Is there a > > I think he is talking about frames that his program writes, not the > VGA vsync framerate. Although buffer switching with the video framerate > would be optimal, I think. Or am *I* now off tagret? ;) > > Chris Christoph P. U. Kukulies kuku AT gil DOT physik DOT rwth-aachen DOT de Yes, you are correct- I consider the end of the frame to be at the bottom of my main loop, after the frame has been drawn and I have flipped pages (or copied the offscreen buffer to the screen, depending on what animation method is currently selected). However, it's pretty easy to find vertical retrace. This should wait for the vertical retrace: while (inportb(0x3DA) & 1); Tom Grandgent tgrand AT canvaslink DOT com Canvas Link, Inc.