English
Language : 

NS32CG16-10 Datasheet, PDF (19/82 Pages) National Semiconductor (TI) – High-Performance Printer / Display Processor
2 0 Architectural Description (Continued)
TL EE 9424 – 68
(a)
(b)
FIGURE 2-10 Overlapping BITBLT Blocks
TL EE 9424 – 8
The left mask and the right mask are 0000 1111 1111 1111 and 1111 1111 0000 0000 respectively
Note 1 Zeros in either the left mask or the right mask indicate the destination bits which will not be modified
Note 2 The BB(function) and EXTBLT instructions use different set up parameters and techniques
2 5 2 2 BITBLT Directions
A BITBLT operation moves a rectangular block of data in a
frame buffer The operation itself can be considered as a
subroutine with two nested loops The loops are preceded
by setup operations In the outer loop the source and desti-
nation starting addresses are calculated and the test for
completion is performed In the inner loop the actual data
movement for a single scan line takes place The length of
the inner loop is the number of (aligned) words spanned by
each scan line The length of the outer loop is equal to the
height (number of scan lines) of the block to be moved A
skeleton of the subroutine representing the BITBLT opera-
tion follows
BITBLT
calculate BITBLT setup parameters
(once per BITBLT operation)
such as
width height
bit misalignment (shift number)
left right masks
horizontal vertical directions
etc


OUTERLOOP calculate source dest addresses
(once per scanline)
INNERLOOP
move data (logical operation) and incre-
ment addresses
(once per word)
UNTIL
done horizontally
UNTIL
done vertically
RETURN
(from BITBLT)
Note In the NS32CG16 only the setup operations must be done by the
programmer The inner and outer loops are automatically executed
by the BITBLT instructions
Each loop can be executed in one of two directions the
inner loop from left to right or right to left the outer loop
from top to bottom (down) or bottom to top (up)
The ability to move data starting from any corner of the
BITBLT rectangle is necessary to avoid destroying the
BITBLT source data as a result of destination writes when
the source and destination are overlapped (i e when they
share pixels) This situation is routinely encountered while
panning or scrolling
A determination of the correct execution directions of the
BITBLT must be performed whenever the source and desti-
nation rectangles overlap Any overlap will result in the de-
struction of source data (from a destination write) if the cor-
rect vertical direction is not used Horizontal BITBLT direc-
tion is of concern only in certain cases of overlap as will be
explained below
Figures 2-10(a) and (b) illustrate two cases of overlap Here
the BITBLT rectangles are three pixels wide by five scan
lines high they overlap by a single pixel in (a) and a single
column of pixels in (b) For purposes of illustration the
BITBLT is assumed to be carried out pixel-by-pixel This
convention does not affect the conclusions
In Figure 2-10(a) if the BITBLT is performed in the UP direc-
tion (bottom-to-top) one of the transfers of the bottom scan
line of the source will write to the circled pixel of the destina-
tion Due to the overlap this pixel is also part of the upper-
most scan line of the source rectangle Thus data needed
later is destroyed Therefore this BITBLT must be per-
formed in the DOWN direction Another example of this oc-
19