Standard To record physical data, the
zero-crossing from positive to negative voltage of the analog signal is measured. The resulting time between these positive to negative crossings is then compared to a threshold to determine whether the time since the last crossing is short, medium, or long. Note the lower amplitude for the shorter periods. Inside the tape device the
read head signal is fed into an
operational amplifier (1) whose output signal is
DC-filtered. Op-amp (2) amplifies and feeds an RC filter. Op-amp (3) amplifies the signal again followed by another DC filter. Op-amp (4) amplifies the signal into
clipping the
sine-formed signal. The positive and negative rails for all op-amps are wired to +5V DC and
GND. The clipped signal therefore fits into the
TTL electrical level window of the
Schmitt trigger step that in turn feeds the digital cassette port. A circuit in the tape unit transforms the analog signal into a logical 1 or 0, which is then transmitted to the computer via the
tape connector. Inside the computer, the first
Complex Interface Adapter (6526) in the C64 senses when the signal goes from one to zero. This event is called trigger and causes an
interrupt request. This event can be handled by a handler code, or simply discovered by testing bit 4 of location $DC0D. The points that trigger this event are indicated by the black circles in the figure. A combination of pulse lengths are used to encode four signals: • 0, as short followed by medium • 1, as medium followed by short • byte marker, as long followed by medium • end-of-data, as long followed by short Because of clock differences between the
PAL and NTSC versions, the length of the pulses are also different: for NTSC; for PAL. Each byte in the standard recording is structured as byte marker + LSB...MSB + parity bit. As a result, each byte occupies 4480 μs (NTSC), for a data rate of 223.2 bytes/s inside each data block. The datablock contains additional structures such as synchronization tones (blocks of short pulses). Decoded bits are read into a
shift register to turn them into 8-bit-wide bytes.
Turbo Tape Turbo Tape uses a different encoding of bits: the 0 is recorded as a single short pulse and the 1 is recorded as a single medium pulse, approximately doubling the bit-density. There is also no special byte header. A single 8-bit checksum replaces the per-byte parity. To allow regular computers to read a turbo-tape, such tapes are prefaced with a decoder program written in the standard encoding. Decoders are as small as 10 bytes. The decoder monitors the $DCOD location to make its own assessment of pulse length using the timers on the interface adapters. Once the turbo-bits can be decoded, they are fed into a shift register (the endianness depends on the loader used to write the tape) and are continuously compared to a special 8-bit sequence. This bit sequence can also be seen as a byte. A bit-sequence match means that the stream is byte-synchronized. The first byte to compare with is called the
lead-in byte. If matched, it's compared to the
sync byte as well. An example: Turbo Tape 64 has a
lead-in byte $02 (binary 00000010),
sync byte $09 (binary 00001001) and a following sync sequence of $08, $07, $06, $05, $04, $03, $02, $01. == Models ==