home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / sys / amiga / demos / 1675 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  1.9 KB

  1. Path: sparky!uunet!pipex!warwick!uknet!edcastle!dcs.ed.ac.uk!jxp
  2. From: jxp@dcs.ed.ac.uk (Joe Potter)
  3. Newsgroups: alt.sys.amiga.demos
  4. Subject: Re: Phenomena egos??
  5. Message-ID: <Bxt6Dv.HsJ@dcs.ed.ac.uk>
  6. Date: 16 Nov 92 12:22:43 GMT
  7. References: <1dg7r7INNjil@gap.caltech.edu> <1992Nov7.203516.9849@ringer.cs.utsa.edu> <MKNIP.92Nov12144453@wolverine.hut.fi> <1992Nov13.130146.14587@ifi.uio.no> <1968@lysator.liu.se> <1992Nov16.083508.24131@ugle.unit.no>
  8. Sender: cnews@dcs.ed.ac.uk (UseNet News Admin)
  9. Organization: Department of Computer Science, University of Edinburgh
  10. Lines: 34
  11.  
  12. In article <1992Nov16.083508.24131@ugle.unit.no>, mortene@Lise.Unit.NO (Morten Eriksen) writes:
  13. > >Another nice "hack" on the Amiga, is to have more than 8 sprites
  14. > >on a single raster-line. It is pretty easy, you just use the copper
  15. > >to set the xposition of the sprites more than once pr.line.
  16. > Oh? I've heard that this isn't possible. Couldn't you supply us with some source-
  17. > code, please?
  18. > Morten
  19.  
  20.     Well, some pseudocode from the top of my head...
  21.  
  22.     for each virtual sprite:
  23.         for each line:
  24.             get a free h/w sprite number [NOTE 1]
  25.             insert into copperlist:
  26.                 WAIT (pos 8 lores pixels before sprite X)
  27.                 MOVE (position),(h/w sprite pos)
  28.                 MOVE (data),(h/w sprite data)
  29.         next line of virtual sprite
  30.     next virtual sprite
  31.  
  32.     [NOTE 1] Even if you have sprites next to each other, you get 8 times
  33.     sixteen = 128 pixels before having to reuse one.  Provided there's enough
  34.     chip DMA left for the copper (use low colour low res screens), it can
  35.     update the sprite info in time.
  36.  
  37.     Obviously, this algorithm is disastrously slow, with all those insertions. 
  38. Ideally, you'd collect all the vsprite lines and sort first by Y and then by X position.
  39. That WAIT instruction may require more time - remember, this is off the top of
  40. my head!  I know, however, that the sprites position and data registers can be
  41. updated by the copper rather than the DMA controller.
  42.  
  43.                             Joe.
  44.