RETRODREAMSAMIGA & SPECTRUM
Menu

← Fun facts

Sinclair and Spectrum

1982

Stripes, beeps and R Tape loading error

The coloured stripes in the screen border were not decoration: they were the ROM's own loading routine showing, bit by bit, the data arriving from the tape.

If you had a Spectrum, you remember the ritual: LOAD "", ENTER, PLAY on the tape recorder, and minutes spent staring at the screen border. The stripes come straight from the ROM routine. First comes the pilot tone, a continuous beep that lasts about 5 seconds before the header and about 2 seconds before the data; during this phase the border alternates between red and cyan on each signal transition. When the data arrives, the colours switch to blue and yellow [1].

The loading routine is demanding. To accept the pilot tone it has to find 256 pairs of transitions, each less than about 3,000 clock cycles after the previous one [2]. The bits are told apart by length: a 0 is two pulses of 855 cycles each, a 1 is two pulses twice as long [1]. Do the sums and, at 3.5 MHz, a 0 lasts about 0.49 milliseconds and a 1 about 0.98, which gives an average of close to 1,400 bits per second, and around four minutes for 40 KB.

The stripes in the border are the ROM showing, in colour, every bit that arrives from the tape.

The "R Tape loading error" has a simple explanation. Each recorded block ends with a parity byte, calculated from all the others. As it reads, the ROM redoes that calculation, and at the end the result must come to zero; if it does not, or if the signal is lost halfway, the load fails [2]. The Spectrum manual describes error R like this: a file was found on the tape, but for some reason it could not be read or verified [3].

Loading screens took advantage of a BASIC shortcut: SCREEN$ is the same as CODE 16384,6912, the 6,912 bytes of the picture [3]. And they loaded in a strange way because of how video memory is organised. The pixels are not stored line by line: first come the top lines of the characters in rows 0 to 7, then the second lines, and so on, and only then the second and third thirds of the screen. The colours (the attributes) come at the end, stored in normal order [4]. That is why the picture appeared in stripes, in three bands, and only at the very end took on its colour all at once.

Fast loaders (turbo loaders) changed the rules. Speedlock was written in 1983 by David Aubrey-Jones and David Looker, sat in a drawer for about a year and made its debut at the end of 1984, in Ocean's Daley Thompson's Decathlon. As well as loading faster, it used processor tricks, such as the memory refresh register, to make copying harder [5].

The first versions of Speedlock could be recognised by the clicks in the pilot tone; later ones swapped them for an on-screen countdown showing the time left. The system moved to the Amstrad CPC in 1985 and was also used by U.S. Gold and by Ultimate Play the Game [5].

Sources

  1. [1]The Complete Spectrum ROM Disassembly: SA-BYTES (04C2) · Ian Logan e Frank O'Hara, edição SkoolKit de Richard Dymond
  2. [2]The Complete Spectrum ROM Disassembly: LD-BYTES (0556) · Ian Logan e Frank O'Hara, edição SkoolKit de Richard Dymond
  3. [3]Sinclair ZX Spectrum BASIC Programming, capítulo 20 (armazenamento em fita) · Sinclair Research / World of Spectrum, 1982
  4. [4]Sinclair ZX Spectrum BASIC Programming, capítulo 24 (a memória) · Sinclair Research / World of Spectrum, 1982
  5. [5]Fast loader (secção Speedlock) · Wikipedia