Development

In the beginning...

I started development on what would become the Game-o-Tron 3000 in late 2013 (I think, I didn't write it down) when I got a Teensy 3 and a small LCD screen to use with it. I wanted to find out whether I could build a small handheld games console around it.The Teensy was chosen over a Arduino board for its small size and superior hardware capabilities. I started with a breadboard prototype and got the Teensy and screen connected. Using a modified version of the Adafruit TFTCLD library I was able to get the screen working and produce a 30 by 40 character display in up to 256 colours.

Prototype 1Prototype 2Prototype 3Prototype 4

Taking control

At this point I started to think about controls. I wanted to go for the traditional D-pad and gaming buttons but was wondering how best to implement this. I was in the process of building a 3D printer from a kit and what I was thinking of doing was to have a 3D printed button that would sit on top of a switch, so for the breadboard prototype I added 8 miniature switches arranged as two groups of four. I wound that I was able to use the same pins of the Teensy for both the screens data bus and the input switches (more on how this works later). I also implemented touchscreen control just in case I ever needed it, not that I have so far.

Sounding off

The last thing to do for the prototype was to add sound. The Teensy 3 had no analogue output and I'm not musically gifted so all I was after here was basis beeps. Think ZX Spectrum or an old Nokia phone. I was able to do this by using three pins I had left to drive a speaker as a crude, sort-of-but-not-quite digital to analogue converter to achieve volume control. With this I was able to play converted RTTTL songs.

Enter the Teensy 3.1

At around the time I was finishing the prototype, the Teensy 3.1 appeared on the market. This had a couple of new features that would be very useful to me: there was now 64K of memory which meant that I could implement a 16 colour frame buffer and there was also an analogue out pin which I could use for sound. As the Teensy 3 was being discontinued in favour of the 3.1 I decided to make the switch. I didn't rework the prototype for the 3.1 because I was satisfied that that I had done there would work and that more capable hardware would only make it easier.

From breadboard to plastic

The next thing that I wanted to do was go from a prototype on a breadboard to a complete, at least somewhat professional looking, article. I had decided that 3D printing was the answer for this and had recently bought an Ormerod 3D printer. I decided to use OpenSCAD to design the parts; being a programmer, designing the parts by "programming" them (sort of) suits me better than drawing.

The first thing that I wanted to work out was the control buttons and direction pad. I decided to use off off-the-shelf button with a plastic cap that would sit on top of it. The cap fits through the case and has a lip to hold it in place. After a few iterations using different switches I found a setup that worked well. The final refinement was to small pieces of foam rubber to stop the plastic caps rattling and give the buttons the correct feel.

Button prototype 1 - Front Button prototype 1 - Side Button prototype 1 - Back

Button prototype 2 - Front Button prototype 2 - Side Button prototype 2 - Back

Button prototype 3 - Parts Button prototype 3 - Assembly Button prototype 3 - Front Button prototype 3 - Side Button prototype 3 - Back

The case of the case

Once that was done the next part was to design the rest of the case. The form factor is roughly Game Boy like and the outer case is made up of four main parts, the upper and lower front and back. I could have gone it as two but decided to split it into four to reduce the printing time for individual parts and also to make prototyping individual elements quicker. The top and bottom of the case are held together with nuts and bolts but the front and bach and all the other connections use bolts only that self tap into printed post fittings in the part. A number of other parts hold the internals together and there are two clipped in back panels that can be removed for access.

Assembly

The final step for the hardware was to connect it all up. The Teensy sits in the top behind the screen with four AAA batteries. In the bottom, the gaming buttons and power switch are at the front with a speaker bottom centre. To either side of the speaker an amplifier module and a small small PCB for the diodes that are wired in series with the buttons (more on why this is needed later). At the bottom of the case is a small piece that holds the last three electronic components: the USB connector (for power and programming), the voltage regulator and a small circuit built on a piece of stripboard that controls the low battery LED.

Assembly 1 Assembly 2 Assembly 3 Assembly 4 Assembly 5 Assembly 6 Assembly 7 Assembly 8 Assembly 9

The software

Some of the software was carried over from the prototype but my first priority here was to finish what I called the "platform" code. This is the base code that all the games would need, such as drawing to and updating the display, reading the bottom states and producing sounds. I currently have two graphics modes that I can use: a 16 colour frame buffer that I use for the games and a 2 colour character based display that I use for the option screen. The option screen can be called up at any time, including while a game is running and so needs to use as little memory as possible.

The next step was to write a menu system that allows the user to select a game and that just left the games themselves currently there are two: a snake game and an invaders like game. Both games, the menu system and all the platform code together use about 25% of the available flash memory, so there is room for more games and I intend to add more in the future.


Previous page: Game-o-Tron 3000
Next page: Hardware - electronics