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=CLS, b1=Clock, b2=Timer 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. Links 10 to 14 are also known as the INDEX, RED, GREEN, YELLOW, BLUE links followed by pressing f0-f4. If a page link is 0 then it does not exist, if it is a negative number it is page -1-(link), ie -1 links to 0, -2 links to 1, etc. 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. Some network teletext servers serve teletext pages with the BCD page subnumber in bytes 1022-1023. Teletext BASIC library - Teletext data manipulation =================================================== File: TtxtLib - Update: 1.00 Author: J.G.Harston - Date: 18-Feb-2010 The Teletext 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 ===================================== Editor flags: Z%=&ABCDEFGH \/\ /\/ | \/ &GH - Page buffer number | | | &CDEF00 - ST% - start of data buffer, | offset from (PAGE AND &FF000000) | &AB - maxpg% - maximum no. of pages (0-127) !Comdat Info: (pointed to by B%) 00-03 in D% 00 Flags: b0 Check files b1 01 Flags: b0 Don't ask user for date 02 (0) b1 Check NetFS date first 03 (0) b2\Number of directory b3/extension characters b4 Ignore NetFS time b5\ b6 Exit option b7/ 04-xx Pages Directory yy (CR) 2B-2E Exit page number 2F-38 Teletext User Name 39 (CR) 3A- Teletext program directory Exit options: b2 - *I AM BOOT b1 - CH."ViewData" b0 - CH."Hello" 0 - END 1 - CHAIN "Hello" 2 - V%=100:W%=exitpage%: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.