Xvectrex


Xvectrex is a modified version of XFree86 outlink, with display and input drivers added for the Vectrex. It has also been modified to run on the Raspberry Pi with modern versions of Linux. See the readme file outlink for technical details including compiling and configuration instructions. This is a summary of how it works for the PiTrex software.

Programs use a library called Xlib or libX11 (possibly via other libraries in-between) to draw on the screen and read user inputs. The Xlib library talks to a separate program called an X display server, and it is this server program that actually draws things on a computer monitor and reads keyboard and mouse inputs.

Features of this compared to each program interfacing with the display and inputs directly include:

  • Multiple programs can use the display and inputs without clashing with each other.
  • Root access is only required by the X server, so other programs don't need to be trusted with the ability to see/modify anything that the computer is doing.
  • Programs can run on a separate CPU to the X server (if there's more than one CPU), so that the display drivers (particularly the Vectrex one) don't slow down applications as much.
  • Programs can run on a separate "remote" computer to the X server, and talk via a local network (or even over the internet with a fast connection and data compression, eg. via SSH).


At least the last two features can be useful for the PiTrex software, but one of the main advantages is simply that lots of existing Linux vector games have been written for X (see software_ports), so they can be more easily ported using Xvectrex instead of needing to rewrite them to use the Vectrex Interface Library directly.

The main restriction is that games must draw vector graphics using the Xlib line-drawing functions in order for the corresponding lines to be displayed on the Vectrex. Some don't, but in the case of XMAME, it was possible to modify the display code to draw this way instead of using its built-in vector renderer, which meant that the remote display capability of X could also be retained for running the emulator on a faster computer than the Raspberry Pi Zero.