# Vectrex

### Vectrex

I've converted a Vectrex to an Vector display and am driving it with a Teensy 3 plus an SPI DAC. Using a modified version of MAME, I'm able to write the vectors to the Teensy over USB, which generates 12-bit lines using Bresenham's line algorithm and DMA to transfer the points to the DAC. This provides a nearly glitch free way to display the games and artwork.

### Conversion

The conversion involves disconnecting the Vectrex's CPU board and connecting the output from the DAC to the X and Y inputs, plus a third signal to the "Z" brightness control. This particular Vectrex isn't in very good shape -- the CRT board has wobbly caps and the solder mask has started to degrade.

### Vector generation

The Teensy 3 does DMA to the SPI DAC, which generates 0-5V. A resistor voltage divider creates a 2.5V reference, which makes the voltage swing -2.5 to +2.5 volts. This is almost enough to cover the screen, although the final design will have opamps to scale and center each of the axes. The Z axis requires a +5V for On and 0V for off, so a 2N2222 transistor is used to to use one of the alternate SPI SS lines as a beam on/off switch.

The SPI clock is run at 25 MHz and each X or Y coordinate requires 16-bits of data. With the framing and setup bits, this allows roughly 1.25 million points per second to be generated.

[MAME], with some patches, emulates the vector systems and writes the vectors to the serial port. This is working almost perfectly; I want to add an adapter for the Vectrex joystick so that the games are playable on the Vectrex as a console itself.

The Z axis wasn't working initially, which meant that the beam movements were visible. It is interesting to see how the different games behave -- Tempest (video) seems to always return to center, while Lunar Lander and Asteroids both move immediately to the next object to be drawn.

One major improvement (beyond fixing the Z axis) was adding a "dwell time" to the line drawing code. This repeats the first and last points of a vector a few times before moving on to the next one. You can see the improvement -- the font looks less "cursive" and more "arcade" by making the lines straight.

High-vector games are playable, but flickery. The need to slow down the beam means that the frame rate suffers and frequently the small text ends up a little ragged. Compared to the Tek 1720 vectorscope, the Vectrex has significantly lower bandwidth.

### Source code

This is still a work in progress. Patches to MAME, schematics and source for the Teensy code is coming; rough version of it are in github.com/osresearch/vst/tree/master/teensyv. For more information on the drive boards, see v.st.

Last update: November 8, 2020