Skip to content

Latest commit

 

History

History
94 lines (66 loc) · 3.23 KB

File metadata and controls

94 lines (66 loc) · 3.23 KB

Architecture

Three screen planes

Screen Machine keeps three full Spectrum SCREEN images:

$4000-$5AFF   visible display
$8000-$9AFF   single-level UNDO / initial demonstration
$E000-$FAFF   authoritative working image

The visible display is frequently a compositor target rather than the primary image. Palettes, cursor graphics, magnifier views and modal previews are drawn there while the working image remains contiguous at $E000.

Semantic selector plane

Every 8×8 display cell has a parallel semantic byte:

attribute address   $5800 + row*32 + column
selector address    $A800 + row*32 + column

Panel and palette builders write both planes together. The graphical cursor can therefore dispatch commands by reading the selector beneath its hotspot instead of recognising pixels.

Transaction model

Selecting a graphics tool snapshots all 6,912 working SCREEN bytes into the UNDO plane. Actions performed while that tool remains active accumulate against the same snapshot. UNDO restores the entire snapshot.

Several modal tools render XOR previews on the visible display. Commit routines then update the working plane and rebuild the display. This explains why preview phase, cursor restoration and stack-unwind contracts are shared across modules.

Cursor model

The cursor uses:

  • 8.8 fixed-point X and Y coordinates;
  • independent acceleration, maximum velocity and repeat-pause settings;
  • a masked 8×8 sprite;
  • a fixed sixteen-record save area for background restoration.

Vertical clipping deliberately reads and writes ROM addresses for off-screen rows. Horizontal clipping inserts zero records to keep the restore stack shape constant.

Compact panels and palettes

Panel streams combine text, borders, row movement and selectors. Palette streams use right-edge glyphs as both visible frame pieces and row/end markers. This keeps geometry implicit in the artwork stream.

The common UI runtime can:

  • open framed panels;
  • render compact character streams;
  • update semantic selectors;
  • edit fixed-width fields in place;
  • bridge modal keyboard input through Spectrum ROM PAUSE 0 behaviour.

BASIC bridge

Machine code does not execute tape or disk statements directly. It publishes a filename, address, length and operation selector into fixed BASIC variables, restores the saved BASIC stack and returns into the resident Sm30_io program. BASIC performs LOAD, SAVE or CAT, then re-enters the machine-code executive.

Printer installation

The generic base contains three installable regions. The historical installer chooses language, storage interface and printer, patches the runtime template, and installs controller code, hardware support and COPY/DCOPY vectors.

The reconstructed installer emulator reproduces the requested Czech / INTERNAL / BT-100 / DIDAKTIK profile and emits directly runnable TAP and TZX media.

Self-modifying state

Screen Machine stores several state values in executable operands:

  • selected raster operation;
  • magnifier source stepping;
  • grid and colour policy bytes;
  • stack checkpoints for modal or printer aborts;
  • hardware output vectors.

The source names these operands as state fields. Replacing them with detached variables would change timing, size and sometimes stack behaviour.