man c2n (Commandes) - Commodore C2N tape format encoder and decoder

NAME

c2n - Commodore C2N tape format encoder and decoder

SYNOPSIS

c2n [options] le...

DESCRIPTION

This manual page documents briey 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 dierent 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 rst le 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 dier from other Commodores, and the pulses are clearly wider than in other 8-bit Commodore systems.
-c device
Specify the name of the RS-232 interface connected to the C2N232 device. When this option is not specied, c2n will communicate the pulse streams via standard input or output.
-d
Decode pulses to C2N binary format.
-D
Decode Commodore tape images (.TAP les) 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 -d in the presence of the -c option.
-e
Encode high-level tape format to pulses. This is the default option.
-E [+|-]rate[b|l|s|u]*[,le]
Encode high-level tape format to pulse code modulated audio samples. The parameter rate species the sample rate in hertz. A negative sample rate means that the phase of the sinusoidal waves will be inverted. When the parameter le is not specied, the data will be written to the standard output. The default sample width is 8 bits. The modiers b and l select 16-bit samples in big-endian or little-endian format, respectively. By default, the sample values are signed (in two's complement notation). The modier u selects unsigned format. Finally, the modier s overrides the default monaural output with binaural (stereo).
-h
Display a short command-line usage message and exit.
-p short,medium,long
Specify pulse widths for the C2N232 device. The unit is 8 microseconds. The default widths (which are distinct for decoding and encoding) should work with all Commodore computers. The options -1 and -2 imply dierent defaults.
-r
Enable raw operation. No encoding or decoding of the pulse stream takes place. The le arguments following the options given to c2n are assumed to be pulse streams consisting of the characters A, B, C, and D, as described in the beginning of this manual.
-s begin,intra
Specify the number of short pulses in the beginning of the rst 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 sucient 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.
-t thresold
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.

BUGS

The C2N232 device is not connected to the motor control signal on the Commodore cassette interface. Thus, only partial interlocking between the computer and the cassette drive emulator is possible.

All tape operations should be started on the Commodore computer rst. Once a prompt for starting the tape drive appears, c2n must be invoked with the appropriate parameters.

On models that disable screen output during tape operations and wait for a key press once the tape header has been loaded, the Commodore key must be pressed quickly, since the C2N232 device does not receive any indication that the tape drive motor has been stopped.

On the Commodore PET, all programs (header type 1) are loaded to an absolute address, while on other Commodores, type 1 indicates a relocatable BASIC program. Header type 3, which corresponds to the PET header type 1 on other Commodores, is ignored by the PET. When loading machine language C2N les to the PET, make sure that the rst header byte is 1. (cbmconvert uses header type 3 when the least signicant byte of the start address diers from 1.)

The program has been tested on a CBM 8032 and on the PAL versions of the Commodore VIC-20, Commodore 64, Commodore 128 and plus/4 computers, and on a Tangerine ORIC-1.

Since c2n has not been designed for recovering data from audio tapes, it does not have any intelligent error correction features. Instead, it just reports the detected inconsistencies.

AUTHOR

The c2n utility and the C2N232 cassette drive emulator device were designed and implemented by Marko Mkel <msmakela@nic.funet.fi>.

SEE ALSO