10
20
30 :
40 seq%=FALSE
50 :
60 FOR disk%=20 TO 20
70 VDU26,12
80 file1$="Utils.STDUTL"+FNd0(disk%,2)
90 file2$=file1$
100 :
110 A%=INSTR(file2$,".")
120 in$ ="ADFS::A5000.$.Holding.TorchUnix."+LEFT$(file2$,A%-1)+"/zip"+MID$(file2$,A%)+"/IMD"
130 out$="ADFS::A5000.$.Holding.TorchUnix."+file1$+LEFT$("/ssd",seq%)+LEFT$("/dsd",seq%=0)
140 txt$="ADFS::A5000.$.Holding.TorchUnix."+file1$+"/txt"
150 dir$="ADFS::A5000.$.Holding.TorchUnix."+LEFT$(file2$,A%-1)
160 PRINTin$
170 PRINTout$
180 :
190 ON ERROR REPORT:PROCClose_All:PRINT" at line ";ERL:END
200 DIM secmap% 255
210 in%=OPENIN(in$):IFin%=0:END
220 OSCLI"CDir "+dir$
230 out%=OPENOUT(out$)
240 header$=GET$#in%
250 OSCLI"Spool "+txt$
260 PRINT"Header: ";header$;FNlf;
270 REPEAT
280 A%=BGET#in%:IF A%=10:A%=BGET#in%
290 IF A%<>26:comment$=CHR$A%+GET$#in%:PRINT"Comment: ";comment$;FNlf;
300 UNTILA%=26
310 *Spool
320 OSCLI"SetType "+txt$+" FFF"
330 REPEAT
340 mode%=BGET#in%
350 cyl% =BGET#in%
360 head%=BGET#in%
370 spt% =BGET#in%
380 ssz% =BGET#in%:secsz%=2^(ssz%+7)
390 FOR sec%=0 TO spt%-1:secmap%?sec%=BGET#in%:NEXT
400 PRINT"Cyl:";FNd0(cyl%,2);" Head:";head%;" Sectors:";spt%;" SecSize:";secsz%;
410 FOR sec%=0 TO spt%-1
420 IF seq%:PTR#out%=((head%*80+cyl%)*spt%+secmap%?sec%)*secsz%
430 IFseq%=0:PTR#out%=((head%+cyl%*2)*spt%+secmap%?sec%)*secsz%
440 type%=BGET#in%
450 IF (type%AND1)=1 THEN
460 FOR byte%=0 TO secsz%-1
470 BPUT#out%,BGET#in%
480 NEXT byte%
490 ELSE
500 IF type% THEN
510 A%=BGET#in%
520 FOR byte%=0 TO secsz%-1
530 BPUT#out%,A%
540 NEXT byte%
550 ENDIF
560 ENDIF
570 NEXT sec%
580 PRINT
590 UNTILEOF#in%
600 CLOSE#out%:out%=0
610 OSCLI"SetType "+out$+" Data"
620 CLOSE#in%:in%=0
630 NEXT disk%
640 END
650 DEFPROCClose_All
660 in% =in% :IFin% :A%=in% :in%=0 :CLOSE#A%
670 out%=out%:IFout%:A%=out%:out%=0:CLOSE#A%
680 ENDPROC
690 DEFFNh0(A%,N%)=RIGHT$("0000000"+STR$~A%,N%)
700 DEFFNd0(A%,N%)=RIGHT$("00000000"+STR$A%,N%)
710 DEFFNlf:VDU10:OSCLI"FX3,16":VDU13:OSCLI"FX3":=""