Single Cog Graphics Driver Pattern
Title:Single Cog Graphics Driver Pattern
Author:CardboardGuru
Published:Mon, 16 Jul 2007 11:04:26 GMT

The propeller is unusual in that it can generate a video signal in software. There is hardware support, but you need to have software constantly feeding that hardware with pixel and sync data. A complete video frame's worth of data 60 times a second for NTSC (50 for PAL).

The simplest graphics drivers consist of a single cog which both prepares the data for display and sends it to the video hardware. Examples of this kind of graphics driver are:

The limitation of this pattern is that there is a very limited amount of time available on the single cog for doing anything other than sending pixel and sync data to the video hardware. Especially if you want to use Hi-Color, high horizontal resolutions, display lots of sprites, or preprocess graphic assets such as change their color depth on the fly. In such situations you can use the Cooperative Rendering Pattern.