Changes

Jump to: navigation, search

UIDE Universal IDE adapter cards for Z-80 computers

3,892 bytes added, 11:10, 26 February 2017
/* Drivers */
The provisional PCW driver suite can be downloaded here: [[File:Xdriver PCW suite 0.1.zip|framed|All Board BOM]].
 
=== BASIC program to load the driver from a DOM ===
If you chose to buy one of my DOMs, I can load it with the xdriver FID file. Enter this program into BASIC and run it, and it will retrieve the driver from the DOM and write it to the currently logged in disk:
 
10 REM uIDE bootstrap - load FID from uIDE track 0
20 MEMORY &HCFF0
30 :
40 PRINT
50 PRINT "uIDE driver retrieval program"
60 PRINT "Copyright (c) Jon Bradbury 2017"
70 PRINT
80 fidStart%=&HD000: fidEnd%=&HD4FF: fidSec%=2
90 cfBase%=&HC8
100 cfData%=cfBase%
110 cfFeatures%=cfBase%+1
120 cfError%=cfBase%+1
130 cfSecCount%=cfBase%+2
140 cfLBA0%=cfBase%+3
150 cfLBA1%=cfBase%+4
160 cfLBA2%=cfBase%+5
170 cfHead=cfBase%+6
180 cfStatus%=cfBase%+7
190 cfCommand%=cfBase%+7
200 cf8Bit%=1
210 cfReadSec%=&H20
220 cfMaster%=&HE0
230 cfSetFeat%=&HEF
240 tout%=0: addr%=fidStart%
250 GOSUB 850
260 :
270 GOSUB 580: REM cfWait
280 IF tout%=1 THEN GOTO 560: REM check for timeout
290 :
300 REM init IDE device
310 CALL di%
320 OUT cfFeatures%,cf8Bit%
330 OUT cfCommand%, cfSetFeat%
340 CALL ei%
350 GOSUB 580: REM cfWait
360 :
370 REM retrieve FID
380 PRINT "Retrieving xdrv.fid: [ ]";
390 FOR x=0 TO 24: PRINT CHR$(8);: NEXT x
400 FOR secNo% = 0 TO fidSec%
410 GOSUB 680: REM get current sector
420 NEXT secNo%
430 PRINT: PRINT
440 PRINT "Writing xdrv.fid: [ ]";
450 FOR x=0 TO 20: PRINT CHR$(8);: NEXT x
460 OPEN "R",#1,"xdrv.fid",1
470 FIELD #1,1 AS d0$
480 FOR addr%=fidStart% TO fidEnd%
490 LSET d0$=CHR$(PEEK(addr%))
500 PUT #1
510 IF addr% MOD &H40 = 0 THEN PRINT ".";
520 NEXT addr%
530 CLOSE #1
540 PRINT: PRINT: PRINT "Done."
550 PRINT "Copy xdrv.fid to your PCW CP/M boot disk and reboot."
560 END
570 :
580 REM cfWait
590 FOR try%= 0 TO 31
600 CALL di%
610 status% = INP(cfStatus%)
620 CALL ei%
630 IF (status% <> &HFF) AND (status% AND &H80 <> 0) THEN RETURN
640 NEXT try%
650 PRINT "IDE device timeout - check it is connected."
660 tout%=1
670 RETURN
680 :
690 REM get sector in secNo%, copy to buffer
700 CALL di%
710 OUT cfLBA0%,secNo%
720 OUT cfLBA1%,0
730 OUT cfLBA2%,0
740 OUT cfHead%,cfMaster%
750 OUT cfSecCount%,1
760 OUT cfCommand%,cfReadSec%
770 CALL ei%
780 GOSUB 570
790 FOR byte%=0 TO 511
800 POKE addr%,INP(cfData%)
810 addr%=addr%+1
820 IF addr% MOD &H40 = 0 THEN PRINT ".";
830 NEXT byte%
840 RETURN
850 :
860 REM load up ei-di routines
870 DATA &HF3,&HC9,&HFB,&HC9
880 FOR x=&HCFF1 TO &HCFF4
890 READ inst%
900 POKE x,inst%
910 NEXT x
920 di%=&HCFF1
930 ei%=&HCFF3
940 RETURN
 
'''To use the program.'''
* Connect the uIDE to the PCW.
* Plug the DOM into the uIDE's IDE socket.
* Power up. If the uIDE power and activity lights both come on, you have the cable or DOM back to front. Power down and check.
* Now power-on.
* Load BASIC and enter the program. It's easier if you type AUTO 10 first. Take care with the entering of variable names, most of them have a % at the end (integer).
* Save the BASIC program down before running it. SAVE "get-xdrv.bas"
* Copy get-xdrv.bas onto your boot disk and run it from the boot disk. BASIC get-xdrv
* You should see a progress bar as the FID is loaded from the DOM. The activity light on the uIDE should be flashing.
* Now a second progress bar comes up as the FID is being written to the floppy drive.
* When the program ends, go back to CP/M with SYSTEM command.
* Copy the xdrv.fid file to your boot disk if not already on there.
* Reboot the PCW (use LEFT-SHIFT - EXTRA - EXIT key combination rather than the power switch, it's quicker).
* You should see the sign-on message "PCW IDE Extended Driver Copyright (C) Jon Bradbury"
* You should also see a list of available drives.
* Congratulations, your new IDE device is working!
== CP/M Plus version requirements ==
410
edits