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

Re: NIB and DSK questions



On 2/8/2012 8:41 PM, Egan Ford wrote:
On 2/8/12 2:49 PM, Linards Ticmanis wrote:
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.


Please do. Thanks.

My first reaction - "it's been tried, you can't do it."

After sleeping on it, my reaction is now - "that's probably why you should try."

The code in ADTPro that does the nibble track analysis, finds the gap, etc. is here:
http://adtpro.cvs.sourceforge.net/viewvc/adtpro/adtpro/org/adtpro/NibbleBufferMap.java?revision=1.9&view=markup

You'll find a number of files starting with Nibble in that directory that do the various bits of processing. Gerard Putter's A2V2 (an ADT derivative) can do the nibble reading; that code is also in the most recent CVS snapshot here:
http://adtpro.cvs.sourceforge.net/viewvc/adtpro/adtpro/client/src/dos/adt.s?revision=1.18&view=markup

The only reliable nibble reading is in A2V2, though, not my code. There isn't any nibble write in either code base. See:
http://www.virtualii.com/A2V2Help/A2V2Help.html