[Coco] tape format and .cas file problems

Ciaran Anscomb cocomalt at 6809.org.uk
Thu Nov 20 06:53:52 EST 2008


Roger Taylor wrote:
> The Impossiball game is quite impressive for a tape file.  It 
> auto-starts and also shows a countdown timer on the screen while it's loading

Yeah, I remember figuring out just how many blocks it would save as
so the initial number was correct.

Should point out the game is nothing to do with me, only the loader.

> The file has no silence gaps in it, just a real long initial leader 
> with a glitch of data sound in the middle of it followed by 
> data.  Wierd.  Oh well, it works.

The name block loads some executable code following the name/load/exec
information: CLOAD[M] loads name blocks into a particular area that it
then expects to be populated with the metadata and doesn't mind if the
block was longer than expected.  The data of the first file loads over
the "next BASIC command" area to point it into that code which I think
just has EXEC (wherever) tokenised into it.

I really don't think CAS was ever designed with silence in mind, having
originally been used for emulators that intercepted ROM calls and so
didn't even need the leaders.  It seems the best way to cope with that
inability is to just replace what would have been silence with extra
leader bytes.  Shame, but there we go.

As it turns out, a gzipped WAV file doesn't come out much larger than
an equivalent CAS (if it's a generated WAV, it'll just contain runs of
identical data over and over), and could quite easily contain silence
(though my links there were just a straight cas to wav conversion -
in two parts to preserve the different frequencies in the data part).

..ciaran
-- 
Ciaran Anscomb, Perl/C Hacker



More information about the Coco mailing list