Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!emory!gatech!mcnc!beguine!next1.oit.unc.edu!utoddl From: utoddl@next1.oit.unc.edu (Todd M. Lewis) Newsgroups: comp.sys.amiga.programmer Subject: Re: Block Moves Blits Keywords: blitter Message-ID: Date: 27 Jun 91 15:32:38 GMT Sender: usenet@beguine.UUCP Lines: 59 Mike Schwartz writes: >In article utoddl@next1.oit.unc.edu (Todd M. Lewis) writes: > >[ paraphrased: He wants to drive the blitter to do >BlitMaskBitMapRastPort() himself ] Sorry, Mike, that's not what I said. A side effect of what I want to do would be the creation of the routine BltMaskBitMapBitMap(), which currently doesn't exist. But that's not the point. The points are (1) to understand all the nuances of using the blitter to do block moves, and (2) to provide a working piece of example code which incorporates every detail that must be dealt with when using the blitter directly, excluding perhaps dealing with overlapping blits and layers. My reasons are simple and follow the two points above: (1) I'm doing lots of blits over and over and I can make them go faster (I hope) if I precalculate each blit and do the QBlit() tricks, which requires that I understand how the blitter works, and (2) it would be a shame to make sense of all that and not share it with other programmers. Several people have pointed out to me that I left out some steps in my thumbnail description of what I was doing. I didn't mean to be incomplete, but I didn't want to get bogged down at the OwnBlitter/WaitBlit/DisownBlitter level--I want to get bogged down at a much lower level:-) >Get ahold of Tom Rokiki's BlitLab from the Fish disks. It is excellent >for illustrating how the blitter works. Thanks to all who pointed this out, though I mentioned BlitLab in the original article. Tom did his usual great job on that program, and I'm sure it has saved me many hours. I'm using ver. 1.1, BTW. Is that the latest? >And, by the way, rewriting BMBMPRP() is a great idea. It is a useful >general purpose function as is, but it is at least 100 times slower >than most software needs it to be. Have to disagree with you there, at least until I see some data supporting your assertion. BMBMPRP() has to deal with layers, and must set up the blitter without making any assumptions about the blit. The overhead could easily take longer than the blit itself, especially for small (say, the size of a lemming) blits. My guess (I haven't looked at the code) is that BMBMPRP() is just about as optimized as it can get and still work. Incidentally, if I do get a working BltMaskBitMapBitMap(), I can promise you it will be dog slow. Why? Because I intend to make it as clear as possible for people to understand what is involved in blitter settup. In fact, it should not be used. Just knock up a RastPort with a null Layer, set the BitMap ptr to the right place and use BltMaskBitMapRastPort() and save yourself some time and code size. >**************************************************** >* I want games that look like Shadow of the Beast * >* but play like Leisure Suit Larry. * >**************************************************** I want games that play like Lemmings, but where people send me the money! Todd (utoddl@next1.oit.unc.edu) Lewis