Driver for FDD
ZXNet echo conference «code.zx»
From Sergey Selev → To All 25 March 2001
Aaa, it's time to relax, All.
Is it possible to use this subroutine for positioning?
I wonder if the sector will deteriorate when recording.
B=track number 0..x
FDDPOS IN (#F8)
LD A,B
LD (FDDTS+1),A ; track number
SRL B
LD C,#3C
JR NC,FDDPOS1
LD C,#2C
FDDPOS1 LD A,(FDDN) ; drive number
OR C
OUT (#FF)
LD A,B
OUT (#7F)
IN (#3F)
CP B
PUSH AF
LD A,#18
OUT (#1F)
FDDPOS2 IN (#FF)
R.L.A.
JR NC,FDDPOS2
POP AF
CALL NZ,FDDPOS3
IN (#FA)
RET
FDDPOS3 LD A,#10
FDDPAU LD C,0
FDDPAU1 DEC C
JR NZ,FDDPAU1
DEC A
JR NZ,FDDPAU
RET
Why does this routine fail when interrupts are enabled?
FDDRD IN (#F8)
PUSH DE
LD BC,#037F
FDDRD1 IN (#FF)
AND #C0
JR NZ,FDDRD2
INC DE
LD A,D
OR E
JR NZ,FDDRD1
DJNZ FDDRD1
JR FDDRD4
FDDRD2 INI
FDDRD3 IN (#FF)
AND #C0
JR Z,FDDRD3
JP P,FDDRD2
FDDRD4 POP DE
IN (#FA)
RET
Well, till next time...
██▓▓▓▒▒▒░░░ ╔══ Sergey aka Cyber from Cobra Software ══╗
█▓▓▓▒▒▒░░░ ╚══════ 500:322/62 ════ 2:462/167.62 ══════╝