On some machines you have a grid where to place bitmaps, like tiles. Others you are limited to certain horizontal positions.
One can shift bytes in memory to overcome these problems but that will slow things down.
The TRS-80 Color Computer is of the later kind, where bitmap can be placed anywhere vertically but horizontally only on the byte border.
The byte border changes through the various graphic resolutions. At 256x192-2 colors (pmode4), it happens every 8 pixels, at 64x64-4 colors, it happens every 4 pixels.
With the pmode4 at black and white (css) on an NTSC system, you get artifact colors. These happen by the TV blending and colorizing pixels.
On the NTSC case, to keep with the color you have to position your bitmap always every pixel horizontally, this means that while the byte border is at every 8 pixels, colored bitmaps will always be at every 2 pixels, so a pixel perfect horizontal motion needs only 4 positions to reach the next border.
I think the term people use is COMPILED SPRITES, when you create extra frames of your bitmaps to account for the position limitation.
So the idea here is to do just that, bounce a little artifact colored ball around pixel perfectly.

I created a 16x16 white bitmap containing a 12x12 ball within, this means that if I move it in any direction, its blit is going to "automatically" erase its older version. Then I added a full byte to the bitmap by adding 8 pixels horizontally, getting a final size of 24x16 pixels.
At last, I moved the ball every 2 pixels horizontally within the bitmap to create a total of 4 frames.
Here is the thing:

Saved the Atlas as a PNG and made a simple code to bounce it by flipping the X and Y speeds.
Here is the thing, the X can only move 8 frames.
So I created a variable F for frames from 0 to 3, so whenever you move sideways you increase or decrease that. If you overflow, it will flip to the other end and increase or decrease 8 pixels on your X.
Notice that on the screen side borders I'm not only checking for the X position but also for which frame before bouncing it back.
...and it runs way smoother than this GIF, also unwatchable if you remove the WAIT 50 MS for it is too fast
