evan 6406739c5c feat(cli)!: package emulator as global tool
Replace the legacy script interface with an editable uv application, log-driven flows, reliable button commands, and directory-backed SD imports.
2026-07-31 16:39:33 -04:00
2024-12-03 16:09:19 +04:00
2026-07-19 21:08:45 -04:00
2026-07-30 23:08:13 -04:00
2024-08-13 19:01:42 +02:00
2024-12-17 14:26:42 +03:00
2024-07-22 09:38:16 +01:00
2025-01-17 09:58:21 +03:00
2025-02-26 07:41:35 +01:00
2023-12-21 22:49:27 +01:00
2023-12-21 22:49:27 +01:00
2024-10-07 16:41:58 +02:00
2026-07-19 21:08:45 -04:00
2026-07-19 21:08:45 -04:00
2024-10-07 16:41:57 +02:00
2023-12-21 22:49:27 +01:00
2023-12-21 22:49:27 +01:00
2025-02-24 08:46:48 +03:00

xteink QEMU fork

Espressif's QEMU fork carrying the xteink X3/X4 (ESP32-C3) machine model and a wasm32 TCG backend (ported from ktock/qemu-wasm), used by xteink-web-emulator to run CrossPoint firmware in the browser.

Branch

  • main — the working branch. Base is Espressif's esp-develop-9.2.2-20260417 (40edccac).

Remotes

Building

Native (parity check — authoritative)

nix develop
./configure --target-list=riscv32-softmmu --with-devices-riscv32=xteink --enable-gcrypt
ninja -C build qemu-system-riscv32

Install the emulator controller as an editable global tool:

uv tool install -e tools/xteink-emu-cli
xteink-emu --help

Its first boot builds .#qemu-native-xteink with Nix when dist/qemu-native is missing. Run make xteink when you want to build ahead of time.

Agent emulator

nix run .#xteink-emu -- boot firmware.bin
nix run .#xteink-emu -- boot firmware.bin --sdcard sdcard.img
nix run .#xteink-emu -- boot firmware.bin --sdcard test-library/ --fresh-sd
nix run .#xteink-emu -- wait-log 'ready' --timeout 30
nix run .#xteink-emu -- press bottom-4 bottom-4 bottom-2
nix run .#xteink-emu -- wait-frame 2
nix run .#xteink-emu -- capture screen.png
nix run .#xteink-emu -- memory
nix run .#xteink-emu -- stop

Use one state for a complete flow:

nix run .#xteink-emu -- --state /tmp/reader-test run flow.xteink
# Omit flow.xteink to read command lines from stdin.

boot replaces the emulator already running in that state. Without --sdcard, it creates or reuses $STATE/sdcard.img. An image path is used directly; a directory is merged into the state image before every boot, with host files winning conflicts and other image files preserved. --fresh-sd recreates a state-owned image before importing the directory. The source directory is never modified.

The installable application lives in tools/xteink-emu-cli/; uv tool install -e tools/xteink-emu-cli exposes the global xteink-emu command and reflects checkout edits immediately. press waits for debounced guest ADC reads, so multiple presses do not need display waits. wait-log advances a persistent cursor and fails on timeout; use wait-frame only when visible rendering is itself under test. capture records the current panel without a static delay.

web serves a browser UI for firmware, SD images, controls, screen, logs, and SD files. memory reports RAM high-water marks; QEMU zeroes RAM at reset, so firmware heap logs remain authoritative for live usage. State defaults to /tmp/xteink-emu-$UID. interactive opens a native window and maps Left/Right, 14, and P to device buttons. The emulator exposes the open Wi-Fi network qemu through QEMU user-mode NAT.

WebAssembly

Driven by the parent repo, not here:

cd ../xteink-web-emulator
make web-dev     # incremental build straight from this tree

The parent's scripts/build-qemu-wasm.sh compiles this checkout inside the emsdk Docker image defined in xteink-web-emulator/qemu/wasm/Dockerfile.

S
Description
No description provided
Readme 600 MiB
Languages
C 83.1%
C++ 6.4%
Python 3.3%
Dylan 2.8%
Shell 1.5%
Other 2.6%