
10: 2D BITBLT ENGINE
2-80
EPSON
S1D13806 SERIES PROGRAMMING NOTES
AND EXAMPLES (X28B-G-003-01)
10.2.11 Move BitBLT with Color Expansion
The Move BitBLT with Color Expansion takes a monochrome bitmap as the source and color
expands it into the destination. Color expansion moves all bits in the monochrome source to pixels
in the destination. All bits in the source set to one are expanded into destination pixels of the
selected foreground color. All bits in the source set to zero are expanded into pixels of the selected
background color.
The Move BitBLT with Color Expansion is used to accelerate text drawing on the screen. A mono-
chrome bitmap of a font in off-screen memory occupies very little space and takes advantage of the
hardware acceleration. Since the foreground and background colors are programmable, text of any
color can be created.
The Move BitBLT with Color Expansion may move data from one rectangular area to another, or it
may be specified as linear. The linear configuration may be applied to the source or destination.
Defining the Move BitBLT as linear allows each line of the Move BitBLT area to be placed directly
after the previous line, rather than requiring a complete row of address space for each line.
Note: The BitBLT ROP Code/Color Expansion Register must be programmed to value 07h. Therefore, the
first word in a line color expansion starts with the most significant bit of the low or high byte.
Example 18
Color expand a 9
× 16 rectangle using the pattern in off-screen memory at 100000h
and move it to the screen coordinates x = 200, y = 20. Assume a 640
× 480 display at
a color depth of 16 bpp, Foreground color of black, and background color of white.
1. Calculate the destination and source addresses (upper left corner of the destination and source
rectangles), using the formula.
DestinationAddress = (y
× ScreenStride) + (x × BytesPerPixel)
= (20
× (640 × 2)) + (200 × 2)
= 26000
= 6590h
where:
BytesPerPixel = 1 for 8 bpp
BytesPerPixel = 2 for 16 bpp
ScreenStride = DisplayWidthInPixels
× BytesPerPixels = 1280 for 16 bpp
SourceAddress
= 1M
= 100000h
Program the BitBLT Destination Start Address Registers. REG[10Ah] is set to 00h, REG[109h]
is set to 65h, and REG[108h] is set to 90h.
Program the BitBLT Source Start Address Registers. REG[106h] is set to 10h, REG[105h] is set
to 00h, and REG[104h] is set to 00h.