GetPages 1.20 - Download Teletext Pages
=======================================
Author: J.G.Harston - Date: 31-Jul-1998
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.
When run, the program asks you for the channel, the start and end page
numbers and the filename under which to save the carousel. To just
download one page press RETURN on its own when asked for the end page, and
that page will be saved as then entered filename. When downloaded in
series of pages, each page will be saved as the filename prefix followed
by the page number, ie if you enter 'P', they will be saved as, for
example, P100, P101, P102, etc.
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 of each page requested have been captured, the program stops.
How it works
The program first assembles a short piece as machine code that wipes the
top bit from all the characters on screen, except for the teletext control
characters and the #, £ and _ characters.
It then turns the header on, and asks for the channel, start and end pages
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. The program looks at the end of each line
for the index. 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 file is opened and the
captured subpage is output to it. The program then enters a loop waiting
until all the rest of 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 loops back for all the selected pages.
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 on the channel set with *CH to arrive
and then display it on the screen. Any replacement would have to do the
same.
GetPages - J.G.Harston, 70 Camm Street, Walkley, Sheffield, S6 3TR
Climb aboard the carousel - Micro User, August 1991
History:
About '86 v0.10 Initial version at Myers Grove School
Early '88 v1.00 Tidied up for Micro User
-Aug-91 v1.01 Version of documentation appearing in Micro User
20-Apr-97 v1.10 Select magazine, looks on every line for subpage
21-Jun-98 v1.20 Can do a range of pages
30-Jul-98 v1.21 Better index match, doesn't miss final page