Learn R Programming

adfExplorer

adfExplorer can be used to read from and write to virtual Amiga Disks, a.k.a Amiga Disk Files (ADF).

Installation

You can install the development version of adfExplorer from r-universe with:

install.packages("adfExplorer", repos = c("https://pepijn-devries.r-universe.dev", "https://cloud.r-project.org"))

Or install the latest version from CRAN:

install.packages("adfExplorer")

Background

Amiga Disk Files

The Commodore Amiga was a home computer that relied heavily on it’s build-in 3.5 inch floppy disk drive in the late eighties and early nineties. The Amiga was a popular system which nowadays can be accurately emulated on modern machines. A problem with the emulation of the Amiga is that most modern machines no longer have floppy disk drives. And if they do, they are usually physically not able to read Amiga formatted disks. To overcome this problem, the Amiga Disk File (ADF) was created. Such files are a virtual representation of a floppy disks which can be used in emulation.

Legal notes

Emulating the Commodore Amiga hardware is, as far as I can tell, legal. However, the Amiga had its operating system stored on a read only memory chip. Which is commonly referred to as the kickstart. This kickstart software is still protected by copyright law. Licensed copies can be bought legally from AmigaForever. The same is true for much of the Amiga software, which is still protected by copyright.

Note that for analysing ADF files with the adfExplorer package you don’t need the kickstart software. Just make sure the ADF files you use contain data or software for which you own (or don’t need) a licence.

The adfExplorer package

This package will allow you to analyse Amiga Disk Files (ADF) with the R scripting language. It can also be used to transfer files from and to ADF in batches, e.g. for preparing disks for emulation purposes.

The focus will be on the older Amiga operating systems (i.e., OS 3.x and less), as I am most familiar with those systems. In newer versions floppy disks became less important anyway. Note that this package cannot read extended ADF files containing information on the disk’s Modified Frequency Modulation (MFM). This information is typically only required for copy protected disks and is therefore out of the scope of this package.

Example

library(adfExplorer)
#> 
#> Attaching package: 'adfExplorer'
#> The following objects are masked from 'package:base':
#> 
#>     readBin, readLines, writeBin, writeLines

## First setup a connection to a virtual device
adz_file <- system.file("example.adz", package = "adfExplorer")
my_device <- connect_adf(adz_file)

## Open a connection to a file on the virtual device
fcon <- adf_file_con(my_device, "DF0:s/startup-sequence")

## Read from the file
my_startup <- readLines(fcon, warn = FALSE)

## Close the file
close(fcon)

## Close the virtual device
close(my_device)

Acknowledgements

The adfExplorer package is an R interface around the ADFlib library. The package would not have been possible without the work of Laurent Clévy, Tomasz Wolak and many other contributors of ADFlib.

Code of Conduct

Please note that the adfExplorer project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('adfExplorer')

Monthly Downloads

424

Version

2.0.3

License

GPL (>= 3)

Maintainer

Pepijn de Vries

Last Published

January 10th, 2025

Functions in adfExplorer (2.0.3)

adf_entry_name<-

Obtain or modify an entry name on a virtual device
adf_entry_info

Retrieve information from entry headers on virtual ADF devices
adf_directory

Changing and creating directories on a virtual device
connect_adf

Create a connection to a virtual disk
create_adf_device

Create and format a virtual ADF device
demo_adf

Connect with a demonstration ADF file
amigaDateToRaw

Deprecated functions
device_type

Obtain information about an adf_device connection
format.adf_device

Basic methods for S3 class objects
adf_file_con

Open a connection to a file on a virtual ADF device
adf_file_exists

Test if an entry exists on a virtual device
virtual_path

A path pointing to a file or directory on a virtual ADF device
list_adf_entries

List entries in a directory of a virtual ADF device
adfExplorer-package

adfExplorer: Access and Manipulate Amiga Disk Files
close_all_devices

Close all virtual devices
read_adf_block

Read or write raw data blocks to a virtual device
compress_adf

Compress ADF to ADZ files and vice versa
copy_adf_entry

Copy or move files between physical and virtual devices
readBin

Transfer binary data to and from connections
remove_adf_entry

Remove entry (file / directory) from a virtual ADF device