A8CAS - software for reading/writing Atari 8-bit cassettes

Raw file format - description

Liba8cas allows to open any file (a "raw file") as a cassette file. This is useful - if there is a need to convert an Atari BASIC .bas file or a DOS .com file into a tape image, one only needs to perform a conversion from a "raw file" (the source .bas/.com file) to CAS format using a8cas-convert. A reverse operation is also possible.

When reading from a file opened as a "raw file", each sequence of 128 bytes is converted to a standard SIO 132-byte record. A 0x5555 header is added, along with the byte describing the record's type. At the end of a record, an automatically-computed checksum is added.

When writing to a file opened as "raw file", all non-data bytes, including 0x5555 headers along with checksum bytes, are discarded and only the data part of each record is saved.

Not all kinds of tapes can be stored in the raw format. Only standard SIO tapes generated without custom loaders can be converted. If, when writing to a raw file, a non-standard block is encountered, the write operation with fail with error A8CAS_ERR_BADFILE.