home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / atari / st / tech / 4133 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  2.8 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!wupost!sdd.hp.com!elroy.jpl.nasa.gov!nntp-server.caltech.edu!godzilla.quotron.com!greg
  2. From: greg@Quotron.COM (Greg "Maddog" Knauss)
  3. Newsgroups: comp.sys.atari.st.tech
  4. Subject: Re: Is page flipping safe, and I need to know about syncing
  5. Message-ID: <greg.711924194@duke>
  6. Date: 23 Jul 92 20:43:14 GMT
  7. References: <Bruq9M.FI7@acsu.buffalo.edu>
  8. Sender: usenet@godzilla.quotron.com (usenet user)
  9. Organization: Quotron System, Inc.
  10. Lines: 44
  11.  
  12. chu@acsu.buffalo.edu (John C. Chu) writes:
  13.  
  14. >Is it ok to use Setscreen to do double buffered animation (i.e., draw
  15. >on one buffer while the other is being displayed and switch. I don't
  16. >know if I've used the right term for this). By that I mean, does it
  17. >work on all nominally ST compatible computers, including those with
  18. >video cards? (Of course, I'd also pay attention to what GEM tells me
  19. >when I start up so that I reserve enough memory for each screen.)
  20.  
  21. "Double-buffering" or "page-flipping."  And, yep, Setscreen works for
  22. all standard ST and TT resolutions (though they are different sizes,
  23. you need to check the resolution and use bigger buffers on the TT).
  24. I don't know about video cards, but I expect you'd have to use VDI
  25. calls for them...
  26.  
  27. >Also, a little while back, someone (Dave Baggett??) was talking about
  28. >how one should sync one's game to update the screen every n vblanks
  29. >(where n depends on how much is happening in the program), which will
  30. >among other things, insure that the game plays at the same speed
  31. >across variants of ST-type computers. Unfortunately, I wasn't paying
  32. >attention at the time. How do I do this?
  33.  
  34. First you decide the maximum number of 1/60 second intervals it will
  35. take to draw your most complex screen (say 4).  Then you write your
  36. drawing routine so it keep track of how many jiffies have gone by
  37. since it started to re-draw the screen (between 0 and 4, depending on
  38. the complexity of the screen).  Then you just wait out the remainder.
  39. If a simple screen takes 1 jiffy to draw, you wait for three.  If a
  40. complex screen takes 3 jiffies to draw, you wait for one.  And the
  41. game runs at the same speed (4 jiffies per refresh) no matter how
  42. complex it gets.
  43.  
  44. >After a hiatus, I've decided I'm going to return to trying to program
  45. >the ST again, so I want to make sure whatever I do will work on as
  46. >many ST-type computers (i.e., STe, Mega STe, TT, Falcon, unusual
  47. >configurations of those etc.) as possible (actually, working on all of
  48. >them would be preferable).
  49.  
  50. That's the way to do it.
  51. --
  52.  ------------------------------------------------------------------------------
  53.  Greg "Maddog" Knauss                      My boss doesn't know I'm doing this,
  54.  greg@duke.quotron.com                           so I doubt he'd agree with me.
  55.  ------------------------------------------------------------------------------
  56.