Browse Source

added DOS_1571_03

master
Michael Steil 4 months ago
parent
commit
c9c6534f13
100 changed files with 4939 additions and 0 deletions
  1. 0
    0
      DOS_1571_03/addfil.src
  2. 0
    0
      DOS_1571_03/addrel.src
  3. 0
    0
      DOS_1571_03/block.src
  4. 109
    0
      DOS_1571_03/burst.src
  5. 0
    0
      DOS_1571_03/close.src
  6. 0
    0
      DOS_1571_03/com.src
  7. 0
    0
      DOS_1571_03/copall.src
  8. 0
    0
      DOS_1571_03/copset.src
  9. 0
    0
      DOS_1571_03/dskintsf.src
  10. 0
    0
      DOS_1571_03/duplct.src
  11. 0
    0
      DOS_1571_03/duplct1.src
  12. 0
    0
      DOS_1571_03/erproc.src
  13. 0
    0
      DOS_1571_03/fastld.src
  14. 1355
    0
      DOS_1571_03/fastutl.src
  15. 0
    0
      DOS_1571_03/fndrel.src
  16. 0
    0
      DOS_1571_03/frets.src
  17. 243
    0
      DOS_1571_03/gcrcntrl.src
  18. 0
    0
      DOS_1571_03/gcrtable1.src
  19. 0
    0
      DOS_1571_03/gcrtable3.src
  20. 0
    0
      DOS_1571_03/gcrtable6.src
  21. 0
    0
      DOS_1571_03/gcrtable8.src
  22. 0
    0
      DOS_1571_03/gcrtables.src
  23. 0
    0
      DOS_1571_03/getact.src
  24. 0
    0
      DOS_1571_03/idlesf.src
  25. 0
    0
      DOS_1571_03/irq.src
  26. 0
    0
      DOS_1571_03/irq1541.src
  27. 0
    0
      DOS_1571_03/irq1571.src
  28. 0
    0
      DOS_1571_03/jobssf.src
  29. 0
    0
      DOS_1571_03/lccbingcr.src
  30. 216
    0
      DOS_1571_03/lcccntrl.src
  31. 0
    0
      DOS_1571_03/lccconhdr.src
  32. 0
    0
      DOS_1571_03/lccend.src
  33. 0
    0
      DOS_1571_03/lccfmt1.src
  34. 0
    0
      DOS_1571_03/lccfmt2.src
  35. 0
    0
      DOS_1571_03/lccfmt2a.src
  36. 0
    0
      DOS_1571_03/lccfmt3.src
  37. 0
    0
      DOS_1571_03/lccfmt3a.src
  38. 0
    0
      DOS_1571_03/lccfmt4.src
  39. 0
    0
      DOS_1571_03/lccfmt4a.src
  40. 0
    0
      DOS_1571_03/lccgcrbin.src
  41. 0
    0
      DOS_1571_03/lccgcrbn1.src
  42. 0
    0
      DOS_1571_03/lccinit.src
  43. 0
    0
      DOS_1571_03/lccio.src
  44. 0
    0
      DOS_1571_03/lccread.src
  45. 0
    0
      DOS_1571_03/lccread1.src
  46. 0
    0
      DOS_1571_03/lccseek.src
  47. 0
    0
      DOS_1571_03/lccseek1.src
  48. 0
    0
      DOS_1571_03/lccutil.src
  49. 202
    0
      DOS_1571_03/lccutil1.src
  50. 0
    0
      DOS_1571_03/lccwrt.src
  51. 0
    0
      DOS_1571_03/lccwrt1.src
  52. 0
    0
      DOS_1571_03/leds.src
  53. 0
    0
      DOS_1571_03/lookup.src
  54. 0
    0
      DOS_1571_03/lstdir.src
  55. 0
    0
      DOS_1571_03/map.src
  56. 0
    0
      DOS_1571_03/memrw.src
  57. 0
    0
      DOS_1571_03/mfmcntrl.src
  58. 0
    0
      DOS_1571_03/mfmsubr.src
  59. 493
    0
      DOS_1571_03/mfmsubr1.src
  60. 0
    0
      DOS_1571_03/mfmsubr2.src
  61. 0
    0
      DOS_1571_03/mfmsubr3.src
  62. 0
    0
      DOS_1571_03/new.src
  63. 0
    0
      DOS_1571_03/newss.src
  64. 0
    0
      DOS_1571_03/newvec.src
  65. 0
    0
      DOS_1571_03/nulbuf.src
  66. 0
    0
      DOS_1571_03/open.src
  67. 0
    0
      DOS_1571_03/opnchnl.src
  68. 0
    0
      DOS_1571_03/parsex.src
  69. 1449
    0
      DOS_1571_03/patchn.src
  70. 0
    0
      DOS_1571_03/record.src
  71. 0
    0
      DOS_1571_03/rel1.src
  72. 0
    0
      DOS_1571_03/rel2.src
  73. 0
    0
      DOS_1571_03/rel3.src
  74. 0
    0
      DOS_1571_03/rel4.src
  75. 0
    0
      DOS_1571_03/rename.src
  76. 5
    0
      DOS_1571_03/romsf.src
  77. 0
    0
      DOS_1571_03/romtblsf.src
  78. 0
    0
      DOS_1571_03/scrtch.src
  79. 0
    0
      DOS_1571_03/seratn.src
  80. 182
    0
      DOS_1571_03/seratn1.src
  81. 114
    0
      DOS_1571_03/serlib.src
  82. 0
    0
      DOS_1571_03/serlistn.src
  83. 0
    0
      DOS_1571_03/serlistn1.src
  84. 0
    0
      DOS_1571_03/sertalk.src
  85. 0
    0
      DOS_1571_03/sertalk1.src
  86. 0
    0
      DOS_1571_03/setdrv.src
  87. 0
    0
      DOS_1571_03/signature.src
  88. 0
    0
      DOS_1571_03/ssend.src
  89. 0
    0
      DOS_1571_03/sstest.src
  90. 0
    0
      DOS_1571_03/ssutil.src
  91. 0
    0
      DOS_1571_03/system.src
  92. 0
    0
      DOS_1571_03/trnsfr.src
  93. 571
    0
      DOS_1571_03/tst2.src
  94. 0
    0
      DOS_1571_03/tst3.src
  95. 0
    0
      DOS_1571_03/tst4.src
  96. 0
    0
      DOS_1571_03/tstflg.src
  97. 0
    0
      DOS_1571_03/tstfnd.src
  98. 0
    0
      DOS_1571_03/tsutil.src
  99. 0
    0
      DOS_1571_03/utload.src
  100. 0
    0
      DOS_1571_03/utlodr.src

DOS_1571/addfil.src → DOS_1571_03/addfil.src View File


DOS_1571/addrel.src → DOS_1571_03/addrel.src View File


DOS_1571/block.src → DOS_1571_03/block.src View File


+ 109
- 0
DOS_1571_03/burst.src View File

@@ -0,0 +1,109 @@
.page
.subttl 'burst'
*=$8000

signature_lo .byte $FF ; <<<< TO BE DETERMINED
signature_hi .byte $FF ; <<<< TO BE DETERMINED


.byte 'S/W - DAVID G SIRACUSA',$0D,"H/W - GREG BERLIN",$0D,'1985',$0D

burst_routines

lda cmdsiz ; check command size
cmp #3
bcc realus

lda cmdbuf+2 ; get command
sta switch ; save info
and #$1f
tax ; command info
asl a
tay
lda cmdtbb,y
sta ip
lda cmdtbb+1,y
sta ip+1
cpx #30 ; utload ok for 1541 mode
beq 1$

lda pota1
and #$20 ; 1/2 Mhz ?
beq realus ; 1541 mode...ignore

1$ lda fastsr ; clear clock & error return
and #$eb
sta fastsr

lda cmdctl,x ; most sig bit set set error recover
sta cmdbuf+2 ; save info here

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

jmp ptch65
; jmp (ip) ; *** rom ds 04/25/86 ***

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

realus lda #<ublock ; set default block add
sta usrjmp
lda #>ublock
sta usrjmp+1
unused rts

.page

; command tables and information

cmdctl .byte $80,$81,$90,$91,$b0,$b1,$f0,$f1,$00,$01,$B0,$01,$00,$01,$00,$01
.byte $80,$81,$90,$91,$b0,$b1,$f0,$f1,$00,$01,$B0,$01,$00,$01,$00,$80

cmdtbb .word fstrd ; fast read drv #0 - 0000
.word ndkrd ; fast read drv #1 - 0001

.word fstwrt ; fast write drv #0 - 0010
.word ndkwrt ; fast write drv #1 - 0011

.word fstsek ; seek disk drv #0 - 0100
.word ndkrd ; seek disk drv #1 - 0101

.word fstfmt ; format disk drv #0 - 0110
.word fstfmt ; format disk drv #1 - 0111

.word cpmint ; interleave disk drv #0 - 1000
.word cpmint ; interleave disk drv #1 - 1001

.word querdk ; query disk format - 1010
.word ndkrd ; seek disk drv #1 - 1011

.word inqst ; return disk status - 1100
.word ndkrd ; return disk status - 1101

.word duplc1 ; backup drv0 to drv1 - 1110
.word duplc1 ; backup drv1 to drv0 - 1111

; *****************************************************************
.word fstrd ; fast read drv #0 - 0000
.word ndkrd ; fast read drv #1 - 0001

.word fstwrt ; fast write drv #0 - 0010
.word ndkwrt ; fast write drv #1 - 0011

.word fstsek ; seek disk drv #0 - 0100
.word ndkrd ; seek disk drv #1 - 0101

.word fstfmt
.word fstfmt

.word unused
.word unused

.word querdk ; query disk format - 1010
.word ndkrd ; seek disk drv #1 - 1011

.word unused
.word unused

.word chgutl
.word fstload

DOS_1571/close.src → DOS_1571_03/close.src View File


DOS_1571/com.src → DOS_1571_03/com.src View File


DOS_1571/copall.src → DOS_1571_03/copall.src View File


DOS_1571/copset.src → DOS_1571_03/copset.src View File


DOS_1571/dskintsf.src → DOS_1571_03/dskintsf.src View File


DOS_1571/duplct.src → DOS_1571_03/duplct.src View File


DOS_1571/duplct1.src → DOS_1571_03/duplct1.src View File


DOS_1571/erproc.src → DOS_1571_03/erproc.src View File


DOS_1571/fastld.src → DOS_1571_03/fastld.src View File


+ 1355
- 0
DOS_1571_03/fastutl.src
File diff suppressed because it is too large
View File


DOS_1571/fndrel.src → DOS_1571_03/fndrel.src View File


DOS_1571/frets.src → DOS_1571_03/frets.src View File


+ 243
- 0
DOS_1571_03/gcrcntrl.src View File

@@ -0,0 +1,243 @@
.page
.subttl 'gcrcntrl.src'

; *contrl
; main controller loop
; scans job que for jobs
; finds job on current track
; if it exists

jlcc tsx ; save current stack pointer
stx savsp ; *
bit t1lc2 ; reset irq flag
lda pcr2 ; enable SO
ora #$0e
sta pcr2

jtop ldy #numjob-1 ; pointer into job que
2$ lda jobs,y ; find a job (msb set)
bmi 3$ ; branch if there is a job
dey
bpl 2$

jmp jend

3$ cmp #fread ; fast read cmd
bne 1$

jmp jread01 ; fill, same track read job

1$ cmp #jumpc ; jump cmd ?
bne 15$

jmp exdo

15$ and #drvmsk ; get drive #
beq 5$
sty jobn
lda #15
jmp jerrr ; bad drv

5$ tax
cmp cdrive ; test if current drive
beq 7$

sta cdrive
jsr turnon ; turn drive on
jmp jend ; go clean up

7$ lda drvst ; test if motor up to speed
bmi 8$

asl a ; test if stepping
bpl 9$ ; not stepping

8$ jmp jend

9$ lda #$20 ; status=running
sta drvst

ldy #numjob-1
sty jobn

10$ jsr jsetjb
bmi 11$

12$ dec jobn
bpl 10$

ldy nxtjob
jsr jsetjb1

lda nxtrk
sta steps
asl steps ; steps*2

lda #$60 ; set status=stepping
sta drvst

lda (hdrpnt),y ; get dest track #
sta drvtrk
jmp jend

11$ and #drvmsk ; test if same drive
cmp cdrive
bne 12$ ; test if current drive

lda drvtrk
beq 13$ ; uninit. track #

lda drvtrk ; we are here
cmp #36 ; destination
php ; save status
lda (hdrpnt),y ; destination
cmp #36
ror a ; rotate to sign bit
plp ; retrieve carry
and #$80 ; retrieve sign
bcc 16$ ; br, we are on side 0

bmi 17$ ; br, we are on side 1 & our dest is side 1

; a change ...

lda drvtrk ; we are on side 1 & and our dest is side 0
sbc #35 ; so decrement where we are
sta drvtrk
jmp 17$

16$ bpl 17$ ; br, we are on side 0 & our dest is side 0

; a change ...

lda drvtrk ; we are on side 0 & our dest is side 1
adc #35
sta drvtrk
17$ sec
lda (hdrpnt),y
sbc drvtrk
beq 13$ ; on track

sta nxtrk
lda jobn ; save job# and dist to track
sta nxtjob

jmp 12$


13$ ldx #4 ; set track and sector
lda (hdrpnt),y
sta tracc
cmp #36 ; second side ?
tay ; save track
jsr set_side ; adjust h/w and set appropiate flag
tya ; restore track
bcc 14$

sbc #35 ; track 36 is track 1 physically
14$ tax
lda worktbl-1,x
sta sectr ; select density

lda dskcnt
and #$9f ; clear density bits
ora sectr
sta dskcnt ; set density bits

lda num_sec-1,x
sta sectr ; get # of sector

lda job ; yes, go do the job
cmp #bump-$80 ; test for bump
beq jbmp

cmp #execd
beq exdo

cmp #frmt-$80 ; is it a format code
beq jfmt

jmp jseak ; do a sector seek

jfmt jmp jformt ; do the format

exdo lda jobn
clc
adc #>bufs
sta bufpnt+1
lda #0
sta bufpnt
jmp (bufpnt)

jbmp
lda #$60 ; set status=stepping
sta drvst
lda dskcnt
and #$ff-$03 ; set phase a
sta dskcnt

lda #256-92 ; step back 45 traks
sta steps
lda side ; what side are we on ?
bmi 1$

lda #$01 ; drvtrk now 1
.byte skip2
1$ lda #36 ; drvtrk now 36
sta drvtrk
lda #1
jmp jerrr

jsetjb ldy jobn
jsetjb1 lda jobs,y
pha
bpl 1$ ; no job here

and #$78
sta job
tya
asl a
adc #<hdrs ; hdrpnt,trk,sec for job
sta hdrpnt
lda #>hdrs
sta hdrpnt+1
tya ; point at buffer
clc
adc #>bufs
sta bufpnt+1

1$ ldy #0
sty bufpnt
pla
rts


set_side
bcs 1$
lda #0
.byte skip2
1$ lda #$84
sta side
lda pota1
and #$ff-4
ora side
sta pota1
rts

worktbl ; table of track densities
.byte $60,$60,$60,$60,$60,$60,$60,$60,$60,$60
.byte $60,$60,$60,$60,$60,$60,$60
.byte $40,$40,$40,$40,$40,$40,$40
.byte $20,$20,$20,$20,$20,$20
.byte $00,$00,$00,$00,$00

num_sec ; number of sectors per track
.byte 21,21,21,21,21,21,21,21,21,21
.byte 21,21,21,21,21,21,21
.byte 19,19,19,19,19,19,19
.byte 18,18,18,18,18,18
.byte 17,17,17,17,17

DOS_1571/gcrtable1.src → DOS_1571_03/gcrtable1.src View File


DOS_1571/gcrtable3.src → DOS_1571_03/gcrtable3.src View File


DOS_1571/gcrtable6.src → DOS_1571_03/gcrtable6.src View File


DOS_1571/gcrtable8.src → DOS_1571_03/gcrtable8.src View File


DOS_1571/gcrtables.src → DOS_1571_03/gcrtables.src View File


DOS_1571/getact.src → DOS_1571_03/getact.src View File


DOS_1571/idlesf.src → DOS_1571_03/idlesf.src View File


DOS_1571/irq.src → DOS_1571_03/irq.src View File


DOS_1571/irq1541.src → DOS_1571_03/irq1541.src View File


DOS_1571/irq1571.src → DOS_1571_03/irq1571.src View File


DOS_1571/jobssf.src → DOS_1571_03/jobssf.src View File


DOS_1571/lccbingcr.src → DOS_1571_03/lccbingcr.src View File


+ 216
- 0
DOS_1571_03/lcccntrl.src View File

@@ -0,0 +1,216 @@
.page
.subttl 'lcccntrl.src'
;
;
;
; *contrl
;
; main controller loop
;
; scans job que for jobs
;
; finds job on current track
; if it exists
;
lcc
;
tsx ; save current stack pointer
stx savsp
;
lda t1lc2 ; reset irq flag
;
lda pcr2 ; enable s.o. to 6502
ora #$0e ; hi output
sta pcr2
;
;
;
top ldy #numjob-1 ; pointer into job que
;
cont10
lda jobs,y ; find a job (msb set)
bpl cont20 ; not one here
;
cmp #jumpc ; test if its a jump command
bne cont30
;
tya ; put job num in .a
jmp ex2
;
;
cont30
and #1 ; get drive #
beq cont35
;
sty jobn
lda #$0f ; bad drive # error
jmp errr
;
cont35 tax
sta drive
;
cmp cdrive ; test if current drive
beq cont40
;
jsr turnon ; turn on drive
lda drive
sta cdrive
jmp end ; go clean up
;
;
cont40 lda drvst ; test if motor up to speed
bmi cont50
;
asl a ; test if stepping
bpl que ; not stepping
;
cont50 jmp end
;
cont20 dey
bpl cont10
;
jmp end
;
;
que lda #$20 ; status=running
sta drvst
;
ldy #numjob-1
sty jobn
;
que10 jsr setjb
bmi que20
;
que05 dec jobn
bpl que10
;
;
ldy nxtjob
jsr setjb1
;
lda nxtrk
sta steps
asl steps ; steps*2
;
lda #$60 ; set status=stepping
sta drvst
;
;
lda (hdrpnt),y ; get dest track #
sta drvtrk
fin jmp end
;
;
que20 and #1 ; test if same drive
cmp drive
bne que05
;
lda drvtrk
beq gotu ; uninit. track #
;
sec ; calc distance to track
sbc (hdrpnt),y
beq gotu ; on track
;
eor #$ff ; 2's comp
sta nxtrk
inc nxtrk
;
lda jobn ; save job# and dist to track
sta nxtjob
;
jmp que05
;
;
;
;
gotu ldx #4 ; set track and sectr
lda (hdrpnt),y
sta tracc
;
gotu10 cmp trknum-1,x
;
dex
bcs gotu10
;
lda numsec,x
sta sectr
;
txa ; set density
asl a
asl a
asl a
asl a
asl a
sta work
;
lda dskcnt
and #$9f ; clear density bits
ora work
sta dskcnt
;
ldx drive ; drive num in .x
;
lda job ; yes, go do the job
cmp #bumpc ; test for bump
beq bmp
;
;
exe cmp #execd ; test if execute
beq ex
;
jmp seak ; do a sector seek
;
ex lda jobn ; jump to buffer
ex2 clc
adc #>bufs
sta bufpnt+1
lda #0
sta bufpnt
ex3 jmp (bufpnt)
;
;
bmp
lda #$60 ; set status=stepping
sta drvst
;
lda dskcnt
and #$ff-$03 ; set phase a
sta dskcnt
;
;
lda #256-92 ; step back 45 traks
sta steps
;
lda #1 ; drvtrk now 1
sta drvtrk
;
jmp errr ; job done return 1
;
;
setjb ldy jobn
setjb1 lda jobs,y
pha
bpl setj10 ; no job here
;
and #$78
sta job
tya
asl a
adc #<hdrs
sta hdrpnt
tya ; point at buffer
clc
adc #>bufs
sta bufpnt+1
;
;
setj10 ldy #0
sty bufpnt
;
pla
rts
;
;
;
;.end

DOS_1571/lccconhdr.src → DOS_1571_03/lccconhdr.src View File


DOS_1571/lccend.src → DOS_1571_03/lccend.src View File


DOS_1571/lccfmt1.src → DOS_1571_03/lccfmt1.src View File


DOS_1571/lccfmt2.src → DOS_1571_03/lccfmt2.src View File


DOS_1571/lccfmt2a.src → DOS_1571_03/lccfmt2a.src View File


DOS_1571/lccfmt3.src → DOS_1571_03/lccfmt3.src View File


DOS_1571/lccfmt3a.src → DOS_1571_03/lccfmt3a.src View File


DOS_1571/lccfmt4.src → DOS_1571_03/lccfmt4.src View File


DOS_1571/lccfmt4a.src → DOS_1571_03/lccfmt4a.src View File


DOS_1571/lccgcrbin.src → DOS_1571_03/lccgcrbin.src View File


DOS_1571/lccgcrbn1.src → DOS_1571_03/lccgcrbn1.src View File


DOS_1571/lccinit.src → DOS_1571_03/lccinit.src View File


DOS_1571/lccio.src → DOS_1571_03/lccio.src View File


DOS_1571/lccread.src → DOS_1571_03/lccread.src View File


DOS_1571/lccread1.src → DOS_1571_03/lccread1.src View File


DOS_1571/lccseek.src → DOS_1571_03/lccseek.src View File


DOS_1571/lccseek1.src → DOS_1571_03/lccseek1.src View File


DOS_1571/lccutil.src → DOS_1571_03/lccutil.src View File


+ 202
- 0
DOS_1571_03/lccutil1.src View File

@@ -0,0 +1,202 @@
.page
.subttl 'lccutil1.src'

; * utility routines

jerrr ldy jobn ; return job code
sta jobs,y

lda gcrflg ; test if buffer left gcr
beq 1$ ; no

jsr jwtobin ; convert back to binary

1$ jsr trnoff ; start timeout on drive

ldx savsp
txs ; reset stack pointer

jmp jtop ; back to the top

; motor and stepper control
; irq into controller every 8ms

jend
lda t1hl2 ; set irq timer
sta t1hc2

lda dskcnt
and #$10 ; wpsw
cmp lwpt ; same as last
sta lwpt ; update
bne 1$

lda mtrcnt ; anything to do?
bne 7$ ; dec & finish up

beq 2$ ; nothing to do

1$ lda #$ff
sta mtrcnt ; 255*8ms motor on time
jsr moton

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

jsr ptch72 ; *** rom ds 05/20/86 ***
nop
; lda #1
; sta wpsw

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

bne 2$ ; bra

7$ dec mtrcnt ; dec & return
bne 2$
lda drvst
cmp #$00 ; motor off & no active drive ?
bne 2$ ; br, do not turn it off something is going on

jsr motoff

2$ lda phase ; test for phase offset
beq 5$

cmp #2
bne 3$

lda #0
sta phase
beq 5$ ; bra

3$ sta steps
lda #2
sta phase
jmp 6$

5$ ldx cdrive ; work on active drive only
bmi 8$ ; no active drive

lda drvst ; test if motor on
tay
cmp #$20 ; test if anything to do
bne 9$ ; something here

8$ jmp 10$ ; motor just running

9$ dec acltim ; dec timer
bne 11$
tya ; test if acel
bpl 12$


and #$7f ; over, clear acel bit
sta drvst

12$ and #$10 ; test if time out state
beq 11$

dec acltim2 ; decrement second timer
bne 11$

jsr motoff

lda #$ff ; no active drive now
sta cdrive

lda #0 ; drive inactive
sta drvst ; clear on bit and timout
beq 8$

11$ tya ; test if step needed
and #$40
bne 13$ ; stepping

jmp 10$

13$ lda nxtst ; step or settle
bne 18$ ; go set

lda steps
beq 17$

6$ lda steps
bpl 14$

tya
pha ; save regs .y
ldy #99 ; wait for trk_00
15$ lda pota1 ; check for trk_00
ror a ; rotate into carry
php ; save it
lda pota1 ; debounce it
ror a ; => carry
ror a ; => bit 7
plp ; restore carry
and #$80 ; set/clear sign bit
bcc 21$

bpl 16$ ; carry set(off) & sign clear(on) exit

bmi 20$ ; bra

21$ bmi 16$ ; carry clear(on) & sign set(off) exit
20$ dey
bne 15$ ; wait a while

bcs 16$ ; br, not track 00 ?

lda adrsed ; enable/disable track 00 sense
bne 16$ ; br, nope...

lda dskcnt ; phase 0
and #3
bne 16$

pla
tay ; restore .y

lda #0
sta steps ; nomore steps
jmp 10$

16$ pla
tay ; restore .y

inc steps ; keep stepping
lda dskcnt
sec
sbc #1 ; -1 to step out
jmp 19$

17$ lda #2 ; settle time
sta acltim
sta nxtst ; show set status
jmp 10$

18$ dec acltim
bne 10$

lda drvst
and #$ff-$40
sta drvst

lda #00
sta nxtst
jmp 10$

14$ dec steps
lda dskcnt
clc
adc #01

19$ and #3
sta tmp
lda dskcnt
and #$ff-$03 ; mask out old
ora tmp
sta dskcnt

10$ rts

DOS_1571/lccwrt.src → DOS_1571_03/lccwrt.src View File


DOS_1571/lccwrt1.src → DOS_1571_03/lccwrt1.src View File


DOS_1571/leds.src → DOS_1571_03/leds.src View File


DOS_1571/lookup.src → DOS_1571_03/lookup.src View File


DOS_1571/lstdir.src → DOS_1571_03/lstdir.src View File


DOS_1571/map.src → DOS_1571_03/map.src View File


DOS_1571/memrw.src → DOS_1571_03/memrw.src View File


DOS_1571/mfmcntrl.src → DOS_1571_03/mfmcntrl.src View File


DOS_1571/mfmsubr.src → DOS_1571_03/mfmsubr.src View File


+ 493
- 0
DOS_1571_03/mfmsubr1.src View File

@@ -0,0 +1,493 @@
.page
.subttl 'mfmsubr1.src'

; format track

cmdsev lda #$f8 ; write track
jsr strtwd ; send command

bit switch ; system 34 / iso standard switch
bvc no_ind ; write index ?

ldx #80
WDTEST ; chk address
2$ lda wdstat
and #3
lsr a
bcc v6
beq 2$

lda #$4e
sta wddat ; give him the data
dex
bne 2$

ldx #12
WDTEST ; chk address
3$ lda wdstat
and #3
lsr a
bcc v6
beq 3$

lda #0
sta wddat
dex
bne 3$

ldx #3
WDTEST ; chk address
4$ lda wdstat
and #3
lsr a
bcc v6
beq 4$

lda #$f6
sta wddat
dex
bne 4$

WDTEST ; chk address
5$ lda wdstat
and #3
lsr a
bcc v6
beq 5$

lda #$fc
sta wddat


ldx #50
WDTEST ; chk address
6$ lda wdstat
and #3
lsr a
bcc v6
beq 6$

lda #$4e
sta wddat ; give him the data
dex
bne 6$

beq inner ; bra... done...


no_ind ldx #60
WDTEST ; chk address
cmd7 lda wdstat
and #3
lsr a
v6 bcc v1
beq cmd7

lda #$4e
sta wddat ; give him the data
dex
bne cmd7


inner ldy #1 ; ss

main7 ldx #12
WDTEST ; chk address
cmd70 lda wdstat
and #3
lsr a
bcc v1
beq cmd70

lda #0
sta wddat
dex
bne cmd70

ldx #3
WDTEST ; chk address
cmd71 lda wdstat
and #3
lsr a
v1 bcc v2
beq cmd71

lda #$f5
sta wddat
dex
bne cmd71


WDTEST ; chk address
cmd7n lda wdstat
and #3
lsr a
bcc v2
beq cmd7n

lda #$fe ; id address mark
sta wddat


WDTEST ; chk address
cmd7f lda wdstat
and #3
lsr a
bcc v2
beq cmd7f

lda mfmcmd ; give him the track
sta wddat

WDTEST ; chk address
cmd7e lda wdstat
and #3
lsr a
bcc v2
beq cmd7e
lda switch
and #%00010000 ; what side are we on ?
bne 1$

lda #0
.byte skip2
1$ lda #1
sta wddat ; side number is ...
WDTEST ; chk address
cmd7d lda wdstat
and #3
lsr a
bcc v2
beq cmd7d
lda cmdbuf+10,y ; sector number actually cmdbuf+11
sta wddat

WDTEST ; chk address
cmd7c lda wdstat
and #3
lsr a
v2 bcc v3
beq cmd7c

lda cmdbuf+5 ; sz
sta wddat
WDTEST ; chk address
cmd7b lda wdstat
and #3
lsr a
bcc v3
beq cmd7b

lda #$f7 ; crc 2 bytes written
sta wddat

ldx #22

WDTEST ; chk address
cmd72 lda wdstat
and #3
lsr a
bcc v3
beq cmd72


lda #$4e
sta wddat
dex
bne cmd72

ldx #12

WDTEST ; chk address
cmd73 lda wdstat
and #3
lsr a
v3 bcc v4
beq cmd73



lda #0
sta wddat
dex
bne cmd73

ldx #3
WDTEST ; chk address
cmd74 lda wdstat
and #3
lsr a
bcc v4
beq cmd74


lda #$f5 ; a1
sta wddat
dex
bne cmd74

WDTEST ; chk address
cmd7a lda wdstat
and #3
lsr a
bcc v4
beq cmd7a

lda #$fb ; dam
sta wddat
sty temp ; save current sector


ldy mfmsiz_hi ; high
WDTEST ; chk address
cmd750 lda wdstat
and #3
lsr a
v4 bcc v5
beq cmd750


lda cmdbuf+10 ; fl
sta wddat
cpx mfmsiz_lo
beq cmd75x

inx ; increment
jmp cmd750
cmd75x inx
dey
bne cmd750


WDTEST ; chk address
cmd7ff lda wdstat
and #3
lsr a
bcc v5
beq cmd7ff

lda #$f7 ; crc
sta wddat
ldy cmdbuf+5 ; ss
lda gapmfm,y
ldy temp ; sector restore
tax

WDTEST ; chk address
cmd7fe lda wdstat
and #3
lsr a
bcc v5
beq cmd7fe

lda #$4e ; gap 3
sta wddat
dex
bne cmd7fe

cpy cmdbuf+7 ; ns
beq finmfm

iny ; inc sector
jmp main7


WDTEST ; chk address
finmfm lda wdstat
and #3
lsr a
bcc vfin
beq finmfm

clc
lda #$4e ; wait for wd to time out
sta wddat
jmp finmfm

vfin jsr waitdn ; wait for sleepy time
clc ; good carry
.byte skip1
v5 sec
rts

; min gap size @2% fast
gapmfm .byte 7, 12, 23, 44
numsek .byte 26, 16, 9, 5

.page
; format disk

; 0 1 2 3 4 5 6 7 8 9 10 + cmdbuf
; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
; "U" + $00 + N + MD + CP + SZ + LT + NS + ST + S + FL

cmdeig lda switch ; check abort command switch
and #%00001000
beq 1$

ldx ctl_dat ; get error
stx mfmcmd ; save for prcmd
sec ; wp error usually
rts

1$ jsr clrchn ; close all channels
lda cmdsiz ; setup default parms
sec
sbc #4 ; less mandatory + 1
tay
beq cp00 ; mode only, gave cp
dey
beq sz00 ; md, cp only, gave sz

lda #0
sta mfmcmd ; clear status

lda cmdbuf+5
jsr consek ; setup sector size
dey
beq lt00 ; md, cp, sz only, gave lt

dey
beq ns00 ; md, cp, sz, lt only, gave ns
dey
beq st00 ; md, cp, sz, lt, ns only, gave st

dey
beq s00 ; md, cp, sz, lt, ns, st only, gave s

dey
beq fl00 ; md, cp, sz, lt, ns, st, ss only, gave fl

jmp start8

.page
cp00 lda #0 ; default interleave
sta cmdbuf+4

sz00 lda #0
sta mfmcmd ; clear status

lda #1 ; 256 byte sectors
sta cmdbuf+5
jsr consek ; setup block size

lt00 lda #39 ; last track is #39, 40 tracks total
sta cmdbuf+6

ns00 lda numsek,x ; x=sector size index for # of sectors per track
sta cmdbuf+7

st00 lda #0 ; default track #0 start
sta cmdbuf+8
sta wdtrk

s00 lda #0 ; default steps from track 00
sta cmdbuf+9

fl00 lda #$e5 ; default block fill
sta cmdbuf+10

.page
start8 jsr go_fmt ; format side zero
lda mfmcmd ; error ?
cpx #2
bcs 1$

lda switch ; check for double sided opt
and #%00100000
beq 1$

lda switch ; set single side
ora #%00010000
sta switch
jsr sel_sid ; select h/w
jsr go_fmt ; format side one
1$ jmp cmdone ; restore

.page
go_fmt jsr diskin ; is there a diskette in the unit
bcs c_801 ; br, nope...

lda #1
sta ifr1 ; clear irq from write protect
jsr cmdone ; restore to track one/zero ?
lda cmdbuf+8 ; store logical
sta mfmcmd ; in mfmcmd
sta wdtrk

bit cmdbuf+3 ; check table bit
bvs 1$ ; br, table has been given to us

jsr sectcv ; generate sector table
bcs c_801

1$ lda cmdbuf+9 ; offset track 00 by s steps
and #$7f ; clear mode bit
beq c_800

clc
adc cmd_trk ; add to it
sta cmd_trk ; physical
jsr seke ; & seek to it

c_800 sei
lda ifr1 ; check for disk change
lsr a
bcs c_801

jsr cmdsev ; format track
bcs c_801

lda ifr1 ; check for disk change
lsr a
bcs c_801

jsr verfmt ; verify format
bcs c_801

lda ifr1 ; check for disk change
lsr a
bcs c_801

lda mfmcmd ; last track ?
cmp cmdbuf+6 ; lt
beq c_802

inc cmd_trk
inc wdtrk
inc mfmcmd ; track to write

jsr seke ; goto next track
jmp c_800

c_802 bit switch
bpl c_803 ; kill next

sec
lda cmdbuf+6 ; lt
sbc cmdbuf+8 ; st
cmp #39 ; no more than 40 tracks
bcs c_803
inc cmd_trk ; clear next track
jsr seke
ldx #28
jsr jclear ; with gcr 0
jsr kill ; read mode again
c_803 ldx #0
.byte skip2
c_801 ldx #6
stx mfmcmd ; ok exit
jmp upinst

DOS_1571/mfmsubr2.src → DOS_1571_03/mfmsubr2.src View File


DOS_1571/mfmsubr3.src → DOS_1571_03/mfmsubr3.src View File


DOS_1571/new.src → DOS_1571_03/new.src View File


DOS_1571/newss.src → DOS_1571_03/newss.src View File


DOS_1571/newvec.src → DOS_1571_03/newvec.src View File


DOS_1571/nulbuf.src → DOS_1571_03/nulbuf.src View File


DOS_1571/open.src → DOS_1571_03/open.src View File


DOS_1571/opnchnl.src → DOS_1571_03/opnchnl.src View File


DOS_1571/parsex.src → DOS_1571_03/parsex.src View File


+ 1449
- 0
DOS_1571_03/patchn.src
File diff suppressed because it is too large
View File


DOS_1571/record.src → DOS_1571_03/record.src View File


DOS_1571/rel1.src → DOS_1571_03/rel1.src View File


DOS_1571/rel2.src → DOS_1571_03/rel2.src View File


DOS_1571/rel3.src → DOS_1571_03/rel3.src View File


DOS_1571/rel4.src → DOS_1571_03/rel4.src View File


DOS_1571/rename.src → DOS_1571_03/rename.src View File


+ 5
- 0
DOS_1571_03/romsf.src View File

@@ -0,0 +1,5 @@
.page
.subttl 'romsf.src'
*=rom ; +$300 rom patch area
cchksm .byte $ff ; <<<<< TO BE DETERMINED
freec0 *=*+255 ; c0 patch space

DOS_1571/romtblsf.src → DOS_1571_03/romtblsf.src View File


DOS_1571/scrtch.src → DOS_1571_03/scrtch.src View File


DOS_1571/seratn.src → DOS_1571_03/seratn.src View File


+ 182
- 0
DOS_1571_03/seratn1.src View File

@@ -0,0 +1,182 @@
.page
.subtttl 'seratn1.src'

jatnsrv sei
lda #0 ; clear pending flag
sta atnpnd
sta lsnact ; clear address flags
sta tlkact
ldx #topwrt ; reset stack
txs
jsr spinp

lda #$80 ; set atn mode flag for acpt routine
sta eoiflg ; reset eoi flag to non-eoi state
sta atnmod

jsr clkhi
jsr datlow ; set data line low as response

lda pb ; set atn ack to release data line
ora #atna
sta pb

1$ lda pb ; test atn still here
bpl a2 ; gone !

and #clkin ; clock still low
bne 1$

a3 jsr jacptr+3 ; get a command byte

cmp #unlsn
bne a4

lda fastsr ; clr fast host flag
and #$ff-$40
sta fastsr
lda #0
sta lsnact
beq a6 ; jmp

a4 cmp #untlk
bne a5

lda fastsr ; clr fast host flag
and #$ff-$40
sta fastsr
lda #0
sta tlkact ; untalk now

a6 jmp a9 ; jmp

a5 cmp tlkadr ; our talk address?
bne a7 ; nope

lda #1 ; yes
sta tlkact ; set active talker flag
lda #0
sta lsnact ; unlisten
beq a8 ; jump

a7 cmp lsnadr ; our listen address?
bne a10 ; nope

lda #1 ; yes
sta lsnact
lda #0
sta tlkact
beq a8 ; jump

a10 tax ; test if sa
and #$60
cmp #$60 ; sa = $60 + n
bne a11 ; did not get a valid command

txa ; a sa for me
sta orgsa
and #$0f ; strip junk
sta sa

lda orgsa ; test if close
and #$f0
cmp #$e0
bne a9 ; no

cli
jsr close ; close the file
sei

;warning:::close doesn't return in time for a9

a8 bit pb ; test atn still here
bmi a3

;atn gone , do what we where told to do

a2 lda #0 ; clear atn mode
sta atnmod

lda pb ; atn gone, release atn ack
and #$ff-atna
sta pb

lda lsnact ; listen ?
beq a12

bit fastsr ; fast ?
bvc a14

jsr reqfst ; fast request
a14 jsr jlisten
jmp xidle

a12 lda tlkact ; talk?
beq a13

jsr dathi ; release data line
jsr clklow

jsr jslowd ; slow down for plus4 series
jsr jtalk
jsr jslowd ; slow down for plus4 series
a13 jmp jilerr ; release all lines and go to idle

;fix so (device not present) errors reported

a11 lda #$10 ; kill all
sta pb

a9 bit pb
bpl a2 ; exit out same way after atn done

bmi a9 ; bra

reqfst jsr tstatn ; does the host want us ?
jsr debnc
and #clkin
bne reqfst ; wait for clk hi

jsr spout ; output

lda #0
sta sdr ; send zero

slowb lda #8
1$ bit icr
beq 1$

spinp php ; save uP status
sei
lda cra ; turn 6526 in
and #%10111111 ; serial port input
sta cra
lda pota1 ; turn drvr in
and #%11111101
sta pota1

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

; lda #$84
lda #$88 ; *** rom ds 10/07/85 beta9 ***, irq from SP

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

sta icr ; enable irq from serial port
bit icr ; clear pending
plp
rts

spout php ; save uP status
sei
lda pota1
ora #%00000010 ; turn drvr out
sta pota1
lda cra ; turn 6526 out
ora #%01000000
sta cra
lda #8
sta icr ; disable irq from serial port
bit icr ; clr pending
plp
rts

+ 114
- 0
DOS_1571_03/serlib.src View File

@@ -0,0 +1,114 @@
.page
;*************************************
;
; 1571 DOS 3.0 ROM
;
;*************************************
.list
.include com
.include wd1770
.include var
.include burst
.include seratn1
.include sertalk1
.include serlistn1
.include fastutl
.include mfmcntrl
.include mfmsubr
.include mfmsubr1
.include mfmsubr2
.include mfmsubr3
.include utload
.include fastld
.include signature
.include gcrcntrl
.include lccseek1
.include lccread1
.include lccwrt1
.include lccgcrbn1
.include lccutil1
.include lccfmt2a
.include lccfmt3a
.include lccfmt4a
.include irq1541
.include irq1571
.include gcrtables
.include gcrtable1
.include gcrtable3
.include gcrtable6
.include gcrtable8
.include duplct1
.include patchn
.include newvec
.page
.subttl '1571 DOS & Controller Routines'
.page
.include romsf
.include leds
.include parsex
.include setdrv
.include lookup
.include trnsfr
.include scrtch
.include duplct
.include copset
.include copall
.include rename
.include memrw
.include block
.include fndrel
.include tst2
.include tst3
.include tst4
.include jobssf
.include addfil
.include open
.include close
.include opnchnl
.include tstflg
.include tsutil
.include ssutil
.include sstest
.include getact
.include rel1
.include rel2
.include rel3
.include rel4
.include ssend
.include record
.include nulbuf
.include addrel
.include newss
.include erproc
.include utlodr
.include seratn
.include sertalk
.include serlistn
.include dskintsf
.include idlesf
.include lstdir
.include verdir
.include new
.include map
.include frets
.include tstfnd
.include system
.include lccio
.include lccinit
.include lcccntrl
.include lccseek
.include lccread
.include lccwrt
.include lccbingcr
.include lccgcrbin
.include lccconhdr
.include lccutil
.include lccend
.include lccfmt1
.include lccfmt2
.include lccfmt3
.include lccfmt4
.include irq
.include romtblsf
.include vector
.end

DOS_1571/serlistn.src → DOS_1571_03/serlistn.src View File


DOS_1571/serlistn1.src → DOS_1571_03/serlistn1.src View File


DOS_1571/sertalk.src → DOS_1571_03/sertalk.src View File


DOS_1571/sertalk1.src → DOS_1571_03/sertalk1.src View File


DOS_1571/setdrv.src → DOS_1571_03/setdrv.src View File


DOS_1571/signature.src → DOS_1571_03/signature.src View File


DOS_1571/ssend.src → DOS_1571_03/ssend.src View File


DOS_1571/sstest.src → DOS_1571_03/sstest.src View File


DOS_1571/ssutil.src → DOS_1571_03/ssutil.src View File


DOS_1571/system.src → DOS_1571_03/system.src View File


DOS_1571/trnsfr.src → DOS_1571_03/trnsfr.src View File


+ 571
- 0
DOS_1571_03/tst2.src View File

@@ -0,0 +1,571 @@
.page
.subttl 'tst2.src'

;*******************************
;************ l r u i n t ****
;*******************************
;
; initialize the lru tabel
;
;*******************************

lruint
ldx #0
lruilp
txa
sta lrutbl,x
inx
cpx #cmdchn
bne lruilp

lda #blindx
sta lrutbl,x
rts

;*******************************
;************* l r u u p d ***
;*******************************

; least recently used table update

; input parameters:
; lindx - current channel

; output parameters:
; lrutbl - updated

;*******************************

lruupd ldy #cmdchn
ldx lindx
lrulp1 lda lrutbl,y
stx lrutbl,y
cmp lindx
beq lruext
dey
bmi lruint
tax
jmp lrulp1
lruext rts

;*******************************
;************* d b l b u f ***
;*******************************

; double buffer
; rtn to switch the active and
; inactive buffers

;*******************************

dblbuf
jsr lruupd
jsr getina
bne dbl15
jsr setdrn
jsr getbuf
bmi dbl30 ; no buffers
jsr putina ; store inactive buff #
lda track
pha
lda sector
pha
lda #1
jsr drdbyt
sta sector
lda #0
jsr drdbyt
sta track

beq dbl10

jsr typfil
beq dbl05 ; it's rel

jsr tstwrt
bne dbl05 ; read ahead

jsr tglbuf ; just switch on write
jmp dbl08

dbl05
jsr tglbuf
jsr rdab
dbl08
pla
sta sector
pla
sta track
jmp dbl20
dbl10
pla
sta sector
pla
sta track
dbl15 jsr tglbuf
dbl20 jsr getact
tax
jmp watjob

; there are no buffers to steal

dbl30
lda #nochnl
jmp cmderr

;********************************

dbset
jsr lruupd
jsr getina
bne dbs10
jsr getbuf
bmi dbl30 ; no buffers
jsr putina ; store inactive buff #
dbs10
rts
;********************************
;************ t g l b u f *****
;********************************

; toggle the inactive and active
; buffers.

; input parameters:
; lindx - channel #

;********************************

tglbuf ldx lindx
lda buf0,x
eor #$80
sta buf0,x
lda buf1,x
eor #$80
sta buf1,x
rts


pibyte
ldx #iwsa
stx sa
jsr fndwch
jsr setlds
jsr typfil
bcc pbyte
lda #ovrflo
jsr clrflg
pbyte
lda sa
cmp #15
beq l42
bne l40

; main routine to write to chanl

put lda orgsa ; is chanl cmd or data
and #$8f
cmp #15 ; <15
bcs l42
l40 jsr typfil ; data byte to store
bcs l41 ; branch if rnd
lda data ; seq file
jmp wrtbyt ; write byte to chanl
l41
bne l46
jmp wrtrel
l46 lda data ; rnd file write
jsr putbyt ; write to chanl
ldy lindx ; prepare nxt byte
jmp rnget2
l42 lda #cmdchn ; write to cmd chanl
sta lindx
jsr getpnt ; test if comm and buffer full
cmp #<cmdbuf+cmdlen+1
beq l50 ; it is full (>cmdlen)
lda data ; not full yet
jsr putbyt ; store the byte
l50 lda eoiflg ; tst if lst byte of msg
beq l45 ; it is
rts ; not yet , return
l45
inc cmdwat ; set cmd waiting flag
rts

; put .a into active buffer of lindx

putbyt pha ; save .a
jsr getact ; get active buf#
bpl putb1 ; brach if there is one
pla ; no buffer error
lda #filnop
jmp cmderr ; jmp to error routine
putb1 asl a ; save the byte in buffer
tax
pla
sta (buftab,x)
inc buftab,x ; inc the buffer pointer
rts ; z=1 if last char slot in buffer

; find the active buffer # (lindx)


;initialize drives (command)
intdrv jsr simprs

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

jsr ptch73 ; *** rom ds 05/20/86 ***
; jsr initdr

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

id20 jmp endcmd

; initialize drive (drvnum)

itrial
jsr bam2a
tay ; bam lindx from buf0
ldx buf0,y
cpx #$ff
bne it30 ; valid buffer #

pha ; save bam-lindx
jsr getbuf ; get a buffer
tax ; test it
bpl it20 ; no error

lda #nochnl

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

; jsr cmder3
jsr cmder2 ; *** rom ds 1/06/86 beta9 ***, set error

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
it20
pla
tay ; restore bam-lindx
txa
ora #$80 ; set inactive
sta buf0,y
it30
txa
and #$f ; stip to buf #
sta jobnum
ldx #0
stx sector
ldx dirtrk
stx track
jsr seth ; set the bam header
lda #seek

;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>

jmp ptch24 ; *** rom ds 02/21/85 ***
; jmp dojob ; do a seek

;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>

initdr
jsr clnbam
jsr cldchn
jsr itrial
ldx drvnum
lda #0
sta mdirty,x
txa
asl a
tax
lda header
sta dskid,x
lda header+1
sta dskid+1,x

;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>

jsr ptch23 ; *** rom 02/21/85 ***
; jsr doread

;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>

lda jobnum
asl a
tax
lda #2
sta buftab,x
lda (buftab,x)
ldx drvnum
sta dskver,x ; set up disk version #

lda #0

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

jmp ptch51 ; *** rom ds 05/01/85 ***
nop ; fill
; sta wpsw,x ; clear wp switch
; sta nodrv,x ; clear not active flag
rtch51 ; ret address

;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

; count the number of free blocks here
;
nfcalc
jsr setbpt

ldy #4
lda #0
tax ; 0 hi byte
numf1
clc
adc (bmpnt),y
bcc numf2
inx
numf2
iny
iny
iny
iny
cpy #$48 ; dont count the dir
beq numf2
cpy #$90
bne numf1
pha
txa
ldx drvnum
sta ndbh,x
pla

;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>

jmp ptch40 ; *** rom ds 02/26/85 ****
; sta ndbl,x
rts
;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>

; start double buffering
; use track,sector as starting block
strrd
jsr sethdr
jsr rdbuf
jsr watjob
jsr getbyt
sta track
jsr getbyt
sta sector
rts

strdbl
jsr strrd
lda track
bne str1
rts
str1
jsr dblbuf
jsr sethdr
jsr rdbuf
jmp dblbuf

; start a read job on track,sector

rdbuf lda #read
bne strtit

; start a write job on track,sector

wrtbuf lda #write
strtit sta cmd
jsr getact
tax
jsr setljb
txa
pha
asl a
tax
lda #0
sta buftab,x
jsr typfil
cmp #4
bcs wrtc1 ; not sequential type

inc nbkl,x
bne wrtc1
inc nbkh,x
wrtc1 pla
tax
rts


;****************************
;*
;* fndrch
;******************************
;*
;*
fndrch lda sa
cmp #maxsa+1
bcc fndc20
and #$f
fndc20
cmp #cmdsa
bne fndc25
lda #errsa
fndc25
tax
sec
lda lintab,x
bmi fndc30
and #$f
sta lindx
tax
clc
fndc30 rts
;*
;*
;*****************************
;*
;* fndwch
;*
;*****************************
;*
;*
fndwch lda sa
cmp #maxsa+1
bcc fndw13
and #$f
fndw13 tax
lda lintab,x
tay
asl a
bcc fndw15
bmi fndw20
fndw10 tya
and #$0f
sta lindx
tax
clc