Class NibbleOrder
java.lang.Object
com.webcodepro.applecommander.storage.physical.ImageOrder
com.webcodepro.applecommander.storage.physical.DosOrder
com.webcodepro.applecommander.storage.physical.NibbleOrder
Supports disk images stored in nibbilized DOS physical order.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]
This maps a DOS 3.3 sector to a physical sector. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
format()
Format the media.int
Answer with the number of blocks on this device.int
Answer with the number of sectors per track on this device.int
Answer with the number of tracks on this device.byte[]
readSector
(int track, int dosSector) Retrieve the specified sector.protected byte[]
readTrackData
(int track) Read nibbilized track data.void
writeSector
(int track, int dosSector, byte[] sectorData) Write the specified sector.protected void
writeTrackData
(int track, byte[] trackData) Write nibbilized track data.Methods inherited from class com.webcodepro.applecommander.storage.physical.DosOrder
blockToSectors525, getName, getOffset, isBlockDevice, isTrackAndSectorDevice, readBlock, writeBlock
Methods inherited from class com.webcodepro.applecommander.storage.physical.ImageOrder
getDiskImageManager, getPhysicalSize, getSectorsPerDisk, isSizeApprox, readBytes, setDiskImageManager, writeBytes
-
Field Details
-
DOS_SECTOR_SKEW
public static final int[] DOS_SECTOR_SKEWThis maps a DOS 3.3 sector to a physical sector. (readSector and writeSector work off of the DOS 3.3 sector numbering.)
-
-
Constructor Details
-
NibbleOrder
Construct a NibbleOrder.
-
-
Method Details
-
readTrackData
protected byte[] readTrackData(int track) Read nibbilized track data. -
writeTrackData
protected void writeTrackData(int track, byte[] trackData) Write nibbilized track data. -
readSector
Retrieve the specified sector. The primary source of information for this process is directly from Beneath Apple DOS, chapter 3.- Overrides:
readSector
in classDosOrder
- Throws:
IllegalArgumentException
-
writeSector
public void writeSector(int track, int dosSector, byte[] sectorData) throws IllegalArgumentException Write the specified sector.- Overrides:
writeSector
in classDosOrder
- Throws:
IllegalArgumentException
-
getTracksPerDisk
public int getTracksPerDisk()Answer with the number of tracks on this device.- Overrides:
getTracksPerDisk
in classImageOrder
-
getSectorsPerTrack
public int getSectorsPerTrack()Answer with the number of sectors per track on this device.- Overrides:
getSectorsPerTrack
in classImageOrder
-
getBlocksOnDevice
public int getBlocksOnDevice()Answer with the number of blocks on this device. This cannot be computed since the physical size relates to disk bytes (6+2 encoded) instead of a full 8-bit byte.- Overrides:
getBlocksOnDevice
in classImageOrder
-
format
public void format()Format the media. Formatting at the ImageOrder level deals with low-level issues. A typical ordering just needs to have the image "wiped," and that is the assumed implementation. However, specialized orders - such as a nibbilized disk - need to lay down track and sector markers.- Overrides:
format
in classImageOrder
-