Skip to main content

Module vm

Module vm 

Source
Expand description

WASM game execution: sandbox, host ABI, and lifecycle calls.

Carts are wasm32-unknown-unknown modules executed with wasmi. The only way a cart can touch the outside world is through the small, C-like import set in the "pixel8" module — no WASI, no filesystem, no network. Fuel metering keeps runaway loops from hanging the console; they surface as a friendly error screen instead.

Structs§

GameVm
A loaded, running cart.
HostState
Everything the host exposes to a running cart.
RuntimeError
A cart-side runtime error, formatted for the error screen.

Constants§

DEFAULT_FPS
A cart’s logical frames per second when it doesn’t say otherwise.
UI_FPS
The console’s own tick rate: editors, menus and cart pickers. Independent of the cart rate, which the cart chooses via pixel8_fps.