As programmers, we often take pride in how extensive our knowledge is of low level systems and techniques for the hardware we’re working on. Yet, how often do you as a game programmer know exactly how each individual component (resistors, capacitors, ICs) contributes to the game you are running? It’s a truly enlightening experience to learn the black art in the development of game consoles themselves. I started down the path about five years ago, and I want to share all the things I learned to make it easier for newcomers to the field.
When you first begin researching the design of the game consoles themselves, you might be shocked (I was at least) to find nothing, at least for the latest consoles. Sure, you can find the hardware specs for the PlayStation 3. Even it’s DMA architecture and register locations are available for developers. But, I’m talking about the real nitty-gritty, the electrical architecture–the actual conductive interconnections between all the components and the integrated circuits that support them all. Modern consoles are huge and use many custom ICs to support their processing. If I wanted to learn the hardware design for the PS3 or Xbox360, I’d at least have to know about designing PC motherboards, and that is a black art very few know.
Rather than attempt the impossible in trying to decipher modern game hardware, why not jump back a few decades? The schematics for the Nintendo SNES are available with just a quick google images search!
Super NES Programming). Even then, my goal was not to build a clone or learn to program the SNES, so let’s get on to the good stuff!
Modern hobbyist electronics have grown to awesome complexity in the last decade, a lot of it fueled by a certain type of device: The Microcontroller. A microcontroller in a nutshell is a CPU, RAM, ROM, and various peripherals all shoved together into one chip package. Basically, it’s an entire (albeit not very powerful) computer in a single IC. Often you only have to provide power to start up a microcontroller. There are many manufacturers and names in the business:
Each one sells microcontrollers with different architectures and different applications. Microchip and Atmel are favorites amongst the hobby community. They sell excellent, simple 8-bit devices and have a large community following with free dev tools and support. Microchip sells the PIC microcontroller line, an 8-bit or 16-bit architecture with ROM from 128 bytes to over 128KB, RAM from a few bytes to 16KB, and up to 40 MIPS (millions of instructions per second) of RISC CPU power. Atmels line up looks similar, except their devices come in different categories: tinyAVR and megaAVR. Oh, and a word of advice for getting started: do not get sucked into the debate over which is better, it’s just like the Mac/PC debate–endless and dumb. Now, you may be wondering why I shot off tangentially into the world of microcontrollers. Well, these handy devices are the easiest way to get started in game console design. With a single chip, we have a programmable CPU (most microcontrollers have a dongle from your computer for programming), some memory, and a bunch of IO. With just one microcontroller, we can develop a simple game console and put some graphics on the screen. But, even these simple devices take a long time to learn, and a longer time to master. Lucky for the hobbyist community, there exists the Arduino. The Arduino is a beginner microcontroller development platform based on the Atmel AVR series. The board comes with power, IO, das blinkenlights, and the microcontroller for $30. It also includes a development environment complete with its own language. Check out the site for details: Arduino.
Developing the graphics subsystem for a game console is often the hardest task. I was unfortunate enough to undertake my venture before the days of the Arduino’s popularity (ok, fine, I just didn’t think to use it). My first console generated the video signal for the TV all itself… in software. Using a Microchip PIC, I was able to generate a black and white NTSC video signal for my TV–my poor abused TV. I used a couple or Static RAM chips to hold the contents of the screen and then a bunch of resistors to convert the digital information into voltage levels for the Composite Video input (if you’re really daring, google NTSC waveform–there is tons of information on it, but none of the specs seem to match :O). For a few examples of doing it the hard way, check out:
Lucky for us, the Arduino has its own set of tools for game console building now: Gameduino.
With the Gameduino, the blood, sweat, and sleepless nights have been removed from the video generation process. Sadly, I think it’s still in the kickstarter/first production run phase, so I am not sure about its availability. If you are unlucky, there are alternatives: Game Shield. There are plenty of websites devoted to building cool things with Arduinos, google em’. Now please, buy an Arduino, learn how it works, and make some damn cool games. But, what I really want to encourage is not developing games for these pre-made kits and tools, but the creation of completely custom designs! It’s your hardware! Once you learn to basics from Arduinos and kits, start from scratch–it’s fun and completely creative. For my current side-project, I am using an array of 8-bit microcontrollers slaved to an ARM CPU to simulate a sort-of pixel shader platform. Do fun stuff, that’s the whole point. I ended up with this:
32-Bit Arm Game Console. I learned a ton about ARM software optimization from my project–which is real handy because I do most of my game development on mobile ARM platforms.
I challenge you, learn what really makes your game tick. Get out those transistors!