[Coco] .dsk format

Gene Heskett gene.heskett at verizon.net
Tue Mar 10 10:48:58 EDT 2009


On Tuesday 10 March 2009, Bill wrote:
>Pardon what may be a silly question, but can files saved in the .dsk format
>be downloaded and put back on their original condition using a coco?

In nitros9/os9, one can rather quickly write a basic09 program to do that, the 
secret is to open  the write path to the disk in the whole disk mode, aka /d0@ 
or /d1@ etc, then copy the .dsk file to the disk, one 256 byte sector at a 
time until done.  Very simplified:

10 PROCEDURE WRTDISK
20 DIM BUFFER, 256 BYTE buffer storage 
30 DIM IPATH byte, OPATH byte
40 OPEN #IPATH,srcfilename
50 OPEN OPATH, /d0@
60 WHILE NOT(EOF, #IPATH) DO
70 READ #IPATH, BUFFER
80 WRITE #OPATH, BUFFER
90 ENDWHILE
100 CLOSE #IPATH, #OPATH
110 END

That is probably full of syntax errors because I haven't done that in years, 
but that is pretty close to the general outline of what it would take.

The coco's basic can do that too, but its default buffer size of 128 bytes 
means you need to allocate 2, and load both, then write both, using the dski 
and dsko syntax IIRC, where you have to handle in a 2 layer loop, the 
presetting and incrementing of the values you give the dski and dsko commands 
for the track and sector they need.  And I may not even have the right names 
for the dski and dsko stuff, mainly because I switched to os9 & never looked 
back about 2 months after getting my first old grey ghost coco all those years 
ago, just as soon as I could find 64k of ram to put in it.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
"It's when they say 2 + 2 = 5 that I begin to argue."
-- Eric Pepke





More information about the Coco mailing list