Teletext on Amiga
“Can the Amiga output Teletext?”
This has been an open question in the Amiga community for decades. Well, not anymore! The answer is: Yes! :)
If you want to study how the current implementation looks and maybe even run your own experiments, here’s a a Teletext test tool, complete with source code:
Currently, this requires ECS or AGA; I have only been testing it on my Amiga 1200 so far.
- Regular PAL interlaced display in hi-res
- VARVBEN in BEAMCON0 set
- VBSTRT, VBSTOP set to 1 and 5, respectively
- The 360 Teletext bits get stretched to 736 hi-res pixels (integer scaling, no fancy interpolation, no grey levels, no super-hires pixels)
- Horizontal shift (BPLCON1) set to $77
- Amiga 1200 composite out is directly connected to the TV (no extra hardware)
- Teletext decoder seems to be forgiving in horizontal position, but not in overall timing
- Needs more testing! Only tested on 2 TVs so far
It took weeks of fiddling to get the first Teletext page to be displayed. Different variables included:
- Exact horizontal and vertical position
- White levels (standard suggests $aaa?)
- Teletext packet interpolation (what do display)
- Lo-res, hi-res, super-hires
- Native Amiga width or stretched, stretched to what width exactly?
- Interlaced or progressive
- 1:1 Amiga pixels, integer scaled, bilinear interpolation with 4 grey levels, bicubic or other interpolation
- Connection to TV
- RGB via SCART
- Composite output from the built-in port
- Composite output from A520
- Encode the bytes in the wrong bit order or the correct one :)
What kept me going was the ability to compare a known-good signal from the Raspberry Pi running raspi-teletext and the Amiga output, using a USB video grabber (Hauppauge Live 2, which is thankfully supported under Linux, offering a dedicated /dev/vbi video device).
When I first compared the Amiga output with that of the Raspberry Pi, I measured the overlayed captures in photoshop and came to the estimation that I would need to stretch the equivalent of 360 Amiga lo-res pixels to 368 Amiga lo-res pixels. Luckily, this seemed to line up with pandy71's calculations of the different pixel clocks.
Integer scaling for the Teletext data may seem crude (there's a visible discontinuity in the clock run-in!), but the TV accepted it, so I went with it. Also, I was relieved I could get away with hi-res, since I had trouble getting the correct pixels to show up near the right border when running super hi-res. Also, it allowed for a fast-enough, easy bitmap output implementation in asm.
BEAMCON0 better description was a huge help, as were the numerous old Teletext posts and threads. Another unexpected, welcome gift was the introduction of "Ultra extreme debug" mode in WinUAE, which supports displaying the vertical blank area and came out just when I was working on an interactive parameter-fiddling Teletext test tool.