Skip to main content

Crate saturnus_objects

Crate saturnus_objects 

Source
Expand description

HP 48/49 RPL objects for saturnus hosts (the app in the browser and on the desktop, the Kermit test host), without any I/O or protocol stack: builds for wasm32 like the core.

  • object: the typed object model (Object, JSON through serde) and the exact decoder of the calculator’s nibble format.
  • ram: a read-only view of a paused machine’s user memory: the HOME tree with each variable’s type, size and checksum, the current directory, the data stack and the flags, straight from RAM (no Kermit server, no mode switch), plus a change counter for cheap polling.
  • names: command names read at run time from the loaded ROM’s own library tables (NameTable, built once per ROM).
  • decompile: the calculator’s text for programs, algebraics, units and data objects in the display mode the flags select.
  • prolog: object types by prolog and the size walk.
  • cmdline: the command line being edited (text, cursor, open or not) and the editor’s entry mode, alpha and shifts, from RAM.
  • error: DecodeError (nibbles that are not an object, and where) and Error (everything else, such as memory the ROM has not set up yet).
  • transfer: the objects of Kermit transfers: binary transfer files decoded and encoded, sources from ASCII transfers, RPL source text for host commands (the protocol itself is the host’s).

Re-exports§

pub use cmdline::CommandLine;
pub use cmdline::Editor;
pub use cmdline::EditorLayout;
pub use cmdline::command_line;
pub use decompile::NumberFormat;
pub use decompile::Settings;
pub use decompile::described;
pub use decompile::display;
pub use decompile::has_text;
pub use decompile::text;
pub use error::DecodeError;
pub use error::Error;
pub use error::Reason;
pub use names::CommandInfo;
pub use names::NameStats;
pub use names::NameTable;
pub use names::UnitMarkers;
pub use object::ArrayItem;
pub use object::Base;
pub use object::Graphic;
pub use object::Integer;
pub use object::MAX_CLONED_NIBBLES;
pub use object::MAX_DECODED_NIBBLES;
pub use object::MAX_DECODED_OBJECTS;
pub use object::Memory;
pub use object::NoMemory;
pub use object::Object;
pub use object::Reader;
pub use object::Real;
pub use object::decode;
pub use object::decode_at;
pub use object::graphic;
pub use prolog::ObjectType;
pub use ram::Flags;
pub use ram::Layout;
pub use ram::UserMemory;
pub use ram::Variable;
pub use ram::change_counter;
pub use ram::current_path;
pub use ram::flags;
pub use ram::memory_tree;
pub use ram::stack_objects;

Modules§

charset
The HP 48/49 character set as Unicode text, and the ASCII trigraphs of the transfer translation modes. The one table of the workspace: satx-core’s charset wraps it.
cmdline
The command line being edited and the state of the ROM’s editor (entry mode, alpha, shifts), read from RAM without pressing a key.
decompile
The calculator’s text for objects: numbers in the display mode, data objects as the stack shows them, programs, algebraics (infix) and unit expressions rebuilt from their elements.
error
The crate’s errors: DecodeError where the nibbles of an object do not make one (with the offset where decoding failed and a Reason), and Error for everything else (no memory view on this model, memory the ROM has not set up, text that is no number, an object that cannot be encoded), wrapping a DecodeError where one is the cause.
menus
The built-in menus, read from the ROM image: which commands each menu number offers and which keys lead to submenus.
names
Command names, read at run time from the ROM’s own library tables.
object
Typed calculator objects (the JSON model of saturnus’s tools) and the exact decoder for objects in the calculator’s nibble format, whether from a binary transfer or read straight from memory.
prolog
Object types by prolog and the size walk over nibbles.
ram
A read-only view of a paused calculator’s user memory: the HOME directory tree, the current directory, the data stack and the flags, read straight from RAM through the ROM’s own system pointers. Nothing is written and the calculator does not change mode, so a host can show it at any time; the values are those the ROM left when it last went idle (in its outer loop, the stack showing), which is where a paused machine normally sits.
transfer
What rides on the calculators’ Kermit transfers (wiki: protocols/hp-object-format), for hosts that talk to the ROM’s server: the binary transfer file (HPHP48-x / HPHP49-x header and packed nibbles) decoded to an Object and encoded from one, the text of programs, algebraics, units and commands filled in from the ASCII transfer of the same object, and RPL source text for objects sent as a host command. No I/O and no protocol: the Kermit exchange is the host’s.