Paganini wrote:
15 x 9 seems like a pretty common glyph size. I went with 16 x 8 because it made counting scanlines and loading pixel data a little more simple, but it seemed like there were fewer typefaces to choose from.
It would have been 8x15 for sure in my case, not 9. Standard VGA 80x25 text mode font is about 14 scanlines I think, in a 640x350 mode or something like that.
I'm pretty sure I picked 15 because it evenly divides 525. It looks like my sync ROM takes units of 16 pixels horizontally, and two pixels vertically as iirc the vsync is meant to be two scanlines. Though I've sent four scanlines in the past without problems. I'm not entirely sure though how I planned to get the vertical reset to occur at the right time, since the sync ROM lacks the ability to output something unique on scanline 15 of a character. That said it looks like I'm resetting the scanline counter to zero instead of one for the first row of the screen, so maybe that was a trick to mean that at the end of the frame the vertical reset occurs on scanline 14 instead of 15? Or maybe that's a fluke, I'm afraid I don't remember at all!
Quote:
He doesn't give details for how to implement the two systems, however. I went with X,Y counters, because I couldn't see a way to make the linear counters. They have to count from 0 - 79 16 times, then count from 80 to 159 16 times, and so on, for 30 lines.
Now that I have a little more experience, I can think of a way to do it, using loadable counters and/or a couple of ROMs but it gets pretty complicated. Is there a simple way to do a linear frame-buffer?
Microcomputers certainly used linear addresses when I was growing up - memory was precious! And chips like the 6845 only really support linear addressing, they internally reset the output address at the start of each scanline within a character row.
I think trying to do linear addresses with more discrete parts is more trouble than it's worth though - as you say, you really need an extra set of registers to hold the start-of-line reset address and presentable counters.
Apart from one of my designs, I've always had separate vertical and horizontal counters instead and live with the wasted memory. In the design I posted above you can see the framebuffer RAM being indexed by the low bits of the horizontal and vertical counts, and I guess I'm relying on blanking in non-visible areas where these addresses would wrap.