TeleMaxt: Teletext for Classic Mac!

Snial

Well-known member
Teletext was a TV magazine system, popular across Europe, but originating in the UK. It sequenced through hundreds of pages of text stored in the vertical blanking scans of a PAL or SECAM image; things like news; TV guides; weather; cooking. It could also generate closed-captioning, i.e. subtitles.

In honour of the 50th anniversary (yep, it first went live in late 1974, see this video), for fun I wrote a Teletext renderer/editor for a classic monochrome Mac. It's only 8kB, and I've done some basic testing on a Mac 128K via Infinite Mac, which is the basic point, what would Teletext have been like on the original hardware?

The real challenge is mapping Teletext colours to 1bpp. My approach is to create a 12x12 font containing a chunky character set + block graphics so that colours can be mapped to different shades and masked to the foregrounds and backgrounds. I chose the Top40 singles screenshot again as an example! You can see the difference between white, yellow, green and cyan text; green and cyan block graphics against black or blue backgrounds.

Version 0.11 is pretty rough. Quite a lot of characters are uglier than they could be. It doesn't model serial attributes, they're all parallel, so it can create impossible Teletext pictures. It doesn't support flash. It can't save or load Teletext screens. Finally, because of all the masking; characters are drawn as slowly as a ZX81 in SLOW mode
😉
!

Nevertheless, as a first attempt at generating a Ceefax page I'm very pleased, as it's readable! It's currently running in miniVMac, but in theory, it could be massively enhanced by adding a Serial-baed Teletext decoder.

Here's my first Teletext picture I've created:
1729021142879.png
It's based on a real Ceefax (the BBC's Teletext transmissions) from, I think 1985. This is how it looked on a TV:
1729021193130.png
ThinkC project and Application for System 7 or System 2 (which works on a Mac128K) is attached.
 

Attachments

  • TeleMaxt.cpt.hqx.zip
    48.5 KB · Views: 0

Snial

Well-known member
Very cool! Now recreate Bamboozle on Channel 4! 😅
Sounds like fun, was that a Teletext puzzle/game? I've been thinking about how Teletext could be represented on home computers of the era. Obviously, the BBC micro could do it, because it had a Teletext mode. The Oric-1 is close, because its text mode is closely based on Teletext. Other early 80's computers struggle, because they either can't mix 8 foreground / background colours freely (C64/VIC-20); or don't have a high enough resolution in a mode that does. The Acorn Electron & Amstrad CPC464 could simulate it in their 8 colour/16-colour x 160 pixels per scan mode, but flashing would have to be done in software. Oddly enough, the ZX Spectrum, despite its 32 colour bytes/line could do a fairly reasonable job, because every new colour change occupies a blank space, so the colour resolution in Teletext is lower than the character resolution.

The Oric-1 can't quite do it, because it's missing a few codes & interprets colours as ink / paper instead of text/graphics (there's a special code for setting background colours). It can do this:

1729063931104.png
Fairly similar, but green & cyan are darker, and the font isn't a standard Teletext font. My motivation for that was to write a Teletext screen editor in Oric-1 BASIC. It turns out to be pretty easy:

1729064134200.png
And the reason for doing that, was because the first computer-based Teletext editor was probably written in BASIC for Esmerelda, the 16-bit BBC Ceefax LSI-2/20 computer from Computer Automation. Despite the LSI-2 name, it's not a pdp-11 clone or OEM, but a modified accumulator architecture. It's featured in the video link in the first post in the thread. Also, as you can see from the video, they had to plot graphics by typing in the equivalent ASCII codes and masking out the top bits, a lot like the way it's done in the Oric-1 program.
 

Snial

Well-known member
Correct!


That’s all pretty cool. I’m hoping I’ll have a chance to try it out soon, just spinning far too many plates at present!
My immediate work on TeleMaxt is basically complete I think, but I might do a Bamboozle screenshot - for you! I'm quite intrigued by the technological achievement of Teletext: astounding by 1970s standards.
do digitiser next!
Do you mean a composite video Teletext decoder? I've done a bit of feasibility on it. I think that with a fairly standard decoder chip (signal is slightly under 7MHz) + 8kB of RAM + some latches and a UART running at 38400 it's possible to provide a serial interface for reading Teletext that will work in real-time. That's mostly because each Teletext line scan is about 45 bytes long x 64µs x 12 or 16 scans per frame, but only the first 2 bytes need to be read to determine if you're at the beginning of a page. So, at about 4kB/s (38400), 12 x 2 bytes = 24/4kB = 6.25ms, quite a bit less than the frame time of 20ms. However, once you find the beginning of a page (1/24 line scans on average); you need to read the next 8 bytes; which means a total bandwidth of (12x2 + 8/24)/4kB = 0.634ms on average. Still OK. However, reading an entire page will take 1kB/4kB = 0.25s; which means you have to stop reception of scans when you find the right page.

For the uninitiated: Teletext pages are embedded into the vertical blanking + off-screen scans at the top of a page. Each scan line used transmits a single line of a single page, containing some header bytes + 40 characters of display text. The top line is also special, it's only 32 bytes with 8 extra bytes for the page ID & time. Teletext is hierarchically organised into 'magazines' (the first digit), 'pages' (the next two digits) and 'sub-pages' (not encoded in a page).

A single page can't be transmitted in a frame; it's transmitted over multiple frames and the design is highly resilient to decode errors (in that they can be ignored and then the hardware just waits for a replacement). Hardware only really needs to decode a line at a time (which simplifies it significantly); individual rows can appear in any order within a page (and empty rows are possible - just don't transmit them!), and different pages across multiple magazines can be multiplexed (but not rows from different pages in the same magazine).

Teletext doesn't simply transmit all the pages in order: some pages are transmitted more frequently than others (like the home page: 100). Sub-pages work differently: the Teletext transmitter sequentially chooses the next sub-page of a given page every 30s or so, and that's when that page will switch to the next sub-page. This means that if you're using Teletext and you select a page that has sub-pages, you can easily be directed to e.g. half-way through the sequence of sub-pages when you first see it; followed by each update in turn; and you have to wait until the sub-page cycle finally gets round to the beginning to see how it started.
 

CC_333

Well-known member
The discontinuation of analog TV has been kind of sad for me, as it renders impossible neat ricks like this.

Another thing is that analog signals fade gracefully, so a weak, noisy signal can still be watchable (none of the so-called "cliff effect").

c
 
Top