Developing for Commander X16 in Prog8 – Part 6

The Commander X16 VERA graphics chip has several layers.

  • The Background Layer, which can only have the colour changed
  • Layer 0 on top of the background Layer, which can have Tiles or a Bitmap on it.
  • Layer 1 on top of Layer 0, which can have Tiles or a Bitmap on it.

Any part of Layer 0 which is Transparent (denoted by the palette #0 position) will let the Background show through. Any part of Layer 1 which is Transparent (palette #0 position) will let Layer 0 and/or the Background show through.

Sprites can be interleaved between or on top of these layers.

The Layers are shown above. The green hollow shapes denote where Sprites may be added. In this way, Sprites can be completely or partially hidden by the Layers above. For example, if the player walks behind a tree they will be obscured by the tree on the layer above.

So far, we’ve been only dealing with Layer 1 as it’s the default layer when you turn on the Commander X16. The characters you type with the keyboard display PETSCII tile characters on Layer 1.

One useful usage for layering your graphics is you can put Tiles on Layer 0 and Sprites on Layer 1 and also a Bitmap or other Tiles on Layer 1 to draw the HUD (Heads-up display) with the current score, number of players left, level number, etc.

Comments

Leave a Reply