# Playing Gamebuino META Games on Arcada

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/076/347/medium800/gaming_4200-07.jpg?1559445271)

The Gamebuino META is a cool and colorful gaming handheld that features an Arduino-compatible ATSAMD21, 160x128 color TFT screen, speaker, and 8 buttons.&nbsp; It's an amazing platform for writing small games and is a great looking handheld!

[Buy a Gamebuino META from the Gamebuino shop here](https://shop.gamebuino.com/en/home/65-1049-gamebuino-meta.html)
![](https://cdn-learn.adafruit.com/assets/assets/000/076/319/medium800/gaming_gamebuino-meta.jpg?1559429535)

Since Arcada boards, like the PyGamer and PyBadge's are also Arduino compatible, it's easy to compile any Gamebuino games for these boards. The PyGamer/PyBadge have much faster processors with more memory and the same size screen (in fact, it's the same exact screen). We will not be 'emulating' the Gamebuino games - we really will just re-compile them.

The buttons, sound, display all work the same. A huge amount of the hardware interfacing code is all from Adafruit already, so adapting the Gamebuino library from the SAMD21 to SAMD51 was not too difficult!

You can use the SD card on the PyGamer if you like but we will prefer the internal QSPI memory since it exists on all Arcada boards.

The program-from-SD card bootloader wasn't ported, we'll be sticking to the UF2 bootloader we know and love.

Info: 

# What can I use?

We use the Arcada Arduino library to interface with the hardware, and can run on:

### Adafruit PyGamer Starter Kit

[Adafruit PyGamer Starter Kit](https://www.adafruit.com/product/4277)
**Please note: you may get a royal blue _or_ purple case with your starter kit (they're both lovely colors)**

What&nbsp;fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4277)
[Related Guides to the Product](https://learn.adafruit.com/products/4277/guides)
![Adafruit PyGamer Starter Kit with PCB, enclosure, buttons, and storage bag](https://cdn-shop.adafruit.com/640x480/4277-08.jpg)

### Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino

[Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino](https://www.adafruit.com/product/4242)
What&nbsp;fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right, it's the **Adafruit PyGamer!** We wanted to make an entry-level gaming handheld for DIY gaming, and maybe a little...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4242)
[Related Guides to the Product](https://learn.adafruit.com/products/4242/guides)
![Angled shot of Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino.](https://cdn-shop.adafruit.com/640x480/4242-00.jpg)

### Adafruit PyBadge for MakeCode Arcade, CircuitPython, or Arduino

[Adafruit PyBadge for MakeCode Arcade, CircuitPython, or Arduino](https://www.adafruit.com/product/4200)
What's the size of a credit card and can run CircuitPython, MakeCode Arcade or Arduino? That's right, its the **Adafruit PyBadge!** We wanted to see how much we could cram into a ​3 3⁄8 × ​2 1⁄8 inch rounded rectangle, to make an all-in-one dev board with...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4200)
[Related Guides to the Product](https://learn.adafruit.com/products/4200/guides)
![Angled shot of a Adafruit PyBadge for MakeCode Arcade, CircuitPython, or Arduino. ](https://cdn-shop.adafruit.com/640x480/4200-01.jpg)

### Adafruit PyBadge LC - MakeCode Arcade, CircuitPython, or Arduino

[Adafruit PyBadge LC - MakeCode Arcade, CircuitPython, or Arduino](https://www.adafruit.com/product/3939)
What's the size of a credit card and can run CircuitPython, MakeCode Arcade or Arduino even when you're on a budget? That's right, it's the&nbsp; **Adafruit PyBadge LC!** &nbsp;We wanted to see how much we could cram into a ​3 3⁄8 × ​2 1⁄8 inch...

In Stock
[Buy Now](https://www.adafruit.com/product/3939)
[Related Guides to the Product](https://learn.adafruit.com/products/3939/guides)
![Angled Shot of Adafruit PyBadge - Low Cost. ](https://cdn-shop.adafruit.com/640x480/3939-05.jpg)

### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

# Playing Gamebuino META Games on Arcada

## Gamebuino Libraries

# Step 1. Install Arduino IDE, drivers & board package

Before you start, you'll need to follow the guide for your particular board to install the Arduino IDE, drivers and board support package so that you can upload code to it via Arduino

# Step 2. Install Arcada Libraries

We use quite a number of libraries to access the display, sound, buttons, etc.

[Visit the Arcada library page to install **all** the libraries listed (yes that's a dozen!)](https://learn.adafruit.com/adafruit-pybadge/arcada-libraries)

# Step 3. Install Adafruit Version Gamebuino Library

In addition to the Arcada libraries, you'll need the Adafruit-tweaked versions of the Gamebuino lirbary. We will install it manually, not through the library manager, so download the Zip and then select **Add .ZIP Library...** to install

![](https://cdn-learn.adafruit.com/assets/assets/000/076/111/medium800/adafruit_products_image.png?1558939213)

 **These replace the existing library but adds support for Arcada boards, for that reason, you should remove any existing library you have with this name!**

[Gamebuino-META Library for Arcada Boards](https://github.com/adafruit/Gamebuino-META/archive/master.zip)
# Playing Gamebuino META Games on Arcada

## Gamebuino Test

OK, let's test out that this worked. Restart the Arduino IDE and select the board you'll be uploading to, then open the **Gamebuino META for Arcada** examples. Start with **a\_hello**

![](https://cdn-learn.adafruit.com/assets/assets/000/076/320/medium800/gaming_image.png?1559430069)

Be sure to select your Arcada board. You don't need to overclock or optimize so leave those settings alone.

**You must select TinyUSB as the USB Core - that's what we use to have the internal storage appear as a disk drive. It's _not_ the default so be sure to re-select it whenever you open the Arduino IDE**

![](https://cdn-learn.adafruit.com/assets/assets/000/076/322/medium800/gaming_image.png?1559433477)

Compile and upload **a\_Hello** to your board. You will see the starting animation and **GAMEBUINO** text...

You will see the starting animation, LEDs flashing, and **GAMEBUINO** text...

![gaming_IMG_2083.jpg](https://cdn-learn.adafruit.com/assets/assets/000/076/323/medium640/gaming_IMG_2083.jpg?1559433803)

Then the 'splash screen' for the game, in this case it just shows the name and indicates for you to press the **A** button to continue

![gaming_IMG_2082.jpg](https://cdn-learn.adafruit.com/assets/assets/000/076/324/medium640/gaming_IMG_2082.jpg?1559433827)

Finally, the Hello World text and a counter will appear. That's it!

![gaming_IMG_2084.jpg](https://cdn-learn.adafruit.com/assets/assets/000/076/325/medium640/gaming_IMG_2084.jpg?1559433875)

The next one we suggest you try is **c\_Controls** because you can test the D-Pad (move the ball) and buttons (make sounds)

![](https://cdn-learn.adafruit.com/assets/assets/000/076/326/medium800/gaming_image.png?1559433943)

![](https://cdn-learn.adafruit.com/assets/assets/000/076/327/medium800/gaming_IMG_2085.jpg?1559433957)

# Disk Drive Usage

You'll note as you run these tests that a **CIRCUITPY** drive will appear on your computer. This disk drive has the contents of the filesystem (QSPI or SD Card) that you can browse and manage with your computer. Folders appear on the disk drive for each project/game you compile & upload, and will contain files or settings for that game.

![](https://cdn-learn.adafruit.com/assets/assets/000/076/321/medium800/gaming_image.png?1559433291)

# Using the Filesystem for Games

Some games will want you to store files on the filesystem. Normally this is an SD card only, but we can use the QSPI storage as the USB disk drive. To demonstrate, load up the **Audio** demo

![](https://cdn-learn.adafruit.com/assets/assets/000/076/328/medium800/gaming_image.png?1559434148)

You'll notice that you can press **B** to play the bleep effect but **A** doesn't work yet.

![gaming_IMG_2086.jpg](https://cdn-learn.adafruit.com/assets/assets/000/076/332/medium640/gaming_IMG_2086.jpg?1559434529)

In the code **A** should trigger this line:

```auto
music = gb.sound.play("test.wav", true); // true for infinite looping
```

In this case its looking on the filesystem. Press reset to restart the sketch, the next time the USB drive appears you'll see a new folder called **Audio**

![](https://cdn-learn.adafruit.com/assets/assets/000/076/329/medium800/gaming_image.png?1559434415)

Download and save this **test.wav** file into the folder

[test.wav](https://cdn-learn.adafruit.com/assets/assets/000/076/330/original/test.wav?1559434424)
![](https://cdn-learn.adafruit.com/assets/assets/000/076/331/medium800/gaming_image.png?1559434451)

Once it finishes writing, wait a moment, then try pressing **A** on the sketch to play the audio!

# Playing Gamebuino META Games on Arcada

## Some Examples

There's over 100 games available, and we don't want to play any favorites! We did try a couple games that are good demonstrations of the Gamebuino platform. Here are ready-to-go UF2s you can drag-n-drop onto the **BOOT** bootloaders of a PyGamer or PyBadge

# METAtris

[This Tetris-like has awesome graphics and sound, incredibly addicting!](https://gamebuino.com/creations/metatris)

[The source code is on github, you can download/fork it from there](https://github.com/Riksu9000/METAtris)

![](https://cdn-learn.adafruit.com/assets/assets/000/076/333/medium800/gaming_4200-07.jpg?1559435621)

[METAtris_PyBadge.UF2](https://cdn-learn.adafruit.com/assets/assets/000/076/336/original/METAtris_PyBadge.UF2?1559436107)
[METAtris_PyGamer.UF2](https://cdn-learn.adafruit.com/assets/assets/000/076/337/original/METAtris_PyGamer.UF2?1559436108)
# META-Picomon

This _Pokémon_ _alike_ is a port from a pico8 game, thus the name

[Source code is on GitHub you can download/fork it here](https://github.com/deeph-z80/META-Picomon)

This game comes with audio files, so after you run the game once, reset the Arcada board, and find the **picomon** folder on the USB drive that appears:

![](https://cdn-learn.adafruit.com/assets/assets/000/076/339/medium800/gaming_image.png?1559436599)

Then, from the downloaded source code, go into the **binaries/picomon** folder. You'll find a **musics** folder, **ICON.GMV** file and more. Drag _all but the picomon.bin_ file into the **CIRCUITPY/picomon** folder

![](https://cdn-learn.adafruit.com/assets/assets/000/076/341/medium800/gaming_image.png?1559436699)

![](https://cdn-learn.adafruit.com/assets/assets/000/076/342/medium800/gaming_IMG_2088.jpg?1559437035)

[picomon_PyGamer.UF2](https://cdn-learn.adafruit.com/assets/assets/000/076/345/original/picomon_PyGamer.UF2?1559444648)
[picomon_PyBadge.UF2](https://cdn-learn.adafruit.com/assets/assets/000/076/346/original/picomon_PyBadge.UF2?1559444933)
# Playing Gamebuino META Games on Arcada

## Warnings & Notes

# Yield

The Gamebuino library defines a function called `yield()` but this is internally used by Arduino for USB and other RTOS tasks, for Gamebuino's `yield` we've renamed it to `gb_yield()`

# SD vs. QSPI Filesystem

By default Arcada sets up to use the internal QSPI filesystem. If you want to use SD cards instead, and your board has an SD card slot, open up the **Adafruit\_Arcada.h** and find the definition block for your board, for example

`#elif defined(ADAFRUIT_PYGAMER_M4_EXPRESS)`

Then change

```auto
  #define ARCADA_USE_QSPI_FS
//#define ARCADA_USE_SD_FS
```

to

```auto
//#define ARCADA_USE_QSPI_FS
  #define ARCADA_USE_SD_FS
```

And recompile your game

# Audio Format

Audio WAV files must be in **Mono, 8-bit, 44.KHz** which is a little different than what we normally use in Adafruit projects. [Still, our audio-conversion guide may help!](https://learn.adafruit.com/microcontroller-compatible-audio-file-conversion)


## Featured Products

### Adafruit PyGamer Starter Kit

[Adafruit PyGamer Starter Kit](https://www.adafruit.com/product/4277)
**Please note: you may get a royal blue _or_ purple case with your starter kit (they're both lovely colors)**

What&nbsp;fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4277)
[Related Guides to the Product](https://learn.adafruit.com/products/4277/guides)
### Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino

[Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino](https://www.adafruit.com/product/4242)
What&nbsp;fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right, it's the **Adafruit PyGamer!** We wanted to make an entry-level gaming handheld for DIY gaming, and maybe a little...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4242)
[Related Guides to the Product](https://learn.adafruit.com/products/4242/guides)
### Adafruit PyBadge for MakeCode Arcade, CircuitPython, or Arduino

[Adafruit PyBadge for MakeCode Arcade, CircuitPython, or Arduino](https://www.adafruit.com/product/4200)
What's the size of a credit card and can run CircuitPython, MakeCode Arcade or Arduino? That's right, its the **Adafruit PyBadge!** We wanted to see how much we could cram into a ​3 3⁄8 × ​2 1⁄8 inch rounded rectangle, to make an all-in-one dev board with...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4200)
[Related Guides to the Product](https://learn.adafruit.com/products/4200/guides)
### Adafruit PyBadge LC - MakeCode Arcade, CircuitPython, or Arduino

[Adafruit PyBadge LC - MakeCode Arcade, CircuitPython, or Arduino](https://www.adafruit.com/product/3939)
What's the size of a credit card and can run CircuitPython, MakeCode Arcade or Arduino even when you're on a budget? That's right, it's the&nbsp; **Adafruit PyBadge LC!** &nbsp;We wanted to see how much we could cram into a ​3 3⁄8 × ​2 1⁄8 inch...

In Stock
[Buy Now](https://www.adafruit.com/product/3939)
[Related Guides to the Product](https://learn.adafruit.com/products/3939/guides)
### SD/MicroSD Memory Card (8 GB SDHC)

[SD/MicroSD Memory Card (8 GB SDHC)](https://www.adafruit.com/product/1294)
Add mega-storage in a jiffy using this 8 GB class 4 micro-SD card. It comes with a SD adapter so you can use it with any of our shields or adapters. Preformatted to FAT so it works out of the box with our projects. Tested and works great with our <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1294)
[Related Guides to the Product](https://learn.adafruit.com/products/1294/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)

## Related Guides

- [Adafruit PyBadge and PyBadge LC](https://learn.adafruit.com/adafruit-pybadge.md)
- [Introducing Adafruit PyGamer](https://learn.adafruit.com/adafruit-pygamer.md)
- [Custom Color Palettes for MakeCode Arcade Games](https://learn.adafruit.com/custom-color-palettes-for-makecode-arcade-games.md)
- [Two Player Game System for PyGamer and RFM69HCW Radio Wing](https://learn.adafruit.com/two-player-game-system-for-pygamer-and-rfm69hcw-radio-wing.md)
- [PyGamer Marble Labyrinth in MakeCode Arcade](https://learn.adafruit.com/pygamer-marble-labyrinth-in-makecode-arcade.md)
- [Re-MakeCode the Classics: Py Hunter](https://learn.adafruit.com/re-makecode-the-classics-spy-hunter.md)
- [Saving CircuitPython Bitmaps and Screenshots](https://learn.adafruit.com/saving-bitmap-screenshots-in-circuitpython.md)
- [Creating Your First Tilemap Game with CircuitPython](https://learn.adafruit.com/creating-your-first-tilemap-game-with-circuitpython.md)
- [Next Level MakeCode Arcade Games](https://learn.adafruit.com/next-level-makecode-arcade-games.md)
- [PyBadger Event Badge](https://learn.adafruit.com/pybadger-event-badge.md)
- [PyGamer Thermal Camera with AMG8833](https://learn.adafruit.com/pygamer-thermal-camera-amg8833.md)
- [PyPaint Drawing Program In CircuitPython](https://learn.adafruit.com/pypaint.md)
- [Creating Custom Symbol Fonts for Adafruit GFX Library](https://learn.adafruit.com/creating-custom-symbol-font-for-adafruit-gfx-library.md)
- [PyGamer 3D Printed Snapfit Case](https://learn.adafruit.com/pygamer-snapfit-case.md)
- [Game & Watch Octopus](https://learn.adafruit.com/game-watch-octopus.md)
- [JOY of Arcada — USB Game Pad for Adafruit PyGamer and PyBadge](https://learn.adafruit.com/joy-of-arcada-usb-game-pad-for-adafruit-pygamer-pybadge.md)
- [Re-MakeCode the Classics: Arkanoid](https://learn.adafruit.com/re-makecode-the-classics-arkanoid.md)
