Package org.applecommander.device
Class TrackSectorNibbleDevice
java.lang.Object
org.applecommander.device.TrackSectorNibbleDevice
- All Implemented Interfaces:
CapabilityProvider,Device,TrackSectorDevice,HintProvider,Container
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.applecommander.device.TrackSectorDevice
TrackSectorDevice.Geometry -
Field Summary
Fields inherited from interface org.applecommander.device.TrackSectorDevice
SECTOR_SIZE -
Method Summary
Modifier and TypeMethodDescriptionbooleancan(Capability capability) static TrackSectorDevicecreate(NibbleTrackReaderWriter trackReaderWriter, int sectorsPerTrack) Create a TrackSectorNibbleDevice.intfindSector(DataBuffer trackData, int track, int sector) voidformat()Format a disk.<T> Optional<T> static Optional<TrackSectorDevice> identify(NibbleTrackReaderWriter trackReaderWriter) Brute force attempt to identify 13 or 16 sector tracks.booleanstatic intlocateField(int[] prolog, DataBuffer trackData, DataBuffer fieldData, int startingOffset) Locate a field on the track.readSector(int track, int sector) voidwriteSector(int track, int sector, DataBuffer data) 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
-
Method Details
-
create
public static TrackSectorDevice create(NibbleTrackReaderWriter trackReaderWriter, int sectorsPerTrack) Create a TrackSectorNibbleDevice. Device is not formatted but does not need to go through an identification routine (which would fail with a blank image). -
identify
Brute force attempt to identify 13 or 16 sector tracks. Note we only test track 0. Also note, we can do much better -- but all the nibble stuff will need to be reconfigured to allow different prologs/epilogs per track*. This likely can enable reading early software protection schemes that just fiddled with those bytes. DOS likely got moved around, so that would be coupled with more flexibility in DOS. See the "experimenting/identifying-nibble-prolog-bytes" for some experimental work. Note: the variance in prolog/epilog can be super detailed, but it is unlikely a DOS clone has different prolog/epilog bytes per sector. Per track may be a bit over-the-top. Except, that it appears Ultima I may have used it. :-) -
get
-
is
- Specified by:
isin interfaceHintProvider
-
can
- Specified by:
canin interfaceCapabilityProvider
-
getGeometry
- Specified by:
getGeometryin interfaceTrackSectorDevice
-
information
-
locateField
public static int locateField(int[] prolog, 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.This method fills fieldData as well as returning the last position referenced in the track buffer.
-
findSector
-
readSector
- Specified by:
readSectorin interfaceTrackSectorDevice
-
writeSector
- Specified by:
writeSectorin interfaceTrackSectorDevice
-
format
public void format()Description copied from interface:TrackSectorDeviceFormat 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 interfaceTrackSectorDevice
-