I wrote a test program that should read a single sector without using the Disc Basic (as that is normally read from the boot sector), though so far I was only able to test it in emulator where it works fine.
I am wondering, does anyone have real hardware, either a SV-605 or a SV-601+SV-801 and could run this test program?
Code: Select all
10 CLS
20 REM Drive on, select drive 0
30 OUT &H34, &H5
40 REM Select density FM, side 0
50 OUT &H38, &H1
60 REM Restore command (seek track 0)
70 OUT &H30, &H7
80 GOSUB 440
90 IF (S% AND 1) <> 0 THEN GOTO 80
100 REM Controller is not busy, send sector read command
110 DIM SEC%(256)
120 REM Seek track 2
130 OUT &H31,2
140 OUT &H30,&H17
150 GOSUB 440
160 REM IF (S% AND 1) <> 0 THEN GOTO 150
170 GOSUB 490
180 REM Select MFM, side 0
190 REM OUT &H38,&H0
200 REM Read sector
210 OUT &H32,1
220 OUT &H30,&H84
230 GOSUB 490
240 FOR I%=0 TO 127
250 LOCATE 0,3:PRINT "Byte:",I%
260 GOSUB 440
270 IF (D% AND 64)=0 THEN GOTO 260
280 SEC%(I%)=INP(&H33)
290 NEXT I%
300 LOCATE 0,5
310 FOR I%=0 TO 16
320 FOR J%=0 TO 8
330 PRINT RIGHT$("00"+HEX$(SEC%(I%*8+J%)),2);" ";
340 NEXT J%
350 FOR J%=0 TO 8
360 LET C%=SEC%(I%*8+J%)
370 IF C%<32 THEN C%=46
380 PRINT CHR$(C%);
390 NEXT J%
400 PRINT
410 NEXT I%
420 END
430 REM Get Status
440 LET S%=INP(&H30)
450 LOCATE 0,0:PRINT "Status ($30):",RIGHT$("00000000"+BIN$(S%),8)
460 LET D%=INP(&H34)
470 LOCATE 0,1:PRINT "Data ($34):",RIGHT$("00000000"+BIN$(D%),8)
480 RETURN
490 LET T%=INP(&H31):LET S%=INP(&H32):LOCATE 0,2:PRINT"Track:";T%;" Sector:";S%:RETURN