Tape Transfer Utility

Author(s): Dave Maccarone
Pub Details: Time Designs Magazine v4 n5 (Volume 4, Issue 5)
Date: July/August 1988
Pages: 27
Rotronics Wafadrive
Rotronics Wafadrive

The following utility program was supplied to TIME DESIGNS by Dave Maccarone, a former authorized distributor of the Rotronics Wafadrive. Rotronics is not longer in business. It should be noted that the following “Tape Transfer Utility” is for the Spectrum computer or the Spectrum-Emulated Timex Sinclair 2068.

When transferring software from cassette to wafer, some kind of transfer utility program is virtually indispensable. The program given here is written largely in BASIC and sets up its own machine code subroutines. The three facilities provided by the program are:

1. READ HEADER: Essential for analysing the attributes of files on cassette. Displays the auto-run line number of BASIC programs, location and length of code files. It works by reading the program header which preceeds the file on tape. Beware of false headers!

2, RECLAIM RAM: This option effectively de-initializes the Wafaderive Operating System and reclaims all RAM used. The BASIC program is preserved.

3. STOP: This can be used to load a BASIC program such that it is prevented from auto-running once loaded. It will thus cope with “anti-merge” programs. The auto-run line number is displayed on screen with the program name The utility program itself is overwritten.

The machine code subroutines used by the program are all relocateable and can be lifted for use in your own programs. Memory saving techniques have been used in the BASIC to assist when working in “confined spaces”. The program can be further reduced in size if required by splitting it into three parts and/or by loading the machine code straight into the printer buffer as a separate file.

  10 PAPER VAL "5": INK NOT PI: BORDER VAL "5": GO SUB VAL "1e3"
20 CLS : PRINT "Enter number:"''''
30 PRINT " 1 READ HEADER"'" - loads header from cassette & displays file attributes."
40 PRINT ''" 2 RECLAIM RAM"'" - de-initialises WOS & reclaims RAM."
50 PRINT ''" 3 STOP"'" - loads BASIC program from cassette, preventing auto- run."
60 LET a$=INKEY$: IF a$<"1" OR a$>"3" THEN GO TO 60
70 CLS : GO TO VAL "100"*VAL a$
100 REM HEADER READ
110 PRINT " HEADER READ "''"Play tape...": RANDOMIZE USR VAL "23320": CLS : LET a=VAL "23296"
120 LET t=PEEK a: LET a=a+SGN PI
130 PRINT "TYPE:","Program" AND (NOT t);"Number array" AND (t=SGN PI);"String array" AND (t=VAL "2");"Bytes" AND (t=INT PI)
140 PRINT '"NAME:",: FOR n=SGN PI TO VAL "10": PRINT CHR$ (PEEK a);: LET a=a+SGN PI: NEXT n
150 PRINT ''"LENGTH:",PEEK a+VAL "256*PEEK (a+1)": LET a=a+VAL "2"
160 LET b=PEEK a+VAL "256*PEEK (a+1)": IF NOT t THEN PRINT '"AUTO-RUN:",: IF B<VAL "1e4" THEN PRINT b
170 IF t=INT PI THEN PRINT '"START:",b
180 PRINT £NOT PI;"Press a key to return to menu": PAUSE NOT PI: GO TO VAL "20"
200 REM RECLAIM
210 PRINT " RECLAIM RAM "
220 GO SUB VAL "2e3": CLEAR #: RANDOMIZE USR VAL "23340": GO TO VAL "20"
300 REM STOP
310 PRINT " STOP "''"WARNING! - this program is lost when selected.": GO SUB VAL "2e3"
320 PRINT "The number shown on screen is the line from which the program would normally auto-run."''"Play tape..."'';USR VAL "23369": STOP
1000 RESTORE
1010 DATA "221","33","0","91","221","229","17","17","0","175","55","205","86","5","221","225","48","242","251","201"
1020 DATA "219","12","205","46","10","205","159","0","42","99","92","34","101","92","42","146","92","34","104","92","33","182","92","1","244","8","195","232","25"
1030 DATA "1","34","0","247","213","221","225","221","54","1","255","221","54","15","128","62","1","50","116","92","205","58","7","62","255","50","68","92","237","75","66","92","205","27","26","207","255"
1040 FOR a=VAL "23320" TO VAL "23405": READ a$: POKE a,VAL a$: NEXT a: RETURN
2000 REM CONTINUE?
2010 PRINT ''"Press Y to proceed or any other key to return to menu"
2020 PAUSE NOT PI: LET a=PEEK VAL "23560": IF a<>CODE "Y" AND a<>CODE "y" THEN RUN
2030 CLS : RETURN

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.