Line A Routines
BitBlt takes a bit image from one memory area and com
bines it with a bit image in another memory area, according
to the logic operation selected. The source and destination
image rectangles are the same size. The width of this block
(in pixels) is stored in B
__
WD, and its height is stored in B
__
HT, while the number of bit planes is passed in PLANE
__
CT
(this value may be changed by the BitBlt call). The starting
address of the source image block goes into S
__
FORM, while
the starting address of the destination image block is placed
in D
__
FORM. These image blocks must start on word boun
daries.
The x and y offsets of the source image are passed in S
__
XMIN and S
__YMIN, while the corresponding destination
offsets are stored in D
__
XMIN and D
__
YMIN. These images
may overlap one another without harm, but bear in mind
that there is no clipping or boundary checking performed;
it's up to you to make sure that the blit stays within the im
age memory block.
Two other values concerning the image block must also
be passed. The S
__
NXWD and D
__
NXWD variables should
contain the number of bytes between data words that belong
to the same bit plane. For image blocks in ST screen mem
ory, this value is 2 for the high resolution screen, 4 for me
dium resolution, and 8 for low resolution. S
__
NXLN and D__
NXLN should contain the width of each line in the image
block in bytes.
If the entire screen is used, this width is 80 bytes for the
monochrome screen and 160 bytes for each of the color
screens. S
__
NXPL and D
__
NXPL should contain byte offsets
from a word in one bit plane to a word in the next bit plane.
Because of the way the ST screen memory is interleaved, this
value is 2 for all ST screen resolution modes.
The way source and definition blocks are combined is
determined by the raster operation code (opcode) selected.
There are 16 possible logic operations. These are shown in
Table 7-7.
Table 7-7. The 16 Possible Logic Operations for Combining Source
and Definition Blocks
Opcode Logic Operation* Description
0 D1 = 0 Clear destination block
1 D1 = S AND D
2 D1 = S AND (NOT D)
153