All SDK docs

Overview

What the Vectrex Studio SDK is, which cartridges it runs on, and how it is organised.

The Vectrex Studio SDK is a C SDK for writing games that run natively on an ARM cartridge plugged into a Vectrex. There is no 6809 code in a game built with it: the cartridge halts the console's CPU, takes over the bus, and drives the Vectrex's VIA itself — the beam, the sound chip and the controllers — from an RP2350.

It is independent of the IDE. You write C, build with make, and copy the result to an SD card. The VPy IDE has its own targets and its own documentation in Docs; the SDK is what sits underneath the native targets, and it can be used on its own today.


Supported hardware

TargetStatusNotes
Vectrex Studio Debug Cart✅ SupportedThe RP2350 debug cartridge. Its BIOS hosts the SDK, adds a game menu, RTT output and command-list dumps for debugging.
UVMC2 (Ultimate Vectrex Multicart 2)✅ SupportedGames are built as .um2 images and launched from the UVMC2's own menu. Adds 8 MB of PSRAM and a 16-bit audio jack.
PiTrex🔜 Coming soonThe backend-neutral API layers already compile for other targets; the PiTrex backend is in progress.

The same game source builds for every target. Where a feature exists only on one cartridge — the UVMC2's audio jack, for example — its page says so.


The core idea

Drawing on a Vectrex means writing VIA registers in step with a 1.5 MHz bus clock. Doing that one write at a time would stall the CPU on every edge and leave the beam idle whenever the game is thinking. So the SDK splits the work across the RP2350's two cores:

Core 0 runs your game and RECORDS a list of VIA writes. Core 1 REPLAYS it on the bus, back to back.

Everything else follows from that. A frame at 50 Hz is 30,000 bus cycles — that is the drawing budget, and no amount of CPU makes it larger. A chained stroke costs 6 commands whatever its length, and one that needs a jump first costs two to three times as much, so fewer, longer, chained strokes is the habit that matters most. See How the engine works. See The command list and Drawing.


Three layers you can program against

LayerHeaderUse it for
1 — libvpyvpy.h (+ vpy3d.h, vpyphys.h, …)Games. Shapes, text, input, sound, maths, plus optional libraries for 3D, physics, effects, animation and gameplay.
2 — the host contractvectrex/vectrexInterface.hA backend-neutral surface (v_directDraw32, v_WaitRecal, …). Code written here also builds for a desktop harness and a WASM simulator.
3 — the cartridge SDKuvm2_*.hThe runtime itself: the draw emitter, the bus, input, audio, SD card, calibration.

Each layer is written in terms of the one below, and they can be mixed freely. Most games should live in layer 1. See libvpy and the Low-level API.


What is in the starter kit

The SDK is distributed as the UVMC2 starter kit — everything needed to build, with no dependencies outside the folder:

  • the SDK — the command list, the beam model (Rust), dual core, the PIO + DMA bus stream, sound, input, the SD card;
  • the libraries — libvpy and its 3D, physics, effects, animation and gameplay modules;
  • a minimal game to copy (examples/hello_uvmc2) and a set of demos;
  • a complete arcade port — Sega's Tac/Scan, emulated in C, with its romset and sampled sound;
  • host tools to measure a frame on a laptop, and SWD tools to inspect a running console.

Get it from Downloads or GitHub, then follow Installation.


Two conventions worth knowing

  • Comments carry provenance. When a constant in the SDK says it was measured on the console, the number was not reasoned out — changing it needs another measurement, not another argument.
  • Failures are made loud. Several counters exist only so that "it is broken" and "it never ran" cannot look the same: stats.dropped, stats.ramps_clamped, stats.recals, uvm2_sd_error, and a compile-time #error if dual core is switched off. Respect them — see Debugging.

Where to go next

If you want to…Read
build and run somethingInstallation, then Your first game
see what the SDK can doExamples
make a console draw correctlyCalibrating a console
understand why a stroke looks the way it doesHardware, Command list, Drawing
port an arcade gamePorting from MAME