Expand description
Core library of the Saturnus emulator: Saturn CPU, bus, modules and
per-model machine wiring. No I/O and no threads: this crate must build
for wasm32.
The public API is the Machine and what it takes and returns:
Model, io::Key, Port, the display (Lcd,
Framebuffer, Annunciators), Error and Halt, and a
disassembler for traces (disasm). The CPU, the bus and the I/O
chips are internal; the internals feature exposes them, without any
stability promise, for this crate’s own ROM-gated tests and its boot
example.
Hardware facts are cited as wiki: <page> referring to the calculator
wiki (see kb/docs/knowledge-sources.md).
Modules§
- disasm
- Disassembly for traces and listings: decode the instruction at an
address and render it in HP SASM syntax (see the CPU’s disassembler
for the conventions). The instruction set itself stays internal; an
Instructionis only its length and its text. - io
- Memory-mapped I/O of the HP48: the 64-nibble HDW register window, the two hardware timers, the UART and the keyboard matrix; and the 42S’s Lewis display and register block.
Structs§
- Annunciators
- The annunciators above the pixel area: six on the 48-family models
(wiki: hardware/display, bit names after Giesselink: #10B LA1-LA4, #10C
LA5-LA6), seven on the 42S (wiki: hardware/lewis “Annunciators”) and
seven on the 28S (wiki: hardware/hp28s “Annunciators”). The Lewis
models’ shift, print and run (busy) annunciators are reported as
left_shift,transmittingandbusy;updown,gexist only on the 42S,batteryandradon the 42S and 28S,suspendedon the 28S. - Framebuffer
- Everything the display shows: pixels, annunciators and contrast.
- Lcd
- A snapshot of the LCD pixels.
- Machine
- A complete calculator: CPU, hardware and the clock that ties them.
Enums§
- Error
- Something the caller handed the library was unusable.
- Halt
- Why a run stopped before its cycle budget was used up.
- Model
- A supported calculator model.
- Port
- A card port of the HP48 (wiki: hardware/card-ports). Which chip select serves it depends on the model: CE1 and CE2 on the 48SX, CE2 and NCE3 (banked) on the 48GX.
Constants§
- ADDR_
MASK - Mask for 20-bit addresses (D0, D1, PC, RSTK entries). wiki: hardware/saturn-cpu (20-bit address space).
- CARD_
MAX_ BYTES - Largest card image any port of any model takes: 4 MB, 48GX port 2
(wiki: hardware/card-ports). Per port and model see
Model::card_max_bytes. - CARD_
MIN_ BYTES - Smallest card image in bytes (1 KB).
- INTL_
17B_ BYTES - The international 17B and 17BII ROM image: 64 KB plus a 32 KB language ROM.
- LCD_
HEIGHT - LCD height in pixels of the 48-family models.
- LCD_
HEIGHT_ 28S - LCD height in pixels of the 28S: four lines of 8 rows.
- LCD_
HEIGHT_ 42S - LCD height in pixels of the 42S: two lines of 8 rows.
- LCD_
WIDTH - LCD width in pixels of every model but the 28S.
- LCD_
WIDTH_ 28S - LCD width in pixels of the 28S.
- NEW_
CARD_ BYTES - Size of a new, empty RAM card: 128 KB, the largest card every port of every model with slots takes.
- STATE_
FORMAT - The format version this library writes and reads (the u16 after the magic): a host that keeps states tells a newer one from a broken one.
Functions§
- pioneer_
address_ order imagein address order: reordered when it is in dump order, as it is otherwise.