Page 78
Epson Research and Development
Vancouver Design Center
S
D
D
S
Destination Address greater than Source Address
Use Move BitBLT in Negative Direction
Destination Address less than Source Address
Use Move BitBLT in Positive Direction
Figure 10-1: Move BitBLT Usage
Example 12: Copy a 9 x 321 rectangle at the screen coordinates x = 100, y = 10 to
screen coordinates x = 200, y = 20 using a 640x480 display at a color
depth of 16 bpp.
1. Calculate the source and destination addresses (upper left corners of the source and
destination rectangles), using the following formula.
SourceAddress
= (y × ScreenStride) + (x × BytesPerPixel)
= (10 × (640 × 2)) + (100 × 2)
= 13000
= 32C8h
DestinationAddress = (y × ScreenStride) + (x × BytesPerPixel)
= (20 × (640 × 2)) + (200 × 2)
= 26000
= 6590h
where:
BytesPerPixel = 1 for 8 bpp
BytesPerPixel = 2 for 15/16 bpp
ScreenStride = DisplayWidthInPixels × BytesPerPixel = 1280 for 16 bpp
Program the BitBLT Source Start Address Registers. REG[106h] is set to 00h,
REG[105h] is set to 32h, and REG[104h] is set to C8h.
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.
2. Program the BitBLT Width Registers to 9 - 1. REG[111h] is set to 00h and
REG[110h] is set to 08h.
3. Program the BitBLT Height Registers to 321 - 1. REG[113h] is set to 01h and
REG[112h] is set to 40h (320 decimal).
4. Program the BitBLT Operation Register to select the Move BitBLT in Positive Direc-
tion with ROP. REG[103h] is set to 02h.
S1D13506
X25B-G-003-03
Programming Notes and Examples
Issue Date: 01/02/06