Is it possible to recreate this test pattern using a games console? Let’s find out…

There’s only so close you can get to analogue television hardware, without a tonne of expensive analogue signal generation equipment and a degree in electronic engineering, neither of which I’m in possession of.

However, I can try and get as close as possible to the signal generation process as possible with what I do have: A games console from the 1970s’ and the ability to code in assembly language.

Let’s race the beam and make some colours.

A (Very) Abbreviated History of Test Patterns

As someone who grew up in the 80s’, I was used to seeing test patterns (or ā€œtest cardsā€ as we called them in the UK) on television. They were often broadcast overnight either from local transmitters or television centres. Often, they were accompanied by library music or a high pitched electronically generated tone.1

Some test signals, such as the BBC’s pulse and bar were designed for engineers to fine tune intermediate equipment, rather than specifically for viewing on a TV screen. Others such as the very famous Test Card F allowed the televisions themselves to be calibrated by tradespeople.

Whilst Test Card F was analogue at source,2 eventually digital test card generators came along such as the Philips circle pattern or the more widely seen ETP-1, which often made its appearance on ITV and Channel 4. Most of this was happening in Europe, and meanwhile over in North America they had their own test patterns such as the SMPTE color bars pattern.

Equipment to generate all these over an analogue signal is now rare and very expensive, not least because analogue television transmissions are now a thing of the distant past. But, I still wanted to have a go at generating a simple pattern of colour bars with the equipment I do have.

The Atari 2600 (Racing the Beam)

You’re probably familiar with the Atari 2600 (or ā€œAtari VCSā€ in North American parlance). It was an early games console most closely associated with the video game crash of 1983. It was also my first games console and a device for which I will always have a strong nostalgia, not least because of the incredible library of excellent games.

So why do I think the 2600 can bring me closer to the act of generating an analogue television signal?

Well, there’s a trick to programming the 2600, and it’s all about timing. In most consoles of the era, you could just place sprites on the screen and trust the hardware to handle them. And whilst the 2600 does have a couple of available sprites, if you want to do anything more interesting you have to write code which times itself with the electron beam as it races across the television screen. Hence the phrase ā€œracing the beamā€ which summed up the programming experience on the Atari 2600.

So this does bring you closer to the television hardware than you might have initially thought, especially when compared to later 8-bit systems such as the NES.

To recreate the colour bars test signal, the assembly code I wrote would need to sync up with the electron beam as it heads from left to right, and change colour on each row at exactly the right moment to get the bars to line up.

Here’s how my efforts worked out:

Yeah!

So, my attempt kind of works. I managed to get the vertical bars to show, but approximating the colours was a bit challenging. True to how an analogue television signal works, colours on the Atari 2600 are defined by luminance and chrominance. However, I wasn’t quite able to get the luminance values as bright as you might see in a genuine test signal, so the colours don’t quite pop as much.

Also, because I know next to nothing about precisely timing my code with the beam,3 the bars aren’t all quite the same width. There’s also a black border on the edges, whereas a true test pattern would take up the entire screen.

But, it’s close enough for this experiment! I coded this using a popular emulator called Stella, Vim and the dasm assembler, but would the final binary work on genuine hardware?

Trying it on a Real Television

Indeed, the experiment wouldn’t be complete without trying my code out on a genuine Atari 2600 plugged into a real CRT television. And here, the results were a bit unexpected.

Please excuse the poor image, it’s actually quite hard to take a photo of a CRT with an iPhone

So, I was happy about the colour bars taking up the full screen (I suspect Stella shows the overscan areas which wouldn’t normally be visible on a real television), but there’s some odd things happening with the two black bars on either side, as well as the thin line bisecting the green bar.

Both my Atari 2600 unit and the television are of course NTFC. It could be I unintentionally compiled my binary for PAL,4 but if that were the case the colours would be completely different as those two standards have different palettes on the 2600.

So, I’m not sure exactly what’s going on here, but what I do know is that programming for the Atari 2600 is a dark art which involves properly understanding the hardware and the timing of the television signal.

Test Signal Received

Atari 2600 programming is really all about tricks and technique, and the best coders of on platform were more engineers than they were programmers. It’s all very different to how we might write games today.

If you want to see an example of the Atari 2600 hardware pushed to its limits, you could do worse than reading this review of Star Raiders.


  1. The tone would vary in pitch depending on whether the test card was being transmitted on BBC1 or BBC2, presumably to help engineers identify which of the two channels they were tuned into. ā†©ļøŽ

  2. Test card F was originally generated photographically, but was later digitised (even though the original source was still analogue). ā†©ļøŽ

  3. Well, I’m not an expert yet! I’ll probably return to this project in the future and try an improved implementation once I’ve built up my skills. ā†©ļøŽ

  4. As if NTSC and PAL aren’t enough of a challenge, I wouldn’t even know where to start with SECAM, the French standard which seems vastly different to the other two. And yet, the Atari 2600 did support SECAM as well. ā†©ļøŽ

Made by a Human Person