home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!warwick!uknet!edcastle!dcs.ed.ac.uk!jxp
- From: jxp@dcs.ed.ac.uk (Joe Potter)
- Newsgroups: alt.sys.amiga.demos
- Subject: Re: Phenomena egos??
- Message-ID: <Bxt6Dv.HsJ@dcs.ed.ac.uk>
- Date: 16 Nov 92 12:22:43 GMT
- 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>
- Sender: cnews@dcs.ed.ac.uk (UseNet News Admin)
- Organization: Department of Computer Science, University of Edinburgh
- Lines: 34
-
- In article <1992Nov16.083508.24131@ugle.unit.no>, mortene@Lise.Unit.NO (Morten Eriksen) writes:
- > >Another nice "hack" on the Amiga, is to have more than 8 sprites
- > >on a single raster-line. It is pretty easy, you just use the copper
- > >to set the xposition of the sprites more than once pr.line.
- >
- > Oh? I've heard that this isn't possible. Couldn't you supply us with some source-
- > code, please?
- >
- > Morten
-
- Well, some pseudocode from the top of my head...
-
- for each virtual sprite:
- for each line:
- get a free h/w sprite number [NOTE 1]
- insert into copperlist:
- WAIT (pos 8 lores pixels before sprite X)
- MOVE (position),(h/w sprite pos)
- MOVE (data),(h/w sprite data)
- next line of virtual sprite
- next virtual sprite
-
- [NOTE 1] Even if you have sprites next to each other, you get 8 times
- sixteen = 128 pixels before having to reuse one. Provided there's enough
- chip DMA left for the copper (use low colour low res screens), it can
- update the sprite info in time.
-
- Obviously, this algorithm is disastrously slow, with all those insertions.
- Ideally, you'd collect all the vsprite lines and sort first by Y and then by X position.
- That WAIT instruction may require more time - remember, this is off the top of
- my head! I know, however, that the sprites position and data registers can be
- updated by the copper rather than the DMA controller.
-
- Joe.
-