[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems



KH>: That's an inherent problem with the 5.25" drive.  The computer has no
KH>: way of knowing for certain how many 5.25" drives are connected.  So if
KH>: you are in P8 or DOS 3.3 or Pascal, the software should assume two 5.25"
KH>: drives and give you the option of not using S6,D2.

KH>No way to fix it under P8?

Actually, there is a very short ml routine that can be used to determine if a
5.25" drive is connected to a disk controller.  Note: You do not have to have
a diskette in drive for the routine to work !!!

If merged into the P8 kernal, P8 could eliminate non-existant 5.25" drives
from the device list.


I extracted the routine from the old program "Newsroom".  I was amazed that
the program "knew" if the user had two drives attached to the computer.  If
two drives were attached, the program would ask the user whether the "data"
drive was drive 2 or not.  If only one drive was attached, the question would
not be asked.

The routine below tests for the existance of drive 2 on a 5.25" controller
card. (It assumes a drive attached as Drive 1.)

<--- Merlin source code --->

DUMMY $FC
TimeOut  DS   2           ;16-bit countdown ptr
Slot     DS   1           ;Slot number in form of Slot*16
No_Drvs  DS   1           ;Number drives attached (1 or 2)
DEND
MOTOROFF =    $C088
MOTORON  =    $C089
DRV1EN   =    $C08B
Q6L      =    $C08C
Q7L      =    $C08E

WAIT     =    $FCA8

ORG  $900
LDA  #$60        ;Test slot #6
STA  Slot

ChkDrv2  LDA  #1          ;Assume 1 drive is attached
STA  No_Drvs
LDA  #0
STA  TimeOut
STA  TimeOut+1
LDX  Slot        ;Turn on the drive and wait for it to spin up
LDA  DRV1EN,X
LDA  MOTORON,X
LDA  #0
JSR  WAIT

LDA  Q7L,X       ;Configure drive for READ operations
:ChkDrv  CMP  Q6L,X
BNE  :2Drvs      ;-> Latch holds valid data
DEC  TimeOut     ;Have we timed-out yet ?
BNE  :ChkDrv
DEC  TimeOut+1
BNE  :ChkDrv
BEQ  :Exit       ;Drive TimeOut: Drive 2 does not exist

:2Drvs   LDA  #2
STA  No_Drvs
:Exit    LDA  MOTOROFF,X  ;Turn the drive motor off
RTS

* KingQWK 1.05 # [PK] * Smith & Wesson: Original point-n-click interface

----
+------------------------------------------------------------------------+
|Ye Olde Bailey BBS Zyxel 713-520-1569(V.32bis) USR 713-520-9566(V.34/FC)|
|   Houston,Texas             yob.com           Home of alt.cosuard      |
+------------------------------------------------------------------------+