<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 18 Jul 2006 21:20:08 +0100
From   : "Steve O'Leary" <navalenigma@...>
Subject: Re: Getting .SSD disk images onto a beeb...

>From: Rob <robert@...>
>To: Jules Richardson <julesrichardsonuk@...>,bbc 
><bbc-micro@...>
>Subject: Re: [BBC-Micro] Getting .SSD disk images onto a beeb...
>Date: Tue, 18 Jul 2006 15:54:41 +0100
>
>At 14:33 18/07/2006, Jules Richardson wrote:
>
>
>Actually, assuming the format of the SSD file is as simple as has been 
>described, then, off the top of my head, you only need something like:
>
>*DISC
>fh%=OPENIN("-NET-image.ssd") : REM you need a Master for temporary 
>filesystem
>side%=0
>lba%=0: DIM buffer% 256
>FOR trk% = 0 to 79
>   FOR sec% = 0 to 9 : REM is it 9, so long since I looked..
>       PROGosgbpb(fh%,buffer%,256,lba%*256)
>       PROCwrite_sector(side%,trk%,sec%,buffer%)
>       lba%=lba%+1
>   NEXT
>NEXT
>CLOSE#fh%
>
>The two DEF PROCs required are left as an exercise for the student..
>
>Rob.

Ahh, it is that simple and it isn't ! Sorry coming late to this thread or I 
would have chipped in earlier. Yes an .ssd disk file is a straight forward 
sector by sector copy, however if no files are stored beyond a certain 
sector then it does not store empty data. Look at the file sizes of a few 
..ssd files and you'll see they vary widley. So you need to ensure that you 
don't try and read past the end of the input stream and generate an error. 
In this case you could just exit the proc leaving the previous buffer 
contents to be written again (which won't do you any harm) or more elegantly 
perhaps write out null  bytes.

If you actually create a new .ssd in BeebEm and then format the disk as well 
then it will create a file of the correct full size.

_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free! 
http://imagine-msn.com/messenger/launch80/?locale=en-gb
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>