EasyManua.ls Logo

Commodore Amiga A2000 - Figure 6-4 Extracting a Range of Columns

Commodore Amiga A2000
380 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
|______________2 word source bitmap____________|
| |
|___Extract a 23-bit image_____| |
| | |
|_____16 bit word______| | |
| | | |
|______________________|_______|_______________|
| |
Source | 00000000 00000000 00000000 00000000 |
DMA B | 11111111 11111111 11111111 11111111 |
| 10101010 01010101 10101010 01010101 |
|______________________________________________|
| | | | *
\|/ \|/ \|/ \|/
____V___________V_____ ___V___________V_____
| | | |
Mask on | 11111111 11111111 | |11111110 00000000 |
DMA A | First word mask | | Second word mask |
|______________________| |_____________________|
| | | | _|_ _|_
\|/ \|/ \|/\|/
____V____________V__________V__V______________
Final | |
destination | 00000000 00000000 00000001 11111111 |
DMA D | 11111111 11111111 11111111 11111111 |
(points to | 10101010 01010101 10101011 11111111 |
same address|______________________________________________|
as DMA C) ^ ^ ^ ^
___ ___ ___ /|\ /|\ /|\ /|\
| | | | | | |
____|____________|_________|___|_____|___|___| **
Destination | |
before blit | 11111111 11111111 11111111 11111111 |
DMA C | 11111111 11111111 11111111 11111111 |
(to be | 11111111 11111111 11111111 11111111 |
overwritten) |______________________________________________|
* Source is passed through mask when it is a one, otherwise the
destination is copied.
** Destination does not change where mask is 0.
Figure 6-4: Extracting a Range of Columns
To do this, we point the B DMA channel at the bitmap containing the source image, and
the D DMA channel at the screen bitmap. We use a shift value of 5. We also point the C
DMA channel at the screen bitmap. We use a blit width of 2 words. What we need is a
simple copy operation, except we wish to leave the first five bits of the first word, and the
last four bits (2 times 16, less 23, less 5) of the last word alone. The A DMA channel
comes to the rescue. We preload the A data register with $FFFF (all ones), and use a first
word mask with the most significant five bits set to zero ($07FF) and a last word mask
with the least significant four bits set to zero ($07FF).
We do not enable the A DMA channel, but only the B, C, and D channels, since we want to
use the A channel as a simple row mask. We then wish to pass the B (source) data along
wherever the A channel is 1 (for a minterm of AB) and pass along the original destination
data (from the C channel) wherever A is 0 (for a minterm of AC), yielding our classic
cookie-cut function of AB+AC, or $CA.
- Blitter Hardware 175 -

Table of Contents

Other manuals for Commodore Amiga A2000

Related product manuals