No description
  • Makefile 75.7%
  • CMake 12.2%
  • C 9%
  • C++ 2.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
P7MJ 1afcff2588 Link README to the game repo and v2 firmware
Points to Pico-GC-Game-Repo (V1 games) and the pico-gc-v2 rewrite.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-08-21 13:57:23 -04:00
_deps Vibe coded hello world, working but bloat 2026-07-03 21:45:53 -04:00
CMakeFiles Gitea Upload 2026-08-15 17:35:29 -04:00
generated/pico_base/pico Vibe coded hello world, working but bloat 2026-07-03 21:45:53 -04:00
pico-sdk A-0-i. I have a bad feeling Gemini is going to mess stuff up 2026-07-31 09:20:19 -04:00
picotool Vibe coded hello world, working but bloat 2026-07-03 21:45:53 -04:00
pioasm Basic music and draw functions completed 2026-07-30 18:27:57 -04:00
pioasm-install/pioasm Basic music and draw functions completed 2026-07-30 18:27:57 -04:00
cmake_install.cmake Basic music and draw functions completed 2026-07-30 18:27:57 -04:00
CMakeCache.txt Basic music and draw functions completed 2026-07-30 18:27:57 -04:00
CMakeLists.txt A-0-i. I have a bad feeling Gemini is going to mess stuff up 2026-07-31 09:20:19 -04:00
dino.py A-0-i. I have a bad feeling Gemini is going to mess stuff up 2026-07-31 09:20:19 -04:00
interpreter.c Gitea Upload 2026-08-15 17:35:29 -04:00
interpreter.h A-0-i. I have a bad feeling Gemini is going to mess stuff up 2026-07-31 09:20:19 -04:00
lwipopts.h Basic music and draw functions completed 2026-07-30 18:27:57 -04:00
main.c Gitea Upload 2026-08-15 17:35:29 -04:00
Makefile A-0-i. I have a bad feeling Gemini is going to mess stuff up 2026-07-31 09:20:19 -04:00
pico_flash_region.ld Vibe coded hello world, working but bloat 2026-07-03 21:45:53 -04:00
pico_game_console.bin Gitea Upload 2026-08-15 17:35:29 -04:00
pico_game_console.dis Gitea Upload 2026-08-15 17:35:29 -04:00
pico_game_console.elf Gitea Upload 2026-08-15 17:35:29 -04:00
pico_game_console.elf.map Gitea Upload 2026-08-15 17:35:29 -04:00
pico_game_console.hex Gitea Upload 2026-08-15 17:35:29 -04:00
pico_game_console.uf2 Gitea Upload 2026-08-15 17:35:29 -04:00
pico_sdk_import.cmake Vibe coded hello world, working but bloat 2026-07-03 21:45:53 -04:00
README.md Link README to the game repo and v2 firmware 2026-08-21 13:57:23 -04:00

Pico Game Console (v1)

The original Pico Game Console firmware: an SSD1306 OLED (128×64), six buttons, a PWM buzzer, and a simple line-based text interpreter (PGCScript) driven from a PC over USB serial.

⚠️ This is v1. The interpreter was rewritten from scratch for the pico-gc-v2 firmware (PgcScript v2 — CAScript-flavoured, compiled bytecode, functions/loops/wait(), and all of the v1 bugs below fixed). v1 is kept as the original reference.

Related: Pico-GC-Game-Repo (which holds the v1 games in V1/) · pico-gc-v2 (the rewrite)

Hardware

Part Wiring
OLED SSD1306 128×64, I2C1, GP6 (SDA) / GP7 (SCL), addr 0x3C
Buttons UP / DOWN / LEFT / RIGHT / A / B on GP10GP14, GP16 (active-low, internal pull-ups)
Buzzer GP15 (PWM)
Onboard LED GP25

How it works

The firmware boots, initializes display/buttons/audio, then loops forever:

  1. polls the buttons, printing BTN_DOWN <name> / BTN_UP <name> over USB,
  2. drains the USB serial buffer into process_command(),
  3. re-runs the loaded script's loop section once per frame (~60 FPS).

Games are written in PGCScript, a tiny line-based language: each line is one instruction and the interpreter re-parses and re-executes every line every frame. A script is uploaded over serial as:

BEGIN_LOAD
<every line of the game file>
END_LOAD

Lines before the # --- LOOP --- marker run once as setup; lines after it re-run every frame. The full language reference (commands, limits, gotchas) lives in the game repo: Pico-GC-Game-Repo/PGCScript_Documentation.md.

Uploading a game

Use pico_launcher.py from the game repo: it scans for *.txt files whose first line is # PICO_CONSOLE_GAME <title>, shows a menu, and streams the chosen one to the Pico over 115200 serial.

Building

cmake -B build
cd build && make

Flash build/pico_game_console.uf2 (hold BOOTSEL, drag-and-drop).

Known limitations (all fixed in v2)

  • Conditional nesting deeper than 3 levels can overflow the stack into the audio thread and kill the buzzer until power-cycle.
  • text messages over 63 chars overflow a 64-byte buffer.
  • rand is unseeded — the same sequence replays every boot.
  • Audio notes are silently dropped when the 32-deep queue is full.
  • No button debouncing.
  • The OLED re-sends all 8 pages every frame (~20 ms) — the FPS ceiling.
  • No functions, loops, or math beyond + - / rand; restarting a game means hand-resetting every variable.