CSW2CDT is a cross-platform encoder-decoder of CSW (v1) 1-bit sample files and CDT/TZX (v1+) tape files. Its purpose is the preservation of single-bit computer tapes in general and 8-bit home computer tapes in particular, with emphasis on the Amstrad CPC and the Sinclair Spectrum, and their shared CDT/TZX tape file format, but also able to encode and decode TSX tapes from the MSX platform; the PZX tape format, a middle point between CSW and CDT/TZX, is secondarily supported as well. Its companion tool CSW0 is an encoder-decoder of RIFF WAVE audio files and CSW (v1) files; both encoders can thus work together to encode extant tapes into tape files, and to decode these files back into audio than can be recorded on real tapes or fed to computers and emulators alike.
The general idea of turning a source tape into a fully encoded CDT/TZX file is to be done in three steps: first, the tape must be sampled into an audio file; second, CSW0 will read that audio file and encode its contents into a partially processed CSW file; third, CSW2CDT will take the CSW file from the second step and parse its data into a fully processed CDT/TZX file that can be examined with editors and fed to emulators. Because noise is a problem in tapes (and even more so as they age and grow old) each stage may need the user to perform multiple retries with different parameters, until the resulting files are good enough to move on to the next stage.
Similarly, the reverse procedure of decoding an extant CDT/TZX file starts by feeding said file to CSW2CDT, who will decode it into a CSW file, and continues by feeding the resulting CSW file to CSW0, who will encode it into a WAV file that can be recorded on a tape or played back on a real machine or an emulator.
Both operations may require user input: removing noise following certain parameters, stating a particular type of tape encoding, etc.
The package also includes CSW2CDT-UI, a Windows binary that simplifies parts of the work by hiding the command line operations: the user can select files and options on a dialog instead of having to type commands and paths in full. The procedures stay the same, however, so the following episodes about CSW0 and CSW2CDT apply to CSW2CDT-UI as well.
Changelog
20240727 -- minor patch. Improved Gremlin handlers: type Gremlin0 is gone, Gremlin1 handles single-part blocks (f.e. "Basil the Great Mouse Detective"), Gremlin2 handles multi-part blocks (f.e. "Mask") and more attention is paid to the separators between headers and bodies.
20240531 -- minor patch. New multipart Speedlock handler: types 3-4 and 5-7 unify and improve the chunk separator detection logic, while fixing a bug in the dummy trailing bits of multipart blocks. Parameter "-w N" behaves differently in Speedlock tapes: it specifies the N-th block where the ID is 8 bits long, for example the levels of "Super Cycle" and "Nigel Mansell's Grand Prix". Option "-P N" lets the user set the minimum amount of data edges, for example -P 16 in the original release of "Dragon Ninja" for Amstrad CPC. Tweaks in the Bleepload2 detection. New option "-Z" (equivalent to "-z 0") forbids the generation of TZX BLOCK $10 altogether.
20240328 -- minor patch. Added sanity checks when playing TZX blocks $19 and $2B (suggested by Beginner, Patrik and Woodster), fixed bug in encoders "speedlock6" and "speedlock7" (reported by Dlfrsilver and Imulilla).
20240224 -- first public version: The list of double-hyphen encodings is "amstrad", "alkatraz", "bleepload1", "bleepload2", "carsoncity", "cassys", "ehservices", "frankbruno", "gremlin1", "gremlin2", "hexagon", "kansas", "keytone", "maubeuge", "microkey", "operasoft", "poliload", "puffyssaga", "ricochet", "spectrum", "specvar0", "specvar1", "specvar2", "speedlock0", "speedlock1", "speedlock2", "speedlock3", "speedlock4", "speedlock5", "speedlock6", "speedlock7", "unilode" and "zydroload".
The prehistory: closed source releases
20191102: support for Gremlin1 tapes, complete with checksum calculation. Gremlin2 and Gremlin3 are works in progress.
20170419: antivirus gave bogus warnings about CSW2CDT-UI.EXE, so it's no longer trimmed with STRIP.
20170409: improved pilot and SYNC detection, "--hexagon" now supports both the CPC and Spectrum Hexagon methods.
20170402: packing them with UPX led to Avast antivirus giving bogus warnings, so they're no longer compressed.
20170401: first public version of the binaries (no source code yet, it's too messy) and the handbooks, written by Dlfrsilver.