On 02/08/2012 06:40 PM, Egan Ford wrote:
I wanted to avoid this, but perhaps I need to create a nibble writer.
Is there any Apple ASM code floating around that I can look at?
NIB depends on an emulated Disk II controller that always reads whole
bytes at a time. It has too little information to work on a real Disk II
(or other Apple 5.25") controller that reads data bit by bit, assembling
them to bytes with the help of those special, longer "sync" bytes.
Also, the tracks of (most) NIBs are longer than real floppy tracks so
you have to know what to truncate, a problem for which there is probably
no fully automatic solution.
These two problems prevent a general solution.
Once you manage to throw out the garbage/duplicate data and to guess
correctly which bytes are "sync", writing it back to a real disk is
eminently possible with a fairly short assembler loop construct. I did
it once and used a mixture of assembler and C (cc65 compiled) to write
the disk. I can send you the code if you're interested, I think it's
originally from "Beyond Apple DOS" or some similar book.