2

Progress so far

Posted by Chris on Friday, November 27, 2009
Well, whenever you get any graphical screen working, the first job is always to write a repeating message - "Nerds are cool" or something like that.
And to display a message on a graphical screen, you need to have a "bitmap" font - a sequence of bytes that, when sent to the display, create letters on screen.

We've chosen the "BlackoutX" font as it has a thick outline around each character, making it ideal for dark and light backgrounds. It also happens to be a fixed width font (always easier for implementing bitmap-based text) and even better, each character is 8x8 pixels in size. It's just like a custom ZX Spectrum font!

Note to uber-nerds and ZX Spectrum bores: poke 23606,x and poke 23607,y where x and y are the high/low bytes pointing to the start address where your character set has been poked into memory. It's amazing what you remember, even decades later....


The outline around each of the characters also mean that this font would be equally suitable on a dark or light background, or even drawn directly over a bitmap/image.



I've deliberately only coded a few letters, to keep the size of the code down, so burning it to the mcu doesn't take forever each time I try out an update.
I have coded the entire font set (I wrote a custom VB app to do it for me) but the full font set bloats the PIC code from 3k to 12k - the burning time increases fourfold and while I'm still trying stuff out, I only need a few characters anyway. Implementing other characters means simply increasing a look-up table.

And now for the "reveal" - a working demo of the BlackoutX font on a QVGA LCD screen:



Ok, it's not quite there yet, but at least you can see readable characters on the display! There's a little bug in the code that draws the "transparent" pixels as black, which make the letters appear to be on a black background - so you don't get the full "outline" effect. But that shouldn't take long to hunt down and sort out....

2 Comments


The images seem to be broken :-( An extra 9k for the font seems substantial. Surely it would be 8 bytes per character for 96 character = under 800 bytes?


True, 9k for a font is massive! I got the font characters down to 40 chars (uppercase A-Z + numbers + a few special characters) and each character is an 8x8 grid (8 bytes per character). In fact, I also include a mask for each character, so each character takes 16 bytes. The whole thing weighed in at 40 x 16 = 640 bytes.

But to store and recall 640 bytes in a lookup table (retrieving font data from eeprom was too slow) meant the compiled PIC code grew by about 4k in total.

Post a Comment

whos.amung.us

Copyright © 2009 .Nerd Club All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive Supported by Blogger Templates.