Font Memory
8.1 Overview
As its name suggests, the font memory stores the font data used when the current video mode is set to one of the text modes.
There are 256 characters in total. Each character is 8x12 pixels and occupies 12 bytes of memory.
Therefore, the total font memory size is 256 * 12 = 3,072 bytes.
The characters are encoded sequentially in memory, so the first 12 bytes represent the first character, the next 12 bytes represent the second character, and so on. Thus, character n can be found at memory offset 12 * n.
Each byte of characters are encoded as bitmaps, so one byte represents 8 pixels (one line):
- Each bit set to 1 represents a foreground pixel
- Each bit set to 0 represents a background pixel
This font memory is read-write, allowing the CPU to read or modify it at any time. This makes it convenient to back up the original font before applying any modifications.
This memory acts like a tileset only used in text modes and is not used in graphics mode.
8.2 Example
For example, the ASCII character 0 can be encoded as the following byte: 0x00, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00:
These bytes can be stored starting at offset 0x30 * 12 bytes = 0x240 in the font memory table to correctly align with ASCII encoding.
8.3 Default font
It is highly advised to follow the ASCII order for the printable characters. In fact, on power on (not reset), the font memory is loaded with the BigBlue character set, created by VileR, licensed under the Attribution-ShareAlike 4.0 International (no changes have been made to this font).
On power-on, the FPGA automatically loads the font data from its NOR flash memory and stores it into the font memory. This process is done at a hardware level and does not require any intervention from the host CPU.
8.4 Interactive demo
In the demo below, toggle the pixels in the table to see how the character would be rendered by Zeal Video Board on screen. It also generates the 12-byte sequence encoding for the character.
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 | ||||||||
| 0x00 |