SPORT Transfers to the Frame Buffer


Compared to the inner workings of the cel engine, the details of transferring an image into the frame buffer with the SPORT bus are starkly simple. In essence, a background image is stored outside of the frame buffer in another section of VRAM. During the vertical interrupt of the NTSC display, the SPORT bus transfers the contents of the background-image bitmap into the frame buffer, effectively erasing everything there and laying out a fresh background for any cel projection or direct drawing to the frame buffer.

Restrictions

The SPORT bus has the following restrictions imposed by its architecture-one timing restriction and three memory restrictions:

Strategic memory allocation for SPORT transfers is crucial. The frame buffer must be in the same VRAM bank as the background bitmap for a SPORT background refresh to work. SPORT's full-page restriction requires that the frame buffer and bitmap both allocate full pages of VRAM for their operation; if the bitmap or the frame image use less than full pages for their contents, a fraction of a page is left unused, but is still allocated so that the SPORT transfer can write into it without harm to other processes.

As it turns out, there is little or no VRAM waste with full-page allocation because VRAM page sizes are 2 kilobytes in size (depending on available VRAM), and a standard 320-by-240 frame buffer uses exactly 75 2 KB pages of VRAM.

Clearing the Frame Buffer

Many tasks will want to clear the frame buffer to a single color (black, for example) instead of laying down a background image for each frame. The SPORT bus features FlashWrite. It copies the contents of a single 32-bit register to all the pixels of the frame buffer. This clears the buffer without dedicating an entire page of VRAM to the clearance color. FlashWrite operations are not restricted to occurring during Vblank.