The Blitter is an arrangment of logic gates, registers, and counters that may be used to copy rectangular areas up to 127×127 pixels from Sprite RAM to the framebuffer. This copy runs in parallel to CPU execution and copies at a rate of 1 pixel per CPU clock cycle. If the DMA_IRQ flag is set, the Blitter will assert an IRQ signal when a copy operation completes.
Using the blitter is roughly analogous to using
There are seven registers used for preparing a copy operation and an additional address used for initiating the copy operation. In order to access these registers, DMA_ENABLE must be set.
|X coordinate in framebuffer of left column of drawing
|Y coordinate in framebuffer of top row of drawing
|X coordinate in Sprite RAM for first column of source data
|Y coordinate in Sprite RAM for first row of source data
|Width of drawing operation. Bit 7 controls horizontal flipping.
|Height of drawing operation. Bit 7 controls vertical flipping.
|Write 1 to clear IRQ and begin a blit operation. Write 0 to clear IRQ without starting a blit.
|Value to use for Color Fill Mode. Value is inverted. Only used when DMA_COLORFILL_ENABLE is set.
VX, GX, and WIDTH are read both at the start of a blit and at the end of every row. COLOR is read for every pixel in color fill mode. Modifying these during a blit operation with careful timing can produce a variety of effects. However, if you want to copy the sprite normally these registers should be left alone during a blit.
For solid color fills, the value written to the COLOR register should be inverted from the expected color number. So to write a color with value 213 set the register to 42.
The values of GX and GY last used by the Blitter will also influence which part of Sprite RAM the CPU can access in addition to the Banking Register. The video section of the memory map is only big enough for a 128×128 region. So the quadrant of Sprite RAM available to the CPU is determined by the most significant bit in the Sprite RAM coordinate counters. Typically these would be set before loading sprites by running a single-pixel blit operation copying from the target quadrant to an off-screen portion of the framebuffer.