Crate wasm4fun_core

Source
Expand description

Primitives and constants from WASM-4 fantasy console

WASM-4 ships a w4 application that can generate a preconfigured Rust crate to build a game. That crate contains a wasm4 module that exports all primitives and constants exposed by the console.

This crate replicates that module, documenting each public symbol and adding few Rust attributes where needed, so that w4 is no longer necessary to build a game.

Note that w4 application is still required to play the game or to generate a self-contained cartridge from the final .wasm artefact.

Constants§

Statics§

Functions§

  • Copy pixels to the framebuffer
  • Copy a subregion within a larger sprite atlas to the framebuffer
  • Read up to size bytes from persistent storage into the pointer dest
  • Write up to size bytes from the pointer src into persistent storage
  • Draw a horizontal line
  • Draw a line between two points
  • Draw an oval (or circle)
  • Draw a rectangle
  • Draw text using the built-in system font
  • Play a sound tone
  • Print a message to the debug console
  • Draw a vertical line