Z-Tape
WORDMONGERS LIMITED
Tape streamer software for the Z88
Introduction
The Wordmongers Z-Tape program is designed to provide general data backup opportunities for the Z88 with a cassette recorder. In addition, the software includes a routine which will run a machine code program from RAM.
Important basic concepts
Saving data
Saving data to a tape involves a number of processes. Firstly, the data, which are a series of 0's and 1's, are grouped together in pre-determined block sizes. The blocks are then converted to on/off pulses and sent through the serial port to the cassette tape. These pulses can be heard as a series of squelches.
Two elements are crucial to the proper transmission and receipt of the noises and both are related to timings. The data sent out from the Z88 goes at a set speed which must remain constant when the data are read back. For this reason the health of the power supply to the tape recorder is of utmost importance. If batteries are used, they should be checked regularly. Whenever possible, a mains supply should be used.
Equally important is the quality of the tape in use. The recommended tape is a C30 with 15 minutes on each side, or a smaller tape. Larger tape may stretch and distort. The C30 tape is sufficiently robust not to stretch too much in use. Thus the apparent speed of the data on the tape is less likely to distort.
Although tape cassettes are much less expensive now than in the past, very cheap tapes should be avoided.
As with all backup systems, any vital data should be stored at least twice.
Z88 Filer
The Z88 FILER popdown is the internal route to file handling on the Z88. In order to keep things consistent, the FILER system has been emulated as closely as possible in Z-Tape. Therefore, files can be listed and marked in a fashion similar to the filer. However, some differences exist between FILER and Z-Tape.
Backup Facility
Because Z-Tape is designed as a backup facility, any saving to tape is done as a complete operation including a catalogue of the files saved. Individual files should not be added to an existing backup tape. Any save operation is a one off event for a tape. Incremental saving is not recommended.
For this reason, any saving is done by file name or group of files. Files to be saved in any one save can be marked as in the FILER or selected on the basis of wild cards such as *. See SAVE TO TAPE, below.
By careful management of a tape, a second set of files may be saved to a tape with its own catalogue. However, it is then up to the operator to ensure that the rewind brings the tape to the correct position when doing anything which involves the catalogue section. This is not recommended.
Unlike saving to disk on a PC, saving a file to tape is a one way process. The Z88 sends the data out of the serial port and has no way of knowing whether the data has landed safely, if at all. Therefore the verify option is an important routine which should be used whenever a set of files is saved.
If the verify routine is not tried, the first indication of damage will appear when that file is loaded back to the Z88.
Quick Start Guide
The Quick Start Guide is designed to be a brief exposure to the save and load facilities of Z-Tape. It is not comprehensive and is no substitute for the rest of this manual.
QSG 1
With the INDEX on display on the Z88, open the clear perspex cover labelled '1 2 3', and insert the Z-Tape application ROM in slot 3. Close the perspex cover. (For details of other options about how to position ROMs see Appendix 2).
Move the cursor bar up and down on the APPLICATIONS INDEX until it is highlighting the Z-Tape application.
Press ENTER
to run Z-Tape.
QSG 2
The screen will display the Z-Tape front screen with a Wordmongers copyright message in the screen window on the right.
Connect the Z88 to the cassette recorder using the cable supplied. Of the two JACK plugs one will be plastic (or a BLACK plastic), and the other one metal (or RED plastic). The Metal (or RED plastic) one is for the Mic socket. i.e. M for M.
QSG 3
Select a file for saving to tape by moving the cursor bar to any one of the files whose name is displayed on the central directory window. With the selected file highlighted, press ENTER
. A small mark will appear next to that file.
Also note that the right hand window will now display a value for the number of bytes in the file marked, and the size of tape required to hold the marked file.
QSG 4
having selected a file, press ◇
C
S
This will initiate a 'SAVE TO CASSETTE'.
An instruction will appear on screen saying that the tape recorder should be switched on with the RECORD button depressed. When this has been done, press any key to commence the saving of the file to the tape.
Press ESC
if you need to abandon the save.
QSG 5
When the save is complete, stop the tape and rewind. From the Z-Tape menu press the command to verify, ◇
C
V
A prompt will ask for the file name to be verified. Press *
ENTER
then start the tape.
QSG 6
Now to LOADING a file or FETCH FROM TAPE. Insert the tape with the required file into the cassette recorder and ensure that it is fully re-wound.
QSG 7
Press ◇
C
F
to initiate a Fetch from Cassette.
The prompt will appear asking for the name of the file to be loaded (fetched from tape). Press *
ENTER
and rewind the tape.
Start the tape, without the record button depressed this time. A filename and counter will appear on the screen as the file is received. As soon as the required file or files are received, the Z-Tape menu will return.
QSG 8
All that remains is for the retrieved files to be examined.
QSG 9
Press ESC
to kill the Z-Tape application and return to the Z88 INDEX.
Alternatively, selecting INDEX
or any Z88 popdown or Application will exit Z-Tape. Since Z-Tape is itself a popdown, it will not be left as a suspended application.
The Menu
Z-Tape operates in a similar fashion to existing Z88 popdowns. It can be called from the Applications INDEX by highlighting it with the cursor, or by entering □
J
at the keyboard. In either case the commands menu will contain the options available.
The commands are:
| CATALOGUE TAPE |
| SAVE TO TAPE |
| FETCH FROM TAPE |
| VERIFY TAPE FILES |
| SELECT DEVICE |
| SELECT DIRECTORY |
| RUN CODE FILE |
| ESCAPE (not displayed) |
The following sections deal with each option in turn.
When Z-Tape is invoked, the Commands will appear on the left, as usual, with the file names of the default device and directory in the middle window, just as in the FILER.
Marking Files
Equally, as in FILER, files may be marked for bulk operation. So, for example, the cursor can be moved around the file list and the files marked using the ENTER
key, the SHIFT
+ENTER
combination or the TAB
key. Subsequent save commands will then operate on the marked file(s).
Selecting an option
Any option in Z-Tape may be selected by any of the usual Z88 methods, namely
its diamond (
◇
) sequence,by highlighting the command on the commands list or
by highlighting the selected option in the menu, obtained by pressing the
MENU
key.
HELP
The internal Z88 help system has been implemented in that each menu option has some help text assigned to it. To see the specific help text attached to an option, press the MENU
key and highlight the option for which help is required. With that option under the cursor bar, press the HELP
key and a screen of text will appear.
ESC
returns to the Z-Tape front screen. The cursor keys will display other help screens.
Device & Directory scrolling
When the Z-Tape COMMANDS MENU is on screen, the files displayed will be those contained in the currently selected device and directory. The diamond commands to change these settings are described below. However, there is a shorthand method of moving between devices and directories.
To scroll round the devices, use ◇
↑
and ◇
↓
. All 4 devices from RAM.0 to RAM.3 can be displayed, WHETHER OR NOT THEY EXIST. Obviously, if RAM.3 is selected its directory will show as blank. If any attempt is made to fetch files from tape onto a non-existent RAM, an error message will appear and no harm will be done.
To go into a sub-directory, highlight that sub-directory name and use SHIFT
+↓
. To return to a higher level directory, use SHIFT
+↑
Commands
Catalogue Cassette (Tape) - ◇
C
C
This utility reads in the header block from a tape and lists the files available on that tape. This speedy cataloguing system explains why all saves to the tape must occur at the same time. The catalogue header block cannot be changed dynamically and so cannot cope with the addition of files to an existing tape.
When the saving takes place, the catalogue is created and stored as the first block on the tape. This header is then easily and quickly available for viewing.
The catalogue will appear on screen in the order in which the files are stored on the tape.
When the single file load, or load next file choices are used, the software makes no reference to the tape catalogue. The software simply recognises the start of a file by referring to header information at the start of each block. i.e. the tape does not have to be completely re-wound at every operation. Having said that, it certainly must be re-wound right to the beginning if the Catalogue choice is selected.
On selecting this option, the whole Z88 screen will clear and the screen will be split into two halves, left and right. The left half will display FILE information and the right half will display BLOCK information. So on the left will appear the words: "Awaiting catalogue" and "WAITING".
On the right:
"Awaiting block :0"
"Found block"
After the tape has been started and has run past the leader, the catalogue block(s) will be loaded to the Z88 and displayed. As soon as the catalogue of files is displayed, the tape may be stopped and
rewound.
Cassette Save (Save to Tape) - ◇
C
S
All files to be saved to tape in a single operation MUST BE on a single directory.
Marking the files
The primary method for selecting files for saving is to use the cursor to move round the file names list and mark each file in turn. The first file is marked by pressing ENTER
or TAB
. Subsequent files are marked by using the SHIFT
+ENTER
combination or the TAB
key.
As each file is marked, two indicators are recalculated and displayed in the right hand window. The first counter is a byte total for the files marked. The second counter is an estimate of the size of tape required for the files marked. e.g. C30 indicates a need for one side of a C30 tape.
With a set of files marked in this way, the SAVE TO TAPE option can be selected by entering the ◇
C
S
command, or by moving the cursor bar to the 'SAVE TO TAPE' option on the commands list.
Wild Cards
An alternative way of saving involves the use of file names. If no files are marked, as described above, the SAVE TO TAPE function may be called using the sequence or by pressing the MENU
key and moving the cursor to the required option.
This time a prompt will appear requesting a file name. This can be a single file or a series of files linked by a wild card.
e.g. valid entries would be:
FRED.DOC ENTER
PHONE. DBF ENTER
PHONE.* ENTER
STOCK??.DBE ENTER
Any of the above lines would be permissible. However, only one of them is possible for any one save operation.
No file path may be specified. Files may only be saved from the currently logged device and directory.
In this case, the byte counter and tape indicator will be displayed before the 'START TAPE' prompt appears.
After selecting files by one of the above methods, the instruction will appear to start tape. The tape should be set to RECORD with the cable connected.
When the tape is running, press SPACE to commence the save operation.
The screen will be split into two with static information and file information appearing on the left, and Block information appearing on the right.
The static information will show the number of blocks to be saved, the estimate of the tape required and the number of files left to be saved. This third item will count down as the files are saved to tape.
On the right hand side, blocks information will appear showing the block number currently being saved.
When the file(s) have been sent, the Z-Tape menu will return.
Whenever a save occurs to tape, that tape is overwritten. Incremental saves are not recommended, i.e. a single file should not be added to a tape at the end.
(See "Saving Data" section above.)
Cassette Fetch (Tape) - ◇
C
F
All files collected from Tape will be downloaded or fetched onto the currently selected device and directory.
On selection of this choice, a prompt will appear asking for the name of the file to be fetched from tape. (Compare this with the ◇
E
F
FILER command for fetching files from EPROM.)
At this prompt three possible entries may be made. They are Select files for loading
LOAD ALL
LOAD ONE
LOAD NEXT
LOAD ALL
To specify ALL files the necessary response is
Name of file to fetch ENTER
This behaves just like the normal wild card and means all files in the catalogue will be fetched from the tape to the Z88.
This choice reads the catalogue header block stored on the tape and loads all the files listed on that catalogue on to the currently selected Z88 device and directory. The file names as saved to tape are preserved so if a file exists on the Z88 with the same name, the Z88 file will be over written by the tape version.
If space is available and such over writing is to be avoided, there are two possible routes to be followed.
Firstly, a catalogue of the tape could be obtained (see above ◇
C
F
) and examined for duplicate file names. Alternatively, a new clean sub-directory could be set up to take the files from tape and any duplicated files could be compared after the download is complete.
LOAD ONE
To specify a single file to be brought from tape, the file name must be entered here in exactly the same form as it was stored. i.e. file name only without any device or directory name.
This choice provides for a single file to be fetched from the tape. It will be stored under the currently selected device and directory.
In this instance, the catalogue is not examined at all. The software will start at wherever the tape is and will read whatever comes from the tape until the header block for the required file is encountered. At that point the downloading will commence until that single file is collected. The 'STOP TAPE' message will then appear.
LOAD NEXT
Enter a !
(exclamation mark) at the file name prompt. A choice reminiscent of the LOAD ""
on Sinclair Spectrums. The first file found by the software will be restored to the Z88. If the tape is left at an intermediate point in the middle of a file the download will begin at the start of the next file.
Execute the fetch
After specifying the files to be read onto the Z88, the screen will split onto two halves. The left will show the number of files to be retrieved from the tape with the name of the first file expected. If the * or ! options are used, a series of ?'s will appear. The word WAITING will also be there.
On the right hand side of the screen, two lines will appear saying
"Awaiting block :?"
"Found block :"
As data is recognised coming from the tape, the blanks and the ?'s will be replaced with real information related to file names and block numbers.
As usual, the ESC
key may be used to cancel the operation.
The file will be loaded a block at a time. As each block is fetched from the tape, its checksum will be verified. If a checksum does not match, an error message will be displayed. The tape should be stopped and rewound a bit, then re-started. The software will have kept a note of the block which did not verify and will ignore blocks before that one.
The software also keeps track of which block it should load next. If it finds a block after the one it is looking for it displays a message asking for the cassette to be rewound.
After completion, the Z-Tape Commands Menu will return with the default directory displayed.
Cassette Verify (File) - ◇
C
F
This option will appear very much like the FETCH FROM TAPE option in that a prompt will appear asking for the name of the file to be verified. The same symbols may be used here as for FETCH FROM TAPE, namely
*
for ALL files, !
for next file encountered filename for specified file.
If the *
option is selected, the tape must be rewound to the beginning so that the catalogue block can be read. The verification process checks the checksum attached to each block of data on the tape. In short, as the Z-Tape software sends each block of data to the tape a checksum is calculated and saved at the end of the block. The verification process reads in each block, re-calculates the checksum and displays an error message if any of the checksums are incorrect.
The saving operation should be executed again.
Select DeVice - ◇
S
V
This routine operates in a manner very similar to the FILER. When selected, the current device title will be displayed. This can be over-typed with the required new device title. The selection is complete when the ENTER
key is pressed.
An additional way to select a device is to scroll round the Z88 device addresses using ◇
↑
and ◇
↓
. Even if there is no RAM.3, it will still appear on the scroll round as an empty directory. If an absent RAM pack is accidentally logged an error message will appear when any saving is to be done.
Cable Schematic
Further Reading
Reverse engineering Z-Tape for the Cambridge Z88 by Ben Ryves.