Package org.applecommander.device
Class ProdosBlockToTrackSectorAdapterStrategy
java.lang.Object
org.applecommander.device.ProdosBlockToTrackSectorAdapterStrategy
- All Implemented Interfaces:
TrackSectorToBlockStrategy
public class ProdosBlockToTrackSectorAdapterStrategy
extends Object
implements TrackSectorToBlockStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]This table contains the block offset for a particular DOS sector.static final int[]Defines the location within a block in which the DOS sector resides. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcomputeBlock(int track, int sector) Translate a track and sector reference into the proper block number.intcomputeOffset(int track, int sector) Translate a given track and sector into the proper offset into the block.getName()The name is information used in various toString methods.intIndicates the total number of sectors per track in this device.intIndicates the total number of tracks in this device.
-
Field Details
-
blockInterleave
public static final int[] blockInterleaveThis table contains the block offset for a particular DOS sector. -
blockOffsets
public static final int[] blockOffsetsDefines 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:TrackSectorToBlockStrategyTranslate a track and sector reference into the proper block number.- Specified by:
computeBlockin interfaceTrackSectorToBlockStrategy
-
computeOffset
public int computeOffset(int track, int sector) Description copied from interface:TrackSectorToBlockStrategyTranslate 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:
computeOffsetin interfaceTrackSectorToBlockStrategy
-
getTotalTracks
public int getTotalTracks()Description copied from interface:TrackSectorToBlockStrategyIndicates 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:
getTotalTracksin interfaceTrackSectorToBlockStrategy
-
getSectorsPerTrack
public int getSectorsPerTrack()Description copied from interface:TrackSectorToBlockStrategyIndicates 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:
getSectorsPerTrackin interfaceTrackSectorToBlockStrategy
-
getName
Description copied from interface:TrackSectorToBlockStrategyThe name is information used in various toString methods. This ensures it is populated.- Specified by:
getNamein interfaceTrackSectorToBlockStrategy
-