
The set-up screen
The set-up screen is the only part of the code that is written in C and for this I implemented a very minimal windowing like look and feel (the code is nothing to be proud of though and contains lots of repeated code that could be cleaned up).
The set-up screen is activated when you give the terminal the famous three finger salute (i.e. ctrl-alt-del) which brings you with an empty blue screen and a simple menu bar on top.
The first letter of each menu item is highlighted in red. Meaning that pressing the letter on the keyboard will open a small window corresponding to that menu item. Otherwise, a simple return can be used and the menu option selected by the cursor will be opened. Traversing menu options can be done with the TAB key.
Baud rate selection
This allows you to choose a different baud rate than the default 115.200 baud. Note that you can’t change the number of data bits, start bits or parity bits. This is fixed at 8 data bits, no parity bit and 1 start bit.
Colour selection
Here you can set the default font and background colour. The screenshot below shows that green is selected for the font and black for the background.
Screen size selection
Since the terminal has 8K of video RAM to play with, I could implement
some screen sizes with a lot more lines than the 24 or 25 lines that were
usual at the time. The maximum [for the moment] is 60 lines. Note that for
screen sizes with more than 30 lines, you need to select a font with a
height of less than 16 pixels. E.g. if you would choose 60 lines, then
each character can not be more than 480 / 60 = 8
pixels.
Font selection
Here you can select the font to be used. Only one font can be used at the same time. At the moment I implemented 2 fonts which follows code page 437 with either 16 or 8 pixels height.
-
The 16 pixel height one, I found in the VGA3 project.
-
The 8 pixel height one, which comes from The Oldschool PC Font Resource website. Which has a lot more fonts that could be used here as well.
Exit
Here you can confirm if you want to flash the updated settings and reboot or just exit and keep using the old settings.
Default settings
No screen shot for this option. Selecting this option (or simply pressing D) will install the default settings in Flash and reboot the terminal. The default settings are:
- 115.200 baud (8N1)
- Green font colour on a black background
- 80 characters by 25 lines
- Font 0 (code page 437, 16 pixels height)
A word on storing the settings in NOR Flash
In my first prototypes I used a simple 8 position dip switch. But this quickly turned out to be insufficient to be able to choose all the above mentioned settings.
Since I’m using a NOR Flash chip to store the code it is possible to reserve a few bytes of it to store the settings. This required only a small change in the schematic (wiring up the write signal to the NOR Flash).
However programming the settings was a bit more difficult. There is only one NOR Flash containing the code to program the same NOR Flash with a few bytes. Running the code in the same address space as the NOR Flash is in messes up the addressing sequence required to program the same NOR Flash.
What I had to do is first copy the programming code into User RAM and run the programming code from there. Luckily, it’s easy to write short, relocatable code on a Z80 and all that is needed is to copy this code to the USER RAM and execute from there.