home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Toolkit
/
1581CHECK64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
1KB
|
38 lines
100 REM CHECK 1581 DISK FOR CONTROLLER TYPE & J1 JUMPER
110 REM 12/09/87 FRED BOWEN
111 REM MODIFIED FOR THE C64 BY HOWARD ROSENMAN
115 :
120 PRINT"INSERT ANY FORMATTED DISK IN DRIVE."
121 INPUT"CHECK WHICH UNIT";U: PRINT
125 :
130 OPEN 1,U,15 :L=474AND255: H=474/256
140 OPEN 2,U,2,"#"
145 PRINT#1,"M-R"CHR$(0)CHR$(192)CHR$(1): GET#1,A$
150 IF ASC(A$)<>192 THEN PRINT"DEVICE"U"IS NOT A 1581.": GOTO360
155 :
160 PRINT#1,"M-R"CHR$(L)CHR$(H)CHR$(5): REM MODIFY CONTROLLER CMDS
170 FORI=1TO5:GET#1,A$:B$=B$+CHR$(ASC(A$)OR3):C$=C$+A$:NEXT
180 PRINT#1,"M-W"CHR$(L)CHR$(H)CHR$(5)B$
190 :
200 PRINT#1,"U1";2;0;1;0 :GOSUB500: REM SEEK TRACK 1 & RESET
210 PRINT#1,"U1";2;0;80;0 :GOSUB600: REM SEEK TRACK 80 & READ
220 :
230 PRINT#1,"M-W"CHR$(8)CHR$(64)CHR$(1)CHR$(0): REM TEST JUMPER J1
240 PRINT#1,"M-R"CHR$(8)CHR$(64)CHR$(1): GET#1,J$
250 :
260 PRINT#1,"M-W"CHR$(L)CHR$(H)CHR$(5)C$: REM RESTORE CONTROLLER CMDS
270 IF VAL(F$)>0 THEN PRINT"SEEK ERROR- CHECK DISKETTE.": PRINT: RUN
285 :
290 PRINT"UNIT"U" CONTAINS A ";: REM REPORT
300 IF T>20 THEN PRINT"WD1770";
310 IF T<20 THEN PRINT"WD1772";
320 PRINT" AND J1 IS ";
330 IF J$="" THEN PRINT"OPEN"
340 IF J$>"" THEN PRINT"CLOSED"
360 :
370 CLOSE2: CLOSE1: END
380 :
390 :
500 FORI=11TO8STEP-1: POKE56320+I,0: NEXT: RETURN
600 INPUT#1,F$,R$,E$,D$: T=PEEK(56329)*10+PEEK(56328): RETURN