Skip to main content

Module viewdata

Module viewdata 

Source
Expand description

Viewdata BBSes (Prestel, and the teletext look): a 40x24 page of text and 2x3 block “mosaic” graphics in eight colors, as a Prestel terminal showed them, following CTerm’s description of its Prestel mode.

Colors and the like are serial attributes: control codes that take a cell of their own and change the cells after them on the same row. So, as a real decoder does, the page keeps the bytes as received and each row is drawn again from left to right when anything changes; overwriting a code part way along a row recolors the rest of it.

The glyphs are the font with ID FONT, which the front end makes: teletext’s alphanumerics at their own codes, drawn from the CP437 font, the UK set’s £, ½, ¼, ¾, ‖, ─, ■ and ÷ in the control-code slots (see glyph), and the mosaics at 0x80 + the six bits of the pattern (contiguous) and 0xC0 + them (separated).

Structs§

Viewdata

Enums§

Kind
Which teletext terminal: a Prestel one, or a BBC Micro in Mode 7.

Constants§

BEEB_ROWS
BBC Mode 7 has a 25th row.
COLS
FONT
The (BadTerm-only) font ID of the teletext glyphs.
GLYPH_BARS
GLYPH_BLOCK
GLYPH_DASH
GLYPH_DIVIDE
GLYPH_HALF
GLYPH_POUND
Where the FONT font keeps the UK set’s own characters.
GLYPH_QUARTER
GLYPH_THREE_QUARTERS
PALETTE
Black, red, green, yellow, blue, magenta, cyan, white.
ROWS

Functions§

beeb_encode_char
A typed character as a BBC Micro sends it: its £ is 0x60.
encode_char
A typed character as a Prestel keyboard sends it: its # key is 0x5F, and £ is 0x23. Enter is the # key, which ends input.
glyph
The glyph (in the FONT font) for a teletext alphanumeric, 0x20-0x7F. UK Prestel’s set differs from ASCII in a few places.