Commit graph

5 commits

Author SHA1 Message Date
1d450a5dd1 Phase 4: user dict, console commands, undo wiring
- engine_init.cc: user dict (16KB RAM-backed) added to dict stack as
  highest priority. Console commands registered (list/enable/disable/
  toggle dicts, lookup, add/remove translations, template values).
  Undo stroke (*) already handled by StenoEngine::Process().
- zmk_console_shim.cc: route Javelin console output to ZMK logging
  (line-buffered, LOG_INF per line). Enables debug visibility.

All Phase 4 features (undo, user dict, add_translation mode, console
mode, orthography engine, all processor types) are already compiled
from Javelin source — this commit wires them into the init path.

Orthography rules: empty for now (suffix folding disabled).
Full orthography requires separate data in the binary — planned for
dict compiler enhancement.
2026-06-22 21:55:53 +08:00
580d2ed5b8 Phase 3b: working dict compiler + dict download script
- compile_dict.py: full JSC4 binary compiler for compact map dicts.
  Parses Plover JSON → builds hash maps with CRC32 probing →
  produces binary with correct header, pointers, text block, timestamps.
  Tested with small dict — magic + timestamp validation passes.
- download_dicts.sh: fetches Plover main.json from openstenoproject/plover
  and Lapwing dicts from aerickt/plover-lapwing-aio.

Usage: python compile_dict.py main.json -o dicts/steno_dict.bin
2026-06-22 21:52:57 +08:00
1751171667 Phase 3: dictionary loading pipeline + binary embedding
- engine_init.cc: loads StenoDictionaryCollection from embedded binary,
  validates JSC4 magic + timestamp, constructs dict list + full processor
  pipeline (Repeat → AllUp → JeffModifiers → Engine)
- dict_embed.S: embeds compiled dict binary via .incbin directive.
  Falls back to null placeholder if no dict available
- CMakeLists.txt: dict binary discovery (dicts/steno_dict.bin or
  JAVELIN_DICT_BIN cmake var), assembly embedding
- tools/dict_compiler/compile_dict.py: stroke parser + skeleton compiler.
  Full JSC4 binary format not yet implemented — for now, use Javelin
  web tool (lim.au) to generate dict binary
- dicts/: directory for compiled dictionary binaries

Dict compiler is the remaining gap — JSC4 format requires exact XIP
pointer layout matching Javelin's C++ struct casting.
2026-06-22 21:26:23 +08:00
d4dc836b52 Implement Phase 2: real platform shims + behavior driver + steno key defines
- zmk_key_shim: Key::Press/Release → raise_zmk_keycode_state_changed()
  Maps Javelin KeyCode to ZMK HID events (keyboard + consumer pages)
- zmk_clock_shim: Clock:: → Zephyr k_uptime_get/k_cyc_to_us/k_msleep
- zmk_flash_shim: Flash::EraseBlock/WriteBlock → Zephyr flash API
- behavior_javelin_steno.c: proper DT_DRV_COMPAT, DT_INST_FOREACH_STATUS_OKAY
- engine_init.cc: processor pipeline wiring (AllUp → JeffModifiers → Engine)
- javelin_steno.dtsi: default &javsteno behavior instance
- dt-bindings/zmk/javelin_steno.h: STENO_S1..STENO_ZR key defines for keymaps
- Exclude thread.cc (pthreads), key.cc, clock.cc (replaced by shims)
- Fix CMake: combine COMPILE_FLAGS + COMPILE_DEFINITIONS in single call

Engine init deferred until dictionary loaded (Phase 3).
2026-06-22 21:02:14 +08:00
206e5231e1 Initial skeleton: ZMK module structure + Javelin submodule + stub shims
Phase 1 scaffold for porting Javelin steno engine as a ZMK module.
All platform shims are stubs — compiles but no steno processing yet.
2026-06-22 20:49:01 +08:00