Class NibbleScanner

java.lang.Object
org.applecommander.device.nibble.NibbleScanner

public class NibbleScanner extends Object
Scan a nibble disk and try to identify the formatting. Note that this is really only good for protected DOS disks. Also note that the DOS catalog track has likely been moved, so the DOS filesystem needs to also support it.

This appears to be a rather successful algorithm:

  1. Locate address prolog bytes by simply looking for the track number and a sensible sector using 4invalid input: '&'4 encoding.
  2. From that prolog (per track), start from end of address prolog and scan for sync bytes.
  3. Try reading based on the sector count (16 vs 13).
  • Constructor Details

    • NibbleScanner

      public NibbleScanner()
  • Method Details

    • identify

      public static Optional<DiskMarker[]> identify(NibbleTrackReaderWriter trackReaderWriter)
    • findAddressPrologs

      public static Map<Integer,Set<Integer>> findAddressPrologs(int track, DataBuffer trackData)
      Look for likely address prologs on disk. Returns raw results in case there is more than one possibility and to identify likely sectors per track.

      Generate strategy is to look for byte sequence P1 P2 P3 VX VY TX TY SX SY CX CY E1 E2 E3 where 1,2,3 = prolog/epilog bytes, X,Y = 4+4 encoded data, and V,T,S,C identify volume, track, sector, and checksum.

    • findDataProlog

      public static int findDataProlog(int addressProlog, DataBuffer trackData, NibbleDiskCodec nibbleDiskCodec)
      Scan from an address prolog, look for sync bytes, and then assume next 3 are data prolog. Note that this makes a bunch of assumptions!