Class RdosFormatDisk
- All Implemented Interfaces:
DirectoryEntry
Note that the RDOS 2.1/3.2 block interleave is different than the standard DOS 3.3 format. Thus, when the image is made, the sectors are skewed differently - use readRdosBlock to read the appropriate block number.
Also note that the operating system is itself the first file. Block #0 is really track 0, sector 0 - meaning that the first file should not (cannot) be deleted.
RDOS 2.1/3.2 was placed on 13 sector disks. This limits the number of blocks to 455. It also may also cause incompatibilities with other formats and other cracks.
Date created: Oct 7, 2002 2:03:58 PM
-
Nested Class Summary
Nested classes/interfaces inherited from class com.webcodepro.applecommander.storage.FormattedDisk
FormattedDisk.DiskInformation, FormattedDisk.DiskUsage, FormattedDisk.FileColumnHeader
Nested classes/interfaces inherited from class com.webcodepro.applecommander.storage.Disk
Disk.FilenameFilter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Number of sectors used by catalog.static final int
Specifies the length of a file entry.static final String[]
The known filetypes for a RDOS disk.static final int
Specifies the number of tracks on the disk.Fields inherited from class com.webcodepro.applecommander.storage.FormattedDisk
FILE_DISPLAY_DETAIL, FILE_DISPLAY_NATIVE, FILE_DISPLAY_STANDARD
Fields inherited from class com.webcodepro.applecommander.storage.Disk
APPLE_10MB_HARDDISK, APPLE_140KB_DISK, APPLE_140KB_NIBBLE_DISK, APPLE_20MB_HARDDISK, APPLE_32MB_HARDDISK, APPLE_5MB_HARDDISK, APPLE_800KB_2IMG_DISK, APPLE_800KB_DISK, BLOCK_SIZE, DOS33_SECTORS_ON_140KB_DISK, PRODOS_BLOCKS_ON_140KB_DISK, SECTOR_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionRdosFormatDisk
(String filename, ImageOrder imageOrder) Constructor for RdosFormatDisk. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Identify if additional directories can be created.boolean
Indicates if this disk image can create a file.boolean
Indicates if this disk image can delete a file.boolean
RDOS dos not support directories.boolean
Indicates if this disk image can read data from a file.boolean
Indicates if this disk image can write data to a file.void
changeImageOrder
(ImageOrder imageOrder) Change to a different ImageOrder.static RdosFormatDisk[]
create
(String filename, ImageOrder imageOrder) Create a RdosFormatDisk.createDirectory
(String name) Create a new DirectoryEntry.Create a new FileEntry.void
format()
Format the disk as an RDOS disk.int[]
Get suggested dimensions for display of bitmap.String[]
Get the labels to use in the bitmap.int
Get the length of the bitmap.Gives an indication on how this disk's geometry should be handled.Get Pascal-specific disk information.RDOS really does not have a disk name.Get the disk usage iterator.getFileColumnHeaders
(int displayMode) Get the standard file column header information.byte[]
getFileData
(FileEntry fileEntry) Get the data associated with the specified FileEntry.getFiles()
Retrieve a list of files.String[]
Returns a list of possible file types.Identify the operating system format of this disk.int
Return the number of free blocks.int
Return the amount of free space in bytes.int
Returns the logical disk number.getSuggestedFilename
(String filename) Returns a valid filename for the given filename.getSuggestedFiletype
(String filename) Returns a valid filetype for the given filename.int
Return the number of used blocks.int
Return the amount of used space in bytes.boolean
needsAddress
(String filetype) Indicates if this filetype requires an address component.byte[]
readRdosBlock
(int block) Read an RDOS block.void
setFileData
(FileEntry fileEntry, byte[] fileData) Writes the raw bytes into the file.boolean
Indicates if this disk format supports "deleted" files.boolean
Indicates if this FormattedDisk supports a disk map.toNativeFiletype
(String prodosFiletype) Provides conversation from a given ProDOS file type since as it is common across many archiving tools.toProdosFiletype
(String nativeFiletype) Provides conversation to a given ProDOS file type since as it is common across many archiving tools.void
writeRdosBlock
(int block, byte[] data) Write an RDOS block.Methods inherited from class com.webcodepro.applecommander.storage.FormattedDisk
getDirname, getFile, getFile, getFormattedDisk, resizeDiskImage, setDiskName, writeBootCode
Methods inherited from class com.webcodepro.applecommander.storage.Disk
getAllExtensions, getDiskImageManager, getFilename, getFilenameFilters, getFormattedDisks, getImageOrder, getOrderName, getPhysicalSize, hasChanged, is140KbDisk, is2ImgOrder, is800KbDisk, isBXY, isCompressed, isCpmFormat, isDC42, isDosFormat, isDosOrder, isNakedosFormat, isNewImage, isNibbleOrder, isOzDosFormat, isPascalFormat, isProdosFormat, isProdosOrder, isRdos33Format, isRdosFormat, isSDK, isSHK, isUniDosFormat, isWPFormat, makeDosOrder, makeProdosOrder, readBlock, readSector, resizeDiskImage, save, saveAs, setFilename, setImageOrder, sizeToFit, testImageOrder, writeBlock, writeSector
-
Field Details
-
ENTRY_LENGTH
public static final int ENTRY_LENGTHSpecifies the length of a file entry.- See Also:
-
TRACKS_ON_DISK
public static final int TRACKS_ON_DISKSpecifies the number of tracks on the disk. RDOS apparantly only worked on 5.25" disks.- See Also:
-
CATALOG_SECTORS
public static final int CATALOG_SECTORSNumber of sectors used by catalog. FIXME: some sources say 10, others say 11. RDOS 3.3 may support 16.- See Also:
-
FILE_TYPES
The known filetypes for a RDOS disk.
-
-
Constructor Details
-
RdosFormatDisk
Constructor for RdosFormatDisk.
-
-
Method Details
-
create
Create a RdosFormatDisk. -
readRdosBlock
public byte[] readRdosBlock(int block) Read an RDOS block. The sector skewing for RDOS 2.1/3.2 is different. This routine will convert the block number to a DOS track and sector, handling the sector change-over. The readSector method then should take care of various image formats.Note that sectorSkew has the full 16 sectors, even though RDOS 2.1/3.2 itself is a 13 sector format.
-
writeRdosBlock
public void writeRdosBlock(int block, byte[] data) Write an RDOS block. The sector skewing for RDOS2.1/3/2 is different. This routine will convert the block number to a DOS track and sector, handling the sector change-over. The writeSector method then should take care of various image formats.Note that sectorSkew has the full 16 sectors, even though RDOS itself is a 13 sector format.
-
getDiskName
RDOS really does not have a disk name. Fake one.- Specified by:
getDiskName
in classFormattedDisk
-
getFiles
Retrieve a list of files. -
createFile
Create a new FileEntry.- Throws:
DiskFullException
-
canCreateDirectories
public boolean canCreateDirectories()Identify if additional directories can be created. This may indicate that directories are not available to this operating system or simply that the disk image is "locked" to writing. -
canCreateFile
public boolean canCreateFile()Indicates if this disk image can create a file. If not, the reason may be as simple as it has not been implemented to something specific about the disk. -
getFormat
Identify the operating system format of this disk.- Specified by:
getFormat
in classFormattedDisk
-
getFreeBlocks
public int getFreeBlocks()Return the number of free blocks. -
getUsedBlocks
public int getUsedBlocks()Return the number of used blocks. -
getFreeSpace
public int getFreeSpace()Return the amount of free space in bytes.- Specified by:
getFreeSpace
in classFormattedDisk
-
getUsedSpace
public int getUsedSpace()Return the amount of used space in bytes.- Specified by:
getUsedSpace
in classFormattedDisk
-
getBitmapDimensions
public int[] getBitmapDimensions()Get suggested dimensions for display of bitmap. Since RDOS uses blocks, a null is returned indicating no suggestions.- Specified by:
getBitmapDimensions
in classFormattedDisk
-
getBitmapLength
public int getBitmapLength()Get the length of the bitmap.- Specified by:
getBitmapLength
in classFormattedDisk
-
getDiskUsage
Get the disk usage iterator.- Specified by:
getDiskUsage
in classFormattedDisk
-
getBitmapLabels
Get the labels to use in the bitmap.- Specified by:
getBitmapLabels
in classFormattedDisk
-
getDiskInformation
Get Pascal-specific disk information.- Overrides:
getDiskInformation
in classFormattedDisk
-
getFileColumnHeaders
Get the standard file column header information. This default implementation is intended only for standard mode.- Overrides:
getFileColumnHeaders
in classFormattedDisk
-
supportsDeletedFiles
public boolean supportsDeletedFiles()Indicates if this disk format supports "deleted" files.- Specified by:
supportsDeletedFiles
in classFormattedDisk
-
canReadFileData
public boolean canReadFileData()Indicates if this disk image can read data from a file.- Specified by:
canReadFileData
in classFormattedDisk
-
canWriteFileData
public boolean canWriteFileData()Indicates if this disk image can write data to a file.- Specified by:
canWriteFileData
in classFormattedDisk
-
canHaveDirectories
public boolean canHaveDirectories()RDOS dos not support directories.- Specified by:
canHaveDirectories
in classFormattedDisk
-
canDeleteFile
public boolean canDeleteFile()Indicates if this disk image can delete a file.- Specified by:
canDeleteFile
in classFormattedDisk
-
getFileData
Get the data associated with the specified FileEntry.- Specified by:
getFileData
in classFormattedDisk
- See Also:
-
format
public void format()Format the disk as an RDOS disk. FIXME - RDOS does not "like" an AppleCommander formatted disk. This appears to be because the &CAT command reads from track 1 sector 9 (whatever RDOS block that would be) and executes that code for the directory. AppleCommander will need to either clone the code or write its own routine. This is RDOS block #25. FIXME - Doesn't handle native 16-sector (RDOS 3.3) format.- Specified by:
format
in classFormattedDisk
- See Also:
-
getLogicalDiskNumber
public int getLogicalDiskNumber()Returns the logical disk number. Returns a 0 to indicate no numbering.- Specified by:
getLogicalDiskNumber
in classFormattedDisk
-
getSuggestedFilename
Returns a valid filename for the given filename. RDOS pretty much allows anything - so it is cut to 24 characters and trimmed (trailing whitespace may cause confusion).- Specified by:
getSuggestedFilename
in classFormattedDisk
-
getSuggestedFiletype
Returns a valid filetype for the given filename. The most simple format will just assume a filetype of binary. This method is available for the interface to make an intelligent first guess as to the filetype.- Specified by:
getSuggestedFiletype
in classFormattedDisk
-
getFiletypes
Returns a list of possible file types. Since the filetype is specific to each operating system, a simple String is used.- Specified by:
getFiletypes
in classFormattedDisk
-
needsAddress
Indicates if this filetype requires an address component. Presumably, the "B" filetype is binary and will need an address.- Specified by:
needsAddress
in classFormattedDisk
-
supportsDiskMap
public boolean supportsDiskMap()Indicates if this FormattedDisk supports a disk map.- Overrides:
supportsDiskMap
in classFormattedDisk
-
changeImageOrder
Change to a different ImageOrder. Remains in RDOS format but the underlying order can change.- Specified by:
changeImageOrder
in classFormattedDisk
- See Also:
-
setFileData
Writes the raw bytes into the file. This bypasses any special formatting of the data (such as prepending the data with a length and/or an address). Typically, the FileEntry.setFileData method should be used.- Specified by:
setFileData
in classFormattedDisk
- Throws:
DiskFullException
-
createDirectory
Create a new DirectoryEntry.- Throws:
DiskFullException
- See Also:
-
getDiskGeometry
Gives an indication on how this disk's geometry should be handled.- Specified by:
getDiskGeometry
in classFormattedDisk
-
toNativeFiletype
Provides conversation from a given ProDOS file type since as it is common across many archiving tools.- Specified by:
toNativeFiletype
in classFormattedDisk
-
toProdosFiletype
Provides conversation to a given ProDOS file type since as it is common across many archiving tools.- Specified by:
toProdosFiletype
in classFormattedDisk
-