Loading/saving from .TAP and .TZX files

(TapeIO screenshot)

TapeIO

The TapeIO package is an optional package that you can install on ResiDOS which gives you the ability to load and save directly to .TAP and .TZX files on your flash card or hard disk as if it was a real tape. This means that you can take advantage of the thousands of .TAP and .TZX emulator files available and use them with your Spectrum

The most important commands to use are %TAPEIN and %TAPEOUT. Each of these takes the name of a .TAP or .TZX file. Thereafter, and standard LOAD commands that would normally access the tape will be redirected to whichever .TAP/.TZX file you specified in the %TAPEIN command. Similarly, any standard SAVE commands that would normally access the tape will be redirected to the .TAP/.TZX file specified in the %TAPEOUT command. In order to redirect access to tape, simply use the %TAPEIN or %TAPEOUT command without a filename.

For example, to load up Jetpac from a jetpac.tap file, use the following commands:

To create a .TZX file containing your latest masterpiece, so that it can be loaded by an emulator, use commands such as:


Controlling the tapepointer

Some more useful commands that are available are %TAPELIST and %TAPEWIND.

The first of these lists out the contents of the current .TAP/.TZX file being used for input (ie the last one specified in a %TAPEIN command). It also shows which is the next block that will be LOADed, with a cursor (similar to the cursor in a BASIC program listing).

With the %TAPEWIND command, you can "wind" the tape pointer forwards (using a positive number) or backwards (using a negative number) by a number of blocks, or to a specific block number (using the "=" option). If you do not specify any number, then the input tapefile will be rewound to the start.

For example, use the following commands to wind the tape in different ways and see the result on the tapelisting:

Finally, you can also change the behaviour when the last file is loaded from the input .TAP/.TZX file. Normally, when this happens the tapefile is "ejected" and subsequent LOAD commands use the real tape again, until another %TAPEIN command is used. However, if you would prefer the tapefile to be "rewound" to the start, then use the following command:

To revert to the default behaviour (ejecting the tapefile), use:


Transferring files between disk and .TAP/.TZX files

It's also easy to transfer files from within .TAP and .TZX files to separate files on your flash card or hard disk. There are commands available to transfer files with headers (%TAPEGET and %TAPEPUT) and also headerless files (%TAPEBGET and %TAPEBPUT). For details, see the full command reference below.


Troubleshooting

All .TAP files should work correctly with ResiDOS, as well as some .TZX files which use the standard Spectrum loading system. However, any .TZX files using speedloading or other custom loaders will not work. If a game appears to stop loading from a .TZX file, then it is likely to have a custom loader. Using the %TAPELIST command on such a file should show which blocks ResiDOS can "see" and help to show if it is a non-standard loader program.

If a CODE file which might overwrite the ROM area or the stack is encountered, then TapeIO will load this byte-by-byte in "slow" mode, to ensure that ResiDOS data is not corrupted. In such cases, the border will flash multicoloured during loading.

If you have a 128K Spectrum and find a game that fails to load, please try again after selecting 48K mode (with the %SPECTRUM command). Many games will only load in 48K mode by design (and would have included instructions on the cassette inlay to switch to 48K mode before loading).


TapeIO Command Reference

Here is a complete list of all the commands supported by the TapeIO package, including several options and variants that aren't described above. Please read carefully to get the most out of this package.

%TAPEIN "filename"
Redirect all tape LOAD commands to use the .TAP or .TZX file specified.
%TAPEIN
Redirect all tape LOAD commands back to physical tape.
%TAPEOUT "filename"
Create a new .TAP or .TZX file, and redirect all tape SAVE commands to it.
%TAPEOUT+ "filename"
Open an existing .TAP or .TZX file, and redirect all tape SAVE commands to it (appending to the end of the file).
%TAPEOUT
Redirect all tape SAVE commands back to physical tape.
%TAPELIST
List the contents of the current input tapefile.
%TAPELIST #n
List the contents of the current input tapefile to stream "n".
%TAPEWIND n
Wind the tapepointer by "n" blocks (positive is forwards, negative is backwards).
%TAPEWIND=n
Wind the tapepointer to block number "n".
%TAPEWIND
Rewind the tapepointer to the start of the tapefile.
%TAPEGET "diskname"
Copy the next file with a header from the input tapefile onto disk, using the specified name for the disk file.
%TAPEGET
Copy all files with a header from the input tapefile onto disk, translating names to fit in the 8.3 name format.
%TAPEBGET "diskname"
Copy the next block (could be a header or data block) from the input tapefile onto disk, using the specified name for the disk file.
%TAPEBGET+ "diskname"
Copy the next block (could be a header or data block) from the input tapefile onto disk, using the specified name for the disk file. Copy the entire block, including the block type and parity byte (which are normally stripped out).
%TAPEPUT "diskname"
Copy a disk file into the current output tapefile, complete with an appropriate header.
%TAPEBPUT "diskname"
Copy a disk file into the current output tapefile as a headerless block (of type 255).
%TAPEBPUT "diskname", n
Copy a disk file into the current output tapefile as a headerless block (of type "n").
%TAPEBPUT- "diskname"
Copy a disk file into the current output tapefile as a headerless block, but don't add a type byte or parity byte.
%TAPEMODE n
Set the behaviour for what happens when the end of the input tapefile is reached (0=eject, 1=rewind).
%TAPEMODE+ n
Set the behaviour for what happens when the end of the input tapefile is reached (0=eject, 1=rewind). Make this behaviour permanent.
%TAPEMODE- n
Set the behaviour for what happens when the end of the input tapefile is reached (0=eject, 1=rewind). Remove any permanent behaviour.

Back to the ResiDOS home page