home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.apple2
- Path: sparky!uunet!usc!elroy.jpl.nasa.gov!nntp-server.caltech.edu!toddpw
- From: toddpw@cco.caltech.edu (Todd P. Whitesel)
- Subject: Re: When is the tick counter incremented?
- Message-ID: <1992Aug27.033705.14955@cco.caltech.edu>
- Sender: news@cco.caltech.edu
- Nntp-Posting-Host: punisher
- Organization: California Institute of Technology, Pasadena
- References: <1992Aug26.185150.22795@julian.uwo.ca>
- Date: Thu, 27 Aug 1992 03:37:05 GMT
- Lines: 28
-
- hackett@gaul.csd.uwo.ca (Mike Hackett) writes:
-
- >reading TN #39 several times, I'm not entirely sure exactly when the tick
- >counter is incremented. The note seems to suggest that the vertical
- >blanking interrupt occurs at line 192. (Actually, it often refers to the
- >vertical blanking actually occurring at 192, but this is not true.)
- >The vertical counter should then be $1C0, I believe.
-
- heh ... //e history time folks. The //e has a vertical blanking signal you can
- read at $C019 if I remember right. The Mega II in the IIgs, seeing as how it
- was originally designed for a low-cost //e model and not the IIgs, also
- generates this signal. This signal is output on a pin of the Mega II and the
- VGC uses it to generate an interrupt on the edge that counts. This edge occurs
- at line 192 all the time -- you've got to understand that the Mega II does all
- the actual timing generation, and the VGC simply genlocks to it when SHR mode
- is active. The timing of the VBL signal does not change because it is hardwired
- into the Mega II timing generator. Once this interrupt is generated, it usually
- gets handled by the heartbeat queue manager, one of whose tasks is to increment
- the system tick count. This increment is atomic since it happens from the IRQ
- handler, BUT it occurs at a variable delay after the VBL interrupt hits. This
- is due to indeterminacy in the response time -- if another interrupt is already
- being handled, the heartbeat manager must wait until it's done before it can
- run. There also may be variable delays within the heartbeat queue handler
- itself, depending on what order it increments the counter and calls the tasks
- in the queue (it's been a while since I traced through the sucker with GSbug).
-
- Todd Whitesel
- toddpw @ cco.caltech.edu
-