


cassette(1)                                                       cassette(1)



Name
  cassette - data cassette image manipulator for xtrs TRS-80 emulator

Syntax
  ccaasssseettttee

Description
  To control the emulated cassette used by xxttrrss, a file called
  ".cassette.ctl" in the current directory keeps track of what file is
  currently "loaded" as the cassette tape and the current position within
  that file. The ccaasssseettttee shell script provides a way to manipulate this
  file; typing "help" at its prompt shows its commands. You may use this
  script to load and position cassette tape files. The operation works very
  much like an actual tape recorder.

  This manual page also describes the image formats that the emulator sup-
  ports and their limitations.

  In this release, two cassette programs are supplied.  The original ccaasssseettttee
  is a C-shell script; it should work with most versions of /bin/csh.  If you
  do not have /bin/csh installed, you can use ccaasssseettttee..sshh, which is a Bourne
  shell script.  It requires a modern version of the Bourne shell that sup-
  ports user-defined functions, so it may not work on older Unix systems.


Commands
  ppooss generates a status message including the filename being used as the
  cassette image and the current position within the image, in bytes.

  llooaadd [_f_i_l_e_n_a_m_e] changes the cassette image currently being used to the file
  specified, and resets the position counter to zero.

  ttyyppee _t_y_p_e_n_a_m_e tells the emulator what type of image is loaded.  Usually
  this is detected from the file extension, but you can override the detected
  value with this command.  The supported types are listed in the next sec-
  tion.

  rreeww [_p_o_s_i_t_i_o_n] changes the position counter to the position specified.  If
  no position is given, the counter is reset to zero.

  ffff [_p_o_s_i_t_i_o_n] changes the position counter to the position specified.  If
  no position is given, the counter is set to the end of the file.

  qquuiitt exits the ccaasssseettttee shell script.

Types
  xxttrrss supports several different types of cassette images, each of which
  represents cassette data in a different format.

  _c_a_s format is fairly compact and is compatible with other TRS-80 emulators
  that have cassette support.  This format represents the bit stream that
  (the emulator thinks) the TRS-80 cassette routines were trying to save to
  the tape, not the actual electrical signals on the tape.  On writing, the
  emulator monitors the values that the TRS-80 software is sending to the
  cassette port and their timing, auto-recognizes whether a 500-bps or 1500-
  bps format is being written, decodes the signals into a string of 0 and 1
  bits, packs the bits into bytes, and writes them to the cas file.  (250
  bps, used by Level 1 Basic, is currently not supported.)  On reading, the
  emulator auto-detects whether software is trying to read at 500 or 1500 bps
  and encodes the 0's and 1's back into the signals that the TRS-80 software
  is expecting.

  This somewhat roundabout method should work with most TRS-80 cassette rou-
  tines that read/write signals compatible with the ROM cassette routines,
  but will fail with routines that are too different.  Note that you can't
  read a 500-bps cas image at 1500 bps or vice versa; 1500 bps uses a dif-
  ferent bit pattern in the leader and writes an extra zero bit between every
  two data bytes.

  _c_p_t format (for "cassette pulse train") encodes the exact values and timing
  of the signals that the TRS-80 cassette routine sends to the cassette out-
  put port to be recorded on the tape.  Timing is to the nearest microsecond.
  This format emulates a perfect, noise-free cassette, so any cassette rou-
  tines that even halfway worked on real hardware should work with it.

  _w_a_v format is a standard sound file format.  The wav format is intermediate
  in emulation accuracy between cas and cpt.  It does represent actual sig-
  nals, not decoded bits, but its timing precision is limited by the sample
  rate used.  The default rate for new wav files is 11,025 Hz; you can change
  this with the -samplerate command line option to xxttrrss.

  You can play wav files written by xxttrrss through your sound card and hear
  roughly what a real TRS-80 cassette sounds like.  A real TRS-80 should be
  able to read wav files written by xxttrrss if you copy them to a cassette or
  connect the TRS-80 directly to the sound card's output, but that is
  untested at this writing.

  xxttrrss can also read wav files.  It can read back the wav files that it
  writes without error (since no noise has been introduced), but reading wav
  files sampled from real cassettes is more difficult.  At this writing it
  seems to work fairly well for 500bps cassettes but poorly for 1500bps.
  Perhaps a higher sampling rate or better signal preprocessing inside xtrs
  would help.

  The wav file parsing code has several limitations.  Samples must be 8-bit
  mono, and the wav file must contain only one data chunk and no extra
  optional RIFF chunks in the header.  If you have a wav file whose header
  xtrs rejects, try using sox(1) to convert it to a more vanilla format.

  _d_i_r_e_c_t format is similar to wav format, except that the samples go to (or
  come from) your sound card directly, not a wav file.  Direct format
  requires the Open Sound System /dev/dsp device.  Extending the code to work
  with other sound interfaces would probably not be hard, but is left as an
  exercise for the reader.  Please send me the changes if you do this.

  _d_e_b_u_g format is the same as cpt format except that the data is written in
  human-readable ASCII.  The cassette output is assumed to be 0 initially.
  Each line of output gives a new value (0, 1, or 2), and the amount of time
  (in microseconds) to wait before changing the output to this value.

  _a_u_t_o_d_e_t_e_c_t is not a real format.  Rather, setting the type to autodetect is
  supposed to tell xxttrrss to look inside the file and guess the type that way.
  This is not implemented yet.






Authors
  xxttrrss was written by David Gingold <gingold@think.com> of Thinking Machines
  Corporation, Alec Wolman <wolman@crl.dec.com> of Digital Equipment Corpora-
  tion, and Timothy Mann <mann@pa.dec.com> of Digital Equipment Corporation.
  An initial version of this man page, and the translation from C-shell
  (cassette) to Bourne shell (cassette.sh), are due to Branden Robinson of
  the Debian GNU/Linux project.

































































