Epson Research and Development
Page 85
Vancouver Design Center
8. Program the BitBLT Destination/Source Linear Select bits for a rectangular blit (Bit-
BLT Destination Linear Select = 0, BitBLT Source Linear Select = 0).
Start the blit operation. REG[100h] is set to 80h.
Note
The order of register initialization is irrelevant as long as all relevant registers are pro-
grammed before the BitBLT is initiated.
10.2.9 Pattern Fill BitBLT with ROP
The Pattern Fill BitBLT with ROP fills a specified rectangular area of the display buffer
with a pattern. The fill pattern is an array of pixels stored in off-screen display buffer. The
fill pattern is limited to an eight by eight pixel array and must be loaded to off-screen
memory prior to the BitBLT starting. The pattern can be logically combined with the desti-
nation using all 16 ROP codes, but typically the copy pattern ROP is used (ROP code 0Ch).
The pattern itself must be stored in a consecutive array of pixels. As a pattern is defined to
be eight pixels square, this results in 64 consecutive bytes for 8 bpp color depths and 128
bytes for 15/16 bpp color depths. For 8 bpp color depths the pattern must begin on a 64 byte
boundary, for 15/16 bpp color depths the pattern must begin on a 128 byte boundary.
To fill an area using the pattern BitBLT, the blit engine requires the location of the pattern,
the destination rectangle position and size, and the ROP code. The blit engine also needs to
know which pixel from the pattern is the first pixel in the destination rectangle (the pattern
start phase). This allows seamless redrawing of any part of the screen using the pattern fill.
Example 16: Fill a 100 x 250 rectangle at the screen coordinates x = 10, y = 20 with
the pattern in off-screen memory at offset 10 0000h using a 640x480 dis-
play at a color depth of 8 bpp. The first pixel (upper left corner) of the
rectangle is the pattern pixel at x = 3, y = 4.
1. Calculate the destination address (upper left corner of the destination rectangle), using
the formula:
DestinationAddress = (y × ScreenStride) + (x × BytesPerPixel)
= (20 × 640) + (10 × 1)
= 12810
= 320Ah
where:
BytesPerPixel = 1 for 8 bpp
BytesPerPixel = 2 for 15/16 bpp
ScreenStride = DisplayWidthInPixels × BytesPerPixels = 640 for 8 bpp
Program the BitBLT Destination Start Address Registers. REG[10Ah] is set to 00h,
REG[109h] is set to 32h, and REG[108h] is set to 0Ah.
2. Calculate the source address. This is the address of the pixel in the pattern that is the
origin of the destination fill area. The pattern begins at offset 1M, but the first pattern
pixel is at x = 3, y = 4. Therefore, an offset within the pattern itself must be calculated.
Programming Notes and Examples
Issue Date: 01/02/06
S1D13506
X25B-G-003-03