Package org.applecommander.device.nibble
Class NibbleScanner
java.lang.Object
org.applecommander.device.nibble.NibbleScanner
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:
- Locate address prolog bytes by simply looking for the track number and a sensible sector using 4invalid input: '&'4 encoding.
- From that prolog (per track), start from end of address prolog and scan for sync bytes.
- Try reading based on the sector count (16 vs 13).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindAddressPrologs(int track, DataBuffer trackData) Look for likely address prologs on disk.static intfindDataProlog(int addressProlog, DataBuffer trackData, NibbleDiskCodec nibbleDiskCodec) Scan from an address prolog, look for sync bytes, and then assume next 3 are data prolog.static Optional<DiskMarker[]> identify(NibbleTrackReaderWriter trackReaderWriter)
-
Constructor Details
-
NibbleScanner
public NibbleScanner()
-
-
Method Details
-
identify
-
findAddressPrologs
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 sequenceP1 P2 P3 VX VY TX TY SX SY CX CY E1 E2 E3where 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!
-