GONG RIDER for the PiTrex
=========================

A Vectrex game written in C for the PiTrex (a Raspberry Pi Zero in a Vectrex
cartridge), drawn and played through Malban's vectrexInterface library.
Steer a flying carpet through a tunnel, then play back the notes of four gongs.
Heavily inspired by Master of the Lamps (Activision, 1985). MIT licence, see LICENSE.

Article: https://vectrex.substack.com  (GONG RIDER: a PiTrex game, line by line)
Page:    https://rogerboesch.games/learn/gong-rider/

What is in here
---------------
  src/gongrider.c     the game, 862 lines
  sim/                what the desktop simulator lacks: v_printString, the
                      sound buffer, the beam numbers for the test
  simulator/          a desktop PiTrex simulator (SDL2): the library calls the
                      game uses, a phosphor beam model, keyboard as controller
  test/               the autopilot that plays the game headless, the pictures
  Makefile            the desktop build
  Makefile.pitrex     the kernel image for a real PiTrex

Run it on your computer
-----------------------
Needs a C/C++ compiler, make and SDL2 (macOS: brew install sdl2,
Debian/Ubuntu: apt install libsdl2-dev).

  make            build_sim/gongrider
  make run        arrow keys = stick, 1 2 3 4 (or A S D F) = buttons, Esc quits
  make test       the autopilot plays 5 minutes headless and prints the numbers

Build it for the PiTrex
-----------------------
Needs arm-none-eabi-gcc (tested with xpack 10.3.1) and Malban's
pitrex-baremetal SDK with its libraries built (how to get and build it:
http://vide.malban.de/pitrex).

  make img PITREX_SDK=/path/to/pitrex-baremetal                    Pi Zero
  make img PITREX_SDK=/path/to/pitrex-baremetal BUILD_FOR=zero2    Pi Zero 2

The result is gongrider.img, a kernel image for the PiTrex SD card.
