Package org.applecommander.device
Class TrackSectorToBlockAdapter
java.lang.Object
org.applecommander.device.TrackSectorToBlockAdapter
- All Implemented Interfaces:
CapabilityProvider,BlockDevice,Device,HintProvider,Container
Provides a _very simple_ mapping from Track/Sectors to blocks. All sector skewing is expected
to be handled in the TrackSectorDevice. As such, this device expects to map sectors in the given
("natural") order. (That is, ProDOS blocks are sectors 0,1 and 2,3 and 3,4 etc. RDOS is in physical
order. CP/M is in CP/M's expected order.)
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.applecommander.device.BlockDevice
BlockDevice.Geometry -
Field Summary
Fields inherited from interface org.applecommander.device.BlockDevice
STANDARD_BLOCK_SIZE -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbooleancan(Capability capability) voidformat()Format a disk.<T> Optional<T> booleanreadBlock(int block) voidwriteBlock(int block, DataBuffer blockData) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.applecommander.hint.HintProvider
isAny
-
Constructor Details
-
TrackSectorToBlockAdapter
public TrackSectorToBlockAdapter(TrackSectorDevice device, TrackSectorToBlockAdapter.BlockStyle style)
-
-
Method Details
-
get
-
is
- Specified by:
isin interfaceHintProvider
-
can
- Specified by:
canin interfaceCapabilityProvider
-
getGeometry
- Specified by:
getGeometryin interfaceBlockDevice
-
readBlock
- Specified by:
readBlockin interfaceBlockDevice
-
writeBlock
- Specified by:
writeBlockin interfaceBlockDevice
-
format
public void format()Description copied from interface:BlockDeviceFormat a disk. For most disks, this is simply a wipe to all zeros. If this disk has extended format (such as nibble formats), this is the opportunity to write out that format. NOTE: Adapter type devices have to be cautious about what device is responsible about formatting. For example, a UniDOS disk is 2x400K volumes on an 800K block device -- if they defer formatting to the 800K block device, a format on one volume also wipes out the other (in this case, do not defer to the "parent"). However, if the block adapter contains a nibble-based TrackSectorDevice, the actual formatting needs to get to the nibble device so it can lay down sector markers and the rest of the track structure.- Specified by:
formatin interfaceBlockDevice
-