c2n1
Commodore c2n tape format encoder and decoder
Usage
c2n [options]
file ...
Overview
This manual page documents briefly the c2n command.
c2n encodes or decodes Commodore C2N tape recorder pulse streams that represent data in formats adopted by 8-bit computers.
The pulse streams are communicated either via standard input or output, or via an external RS-232 device - a tape drive emulator called C2N232. On Commodore computers, the streams consist of four kinds of symbols that denote different kinds of low-to-high-to-low transitions on the read or write signals of the Commodore cassette interface.
- A
-
A break in the communications, or a pulse with very long cycle time.
- B
-
A short pulse, whose cycle time typically ranges from 296 to 424 microseconds, depending on the computer model.
- C
-
A medium-length pulse, whose cycle time typically ranges from 440 to 576 microseconds, depending on the computer model.
- D
-
A long pulse, whose cycle time typically ranges from 600 to 744 microseconds, depending on the computer model.
Options
C2N follows the usual Unix command line syntax, with options starting with a dash (`-').
-
-- -
Stop processing options. This is useful if the first file name begins with a dash.
-
-1 -
Use the Tangerine ORIC-1 tape format. The short B pulses representing '1' bits are symmetric. The other J pulses representing '0' bits have a one-third duty cycle and are one third longer. This format is insensitive to the phase of the signal.
-
-2 -
Use the Commodore 264 series tape format, for the models 16, 116 and plus/4. The pulse streams slightly differ from other Commodores, and the pulses are clearly wider than in other 8-bit Commodore systems.
-cdevice-
Specify the name of the RS-232 interface connected to the
C2N232device. When this option is not specified,c2nwill communicate the pulse streams via standard input or output.
-
-d -
Decode pulses to C2N binary format.
-
-D -
Decode Commodore tape images (.TAP files) from standard input to C2N binary format. All bytes arriving at standard input are assumed to be pulse width data. This option is interpreted as
-din the presence of the-coption.
-
-e -
Encode high-level tape format to pulses. This is the default option.
-
-E [+|-]rate[b|l|s|u]*[,file] -
Encode high-level tape format to pulse code modulated audio samples. The parameter rate specifies the sample rate in hertz. A negative sample rate means that the phase of the sinusoidal waves will be inverted. When the parameter file is not specified, the data will be written to the standard output. The default sample width is 8 bits. The modifiers
bandlselect 16-bit samples in big-endian or little-endian format, respectively. By default, the sample values are signed (in two's complement notation). The modifieruselects unsigned format. Finally, the modifiersoverrides the default monaural output with binaural (stereo).
-
-h -
Display a short command-line usage message and exit.
-pshort,medium,long-
Specify pulse widths for the
C2N232device. The unit is 8 microseconds. The default widths (which are distinct for decoding and encoding) should work with all Commodore computers. The options-1and-2imply different defaults.
-
-r -
Enable raw operation. No encoding or decoding of the pulse stream takes place. The file arguments following the options given to
c2nare assumed to be pulse streams consisting of the characters A, B, C, and D, as described in the beginning of this manual.
-sbegin,intra-
Specify the number of short pulses in the beginning of the first tape header block (default: begin=1500) and between adjacent tape blocks (default: intra=5376). The Commodore KERNAL routines use a begin value of over 26000, corresponding to around ten seconds. It appears that 1500 pulses are sufficient in the beginning of the stream. The intra-block gap could be reduced on those Commodore models that do not blank the screen during tape operations nor wait for user interaction after loading the header. For the Tangerine ORIC-1, the argument begin counts bytes, not pulses.
-tthresold-
Specify the maximum number of errors that are tolerated during decoding or encoding, before aborting program execution. The default value is 10.
-
-v -
Enable verbose diagnostic messages from the encoding and decoding routines.
Releases
Unchanged in 2 releases since Debian 3.1 (Sarge).