A8CAS - software for reading/writing Atari 8-bit cassettes
Features
A8CAS consists of:
- a shared library, liba8cas, that contains all routines needed to read and write cassettes (support for CAS, HEX, FSK and sound files WAV, OGG, FLAC etc. is implemented). The library can be used in emulators and drivers for SIO interfaces such as SIO2PC;
- a set of command-line tools, a8cas-tools, that contains
a8cas-convert
, a utility similar to WAV2CAS/CAS2WAV. The tools use the A8CAS library; - a patch for the Atari800 emulator, that allows to load and save tape files (CAS, HEX, WAV, OGG, ...) using liba8cas.
Here are described features already realised in the A8CAS project.
liba8cas
The liba8cas library implements creating tape files in several formats, read and write operations, and seek operations. Interaction with sound files is provided by using the libsndfile library.
Support for audio tracks in stereo tapes is also implemented.
Feature | Status | Notes |
---|---|---|
Support for CAS format | Yes | WAV2CAS' CAS format has been extended to support copy-protected tapes. The extension is backwards-compatible - old CAS files are read without problems. |
Support for HEX format | Yes | WAV2CAS' HEX format has been modified and extended to support copy-protected tapes. |
Support for FSK format | Yes | FSK is a simple text file format destined for debugging particularly bad tapes. |
Support for WAV files | Yes | |
Support for other audio formats | Yes | All formats supported by libsndfile are usable. This includes WAV, AIFF, Ogg/Vorbis and FLAC. MP3 is excluded due to licencing constraints. Creating new tapes is however possible only in WAV format. |
Support for raw files | Yes | Allows to convert an arbitrary file (f.e. a BASIC program) to/from a cassette image. |
Creating new tapes | Yes | Tape files in all of the above formats can be created and written to. |
Conversion between formats | Yes | Realised by opening two files simultaneously - one for reading, one for writing. |
Seek operations | Yes | Available in all of the above formats, including sound files. This allows to rewind or fast-forward a tape file like on a real tape-recorder. |
Mixing of read, write and seek operations | Yes | A tape file can be opened in "read/write" mode, and read, seek, and write operations can then be performed in any order. Supported by all formats (except for Ogg/Vorbis, FLAC and other compressed formats. These files cannot be opened in "read/write" mode). |
Playback of audio track | Yes | In all formats. Used in the emulator to make the user hear the loaded tape. Stereophonic tapes are also supported. |
Conversion of cassettes with audio track to CAS format | Planned | |
Loading turbo tapes | Limited | The CAS format has been extended to support various turbo formats. Works with CAS and HEX, but with audio files loading is rather unreliable. |
Saving turbo tapes | Planned |
a8cas-tools
a8cas-tools consists of two command-line tools that use liba8cas. These are:
a8cas-info
: a small utility that writes back some basic information (file format, number of blocks, sample rate) from a given tape file;a8cas-convert
: a simple utility for converting tape files between formats: From sound files to CAS, from CAS to sound files, CAS↔HEX, etc. It replaces utilities such as WAV2CAS, CAS2WAV, CAS2XEX, XEX2CAS.
Atari800 patch
View of the new Tape Management menu in Atari800
A patch has been created to add support for liba8cas to Atari800. Support for loading, writing and creating tape files in all formats has been added. Rewinding and fast-forwarding is also supported, as well as tapes with stereophonic audio track.
Select Tape Management (shortcut: Alt+T) from the emulator's main menu (F1).
Feature | Status | Notes |
---|---|---|
Loading and saving in CAS format | Yes | New CAS files can be created from withing the emulator. |
Loading and saving in HEX and FSK formats | Yes | New files in these formats cannot be created from within the emulator. |
Loading and saving in WAV format | Yes | New WAV files can be created from within the emulator. |
Loading and saving in other audio formats | Partial | Creation of new files in formats other than WAV is not supported. Additionally, compressed file formats (Ogg/Vorbis, FLAC) are read-only. |
Loading and saving of raw files | Yes | Allows to mount a COM or BASIC program as a cassette image, or create such files by saving to tape. |
Fast-forwarding and rewinding | Yes | Supported in all formats. The user has to enter a number of the block to which the tape should be rewinded. |
Audio playback | Yes | When loading and saving a tape, its sound is played synchronously with the loaded/saved data. For stereophonic tapes, only the data track is played back. Volume of the audio playback can be adjusted. Supported only in the SDL version of Atari800. Supported in all frequencies, 8/16 bit, and mono/stereo. |
Tapes with non-standard blocks (copy-protected) | Yes | Loading of non-standard blocks is fully supported. Writing is supported too, but not fully. |
Cassette recorder activity indicator | Yes | Same as the indicator seen during disk operations. Can also display a current block number (activate by Display Settings→Show sector counter). |
SIO-patch for fast tape access | Yes | Standard tapes (ie. without custom loaders) can be loaded/saved with SIO patch. All formats CAS, HEX, FSK, sound, raw) are supported. |
Turbo hardware modifications | Limited | Several turbo systems are supported, but only when loading. Reading from sound files is unreliable. |
To do
Important features to do:
- Commit support for liba8cas in Atari800's source tree (possibly as an optional feature).
- Make the dependence of liba8cas on libsndfile optional (for example, without libsndfile only WAV sound files will be supported).
- Improve decoding of tape signals from audio files. The algorithm could be better - at the moment it fails on some low-quality tapes. A guy named FUJI has implemented a WAV preprocessing tool, wav-square-cas, which gives better reults than the algorithm in A8CAS - I'll try to integrate it into the library.
- Provide an interface which will allow the user to use his own audio routines, so dependence on libsndfile would not be mandatory.
- Add support for converting tapes with audio tracks to CAS format.
- Improve speed of internal algorithms (if possible). (Not that they are inefficient in any way now.)
- Support more turbo systems, saving, and conversion of turbo tapes to CAS.