[Coco] tape format

Roger Taylor operator at coco3.com
Wed Nov 19 19:37:05 EST 2008


Darren,
I've got the key routines put in procedures so I can build custom 
files easier.  During testing I've been tweaking stuff a lot 
easier.  Below is an example of a test ASCII BASIC program I've been 
sending over to the CoCo.  The checksum and block size is kept up 
with when I save data to the block so when I stream the block out 
into the audio samples, the size and checksum bytes are included 
without me thinking about it anymore.  A data buffer is first filled 
with what I want, up to 255 bytes, then off it goes into the 
stream.  Simple enough.

procedure MakeGappedASCIIBASIC;
begin MakeGappedASCIIBASIC;

	SineOuts($55, 128);	// block leader
	NewBlock();

	// create FILENAME block data
	SaveStr("FILENAME");
	SaveData($00);	// $00=BASIC  $01=data  $02=binary/ML
	SaveData($ff);	// $00=binary  $ff=ASCII
	SaveData($ff);	// $00=continuous  $ff=gaps
	// block type  $00=filename  $01=data  $ff=EOF
	StreamBlock(&buffer, $00);	// memory, block type

	InsertSilence(9000); // 12000 hz/9000 = 3/4 second
	SineOuts($55, 128);	// block leader
	NewBlock();

	SaveData(13);
	SaveStr("10 CLS");
	SaveData(13);
	SaveStr("20 PRINT 123");
	SaveData(13);
	SaveStr("30 PRINT 456");
	SaveData(13);
	StreamBlock(&buffer, $01);

	// End of File
	InsertSilence(9000);
	SineOuts($55, 128);	// block leader
	NewBlock();
	StreamBlock(&buffer, $ff);

end MakeGappedASCIIBASIC;

-- 
Roger Taylor

http://www.wordofthedayonline.com




More information about the Coco mailing list