
Epson Research and Development
Page 75
Vancouver Design Center
Programming Notes and Examples
S1D13A05
Issue Date: 2002/08/21
X40A-G-003-04
9.2.1
Write BitBLT with ROP
Write BitBLTs increase the speed of transferring data from system memory to the display
buffer. The Write BitBLT with ROP accepts data from the CPU and writes it into display
memory. This BitBLT is typically used to copy a bitmap image from system memory to the
display buffer.
Write BitBLTs support 16 ROPs, the most frequently used being ROP 0Ch (Copy Source
to Destination). Write BitBLTs support both rectangular and linear destinations. Using a
linear destination it is possible to move an image to off screen memory in a compact format
for later restoration using a Move BitBLT.
During a Write BitBLT operation the BitBLT engine expects to receive a particular number
of WORDs and it is the responsibility of the CPU to provide the required amount of data.
When performing BitBLT at 16 bpp color depth the number of WORDS to be sent is the
same as the number of pixels to be transferred as each pixel is one WORD wide. The
number of WORD writes the BitBLT engine expects is calculated using the following
formula.
WORDS
= Pixels
= BitBLTWidth
× BitBLTHeight
When the color depth is 8 bpp the formula must take into consideration that the BitBLT
engine accepts only WORD accesses and each pixel is one BYTE. This may lead to a
different number of WORD transfers than there are pixels to transfer.
The number of WORD accesses is dependant on the position of the first pixel within the
first WORD of each row. Is the pixel stored in the low byte or the high byte of the WORD?
This aspect of the BitBLT is called phase and is determined as follows:
Source phase is 0 when the first pixel is in the low byte and the second pixel is in the high
byte of the WORD. When the source phase is 0, bit 0 of the Source Start Address Register
is 0. The Source Phase is 1 if the first pixel of each row is contained in the high byte of the
WORD, the contents of the low byte are ignored. When the source phase is 1, bit 0 of the
Source Start Address Register is set.
Depending on the Source Phase and the BitBLT Width, the last WORD may contain only
one pixel. In this case it is always in the low byte. The number of WORD writes the BitBLT
engine expects for 8 bpp color depths is shown in the following formula.
WORDS
= ((BitBLTWidth + 1 + SourcePhase)
÷ 2) × BitBLTHeight
The BitBLT engine requires this number of WORDS to be sent from the local CPU before
it will end the Write BitBLT operation.