Chroni Series

Chroni Video Processor (Part 1)

Finally Compy has a video processor and it is called Chroni! The name comes from “partners in time” and it was suggested by my friend Stuart Law as a variant of the British saying “Cronie, partners in crime”. Why partners in time? Because the CPU must operate in sync with the video processor and it is heavily influenced by the video timings.

Following there will be a series of post detailing the features included in Chroni, and this time they are not only ideas, most of these features are already implemented in the Compy Emulator. I also included several assembly programs included as an example of use.

Let’s start with the list of features:

  • 128K of Video RAM
  • 320×240 maximum resolution at 16 colors
  • 64K color palette
  • 3 Character modes: Normal, Wide and Double (1×1, 1×2, 2×2)
  • 7 Bitmap modes: 160 or 320 pixels wide, from 2 to 16 colors
  • 3 Tiled modes: 16×16 pixels, 160 or 320 pixels wide, from 4 to 16 colors
  • 32 sprites. 16×16 pixels, 15 colors + 1 transparent color
  • Horizontal and Vertical scrolling (not implemented yet)
  • Antic like Display lists
  • Vertical Blank Interrupts
  • Display List interrupts

Design principles

A proper design for a Video Processor that will be driven by an 8 bit CPU must consider its limitations, mainly speed and the amount of addressable memory: The CPU just can’t read or write a lot of data per frame and the addressable memory is only 64KB.

Chroni is designed to reduce the need for screen memory access by the CPU, so copy operations are avoided by providing pointer operations instead. For example, sprites can be updated just pointing the data address to any location in VRAM. Using this method you can modify a sprite with just a 2 byte write operation. The same with palettes, tiled graphics and so on.

VRAM is mapped into a 16K window on main memory, and it can be mapped out because only Chroni needs to access that memory at all times and not the CPU. Using this method all the VRAM is accessible via a simple memory write/read instruction, there is no need to use more complex methods like registers on the video processor.

This is just a quick overview of Chroni, keep reading these post series for full details.