saturnus-host
What every front end of Saturnus
needs around the emulator core (saturnus-core):
the app's WebAssembly bindings, the desktop app and the command-line
tool's control API all use it. No bindings, no I/O and no
threads: like the core it builds for wasm32-unknown-unknown.
protocol: the front ends' command/event protocol and its wall-clock pacing as one state machine,Engine: commands and the host's clock in, replies, events and "call me again at" out, so a host is a thin driver (a Web Worker's timers, a native thread's channel).Emulator: one machine run in emulated milliseconds, with change-detectedframeandkeysevents, and the user memory read from RAM (variables, stack, flags; 48SX, 48GX, 49G). Answers are typed values, serializable to the JSON the front ends use; failures are oneErrortype.host: the key queue that times presses and types letters in emulated time, so a key is held as long as the calculator needs to see it.typing: typing text into the calculator's command line (insert,run,replace) and reading the line back from RAM.layoutandskins: each model's keys in their places and its drawn calculator, as data (serializable for the app).romid: which model a ROM file belongs to, by SHA-256 or by size.
Usage
use Model;
use Emulator;
No ROM is included; see the Saturnus repository for where to get one legitimately.
Licence
MIT. Parts of the code were generated by AI systems under human
supervision; see the repository's AI_NOTICE.