# Disc Images

BeebEm emulates two double sided floppy disc drives, know as drive 0 (second side 2) and drive 1 (second side 3). You can load a disc image file into either drive 0 or 1 using the File menu in BeebEm.

Once a disc image is loaded you can use the BASIC interpreter and BBC operating system to access the files in the disc. Some useful disc commands are:

Command | Description
--- | ---
*CAT | List files on the disc
*DRIVE <drive> | Change default drive number (0, 1, 2 or 3)
LOAD "<file>" | Load a BASIC program
CHAIN "<file>" | Load and run a BASIC program
SAVE "<file>" | Save a BASIC program
*DELETE <file> | Delete a file
*RUN <file> | Load and run a binary program
*TITLE <title> | Put a title on the disc
*BUILD <file> | Create a file on the disc containing a set of commands you type in. Press `Escape` to end
*EXEC <file> | Execute the commands contained in a file (created with *BUILD for example)

## Booting Discs

Many disc images that can be downloaded from the Internet have been set up to be "bootable" (i.e., configured to run a particular program). To boot a disc press `Shift` + `F12` (i.e., hold the `Shift` key down and press `F12`). If a disc does not boot it is probably because it has not been set up to be bootable. Non-bootable disc can be accessed using the commands shown above.

If you want to make a disc bootable you will need to create a file called !BOOT containing the commands to execute when the disc is booted. The *BUILD command can be used to create the !BOOT file. The disc image file also needs to be configured to run the !BOOT file when its booted. This can be done by running the command *OPT4,3.

If you want to write data to a disc image (e.g., save a game position) you will need to make sure that Write Protect is switched off on the File → Disc Options menu for the drive you are using. Disc writes will then write data straight back to the image file on your PC disc.

You can find out more information about using discs by reading the DFS (Disc Filing System) guides available on the Internet.

## Modifying Disc Image Files

The BeebEm File menu provides options to create new disc image files. The Edit menu provides options to export and import files from/to a disc image file.

When importing and exporting files BeebEm will look for or create an additional file with a .inf extension to accompany the data file. The .inf file contains load address, execution address and file length information for the data file. The format of the data in the .inf file is:

> <file name> <load address> <execution address> <file length>

The file name must include the DFS directory prefix for the file and it must be 9 characters long. The addresses and length are 6 digit hex numbers, e.g.:

            A.DARE    004000 006691 002700
            $.CHUCKIE 001100 0029AB 002700

## ADFS Discs

If you want to use ADFS discs in the Master 128 mode then load an ADFS disk image (such as the MasterWelcome.adl image in the DiscIms folder) and type *ADFS to mount it. You can also press `A` + `F12` to mount an ADFS disc.

ADFS is also supported in Model B and B Plus modes. Note that in Model B mode you will need to select the Acorn 1770 disc controller and add ADFS-1.30.rom to the ROM configuration.

## FSD Disc Images

BeebEm supports loading FSD format disc images, which can be used for titles that use disc copy protection techniques. BeebEm does not allow you to write to FSD format discs, so these files are always opened read-only. There is more information about the FSD format in Documents\FSDFileFormat.txt. Note that FSD files only work with the 8271 disc controller, so cannot be used with BeebEm's Master 128 emulation.

## Corrupted Disc Images

Some of the disc images you will find on the Internet or that you create yourself will have an invalid catalogue (they contain just enough information for disc reads to work but not writes).

When you write enable a disc BeebEm checks the disc catalogues and it will display a warning message if either are invalid. If you get a warning message then do NOT write to the disc image, as it is possible you will lose data.

To fix an invalid catalogue do the following:

1. Start BeebEm and load the invalid image into drive 1.
2. Create a new disc image file in drive 0.
3. If the invalid image uses a Watford DFS 62 file catalogue then format the new disc image with a 62 file catalogue (you need the Watford DFS ROM installed), type:

                   *ENABLE
                   *FORM80 0

4. Copy all the files from the invalid disc to the new one and set the shift break option and title, type:

                   *COPY 1 0 *.*
                   *OPT4,3
                   *TITLE <title>

The new image will now have a valid catalogue. If you are using double sided images then remember to format and copy both sides (the second sides of disc 0 and 1 are 2 and 3).