[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DSK to NIB Instruction



Paul Schlyter <pausch@saaf.se> wrote:
>> A .nib file is 6656 ($1a00) bytes of raw data read from the floppy drive.
>> It's just about impossible for a track to actually be that long, so you
>> have some overlap.  Sadly, information about sync bytes is not retained.
> 
> WOuldn't it be safe to assume that any FF bytes are sync bytes?  Or at
> least any sequence of at neast <N> FF bytes where <N> is a suitable
> number.

0xff is a valid byte in 5&3 and 6&2 encoding.

A sector full of 0xffs becomes a nibble-encoded sector full of 0xffs.
Get too many of these and the track length exceeds what you can write
without altering the drive speed.

To make matters more interesting, some copy-protected disks don't use
0xff as the sync byte.  So if you just promote 0xff, you can end up
with a track with no sync bytes.  This is relatively rare.

There are various ways to solve this, all revolving around finding some
heuristic for identifying sync fields.  It's pretty easy to solve for
disks that aren't copy protected, but if they weren't copy protected
they wouldn't need to be stored in .nib format.

-- 
Send mail to fadden@fadden.com (Andy McFadden) - http://www.fadden.com/
CD-Recordable FAQ - http://www.cdrfaq.org/
CiderPress Apple II archive utility for Windows - http://www.faddensoft.com/
Fight Internet Spam - http://spam.abuse.net/spam/ & http://spamcop.net/