[Coco] tape format and .cas file problems

Darren A mechacoco at gmail.com
Wed Nov 19 18:01:34 EST 2008


On 11/19/08, Roger Taylor wrote:
> At 02:28 PM 11/19/2008, you wrote:
>>
>>Color Basic does not support muti-segment CLOADM files, but Extended
>>Basic does add that capability. These multi-segment files must have
>
> Shows ya how much I clung to the tape format over the years.  I was
> under the impression that no CoCo ROM supported multi-segment
> CLOADMs, but I stand educated.  ;)
>
> So, where are the origin control bytes in those data blocks?  The
> filename block has the initial load and exec addresses, ofcourse.


The multi-segment tape format is identical to the disk format. The
5-byte pre/postamble blocks are contained in the cassette file's data
bytes. The initial load and exec address in the filename block are
ignored for multi-segment files.


>>By the way, I too have written a utility to convert CAS files to audio
>>and vise-versa. However, mine currently works on Mac OS only and uses
>>the AIFF audio file format (which is very similar to WAV).
>
> I figured I could just throw that feature into cocotape.exe.  I can't
> find the .cas specs to see how the silence gaps are stored.  You
> can't represent silence as a byte that represents 8 sinewaves of 0 or 1.
>

The CAS files I have seen all use zeros for silence without any real
way to diferentiate them from actual bytes of $00. I'm not sure how it
was supposed to work.

My conversion utility does not try to replicate the CAS file exactly,
but instead uses a state machine to translate the file. Initially, it
starts in an "invalid" state and remains in that state until its sees
enough sync bytes to move to the next one. It then looks for the
logical block structures, etc... When it reaches the end of a block it
returns to the "invalid" state.  The audio output contains silence
gaps of a fixed duration. This won't work for every CAS file (like
those that don't use the defined block format), but it has worked for
everything I've needed to convert.

Darren



More information about the Coco mailing list