Text Generation
BMOW is now text-enabled! I stole an 8×16 bitmapped font from the X11 font set, programmed it into my character ROM, and now I can do this:
OK, it would be a more impressive demo if I actually wrote some specific text to the screen, instead of displaying garbage memory as text, but you get the idea.
There are 64 columns x 30 lines shown here. Each character is an 8×16, 1 bit-per-pixel bitmap stored in the character ROM. During normal video operation, bytes from video RAM are passed directly to the palette chip to be converted into colors. During text mode, however, the bytes from video memory are instead used to create an address for the character ROM, along with the least-significant 4 bits of the screen row counter. The correct character byte for the desired character and row is then retrieved and passed to the palette chip. There are 128 (7 bits) different characters possible. The 8th bit is used to invert the character, making it appear as dark on a light background. This can be used to implement a cursor, or create a highlight effect for text.
In this example, the whole screen is filled with black and white text. I’ll try some more complicated examples next. It’s possible to select different foreground and background colors for each line of text, as well as to mix some lines of text with some lines of graphics on the same screen.
Unfortunately a side-effect of my most recent text-related changes seems to be making BMOW extremely crash-prone. It frequently freezes up within a few seconds of power-on. If I remove the text-related subroutines from my boot ROM, the problem vanishes. Oddly, the problem happens if the text routines are in the boot ROM, even if I never call them. I think they’re pushing the system monitor program subroutines into a different address range in the ROM, which must be causing problems somehow.
A second problem is that my horizontal resolution of 512 pixels doesn’t scale well on my LCD monitor. The monitor thinks it’s a 640 pixel wide image, and does some kind of sampling and scaling accordingly, with the result that the text looks distorted. If you look carefully at the full-size version of the photo, and look for instances of the forward slash “/”, you’ll see that instead of looking like a smooth diagonal line, they look chunky, like an extra pixel were in the line. This is not an error in the font, and if you look at other examples of the forward slash, you’ll see that the extra pixels are in different places, or in some cases not present at all.
Maybe I just need to live with this. The only realistic solution I can imagine is to replace the video clock to generate a 512 pixel wide image with 640 pixel timing, with a 128 pixel black border at the sides. Updating the video system to generate true 640 pixel wide video would be too large of a change to attempt at this point.
Read 3 comments and join the conversation3 Comments so far
Leave a reply. For customer support issues, please use the Customer Support link instead of writing comments.
I accidentally deleted the comment “So when will we be seeing BMOWUnix? :)”
Hehe, probably never. I’m intentionally aiming for something similar to the single-user home computers of the 1980’s, like the Apple II and Commodore 64. I did some experiments earlier with multi-tasking several programs in their own protected memory spaces, but it was only a proof of concept. BMOW programs can be kept simpler and run faster if they can assume they have complete control of the machine, rather than just being one program of many managed by an underlying operating system.
Hi again,
I had halted my vga project since the last time I wrote to you and restarted it a couple of weeks ago… I decided to use a cpld to perform all the critical timing and at the momment I have managed to produce some color lines on an lcd monitor and show a small static image.
Now I am designing the Text mode process.
If I understand correctly, you read a byte from the sram and this becomes an address for the EPROM that holds the font patterns. Then you read line by line, byte by byte, each of the 16 char lines and you feed them to the GAL shifter. Then the GAL serially outputs bit by bit every line to the Palette chip.
Please verify the validity of this.
I need to have different colors per character so I probably need two flash memories one to hold the characters and one to hold the colors and read them simultaneously. Any other ideas?
Yes, that sounds right. If your text mode must support colored text, then you’ll also need some additional way of specifying the font color. Either stored along with the character data in your video memory, or provided through a separate color register or something…