[comp.sys.amiga.tech] Blitter code needed

SXA00051@BAGAMCOK.BITNET (Mitchell Morris) (04/29/88)

Can anyone provide some sample code that calls the blitter directly?
I've been plowing through the RKM (white books) trying to figure
this thing out, but nothing I do works.

On the positive side, I no longer GURU the machine, but the blitting
doesn't take place.

Even a working fragment is better than what I now have.

                               Mitch

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Mitchell Morris, professional layabout and ne'er-do-well
BITNET:     {SXA00051, SXA00052} @ BAGAMCOK
UUCP:       seismo!ncr-sd!ncrcae!usceast!baldwin
            ihnp4!crash!pro-carolina!mitch
U.S. Snail: 17 Dunes Point, Blythewood SC 29016

"Anyone who considers mathematical methods of producing random
   numbers is, of course, in a state of sin"  --  Von Neumann
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

avery@puff.cs.wisc.edu (Aaron Avery) (05/05/88)

I have the feeling that the main thing you're missing is the approved method
of accessing the blitter directly. You need to call a few routines regarding
giving you exclusive access to the blitter. You need to call OwnBlitter() and
then WaitBlit() before you access any of the blitter registers. OwnBlitter()
makes sure that noone else will try to access the blitter while you do, and
WaitBlit() makes sure that any previous blits are done before returning. Now
you stuff all of the blitter registers with the values you want (making sure
that bltsize is last), and the blitter should start the operation. At some
time in the future (you may want to do some parallel operations while the
blitter is doing its thing), you call WaitBlit() (I guess it's optional, but
I do it), then call DisownBlitter(), which relinquishes your exclusive access.
If you wish to do multiple operations before the DisownBlitter(), you want to
separate them by WaitBlit()'s so that you don't start stuffing the registers
before it's done with the previous operation.

I strongly suggest that you try to get ahold of Tom Rockiki's program
'Blitlab'. It's commonly available, but let me know if you want me to mail it
to you. The program allows you to 'play' with the blitter by giving you an
enlarged bitmap to operate on, access to all of the registers, and boolean
expression decoding. It's a very good program to test your operations with so
that you're sure that the blitter behaves as you thought it would. This program
alerted me to the 'wrap-around' that the blitter performs during shifting,
which I wasn't aware of. Hope all of this helps, and, by the way, those
routines mentioned above are in the graphics.library, so you need to have
opened it to use them.

-- 
Aaron Avery (avery@puff.cs.wisc.edu)
	    ({seismo,caip,allegra,harvard,rutgers,ihnp4}!uwvax!puff!avery)

dca@kesmai.COM (David C. Albrecht) (05/06/88)

> Can anyone provide some sample code that calls the blitter directly?
> I've been plowing through the RKM (white books) trying to figure
> this thing out, but nothing I do works.
> 
> Even a working fragment is better than what I now have.

You probably want Blitlab which is a visual blitter tinkering program.
It comes with the C source so you can see how it invokes the blitter.
It is available on the Fred Fish Disk 84.  I also know it is available
on GEnie, probably other network services as well.

David Albrecht