Getting started

From a fresh clone to the simulator in about 15 minutes, and to a first change with a passing gate in about an hour. The deeper documents are the plan (docs/PLAN.md, docs/plan/) and the work log (docs/STATUS.md); this page links to them instead of repeating them.

1. Prerequisites

The toolchain is pinned in rust-toolchain.toml (stable 1.98.1, the thumbv7em-none-eabihf target, rustfmt, clippy, llvm-tools). rustup toolchain install in the tree installs it (recent rustup versions also do it on the first cargo command). A nightly is needed only for fuzzing, coverage and sanitizers (ORPHEUS_NIGHTLY, see 07 §3.5).

2. Clone and build

git clone https://github.com/timschmidt/orpheus
cd orpheus
cargo test --workspace          # host crates, simulator, golden images
cargo xtask build               # firmware: target/orpheus/firmware.yfw

There are two Cargo workspaces. The root one holds everything that runs on the desktop (crates/, sim/, xtask/); fw/ holds the device crates (HAL, board support, firmware, boot stage, payloads) and builds for the Cortex-M4F. Shared no_std crates under crates/ are used by both.

3. The xtask tour

Every task goes through one entry point, cargo xtask <command>; each prints a one-line verdict last and fails with a non-zero exit code. cargo xtask help lists them; the full table is 07 §2.

CommandDoes
test host / test golden / test allHost test suites
test golden --blessRewrite the golden images after an intended change
build, size --check, check-residentFirmware image, RAM/size budgets, the resident-code proof
gate --no-devEverything a change must pass, without the player
brand, siteBrand assets, the website and its screenshots
wasm [--test]The simulator in the browser (the website's Try it page), its size budget and self-test
dev …Talk to the player (below)

4. The simulator

The simulator runs the real UI and app code against desktop back ends:

cargo run -p orpheus-sim -- --script "ok down*2 shot:music"   # writes target/orpheus/shots/music.png
cargo run -p orpheus-sim --features window -- --window          # interactive, 4x

In the window: arrows are Up/Down/Prev/Next, Enter is OK, Backspace is Back, M is Menu, + and − are volume, P is Power, S takes a screenshot. Scripts use the same key names plus hold:KEY, wait:MS, expect-screen:NAME and shot:NAME.

The same apps also run in the browser (sim/web, the site's Try it page): cargo xtask site then cargo xtask wasm builds the page into target/orpheus/site/; serve that directory with any static web server. xtask wasm pins wasm-bindgen and wasm-opt and installs them into target/orpheus/tools/ if they are missing; --test runs the page's self-test in headless Chromium (Node and Chromium needed).

5. Golden images

Every screen has golden images in sim/golden/ (dark and light theme, Latin, Cyrillic and CJK text). cargo test compares each pixel; after an intended change run cargo xtask test golden --bless, look at the PNGs you changed, and commit them. target/orpheus/golden.html shows old, new and the difference side by side. The manual's screenshots are copies of goldens (cargo xtask site shots), so they follow automatically.

6. The gate

Before a change is done:

cargo xtask gate --no-dev

It runs cargo fmt --check, clippy with warnings as errors (both workspaces), xtask test all, the brand and site checks, the firmware build, size --check and check-resident, and reports each step as passed, FAILED or not run (07 §6). CI runs the host part on every push.

7. A first change

Say the About screen should show the card's file system.

  1. Find the screen: About is an info list (ListKind::Info in crates/orpheus-apps/src/screens/lists.rs). Screens draw through the toolkit in crates/orpheus-ui and get their data from service traits in crates/orpheus-apps/src/services.rs, which the simulator (sim/src/apps.rs) and the firmware (fw/firmware/src/services.rs) implement.
  2. Add the row, a service method if the data is new (implemented in both back ends), and a string in strings.rs (append; ids are never reused) with translations in sim/src/packs.rs.
  3. cargo run -p orpheus-sim -- --script "…shot:about" and look at it.
  4. cargo xtask test golden --bless, look at every changed PNG.
  5. cargo xtask gate --no-dev, then commit with the work-package id in the subject (see CONTRIBUTING.md).

More recipes: how-to.

8. Working with the player safely

The player has a lithium cell and its owner's music; the full rules are in CLAUDE.md and 07 §7. In plain words:

The device commands currently need the companion repository (yoton-rockbox) for two helper payloads and the backup: set ORPHEUS_DIR to it.