Battlezone – Mini Vector Arcade Machines

2:16 pm Projects

If you follow me on Twitter, you’ve probably seen the picture of a CRT deflection yoke undergoing surgery. Well, it’s now installed in a mini Battlezone arcade cabinet that I built for Maker Faire this year.

It uses a 5-inch B&W CRT taken from a broken security camera monitor. I had to rewind the yoke to make the vertical windings fast enough to handle vector graphics. The horizontal windings were already pretty close, but they did need to be rewired to operate in series to reduce the drive current.

The CRT is a bit different than most of the old-style CRTs I work with. For the curious, it uses an EIA E7-91 style base which has an additional grid for acceleration purposes. The lower circuit board in the photo is a potentiometer resistor divider that develops a ~300V bias voltage to drive this additional grid. The upper board is a Cockcroft-Walton multiplier circuit to step up the 1KV power supply voltage to the 4KV necessary for the post-deflection acceleration (PDA) anode. I’m running this CRT a bit under voltage, and it works fine because I’m not trying to fill the whole screen with a solid raster.

The metal enclosure houses the power supplies–it is made out of soft steel with the idea of containing the stray magnetic fields generated by the power supply switching inductors. It works a bit, but I’ve had better luck in the past with mu-metal shields around the CRTs themselves. There are three power supplies: one steps 120V down to +12V, +5V, and -12V. Another steps +12V to +1KV, and the final one steps +12V up to +60V. These last two power supplies are detailed here. They are open-source hardware so you can build your own.

Outside the shield you can see the video amplifier board at the lower left, which is the same circuit used on my electrostatic deflection board but without the deflection amplifiers. At the bottom right is my new magnetic deflection amplifier board which drives the deflection yoke. It is based around an LM4765 audio amplifier IC. I’m not totally happy with the design but eventually I will release the board design. The green board in the upper middle is an STM32F4 Discovery board. The board to the right of it is an audio amplifier that drives the speaker.

The joysticks I machined out of small aluminum blocks. It took some experimenting to figure out how to arrange the springs to get the joystick to return to the center position. The joystick handle on the right is hollow to allow the wires for the fire button to pass through.

I also build a second unit with the same driving circuit but a different CRT–a 5-inch round 5AXP4. This CRT would originally have been used by a TV technician to look for problems with the chassis or the full size picture tube in a customer’s set. The glass is extra thick because the tube was designed to be handled more. This is the same tube that I started experimenting with last year.

21 Responses
  1. Richard :

    Date: June 10, 2015 @ 6:38 am

    There has been a lot of discussion of using a similar approach to run on vectrex. Using an arm based dev board to run the emulation and then interface it electronically to a cart in the vectrex that would just handle the display side. Eg the board would just provide the vector list in a shared memory location and leave the vectrex program to render it. This has been getting a lot of attention as this could potentially allow much more powerful homebrew games to be made for the vectrex. Eg having realtime 3D graphics etc.

    Do you have a vectrex? Recommend getting one!

  2. eric :

    Date: June 10, 2015 @ 5:20 pm

    Richard: We had some discussion about running Vectrex on it a while ago. I’m not sure the board is fast enough to emulate the processor and generate the vectors. Perhaps there are ways around that.

    I’m also tinkering with an OpenGL-like 3D graphics stack (wireframe only) for the STM32F4. I’ll be putting together a separate post about that since it turns out to be quite fast. It sounds complicated but it is surprisingly easy to work with, and the library itself about 350 lines of code.

  3. Fredk :

    Date: June 10, 2015 @ 3:06 pm

    Nice work my friend. Very very cool. Although I have no problem making an XY monitor I have never worked with the Stm32f4 boards. Any chance you’d sell one programmed and ready to go?

  4. eric :

    Date: June 10, 2015 @ 5:15 pm

    Fredk: Hmm, I don’t plan on selling any ready-to-go boards. Maybe now is a good time to get a STM32F407 Discovery board. They are cheap and well-supported online.

  5. Fredk :

    Date: June 11, 2015 @ 3:42 am

    Do you have the file that loads into the e Arm board? I assume a Hex file or Bin? Thanks.

  6. eric :

    Date: June 11, 2015 @ 9:48 pm

    Fredk: Afraid not, you’ll have to build it yourself due to copyright concerns (we can’t provide you with the Asteroids or Battlezone ROM).

  7. Clay :

    Date: June 11, 2015 @ 1:22 pm

    I’m curious, did you implement some sort of DDA line draw and just DMA the points to the F4’s DACs, or is there some analog integrator hardware there for sweeping between vertices and keeping constant line brightness?

  8. eric :

    Date: June 11, 2015 @ 9:46 pm

    Clay–nothing quite so complex. This is just the F4 slamming coordinates into the DAC outputs using Bresenham for drawing lines. No analog integrator, no constant beam velocity. Looks great.

  9. Waldo :

    Date: June 13, 2015 @ 8:28 am

    Great work. Maybe I can make a little PCB for this that would plug into my increasingly unreliable BattleZone arcade machine.

    A couple suggestions:
    To check this out without a dedicated CRT, you can use an analog scope in XY mode. You may have to level-shift or invert the Z to blank the video properly. If you do this, change the value of g_vctr_post_delay to 1. This reduces the video off delay so it works better on electrostatic deflection CRTs.
    Also, changing write_gpio_leds to change PD14 as well as PC4 will show the Start LED on the Discovery board without needing to add an external LED.

  10. Fred :

    Date: January 27, 2016 @ 12:40 pm

    Is there anyway you could help a guy out? I want to build one of these, but I can’t get the code to compile.. I own an original Battle zone and Asteroids.

  11. eric :

    Date: January 29, 2016 @ 5:03 pm

    Fred, can you paste in the compiler error you are getting?

  12. Bob :

    Date: September 21, 2016 @ 1:17 pm

    With regards to getting it to work on a Vectrex, I have created the Vectrex32 SmartCart. It’s a 32 bit microcontroller on a Vectrex cartridge, sending commands to the Vectrex through dual port memory. The 32 uC (a PIC32) is running interactive, interpreted BASIC.

    So you can now write Vectrex games in BASIC and debug them easily.

    Check out Vectrex32.com. I have SmartCarts for sale.

  13. John :

    Date: January 11, 2017 @ 3:27 am

    STMicro has obsoleted STM32F4 Discovery eval board and replaced it with a new part number STM32F407G-DISC1. Will your code run on this replacement board without any pinout or code changes?

  14. eric :

    Date: February 3, 2017 @ 6:14 pm

    It should work. Under Linux, you may need to change your udev rules and upgrade openocd to support the newer debugger firmware on this board.

  15. richard :

    Date: February 16, 2017 @ 12:46 pm

    Just got this working on a vectrex display (the easy bit) and compiled on windows (the hard bit), awesome! Great work!

    I’d like to know more about how the emulation actually works. I can see where the 6502 assembly is processed, but how does the original code ‘find’ the hardware and how is this emulated with the STM32 hardware.

  16. eric :

    Date: February 25, 2017 @ 1:21 am

    For the hardware emulation question, take a look at memory.c. sim6502 calls “memrd” or “memwr” when the 6502 code tries to read or write memory. There is a tag on each memory location that specifies how the memory access should be handled: main memory, vector memory, coin, switches, pokey, sound, etc. When the 6502 accesses a “hardware” register, code on the STM32 runs that emulates that function.

  17. richard :

    Date: February 22, 2017 @ 1:25 am

    One more question. I don’t see any Z data coming out of the DAC bits. PC0-3. It seems to always be set to full intensity.
    The code appears to always write 0x0f to the GPIOC register.

  18. eric :

    Date: February 25, 2017 @ 1:13 am

    Hmm, that seems odd. I’ll have to look into that.

  19. Graham :

    Date: June 11, 2022 @ 8:46 pm

    As a followup to Richard’s comments (Hi Richard! – R C from Facebook, yes?) – we did take on the idea of an add-on ARM CPU in a cartridge for the Vectrex and indeed Battlezone runs beautifully on the Vectrex – so much so that some of our guys have built custom controllers for it! https://www.youtube.com/watch?v=UcQ4_DKercc

  20. Graham :

    Date: June 11, 2022 @ 8:57 pm

    PS Hedley – thanks for your ‘sim’ static binary translator. We used it in the Pitrex project as a bootstrap while writing our own SBTs. Our 6809 one rather surprisingly (to us) got Star Wars to work on its very first attempt – a tribute to how well the 6809 test suites people had written helped in debugging the translations. If you ever need a 6809 SBT, let us return the favour – give it a try … https://github.com/malbanGit/pitrex-baremetal/tree/main/starwars/translate

  21. Tom :

    Date: July 17, 2022 @ 12:34 pm

    Hello Eric, I agree with Richard concerning Z data from PC0-3, I have same experience. Have you discovered the cause of it? Thanks and regards.

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.