User Tools

Site Tools



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 ctx.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) in Javascript.

Blitter Registers

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. Modifying these registers during a copy operation is possible, but not presently modeled in the GameTank Emulator.

Addr Name Use
$4000 VX X coordinate in framebuffer of left column of drawing
$4001 VY Y coordinate in framebuffer of top row of drawing
$4002 GX X coordinate in Sprite RAM for first column of source data
$4003 GY Y coordinate in Sprite RAM for first row of source data
$4004 WIDTH Width of drawing operation. Bit 7 controls horizontal flipping.
$4005 HEIGHT Height of drawing operation. Bit 7 controls vertical flipping.
$4006 START Write 1 to clear IRQ and begin a blit operation. Write 0 to clear IRQ without starting a blit.
$4007 COLOR Value to use for Color Fill Mode. Only used when DMA_COLORFILL_ENABLE is set.
hardware/blitter.txt · Last modified: 2023/08/18 16:51 by clyde