SX Game System


Picture of the system's PCB.

This page describes a SX28-based color video game system I made during year 2002. Now, beginning of 2007, almost five years after I made the first design I've updated the layout of the PCB and added a version of the PCB that has built-in gamepads and I also have made it possible to buy PCBs, preprogrammed chips, color carrier oscillators and of course complete kits from me in my web shop.

Since all games use the same hardware I have chosen to describe the game system hardware here on a separate page, and describe game specific stuff on the games pages. So far I've only made two games, Pong and Tetris, but some day there might be more games for the system.

The main hardware.


Schematic for the SX game system. (Click to enlarge)

The power supply is standard, a 7805 regulates the voltage to 5v, there is a rectifier at the input to be able to run the system on both AC or DC, the voltage can be 8..15v something. Then there is a bunch of caps on the board to get rid of noice etc.

The video generation is quite simple; it is just a five bit R-2R resistor ladder. It might seem a little bit strange that I connected it to bit 1...5 instead on 0..4, but that is because when I first made the prototype it hade six bits for video and four for audio. I chose six bits first as it is the largest number of bits you should use with an R-2R ladder when using 1% tolerance resistors. Later I understood that it was not needed that many bits for video, that last bit would be better off in the audio generation. At the end of the R-2R ladder I have put one 1pF cap to get a a little bit of filtering if the TV's input has to high bandwidth as my color generation technique generates square wave that needs to be filtered so only the "sinus part" remains. The resistor ladder has an open output as it is supposed to be connected to the TV that has an 75Ohm input that ends the ladder.

The audio part is very similar to the video part, also a five bit DA using an R-2R ladder. The difference is at the end of the ladder, the audio has a 100 Ohm pot to regulate the volume. The 100Ohm pot also ends the ladder as the audio impedance varies a lot between different audio inputs. (1k...20kOmh)

Joysticks.


A classic Tac2 joystick

The joystick inputs are extremely simple, just five pins on the chip connected directly to the joystick inputs. The joystick pins on the SX-chip have their internal pull-up resistors enabled so there is no need for external resistors. There are two joystick inputs, and as with my PIC-based games I used old C64/Amiga/Atari joysticks. If you don't have one you could build one quite easy using the schematic here to the right using five off(on) switches and a 9pin female dsub.


Schematic for a C64 compatible joystick

Oscillator.


My ancient signal generator.

One of the more tricky parts is the Oscillator. This should run at 12 times the color carrier of the TV-system. The built in generator in the SX-key programmer is not accurate enough for video generation, so an external oscillator is needed. During the development of the games I used an almost 30 years old frequency generator (as new ones cost a fortune) seen at the picture here to the right, which made the development a lot easier. There chip-oscillators available that can be programmed once just like you can program a microcontroller. You can buy such oscillators from my webshop preprogrammed to NTSC frequency. (Currently that is the only ones I sell because my games works so poorly for PAL and most modern TVs support both PAL and NTSC anyway). See the table below for what frequencies to use if you program your oscillator yourself or have another solution to generate the frequency.

Small preprogrammed oscillator.

TV System Carrier Frequency ClockFreq = 12 x Carrier Frequency
PAL 4.4297125 MHz 53.156550 MHz
NTSC 3.579545 MHz 42.954540 MHz
PAL-N* 3.575611 MHz 42.907332 MHz
PAL-M* 3.582056 MHz 42.984672 MHz

*Note: None of the games have been tested and calibrated for PAL-M or PAL-N

TV-connection.


Schematic for connecting system to a SCART-input.

The system is connected to the TV's SCART input with a cable with RCA inputs and a scart contact at the end. These cables are available in most TV stores. The best thing to do is buying a finished cable, building one is more expensive and doesn't give a good result, however if you still want to build one you should follow the schematic here to the right.

PCB with built-in joysticks

Picture of the game system with built-in joypads (Click to enlarge)

As it has been requested by several people, now I've created a special version of the PCB with two joypads on the PCB, as seen in the picture here to the right. Both the layout woth the built-in joystick and the standard one (using a C64/Amiga/Atari joystick) are included in the zip-file. The layout supports two common footprints and thus can be used for several types of buttons. There is a separate building instruction page for the joypad version of the layout.


Pictures of three types of buttons supported by the PCB. (Click to enlarge). (Actually, the pictures come from my PIC-based game system but the layout of the buttons is the same for the SX-system)

The software.

So far I've made the games Pong and Tetris for this system:

More info about video signals.

There is not much written on generating color video signals in software, but there some stuff written about generating B&W signals. If you want to know more about generating video signals check out some of these links:

  • Howto on generating video signals in COLOR using SX. (Written by me) is one of the few things written on this subject.
  • AVR PAL generation by Jakub Trznadel generating PAL color video signal in realtime software by repeating sample values. (much lower resolution but much more colors compared to my sx-projects).
  • Conventional Analog Television - An Introduction by Professor Kelin J. Kuhn.
  • Eric Smith and Richard Ottosen's Video display uses an SX-chip to create a B&W serial video display output terminal
  • Documentation of Marcelo Maggi's pattern generator circuit
  • Breakout by Joel Jordan is a breakoutgame inspired by my PIC-based games using the same technique to generate a video signal in software.
  • David B. Thomas' Pong game also using a PIC, but he used a PIC16C711
  • Eric Smith's PIC-Tock generating a video singal showing a clock using a PIC16C61
  • Cedric Beaudoin's game console project with memory mapped graphics using an ATMEGA64 with CPLD-based hardware for phase modulation to generate color.

  • Cornell University Electrical Engineering 476 Video Generation with AVR microcontrollers is an interesting project with memory mapped graphics based on AVR microcontrollers.
  • Serasidis Vasilis' AVR-based colorbar generator can produce 4 colors in software based on the same method as my SX color projects.
  • AVR-based color game system with memory mapped graphics using an external chip (AD724) for the color generation.
  • Video Superimposer by David.B Thomas shows how to overlay graphics to an existing video signal using a PIC.
  • SX-list has a lot of general information about SX microcontrollers and is a good place to start to get info on SX microcontrollers that you might need when making video signals.


  • Download.

    The schematics and layout is included in the games, but if you want you could download it here as a separate file: sxgamesys.zip(113kB)

    Questions ?

    If you have questions about the games, make sure to check out the FAQ (Frequently Asked Questions) before you ask me.

    Copyright note

    SX Game System (C) Rickard Gunee. This is open source, use this at your own risk ! You may use the information on this page for your own projects as long as you refer to the original author (by name and link to authors homepage), don't do it for profit and don't hurt or harm anyone or anything with it. The author can not be held responsible for any damage caused by the information on this and related pages.