10-08-2022, 10:57 PM
Various methods of software bit bashing exist for the microbee to handle animated objects; unfortunately they consume a fair bit of CPU processing thus relatively slow particularly if collision logic is required.
The simplest method is just to use objects at the character grid level. It has a coarse granularity but is relatively simple & is fastest. (e.g. Chess)
It's when a finer granularities are required that things become more complex.
The next simplest is to use LORES graphic characters - this improves the granularity 2x horizontally and 3x vertically. (e.g. ported TRS80 games)
A trick is change the LORES pixel blocks into common mini 4x4 grid chars. e.g. rounded balls or rings.
The technique mentioned by Under4MHz is what is done for some existing microbee software for GUI style mouse pointers.
Some PCG chars are reserved for use as the cursor object (aka "sprite") and its composition is made up from an object matte - a bitmap mask that defines the cursor shape's opacity and the cursor's pixel bitmap definition. What's done is that the chars at the cursor position are copied into the cursor's reserved PCG chars, then the matte is used to create a hole to place the cursor bitmap and then the cursors pixel bitmap definition is ORed in the hole made by the matte. The original characters where the cursor is to be placed is copied into a buffer so it can be restored into place after the cursor has moved away.
To handle pixel resolution movement, the number of PCGs reserved for the cursor object (grid) is extended by one char width (X + 1) and one character height (Y + 1) to handle cursor placements that don't fit wholly into the standard grid with the matte and bitmaps having to be shifted appropriately into the extra region.
Things get even more complex when there's more than one sprite where appropriate sprite priority control & collision handling are required.
(e.g. Mytek games such as Asteroids).
For Alpha plus and later machines PCGs are often laid out so that the screen becomes a fully addressable bitmapped canvas. This allows the setting and resetting of pixels to be done purely with PCG RAM writes. This is good for some things and not so good for others.
The simplest method is just to use objects at the character grid level. It has a coarse granularity but is relatively simple & is fastest. (e.g. Chess)
It's when a finer granularities are required that things become more complex.
The next simplest is to use LORES graphic characters - this improves the granularity 2x horizontally and 3x vertically. (e.g. ported TRS80 games)
A trick is change the LORES pixel blocks into common mini 4x4 grid chars. e.g. rounded balls or rings.
The technique mentioned by Under4MHz is what is done for some existing microbee software for GUI style mouse pointers.
Some PCG chars are reserved for use as the cursor object (aka "sprite") and its composition is made up from an object matte - a bitmap mask that defines the cursor shape's opacity and the cursor's pixel bitmap definition. What's done is that the chars at the cursor position are copied into the cursor's reserved PCG chars, then the matte is used to create a hole to place the cursor bitmap and then the cursors pixel bitmap definition is ORed in the hole made by the matte. The original characters where the cursor is to be placed is copied into a buffer so it can be restored into place after the cursor has moved away.
To handle pixel resolution movement, the number of PCGs reserved for the cursor object (grid) is extended by one char width (X + 1) and one character height (Y + 1) to handle cursor placements that don't fit wholly into the standard grid with the matte and bitmaps having to be shifted appropriately into the extra region.
Things get even more complex when there's more than one sprite where appropriate sprite priority control & collision handling are required.
(e.g. Mytek games such as Asteroids).
For Alpha plus and later machines PCGs are often laid out so that the screen becomes a fully addressable bitmapped canvas. This allows the setting and resetting of pixels to be done purely with PCG RAM writes. This is good for some things and not so good for others.
