JANUARY 2019

Chapter 10 - The Overlay Plane


In this chapter, I'll start using the Overlay Plane I described in Chapter 8 to display the Score and Energy Status Bars.

I'm not aware of any 8-bit computer that had a graphics system with a hardware dual playfield capability. The only one I am aware of is the Commodore Amiga which is a 7.159 Mhz (NTSC) clock speed, 16 bit system with custom graphics hardware.

On the Amiga, you could create two (or more?) bit mapped displays overlaying each other and both independently addressable. This was used extensively in games, not only for overlaying Score and Game Status information but also in parallax graphic effects.

On 8 bit systems such as the CoCo, such feats would have to be emulated in software. This is what my graphics engine in GunStar does. It has some CPU overhead to move large blocks of RAM around but the overall operation is simple and the code size, using the 6309's TFM instruction is quite small.

This dual playfield capability is magic-in-hardware on the Commodore Amiga but on the CoCo is only a software illusion. But done right, to the untrained eye, it too looks like magic... albeit, not as fast as the Amiga's hardware counterpart but pretty good for an 8-bit system at a fraction of the clock speed.


Operation

In GunStar, I have created the background plane which shows a window to a slightly wider area. This is made to scroll down the screen by adding a new line of graphics at the top of the page, to appear as if flying over the background terrain.

As a simulated overlay plane, I can place additional graphics in a fixed location that is unhindered by the scrolling background behind. The diagram below hopefully clarifies this.

The image on the left shows the background plane with the ground scenery and the overlay plane with the Score and Energy Bars on a simulated separate plane. These planes are merged together to form the final composited screen as shown on the image at the right.


 Background Plane and Overlay Plane                                                         Composited Plane to be displayed


I don't need to concern myself with what is overwritten on the Background Plane by the Overlay Plane. Nor do I need to concern myself with erasing of the previous graphics on either plane, the graphics engine does that. I just have to write the graphics data in whatever method I choose as if it's a static display.

Although, due to the bit mapping of 2 pixels per byte, if one of those pixels in the byte I am writing on the Overlay Plane is actually black, it will override the equivalent pixel on the Background Plane below unless I do a bit-merge first. For speed, I can either ignore this black pixel overwrite or design the graphics to fill a complete byte, avoiding the black pixel.


Short but sweet

This is the part of the chapter where I was to have a link to a video demonstrating this overlay plane but things have been going so smoothly and quickly that I have gone ahead and begun programming the actual GunStar ship into the game. It is already working well but I will postpone the video for the next chapter to include this. The next chapter should be up in a week so it will only be a short wait to actually see what I've been ranting about.




Copyright 2017 by Nickolas Marentes