Class TrackSectorNibbleDevice

java.lang.Object
org.applecommander.device.TrackSectorNibbleDevice
All Implemented Interfaces:
CapabilityProvider, TrackSectorDevice

public class TrackSectorNibbleDevice extends Object implements TrackSectorDevice
  • Constructor Details

  • Method Details

    • can

      public boolean can(Capability capability)
      Specified by:
      can in interface CapabilityProvider
    • getGeometry

      public TrackSectorDevice.Geometry getGeometry()
      Specified by:
      getGeometry in interface TrackSectorDevice
    • decodeOddEven

      public int decodeOddEven(DataBuffer rawData, int offset)
      Decode odd-even bytes as stored on disk. The format will be in two bytes. They are stored as such:
           XX = 1d1d1d1d (odd data bits)
           YY = 1d1d1d1d (even data bits)
       
      XX is then shifted by a bit and ANDed with YY to get the data byte. See page 3-12 in Beneath Apple DOS for more information.
    • encodeOddEven

      public void encodeOddEven(DataBuffer data, int offset, int value)
      Encode odd-even bytes to be stored on disk. See decodeOddEven for the format.
      See Also:
    • locateField

      public static int locateField(int[] prolog, int[] epilog, DataBuffer trackData, DataBuffer fieldData, int startingOffset)
      Locate a field on the track. These are identified by a 3 byte unique signature. Because of the way in which disk bytes are captured, we need to wrap around the track to ensure all sequences of bytes are accounted for. Note that we also check the epilog but allow it to be wiggly.

      This method fills fieldData as well as returning the last position referenced in the track buffer.

    • findSector

      public int findSector(DataBuffer trackData, int track, int sector)
    • readSector

      public DataBuffer readSector(int track, int sector)
      Specified by:
      readSector in interface TrackSectorDevice
    • writeSector

      public void writeSector(int track, int sector, DataBuffer data)
      Specified by:
      writeSector in interface TrackSectorDevice