Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ames!amdahl!oliveb!amiga!mitsumi!jimm From: jimm@mitsumi.UUCP (Jim Mackraz) Newsgroups: comp.sys.amiga Subject: Re: Double Buffering Message-ID: <782@mitsumi.UUCP> Date: Fri, 6-Nov-87 13:13:22 EST Article-I.D.: mitsumi.782 Posted: Fri Nov 6 13:13:22 1987 Date-Received: Sun, 8-Nov-87 20:40:40 EST References: <7768@steinmetz.steinmetz.UUCP> Reply-To: jimm@mitsumi.UUCP (James Mackraz) Organization: Mitsumi Technology Inc Lines: 52 Keywords: double buffering, vertical retrace, screens In article <7768@steinmetz.steinmetz.UUCP> guilford@csv.rpi.edu (james d guilford) writes: ) )I am planning to write some animation-type software, and so I looked )up double buffering in the RKM. It suggested that I create two screens )and two sets of copper lists, and then to flip screens, I just replace )the copper list pointers. Note that the copper list pointers you replace are in graphics base, unless you also want to replace the vblank interrupt routine which re-installs them (and handles interlace). One way to do this is use LoadView(). ) )My question is whether I still have to sync with the vertical retrace. )It seems to me that even after updating the copper-list pointers, they )will not be used until the next scan begins. Thus it would not be safe )to start rendering into the other screen until after at least one )vertical blanking period. Is this right? I don't exactly know what protection you need to replace the actual pointers. If you use LoadView() you probably are safe. But your concern about rendering in the newly offscreen buffer is exactly correct. )I am thinking of creating an interrupt handler on the vertical )blanking list which would have a private message port. When I change )the copper list points, I would send it a message. When the vertical )retrace occurs, it would reply to the message. When I see the reply, I )know it is safe to start rendering the next screen. Is this the best )way to go? Not best, but workable. You can tell your interrupt handler that you made the change by setting a global, perhaps within Disable/Enable. Your handler need only send a Signal to your main task (which signal/task values it can read from globals shared with your program's main task). The big problem is that you will find yourself waiting until TOP of frame to start rendering, which needlessly prevents you from rendering during that valuable vertical retrace time. I think (might not be correct) that the blitter can run much faster when no display DMA is occuring (during vertical blank). So the optimal solution uses as bottom of frame interrupt generated by the Copper. This requires a custom copper list, and this opens a can of a few worms. )--JimG (guilford@csv.rpi.edu) jimm -- Jim Mackraz Mitsumi Technology, Inc. 408/980-5422 {amiga,pyramid}!mitsumi!jimm