Commit Graph

22 Commits

Author SHA1 Message Date
evan 34de72680f fix(display): use deterministic X3 LUT classification 2026-07-21 11:42:08 -04:00
evan deb4896a0b Bump third_party/qemu: ignore build artifact 2026-07-21 10:35:12 -04:00
evan 68deac2d8f Reader renders correctly in WASM: grayscale persistence model
Bumps third_party/qemu to the X3 grayscale persistence render. The
in-browser reader now shows crisp black text on white (no inversion, no
muddle). Marks the grayscale defect resolved in ISSUES.
2026-07-21 10:27:36 -04:00
evan 376d302e1d Reader opens in WASM: bump QEMU store-TB workaround; document panic
Bumps third_party/qemu to the wasm32 store-TB TCI workaround so the
browser reader no longer panics in uzlib font decompression. Adds
docs/wasm-inflate-panic.md with the full investigation (native control,
non-deterministic reject, JIT promotion) and next steps. Updates ISSUES:
the panic is worked around; the reader now inverts into muddled
grayscale after the initial BW page (new top reader defect). tests
navigate the 4th Open press into the reader.
2026-07-21 09:16:40 -04:00
evan b959776068 Build native QEMU from the third_party/qemu submodule
Native and wasm now share one source tree, so the xteink machine and SD
fixes never diverge. scripts/build-qemu.sh configures a dedicated
build-native/ dir (ucontext coroutine backend; the fork defaults to the
wasm fiber backend) that never clobbers the Emscripten build/ config.
Retires the separate _scratch/qemu-src patch-based native build.
2026-07-21 08:34:57 -04:00
evan b22934fe0d Replace vvfat SD with browser-built raw FAT32 from OPFS
Browser SD files are persisted in OPFS (web/sdstore.js) and edited in the
Files tab. At boot the browser builds a deterministic 64 MiB FAT32 image
(web/fat32.js) with nested directories and VFAT long names, then mounts
it as a raw block device, bypassing QEMU's broken populated-vvfat WASM
coroutine path. Guest writes mutate only the ephemeral image.

Exposes a hidden #frame-generation indicator that increments on every
e-ink flush, so automation can wait on real display updates instead of
fixed sleeps. Adds tests/ with a Makefile runner: 'make test' for JS +
FAT32/mtools checks, 'make browser-test' for a headless-Firefox boot of
the official CrossPoint 1.4.1 firmware that navigates to
Test/example.txt. Bumps third_party/qemu to the SPI-SD/CMD13 fixes and
updates README/ROADMAP/ISSUES for the new architecture.
2026-07-21 07:43:07 -04:00
evan bff6405afc build: replace wasm patch with third_party/qemu submodule
The 7.7k-line qemu-wasm patch was really a fork, so vendor it as a submodule
(pinned at the xteink QEMU fork) and build it directly. Removes the
clone/commit-check/patch/reset machinery, the redundant web-dev/patch targets,
and 0002-qemu-wasm.patch. Editing third_party/qemu now recompiles incrementally
via plain `make web`. Native build keeps 0001-xteink-machine.patch.
2026-07-20 18:44:51 -04:00
evan 1a782eef9e wip 2026-07-20 18:00:59 -04:00
evan 42c96a31a2 more 2026-07-20 16:34:19 -04:00
evan a87c9576fc working wasm 2026-07-20 14:25:43 -04:00
evan d4e53ae638 fix(m25p80): answer Read-ID 0x90/0xAB for all chips, not just SST
CrossPoint flash detection sends Read-ID (0x90/0xAB); the model only handled it
for SST chips, so the is25lp128 returned nothing and detection fell into an
SFDP/garbage path that crashed QEMU. Return manufacturer + device id for any
chip, as real hardware does.
2026-07-20 09:03:16 -04:00
evan 2c1b320b0a fix(web): stop QEMU serial stdin from triggering browser input prompts 2026-07-20 08:33:28 -04:00
evan 14e2f2ea9f feat(web): surface QEMU logs in-page and enable guest-error diagnostics
Add a log panel that captures QEMU stdout/stderr, route serial to stdio, and
pass -d guest_errors,unimp so device warnings (e.g. the m25p80 Read-ID gap that
stalls CrossPoint boot) are visible in the browser. Read the framebuffer via
HEAPU8 to match the validated node path.
2026-07-20 08:32:14 -04:00
evan 08f5e342b0 feat(web): add self-signed HTTPS mode for headless/LAN access
--tls generates a self-signed cert (SANs: localhost, 127.0.0.1, LAN IP) so a
headless box is reachable directly over HTTPS, which browsers treat as a secure
context (required for cross-origin isolation). make web now defaults to TLS.
2026-07-20 08:27:51 -04:00
evan 15436ee089 feat(web): bind dev server to 0.0.0.0 with a secure-context note 2026-07-20 08:25:11 -04:00
evan 90981ad154 feat(web): auto-merge CrossPoint release app image into a 16 MB flash
Accept the ~5 MB release firmware.bin directly: place it at 0x10000 in a
0xFF-erased 16 MB image alongside the bundled ESP32-C3 bootloader (0x0) and
CrossPoint partition table (0x8000). m25p80 requires a full chip-size backing,
so the 16 MB image is still built, but the user no longer pre-merges. Full
16 MB images are still accepted as-is.
2026-07-20 08:21:38 -04:00
evan bd4aa68032 docs: note boot stall next step and patch re-apply workflow 2026-07-20 08:04:27 -04:00
evan 9eceacea17 fix(wasm): boot real firmware past allocator and signature crashes
Drop EMULATE_FUNCTION_POINTER_CASTS (it broke the wasm32 TCG ffi_call_js
path with BigInt errors) and fix the underlying function-pointer signature
mismatches instead: object_class_cmp GCompareFunc, esp_sha hash-callback
wrappers, and an xts_aes NULL guard in the ESP32-C3 cache. Backport the
upstream Emscripten anonymous-RAM allocator fix. Firmware now boots and
initializes the X3 panel; a post-init boot stall remains.
2026-07-20 08:03:59 -04:00
evan 0683c1b1c1 feat(web): add initial browser emulator interface 2026-07-20 07:00:28 -04:00
evan 6538cec9f6 feat(wasm): add browser QEMU build 2026-07-19 22:31:52 -04:00
evan ca07c02e02 feat(emulator): add runtime X3 and X4 selection
Model the ESP32-C3 I2C fingerprint path for stock firmware detection. Add a blank X4 panel stub, live GPIO inputs, and pin the exact QEMU revision.
2026-07-19 20:51:44 -04:00
evan f972fbe78b initial commit 2026-07-19 19:23:51 -04:00