How peterhellberg/nex works
nex is a Zig host for vex fantasy-console WASM carts. A cart uses the Zig or C SDK and exports boot/update; the host loads and runs it, provides drawing, input, and audio services, then presents its framebuffer through a desktop or terminal backend. Headless execution is another host mode for deterministic frame output. The README establishes these subsystem relationships; source excerpts are limited to the C SDK header and a raylib interop header, so finer call-level wiring is not asserted.
Main entry points: Console.zig Console State · gfx.zig Drawing and Framebuffer · main.zig CLI and Loop · backend.zig Backend Layer
Components 15
Host Runtime
- CLI and Loop
src/main.zig - Cart Runtime
src/cart.zig - Headless Run
src/main.zig
Cart Interface
- Zig Cart SDK
vex.zig - C Cart SDK
vex.h
Console Services
- Console State
src/Console.zig - Drawing and Framebuffer
src/gfx.zig - Bitmap Font
src/font.zig - Input State
src/input.zig - Four-Voice Synth
src/synth.zig
Platform Output
- Backend Layer
src/backend.zig - Raylib Backend
src/backends/raylib.zig - Kitty Backend
src/backends/kitty.zig
Other components
- Cart Author
- WASM Cart
Connections 19
- Cart Author → Zig Cart SDK: uses
README.md - Cart Author → C Cart SDK: uses
README.md - Zig Cart SDK → WASM Cart: builds
README.md - C Cart SDK → WASM Cart: builds
vex.h - CLI and Loop → Cart Runtime: loads and runs
README.md - WASM Cart → Cart Runtime: calls imports
README.md - Cart Runtime → Console State: provides cart state
README.md - Console State → Drawing and Framebuffer: holds framebuffer
README.md - Console State → Input State: holds input state
README.md - Console State → Four-Voice Synth: holds synth state
README.md - CLI and Loop → Backend Layer: runs platform
README.md - Backend Layer → Raylib Backend: selects desktop
README.md - Backend Layer → Kitty Backend: selects terminal
README.md - Raylib Backend → Drawing and Framebuffer: presents framebuffer
README.md - Raylib Backend → Input State: feeds input
README.md - Kitty Backend → Drawing and Framebuffer: presents framebuffer
README.md - Kitty Backend → Input State: feeds input
README.md - CLI and Loop → Headless Run: supports
README.md - Headless Run → Drawing and Framebuffer: hashes or dumps
README.md