home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!emory!swrinde!network.ucsd.edu!ucsbcsl!mcl!uerics
- From: uerics@mcl.ucsb.edu (Eric D. Shepherd)
- Newsgroups: comp.sys.apple2
- Subject: Re: Program idea?
- Message-ID: <uerics.726359386@mcl>
- Date: 6 Jan 93 22:29:46 GMT
- References: <bazyar.726298918@teal> <1993Jan6.100420.19800@nuscc.nus.sg>
- Sender: root@ucsbcsl.ucsb.edu
- Lines: 33
-
- The IIGS Heartbeat is an interrupt which occurs once every 1/60th of a
- second, more or less (the variation is generally minimal, unless you have
- disabled interrupts during that time, which would stop the heartbeat from
- occurring). Basically, once you start the heartbeat interrupts, the
- system tick counter increments once each 1/60th of a second. You can read
- the current value of the tick counter by using the Miscellaneous Tools
- call GetTick.
-
- You can install tasks into the Heartbeat Interrupt Queue by calling
- SetHeartbeat (Misc. Tools). Once installed, that event will be called
- after a certain number of ticks have occurred. If you want the task to
- run every 1/30th of a second, you would tell SetHeartbeat to run the event
- in two ticks.
-
- So there would be two ways to time events using the Heartbeat interrupt.
- The first is to constantly check the tick count (using GetTick) and count
- the 1/60th of a second until it's time to, say, more the object being
- animated. The other way is to have a Heartbeat task which would run every
- N ticks and set a flag telling your program that it's time to move the
- object.
-
- I don't know if this answers your question. Jawaid can probably
- clarify/add to this. :)
-
- Good luck!
-
- - Eric S.
-
- --
- Eric D. Shepherd | Apple II Alliance Charter Member
- InterNet: uerics@mcl.mcl.ucsb.edu | ACM Member
- FidoNet: 1:206/2713 Eric Shepherd | Programming Law #1: "When in
- AOL: Sheppy | doubt, rewrite from scratch."
-