Climb aboard the carousel (GetPages) Jonathan Harston presents a program to grab complete teletext page sequences automatically. Even though BBC TV no longer transmits telesoftware programs, a teletext adapter isn't completely useless. Lots of pages are transmitted by the BBC and ITV services, many of them being carousels made up of sub-pages. Usually, the sub-page number and the total number of pages is displayed in the top right-hand corner. This program lets you download these carousels, so you can use it in a teletext editor and perhaps including it in your own carousels. Don't forget, though, that most transmitted teletext is copyright. Type in the listing and ensure you've made no errors by using the checksums. When run, the program asks you for the channel, the page number and the filename under which to save the carousel. Once you have entered these details, the program waits for each subpage of the carousel to be transmitted and saves it to disk. As the program is waiting, it shows its progress so far with white blocks indicating the sub-pages not yet captured and green blocks for those saved. The sub-pages don't have to be transmitted in the correct order - the program slots them into the file in the correct place. Once all the sub-pages have been captured, the program stops. How it works The program first turns the header on, then asks for the channel, page and name to save the pages under. After setting the page and channel, the program waits for a page to arrive. This is then examined for an index and the total number of sub-pages. Two places are looked at - the top right-hand corner and the bottom right-hand corner. If it can't find an index, the program stops. The program then attempts to save a dummy file long enough for all the pages to check that there's enough disk space. The short piece as machine code that is assembled wipes the top bit from all the characters on screen, except for the teletext control characters and the #, ` and _ characters. The file is opened and the captured subpage is output to it. The program then enters a loop waiting until all the subpages have been captured. Within this loop, while waiting the coloured blocks are show to track progress. Once a sub-page has been captured the program checks the sub-page number and checks if it has already been saved. If not, it saves it. pf%() holds flags indicating which sub-pages have been saved. If at least one of the entries of pf%() is zero, then there are still more sub-pages to capture, and the loop is repeated. Otherwise, the output file is closed and the program ends. PROCsave() sends the captured sub-page into the file. First, the characters on the screen are converted by calling the machine code assembled earlier. Osgbpb is then used to send 920 bytes from the screen into the file, and then 104 padding bytes after. Using Osgbpb is much faster and efficient than using multiple BPUTs. Each sub-page captured is stored as 1024 bytes in the file. The first 920 contain the 23 lines of text, and the final 104 bytes are padding. This is the format most commonly used in the teletext editing programs that I have come across, with the padding bytes being used for extra data specific to the program. The routines were originally writen for use with the Acorn teletext adapter with the ATS rom, but it can be very easily changed for other adapters. The critical commands are *TRANSFER and *DISPLAY. These wait for the next sub-page of the page set with *PAGE to arrive and then display it on the screen. Any replacement would have to do the same. Micro User, August 1991