Re: reading data from G64 track

From: Greg King <greg.king5_at_verizon.net>
Date: Thu, 30 May 2013 19:30:46 -0400
Message-id: <E65CE631E25F43A49D00F101A96B88CB@Kaiser>
From: silverdr; on Thursday, May 30, 2013; at 5:10 PM -0400
>
> I mean, in the modern machine, a few KiBs here or there doesn't make
> any real difference; but, for a CBM, almost 16KiB for the buffer alone
> is a high price.

Oh.  I didn't realize that you "had gone native".  ;-)
How long is gcrBytes?

> So far, I did this for the SYNC:
>
> byte0 = gcrBytes + offset;
> switch (trackDataLength - offset) // We always need two 2 or 3 bytes to 
> get 10 consecutive bits; so, checking the last single byte doesn't make 
> sense unless we "wrap around" the buffer.
> {
> case 1:
> byte1 = gcrBytes;
> byte2 = gcrBytes + 1;
> break;
> case 2:
> byte1 = gcrBytes + offset + 1;
> byte2 = gcrBytes;
> break;
> default:
> byte1 = gcrBytes + offset + 1;
> byte2 = gcrBytes + offset + 2;
> break;
> }
>
> which, I believe, takes care of the wrapping, in a relatively effective 
> way.

What about a "compromise"?  Mirror the first two bytes.  Then, you would 
need to wrap-around the search; but not the 10-bit examination. 


       Message was sent through the cbm-hackers mailing list
Received on 2013-05-31 01:00:03

Archive generated by hypermail 2.2.0.