The following ZX Spectrum mode program allows a backup to be made of a LarKen diskette onto tape and the reconstruction of a diskette from a tape backup.
The program may be used to archive valuable diskettes, to store information from a diskette when diskette space is at a premium, to transfer diskette information onto a medium more capable of withstanding the hazards of the postal system, and/or to solve certain drive related problems.
Notes:
1. The rate of transfer from diskette to tape is approximately 45 seconds per track.
2. The program backs up all tracks containing information including all “free” tracks which contain data from erased programs.
3. The diskette backup system will not backup an NMI “Autostart” program. To preserve such a program save a duplicate to the diskette using the normal save routine. All other types of NMI saves are supported.
4. The target diskette used for the reconstruction must be formatted in the same manner as the original diskette. The program will signal the proper configuration if a mismatch is detected.
5. Use good quality tape for recording backups. Avoid using cassettes longer than a C-90 if and when possible.
100 REM Tape Back-up utility
110 REM By G. Chambers [address omitted]
120 REM For use with the LKDOS
system of 5120 bytes/track.
130 REM Use in Spectrum mode
140 BORDER 1: PAPER 1: CLS
150 PRINT AT 2,4; INK 2; PAPER
6;"LARKEN DISK UTILITY v1.1"; PAPER
1;,,TAB 5; PAPER 6;" Disk to Tape
Back-up "; PAPER 1,,TAB 7; PAPER 6;"By
George Chambers"
160 INK 3: PLOT 8,108: DRAW 0,62: DRAW
239,0: DRAW 0,-62: DRAW -239,0
170 INK 6: PLOT 16,114: DRAW 0,50:
DRAW 222,0: DRAW 0,-50: DRAW -222,0:
INK 7
180 RANDOMIZE USR 100: OPEN #4,"dd"
190 PRINT AT 12,3;"Wait...loading
code"
200 PRINT #4: GO TO 0: LET dr=0
210 REM MINIDOS Control Code
220 RESTORE 240
230 FOR n=44000 TO 44119: READ a: POKE
n,a: NEXT n
240 DATA
195,249,171,195,7,172,195,27,172,195
250 DATA
56,172,195,75,172,243,205,98,0,201
260 DATA
58,100,0,251,201,205,239,171,58,124
270 DATA
171,50,29,32,205,126,0,24,237,205
280 DATA
239,171,58,124,171,50,29,32,205,129
290 DATA
0,58,29,32,50,124,171,24,217,205
300 DATA
239,171,175,50,32,32,205,123,0,58
310 DATA 32,32,79,6,0,33,112,32,17,80
320 DATA
195,1,0,20,237,176,24,188,205,239
330 DATA
171,33,80,195,17,112,32,1,0,20
340 DATA
237,176,205,120,0,24,169,205,239,171
350 DATA
42,144,171,78,35,70,24,158,0,0
360 LET oo=0: LET oa=1: LET ob=2: LET
oc=3
400 LET settrack=44000: LET
nexttrack=44003
410 LET load=44006: LET save=44009:
LET track=43900
430 LET buffer=50000: LET
bufflenth=5120
440 DIM d$(320): DIM g$(9)
470 PRINT AT 10,3;"1. Save Disk to
Tape";AT 12,3;"2. Load from Tape to
Disk";AT 14,3;"3. Change Drive # - Now
"; FLASH 1;dr; FLASH 0;AT 16,3;"4.
Instructions";
AT 18,3;"5. Return to RAMdisk menu";AT
20,9;"Press a key"
480 IF INKEY$="1" THEN PAUSE 30: GO
TO 1000
490 IF INKEY$="3" THEN GO SUB 8010
500 IF INKEY$="2" THEN GO TO 2000
510 IF INKEY$="4" THEN GO SUB 3000:
RUN
520 IF INKEY$="5" THEN PRINT #4: GO
TO 4: PRINT #4: NEW
550 GO TO 470
790 PRINT #4: GO TO 4: PRINT #4: NEW
1000 REM Saving Disk to Tape
1010 IF INKEY$<>"" THEN GO TO 1010
1020 IF PEEK 23736<>168 THEN PRINT AT
12,0;d$: LET a=4: LET b=1: FOR i=10 TO
15: PRINT AT i,1; INK a; PAPER b; FLASH
1;" YOU MUST USE SPECTRUM MODE ": LET
c=a: LET a=b: LET b=c: NEXT i
1030 IF PEEK 23736<>168 THEN PRINT
''TAB 4;"Press any Key for menu": PAUSE
0: PRINT #4: GO TO 4: PRINT #4: NEW
1040 PAUSE 20: LET number=0
1050 PRINT AT 10,0;d$;AT 12,0;"Install
disk in drive ";dr''"Place fresh tape
in recorder"''"Start recorder...and
press a key": PAUSE 0
1060 BEEP .5,20: PAUSE 30: POKE
23736,181: GO SUB 7500
1070 IF number=0 THEN LET side=PEEK
50020: LET tracks=PEEK 50021: LET
onside=ABS (side-3): LET tpd=PEEK
tracks*side
1080 PRINT AT 10,0;d$
1090 LET g=1: FOR n=buffer+2 TO
buffer+10: LET g$(g)=CHR$ PEEK n: LET
g=g+1: NEXT n
1100 IF number=0 THEN LET
g$="Directory"
1110 IF CODE g$=0 OR number>=tpd THEN
GO TO 4000
1120 PRINT AT 18,1;d$( TO 96);AT
18,1;"Saving ";g$;" @ track# ";number
1130 SAVE g$CODE buffer,bufflenth
1140 LET number=number+onside
1150 PAUSE 200: GO TO 1060
2000 REM Loading tape to Disk
2010 PRINT AT 19,0: LET number=0: GO
SUB 7500: LET side=PEEK 50020: LET
tracks=PEEK 50021: IF tracks=0 THEN
PRINT "Wrong format, check disk, and
Press any key to re-start": PAUSE 0:
RUN
2020 PRINT AT 10,0;d$: PRINT AT
10,1;"Start tape & leave running..."
2030 PRINT AT 11,12;"Saving to Drive#
";dr
2040 PRINT '" On this disk...Sides
";side'" Tracks per
side";tracks
2050 PAUSE 80
2060 LET number=0
2070 PRINT AT 19,0;d$( TO 64);AT
19,1;"Loading next track:";
2080 LOAD ""CODE 50000
2090 IF number=0 THEN GO SUB 3120
2100 IF number=0 THEN LET side=PEEK
50020: LET onside=ABS (side-3): LET
tracks=PEEK 50021: LET tpd=PEEK
tracks*side
2110 IF PEEK 50000=200 THEN PRINT AT
18,0;d$( TO 96);AT 18,3; FLASH
1;"Loading to disk Completed"; FLASH
0''TAB 9;"Press a key": FOR n=1 TO 5:
BEEP .5,10: BEEP .5,20: NEXT n: PAUSE
0: GO TO 6000
2120 LET g=1: FOR n=buffer+2 TO
buffer+10: LET g$(g)=CHR$ PEEK n: LET
g=g+1: NEXT n
2130 IF number=0 THEN LET
g$="Directory"
2140 GO SUB 7600
2145 IF number=0 THEN GO SUB 3120
2150 PRINT AT 16,0;d$( TO 160);AT
16,1;"Saved ...";g$;" on track ";number
2160 LET number=number+onside
2170 GO TO 2070
3000 INK 0: PAPER 7: BORDER 7: CLS
3010 PRINT TAB 9;"Instructions"'
3020 PRINT '" This program has been
designed to copy a complete disk to
tape, and then to load the tape back
onto another disk."
3030 PRINT '" It works in the Spectrum
mode. This is because the LOAD/SAVE
routines are more accessible in the
Spectrum ROM."
3040 PRINT '" The program saves to
tape on a track by track basis."
3050 PRINT '" The program contains a
block of code (data statements). This
is a mini DOS used to control the
disk system."
3060 PRINT ''" Press a key to
continue": PAUSE 0
3070 CLS : PRINT '" Although the
program is trans-parent as to the type
of drive that is used, care must be
taken to ensure that the same drive
type is used for the subsequent load as
was used for the initialsave."
3080 PRINT '" This is because the
directory which defines drive type has
not been modified to reflect a
different drive type."
3090 PRINT '" Therefore, although the
disk format is for the one drive
type the system interface, in lookingat
the directory, sees it as another
type. CRC errors will result."
3100 PRINT '" Press a key to return to
menu"
3110 PAUSE 0: CLS : RETURN
3120 IF PEEK 50020<>side OR PEEK
50021<>tracks THEN PRINT AT 10,0;d$;AT
10,2; FLASH 1;"Disk format not
compatible"; FLASH 0''"Tape save is:"'"
";PEEK 50021; "tracks per side on
";PEEK 50020;" Side";("s" AND PEEK
50020=2)''"Disk formatted to:"'"
";tracks;" tracks per side on
";side;"Side";("s" AND side=2)''"
Press any key for re-start": PAUSE 0:
GO TO 3122
3121 RETURN
3122 IF INKEY$="y" OR INKEY$="Y" THEN
POKE 50020,side: POKE 50021,tracks:
RETURN
3130 RUN
4000 LET x=1: LET g$="NoMore": FOR
n=buffer+2 TO buffer+7: POKE n,CODE
g$(x): LET x=x+1: NEXT n
4040 POKE 50000,200: SAVE "NoMore"CODE
buffer,10: PRINT AT 12,0;d$;AT 15,5;
FLASH 1;"Disk saved to tape"' FLASH
0;'TAB 9;"Press a key": FOR n=1 TO 5:
BEEP .5,10: BEEP .5,20:: NEXT n: PAUSE
0: GO TO 6000
6000 PRINT #4: GO TO 0
6010 FOR n=VAL "10" TO VAL "21": PRINT
AT n,NOT PI;c$: NEXT n
6020 PRINT AT VAL "15",VAL "6";"Disk
copy completed"''"Press P key for
RAMdisk menu, or another key to copy
next disk"
6030 PAUSE NOT PI
6040 IF INKEY$<>"P" AND INKEY$<>"p"
THEN RUN
6050 PRINT #4: GO TO 4: PRINT #4: NEW
7500 REM Load a Track
7510 POKE track,number: RANDOMIZE USR
settrack: RANDOMIZE USR load
7520 RETURN
7600 REM Save a Track
7610 POKE track,number: RANDOMIZE USR
settrack: RANDOMIZE USR save
7620 RETURN
7630 STOP
8000 INK 0: PAPER 7: BORDER 7: CLS :
STOP
8010 INPUT "Drive 0 to 3 ? ";dr
8020 PRINT #4: GO TO dr
8050 RETURN
8999 STOP
9000 CLEAR : LET od=4: PRINT AT
15,9;"SAVE ROUTINE"''" Press ""D"" key
to save to disk,"''" or ""T"" key to
save to tape": PAUSE 0
9010 IF INKEY$="t" OR INKEY$="T" THEN
LET od=3
9020 PRINT #od: SAVE "tapsav.BS" LINE
100: RUN