WIP: Tape Port Test patterns

Synopsis: an information-capture for work-in-progress

The Apple cassette save routines use the Y register to determine the pulse-width between signal edges, and there are seven distinct values for the Y parameter depending upon the context and state of the save routine.  For the purposes of studying the cassette routines, I named each parameter for its default value and tested their limits:

  • Y4B at HEADR+01.  Cycle time used in the header tone, which marks the beginning of a tape save.  Architecturally, the header tone consists of long 1-bits which the tape load routine will use to find the rising and falling edges of the signal.  The default for this parameter is $4B, but tests gave valid results with values in the range $47 up to $FF.  Tests failed with Y less than $47, but this appears to be caused by a flaw in the test patterns themselves -- not a valid test result.
  • Y21 at HEADER+0C.  Start bit, which marks the end of the header tone and the start of data tones.  The default is $21, but tests gave valid results with values in the range of $07 through $4F.
  • Y27 at WRITE+06.  Base width of first data bit after the header tone.  The default is $27, but tests gave valid results with values from $07 to $57.
  • Y32 at ZERDLY+05.  Incremental width of 1-bits.  This is additional time, added to the last baseline value in Y to distinguish a 1-bit from a 0-bit.  The default is $32, but tests gave valid results with values from $1F to $A7.
  • Y2C at WRTAPE+07.  Base width of subsequent data bits within a byte, excluding the first data bit in a byte.  The default is $2C, but tests gave valid results with values from $17 to $3F.
  • Y1D at WR1+0E.  Base width of the first data bit in the next byte and all subsequent bytes, which requires less time due to the overhead of advancing the zero-page data pointer.  Default is $1D, but tests gave valid results with values in the range $07 to $47.
  • Y22 at WR1+13.  Base width of the first data bit in the checksum byte, after all data bytes have been transmitted.  Default is $22, but tests gave valid results with values in the range $07 to $4F.  Valid results were also obtained with values in the range $87 to $FF, which apparently 'worked' because the nonstandard width caused the read counter to overflow, and thus wrap around to the correct value by chance.

Tape Port Test Files...

fThere are seven audio files in the archive VBR-Tests.zip, each containing 32 audio segments of a tape-save where the specified Y parameter has been adjusted to values Y=07 through Y=FF in increments of 08.

 

Conclusions and observations:

  • By testing the limits of the parameters used in the tape-save routine, these tests coarsely established some broad limits of the Apple's tape-load routine.
  • Apple's tape-save routine emits exactly 1 full cycle per bit.
  • Apple's tape-load routine measures two half-cycles per bit, but ignores the measurement of the first half-cycle.  This appears to be a hack to help the routine avoid errors, as the first half of any cycle contains jitter (timing noise) incurred by architectural overhead.  At 256-byte page boundaries in the data, where the tape-save  routine is obliged to update the pointer low-byte and the pointer high-byte and load a new data byte via the pointer and extract the first bit from that byte, the jitter was so severe that the first half-cycle was only 75% reliable while the second half-cycle was >99% reliable.
  • It appears that Apple created a tape-save routine and tape-load routine in parallel, in the hope that they could be made compatible by constructing together.  But the load routine is vulnerable to errors at boundaries wherever the two routines are required to perform different functions.

 

For reliable tape loading, it might have been sensible to devise a tape-save routine tailored to generate a signal that fits the response characteristics of the tape-load routine.  But that's like attempting to solve a chicken-and-egg problem by starting with a pristine egg and attempting to encircle it with a chicken that could have laid it.

AttachmentSize
Package icon VBR-Tests.zip235.12 MB
Tags: 
Content Type: