[Coco] [Color Computer] Re: Program to convert .cas files to play a a real Coco

Luis Fernández luis46coco at hotmail.com
Sat Dec 25 14:47:30 EST 2010


found this
serves you
#!/usr/bin/perl -w
# v0.1: initial version# v0.2: write correct size values into header# v0.3: write 9600Hz file# v0.4: simplify writing cycle data
use Fcntl qw(:seek);
unless (defined $ARGV[1]) {	print STDERR "usage: $0 INFILE OUTFILE\n";	print STDERR "INFILE is Dragon/Tandy CoCo CAS file\n";	print STDERR "OUTFILE will be 9600Hz WAV\n";	exit 1;}die unless open (my $in, "<", $ARGV[0]);die unless open (my $out, ">", $ARGV[1]);
my $wav_header = "524946460000000057415645666d742010000000010001008025000080250000010008006461746100000000";
print $out pack("H*", $wav_header);my $count = 0;
my $c;while (sysread($in, $c, 1) > 0) {	$c = ord($c);	for my $i (0..7) {		if ($c & 0x01) {			print $out pack("H*", "80ff8001");			$count += 4;		} else {			print $out pack("H*", "80d9ffd980270127");			$count += 8;		}		$c >>= 1;	}}
seek($out, 40, SEEK_SET);print $out pack("C", $count & 0xff);print $out pack("C", ($count >> 8) & 0xff);print $out pack("C", ($count >> 16) & 0xff);print $out pack("C", ($count >> 24) & 0xff);$count += 36;seek($out, 4, SEEK_SET);print $out pack("C", $count & 0xff);print $out pack("C", ($count >> 8) & 0xff);print $out pack("C", ($count >> 16) & 0xff);print $out pack("C", ($count >> 24) & 0xff);
close $out;exit 0;

> To: ColorComputer at yahoogroups.com
> From: nitrofurano at gmail.com
> Date: Sun, 19 Dec 2010 14:50:53 +0000
> Subject: [Coco] [Color Computer] Re: Program to convert .cas files to play a	a real Coco
> 
> 
> --- In ColorComputer at yahoogroups.com, "Charles" <cwils96 at ...> wrote:
> >
> > Is there an easy way to convert .cas files to play a a real Coco ?
> > i have tried several programs with no luck.
> > thanks
> 
> i'm looking for a .cas to .wav converter for Linux or MacOS-X, but since both .cas and .wav seems to be easy to hardcode, would be great if some useful documentation and some simple script (coded in a language like Python) would be awesome - i want to help on coding it if no one started, and i just need documentation and feedback from people could test it (i don't have a real CoCo now)
> 
> cheers,
> p.
> 
> 
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
 		 	   		  


More information about the Coco mailing list