Epson S1D13506 Technical Manual page 304

Color lcd/crt/tv controller
Table of Contents

Advertisement

Page 70
S1D13506
X25B-G-003-04
Example 9: Write a 100 x 20 rectangle at the screen coordinates x = 25, y = 38 using
a 640x480 display at a color depth of 8 bpp.
1. Calculate the destination address (upper left corner of the screen blit rectangle) using
the following formula.
DestinationAddress = (y × ScreenStride) + (x × BytesPerPixel)
where:
BytesPerPixel = 1 for 8 bpp
BytesPerPixel = 2 for 15/16 bpp
ScreenStride = DisplayWidthInPixels × BytesPerPixel = 640 for 8 bpp
Program the BitBLT Destination Start Address Registers. REG[10Ah] is set to 00h,
REG[109h] is set to 5Fh, and REG[108h] is set to 19h.
2. Program the BitBLT Width Registers to 100 - 1. REG[111h] is set to 00h and
REG[110h] is set to 63h (99 decimal).
3. Program the BitBLT Height Registers to 20 - 1. REG[113h] is set to 00h and
REG[112h] is set to 13h (19 decimal).
4. Program the Source Phase in the BitBLT Source Start Address Register. In this exam-
ple the data is WORD aligned, so the source phase is 0. REG[104h] is set to 00h.
5. Program the BitBLT Operation Register to select the Write Blit with ROP.
REG[103h] is set to 00h.
6. Program the BitBLT ROP Code Register to select Destination = Source. REG[102h]
is set to 0Ch.
7. Program the BitBLT Color Format Select bit for 8 bpp operations. REG[101h] is set
to 00h.
8. Program the BitBLT Memory Offset Registers to the ScreenStride in WORDS:
BltMemoryOffset = DisplayWidthInPixels ÷ BytesPerPixel
REG[10Dh] is set to 01h and REG[10Ch] is set to 40h.
9. Calculate the number of WORDS the blit engine expects to receive.
nWORDS
= (38 × 640) + (25 × 1)
= 24345
= 5F19h
= 640 ÷ 2
= 140h
= ((BlitWidth + 1 + SourcePhase) ÷ 2) × BlitHeight
= (100 + 1) ÷ 2 × 20
= 1000
= 3E8h
Epson Research and Development
Vancouver Design Center
Programming Notes and Examples
Issue Date: 02/03/21

Advertisement

Table of Contents
loading

Table of Contents