Line A Routines
for the foreground color with a transparent background color
(transparent mode), set OP
__
TAB to $7744. Note that FG
__
COL and BG
__
COL may be changed by the BitBlt call.
The BitBlt function also allows the use of fill patterns,
which are ANDed with the source prior to the logic opera
tion. Patterns are snapped to an imaginary grid that starts at
the upper left corner of the destination image block. They are
16 bits wide and repeat every 16 pixels, horizontally. Their
height must be an even power of 2, (1 line, 2 lines, 4 lines,
16 lines, and so on), and they repeat at a frequency equal to
their height. The variable P__ADDR points to the beginning
of the pattern image data block. If it is set to 0, no pattern is
used. P
__
NXLN is the distance between consecutive words
in the pattern (in bytes) and should be a power of 2. P
__
NXPL is the distance (in bytes) between pattern bit planes. If
a single-plane pattern is used for a multiplane destination, it
should be set to 0, so the same pattern will be used for all bit
planes. Finally, P
__
MASK is used to specify the length of the
pattern. It is used in conjunction with the value in P
_
NXLN, which must be an even power of 2. P
__
MASK = (pattern length in words - 1) < < n, where P
__
NXLN = Tn. Since P
__
NXLN will be 2 if the pattern data is
consecutive, n will equal 1, and P
__
MASK will just be the
pattern length in words - 1.
Program 7-4 shows how to blit a simple image on to the
screen:
Program 7-4. BITBLTS.S
************************************************************
* *
* BITBLT.S — Demonstrates the use of the line A *
* BitBlt ($A007) function. *
* *
* *
************************************************************
*** Function Equates
Init = $a000
BitBlit = $a007
*** Program starts here
• text
*** find screen address
raove.w #2,-(sp)
trap #14
addq #2,sp
move.l do,screen
* use XBIOS call #2
* to get screen address
* clean stack
* put screen address in blit block
155