8BitG

Build your own 8BitG

The games are ordinary Python. You can run them on a laptop in a minute, or build the handheld. Pick the route that suits you.

Just play

no hardware

Use the browser version. Nothing to install.

Laptop or desktop

needs only pygame

Run the same files in a window with your keyboard.

The handheld

reference build

Raspberry Pi Zero W with a Waveshare GamePi13 board.

The reference build (what the code was developed on)

PartNotes
Raspberry Pi Zero W (with header)It needs the 40-pin header fitted so the board plugs in. A pre-soldered "WH" model avoids soldering. The Zero 2 W should work too and be quicker, but it has not been tested.
Waveshare GamePi131.3 inch IPS LCD, 240x240, ST7789 controller over SPI, 12 game buttons, speaker and audio jack. Sold as the board alone or with a case kit. A Pi is not included.
microSD cardRaspberry Pi OS Lite is enough.
Power5 V through the Pi's micro-USB port. The GamePi13 page does not list a battery, so check the board's own page if you want it portable and plan a battery pack.

The games draw on a 120x120 canvas which is doubled to fill the 240x240 screen.

Setting up the Pi

  1. Flash Raspberry Pi OS Lite, enable SSH and Wi-Fi in the imager, and boot the Pi with the GamePi13 fitted.
  2. Enable the SPI interface: sudo raspi-config, Interface Options, SPI.
  3. Install the libraries the Pi needs: pygame, numpy, spidev and gpiozero. The install script expects a Python virtual environment at ~/8bit-venv.
  4. Copy the game folder to the Pi, for example scp -r 8bit pi@raspberrypi.local:~/
  5. Try it by hand: cd ~/8bit && ~/8bit-venv/bin/python main.py --pi
  6. Start on boot: sudo bash install_service.sh (remove with --remove). Restart later with sudo systemctl restart gamepi.
Exact package names and the best way to make the virtual environment vary between Pi OS releases, so follow the current Raspberry Pi documentation if a step errors.

Button wiring (GamePi13, BCM numbers)

ButtonGPIOButtonGPIO
D-pad up5X15
D-pad down6B20
D-pad left16Y12
D-pad right13A21
L23Start26
R14Select19

Buttons connect the pin to ground when pressed (the code turns on the Pi's internal pull-ups). The LCD uses SPI0 chip-select CE0 (GPIO 8), data/command on GPIO 25 and reset on GPIO 27. These are the values at the top of hardware.py.

Other hardware the code can run on

The code keeps hardware in one file, hardware.py, with a small "input" part and a "display" part. That makes other setups possible, but only the first three below have actually been run. The rest are my reading of the code and of each maker's product page, so treat them as starting points.

SetupStatusWhat it takes
Laptop / desktop (Linux, Windows, macOS)worksPython 3 and pygame. Run python3 main.py. A 480x480 window opens. Keys: arrows or WASD to move, J K U I for A B X Y, Z and X for L and R, Enter for Start, Backspace for Select.
Web browser (this site)worksNothing. The same files run under Pyodide, with touch buttons for phones.
Pi Zero W + GamePi13worksThe reference build above.
Pi Zero 2 W + GamePi13expectedSame board and pins; Waveshare's page shows this combination. Untested here, but the code is unchanged.
Any Pi on a monitor or TVlikelyOn a Pi desktop, python3 main.py runs in a window with a USB keyboard. A USB gamepad would need mapping to those keys with a tool such as a gamepad-to-keyboard mapper, as the games read the keyboard only. The --fb option is meant for Waveshare's own system image, where the screen is copied to the LCD.
Other 240x240 ST7789 screens (Adafruit 1.3 inch breakout and similar)DIYThe display driver is plain SPI and should suit any 240x240 ST7789. Wire it to SPI0, then set LCD_DC, LCD_RST and the BUTTON_PINS table to your pins. The driver does not switch a backlight pin, so tie the backlight to 3.3 V. If the picture is rotated or the colours are swapped, change ROTATION or BGR in St7789Display.
Fully home-builtDIYA Pi, an ST7789 240x240 screen and 12 push buttons wired from GPIO pins to ground. Fewer buttons works for most games; Start, Select and the D-pad are needed to use the menu.
Pimoroni Display HAT Minipoor fitIt is 320x240 with only 4 buttons, and the games need a D-pad. You would have to change the screen size in the driver and add buttons, so a different board is easier.
Waveshare GamePi15 / GamePi20unknownOlder Waveshare handhelds (GamePi15 is listed as discontinued). They may run through their own screen-copy system, which the --fb mode was written for, but this is untried.
Pico / RP2040 / microcontrollersnoThe games need full Python and pygame, which these boards do not run.

Performance notes

Sources

Waveshare GamePi13 · Waveshare GamePi15 · Pimoroni Display HAT Mini. Specs and stock change, so check the maker's page before you buy.