Close

Demo Software Project: Font Editor

A project log for VDC-II

Commodore 8568-inspired (and mostly compatible) video core for driving VGA-type displays.

samuel-a-falvo-iiSamuel A. Falvo II 12/03/2020 at 18:310 Comments

It has occurred to me that my plans to complete VDC-Forth are essentially kaput; it is a user interface model for a Forth that I'd hoped would give me some unique insights and inspirations, and instead I have essentially coded myself into a corner with it.  While I do intend on playing more with the code in the future, it's not clear to me that it will remain my "go-to" piece of software I can point someone to and say, "Look, here's code that works directly with the VDC-II core you can study."

One thing that I will need in the future, though, is a font editor for this module.  So, I figured, why not write a font editor for it, using it?  And, so, that's what I'm doing.

It's written to use 640x200 bitmapped mode, monochrome.  I chose this because had I used text-mode, I couldn't easily alter the font heights.  Remember that the VDC chip supports fonts as small as 1 pixel tall and as tall as 32 pixels.  Since vertical sync timing is dependent on this height, every time I'd need to alter the font height, I'd need to recompute (dynamically) the CRTC settings.  With this comes the risk of user-visible loss of monitor sync, which is annoying to say the least.

So, bitmapped mode it is.  So far, I've implemented code to draw horizontal lines and draw filled rectangles using patterns.  Although their APIs are quite primitive and low-level, they work.

Just ... not very fast.  I predict the issue is caused by needing to read from and write to the VDC for every byte transferred.  I could probably double performance by only read-modify-writing the left- and right-hand edges of the rectangles, and just blindly writing the interior bytes.

Even so, this software isn't intended to win any races, and certainly not to race the beam in any way.  So, correctness is the most important aspect of the code.  I might spend some time to optimize the code a bit, but I won't spend too much time on it.

Now that I can draw nice rectangles and horizontal lines, the obvious next step is vertical lines and, after that, text.  Once that's done, I'll have the ability to render the complete user interface for the font editor.  From there, actually implementing the editor proper should be relatively simple.

I think.

Discussions