EasyManua.ls Logo

Commodore Plus 4 - Page 360

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
348
Using
Peripheral
Devices
2.
The
diskette
is
validated
as
part
of
this
procedure.
Any
sectors
used
for
direct
access
will
be
deallocated
as
in
any
validate
operation.
3.
If
possible,
make
copies
of
unaffected
files
you
need
from
the
diskette
before
running
this
program.
10
DIMA$(255)
20
PORI=1TO16:S$=S$+CHR$(160):NEXT
30
SCNCLR:PRINT
40
PRINT"INSERT
DISK
CONTAINING
FILE TO
UNSCRATCH":PRINT
50
PRINT"PRESS
ANY
KEY
WHEN
DONE":PRINT
60
GETKEYK$
70
PRINT"INITIALIZING
DISK":PRINT
80
OPEN15,8,15,"I"
90
GOSUB460
100
INPUT"FILE
TO
UNSCRATCH";F$
110
F$=LEFT$(F$+S$,16)
120
PRINT:PRINT"LOOKING
FOR
";F$
130
OPENl,8r2,"#"
140
GOSUB460
150
T=18:S=1
160
PRINT#15,"U1:";2;0;T;S
170
GOSUB460
180
FORI=0TO255
190
GET#1,A$(I)
200
NEXT
210
F=0
220
B=32*F+4:FF$=""
230
FORI=1TO16
240
FF$=FF$+A$(B+I):NEXT
250
IFF$=FF$THEN300
260
F=F+1:IFF<8(THEN220
270
T=ASC(A$(0)):IFT=0THEN290
280
S=ASC(A$(1)):GOTO160
290
PRINT:PRINTF$;" NOT
FOUND":GOTO450
300
PRINT:PRINT"FOUND
";F$
310
B=B-2
320
IFASC(A$(B))O0THENPRINT:PRINTF$;"
IS
NOT
A
SCRATCHED
FILE":GOTO450
330
PRINT:PRINT"1
=
SEQ,
2
=
PRG,
3
=
USR,
4
=
REL"
340
INPUT"WHAT
TYPE
OF
FILE";N%
350
IFN%<1ORN%>4THEN330
360
PRINT:
INPUT"OKAY
TO
UNSCRATCH
(Y/N)";K$
370
IFK$O"Y"THEN450
380
PRINT#15,"B-P:";2;B
390
PRINT#1,CHR$(128+N%);
400
PRINT#15,"U2:";2;0;T;S
410
GOSUB460
420
PRINT:PRINT"VALIDATING
DISK"
430
PRINT#15,"V"
440
GOSUB460
450
CLOSE1:CLOSE15:END
460
IFDS=0THENRETURN
470
PRINTDS$:CLOSE1:CLOSE15:END