Class ProdosBlockToTrackSectorAdapterStrategy

java.lang.Object
org.applecommander.device.ProdosBlockToTrackSectorAdapterStrategy
All Implemented Interfaces:
TrackSectorToBlockStrategy

public class ProdosBlockToTrackSectorAdapterStrategy extends Object implements TrackSectorToBlockStrategy
  • Field Details

    • blockInterleave

      public static final int[] blockInterleave
      This table contains the block offset for a particular DOS sector.
    • blockOffsets

      public static final int[] blockOffsets
      Defines the location within a block in which the DOS sector resides. (0 = 0-255 and 1 = 256-511.)
  • Constructor Details

    • ProdosBlockToTrackSectorAdapterStrategy

      public ProdosBlockToTrackSectorAdapterStrategy()
  • Method Details

    • computeBlock

      public int computeBlock(int track, int sector)
      Description copied from interface: TrackSectorToBlockStrategy
      Translate a track and sector reference into the proper block number.
      Specified by:
      computeBlock in interface TrackSectorToBlockStrategy
    • computeOffset

      public int computeOffset(int track, int sector)
      Description copied from interface: TrackSectorToBlockStrategy
      Translate a given track and sector into the proper offset into the block. This is needed due to the fact that a ProDOS block is 512 bytes but a DOS sector is 256 bytes -- meaning two sectors fit into a block.
      Specified by:
      computeOffset in interface TrackSectorToBlockStrategy
    • getTotalTracks

      public int getTotalTracks()
      Description copied from interface: TrackSectorToBlockStrategy
      Indicates the total number of tracks in this device. The default is 50 tracks, which is the maximum number of tracks DOS will support; this method will have to be overridden for DOS.MASTER type products.
      Specified by:
      getTotalTracks in interface TrackSectorToBlockStrategy
    • getSectorsPerTrack

      public int getSectorsPerTrack()
      Description copied from interface: TrackSectorToBlockStrategy
      Indicates the total number of sectors per track in this device. The default is 32 sectors per track which is the maximum number of sectors that DOS supports. Note that we do make the assumption that the disk geometry is fixed and sectors do not vary.
      Specified by:
      getSectorsPerTrack in interface TrackSectorToBlockStrategy
    • getName

      public String getName()
      Description copied from interface: TrackSectorToBlockStrategy
      The name is information used in various toString methods. This ensures it is populated.
      Specified by:
      getName in interface TrackSectorToBlockStrategy