A Library for the Gameduino shield

Dependencies:   Arduino

Dependents:   Gameduino_Asteroids_game Gameduino_Ball_demo Gameduino_Bitmap_demo Gameduino_chessboard_demo ... more

This is a library for the Gameduino, a shield for the Arduino. It uses a secondary library to recreate the arduino functionality. This is to keep this library as close to the original as possible. The original was released by James Bowman, who designed the Gameduino. His webpage (http://excamera.com/sphinx/gameduino/) has tutorials and plenty of other information on the Gameduino. I have published a lot of the demos on his page and they can be found here:

Asteroids:

Import programGameduino_Asteroids_game

Asteroids game using a Gameduino

Ball demo:

Import programGameduino_Ball_demo

Bouncing ball demo for the Gameduino

Bitmap demo:

Import programGameduino_Bitmap_demo

Bitmap demo for the Gameduino

Chessboard demo:

Import programGameduino_chessboard_demo

Chessboard demo for the Gameduino

Collision demo:

Import programGameduino_collision_demo

Collision demo for the Gameduino

Frogger game:

Import programGameduino_Frogger_game

Frogger game for the Gameduino

jkcollision demo:

Import programGameduino_jkcollision_demo

jkcollision demo for the Gameduino

Joystick test:

Import programGameduino_Joystick_test

Joystick test program for the Gameduino

Manic miner game:

Import programGameduino_Manic_Miner_game

Manic miner game for the Gameduino

Palettes demo:

Import programGameduino_Palettes_demo

Palettes demo for the Gameduino

Rotate demo:

Import programGameduino_Rotate_demo

Sprite rotation demo for the Gameduino

Screenshot demo:

Import programGameduino_screenshot_test

Screen shot demo and test program for the Gameduino

This needs to run a python script, more information and the script can be found on the gameduino site.

Scroll demo:

Import programGameduino_Scroll_demo

Scroll demo for the Gameduino

snow demo:

Import programGameduino_Snow_demo

White noise demo for the Gameduino

spinning dna demo:

Import programGameduino_Spinning_DNA_demo

Spinning dna graphics demo for the Gameduino

split screen demo:

Import programGameduino_Split_Screen_demo

Split screen graphics demo for the Gameduino

256 sprites demo:

Import programGameduino_Sprites256_demo

Sprite control demo for the Gameduino

I've also ported Invaders, written for the arduino by Colin (couldn't find his surname) and can be found at http://www.artlum.com/gameduino/gameduino.html:

Import programGameduino_Invaders_game

Invaders game for the Gameduino

and made a template for gameduino based projects. I have used an mbeduino board and have included a a file shield.h which contains the pinouts for this board. This can easily be modified to your needs. As a default I have chosen to use pull ups on the joystick inputs and switch down to 0V. This can be quickly altered and this is at the top of most main.c files, with the exception of invaders. This has more configuration options in the joystick files.

Revision:
1:f9c070a33214
Parent:
0:c9523256df08
Child:
2:c0acce0a98e3
--- a/GD.h	Sun Oct 21 17:38:24 2012 +0000
+++ b/GD.h	Sun Oct 21 17:51:49 2012 +0000
@@ -1,5 +1,5 @@
-/**
- * @section LICENSE
+/*
+ *  LICENSE
  *  Copyright (c) 2012 James Bowman, Chris Dick
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -20,7 +20,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  *
- * @section DESCRIPTION
+ *  DESCRIPTION
  * Copyright (c) 2011 by James Bowman <jamesb@excamera.com>
  * Gameduino library for mbed. Ported from Arduino by Chris Dick
  *
@@ -39,7 +39,7 @@
   byte image, palette;
 };
 
-/** Gameduino library usage
+/** Gameduino library ported form the arduino
  *
  * Example:
  * @code
@@ -64,86 +64,86 @@
   DigitalOut gameduino_cs;
   Serial pc;
 public:
-/** Create a Gameduino Object with the specified spi pins and uart pins
+/** Create a Gameduino Object with the specified spi pins and uart pins.
  *
- * @param mosi name of pin for spi mosi connection
- * @param miso name of pin for spi moso connection
- * @param sclk name of pin for spi sclk connection
- * @param cs name of pin for spi cs connection
- * @param utx name of pin for uart tx
- * @param urx name of pin for uart rx
+ * @param mosi name of pin for spi mosi connection.
+ * @param miso name of pin for spi moso connection.
+ * @param sclk name of pin for spi sclk connection.
+ * @param cs name of pin for spi cs connection.
+ * @param utx name of pin for uart tx.
+ * @param urx name of pin for uart rx.
  */
   GDClass(PinName mosi, PinName miso, PinName sclk, PinName cs, PinName utx, PinName urx);
 /** Initialize the connection to the adapter, and reset the adapter.
  *
- * @param void
+ * @param void.
  */
   void begin();
-/** end the spi transaction??
+/** end the spi transaction.
  *
- * @param void
+ * @param void.
  */
   void end();
-/** start an spi transaction to addr
+/** start an spi transaction to addr.
  *
- * @param addr: address of memory location 
+ * @param addr: address of memory location.
  */
   void __start(unsigned int addr);
-/** start an spi write transaction to addr
+/** start an spi write transaction to addr.
  *
- * @param addr: address of memory location 
+ * @param addr: address of memory location. 
  */
   void __wstart(unsigned int addr);
-/** end the spi transaction
+/** end the spi transaction.
  *
- * @param void
+ * @param void.
  */
   void __end(void);
-/** Read a byte from memory location addr
+/** Read a byte from memory location addr.
  *
- * @param addr: address of memory location
+ * @param addr: address of memory location.
  */
   byte rd(unsigned int addr);
 /** Write byte v to memory location addr.
  *
- * @param addr: address of memory location
- * @param v: data to write
+ * @param addr: address of memory location.
+ * @param v: data to write.
  */
   void wr(unsigned int addr, byte v);
-/** Read a 16-bit word from memory locations addr and addr+1
+/** Read a 16-bit word from memory locations addr and addr+1.
  *
- * @param addr: address of first memory location
+ * @param addr: address of first memory location.
  */
   unsigned int rd16(unsigned int addr);
-/** Write 16-bit word v to memory locations addr and addr+1
+/** Write 16-bit word v to memory locations addr and addr+1.
  *
- * @param addr: address of first memory location
- * @param v: data to write
+ * @param addr: address of first memory location.
+ * @param v: data to write.
  */
   void wr16(unsigned int addr, unsigned int v);
-/** Fill count memory locations starting at addr with value v
+/** Fill count memory locations starting at addr with value v.
  *
- * @param addr: address of first memory location
- * @param v: data to write
- * @param count: number of memory location to fill
+ * @param addr: address of first memory location.
+ * @param v: data to write.
+ * @param count: number of memory location to fill.
  */
   void fill(int addr, byte v, unsigned int count);
 /** Copy count bytes from AVR flash memory location src to addr.
  *
- * @param addr: address of first destination memory location
- * @param *src: address of first flash memory
- * @param count: number of memory location to copy
+ * @param addr: address of first destination memory location.
+ * @param *src: address of first flash memory.
+ * @param count: number of memory location to copy.
  */
   void copy(unsigned int addr, PROGMEM prog_uchar *src, int count);
 /** Set character palette entry pal to color rgb.
  *
- * @param pal: address of palatte
- * @param rgb: colour value
+ * @param pal: address of palatte.
+ * @param rgb: colour value.
  */
   void setpal(int pal, unsigned int rgb);
 /** Set attributes of sprite spr, can also use RGB(r,g,b) Macro.
  *
- * @param spr: sprite number, 0-255
+ * @param spr: sprite number, 0-255.
  * @param x: x coordinate, 0-511. 0 is left edge of screen.
  * @param y: y coordinate, 0-511. 0 is top edge of screen.
  * @param image: image number, 0-63.
@@ -163,7 +163,7 @@
  * @param jk: J/K collision select, 0-1.
  */
   void sprite2x2(int spr, int x, int y, byte image, byte palette, byte rot = 0, byte jk = 0);
-/** Waits for the start of the vertical blanking period. By waiting for vertical blanking: any animation is guaranteed to be smooth, the sprite collision RAM is valid
+/** Waits for the start of the vertical blanking period. By waiting for vertical blanking: any animation is guaranteed to be smooth, the sprite collision RAM is valid.
  *
  * @param void
  */