Single Cog Graphics Driver Pattern - rosco-pc/propeller-wiki GitHub Wiki

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 Parallax TV driver - (Hydra version: tv_drv_010.spin, Other boards: TV.spin)
    • This uses a tile map, which can also be configured to be used like a screen buffer.
  • HEL - the graphics driver on the Hydra Book CD
    • Builds on the Parallax TV driver, and adds sprites. (Up to 5 per line)
  • The demo SimpleNTSC
    • Has a flag and some color bars hard-coded

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](Palette Mode#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.