Step21: Blitter processor

What is the Blitter

The blitter is a very important coprocessor inside Amiga hardware. « bit Blit », that come from « bit block transfer », is the operation of transfering data from source to destination by mixing different sources with boolean operation. Atari ST also have a blitter.

The blitter coprocessor is inside AGNUS chip.

Data copy

The blitter can copy memory. In this mode, it is twice as fast as the CPU. Blitter can do operation while the CPU is running. So with good organisation, lot of computing can be done by CPU and Blitter at the same time.

Blitter can only access chip memory.

It works on a WORD basis. That means all operations are multiple of 16 bits.

For copy operation, blitter have 4 channels. 3 sources and 1 destination. The source and destination can be « programmed » with logic operation. The formula is named « mintern ». The system need a bit of time to be well understood but not that much complicated.

There are several register to setup a blitter operation. The writing of the transfer size launch the operation.

Line draw

Blitter can also draw line. The line is drawn so that it can be used by filling part (one pixel per line).

When setting up line drawing you need to define in with « Octant » the line is going to be drawn (directions are divided into 8 zones, only have to tell in which zone you want to draw).

Line can also have a pattern.

Surface fill

The last function of the blitter is the surface filling. This could be very useful for doing 3d for example or any 2D filled vectors.

Common Usage

You can use blitter to do above operations inside you algorithm running on CPU. For example you have a CPU function that compute a line positions, and then you call blitter to draw a line. You wait blitter to have finishe the task and you continue your CPU operations. This is the most simple usage, but you are not getting most of the power of the blitter. As it can run at same time than CPU, it would be more intersting not to wait for blitter operation to be finished, you can continue running your CPU function. In fact, you can wait for blitter to be ready only when you need to use it again. That way you got a quite optimisez usage of CPU and blitter.

Blitter have a « nasty » mode. That means when blitter is running it take all the bandwidth and CPU is not running or running slower. That could be useful if you algorithm is not « parallelized ».

Advanced Usage

You can use blitter to copy data into specific structure, like copper list.

You can also use interruption raised by blitter to create a blitter queue. This is something I would like to work on one day.

Blitter can be used for many many things. Lets’s find the better usage for you.



Video tutorial for « scrolling » one part of the screen, using one blitter copy (you can copy to the same location, and shift by one pixel)

Cool demo of that time

megademo 2 by Rebels

Laisser un commentaire

