Article View: comp.sys.atari.st
Article #34292Animation Revisited
From: David M. Baggett
Date: Wed, 28 Sep 1988 23:03
Date: Wed, 28 Sep 1988 23:03
47 lines
1987 bytes
1987 bytes
>In article <8809100453.AA01878@TIS.COM>, dmb@TIS.COM (David M. Baggett) writes:
>> Setscreen((char *) -1L, (char *) new_phys_base, -1);
>> Vsync();
>
>I'm not particularly familiar with the ST, but since SetScreen is asynchronous,
>the following code (based on Amiga code) should work better:
>
> Generate animation in newscreen;
> Vsync(); /* wait for previous SetScreen (of oldscreen) to work */
> SetScreen(newscreen);
> Go back to generate next screen.
>
>This way you get to do computations while waiting for SetScreen, and there's
>always a screen out there waiting to show up.
>--
> Peter da Silva `-_-' peter@sugar.uu.net
Actually, this doesn't work so well. The animation will only be
flicker-free when Vsync() comes _after_ the Setscreen call. It's not
obvious why this is, but I've done several tests that show it to
be the case (I recompiled exisiting programs, only changing the placement
of Vsync).
Also, I don't understand the argument that you'll get less idle time
by moving the Vsync(). I was thinking of the page flipping occuring in
a loop; for exmaple:
for (;;) {
/*
* Do stuff
*/
Setscreen(...);
Vsync();
/*
* Do stuff
*/
}
Moving the Vsync shouldn't change how much idle time you get. In the
sections commented "do stuff", you have about 1/60th of a second worth
of processing time. How much time is spent idle depends on how close
you get to filling these sections (if you put too much code in these
sections, you will only hit every other vblank).
Dave Baggett
dmb@TIS.COM (arpanet)
Technical Details
Message-ID:
<8809282303.AA10566@TIS.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!think!ames!pasteur!ucbvax!TIS.COM!dmbShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!think!ames!pasteur!ucbvax!TIS.COM!dmb From: dmb@TIS.COM (David M. Baggett) Newsgroups: comp.sys.atari.st Subject: Animation Revisited Message-ID: <8809282303.AA10566@TIS.COM> Date: 28 Sep 88 23:03:48 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 47