Classic Headless graphics - z88dk/z88dk GitHub Wiki

Headless graphics

Not all targets supported by z88dk have a graphics card or attached display. The "obvious" example is the +test target which utilises z88dk-ticks as the emulator. This target connects stdin/stdout to the shells terminal window.

Similarly, many of the modern z80 machines such as the RC2014 are by default only accessed by a serial connection.

Wouldn't it be great to be able to display graphics over a serial link?

This must have been a very common question in the 1970s, because there were several solutions to this problem.

Tektronix 401x graphics driver

A Tektronix terminal was one of the cheaper ways to obtain a graphics capable terminal in the 1970s.

The base model (4014) provided an effective 1024x768 resolution monochrome display.

The design of the hardware means that the graphical display is "write once" - it can't be read and pixels can't be reset. This means that only the plot,draw part of the monochrome graphics library is available - unplot, undraw, xorplot, xordraw etc are not implemented.

Linking to the library

The z88dk library can be linked by adding the option -lgfxtek to the command line. Note Adding the option will override any existing monochrome graphics library for your target.

You will also need to supply a single function to permit linking, this function has the following prototype:

void __tek_outc(int c) __z88dk_fastcall

Which should output the supplied character to the Tektronix device. For example, for the +test target, the simplest implementation is the following which just outputs to its console and lets the attached terminal determine what to do.

#include <stdio.h>
void __tek_outc(int c) __z88dk_fastcall
{
    fputc_cons(c);
}

Usage

  • xterm when launched with xterm -t provides a Tektronix terminal
  • Teraterm on Windows can also be used

ReGIS driver

ReGIS was supported by VT125 and VT340 terminals. As a terminal, the drawing primitive support is more fully featured, providing circle, fills and unplotting. The supported resolution is lower than the Tektronix, providing a 768x480 display.

The terminal is unusual in that commands are queued up and only displayed when a special command is issued. This command has been encapsulated in the z88dk method gfx_refresh() which should be called periodically.

Linking to the library

The z88dk library can be linked by adding the option -lgfxregis to the command line. Note Adding the option will override any existing monochrome graphics library for your target.

You will also need to supply a single function to permit linking, this function has the following prototype:

void __regis_outc(int c) __z88dk_fastcall

Which should output the supplied character to the Tektronix device. For example, for the +test target, the simplest implementation is the following which just outputs to its console and lets the attached terminal determine what to do.

#include <stdio.h>
void __regis_outc(int c) __z88dk_fastcall
{
    fputc_cons(c);
}

Usage

The only known program supporting ReGIS graphics is xterm when compiled configured with the --enable-regis option, as ReGIS is not enabled by default. Once compiled, you should launch it with xterm -ti vt340.

⚠️ **GitHub.com Fallback** ⚠️