Skip to contents

Get the side, cylinder and sector on a disk, based on disk type and block id.

Usage

# S4 method for character,numeric
get.diskLocation(disktype, block)

Arguments

disktype

A character string indicating the type of disk: DD for double density disks. HD for high density disks.

block

numeric identifier of a block. Whole numbers ranging from 0 up to 1759 (for DD disks) or 3519 (for HD disks). Note that the base index is zero (for consitency with Amiga specifications and documentation) opposed to the base of one used in R.

Value

Returns a list with corresponding sector, side and cylinder identifiers (numeric).

Details

Data on Amiga floppy disks are stored as 512 byte blocks. These blocks are physically stored on a specific cylinder and side at a specific sector. This method returns the identifiers for the physical location based on the block identifier. The inverse of this function is achieved with the get.blockID method.

See also

Other block.operations: amigaBlock-method, get.blockID()

Author

Pepijn de Vries

Examples

## get the physical location of the first 20 blocks on a DD disk
## and arrange as a data.frame:
as.data.frame(get.diskLocation("DD", 0:19))
#>    sector side cylinder
#> 1       0    0        0
#> 2       1    0        0
#> 3       2    0        0
#> 4       3    0        0
#> 5       4    0        0
#> 6       5    0        0
#> 7       6    0        0
#> 8       7    0        0
#> 9       8    0        0
#> 10      9    0        0
#> 11     10    0        0
#> 12      0    1        0
#> 13      1    1        0
#> 14      2    1        0
#> 15      3    1        0
#> 16      4    1        0
#> 17      5    1        0
#> 18      6    1        0
#> 19      7    1        0
#> 20      8    1        0