<?php
	$title = "File Transfer and Conversion";
	include("pre.php3");
?>

by <A HREF="mailto:deweger@cs.utwente.nl">Mark de Weger</A>. (Note: external links don't work - yet!)

<P>If you wish to transfer the BBC programs found on these pages to your BBC,
or if you wish to transfer files from your BBC disks to your PC in order to
run them using an emulator, you have only two problems:</P>

<MENU>
<LI><A HREF="#transfer">Transferring the files between your PC and your BBC</A>;
<LI><A HREF="#convert">Converting the format of the BBC files on the PC 
to the format supported by the emulator you use.</A>
</MENU>

<P>This page helps you deal with both problems.

<HR><A NAME="transfer">
<H2>Transferring files between a BBC and a PC</H2>

In order to transfer files between your BBC and your PC you basically have
four options:

<MENU>
<LI><A HREF="#native">Read and write BBC and PC disks on a computer that natively
supports both disk formats</A>;
<LI><A HREF="#pcread">Use a special program on your PC that can read and write BBC
disks</A>;
<LI><A HREF="#bbcread">Use a special program on your BBC that can read and write PC
disks</A>;
<LI><A HREF="#serial">Transfer files between BBC and PC via a serial cable</A>.
</MENU>

<A NAME="native">
<H3>Read and write BBC and PC disks on a computer that supports both disk formats</H3>

<P>Some computers have the ability to read and write both BBC disks and PC disks
natively (software built-in in the OS), or with some some simple additional software. 
Computers I know of that have this ability are the BBC Master with a PC board, the
Acorn Archimedes with a PC board, and the RiscPC.

<P>I can provide little information on how to transfer files, as I don't have any of
these computers. However, if you have such a computer, you probably already know how to
read/write BBC and PC disks, and if you don't, the information is of little use to
you.</P>

<A NAME="pcread">
<H3>PC programs that can read and write BBC disks</H3>

<P>The following programs can read and/or write BBC disks:</P>

<MENU>
<LI><A HREF="">BeebDos</A>
<LI><A HREF="">FDC</A>
<LI><A HREF="">Anadisk</A>
</MENU>

<P>All of these programs are subject to the following limitations:</P>

<MENU>
<LI>There are <b>very few</b> PCs that can actually read and write single density
disks (e.g. standard Acorn DFS disks), due to the fact hardly any PC's floppy drive
controller supports single density.
<LI>The number of PCs that can read double density disks using these programs is
<b>also small</b>. (Probably again due to their floppy drive controllers.)
</MENU>

<P>Therefore: try the programs, but if they don't work for you, please don't mail me.
(I tried the programs on at least 10 different PCs and they didn't work a single
time.)</P>

<P><A HREF="">BeebDos</A> is a program to read double density BBC disks on a PC.
It was once sold commercially. I have, however, no idea of its current status. Some
instructuctions are included in the BeebDos package</P>

<P><A HREF="">FDC</A> is another program to read double density BBC disks on a
PC. It was written by <A HREF="">Wouter Scholten</A>. It is an improved version of <A
HREF="">FDCDemo</A>, a program for reading and writing uncommon disk formats. 
Instructions are included in the FDC package.

<P><A HREF="">Anadisk</A> is a program similar to FDC. I suggest you use FDC, as
there are less commands to type in, but you may try any of them. General instructions
are included in the Anadisk package. In order to read (double density) BBC disks using
Anadisk, you have to enter the following commands:

<MENU>
<LI>If the BBC floppy is in a 1.2M (5 1/4 inch) drive:
<OL>
<LI><i>DDINHD</i>, <i>CYL 80</i> (if this doesn't work,
try it without the DDINHD command)
<LI>if the floppy is double density, <i>DD</i>, <i>SECTORS 18</i>
<LI> if the floppy is 40 tracks, <i>DOUBLESTEP</i>
<LI> if the floppy drive is drive A:, <i>FD0</i>
</OL>
<LI>If the BBC floppy is in a 720K (5 1/4 inch) drive:
<OL>
<LI><i>CYL 80</i>
<LI>if the floppy is double density, <i>DD</i>, <i>SECTORS 18</i>
<LI> if the floppy is 40 tracks, <i>DOUBLESTEP</i>
<LI> if the floppy drive is drive A:, <i>FD0</i>
</OL>
<LI>If the BBC floppy is in a 1.44M (3 1/2 inch) drive
<OL>
<LI><i>CYL 80</i> (on first try do NOT use the DDINHD
command)
<LI>if the floppy is double density, <i>DD</i>, <i>SECTORS 18</i>
<LI> if the floppy drive is drive A:, <i>FD0</i>
</OL>
</MENU>

<A NAME="bbcread">
<H3>BBC programs that can read and write PC disks</H3>

<P>There is a program, <A HREF="">DOSFs</A>, that can read and write PC disks on a
BBC. It is subject to the following limitations:</P>

<MENU>
<LI>It can only read/write 360K formatted floppies;
<LI>Your BBC needs to have a 1770 or 1772 disk controller and sideways RAM. Your BBC
disk drive needs to be able to read disks formatted at 40 tracks.
</MENU>

<P>Some instructions are included in the DOSFs package</P>

<A NAME="serial">
<H3>Transfer files between a BBC and a PC via a serial cable</H3>

<P>By connecting a BBC and a PC with a serial cable, you can transfer files from the
BBC to the PC and vice versa. You can use programs like Kermit or Commstar to transfer
the files. If you do so, one problem is that the BBC's file attributes do not get
transferred.

<P><A HREF="">BBCXFer</A> is a program that was specially written for BBC <-> PC file
transfer that does transfer the BBC's file attributes. (It makes use of Wouter
Scholten's <A HREF="std-format.php3">standard format for storing BBC files on other
computers</A>.) In addition it contains a terminal emulator that allows you to control
your BBC from your PC. Instructions for use are included in the BBCXFer package. The
package also contains instructions for making a serial cable and a lengthy explanation
of the standard format.

<P>(Note: The above BBCXFer is by Mark de Weger. There's also a BBCXFer by Tom Seddon,
which is a little less advanced. Mark was so stupid to chose the same name for his
program as Tom did.)</P>

<HR><A NAME="convert">
<H2>Converting BBC file formats on a PC</H2>

<P>After transferring your BBC files to a PC, they are in either of the following
formats:</P>

<MENU>
<LI>Wouter Scholten's <A HREF="std-format.php3">standard format for storing BBC files on
other computers</A> (if you used BBCXFer);
<LI>An image of a BBC disk (if you used one of the disk utilities). The following disk
image formats can be distinguished:
<MENU>
<LI>Single sided, single density
<LI>Single sided, double density
<LI>Double sided, single density
<LI>Double sided, double density
</MENU>
</MENU>

<P>The three current BBC emulators for the PC also use different formats:</P>

<MENU>
<LI><A HREF="">Model-B</A> uses a proprietory disk image format (different from any of
the above);</A>
<LI><A HREF="">BeebEm</A> uses the above disk image format (single sided, single
density or double sided, single density);
<LI><A HREF="">XBeeb</A> uses a format similar to (but not exactly the same as) Wouter
Scholten's standard format.
</MENU>

<P>This section deals with conversion between the different formats. We use
Wouter Scholten's
<A HREF="std-format.php3">standard format</A> as the basis; it is
explained how each format can be translated to and from this standard format (though
some other conversions are explained as well). </P>

<P>The following conversion issues are dealt with:

<MENU>
<LI><A HREF="#diskim">Manipulation of disk images</A>
<LI><A HREF="#sform">Conversion of disk images to and from the standard format</A>
<LI><A HREF="#xbeeb">Conversion to and from XBeeb format</A>
<LI><A HREF="#modelb">Conversion to and from Model-B format</A>
<LI><A HREF="#beebem">Using disk images with BeebEm</A>
</MENU>

<A NAME="diskim">
<H3>Manipulation of disk images</H3>

<P>The utility <A HREF="">BBCIm</A> can be used to manipulate disk images. Instructions
are included in the package, but the main disk manipulation commands are:</P>

<MENU>
<LI><i>BBCIm -inters &ltdiskimage1&gt &ltdiskimage2&gt &ltdiskimage3&gt</i>: makes an
interleaved (double-sided) disk image (&ltdiskimage3&gt) out of two single-sided disk
images (&ltdiskimage1&gt and &ltdiskimage2&gt);
<LI><i>BBCIm -splits &ltdiskimage&gt</i>: makes two single-sided disk images out of one
double-sided disk image (&ltdiskimage&gt);
<LI><i>BBCIm -ddos2dfs &ltdiskimage&gt</i>: splits a single-sided double-density
DDOS disk
image (&ltdiskimage&gt) into multiple single-sided single-density disk images.
</MENU>

<P>Note: you first need to convert your disk images to single-sided single-density
images in order for most BBCIm commands to work.</P>

<P>Other BBCIm commands related to manipulation of disk images:
<MENU>
<LI><i>BBCIm -new &ltdiskimage&gt</i>: makes new (empty) disk image;
<LI><i>BBCIm -40 &ltdiskimage&gt</i>, <i>BBCIm -80
&ltdiskimage&gt</i>, and <i>BBCIm -max &ltdiskimage&gt</i>: expand disk image to
 resp. 40 tracks disks, 80 tracks disks and 256K;
<LI><i>BBCIm -min &ltdiskimage&gt</i>: compresses disk image (similar to *COMPACT and
then cutting off disk image after last used sector);
<LI><i>BBCIm -c &ltdiskimage&gt</i>: shows a catalogue of disk image;
<LI><i>BBCIm -d &ltdiskimage&gt &ltfile&gt</i>: 
deletes file &ltfile&gt from disk image (wildcards not allowed in &ltfile&gt;
&ltfile&gt is case sensitive).
</MENU>

</P>

<A NAME="sform">
<H3>Conversion of disk images to and from the standard format</H3>

<P><A HREF="">BBCIm</A> also has commands to convert (single-sided, single-density)
disk images to and from files in the standard format.</P>

<P>First the conversion from standard format to disk image format:</P>

<MENU>
<LI><i>BBCIm -a &ltdiskimage&gt &ltfilelist&gt</i>: add the files in
standard format whose names are in &ltfilelist&gt to the disk image.
If you use DOS or Windows, wildcards cannot be used in &ltfilelist&gt. 
If you use Linux, you can also use wildcards.
If you use the option <i>-ar</i> instead of <i>-a</i>, the files that are added to the
disk image are deleted. (The command automatically skips the .INF files.)
</MENU>

<P>Then the conversion from disk image format to standard format:</P>
<MENU>
<LI><i>BBCIm -ebi &ltdiskimage&gt</i>: extracts all files from the disk image and stores
them in standard format in the current directory. In addition it produces a catalogue
file &ltdiskimage&gt.CAT, which you can remove.
</MENU>

<P>BBCIm has a number of other options for extraction of files. (These are not needed
if you are just interested in conversion to the standard format.)<BR>
The basic command for
extraction of files from a disk image is <i>BBCIm -e &ltdiskimage&gt</i>. This extracts
files from the diskimage; a file gets the name &ltdiskimage&gt.&ltdir&gt.&ltfile&gt,
 where
&ltfile&gt is the file name of the file and &ltdir&gt the directory the file is in (e.g. 
diskimage.$.ELITE). It also produces the catalogue file.
<BR>
Other options can be obtained by adding the following characters to the <i>-e</i>
option (e.g. <i>-ed#</i>):
<MENU>
<LI><i>d</i> or <i>b</i>:<BR>
<i>d</i>: makes files to be extracted in the directory
&ltdiskimage&gt instead of prepending the name of the disk image to the files
 (e.g. diskimage/$.ELITE for the above example),<BR>
<i>b</i>: makes files to be extracted in the current directory (e.g.
$.ELITE for the above example);
<LI><i>#</i>: does not prepend the directory name $ to a file name and prepends all other
directory names to the file names without a dot (e.g. ELITE for the above example, or
RELITE for a file R.ELITE). If a name clash occurs, you get the option of renaming or
overwriting an already existing file. (The option <i>#</i> is handy for use with DOS, as
e.g. R.ELITE is not a valid DOS file name.)
<LI><i>i</i>: produces the .INF files required for the standard format;
<LI><i>r</i>: removes the disk image after extracting files.
</MENU>

<A NAME="xbeeb">
<H3>Conversion to and from XBeeb format</H3>

<P>The format used by XBeeb is very similar to the standard format: instead of using
.INF file for each BBC file to store the file's attributes, it uses a single catalogue
file to store the attributes of all files in a directory (an XBeeb "disk"). Such a
catalogue is already produced by BBCIm if you use it with the option -e.</P>

<P>Therefore you can convert a disk image to XBeeb format using the command:
<MENU>
<LI><i>BBCIm -eb &ltdiskimage&gt</i>. You
only have to manually rename the catalogue file &ltdiskimage&gt.CAT that BBCIm produces
to the file name required by XBeeb for its catalogue file.
</MENU>

<P>The conversion of XBeeb format to standard format requires the splitting of the
XBeeb catalogue file into multiple .INF files. This is done using the command:
<MENU>
<LI><i>BBCIm -s &ltcataloguefile&gt</i>.<BR>
The option <i>-s</i> can be replaced by <i>-s#</i>, which (similar to <i>-e#</I>)
removes the directory name $ from a file name and replaces all other file names
&ltdir&gt.&ltfilename&gt by &ltdir&gt&ltfilename&gt.
</MENU>

<P>The conversion of standard format to XBeeb format requires the concatenation of the
multiple .INF files into a single catalogue file (and some minor modifications to
this file). This is done using the command:
<MENU>
<LI><i>BBCIm -x &ltfilelist&gt</i>, where &ltfilelist&gt is the list of files
whose attributes should be put in the XBeeb catalogue file. (Wildcards not allowed
in &ltfilelist&gt with DOS/Windows.)
</MENU>

<A NAME="modelb">
<H3>Conversion to and from Model-B format</H3>

<P>Tom Seddon's BBC emulator <A HREF="">Model-B</A> uses a proprietary disk image
format (different from the above mentioned disk image formats), which is called DFFS.
No utilities currently exist for conversion from the DFFS format to other formats.
However, Tom wrote a number of utilities to convert files and disks to the DFFS format.
These are, with instructions, included in the Model-B package. The utilities:

<MENU>
<LI>WSConv to convert files in the standard format to DFFS format. <i>WSConv
&ltdffsdisk&gt</i> adds all files in the current directory in standard format to the
DFFS disk image &ltdffsdisk&gt. (If the DFFS disk image does not exist yet, it is
created.)
<LI>DConv to convert normal single-density disk images to DFFS disk images. 
<i>DConv &ltdfsdisk&gt &ltdffsdisk&gt &ltside&gt</i> converts
the DFS disk image &ltdfsdisk&gt to the DFFS disk image &ltdffsdisk&gt. &ltside&gt
should be:
<MENU>
<LI><i>S</i> for a single-sided disk image;
<LI><i>D0</i> for side 1 of a double-sided disk image;
<LI><i>D1</i> for side 2 of a double-sided disk image.
</MENU>
<LI>DDOSConv to convert normal double-density Opus DDOS disk images into several DFFS
disk images. <i>DDOSConv &ltddosdisk&gt</i> convert the 80-track double-sided
double-density DDOS disk image  &ltddosdisk&gt into several DFFS images. The DFFS disk
images have the same base name as the DDOS disk image, with the extension
&ltside&gt&ltvolume&gt, where &ltside&gt is the side number and
&ltvolume&gt the volume number on the DDOS disk image.
<LI>MkImg to create a new, empty, DFFS image. <i>MkImg &ltdffsdisk&gt</i> creates the
new DFFS disk image &ltdffsdisk&gt.
</MENU>

<A NAME="beebem">
<H3>Using disk images with BeebEm</H3>

<P>The emulator <A HREF="">BeebEm</A> uses normal single-density DFS disk images. As
standard it uses the single-sided 80-track disk image "beebfile/elite" as the mounted disk. You
can change this, however, by setting the environment variable BeebDiscLoad. This should
have the syntax &ltsides&gt:&lttracks&gt:&ltdiskimage&gt, where:
<MENU>
<LI>&ltsides&gt is <i>S</i>
for single-sided disk images and <i>D</i> for double-sided disk images;
<LI>&lttracks&gt is
<i>40</i> for 40-track disk images and <i>80</i> for 80-track disk images;
<LI>&ltdiskimage&gt is the name of the disk image.
</MENU>

<P>In order to simplify the job of setting the value of BeebDiscLoad, you can write 
batch files like the one below:
<PRE>
@echo off
SET BeebDiscLoad=S:80:%1
BeebWin
</PRE>

<P>If you call the batch file SSD.BAT, the command <i>SSD &ltdiskimage&gt</i> will
start BeebEm with the 80-track single-sided disk image &ltdiskimage&gt mounted. You
could make additional batch files for double-sided disk images or 40-track images.</P>

<H3><A NAME="extwatford">Extracting from Watford disk images</H3>

Included in the bbcim archive si the C code for a small utility called w62.  Given the file name (say "watford.ssd") of a single-sided Watford disk image as its parameter, it produces a file called "watford.ssd%" which looks like a DFS image with the extra 31 files of the Wtaford image.  By using bbcim to extract the two images, the net result is an extraction of all the 62-files from the Watford image.

<?php include("post.php3") ?>


