The Fruit Jam

Rinc runs on the Adafruit Fruit Jam, an RP2350 board with HDMI out, USB host ports, an SD card slot and a headphone jack.

Building and flashing

Install the Pico SDK (2.x) and an ARM GCC; the Raspberry Pi Pico extension for VS Code sets up both.

cmake -S . -B build -G Ninja -DPICO_SDK_PATH=/path/to/pico-sdk   # or set PICO_SDK_PATH in the environment
cmake --build build --target flash   # picotool reboots the running board into BOOT mode, writes rinc, starts it

The first time (or if the board isn't answering on USB), hold BOOT while resetting it and copy build/rinc.uf2 to the drive that appears.

The firmware carries no apps, as on the desktop and the web: they go on the SD card (below), so the firmware stays small (about 650 KB) and quick to flash, and apps change without flashing. A firmware can still carry apps, such as a game of its own, as its bundle: RINC_BUNDLE, its apps' .rio files separated by |, RINC_HOME, the one home means (by default the only app, or one named home), and RINC_HELP, help texts (name=folder pairs: Rinc's docs as rinc, say). An app of the same name on the card takes a bundled one's place.

cmake -S . -B build -G Ninja "-DRINC_BUNDLE=$PWD/apps/breakout.rio" -DRINC_HOME=breakout

Using it

Rinc starts at home on the HDMI screen (640x480, each pixel 2x2): the apps on the SD card, sorted, and the console. Type to narrow the list, up and down (or the d-pad) to choose, Enter (or A) to start. The system key with Esc comes back home from anywhere: Windows+Esc, a controller's Xbox+Back, or Ctrl and Shift tapped together and then Esc. Esc and Ctrl+C alone belong to apps. A keyboard's volume knob or keys set the volume (both outputs, in 2.5 dB steps, and mute).

An app that isn't a game, or one that stops with an error, leaves its log and the error on the screen, until system+Esc goes home. One that runs out of memory shows how near each limit it came too.

The first start of an app compiles it, and keeps what that makes on the card, in /rinc/cache/rinc/apps, so later starts are quicker (help: about 30 ms instead of 140). Changing an app's source compiles it again, and system+R starts an app afresh, compiled anew: see compiled apps.

Keyboards plug into the USB host ports. Controllers there can be wired Xbox 360 and Xbox One/Series ones, recognized by the USB interfaces they offer (src/rp2350/gamepad.c).

What the console shows also goes out the USB serial port, a line at a time, and what's typed there goes to the console too:

python -m serial.tools.miniterm COM3 115200 --eol CR   # pip install pyserial; Ctrl+] quits

Over serial (not the keyboard), Ctrl-C opens the console in place of whatever's running, for tools such as send.py, and Ctrl-B opens the firmware's own console, which needs no apps on the card (below). A serial terminal sees each line once it's entered, not as it's typed.

Apps on the SD card

A FAT32 card holds Rinc's storage, /rinc on the card (inside Rinc, that's /: an app's /save/x is the card's /rinc/save/x): apps as /rinc/apps/name/name.rio, with their other files beside them, each app's own files in /rinc/save/name, and help texts in /rinc/help. To fill a card, the board plugged in over USB:

uv run tools/install.py              # home, the console, the editor, help, files, colors, the demos, and Rinc's and Rio's docs
uv run tools/install.py home chord   # just these apps
uv run tools/install.py --to E:      # or into a card in a reader, at E:

That replaces those files on the card and leaves the rest alone (your projects, saves and other apps). Running it again after changing Rinc updates the card. Without a checkout, a release's rinc-system-apps.zip (the system apps and the docs) and rinc-demo-apps.zip each hold a rinc folder: unzip them onto the card's top level.

With no home app on the card, the board starts in the firmware's own console, on the screen and over serial: Rio, with ls, save, delete, home, and put path, any file under /rinc as hex (how install.py sends them); get path sends one back the same way (a screen saved with Print Screen, get shots/<app>-1.png). With no console app, Ctrl-C opens it too. audio says how much of the time mixing takes, and frame how long the app's frames took since it started or since last asked: update's and draw's time (each on average and at most), how many frames ran over a 60th of a second, and the longest gap between two frames' starts (uv run tools/boardplay.py COM3 "con:run paint" wait 5 hold right 10 "fw:frame": ask once, at the end, as the console leaves the app for home). jit off and jit on start apps from then on without native code, or with it (tools/boardspeed.py times both).

For working on the board from a PC, tools/ has a few more, each uv run tools/<name>.py COM3 ... (their first lines say how): boardput.py puts files on the card and boardget.py brings them back (a second or so each, by put and get); boardpaste.py pastes an app's source in, as a person with a serial terminal would (save, then Ctrl-D); and boardplay.py plays an app as its user does (the console's run, buttons tapped and held as kitty's keyboard protocol sends them, waits) and takes screenshots, fetched and enlarged to look at on the PC.

Apps on the card are managed from the console app with ls, run, delete, install and home (see the console). From a PC, uv run tools/send.py apps/bounce.rio sends one app and starts it, in a couple of seconds, and --save keeps it on the card.

The console edits the line being typed (left and right, Home and End or Ctrl-A and Ctrl-E, Backspace and Delete; up and down go back through earlier lines), colors it (keywords, constants, comments), and indents each next line of an unfinished input. A serial terminal gets the same, as terminal escapes, which the screen's console understands too. apps/combo.rio tries everything at once: sound, a controller and the keyboard, both as buttons and as typing.

A thumb drive in a USB-A port (or the board's hub) is the stick: its files at /stick, beside Rinc's own folders (in Files, at /), to copy onto the card (an app's folder copied to /apps is installed), and to copy things onto, to take elsewhere. The first one plugged in, FAT32 or FAT16 (not exFAT, as the card), 512-byte blocks, read through TinyUSB's mass storage host as FatFs's second drive; it's mounted the first time it's looked in, and goes when it's pulled out.

Memory

Of the RP2350's 520 KB of SRAM:

the app space256 KB: Rio's memory, for an app's code and data (and its source, read from the card, while it compiles); Rio compiles the app's simple loops and procs to Thumb-2 code in what the app leaves free
the screen150 KB: the one drawn into, and the copy being shown
code kept in SRAM, as it's faster than flash36 KB: Rio's interpreter loop (13.5 KB, with its jump table), sound's mixing (5 KB), the USB host's (4 KB: the keyboard, its timing tight), HDMI's sound packets (2 KB), the USB serial port's interrupts (2 KB), malloc's arena (1 KB), the rest small
the sound's 16 voices2.4 KB
USB host buffers, the big stack6 KB each
the log, the serial port's ring4 KB each
the command list's overlay, the VM, the console's line, the restabout 15 KB
the card's and the stick's FatFsabout 2 KB: a volume each (its 512-byte sector buffer), two files open (a copy's), the stick's USB state; FatFs's tiny buffers (files share their volume's: FF_FS_TINY), which paid for the stick
freeabout 1.8 KB past the rest (measured 2026-11-21: malloc's, as it grows), and a few hundred bytes of a scratch bank

No PSRAM is needed. Every app, home and the console included, gets the whole app space (see memory); the console's own Rio session lives in the console's memory.

Sound goes out over HDMI and the 3.5 mm jack at once, mixed on the second core along with the video. Mixing 8 ADPCM voices takes about 13% of a core; 16-bit, about 6%.

Speed

Measured on the Fruit Jam (2026-11-13) with apps/drawbench.rio and apps/bench.rio, with the JIT on, as apps run, unless noted:

drawingin 10 ms
8x8 sprites from a sheet (pc.blit), solid1,466
8x8 sprites at 2x (16x16 on the screen), solid299
400 actors, each moved and drawn as an 8x8 sprite1,418
8x8 rectangles (pc.rect)2,960

A sprite's see-through pixels (color 0) cost less than solid ones; scaled sprites take a slower path (each pixel drawn as a block), and so do mirrored ones. Drawing is C, so Rio's own speed barely shows in it: the rectangles drew as many with the JIT off.

Falling sand ("dust": each grain falls, or slides down left or right; 30% of the cells filled), a step of the whole grid in Rio, and drawing it as one picture:

grida step, with the JITwithout itdrawn (scale)
64x641.0 ms4.0 ms1.0 ms (3x)
100x1002.4 ms9.7 ms1.7 ms (2x)
128x1283.9 ms15.7 ms0.6 ms (1x)
160x1606.0 ms24.4 ms1.0 ms (1x)
240x24013.4 ms54.7 ms2.2 ms (1x)

At 60 frames a second (16.7 ms each), about 200x200 fits, step and drawing; 240x240 runs at 30. Here Rio's speed is most of it: the JIT makes the step about 4 times faster. Drawn instead a pc.rect a cell, the calls cost more than the step: about 3.4 us each, so about 50x50 cells at 60.