17-01-2021, 10:24 AM
(17-01-2021, 12:58 AM)ChickenMan Wrote: The HIRES2 line plotting was updated to the faster Bresenham's Algorithm in BASIC 6.32e. You can read further about it in the Catcher v6 #4a p10
Many thanks Chickenman!
Fig.1 Fast line drawing on an Oscilloscope!
Although quick, Bresenham's pixel based line draw algorithm isn't necessarily the fastest. There are others about that are also quick.
The Gamma which had the faster 68000 16-bit processor and more working registers used an additive line drawing algorithm.
Be aware that Monte Chan's Turbo Pascal Hires graphics library for the original microbee (circa 1983), Storymaker (for the Alpha Plus), GSTAR and some other demonstrations were already using Bresenham line and Michener's circle algorithms. Unlike the standard microbee routines these routines ensured that swapping the coordinate order didn't leave pixel dregs on the screen. The dregs are caused by the decision calculation on when to change rows or columns and this decision point can be in a different position when drawing the same line but in opposite directions.
In addition to pixel based algorithms, there are some graphics hardware optimisations that can be applied.
Examples include:
- Rather than the slow pixel by pixel plotting which is calculation intensive and slow, deltas are used and screen updates are only performed when a complete byte based bitmask is complete.
- Horizontal and vertical lines are recognized and optimised accordingly.
There should be a few animated line drawing and unfolding and rotating cube demonstrations around for both the Alpha Plus and Gamma machines to show off their speed.
