Teletext Control Characters =========================== Teletext characters are 7-bit bytes, but it is conventional to refer to the control codes as &80-&9F and the display characters as &20-&7F. Teletext control codes ---------------------- &80 [Black text] &90 [Black graphics] &81 Red text &91 Red graphics &82 Green text &92 Green graphics &83 Yellow text &93 Yellow graphics &84 Blue text &94 Blue graphics &85 Magenta text &95 Maganta graphics &86 Cyan text &96 Cyan graphics &87 *White text &97 White graphics &88 Flash On &98 Conceal display &89 *Flash Off &99 *Continuous graphics &8A End box &9A Separated graphics &8B Start box &9B [Toggle between G0 character sets] &8C *Normal height 1x1 &9C *Black background &8D Double height 1x2 &9D New background &8E [Double width 2x1] &9E Hold graphics &8F [Double size 2x2] &9F *Release graphics *State at start of each line []Extensions Graphics characters ------------------- When preceded by a graphics colour character, characters are displayed according to the character code as: %xx0xxxxx - text (upper case letters) %xx1xxxxx - graphics, with the mosaic formed according to the bitmap: +-------+-------+ | bit 0 | bit 1 | | | | +-------+-------+ | bit 2 | bit 3 | | | | +-------+-------+ | bit 4 | bit 6 | | | | +-------+-------+ Control characters are displayed as spaces, unless preceeded by the Hold Graphics character. Then, all control characters - including the Hold Graphics and Release Graphics characters - are displayed as the most recent graphics character displayed on the line. The 'Hold' includes the joined or separated state. Hold Graphics has no effect on text characters. Character translation --------------------- The bytes in display memory for hash, pound, and underline for the SA5050 are different to their character codes. It is conventional to translate these characters when writing them to put them in their natural order: character byte stored written in memory hash # &23 &5F line _ &5F &60 pound £ &60 &23 Double height characters ------------------------ Any characters on the second line of a row of double-height characters that is not set as double height are invisble. In other words, you cannot have single-height characters on the bottom row of a pair of double-height character rows. The top row of a pair of double-height characters can mix single and the top half of double-height characters. Display control --------------- Where supported, VDU 23,18 selects soft teletext features. VDU 23,18,0,display,mask ,0,0,0,0,0 - set mix/box display mode VDU 23,18,1,update ,mask ,0,0,0,0,0 VDU 23,18,2,reveal ,mask ,0,0,0,0,0 - if reveal.b0=1, reveal concealed display VDU 23,18,3,extend ,mask ,0,0,0,0,0 - extend.b0=black text/graphics enabled, &80/&90 extend.b1=wide characters enabled, &8E/&8F VDU 23,18,4,fontLo,fontHi,0,0,0,0,0 - select font from SAA505x series VDU 23,18,16,flags ,mask ,0,0,0,0,0 - b0=high quality text VDU 23,18,255,flag ,mask ,0,0,0,0,0 - Brandy Basic Where listed, the feature is set with setting=(oldsetting AND mask) EOR newsetting. SAA5050 series -------------- The SAA5050 series have different variants with different fonts. The series number is also used for the VDU 23,18,4 font selection where implemented with a soft teletext implementation. The main series are: 5050 UK 5051 German 5052 Swedish 5053 Italian 5054 Belgian 5055 US 5056 Hebrew 5057 Cyrillic See the image files for the font differences. Aspect ratio ------------ The 40x25 6x10-pixel teletext characters should be displayed in the same area as 40x25 8x10-pixel characters. That is, a BBC MODE 7 display should be the same size as a BBC MODE 6 display. A full teletext display is: (40*6)x(25*10) = 240x250 This has to be displayed in the same area as: (40*8)x(25*10) = 320x250 This means that each of the teletext pixels must be stretched by 4/3 horizontally. This is done by hardware by using a 6MHz pixel clock for teletext characters and an 8MHz pixel clock for soft characters. When converting a teletext screen dump, each teletext pixel must be converted to a rectangular 1 x 4/3 pixel. As a third of a pixel is not possible, this can be achieved by converting each teletext pixel into a block of 4x3 pixels: Teletext Square pixel pixels +-------+ +-+-+-+-+ | | --> +-+-+-+-+ | | --> +-+-+-+-+ +-------+ +-+-+-+-+ This gives an output file of (40*6*4) x (25*10*3) = 960x750 pixels. This also allows teletext sub-pixel character rounding to be converted. Teletext non-graphics characters are rounded on a 12x20 pixel grid by inserting half pixels on diagonals. This can be done by Teletext Square Teletext Square pixel pixels pixel pixels +-----+-----+ +---+---+---+---+ +-----+-----+ +---+---+---+---+ |#####| | |###|###| | | | |#####| | | |###|###| |#####| | +---+---+---+---+ | |#####| +---+---+---+---+ +-----+-----+ |###|###| | | +-----+-----+ | | |###|###| | | | +---+---+---+---+ | | | +---+---+---+---+ | | | | | | | | | | | | | | | | +-----+-----+ +---+---+---+---+ +-----+-----+ +---+---+---+---+ +-----+-----+ +---+---+---+---+ +-----+-----+ +---+---+---+---+ | | | | | | | | | | | | | | | | | | | +---+---+---+---+ | | | +---+---+---+---+ +-----+-----+ |###|###| | | +-----+-----+ | | |###|###| |#####| | +---+---+---+---+ | |#####| +---+---+---+---+ |#####| | |###|###| | | | |#####| | | |###|###| +-----+-----+ +---+---+---+---+ +-----+-----+ +---+---+---+---+