Electronic – Video Controller Design

ramvgavideoz80

I'm designing my own computer based on the Zilog Z80. It has 256KiB of static RAM with paging as well as a few megabytes of flash memory. Everything is going along pretty well until * BAM * I hit a dead end.

The problem that I am having is designing a video controller. I was thinking about some kind of a terminal or display. A 24×80 or 25×80 terminal would be wonderful. However, even a 640×480 VGA display would take up enormous amounts of memory.

640 * 480 = 307.2 Kbits

That is even more than the amount of memory addressable by the Z80 at one time!

Also, if I want color, say, one bit per color, I would need 3 bits per pixel.

307.2 Kbits * 3 = 921.6 Kbits

In addition, wouldn't it need to be dual-ported to allow access from Z80 and the monitor?

Because this is extremely difficult to implement in software and hardware, would it be a good decision to use a character ROM? It would be very difficult for me to get fuse-link PROMs or UV EEPROMS. What should I do? Can I put a character ROM in flash memory? How would I implement it in the controller? How do I tell the character ROM which character to spit out? Should I even use VGA? Would component video (NTSC or PAL) be easier than VGA?

If a good system can be designed, perhaps we can even use it for microcontrollers! Give me all you got, I need as many ideas as possible.

Best Answer

This is why VGA displays didn't happen until long after the Z80.

Block graphics with sprites, or 1 bit per pixel monochrome graphics, or character ROM based display modes were the order of the day. Sometimes you could switch modes between them.

Using character ROMs, the ASCII character code provided most of the address into ROM, with (scan line mod 10) providing 4 LSBs of address. So you stored ASCII character codes into a small (maybe 2kbyte) RAM, and the video controller hardware read a string of 80 from this RAM, (10 times in succession for 10 successive scan lines) to deliver 80 bytes (640 bits) per line.

Those 80 bytes may come from a 128 byte section of the 2K RAM, to simplify the video addressing. Likewise the 10 scan lines come from a 16 byte section of the character ROM to simplify addressing. With a suitable design you can select a different page of character ROM with 14 or 16 bytes per character for a prettier font (and fewer lines of text on screen!) with only minor changes to the video hardware.

The 6845 video controller was a popular device that could handle this sort of addressing and simple bitmapped graphics; it should still be easy to find a lot of information on it.