SVI 3x8 Disc Controller test program

Post Reply
Jens
Member
Posts: 23
Joined: Sun Jul 07, 2024 11:02 am

SVI 3x8 Disc Controller test program

Post by Jens »

We are trying to replicate the SVI 3x8 Disc Controller, though there still seem to be some problems.
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
I need to know if it completes. The byte counter should count up to 128 and then print the sector to screen:
image.png
CAS file attached, so you don't need to type this in. It should only _read_ a sector, though you should probably not use a rare/valuable disc with it...
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2239
Joined: Sun Jul 15, 2007 10:01 pm

Re: SVI 3x8 Disc Controller test program

Post by dom »

It may/may not be of use for comparison...

We use a variant of the CP/M boot sector for loading, it came in via this thread: viewtopic.php?p=17027&hilit=svi+disk#p17027 and the code is here: https://github.com/z88dk/z88dk/blob/mas ... tstrap.asm
Jens
Member
Posts: 23
Joined: Sun Jul 07, 2024 11:02 am

Re: SVI 3x8 Disc Controller test program

Post by Jens »

That is actually helpful! I wrote the basic program to easily print diagnostics, I may have to change some of it to assembly if it isn't fast enough.
I am slightly surprised the bios doesn't provide sector-reading functions.

I attached an updated/fixed version of the basic program, it should correctly seek track 2 now.
You do not have the required permissions to view the files attached to this post.
Post Reply