From: gerrymon@eng.umd.edu (Gerry Mon)
Subject: Atari BLiTTER
Date: Tue, 29 Sep 92 14:05:49 GMT
Organization: College of Engineering, University of Maryland, College Park

In article <1992Sep24.195307.19082@klaava.Helsinki.FI>
lindblad@klaava.Helsinki.FI (Jarkko Lindblad) writes:

>gerrymon@eng.umd.edu (Gerry Mon) writes:
>
>: The Atari BLiTTER takes data from the source and destination and
>: prepares the result to be put back into the destination.  In other
>: words, it's basically a 2 source blitter.  However, the Atari BLiTTER
>
>So, it uses 1 source and 1 source/destination? Ie. One of the sources
>must change? That is bad, too bad.

Why is this so bad?  Don't most microprocessors have an instruction
format like this too?  For example, a lot of microprocessors have an
ADD R1,R2 instruction where you add two numbers in R1 and R2 and place
the result back in R1.

If you think about it, a typical use for a blitter is to blit a bitmap
from memory (the source) to the screen (the destination) thereby
changing the destination.  The Atari BLiTTER seems perfectly fine for
this.

>: The Atari BLiTTER can perform up to 16 logic operations on the 2 data
>: sources (more if you include the 16x16 halftone ram as an additional
>: operand).
>: 
>: By the way, with 3 Boolean operands you can have a total of 256
>: Boolean Functions and with 2 Boolean operands you can have a total of
>: 16 Boolean Functions.  So, both the Amiga and Atari blitters are
>: complete in that sense.
>
>If I understand correctly, you say that because Ataris blitter only
>has two sources and therefor only 16 logical operations, the 16
>operations is equal to Amiga's blitters 256 operations between three
>sources?

I'm just saying that they are both complete in a mathematical sense.

For example, since the Atari BLiTTER is complete, it can emulate all
256 logic operations of the Amiga blitter by basically doing two
blits.  The Atari will be just a little slower at doing it.  Also, it
should be pointed out that a lot of those 256 operations aren't very
useful.  As an example, one of the logic operations is a do-nothing.
It just leaves the destination the same as it was before.

By the way, I just want to elaborate a little on the Atari BLiTTER's
logic operations.  As I mentioned earlier, it can perform more logic
operations if you include the 16x16 halftone ram as one of its
sources.  Specifically, the BLiTTER can perform 4 logic operations
between the source1 and 16x16 halftone ram before performing the 16
logic operations between the source1 and the source2/destination.
This give a total of 64 logic operations.

>: I'm not exactly clear what you mean by this.  
>: 
>: But the Atari BLiTTER is also provided with a separate modulo for the
>: source and destination.  This allows the BLiTTER to move data back and
>
>Now, if you only have one 'true' source and one 'source-destination'
>the modulo of the second source and the destination is always forced
>to be the same....

No, the BLiTTER really does have separate modulos for the source and
destination.  To be specific, it has 4 registers labeled Src_Xinc,
Src_Yinc, Dst_Xinc and Dst_Yinc.  These are the modulo registers for
the source and destination.

The Src_Yinc and Dst_Yinc are equivalent to the Amiga's BLTxMOD
registers.  These are added to the end of each row of the rectangle.
This enables the blitter to blit rectangles that are smaller than the
screen (I think you guys call it the playfield).

The Src_Xinc and Dst_Xinc are needed because of the Atari's weird
interleaved bitplane format.  They are basically the offset for each
word in the bitplane.  For example, in the 4 color mode, the words of
each bitplane are interleaved with the words for the other bitplanes
and you need to use an offset of 4 to get the consecutive words for
that one particular bitplane.  The Amiga has no need for these
registers.

>: >Shifting:
>: >	The blitter can shift one or two of its data sources up to
>: >	15 bits before applying it to the logic operation, allowing
>: >	movement of images in memory across word boundaries.
>: 
>: The Atari BLiTTER also has this capability.
>
>Is the Atari's blitter's shifter a barrell shifter?

To be honest, I'm not sure.  In the very early days I heard a rumor
that it might not be a barrel shifter.  I hope this rumor is wrong.

>
>: >Masking:
>: 
>: The Atari BLiTTER also has this capability.
>
>Just wondering - I haven't seen an Atari for ages, is the window
>movement (horizontal) still restricted to 8 or 16 pixel jumps? At
>least at some stage it was and if it still is, I either find it hard
>to believe Atari's blitter has masking or find it very easy that their
>software engineers have been a bit lazy...:)

No, the Atari isn't restricted to 8 or 16 pixel jumps.  Most
programmers do like to align their windows on word boundaries because
the GEM routines are faster if everything is word aligned (i.e. text
scrolling is much faster if it is word aligned).  It is the Desktop
program that limits window movement to 8 or 16 pixel jumps.  GEM
itself doesn't have this limit.  If a programmer wants to move his
window by 1 pixel he is free to do so.  But most don't want to because
it will be slower.

And yes, the Atari BLiTTER does have masking.  To be specific, it has
3 16-bit mask registers labeled Endmask1, Endmask2 and Endmask3.

Endmask1 is used only for the beginning of the line, Endmask3 is used
for the last word of the line and Endmask2 is used for all other words
between.  A line here means the horizontal line of the blitting
rectangle.

>: In my opinion, the Atari BLiTTER has been unfairly critisized in the
>: past.  It's actually very nice.  While the Amiga blitter is
>: technically better, this doesn't make the Atari BLiTTER a piece of
>: junk like some have been implying.
>
>Well, at least the atar blitter found in ST(e's I guess) are simply
>s l o w. Also the inability to concurrently use CPU and blitter is a
>flaw in the design of the ST-series (including Falcon).
>
>--
>Jarkko Lindblad
>lindblad@cc.helsinki.fi

--Gerry