Hand-held modern gaming for Arduino

Gameduino 2

In 2011, Gameduino brought vintage gaming to the Arduino.

This time it's personal. The Gameduino 2 turns your Arduino into a hand-held modern gaming system.  Touch control, a 3-axis accelerometer, microSD storage for game assets, headphone audio output, and all-new eye-popping graphics on its bright 4.3 inch screen (Figure 1).
 

Hand-held modern gaming for Arduino
Figure 1. Gameduino 2 turns your Arduino into a hand-held modern gaming system.

In this article we will consider more key features of Gameduino 2. So first it is worth recalling the characteristics of previous versions.

Gameduino is a game adapter for Arduino - or anything else with an SPI interface - built as a single shield that stacks up on top of the Arduino and has plugs for a VGA monitor and stereo speakers (Figure 2).
 

Hand-held modern gaming for Arduino
Figure 2. Gemeduino built as a single shield that stacks up on
top of the Arduino and has plugs for a VGA monitor

The sound and graphics are definitely old-school, but thanks to the latest Xilinx FPGA technology (Spartan-3A), the sprite capabilities are a step above those in machines from the past.

  • video output is 400×300 pixels in 512 colors
  • all color processed internally at 15-bit precision
  • compatible with any standard VGA monitor (800×600 @ 72 Hz)
  • background graphics
    • 512×512 pixel character background
    • 256 characters, each with independent 4 color palette
    • pixel-smooth X-Y wraparound scroll
  • foreground graphics
    • each sprite is 16×16 pixels with per-pixel transparency
    • each sprite can use 256, 16 or 4 colors
    • four-way rotate and flip
    • 96 sprites per scan-line, 1536 texels per line
    • pixel-perfect sprite collision detection
  • audio output is a stereo 12-bit frequency synthesizer
    • 64 independent voices 10-8000 Hz
    • per-voice sine wave or white noise
    • sample playback channel

FPGA uses an embedded coprocessor which is a small 16-bit stack-based CPU that has direct access to all of the Gameduino memory and registers. It executes code from the 256 bytes, enough for 128 16-bit instructions.

The coprocessor is completely free for your application to use: in normal operation of the Gameduino, it is idle. Some possible uses of the coprocessor:

  • fast copies and clears (“blits”) of video memory
  • line, circle and triangle drawing using a bitmap, see wireframe
  • split-screen effects by changing registers mid-frame, see split-screen scroll and Background color register

The coprocessor’s CPU executes instructions from its instruction RAM, and can perform read/writes to any location in the 32K Gameduino address space, including its own instruction RAM.

Some highlights of the coprocessor:

  • 50 MIPS
  • 16-bit internal bus
  • 8-bit memory interface, can read/write all memory locations
  • Single-cycle 16×16 bit multiply, plus barrel shifter
  • Fast, efficient stack machine

The adapter is controlled via SPI read/write operations, and looks to the CPU like a 32 Kbyte RAM. (Unlike many 8-bit machines, there are no restrictions on when you can access this RAM).

Gameduino 2 is designed, tested, documented and the prototype is built. The demo videos were all taken from the real hardware - everything you see is running on an Arduino with the prototype. What needs to happen next is a manufacturing run. Your pledge gets you a Gameduino 2 from this first run.

The Gameduino 2's FT800 from FTDI graphics engine is vastly more capable, and its OpenGL-style command set makes programming much easier. It can load JPEGs, supports alpha transparency, and has a full 32-bit color pipeline.

Hand-held modern gaming for Arduino
Figure 3. Gameduino 2's FT800 graphics engine is vastly more capable,
and its OpenGL-style command set makes programming much easier.

The Gameduino 2 hardware and software is open-source (BSD license).

Gameduino 2 is a shield that adds a bright 4.3 inch touchscreen, an embedded GPU, headphone jack, accelerometer and microSD slot to your Arduino - or anything else with an SPI interface. Everything you need to create compelling games – right in your hand (Figure 4).

  • Video output is 480×272 pixels in 24-bit color
  • OpenGL-style command set
  • Up to 2000 sprites, any size
  • 256 Kbytes of video RAM
  • Smooth sprite rotate and zoom with bilinear filtering
  • Smooth circle and line drawing in hardware - 16x antialiased
  • JPEG loading in hardware
  • Built-in rendering of gradients, text, dials and buttons
Hand-held modern gaming for Arduino Hand-held modern gaming for Arduino
Hand-held modern gaming for Arduino Hand-held modern gaming for Arduino
Figure 4. Graphics capabilities of Gameduino 2 board in games.

Sound output is via an amplified headphone jack. The system supports a selection of built-in samples and instruments, and can also play samples from video memory, at up to 48 KHz.

The FT800 can handle media in several formats to reduce the memory footprint:

  • decodes JPEGs directly
  • for lossless image loading, decompresses (zlib INFLATE) directly
  • audio samples can be 8-bit linear, ulaw or ADPCM

Built into the GPU’s ROM are:

  • high-quality fonts in 6 sizes
  • samples of 8 musical instruments, playable by MIDI note
  • samples of 10 percussion sounds

and of course you can load your own fonts and audio samples into the 256 KB RAM.

The same manufacturer who handled the original Gameduino is ready to make Gameduino 2.  We have a final design in place and they are all set to start the run as soon as we reach the target.  The manufacturer sources the components, fabricates and assembles the PCB, attaches the screen and tests the finished unit.  This process typically takes 5-6 weeks.

Gameduino 2 is much like the first Gameduino, an SPI peripheral. The sdcard is also on SPI. The accelerometer is analog, so there are three analog pins for X,Y,Z. Touch and audio functions are handled by the FT800, so take no extra pins.

For power, the shield needs 5-7 V at 200 mA on the 5 V input; it has on-board regulation.

It is a 3.3 V device, but the inputs go through a level-shifter so are also 5 V tolerant. The range of the analog outputs is 0-3.3 V.

Demonstration video

excamera.com

EMS supplier