ABZ Teletext Editor Technical Data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Teletext Page Data Format ========================= A teletext file is a multiple of &400 bytes long, with each chunk of &400 being a single teletext frame. Each frame can contain 23 lines, 24 lines or 25 lines of text in the following layout. Byte 25 lines 24 lines 23 lines 000-039 Text line 1 Text line 1 Text line 1 040-079 Text line 2 Text line 2 Text line 2 etc 880-919 Text line 23 Text line 23 Text line 23 920-959 Text line 24 Text line 24 Title 960-999 Text line 25 Title Page links 0-9 1000-1019 Page links 10-14 1020-1021 Carousel timer, centiseconds 1022 b0=NoCls, b1=NoClock, b2=NoTimer 1023 Frames counter The number of lines of text is found by counting the number of lines of printable characters, that is, bytes larger than 31. This can be found with the FNttx_rows() function listed below. The title in row 24 or row 25 is terminated by a control character (<32) and is displayed on the top screen line. A frame with 25 full lines of text is displayed filling the full screen with no clock or counter, etc. Page links 0 to 9 are followed when the digits 0 to 9 are pressed in the ViewData display program. Page link 10 is the 'up' link and is followed when '^' is pressed. Page link 11 is the 'follow-on' link and is followed when SPACE is pressed, or the carousel counter times out. If a page link is 0 then it does not exist, if it is -1 then it is a link to page 0. If byte 920 is <32, then it is a version number stored by early versions of the ABZ teletext editor. It will normally be a displayable teletext character and be >31. Ttxt BASIC library - Teletext data manipulation =============================================== File: TtxtLib - Update: 1.00 Author: J.G.Harston - Date: 18-Feb-2010 The Ttxt library provides various functions for manipulating and displaying teletext data. DEFFNttx_rows(address%) - returns number of rows ------------------------------------------------- DEFFNttx_rows(D%):A%=919:REPEAT A%=A%+1:UNTIL A%>999 OR D%?A%<32:=A%DIV40 FNttx_rows examines the teletext frame in memory at address% and returns the number of displayable rows. This will normally be 23, 24 or 25. DEFPROCttx_display(address%) - display a teletext frame -------------------------------------------------------- DEFPROCttx_display(D%):LOCAL B%,R% CLS:R%=FNttx_rows(D%):IF R%<25:PRINT FNttx_title(D%,R%) FOR A%=1TO4:B%=D%?(230*A%):D%?(230*A%)=13:PRINT$(D%+230*(A%-1)); D%?(230*A%)=B%:NEXT:IF R%<24:ENDPROC A%=D%+959-40*(R%=25):B%=?A%:?A%=13:PRINT$(D%+920);:?A%=B%:ENDPROC PROCttx_display displays the teletext frame in memory at address%. DEFFNttx_title(address%, rows%) - returns frame title ------------------------------------------------------ DEFFNttx_title(D%,R%):LOCAL B%:D%=D%+920-40*(R%=24) A%=D%-1:REPEAT A%=A%+1:UNTIL?A%<32:B%=?A%:?A%=13:A$=$D%:?A%=B%:=A$ FNttx_title returns the title of the teletext frame in memory at address%. You have to pass the number of rows in the frame, found with FNttx_rows. Internal variables and other settings ===================================== Exit options: b2 - *I AM BOOT b1 - CH."ViewData" b0 - CH."Hello" 0 - END 1 - CHAIN "Hello" 2 - V%=100:W%=expg%:CHAIN TP$+"ViewData" 3 - unused. 4 - *I AM BOOT, END 5 - *I AM BOOT, *EXEC, CHAIN "Hello" 6 - *I AM BOOT, *EXEC, CHAIN TP$+"ViewData" 7 - *I AM BOOT, *EXEC, unused. Editor flags: Z%=&ABCDEFGH \/\ /\/ | \/ &GH - Page number | | | &CDEF00 - ST% - start of data buffer | &AB - maxpg% - maximum no. of pages (0-127)