These functions help you to create an empty virtual device that can be used
in Commodore Amiga emulation. create_adf_device()
simply creates a file
of the proper size (the file size represents the device capacity) and fills it
with raw
zeros. In order to use the device in the Amiga operating system, a
file system needs to be installed on the device. This can be achieved with
prepare_adf_device()
. Note that the file system itself will also consume
disk space on the virtual device.
Usage
create_adf_device(destination, type = "DD", ..., connect = TRUE)
prepare_adf_device(
dev,
name = "EMPTY",
ffs = TRUE,
international = TRUE,
dircache = FALSE,
bootable = TRUE,
...
)
# S3 method for class 'adf_device'
prepare_adf_device(
dev,
name = "EMPTY",
ffs = TRUE,
international = TRUE,
dircache = FALSE,
bootable = TRUE,
...
)
Arguments
- destination
File path where the virtual device needs to be stored.
- type
Specify the type of virtual device you wish to create. Should be one of
"DD"
(double density floppy disk) or"HD"
(high density floppy disk).- ...
Ignored for
prepare_adf_device()
.- connect
A
logical
value. If set toTRUE
a connection is opened to the newly created virtual device and is returned as aadf_device
class object. If it is set toFALSE
, the file is just created and no connection is opened. In the latter caseNULL
is returned invisibly.- dev
The virtual adf device for which information needs to be obtained. It should be of class
adf_device
which can be created withcreate_adf_device()
orconnect_adf()
.- name
A
character
string specifying the disk name for the volume on the virtual device. It will be truncated automatically when too long.- ffs
A
logical
value indicating which file system to be used. IfTRUE
the 'Fast File System' (FFS) is used, whenFALSE
, the 'Old File System' is used. See alsovignette("file_system_modes")
.- international
A
logical
value indicating whether the international mode should be used for file naming. See alsovignette("file_system_modes")
.- dircache
A
logical
value indicating whether directory caching should be used. See alsovignette("file_system_modes")
.- bootable
A
logical
value indicating whether you want to include executable code on the boot block. If set toTRUE
minimal code will be added to the boot block. In an Amiga emulator, this code will load the Amiga Disk Operating System library and start the Amiga Command line interface (CLI). It will then run the startup sequence file from the disk (if available).If set to
FALSE
no such code is added. In that case the file system will still be accessible by the Amiga operating system (if the file system mode is compatible). You just can't use the disk to start up a (virtual) Amiga machine.
Examples
## Filepath to store the virtual device:
dest <- tempfile(fileext = ".adf")
## Create a blank unformated virtual device (a double density floppy disk):
my_device <- create_adf_device(dest, "DD", connect = TRUE, write_protected = FALSE)
print(my_device)
#> Non-bootable unformatted Floppy DD
## Format the floppy and create a file system on the device:
prepare_adf_device(my_device, name = "foobar")
#> Bootable DOS Floppy DD
#> Volume 0 [fi-]: foobar (0.2%)
print(my_device)
#> Bootable DOS Floppy DD
#> Volume 0 [fi-]: foobar (0.2%)
## don't forget to close the device connection after use:
close(my_device)