Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!swrinde!ucsd!cogsci!cogsci.ucsd.edu!costin From: costin@cogsci.ucsd.edu (Dan Costin) Newsgroups: comp.sys.mac.programmer Subject: Re: Animation Message-ID: <290@cogsci.ucsd.EDU> Date: 11 Feb 91 21:04:53 GMT References: <1961.27B4BFB4@stjhmc.fidonet.org> Sender: news@cogsci.ucsd.EDU Reply-To: costin@cogsci.ucsd.edu (Dan Costin) Organization: CSE Dept., U.C. San Diego Lines: 30 In article <1961.27B4BFB4@stjhmc.fidonet.org>, Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) writes: |>Baudoin Raoult writes in a message to All |> |>BR> The simplest way is to use TickCount, as the tick counter is |>BR> updated every 60th of second, each time the video spot starts |>BR> to update new screen. So just write: |>BR> tmp := TickCount; while tmp=Tickcount do { nothing } ; CopyBits(.....) |> |>To make sure that you get the most accurate reading (and the longest time in |>which to do your drawing) use GetTrapAddress to bypass the Trap Dispatcher and |>jump directly to TickCount. Otherwise, you have 100+ CPU cycles of overhead |>that you are wasting. This might not be much, but it could change the flicker |>if your drawing is small enough. |> |> |>Lawson |> Y'all, of course, realize that this hack only works for Mac Classics and such. Mac II screen refresh rates are not necessarily related to the tick count (buy a monitor that refreshes at 72Hz, for example, and the flicker will return) You have to synchronize to the refresh, not the tick, as they are no longer the same. To do this, use a VBL task. (see one of the later Inside Macs) -dan