From C64-Wiki
Jump to navigationJump to search
Stub This article is very short and not very detailed. Please help to improve it.

A TAP file is a tape image file representing the stream of bits as found on a datasette tape.

File format[edit | edit source]

  • Bytes $0000-000B contain "C64-TAPE-RAW"
  • Byte $000C is version - either $00 or $01
  • Byte $000D-000F: Reserved, currently $00
  • Bytes $0010-0013: File size, little endian format.
  • Bytes $0014-end: File data

Each subsequent byte represents the time until the datasette sends a pulse. To convert the byte into the number of seconds for a pulse, multiply the byte by 8, and divide by the number of clock cycles.[1]

The exception is $00:

  • In version 0, $00 is treated as 256.
  • In version 1, the three bytes following $00 represent the exact number of clock cycles to the next pulse.
  • In version 2, this is related to a half-wave format in C16 tapes.

Datasette encoding[edit | edit source]

On the datasette, the pulses can identify either a Short, Medium or Long Wave.

A byte consists of a leading Long wave, a Medium wave, eight bits (0= Short followed by medium/long, 1=Medium/Long followed by short), and an odd parity bit.

A block of data ends with a Long wave followed by a Short Wave.

As a quick default, VICE considers a short pulse is between $24 and $36, a medium pulse between $37 and $49, and a long pulse between $4a and $64.

References[edit | edit source]